From 76c07597f762b0ee4bfa8e2ba2cab2a731d15973 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 9 Dec 2024 11:22:57 +0800 Subject: [PATCH] inj proto inj libs --- .telescope.json | 6 +- git-modules/cometbft/cometbft/main | 2 +- git-modules/cosmos/cosmos-proto/main | 2 +- git-modules/cosmos/cosmos-sdk/main | 2 +- git-modules/cosmos/cosmos-sdk/release/v0.50.x | 2 +- git-modules/cosmos/gogoproto/main | 2 +- git-modules/cosmos/ibc-go/main | 2 +- git-modules/cosmos/ics23/master | 2 +- git-modules/cosmwasm/wasmd/main | 2 +- git-modules/googleapis/googleapis/master | 2 +- git-modules/injectivelabs/sdk-go/master | 2 +- git-modules/protocolbuffers/protobuf/main | 2 +- libs/injective-query/.eslintignore | 1 + libs/injective-query/CHANGELOG.md | 176 + libs/injective-query/README.md | 21 + libs/injective-query/jest.starship.config.js | 18 + libs/injective-query/package.json | 48 + libs/injective-query/src/amino/amino.ts | 1 + libs/injective-query/src/binary.ts | 534 + .../src/cosmos/auth/v1beta1/auth.ts | 550 + .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 113 + .../src/cosmos/auth/v1beta1/query.ts | 2034 +++ .../src/cosmos/authz/v1beta1/authz.ts | 477 + .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 31 + .../src/cosmos/authz/v1beta1/tx.ts | 647 + .../src/cosmos/bank/v1beta1/bank.ts | 974 ++ .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 146 + .../src/cosmos/bank/v1beta1/query.ts | 3027 ++++ .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 40 + .../src/cosmos/bank/v1beta1/tx.ts | 861 + .../src/cosmos/base/abci/v1beta1/abci.ts | 1698 ++ .../cosmos/base/query/v1beta1/pagination.ts | 361 + .../src/cosmos/base/v1beta1/coin.ts | 439 + .../src/cosmos/crypto/ed25519/keys.ts | 209 + .../crypto/multisig/v1beta1/multisig.ts | 225 + .../src/cosmos/crypto/secp256k1/keys.ts | 203 + .../src/cosmos/crypto/secp256r1/keys.ts | 201 + .../distribution/v1beta1/distribution.ts | 1494 ++ .../distribution/v1beta1/tx.rpc.func.ts | 67 + .../src/cosmos/distribution/v1beta1/tx.ts | 1478 ++ .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 31 + .../src/cosmos/feegrant/v1beta1/tx.ts | 596 + libs/injective-query/src/cosmos/gov/v1/gov.ts | 1843 +++ .../src/cosmos/gov/v1/tx.rpc.func.ts | 67 + libs/injective-query/src/cosmos/gov/v1/tx.ts | 1660 ++ .../src/cosmos/gov/v1beta1/gov.ts | 1428 ++ .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 91 + .../src/cosmos/gov/v1beta1/query.ts | 1749 ++ .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 40 + .../src/cosmos/gov/v1beta1/tx.ts | 884 + .../src/cosmos/group/v1/tx.rpc.func.ts | 130 + .../injective-query/src/cosmos/group/v1/tx.ts | 3207 ++++ .../src/cosmos/group/v1/types.ts | 2081 +++ .../src/cosmos/ics23/v1/proofs.ts | 2060 +++ libs/injective-query/src/cosmos/msg/v1/msg.ts | 1 + .../src/cosmos/query/v1/query.ts | 1 + .../cosmos/staking/v1beta1/query.rpc.func.ts | 157 + .../src/cosmos/staking/v1beta1/query.ts | 3073 ++++ .../src/cosmos/staking/v1beta1/staking.ts | 3005 ++++ .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 67 + .../src/cosmos/staking/v1beta1/tx.ts | 1638 ++ .../src/cosmos/tx/signing/v1beta1/signing.ts | 688 + .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 102 + .../src/cosmos/tx/v1beta1/service.ts | 2294 +++ .../src/cosmos/tx/v1beta1/tx.ts | 2029 +++ .../src/cosmos/upgrade/v1beta1/upgrade.ts | 591 + .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 31 + .../src/cosmos/vesting/v1beta1/tx.ts | 698 + .../src/cosmos/vesting/v1beta1/vesting.ts | 735 + .../src/cosmos_proto/cosmos.ts | 341 + .../src/cosmwasm/wasm/v1/proposal_legacy.ts | 2432 +++ .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 157 + .../src/cosmwasm/wasm/v1/query.ts | 3235 ++++ .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 157 + .../src/cosmwasm/wasm/v1/tx.ts | 4191 +++++ .../src/cosmwasm/wasm/v1/types.ts | 1120 ++ libs/injective-query/src/extern.ts | 38 + libs/injective-query/src/gogoproto/gogo.ts | 1 + .../src/google/api/annotations.ts | 1 + libs/injective-query/src/google/api/http.ts | 1069 ++ .../src/google/protobuf/any.ts | 331 + .../src/google/protobuf/descriptor.ts | 7177 ++++++++ .../src/google/protobuf/duration.ts | 225 + .../src/google/protobuf/timestamp.ts | 281 + libs/injective-query/src/helper-func-types.ts | 191 + libs/injective-query/src/helpers.ts | 259 + .../ibc/applications/transfer/v1/transfer.ts | 373 + .../applications/transfer/v1/tx.rpc.func.ts | 22 + .../src/ibc/applications/transfer/v1/tx.ts | 569 + .../src/ibc/core/channel/v1/channel.ts | 1510 ++ .../src/ibc/core/channel/v1/tx.rpc.func.ts | 175 + .../src/ibc/core/channel/v1/tx.ts | 4866 ++++++ .../src/ibc/core/channel/v1/upgrade.ts | 388 + .../src/ibc/core/client/v1/client.ts | 602 + .../src/ibc/core/client/v1/tx.rpc.func.ts | 67 + .../src/ibc/core/client/v1/tx.ts | 1560 ++ .../src/ibc/core/commitment/v1/commitment.ts | 314 + .../src/ibc/core/connection/v1/connection.ts | 1010 ++ .../src/ibc/core/connection/v1/tx.rpc.func.ts | 49 + .../src/ibc/core/connection/v1/tx.ts | 1393 ++ .../src/injective/auction/v1beta1/auction.ts | 692 + .../src/injective/auction/v1beta1/genesis.ts | 156 + .../auction/v1beta1/query.rpc.func.ts | 47 + .../src/injective/auction/v1beta1/query.ts | 726 + .../injective/auction/v1beta1/tx.rpc.func.ts | 22 + .../src/injective/auction/v1beta1/tx.ts | 383 + .../crypto/v1beta1/ethsecp256k1/keys.ts | 205 + .../src/injective/exchange/v1beta1/authz.ts | 1213 ++ .../src/injective/exchange/v1beta1/events.ts | 4016 +++++ .../injective/exchange/v1beta1/exchange.ts | 7789 +++++++++ .../src/injective/exchange/v1beta1/genesis.ts | 2460 +++ .../injective/exchange/v1beta1/proposal.ts | 4383 +++++ .../exchange/v1beta1/query.rpc.func.ts | 663 + .../src/injective/exchange/v1beta1/query.ts | 13590 ++++++++++++++++ .../injective/exchange/v1beta1/tx.rpc.func.ts | 319 + .../src/injective/exchange/v1beta1/tx.ts | 9492 +++++++++++ .../src/injective/insurance/v1beta1/events.ts | 521 + .../injective/insurance/v1beta1/genesis.ts | 178 + .../injective/insurance/v1beta1/insurance.ts | 531 + .../insurance/v1beta1/query.rpc.func.ts | 69 + .../src/injective/insurance/v1beta1/query.ts | 1095 ++ .../insurance/v1beta1/tx.rpc.func.ts | 40 + .../src/injective/insurance/v1beta1/tx.ts | 892 + .../src/injective/ocr/v1beta1/genesis.ts | 945 ++ .../src/injective/ocr/v1beta1/ocr.ts | 3044 ++++ .../injective/ocr/v1beta1/query.rpc.func.ts | 80 + .../src/injective/ocr/v1beta1/query.ts | 1218 ++ .../src/injective/ocr/v1beta1/tx.rpc.func.ts | 85 + .../src/injective/ocr/v1beta1/tx.ts | 1900 +++ .../src/injective/oracle/v1beta1/events.ts | 1234 ++ .../src/injective/oracle/v1beta1/genesis.ts | 440 + .../src/injective/oracle/v1beta1/oracle.ts | 3206 ++++ .../src/injective/oracle/v1beta1/proposal.ts | 1449 ++ .../oracle/v1beta1/query.rpc.func.ts | 190 + .../src/injective/oracle/v1beta1/query.ts | 3446 ++++ .../injective/oracle/v1beta1/tx.rpc.func.ts | 76 + .../src/injective/oracle/v1beta1/tx.ts | 1605 ++ .../src/injective/peggy/v1/attestation.ts | 333 + .../src/injective/peggy/v1/batch.ts | 290 + .../src/injective/peggy/v1/ethereum_signer.ts | 38 + .../src/injective/peggy/v1/events.ts | 2274 +++ .../src/injective/peggy/v1/genesis.ts | 308 + .../src/injective/peggy/v1/msgs.rpc.func.ts | 130 + .../src/injective/peggy/v1/msgs.ts | 3087 ++++ .../src/injective/peggy/v1/params.ts | 392 + .../src/injective/peggy/v1/pool.ts | 198 + .../src/injective/peggy/v1/proposal.ts | 231 + .../src/injective/peggy/v1/query.rpc.func.ts | 234 + .../src/injective/peggy/v1/query.ts | 3578 ++++ .../src/injective/peggy/v1/types.ts | 575 + .../injective/permissions/v1beta1/events.ts | 102 + .../injective/permissions/v1beta1/genesis.ts | 109 + .../injective/permissions/v1beta1/params.ts | 97 + .../permissions/v1beta1/permissions.ts | 709 + .../permissions/v1beta1/query.rpc.func.ts | 69 + .../injective/permissions/v1beta1/query.ts | 1084 ++ .../permissions/v1beta1/tx.rpc.func.ts | 67 + .../src/injective/permissions/v1beta1/tx.ts | 1682 ++ .../src/injective/stream/v1beta1/query.ts | 2870 ++++ .../tokenfactory/v1beta1/authorityMetadata.ts | 99 + .../injective/tokenfactory/v1beta1/events.ts | 495 + .../injective/tokenfactory/v1beta1/genesis.ts | 259 + .../injective/tokenfactory/v1beta1/params.ts | 100 + .../tokenfactory/v1beta1/query.rpc.func.ts | 47 + .../injective/tokenfactory/v1beta1/query.ts | 714 + .../tokenfactory/v1beta1/tx.rpc.func.ts | 58 + .../src/injective/tokenfactory/v1beta1/tx.ts | 1208 ++ .../src/injective/types/v1beta1/account.ts | 110 + .../src/injective/types/v1beta1/tx_ext.ts | 139 + .../injective/types/v1beta1/tx_response.ts | 197 + .../src/injective/wasmx/v1/events.ts | 396 + .../src/injective/wasmx/v1/genesis.ts | 214 + .../src/injective/wasmx/v1/proposal.ts | 769 + .../src/injective/wasmx/v1/query.rpc.func.ts | 36 + .../src/injective/wasmx/v1/query.ts | 509 + .../src/injective/wasmx/v1/tx.rpc.func.ts | 58 + .../src/injective/wasmx/v1/tx.ts | 1174 ++ .../src/injective/wasmx/v1/wasmx.ts | 379 + libs/injective-query/src/react-query.ts | 185 + libs/injective-query/src/registry.ts | 218 + .../src/tendermint/abci/types.ts | 6283 +++++++ .../src/tendermint/crypto/keys.ts | 103 + .../src/tendermint/crypto/proof.ts | 555 + .../src/tendermint/types/block.ts | 131 + .../src/tendermint/types/evidence.ts | 476 + .../src/tendermint/types/params.ts | 814 + .../src/tendermint/types/types.ts | 2157 +++ .../src/tendermint/types/validator.ts | 389 + .../src/tendermint/version/types.ts | 219 + libs/injective-query/src/types.ts | 155 + libs/injective-query/src/utf8.ts | 148 + libs/injective-query/src/varint.ts | 488 + libs/injective-query/tsconfig.esm.json | 9 + libs/injective-query/tsconfig.json | 9 + libs/injectivejs/.eslintignore | 1 + libs/injectivejs/CHANGELOG.md | 176 + libs/injectivejs/README.md | 21 + libs/injectivejs/jest.starship.config.js | 18 + libs/injectivejs/package.json | 48 + libs/injectivejs/src/amino/amino.ts | 1 + libs/injectivejs/src/binary.ts | 534 + .../src/cosmos/auth/v1beta1/auth.ts | 550 + .../src/cosmos/auth/v1beta1/query.rpc.func.ts | 72 + .../src/cosmos/auth/v1beta1/query.ts | 2034 +++ .../src/cosmos/authz/v1beta1/authz.ts | 477 + .../src/cosmos/authz/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/authz/v1beta1/tx.ts | 647 + .../src/cosmos/bank/v1beta1/bank.ts | 974 ++ .../src/cosmos/bank/v1beta1/query.rpc.func.ts | 93 + .../src/cosmos/bank/v1beta1/query.ts | 3027 ++++ .../src/cosmos/bank/v1beta1/tx.rpc.func.ts | 27 + .../injectivejs/src/cosmos/bank/v1beta1/tx.ts | 861 + .../src/cosmos/base/abci/v1beta1/abci.ts | 1698 ++ .../cosmos/base/query/v1beta1/pagination.ts | 361 + .../src/cosmos/base/v1beta1/coin.ts | 439 + .../src/cosmos/crypto/ed25519/keys.ts | 209 + .../crypto/multisig/v1beta1/multisig.ts | 225 + .../src/cosmos/crypto/secp256k1/keys.ts | 203 + .../src/cosmos/crypto/secp256r1/keys.ts | 201 + .../distribution/v1beta1/distribution.ts | 1494 ++ .../distribution/v1beta1/tx.rpc.func.ts | 45 + .../src/cosmos/distribution/v1beta1/tx.ts | 1478 ++ .../cosmos/feegrant/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/feegrant/v1beta1/tx.ts | 596 + libs/injectivejs/src/cosmos/gov/v1/gov.ts | 1843 +++ .../src/cosmos/gov/v1/tx.rpc.func.ts | 45 + libs/injectivejs/src/cosmos/gov/v1/tx.ts | 1660 ++ .../injectivejs/src/cosmos/gov/v1beta1/gov.ts | 1428 ++ .../src/cosmos/gov/v1beta1/query.rpc.func.ts | 58 + .../src/cosmos/gov/v1beta1/query.ts | 1749 ++ .../src/cosmos/gov/v1beta1/tx.rpc.func.ts | 27 + libs/injectivejs/src/cosmos/gov/v1beta1/tx.ts | 884 + .../src/cosmos/group/v1/tx.rpc.func.ts | 87 + libs/injectivejs/src/cosmos/group/v1/tx.ts | 3207 ++++ libs/injectivejs/src/cosmos/group/v1/types.ts | 2081 +++ .../injectivejs/src/cosmos/ics23/v1/proofs.ts | 2060 +++ libs/injectivejs/src/cosmos/msg/v1/msg.ts | 1 + libs/injectivejs/src/cosmos/query/v1/query.ts | 1 + .../cosmos/staking/v1beta1/query.rpc.func.ts | 100 + .../src/cosmos/staking/v1beta1/query.ts | 3073 ++++ .../src/cosmos/staking/v1beta1/staking.ts | 3005 ++++ .../src/cosmos/staking/v1beta1/tx.rpc.func.ts | 45 + .../src/cosmos/staking/v1beta1/tx.ts | 1638 ++ .../src/cosmos/tx/signing/v1beta1/signing.ts | 688 + .../src/cosmos/tx/v1beta1/service.rpc.func.ts | 65 + .../src/cosmos/tx/v1beta1/service.ts | 2294 +++ libs/injectivejs/src/cosmos/tx/v1beta1/tx.ts | 2029 +++ .../src/cosmos/upgrade/v1beta1/upgrade.ts | 591 + .../src/cosmos/vesting/v1beta1/tx.rpc.func.ts | 21 + .../src/cosmos/vesting/v1beta1/tx.ts | 698 + .../src/cosmos/vesting/v1beta1/vesting.ts | 735 + libs/injectivejs/src/cosmos_proto/cosmos.ts | 341 + .../src/cosmwasm/wasm/v1/proposal_legacy.ts | 2432 +++ .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 100 + .../injectivejs/src/cosmwasm/wasm/v1/query.ts | 3235 ++++ .../src/cosmwasm/wasm/v1/tx.rpc.func.ts | 105 + libs/injectivejs/src/cosmwasm/wasm/v1/tx.ts | 4191 +++++ .../injectivejs/src/cosmwasm/wasm/v1/types.ts | 1120 ++ libs/injectivejs/src/extern.ts | 38 + libs/injectivejs/src/gogoproto/gogo.ts | 1 + .../injectivejs/src/google/api/annotations.ts | 1 + libs/injectivejs/src/google/api/http.ts | 1069 ++ libs/injectivejs/src/google/protobuf/any.ts | 331 + .../src/google/protobuf/descriptor.ts | 7177 ++++++++ .../src/google/protobuf/duration.ts | 225 + .../src/google/protobuf/timestamp.ts | 281 + libs/injectivejs/src/helper-func-types.ts | 191 + libs/injectivejs/src/helpers.ts | 259 + .../ibc/applications/transfer/v1/transfer.ts | 373 + .../applications/transfer/v1/tx.rpc.func.ts | 15 + .../src/ibc/applications/transfer/v1/tx.ts | 569 + .../src/ibc/core/channel/v1/channel.ts | 1510 ++ .../src/ibc/core/channel/v1/tx.rpc.func.ts | 117 + .../injectivejs/src/ibc/core/channel/v1/tx.ts | 4866 ++++++ .../src/ibc/core/channel/v1/upgrade.ts | 388 + .../src/ibc/core/client/v1/client.ts | 602 + .../src/ibc/core/client/v1/tx.rpc.func.ts | 45 + libs/injectivejs/src/ibc/core/client/v1/tx.ts | 1560 ++ .../src/ibc/core/commitment/v1/commitment.ts | 314 + .../src/ibc/core/connection/v1/connection.ts | 1010 ++ .../src/ibc/core/connection/v1/tx.rpc.func.ts | 33 + .../src/ibc/core/connection/v1/tx.ts | 1393 ++ .../src/injective/auction/v1beta1/auction.ts | 692 + .../src/injective/auction/v1beta1/genesis.ts | 156 + .../auction/v1beta1/query.rpc.func.ts | 30 + .../src/injective/auction/v1beta1/query.ts | 726 + .../injective/auction/v1beta1/tx.rpc.func.ts | 15 + .../src/injective/auction/v1beta1/tx.ts | 383 + .../crypto/v1beta1/ethsecp256k1/keys.ts | 205 + .../src/injective/exchange/v1beta1/authz.ts | 1213 ++ .../src/injective/exchange/v1beta1/events.ts | 4016 +++++ .../injective/exchange/v1beta1/exchange.ts | 7789 +++++++++ .../src/injective/exchange/v1beta1/genesis.ts | 2460 +++ .../injective/exchange/v1beta1/proposal.ts | 4383 +++++ .../exchange/v1beta1/query.rpc.func.ts | 422 + .../src/injective/exchange/v1beta1/query.ts | 13590 ++++++++++++++++ .../injective/exchange/v1beta1/tx.rpc.func.ts | 213 + .../src/injective/exchange/v1beta1/tx.ts | 9492 +++++++++++ .../src/injective/insurance/v1beta1/events.ts | 521 + .../injective/insurance/v1beta1/genesis.ts | 178 + .../injective/insurance/v1beta1/insurance.ts | 531 + .../insurance/v1beta1/query.rpc.func.ts | 44 + .../src/injective/insurance/v1beta1/query.ts | 1095 ++ .../insurance/v1beta1/tx.rpc.func.ts | 27 + .../src/injective/insurance/v1beta1/tx.ts | 892 + .../src/injective/ocr/v1beta1/genesis.ts | 945 ++ .../src/injective/ocr/v1beta1/ocr.ts | 3044 ++++ .../injective/ocr/v1beta1/query.rpc.func.ts | 51 + .../src/injective/ocr/v1beta1/query.ts | 1218 ++ .../src/injective/ocr/v1beta1/tx.rpc.func.ts | 57 + .../src/injective/ocr/v1beta1/tx.ts | 1900 +++ .../src/injective/oracle/v1beta1/events.ts | 1234 ++ .../src/injective/oracle/v1beta1/genesis.ts | 440 + .../src/injective/oracle/v1beta1/oracle.ts | 3206 ++++ .../src/injective/oracle/v1beta1/proposal.ts | 1449 ++ .../oracle/v1beta1/query.rpc.func.ts | 121 + .../src/injective/oracle/v1beta1/query.ts | 3446 ++++ .../injective/oracle/v1beta1/tx.rpc.func.ts | 51 + .../src/injective/oracle/v1beta1/tx.ts | 1605 ++ .../src/injective/peggy/v1/attestation.ts | 333 + .../src/injective/peggy/v1/batch.ts | 290 + .../src/injective/peggy/v1/ethereum_signer.ts | 38 + .../src/injective/peggy/v1/events.ts | 2274 +++ .../src/injective/peggy/v1/genesis.ts | 308 + .../src/injective/peggy/v1/msgs.rpc.func.ts | 87 + .../src/injective/peggy/v1/msgs.ts | 3087 ++++ .../src/injective/peggy/v1/params.ts | 392 + .../src/injective/peggy/v1/pool.ts | 198 + .../src/injective/peggy/v1/proposal.ts | 231 + .../src/injective/peggy/v1/query.rpc.func.ts | 149 + .../src/injective/peggy/v1/query.ts | 3578 ++++ .../src/injective/peggy/v1/types.ts | 575 + .../injective/permissions/v1beta1/events.ts | 102 + .../injective/permissions/v1beta1/genesis.ts | 109 + .../injective/permissions/v1beta1/params.ts | 97 + .../permissions/v1beta1/permissions.ts | 709 + .../permissions/v1beta1/query.rpc.func.ts | 44 + .../injective/permissions/v1beta1/query.ts | 1084 ++ .../permissions/v1beta1/tx.rpc.func.ts | 45 + .../src/injective/permissions/v1beta1/tx.ts | 1682 ++ .../src/injective/stream/v1beta1/query.ts | 2870 ++++ .../tokenfactory/v1beta1/authorityMetadata.ts | 99 + .../injective/tokenfactory/v1beta1/events.ts | 495 + .../injective/tokenfactory/v1beta1/genesis.ts | 259 + .../injective/tokenfactory/v1beta1/params.ts | 100 + .../tokenfactory/v1beta1/query.rpc.func.ts | 30 + .../injective/tokenfactory/v1beta1/query.ts | 714 + .../tokenfactory/v1beta1/tx.rpc.func.ts | 39 + .../src/injective/tokenfactory/v1beta1/tx.ts | 1208 ++ .../src/injective/types/v1beta1/account.ts | 110 + .../src/injective/types/v1beta1/tx_ext.ts | 139 + .../injective/types/v1beta1/tx_response.ts | 197 + .../src/injective/wasmx/v1/events.ts | 396 + .../src/injective/wasmx/v1/genesis.ts | 214 + .../src/injective/wasmx/v1/proposal.ts | 769 + .../src/injective/wasmx/v1/query.rpc.func.ts | 23 + .../src/injective/wasmx/v1/query.ts | 509 + .../src/injective/wasmx/v1/tx.rpc.func.ts | 39 + libs/injectivejs/src/injective/wasmx/v1/tx.ts | 1174 ++ .../src/injective/wasmx/v1/wasmx.ts | 379 + libs/injectivejs/src/registry.ts | 218 + libs/injectivejs/src/tendermint/abci/types.ts | 6283 +++++++ .../injectivejs/src/tendermint/crypto/keys.ts | 103 + .../src/tendermint/crypto/proof.ts | 555 + .../injectivejs/src/tendermint/types/block.ts | 131 + .../src/tendermint/types/evidence.ts | 476 + .../src/tendermint/types/params.ts | 814 + .../injectivejs/src/tendermint/types/types.ts | 2157 +++ .../src/tendermint/types/validator.ts | 389 + .../src/tendermint/version/types.ts | 219 + libs/injectivejs/src/types.ts | 155 + libs/injectivejs/src/utf8.ts | 148 + libs/injectivejs/src/varint.ts | 488 + libs/injectivejs/tsconfig.esm.json | 9 + libs/injectivejs/tsconfig.json | 9 + libs/interchain-query/package.json | 7 - libs/interchainjs/src/binary.ts | 2 +- .../src/cosmos/auth/v1beta1/query.ts | 13 +- libs/interchainjs/src/cosmos/gov/v1/tx.ts | 5 +- .../src/cosmos/gov/v1beta1/gov.ts | 5 +- .../interchainjs/src/cosmos/gov/v1beta1/tx.ts | 5 +- .../src/cosmos/ics23/v1/proofs.ts | 12 +- .../src/cosmwasm/wasm/v1/query.rpc.func.ts | 16 +- .../src/cosmwasm/wasm/v1/query.ts | 425 +- libs/interchainjs/src/cosmwasm/wasm/v1/tx.ts | 8 +- libs/interchainjs/src/extern.ts | 2 +- libs/interchainjs/src/google/api/http.ts | 96 +- .../src/google/protobuf/descriptor.ts | 169 +- libs/interchainjs/src/helper-func-types.ts | 2 +- libs/interchainjs/src/helpers.ts | 2 +- .../ibc/applications/transfer/v1/transfer.ts | 238 +- .../src/ibc/applications/transfer/v1/tx.ts | 19 +- .../src/ibc/core/channel/v1/tx.ts | 4 +- .../src/ibc/core/client/v1/client.ts | 343 +- .../interchainjs/src/ibc/core/client/v1/tx.ts | 35 +- .../src/ibc/core/commitment/v1/commitment.ts | 104 - .../src/ibc/core/connection/v1/tx.ts | 52 +- libs/interchainjs/src/registry.ts | 2 +- libs/interchainjs/src/types.ts | 2 +- libs/interchainjs/src/utf8.ts | 2 +- libs/interchainjs/src/varint.ts | 2 +- package.json | 8 +- .../applications/transfer/v1/transfer.proto | 18 - protos/ibc/core/client/v1/client.proto | 113 - protos/{ => injectivejs}/amino/amino.proto | 0 .../cosmos/auth/v1beta1/auth.proto | 0 .../cosmos/auth/v1beta1/query.proto | 0 .../cosmos/authz/v1beta1/authz.proto | 0 .../cosmos/authz/v1beta1/tx.proto | 0 .../cosmos/bank/v1beta1/bank.proto | 0 .../cosmos/bank/v1beta1/query.proto | 0 .../cosmos/bank/v1beta1/tx.proto | 0 .../cosmos/base/abci/v1beta1/abci.proto | 0 .../base/query/v1beta1/pagination.proto | 0 .../cosmos/base/v1beta1/coin.proto | 0 .../cosmos/crypto/ed25519/keys.proto | 0 .../crypto/multisig/v1beta1/multisig.proto | 0 .../cosmos/crypto/secp256k1/keys.proto | 0 .../cosmos/crypto/secp256r1/keys.proto | 0 .../distribution/v1beta1/distribution.proto | 0 .../cosmos/distribution/v1beta1/tx.proto | 0 .../cosmos/feegrant/v1beta1/tx.proto | 0 .../{ => injectivejs}/cosmos/gov/v1/gov.proto | 0 .../{ => injectivejs}/cosmos/gov/v1/tx.proto | 0 .../cosmos/gov/v1beta1/gov.proto | 0 .../cosmos/gov/v1beta1/query.proto | 0 .../cosmos/gov/v1beta1/tx.proto | 0 .../cosmos/group/v1/tx.proto | 0 .../cosmos/group/v1/types.proto | 0 .../cosmos/ics23/v1/proofs.proto | 4 +- .../{ => injectivejs}/cosmos/msg/v1/msg.proto | 0 .../cosmos/query/v1/query.proto | 0 .../cosmos/staking/v1beta1/query.proto | 4 +- .../cosmos/staking/v1beta1/staking.proto | 0 .../cosmos/staking/v1beta1/tx.proto | 0 .../cosmos/tx/signing/v1beta1/signing.proto | 0 .../cosmos/tx/v1beta1/service.proto | 0 .../cosmos/tx/v1beta1/tx.proto | 0 .../cosmos/upgrade/v1beta1/upgrade.proto | 0 .../cosmos/vesting/v1beta1/tx.proto | 0 .../cosmos/vesting/v1beta1/vesting.proto | 0 .../cosmos_proto/cosmos.proto | 0 .../cosmwasm/wasm/v1/proposal_legacy.proto | 355 + .../cosmwasm/wasm/v1/query.proto | 59 +- .../cosmwasm/wasm/v1/tx.proto | 6 +- .../cosmwasm/wasm/v1/types.proto | 0 protos/{ => injectivejs}/gogoproto/gogo.proto | 0 .../google/api/annotations.proto | 0 .../{ => injectivejs}/google/api/http.proto | 48 +- .../google/protobuf/any.proto | 0 .../google/protobuf/descriptor.proto | 107 +- .../google/protobuf/duration.proto | 0 .../google/protobuf/timestamp.proto | 0 .../applications/transfer/v1/transfer.proto | 38 + .../ibc/applications/transfer/v1/tx.proto | 6 +- .../ibc/core/channel/v1/channel.proto | 2 +- .../ibc/core/channel/v1/tx.proto | 4 +- .../ibc/core/channel/v1/upgrade.proto | 2 +- .../ibc/core/client/v1/client.proto | 66 + .../ibc/core/client/v1/tx.proto | 8 +- .../ibc/core/commitment/v1/commitment.proto | 9 +- .../ibc/core/connection/v1/connection.proto | 2 +- .../ibc/core/connection/v1/tx.proto | 58 +- .../injective/auction/v1beta1/auction.proto | 82 + .../injective/auction/v1beta1/genesis.proto | 25 + .../injective/auction/v1beta1/query.proto | 86 + .../injective/auction/v1beta1/tx.proto | 53 + .../crypto/v1beta1/ethsecp256k1/keys.proto | 38 + .../injective/exchange/v1beta1/authz.proto | 88 + .../injective/exchange/v1beta1/events.proto | 240 + .../injective/exchange/v1beta1/exchange.proto | 984 ++ .../injective/exchange/v1beta1/genesis.proto | 256 + .../injective/exchange/v1beta1/proposal.proto | 653 + .../injective/exchange/v1beta1/query.proto | 1450 ++ .../injective/exchange/v1beta1/tx.proto | 1154 ++ .../injective/insurance/v1beta1/events.proto | 36 + .../injective/insurance/v1beta1/genesis.proto | 29 + .../insurance/v1beta1/insurance.proto | 84 + .../injective/insurance/v1beta1/query.proto | 120 + .../injective/insurance/v1beta1/tx.proto | 117 + .../injective/ocr/v1beta1/genesis.proto | 75 + .../injective/ocr/v1beta1/ocr.proto | 334 + .../injective/ocr/v1beta1/query.proto | 101 + .../injective/ocr/v1beta1/tx.proto | 211 + .../injective/oracle/v1beta1/events.proto | 89 + .../injective/oracle/v1beta1/genesis.proto | 50 + .../injective/oracle/v1beta1/oracle.proto | 299 + .../injective/oracle/v1beta1/proposal.proto | 152 + .../injective/oracle/v1beta1/query.proto | 323 + .../injective/oracle/v1beta1/tx.proto | 175 + .../injective/peggy/v1/attestation.proto | 62 + .../injective/peggy/v1/batch.proto | 25 + .../injective/peggy/v1/ethereum_signer.proto | 14 + .../injective/peggy/v1/events.proto | 148 + .../injective/peggy/v1/genesis.proto | 31 + .../injectivejs/injective/peggy/v1/msgs.proto | 336 + .../injective/peggy/v1/params.proto | 136 + .../injectivejs/injective/peggy/v1/pool.proto | 17 + .../injective/peggy/v1/proposal.proto | 29 + .../injective/peggy/v1/query.proto | 218 + .../injective/peggy/v1/types.proto | 48 + .../permissions/v1beta1/events.proto | 13 + .../permissions/v1beta1/genesis.proto | 15 + .../permissions/v1beta1/params.proto | 17 + .../permissions/v1beta1/permissions.proto | 56 + .../injective/permissions/v1beta1/query.proto | 118 + .../injective/permissions/v1beta1/tx.proto | 127 + .../injective/stream/v1beta1/query.proto | 205 + .../v1beta1/authorityMetadata.proto | 17 + .../tokenfactory/v1beta1/events.proto | 34 + .../tokenfactory/v1beta1/genesis.proto | 35 + .../tokenfactory/v1beta1/params.proto | 21 + .../tokenfactory/v1beta1/query.proto | 88 + .../injective/tokenfactory/v1beta1/tx.proto | 148 + .../injective/types/v1beta1/account.proto | 3 +- .../injective/types/v1beta1/tx_ext.proto | 22 + .../injective/types/v1beta1/tx_response.proto | 14 + .../injective/wasmx/v1/events.proto | 28 + .../injective/wasmx/v1/genesis.proto | 24 + .../injective/wasmx/v1/proposal.proto | 97 + .../injective/wasmx/v1/query.proto | 55 + .../injectivejs/injective/wasmx/v1/tx.proto | 117 + .../injective/wasmx/v1/wasmx.proto | 63 + .../tendermint/abci/types.proto | 0 .../tendermint/crypto/keys.proto | 0 .../tendermint/crypto/proof.proto | 0 .../tendermint/types/block.proto | 0 .../tendermint/types/evidence.proto | 0 .../tendermint/types/params.proto | 0 .../tendermint/types/types.proto | 0 .../tendermint/types/validator.proto | 0 .../tendermint/version/types.proto | 0 protos/interchainjs/amino/amino.proto | 84 + .../cosmos/auth/v1beta1/auth.proto | 63 + .../cosmos/auth/v1beta1/query.proto | 236 + .../cosmos/authz/v1beta1/authz.proto | 48 + .../cosmos/authz/v1beta1/tx.proto | 81 + .../cosmos/bank/v1beta1/bank.proto | 125 + .../cosmos/bank/v1beta1/query.proto | 408 + .../interchainjs/cosmos/bank/v1beta1/tx.proto | 124 + .../cosmos/base/abci/v1beta1/abci.proto | 177 + .../base/query/v1beta1/pagination.proto | 56 + .../cosmos/base/v1beta1/coin.proto | 61 + .../cosmos/crypto/ed25519/keys.proto | 39 + .../crypto/multisig/v1beta1/multisig.proto | 25 + .../cosmos/crypto/secp256k1/keys.proto | 38 + .../cosmos/crypto/secp256r1/keys.proto | 23 + .../distribution/v1beta1/distribution.proto | 194 + .../cosmos/distribution/v1beta1/tx.proto | 215 + .../cosmos/feegrant/v1beta1/tx.proto | 77 + protos/interchainjs/cosmos/gov/v1/gov.proto | 271 + protos/interchainjs/cosmos/gov/v1/tx.proto | 213 + .../interchainjs/cosmos/gov/v1beta1/gov.proto | 254 + .../cosmos/gov/v1beta1/query.proto | 194 + .../interchainjs/cosmos/gov/v1beta1/tx.proto | 134 + protos/interchainjs/cosmos/group/v1/tx.proto | 394 + .../interchainjs/cosmos/group/v1/types.proto | 339 + .../interchainjs/cosmos/ics23/v1/proofs.proto | 243 + protos/interchainjs/cosmos/msg/v1/msg.proto | 30 + .../interchainjs/cosmos/query/v1/query.proto | 35 + .../cosmos/staking/v1beta1/query.proto | 387 + .../cosmos/staking/v1beta1/staking.proto | 394 + .../cosmos/staking/v1beta1/tx.proto | 206 + .../cosmos/tx/signing/v1beta1/signing.proto | 107 + .../cosmos/tx/v1beta1/service.proto | 292 + .../interchainjs/cosmos/tx/v1beta1/tx.proto | 260 + .../cosmos/upgrade/v1beta1/upgrade.proto | 94 + .../cosmos/vesting/v1beta1/tx.proto | 102 + .../cosmos/vesting/v1beta1/vesting.proto | 94 + protos/interchainjs/cosmos_proto/cosmos.proto | 112 + .../interchainjs/cosmwasm/wasm/v1/query.proto | 355 + protos/interchainjs/cosmwasm/wasm/v1/tx.proto | 521 + .../interchainjs/cosmwasm/wasm/v1/types.proto | 150 + protos/interchainjs/gogoproto/gogo.proto | 144 + .../interchainjs/google/api/annotations.proto | 31 + protos/interchainjs/google/api/http.proto | 371 + protos/interchainjs/google/protobuf/any.proto | 162 + .../google/protobuf/descriptor.proto | 1337 ++ .../google/protobuf/duration.proto | 115 + .../google/protobuf/timestamp.proto | 144 + .../applications/transfer/v1/transfer.proto | 38 + .../ibc/applications/transfer/v1/tx.proto | 83 + .../ibc/core/channel/v1/channel.proto | 187 + .../interchainjs/ibc/core/channel/v1/tx.proto | 469 + .../ibc/core/channel/v1/upgrade.proto | 43 + .../ibc/core/client/v1/client.proto | 66 + .../interchainjs/ibc/core/client/v1/tx.proto | 179 + .../ibc/core/commitment/v1/commitment.proto | 32 + .../ibc/core/connection/v1/connection.proto | 114 + .../ibc/core/connection/v1/tx.proto | 150 + .../injective/types/v1beta1/account.proto | 24 + .../interchainjs/tendermint/abci/types.proto | 486 + .../interchainjs/tendermint/crypto/keys.proto | 17 + .../tendermint/crypto/proof.proto | 41 + .../interchainjs/tendermint/types/block.proto | 15 + .../tendermint/types/evidence.proto | 38 + .../tendermint/types/params.proto | 91 + .../interchainjs/tendermint/types/types.proto | 172 + .../tendermint/types/validator.proto | 37 + .../tendermint/version/types.proto | 24 + scripts/.injective.protod.config.json | 44 + scripts/.protod.config.json | 2 +- scripts/inj-query.telescope.json | 77 + scripts/inj.telescope.json | 77 + scripts/interchain-query.telescope.json | 2 +- scripts/interchainjs.telescope.json | 2 +- yarn.lock | 58 +- 607 files changed, 396488 insertions(+), 879 deletions(-) create mode 100644 libs/injective-query/.eslintignore create mode 100644 libs/injective-query/CHANGELOG.md create mode 100644 libs/injective-query/README.md create mode 100644 libs/injective-query/jest.starship.config.js create mode 100644 libs/injective-query/package.json create mode 100644 libs/injective-query/src/amino/amino.ts create mode 100644 libs/injective-query/src/binary.ts create mode 100644 libs/injective-query/src/cosmos/auth/v1beta1/auth.ts create mode 100644 libs/injective-query/src/cosmos/auth/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/auth/v1beta1/query.ts create mode 100644 libs/injective-query/src/cosmos/authz/v1beta1/authz.ts create mode 100644 libs/injective-query/src/cosmos/authz/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/authz/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/bank/v1beta1/bank.ts create mode 100644 libs/injective-query/src/cosmos/bank/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/bank/v1beta1/query.ts create mode 100644 libs/injective-query/src/cosmos/bank/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/bank/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/base/abci/v1beta1/abci.ts create mode 100644 libs/injective-query/src/cosmos/base/query/v1beta1/pagination.ts create mode 100644 libs/injective-query/src/cosmos/base/v1beta1/coin.ts create mode 100644 libs/injective-query/src/cosmos/crypto/ed25519/keys.ts create mode 100644 libs/injective-query/src/cosmos/crypto/multisig/v1beta1/multisig.ts create mode 100644 libs/injective-query/src/cosmos/crypto/secp256k1/keys.ts create mode 100644 libs/injective-query/src/cosmos/crypto/secp256r1/keys.ts create mode 100644 libs/injective-query/src/cosmos/distribution/v1beta1/distribution.ts create mode 100644 libs/injective-query/src/cosmos/distribution/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/distribution/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/feegrant/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1/gov.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1/tx.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1beta1/gov.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1beta1/query.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/gov/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/group/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/group/v1/tx.ts create mode 100644 libs/injective-query/src/cosmos/group/v1/types.ts create mode 100644 libs/injective-query/src/cosmos/ics23/v1/proofs.ts create mode 100644 libs/injective-query/src/cosmos/msg/v1/msg.ts create mode 100644 libs/injective-query/src/cosmos/query/v1/query.ts create mode 100644 libs/injective-query/src/cosmos/staking/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/staking/v1beta1/query.ts create mode 100644 libs/injective-query/src/cosmos/staking/v1beta1/staking.ts create mode 100644 libs/injective-query/src/cosmos/staking/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/staking/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/tx/signing/v1beta1/signing.ts create mode 100644 libs/injective-query/src/cosmos/tx/v1beta1/service.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/tx/v1beta1/service.ts create mode 100644 libs/injective-query/src/cosmos/tx/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/upgrade/v1beta1/upgrade.ts create mode 100644 libs/injective-query/src/cosmos/vesting/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmos/vesting/v1beta1/tx.ts create mode 100644 libs/injective-query/src/cosmos/vesting/v1beta1/vesting.ts create mode 100644 libs/injective-query/src/cosmos_proto/cosmos.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/proposal_legacy.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/query.rpc.func.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/query.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/tx.ts create mode 100644 libs/injective-query/src/cosmwasm/wasm/v1/types.ts create mode 100644 libs/injective-query/src/extern.ts create mode 100644 libs/injective-query/src/gogoproto/gogo.ts create mode 100644 libs/injective-query/src/google/api/annotations.ts create mode 100644 libs/injective-query/src/google/api/http.ts create mode 100644 libs/injective-query/src/google/protobuf/any.ts create mode 100644 libs/injective-query/src/google/protobuf/descriptor.ts create mode 100644 libs/injective-query/src/google/protobuf/duration.ts create mode 100644 libs/injective-query/src/google/protobuf/timestamp.ts create mode 100644 libs/injective-query/src/helper-func-types.ts create mode 100644 libs/injective-query/src/helpers.ts create mode 100644 libs/injective-query/src/ibc/applications/transfer/v1/transfer.ts create mode 100644 libs/injective-query/src/ibc/applications/transfer/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/ibc/applications/transfer/v1/tx.ts create mode 100644 libs/injective-query/src/ibc/core/channel/v1/channel.ts create mode 100644 libs/injective-query/src/ibc/core/channel/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/ibc/core/channel/v1/tx.ts create mode 100644 libs/injective-query/src/ibc/core/channel/v1/upgrade.ts create mode 100644 libs/injective-query/src/ibc/core/client/v1/client.ts create mode 100644 libs/injective-query/src/ibc/core/client/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/ibc/core/client/v1/tx.ts create mode 100644 libs/injective-query/src/ibc/core/commitment/v1/commitment.ts create mode 100644 libs/injective-query/src/ibc/core/connection/v1/connection.ts create mode 100644 libs/injective-query/src/ibc/core/connection/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/ibc/core/connection/v1/tx.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/auction.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/auction/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/authz.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/events.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/exchange.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/proposal.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/exchange/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/events.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/insurance.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/insurance/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/ocr.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/ocr/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/events.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/oracle.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/proposal.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/oracle/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/attestation.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/batch.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/ethereum_signer.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/events.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/genesis.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/msgs.rpc.func.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/msgs.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/params.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/pool.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/proposal.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/query.ts create mode 100644 libs/injective-query/src/injective/peggy/v1/types.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/events.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/params.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/permissions.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/permissions/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/stream/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/authorityMetadata.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/events.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/genesis.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/params.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/query.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/tokenfactory/v1beta1/tx.ts create mode 100644 libs/injective-query/src/injective/types/v1beta1/account.ts create mode 100644 libs/injective-query/src/injective/types/v1beta1/tx_ext.ts create mode 100644 libs/injective-query/src/injective/types/v1beta1/tx_response.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/events.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/genesis.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/proposal.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/query.rpc.func.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/query.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/tx.rpc.func.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/tx.ts create mode 100644 libs/injective-query/src/injective/wasmx/v1/wasmx.ts create mode 100644 libs/injective-query/src/react-query.ts create mode 100644 libs/injective-query/src/registry.ts create mode 100644 libs/injective-query/src/tendermint/abci/types.ts create mode 100644 libs/injective-query/src/tendermint/crypto/keys.ts create mode 100644 libs/injective-query/src/tendermint/crypto/proof.ts create mode 100644 libs/injective-query/src/tendermint/types/block.ts create mode 100644 libs/injective-query/src/tendermint/types/evidence.ts create mode 100644 libs/injective-query/src/tendermint/types/params.ts create mode 100644 libs/injective-query/src/tendermint/types/types.ts create mode 100644 libs/injective-query/src/tendermint/types/validator.ts create mode 100644 libs/injective-query/src/tendermint/version/types.ts create mode 100644 libs/injective-query/src/types.ts create mode 100644 libs/injective-query/src/utf8.ts create mode 100644 libs/injective-query/src/varint.ts create mode 100644 libs/injective-query/tsconfig.esm.json create mode 100644 libs/injective-query/tsconfig.json create mode 100644 libs/injectivejs/.eslintignore create mode 100644 libs/injectivejs/CHANGELOG.md create mode 100644 libs/injectivejs/README.md create mode 100644 libs/injectivejs/jest.starship.config.js create mode 100644 libs/injectivejs/package.json create mode 100644 libs/injectivejs/src/amino/amino.ts create mode 100644 libs/injectivejs/src/binary.ts create mode 100644 libs/injectivejs/src/cosmos/auth/v1beta1/auth.ts create mode 100644 libs/injectivejs/src/cosmos/auth/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/auth/v1beta1/query.ts create mode 100644 libs/injectivejs/src/cosmos/authz/v1beta1/authz.ts create mode 100644 libs/injectivejs/src/cosmos/authz/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/authz/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/bank/v1beta1/bank.ts create mode 100644 libs/injectivejs/src/cosmos/bank/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/bank/v1beta1/query.ts create mode 100644 libs/injectivejs/src/cosmos/bank/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/bank/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/base/abci/v1beta1/abci.ts create mode 100644 libs/injectivejs/src/cosmos/base/query/v1beta1/pagination.ts create mode 100644 libs/injectivejs/src/cosmos/base/v1beta1/coin.ts create mode 100644 libs/injectivejs/src/cosmos/crypto/ed25519/keys.ts create mode 100644 libs/injectivejs/src/cosmos/crypto/multisig/v1beta1/multisig.ts create mode 100644 libs/injectivejs/src/cosmos/crypto/secp256k1/keys.ts create mode 100644 libs/injectivejs/src/cosmos/crypto/secp256r1/keys.ts create mode 100644 libs/injectivejs/src/cosmos/distribution/v1beta1/distribution.ts create mode 100644 libs/injectivejs/src/cosmos/distribution/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/distribution/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1/gov.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1beta1/gov.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1beta1/query.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/gov/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/group/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/group/v1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/group/v1/types.ts create mode 100644 libs/injectivejs/src/cosmos/ics23/v1/proofs.ts create mode 100644 libs/injectivejs/src/cosmos/msg/v1/msg.ts create mode 100644 libs/injectivejs/src/cosmos/query/v1/query.ts create mode 100644 libs/injectivejs/src/cosmos/staking/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/staking/v1beta1/query.ts create mode 100644 libs/injectivejs/src/cosmos/staking/v1beta1/staking.ts create mode 100644 libs/injectivejs/src/cosmos/staking/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/staking/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/tx/signing/v1beta1/signing.ts create mode 100644 libs/injectivejs/src/cosmos/tx/v1beta1/service.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/tx/v1beta1/service.ts create mode 100644 libs/injectivejs/src/cosmos/tx/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/upgrade/v1beta1/upgrade.ts create mode 100644 libs/injectivejs/src/cosmos/vesting/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmos/vesting/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/cosmos/vesting/v1beta1/vesting.ts create mode 100644 libs/injectivejs/src/cosmos_proto/cosmos.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/proposal_legacy.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/query.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/tx.ts create mode 100644 libs/injectivejs/src/cosmwasm/wasm/v1/types.ts create mode 100644 libs/injectivejs/src/extern.ts create mode 100644 libs/injectivejs/src/gogoproto/gogo.ts create mode 100644 libs/injectivejs/src/google/api/annotations.ts create mode 100644 libs/injectivejs/src/google/api/http.ts create mode 100644 libs/injectivejs/src/google/protobuf/any.ts create mode 100644 libs/injectivejs/src/google/protobuf/descriptor.ts create mode 100644 libs/injectivejs/src/google/protobuf/duration.ts create mode 100644 libs/injectivejs/src/google/protobuf/timestamp.ts create mode 100644 libs/injectivejs/src/helper-func-types.ts create mode 100644 libs/injectivejs/src/helpers.ts create mode 100644 libs/injectivejs/src/ibc/applications/transfer/v1/transfer.ts create mode 100644 libs/injectivejs/src/ibc/applications/transfer/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/ibc/applications/transfer/v1/tx.ts create mode 100644 libs/injectivejs/src/ibc/core/channel/v1/channel.ts create mode 100644 libs/injectivejs/src/ibc/core/channel/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/ibc/core/channel/v1/tx.ts create mode 100644 libs/injectivejs/src/ibc/core/channel/v1/upgrade.ts create mode 100644 libs/injectivejs/src/ibc/core/client/v1/client.ts create mode 100644 libs/injectivejs/src/ibc/core/client/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/ibc/core/client/v1/tx.ts create mode 100644 libs/injectivejs/src/ibc/core/commitment/v1/commitment.ts create mode 100644 libs/injectivejs/src/ibc/core/connection/v1/connection.ts create mode 100644 libs/injectivejs/src/ibc/core/connection/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/ibc/core/connection/v1/tx.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/auction.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/auction/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/authz.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/events.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/exchange.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/proposal.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/exchange/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/events.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/insurance.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/insurance/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/ocr.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/ocr/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/events.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/oracle.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/proposal.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/oracle/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/attestation.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/batch.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/ethereum_signer.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/events.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/genesis.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/msgs.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/msgs.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/params.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/pool.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/proposal.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/query.ts create mode 100644 libs/injectivejs/src/injective/peggy/v1/types.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/events.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/params.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/permissions.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/permissions/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/stream/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/authorityMetadata.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/events.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/genesis.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/params.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/query.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.ts create mode 100644 libs/injectivejs/src/injective/types/v1beta1/account.ts create mode 100644 libs/injectivejs/src/injective/types/v1beta1/tx_ext.ts create mode 100644 libs/injectivejs/src/injective/types/v1beta1/tx_response.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/events.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/genesis.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/proposal.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/query.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/query.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/tx.rpc.func.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/tx.ts create mode 100644 libs/injectivejs/src/injective/wasmx/v1/wasmx.ts create mode 100644 libs/injectivejs/src/registry.ts create mode 100644 libs/injectivejs/src/tendermint/abci/types.ts create mode 100644 libs/injectivejs/src/tendermint/crypto/keys.ts create mode 100644 libs/injectivejs/src/tendermint/crypto/proof.ts create mode 100644 libs/injectivejs/src/tendermint/types/block.ts create mode 100644 libs/injectivejs/src/tendermint/types/evidence.ts create mode 100644 libs/injectivejs/src/tendermint/types/params.ts create mode 100644 libs/injectivejs/src/tendermint/types/types.ts create mode 100644 libs/injectivejs/src/tendermint/types/validator.ts create mode 100644 libs/injectivejs/src/tendermint/version/types.ts create mode 100644 libs/injectivejs/src/types.ts create mode 100644 libs/injectivejs/src/utf8.ts create mode 100644 libs/injectivejs/src/varint.ts create mode 100644 libs/injectivejs/tsconfig.esm.json create mode 100644 libs/injectivejs/tsconfig.json delete mode 100644 protos/ibc/applications/transfer/v1/transfer.proto delete mode 100644 protos/ibc/core/client/v1/client.proto rename protos/{ => injectivejs}/amino/amino.proto (100%) rename protos/{ => injectivejs}/cosmos/auth/v1beta1/auth.proto (100%) rename protos/{ => injectivejs}/cosmos/auth/v1beta1/query.proto (100%) rename protos/{ => injectivejs}/cosmos/authz/v1beta1/authz.proto (100%) rename protos/{ => injectivejs}/cosmos/authz/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/bank/v1beta1/bank.proto (100%) rename protos/{ => injectivejs}/cosmos/bank/v1beta1/query.proto (100%) rename protos/{ => injectivejs}/cosmos/bank/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/base/abci/v1beta1/abci.proto (100%) rename protos/{ => injectivejs}/cosmos/base/query/v1beta1/pagination.proto (100%) rename protos/{ => injectivejs}/cosmos/base/v1beta1/coin.proto (100%) rename protos/{ => injectivejs}/cosmos/crypto/ed25519/keys.proto (100%) rename protos/{ => injectivejs}/cosmos/crypto/multisig/v1beta1/multisig.proto (100%) rename protos/{ => injectivejs}/cosmos/crypto/secp256k1/keys.proto (100%) rename protos/{ => injectivejs}/cosmos/crypto/secp256r1/keys.proto (100%) rename protos/{ => injectivejs}/cosmos/distribution/v1beta1/distribution.proto (100%) rename protos/{ => injectivejs}/cosmos/distribution/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/feegrant/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/gov/v1/gov.proto (100%) rename protos/{ => injectivejs}/cosmos/gov/v1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/gov/v1beta1/gov.proto (100%) rename protos/{ => injectivejs}/cosmos/gov/v1beta1/query.proto (100%) rename protos/{ => injectivejs}/cosmos/gov/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/group/v1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/group/v1/types.proto (100%) rename protos/{ => injectivejs}/cosmos/ics23/v1/proofs.proto (98%) rename protos/{ => injectivejs}/cosmos/msg/v1/msg.proto (100%) rename protos/{ => injectivejs}/cosmos/query/v1/query.proto (100%) rename protos/{ => injectivejs}/cosmos/staking/v1beta1/query.proto (99%) rename protos/{ => injectivejs}/cosmos/staking/v1beta1/staking.proto (100%) rename protos/{ => injectivejs}/cosmos/staking/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/tx/signing/v1beta1/signing.proto (100%) rename protos/{ => injectivejs}/cosmos/tx/v1beta1/service.proto (100%) rename protos/{ => injectivejs}/cosmos/tx/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/upgrade/v1beta1/upgrade.proto (100%) rename protos/{ => injectivejs}/cosmos/vesting/v1beta1/tx.proto (100%) rename protos/{ => injectivejs}/cosmos/vesting/v1beta1/vesting.proto (100%) rename protos/{ => injectivejs}/cosmos_proto/cosmos.proto (100%) create mode 100644 protos/injectivejs/cosmwasm/wasm/v1/proposal_legacy.proto rename protos/{ => injectivejs}/cosmwasm/wasm/v1/query.proto (82%) rename protos/{ => injectivejs}/cosmwasm/wasm/v1/tx.proto (99%) rename protos/{ => injectivejs}/cosmwasm/wasm/v1/types.proto (100%) rename protos/{ => injectivejs}/gogoproto/gogo.proto (100%) rename protos/{ => injectivejs}/google/api/annotations.proto (100%) rename protos/{ => injectivejs}/google/api/http.proto (93%) rename protos/{ => injectivejs}/google/protobuf/any.proto (100%) rename protos/{ => injectivejs}/google/protobuf/descriptor.proto (92%) rename protos/{ => injectivejs}/google/protobuf/duration.proto (100%) rename protos/{ => injectivejs}/google/protobuf/timestamp.proto (100%) create mode 100644 protos/injectivejs/ibc/applications/transfer/v1/transfer.proto rename protos/{ => injectivejs}/ibc/applications/transfer/v1/tx.proto (94%) rename protos/{ => injectivejs}/ibc/core/channel/v1/channel.proto (99%) rename protos/{ => injectivejs}/ibc/core/channel/v1/tx.proto (99%) rename protos/{ => injectivejs}/ibc/core/channel/v1/upgrade.proto (96%) create mode 100644 protos/injectivejs/ibc/core/client/v1/client.proto rename protos/{ => injectivejs}/ibc/core/client/v1/tx.proto (97%) rename protos/{ => injectivejs}/ibc/core/commitment/v1/commitment.proto (75%) rename protos/{ => injectivejs}/ibc/core/connection/v1/connection.proto (98%) rename protos/{ => injectivejs}/ibc/core/connection/v1/tx.proto (70%) create mode 100644 protos/injectivejs/injective/auction/v1beta1/auction.proto create mode 100644 protos/injectivejs/injective/auction/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/auction/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/auction/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/crypto/v1beta1/ethsecp256k1/keys.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/authz.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/events.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/exchange.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/proposal.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/exchange/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/insurance/v1beta1/events.proto create mode 100644 protos/injectivejs/injective/insurance/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/insurance/v1beta1/insurance.proto create mode 100644 protos/injectivejs/injective/insurance/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/insurance/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/ocr/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/ocr/v1beta1/ocr.proto create mode 100644 protos/injectivejs/injective/ocr/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/ocr/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/events.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/oracle.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/proposal.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/oracle/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/peggy/v1/attestation.proto create mode 100644 protos/injectivejs/injective/peggy/v1/batch.proto create mode 100644 protos/injectivejs/injective/peggy/v1/ethereum_signer.proto create mode 100644 protos/injectivejs/injective/peggy/v1/events.proto create mode 100644 protos/injectivejs/injective/peggy/v1/genesis.proto create mode 100644 protos/injectivejs/injective/peggy/v1/msgs.proto create mode 100644 protos/injectivejs/injective/peggy/v1/params.proto create mode 100644 protos/injectivejs/injective/peggy/v1/pool.proto create mode 100644 protos/injectivejs/injective/peggy/v1/proposal.proto create mode 100644 protos/injectivejs/injective/peggy/v1/query.proto create mode 100644 protos/injectivejs/injective/peggy/v1/types.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/events.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/params.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/permissions.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/permissions/v1beta1/tx.proto create mode 100644 protos/injectivejs/injective/stream/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/authorityMetadata.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/events.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/genesis.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/params.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/query.proto create mode 100644 protos/injectivejs/injective/tokenfactory/v1beta1/tx.proto rename protos/{ => injectivejs}/injective/types/v1beta1/account.proto (87%) create mode 100644 protos/injectivejs/injective/types/v1beta1/tx_ext.proto create mode 100644 protos/injectivejs/injective/types/v1beta1/tx_response.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/events.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/genesis.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/proposal.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/query.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/tx.proto create mode 100644 protos/injectivejs/injective/wasmx/v1/wasmx.proto rename protos/{ => injectivejs}/tendermint/abci/types.proto (100%) rename protos/{ => injectivejs}/tendermint/crypto/keys.proto (100%) rename protos/{ => injectivejs}/tendermint/crypto/proof.proto (100%) rename protos/{ => injectivejs}/tendermint/types/block.proto (100%) rename protos/{ => injectivejs}/tendermint/types/evidence.proto (100%) rename protos/{ => injectivejs}/tendermint/types/params.proto (100%) rename protos/{ => injectivejs}/tendermint/types/types.proto (100%) rename protos/{ => injectivejs}/tendermint/types/validator.proto (100%) rename protos/{ => injectivejs}/tendermint/version/types.proto (100%) create mode 100644 protos/interchainjs/amino/amino.proto create mode 100644 protos/interchainjs/cosmos/auth/v1beta1/auth.proto create mode 100644 protos/interchainjs/cosmos/auth/v1beta1/query.proto create mode 100644 protos/interchainjs/cosmos/authz/v1beta1/authz.proto create mode 100644 protos/interchainjs/cosmos/authz/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/bank/v1beta1/bank.proto create mode 100644 protos/interchainjs/cosmos/bank/v1beta1/query.proto create mode 100644 protos/interchainjs/cosmos/bank/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/base/abci/v1beta1/abci.proto create mode 100644 protos/interchainjs/cosmos/base/query/v1beta1/pagination.proto create mode 100644 protos/interchainjs/cosmos/base/v1beta1/coin.proto create mode 100644 protos/interchainjs/cosmos/crypto/ed25519/keys.proto create mode 100644 protos/interchainjs/cosmos/crypto/multisig/v1beta1/multisig.proto create mode 100644 protos/interchainjs/cosmos/crypto/secp256k1/keys.proto create mode 100644 protos/interchainjs/cosmos/crypto/secp256r1/keys.proto create mode 100644 protos/interchainjs/cosmos/distribution/v1beta1/distribution.proto create mode 100644 protos/interchainjs/cosmos/distribution/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/feegrant/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/gov/v1/gov.proto create mode 100644 protos/interchainjs/cosmos/gov/v1/tx.proto create mode 100644 protos/interchainjs/cosmos/gov/v1beta1/gov.proto create mode 100644 protos/interchainjs/cosmos/gov/v1beta1/query.proto create mode 100644 protos/interchainjs/cosmos/gov/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/group/v1/tx.proto create mode 100644 protos/interchainjs/cosmos/group/v1/types.proto create mode 100644 protos/interchainjs/cosmos/ics23/v1/proofs.proto create mode 100644 protos/interchainjs/cosmos/msg/v1/msg.proto create mode 100644 protos/interchainjs/cosmos/query/v1/query.proto create mode 100644 protos/interchainjs/cosmos/staking/v1beta1/query.proto create mode 100644 protos/interchainjs/cosmos/staking/v1beta1/staking.proto create mode 100644 protos/interchainjs/cosmos/staking/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/tx/signing/v1beta1/signing.proto create mode 100644 protos/interchainjs/cosmos/tx/v1beta1/service.proto create mode 100644 protos/interchainjs/cosmos/tx/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/upgrade/v1beta1/upgrade.proto create mode 100644 protos/interchainjs/cosmos/vesting/v1beta1/tx.proto create mode 100644 protos/interchainjs/cosmos/vesting/v1beta1/vesting.proto create mode 100644 protos/interchainjs/cosmos_proto/cosmos.proto create mode 100644 protos/interchainjs/cosmwasm/wasm/v1/query.proto create mode 100644 protos/interchainjs/cosmwasm/wasm/v1/tx.proto create mode 100644 protos/interchainjs/cosmwasm/wasm/v1/types.proto create mode 100644 protos/interchainjs/gogoproto/gogo.proto create mode 100644 protos/interchainjs/google/api/annotations.proto create mode 100644 protos/interchainjs/google/api/http.proto create mode 100644 protos/interchainjs/google/protobuf/any.proto create mode 100644 protos/interchainjs/google/protobuf/descriptor.proto create mode 100644 protos/interchainjs/google/protobuf/duration.proto create mode 100644 protos/interchainjs/google/protobuf/timestamp.proto create mode 100644 protos/interchainjs/ibc/applications/transfer/v1/transfer.proto create mode 100644 protos/interchainjs/ibc/applications/transfer/v1/tx.proto create mode 100644 protos/interchainjs/ibc/core/channel/v1/channel.proto create mode 100644 protos/interchainjs/ibc/core/channel/v1/tx.proto create mode 100644 protos/interchainjs/ibc/core/channel/v1/upgrade.proto create mode 100644 protos/interchainjs/ibc/core/client/v1/client.proto create mode 100644 protos/interchainjs/ibc/core/client/v1/tx.proto create mode 100644 protos/interchainjs/ibc/core/commitment/v1/commitment.proto create mode 100644 protos/interchainjs/ibc/core/connection/v1/connection.proto create mode 100644 protos/interchainjs/ibc/core/connection/v1/tx.proto create mode 100644 protos/interchainjs/injective/types/v1beta1/account.proto create mode 100644 protos/interchainjs/tendermint/abci/types.proto create mode 100644 protos/interchainjs/tendermint/crypto/keys.proto create mode 100644 protos/interchainjs/tendermint/crypto/proof.proto create mode 100644 protos/interchainjs/tendermint/types/block.proto create mode 100644 protos/interchainjs/tendermint/types/evidence.proto create mode 100644 protos/interchainjs/tendermint/types/params.proto create mode 100644 protos/interchainjs/tendermint/types/types.proto create mode 100644 protos/interchainjs/tendermint/types/validator.proto create mode 100644 protos/interchainjs/tendermint/version/types.proto create mode 100644 scripts/.injective.protod.config.json create mode 100644 scripts/inj-query.telescope.json create mode 100644 scripts/inj.telescope.json diff --git a/.telescope.json b/.telescope.json index 510be282..a2d0f66f 100644 --- a/.telescope.json +++ b/.telescope.json @@ -1,8 +1,8 @@ { "protoDirs": [ - "./protos" + "./protos/injectivejs" ], - "outPath": "./libs/interchain-query/src", + "outPath": "./libs/injectivejs/src", "options": { "classesUseArrowFunctions": true, "env": "v-next", @@ -60,7 +60,7 @@ }, "helperFuncCreators": { "enabled": true, - "genCustomHooks": true + "genCustomHooks": false }, "interfaces": { "enabled": true, diff --git a/git-modules/cometbft/cometbft/main b/git-modules/cometbft/cometbft/main index 43dcd47c..e2c3fd40 160000 --- a/git-modules/cometbft/cometbft/main +++ b/git-modules/cometbft/cometbft/main @@ -1 +1 @@ -Subproject commit 43dcd47c99cb8014890e8d4264696efe2285d571 +Subproject commit e2c3fd400f52aecf50c78ec0a3bda73ebb5ff76b diff --git a/git-modules/cosmos/cosmos-proto/main b/git-modules/cosmos/cosmos-proto/main index 6749af0d..3e538125 160000 --- a/git-modules/cosmos/cosmos-proto/main +++ b/git-modules/cosmos/cosmos-proto/main @@ -1 +1 @@ -Subproject commit 6749af0d5eaee07f371396092a2802b8941ff01f +Subproject commit 3e53812559a5f89540930b1a40f16266a73ce1c9 diff --git a/git-modules/cosmos/cosmos-sdk/main b/git-modules/cosmos/cosmos-sdk/main index 05ff7a7c..9d9c19c0 160000 --- a/git-modules/cosmos/cosmos-sdk/main +++ b/git-modules/cosmos/cosmos-sdk/main @@ -1 +1 @@ -Subproject commit 05ff7a7cb72ef8399cb4de76bd1d7aab42debaf3 +Subproject commit 9d9c19c0f854c203ba1a202846eb9067124d4eff diff --git a/git-modules/cosmos/cosmos-sdk/release/v0.50.x b/git-modules/cosmos/cosmos-sdk/release/v0.50.x index aeb1e8f4..96a30160 160000 --- a/git-modules/cosmos/cosmos-sdk/release/v0.50.x +++ b/git-modules/cosmos/cosmos-sdk/release/v0.50.x @@ -1 +1 @@ -Subproject commit aeb1e8f46b8dad727e1935ac7728fb0c0327f280 +Subproject commit 96a30160b3453ebed51d6b684c73c5f89bca6233 diff --git a/git-modules/cosmos/gogoproto/main b/git-modules/cosmos/gogoproto/main index 6eec9731..28b2faca 160000 --- a/git-modules/cosmos/gogoproto/main +++ b/git-modules/cosmos/gogoproto/main @@ -1 +1 @@ -Subproject commit 6eec9731781bf8ec4feb0e4098ffb19ee74afb50 +Subproject commit 28b2facaa30178e137477bcc756a72a7a3c84b6b diff --git a/git-modules/cosmos/ibc-go/main b/git-modules/cosmos/ibc-go/main index 061a565e..4eac951b 160000 --- a/git-modules/cosmos/ibc-go/main +++ b/git-modules/cosmos/ibc-go/main @@ -1 +1 @@ -Subproject commit 061a565ec136288a731baa394b283556bb1cb7bc +Subproject commit 4eac951bfd4ad71338ce4bcd48367fb0afdf712e diff --git a/git-modules/cosmos/ics23/master b/git-modules/cosmos/ics23/master index 69d86966..a31bd4d9 160000 --- a/git-modules/cosmos/ics23/master +++ b/git-modules/cosmos/ics23/master @@ -1 +1 @@ -Subproject commit 69d86966af4cf42f5a81ecddf82d513995272398 +Subproject commit a31bd4d9ca77beca7218299727db5ad59e65f5b8 diff --git a/git-modules/cosmwasm/wasmd/main b/git-modules/cosmwasm/wasmd/main index 21b048d5..b2b6abee 160000 --- a/git-modules/cosmwasm/wasmd/main +++ b/git-modules/cosmwasm/wasmd/main @@ -1 +1 @@ -Subproject commit 21b048d54e395ff9168e5c3037356a73797500ba +Subproject commit b2b6abee8c9484a4bf668c1cc7119c994b2a7476 diff --git a/git-modules/googleapis/googleapis/master b/git-modules/googleapis/googleapis/master index 573205a8..4743cf9e 160000 --- a/git-modules/googleapis/googleapis/master +++ b/git-modules/googleapis/googleapis/master @@ -1 +1 @@ -Subproject commit 573205a81b9b96ea6d4e0365373839b59f4b427e +Subproject commit 4743cf9ecab30cb113a7809aacbdbbba376f79f6 diff --git a/git-modules/injectivelabs/sdk-go/master b/git-modules/injectivelabs/sdk-go/master index 72947502..428cbcf1 160000 --- a/git-modules/injectivelabs/sdk-go/master +++ b/git-modules/injectivelabs/sdk-go/master @@ -1 +1 @@ -Subproject commit 729475023c82723025bea1161754637152ac271a +Subproject commit 428cbcf1970f875d487319d572640256f7cdca25 diff --git a/git-modules/protocolbuffers/protobuf/main b/git-modules/protocolbuffers/protobuf/main index bbf52275..c879cccf 160000 --- a/git-modules/protocolbuffers/protobuf/main +++ b/git-modules/protocolbuffers/protobuf/main @@ -1 +1 @@ -Subproject commit bbf52275dbad317bad3421f3c69b5f3759eb2b23 +Subproject commit c879cccf0d740af2e2a2a779a8384d23f544eabe diff --git a/libs/injective-query/.eslintignore b/libs/injective-query/.eslintignore new file mode 100644 index 00000000..838458f2 --- /dev/null +++ b/libs/injective-query/.eslintignore @@ -0,0 +1 @@ +/dist/ \ No newline at end of file diff --git a/libs/injective-query/CHANGELOG.md b/libs/injective-query/CHANGELOG.md new file mode 100644 index 00000000..c7519894 --- /dev/null +++ b/libs/injective-query/CHANGELOG.md @@ -0,0 +1,176 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.0.1-beta.36](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.35...interchainjs@0.0.1-beta.36) (2024-11-04) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.35](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.34...interchainjs@0.0.1-beta.35) (2024-11-04) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.34](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.33...interchainjs@0.0.1-beta.34) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.33](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.33...interchainjs@0.0.1-beta.33) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.33](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.32...interchainjs@0.0.1-alpha.33) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.32](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.31...interchainjs@0.0.1-alpha.32) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.31](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.30...interchainjs@0.0.1-alpha.31) (2024-10-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.30](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.30...interchainjs@0.0.1-alpha.30) (2024-10-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.30](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.29...interchainjs@0.0.1-beta.30) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.29](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.28...interchainjs@0.0.1-beta.29) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.28](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.27...interchainjs@0.0.1-beta.28) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.27](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.26...interchainjs@0.0.1-beta.27) (2024-10-23) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.26](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.25...interchainjs@0.0.1-beta.26) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.25](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.24...interchainjs@0.0.1-beta.25) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.24](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.23...interchainjs@0.0.1-beta.24) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.23](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.22...interchainjs@0.0.1-beta.23) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.22](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.21...interchainjs@0.0.1-beta.22) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.21](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.20...interchainjs@0.0.1-beta.21) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.20](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.19...interchainjs@0.0.1-beta.20) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.19](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.18...interchainjs@0.0.1-beta.19) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.18](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.17...interchainjs@0.0.1-beta.18) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.17](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.16...interchainjs@0.0.1-beta.17) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.16](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.15...interchainjs@0.0.1-beta.16) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.15](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.14...interchainjs@0.0.1-beta.15) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.14](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.13...interchainjs@0.0.1-beta.14) (2024-09-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.13](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.12...interchainjs@0.0.1-beta.13) (2024-09-10) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.12](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.11...interchainjs@0.0.1-beta.12) (2024-08-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.11](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.10...interchainjs@0.0.1-beta.11) (2024-08-27) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.10](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.9...interchainjs@0.0.1-beta.10) (2024-08-26) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.9](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.8...interchainjs@0.0.1-beta.9) (2024-08-24) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.8](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.7...interchainjs@0.0.1-beta.8) (2024-08-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.7](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.6...interchainjs@0.0.1-beta.7) (2024-08-19) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.6](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.5...interchainjs@0.0.1-beta.6) (2024-08-14) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.5](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.4...interchainjs@0.0.1-beta.5) (2024-08-14) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.4](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.3...interchainjs@0.0.1-beta.4) (2024-08-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.3](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.2...interchainjs@0.0.1-beta.3) (2024-08-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.2](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.1...interchainjs@0.0.1-beta.2) (2024-06-07) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.0...interchainjs@0.0.1-beta.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.0](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1-beta.0) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.7...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## 0.0.7 (2024-04-02) + +**Note:** Version bump only for package interchainjs diff --git a/libs/injective-query/README.md b/libs/injective-query/README.md new file mode 100644 index 00000000..7e697b67 --- /dev/null +++ b/libs/injective-query/README.md @@ -0,0 +1,21 @@ +# interchainjs + +

+ +

+ +

+ + + +

+ +Functionalities(Tx, Query) generated by Telescope. + +## License + +MIT License (MIT) & Apache License + +Copyright (c) 2024 Cosmology (https://cosmology.zone/) diff --git a/libs/injective-query/jest.starship.config.js b/libs/injective-query/jest.starship.config.js new file mode 100644 index 00000000..c8558038 --- /dev/null +++ b/libs/injective-query/jest.starship.config.js @@ -0,0 +1,18 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + testTimeout: 15000, + preset: 'ts-jest', + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': [ + 'ts-jest', + { + babelConfig: false, + tsconfig: 'tsconfig.json', + }, + ], + }, + transformIgnorePatterns: [`/node_modules/*`], + testRegex: '(/starship/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], +}; diff --git a/libs/injective-query/package.json b/libs/injective-query/package.json new file mode 100644 index 00000000..23a16249 --- /dev/null +++ b/libs/injective-query/package.json @@ -0,0 +1,48 @@ +{ + "name": "injective-query", + "version": "0.0.1-beta.36", + "description": "Injective-query is a JavaScript library providing react query hooks for interacting with injective sdk.", + "main": "index.js", + "module": "esm/index.js", + "types": "index.d.ts", + "author": "Cosmology ", + "homepage": "https://github.com/cosmology-tech/interchainjs", + "repository": { + "type": "git", + "url": "https://github.com/cosmology-tech/interchainjs" + }, + "license": "MIT", + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "scripts": { + "copy": "copyfiles -f ../../LICENSE-MIT ../../LICENSE-Apache README.md package.json dist", + "clean": "rimraf dist/**", + "build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy", + "build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy", + "lint": "eslint . --fix", + "prepare": "npm run build" + }, + "dependencies": { + "@interchainjs/cosmos": "^0.0.1-beta.34", + "@interchainjs/cosmos-types": "^0.0.1-beta.34", + "@interchainjs/types": "^0.0.1-beta.34", + "@interchainjs/utils": "^0.0.1-beta.34", + "@noble/hashes": "^1.3.1", + "decimal.js": "^10.4.3" + }, + "devDependencies": { + "@tanstack/react-query": "4.29.1" + }, + "peerDependencies": { + "@tanstack/react-query": "4.29.1" + }, + "keywords": [ + "cosmos", + "blockchain", + "transaction", + "cosmjs", + "wallet" + ] +} diff --git a/libs/injective-query/src/amino/amino.ts b/libs/injective-query/src/amino/amino.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injective-query/src/amino/amino.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injective-query/src/binary.ts b/libs/injective-query/src/binary.ts new file mode 100644 index 00000000..1f9d1f8c --- /dev/null +++ b/libs/injective-query/src/binary.ts @@ -0,0 +1,534 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// 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 its author, 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. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from "./utf8"; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from "./varint"; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError("premature EOF"); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + "illegal tag: field no " + fieldNo + " wire type " + wireType + ); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === "number") { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error("float not supported"); + } + + double(): number { + throw new Error("double not supported"); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + val: T + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== "undefined") { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size); + } else { + return new Array(size); + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error("float not supported" + value); + } + + double(value: number): BinaryWriter { + throw new Error("double not supported" + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0); + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== "undefined") { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + "index out of range: " + + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len + ); +} diff --git a/libs/injective-query/src/cosmos/auth/v1beta1/auth.ts b/libs/injective-query/src/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..bd8ed990 --- /dev/null +++ b/libs/injective-query/src/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,550 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + address: string; + pubKey?: Any; + accountNumber: bigint; + sequence: bigint; +} +export interface BaseAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; + value: Uint8Array; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountAmino { + address: string; + pub_key?: AnyAmino; + account_number: string; + sequence: string; +} +export interface BaseAccountAminoMsg { + type: "cosmos-sdk/BaseAccount"; + value: BaseAccountAmino; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + baseAccount?: BaseAccount; + name: string; + permissions: string[]; +} +export interface ModuleAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount"; + value: Uint8Array; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountAmino { + base_account?: BaseAccountAmino; + name: string; + permissions: string[]; +} +export interface ModuleAccountAminoMsg { + type: "cosmos-sdk/ModuleAccount"; + value: ModuleAccountAmino; +} +/** + * 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; +} +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsAmino { + max_memo_characters: string; + tx_sig_limit: string; + tx_size_cost_per_byte: string; + sig_verify_cost_ed25519: string; + sig_verify_cost_secp256k1: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/x/auth/Params"; + value: ParamsAmino; +} +function createBaseBaseAccount(): BaseAccount { + return { + address: "", + pubKey: undefined, + accountNumber: BigInt(0), + sequence: BigInt(0) + }; +} +export const BaseAccount = { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + aminoType: "cosmos-sdk/BaseAccount", + is(o: any): o is BaseAccount { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is BaseAccountAmino { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(32).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64(); + break; + case 4: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + 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); + return message; + }, + fromAmino(object: BaseAccountAmino): BaseAccount { + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + 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); + } + return message; + }, + toAmino(message: BaseAccount): BaseAccountAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber?.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { + return BaseAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { + return { + type: "cosmos-sdk/BaseAccount", + value: BaseAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { + return BaseAccount.decode(message.value); + }, + toProto(message: BaseAccount): Uint8Array { + return BaseAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseAccount): BaseAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + value: BaseAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseAccount.aminoType, BaseAccount.typeUrl); +function createBaseModuleAccount(): ModuleAccount { + return { + baseAccount: undefined, + name: "", + permissions: [] + }; +} +export const ModuleAccount = { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + aminoType: "cosmos-sdk/ModuleAccount", + is(o: any): o is ModuleAccount { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + isAmino(o: any): o is ModuleAccountAmino { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.name = object.name ?? ""; + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleAccountAmino): ModuleAccount { + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + toAmino(message: ModuleAccount): ModuleAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + obj.name = message.name === "" ? undefined : message.name; + if (message.permissions) { + obj.permissions = message.permissions.map(e => e); + } else { + obj.permissions = message.permissions; + } + return obj; + }, + fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { + return ModuleAccount.fromAmino(object.value); + }, + toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { + return { + type: "cosmos-sdk/ModuleAccount", + value: ModuleAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { + return ModuleAccount.decode(message.value); + }, + toProto(message: ModuleAccount): Uint8Array { + return ModuleAccount.encode(message).finish(); + }, + toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + value: ModuleAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleAccount.aminoType, ModuleAccount.typeUrl); +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: "", + derivationKeys: [] + }; +} +export const ModuleCredential = { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + aminoType: "cosmos-sdk/GroupAccountCredential", + is(o: any): o is ModuleCredential { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.moduleName === "string" && Array.isArray(o.derivationKeys) && (!o.derivationKeys.length || o.derivationKeys[0] instanceof Uint8Array || typeof o.derivationKeys[0] === "string")); + }, + isAmino(o: any): o is ModuleCredentialAmino { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.module_name === "string" && Array.isArray(o.derivation_keys) && (!o.derivation_keys.length || o.derivation_keys[0] instanceof Uint8Array || typeof o.derivation_keys[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ModuleCredential.typeUrl, ModuleCredential); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleCredential.aminoType, ModuleCredential.typeUrl); +function createBaseParams(): Params { + return { + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0) + }; +} +export const Params = { + typeUrl: "/cosmos.auth.v1beta1.Params", + aminoType: "cosmos-sdk/x/auth/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxMemoCharacters === "bigint" && typeof o.txSigLimit === "bigint" && typeof o.txSizeCostPerByte === "bigint" && typeof o.sigVerifyCostEd25519 === "bigint" && typeof o.sigVerifyCostSecp256k1 === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_memo_characters === "bigint" && typeof o.tx_sig_limit === "bigint" && typeof o.tx_size_cost_per_byte === "bigint" && typeof o.sig_verify_cost_ed25519 === "bigint" && typeof o.sig_verify_cost_secp256k1 === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { + writer.uint32(8).uint64(message.maxMemoCharacters); + } + if (message.txSigLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.txSigLimit); + } + if (message.txSizeCostPerByte !== BigInt(0)) { + writer.uint32(24).uint64(message.txSizeCostPerByte); + } + if (message.sigVerifyCostEd25519 !== BigInt(0)) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + } + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + } + 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.maxMemoCharacters = reader.uint64(); + break; + case 2: + message.txSigLimit = reader.uint64(); + break; + case 3: + message.txSizeCostPerByte = reader.uint64(); + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64(); + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0); + message.txSigLimit = object.txSigLimit !== undefined && object.txSigLimit !== null ? BigInt(object.txSigLimit.toString()) : BigInt(0); + message.txSizeCostPerByte = object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0); + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0); + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_memo_characters = message.maxMemoCharacters !== BigInt(0) ? message.maxMemoCharacters?.toString() : undefined; + obj.tx_sig_limit = message.txSigLimit !== BigInt(0) ? message.txSigLimit?.toString() : undefined; + obj.tx_size_cost_per_byte = message.txSizeCostPerByte !== BigInt(0) ? message.txSizeCostPerByte?.toString() : undefined; + obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 !== BigInt(0) ? message.sigVerifyCostEd25519?.toString() : undefined; + obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 !== BigInt(0) ? message.sigVerifyCostSecp256k1?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/auth/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.auth.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/injective-query/src/cosmos/auth/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..55204af9 --- /dev/null +++ b/libs/injective-query/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -0,0 +1,113 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountsRequest.encode, + decode: QueryAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Accounts", + clientResolver +}); +export const useGetAccounts = buildUseQuery({ + builderQueryFn: createGetAccounts, + queryKeyPrefix: "AccountsQuery" +}); +export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountRequest.encode, + decode: QueryAccountResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Account", + clientResolver +}); +export const useGetAccount = buildUseQuery({ + builderQueryFn: createGetAccount, + queryKeyPrefix: "AccountQuery" +}); +export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressByIDRequest.encode, + decode: QueryAccountAddressByIDResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountAddressByID", + clientResolver +}); +export const useGetAccountAddressByID = buildUseQuery({ + builderQueryFn: createGetAccountAddressByID, + queryKeyPrefix: "AccountAddressByIDQuery" +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountsRequest.encode, + decode: QueryModuleAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccounts", + clientResolver +}); +export const useGetModuleAccounts = buildUseQuery({ + builderQueryFn: createGetModuleAccounts, + queryKeyPrefix: "ModuleAccountsQuery" +}); +export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountByNameRequest.encode, + decode: QueryModuleAccountByNameResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccountByName", + clientResolver +}); +export const useGetModuleAccountByName = buildUseQuery({ + builderQueryFn: createGetModuleAccountByName, + queryKeyPrefix: "ModuleAccountByNameQuery" +}); +export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ + encode: Bech32PrefixRequest.encode, + decode: Bech32PrefixResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Bech32Prefix", + clientResolver +}); +export const useGetBech32Prefix = buildUseQuery({ + builderQueryFn: createGetBech32Prefix, + queryKeyPrefix: "Bech32PrefixQuery" +}); +export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressBytesToStringRequest.encode, + decode: AddressBytesToStringResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressBytesToString", + clientResolver +}); +export const useGetAddressBytesToString = buildUseQuery({ + builderQueryFn: createGetAddressBytesToString, + queryKeyPrefix: "AddressBytesToStringQuery" +}); +export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressStringToBytesRequest.encode, + decode: AddressStringToBytesResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressStringToBytes", + clientResolver +}); +export const useGetAddressStringToBytes = buildUseQuery({ + builderQueryFn: createGetAddressStringToBytes, + queryKeyPrefix: "AddressStringToBytesQuery" +}); +export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountInfoRequest.encode, + decode: QueryAccountInfoResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountInfo", + clientResolver +}); +export const useGetAccountInfo = buildUseQuery({ + builderQueryFn: createGetAccountInfo, + queryKeyPrefix: "AccountInfoQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/auth/v1beta1/query.ts b/libs/injective-query/src/cosmos/auth/v1beta1/query.ts new file mode 100644 index 00000000..13eb3d8e --- /dev/null +++ b/libs/injective-query/src/cosmos/auth/v1beta1/query.ts @@ -0,0 +1,2034 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, BaseAccount, BaseAccountProtoMsg, BaseAccountAmino, ModuleAccount, ModuleAccountProtoMsg } from "./auth"; +import { EthAccount, EthAccountProtoMsg } from "../../../injective/types/v1beta1/account"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAccountsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; + value: Uint8Array; +} +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryAccountsRequest"; + value: QueryAccountsRequestAmino; +} +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponse { + /** accounts are the existing accounts */ + accounts: (BaseAccount | EthAccount | Any)[] | Any[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; + value: Uint8Array; +} +export type QueryAccountsResponseEncoded = Omit & { + /** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg)[]; +}; +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponseAmino { + /** accounts are the existing accounts */ + accounts: AnyAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAccountsResponseAminoMsg { + type: "cosmos-sdk/QueryAccountsResponse"; + value: QueryAccountsResponseAmino; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + /** address defines the address to query for. */ + address: string; +} +export interface QueryAccountRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest"; + value: Uint8Array; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestAmino { + /** address defines the address to query for. */ + address: string; +} +export interface QueryAccountRequestAminoMsg { + type: "cosmos-sdk/QueryAccountRequest"; + value: QueryAccountRequestAmino; +} +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponse { + /** account defines the account of the corresponding address. */ + account?: BaseAccount | EthAccount | Any | undefined; +} +export interface QueryAccountResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; + value: Uint8Array; +} +export type QueryAccountResponseEncoded = Omit & { + /** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponseAmino { + /** account defines the account of the corresponding address. */ + account?: AnyAmino; +} +export interface QueryAccountResponseAminoMsg { + type: "cosmos-sdk/QueryAccountResponse"; + value: QueryAccountResponseAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/cosmos.auth.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: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * 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; +} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponse { + accounts: (ModuleAccount | Any)[] | Any[]; +} +export interface QueryModuleAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; + value: Uint8Array; +} +export type QueryModuleAccountsResponseEncoded = Omit & { + accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; +}; +/** + * 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; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} +export interface QueryModuleAccountByNameRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; + value: Uint8Array; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestAmino { + name: string; +} +export interface QueryModuleAccountByNameRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameRequest"; + value: QueryModuleAccountByNameRequestAmino; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account?: ModuleAccount | Any | undefined; +} +export interface QueryModuleAccountByNameResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; + value: Uint8Array; +} +export type QueryModuleAccountByNameResponseEncoded = Omit & { + account?: ModuleAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseAmino { + account?: AnyAmino; +} +export interface QueryModuleAccountByNameResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameResponse"; + value: QueryModuleAccountByNameResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + pagination: undefined + }; +} +export const QueryAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest", + aminoType: "cosmos-sdk/QueryAccountsRequest", + is(o: any): o is QueryAccountsRequest { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAccountsRequestAmino { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + 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: DeepPartial): 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.auth.v1beta1.QueryAccountsRequest", + value: QueryAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountsRequest.typeUrl, QueryAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsRequest.aminoType, QueryAccountsRequest.typeUrl); +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + accounts: [], + pagination: undefined + }; +} +export const QueryAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + aminoType: "cosmos-sdk/QueryAccountsResponse", + is(o: any): o is QueryAccountsResponse { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.is(o.accounts[0]) || EthAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isAmino(o: any): o is QueryAccountsResponseAmino { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isAmino(o.accounts[0]) || EthAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, + encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(GlobalDecoderRegistry.wrapAny(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): QueryAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.accounts = message.accounts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse { + return QueryAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountsResponse", + value: QueryAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse { + return QueryAccountsResponse.decode(message.value); + }, + toProto(message: QueryAccountsResponse): Uint8Array { + return QueryAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountsResponse): QueryAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + value: QueryAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountsResponse.typeUrl, QueryAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsResponse.aminoType, QueryAccountsResponse.typeUrl); +function createBaseQueryAccountRequest(): QueryAccountRequest { + return { + address: "" + }; +} +export const QueryAccountRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + aminoType: "cosmos-sdk/QueryAccountRequest", + is(o: any): o is QueryAccountRequest { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountRequestAmino { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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.auth.v1beta1.QueryAccountRequest", + value: QueryAccountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountRequest.typeUrl, QueryAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountRequest.aminoType, QueryAccountRequest.typeUrl); +function createBaseQueryAccountResponse(): QueryAccountResponse { + return { + account: undefined + }; +} +export const QueryAccountResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + aminoType: "cosmos-sdk/QueryAccountResponse", + is(o: any): o is QueryAccountResponse { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountResponseAmino { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.account), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; + }, + toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { + const obj: any = {}; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(message.account) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { + return QueryAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountResponse", + value: QueryAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { + return QueryAccountResponse.decode(message.value); + }, + toProto(message: QueryAccountResponse): Uint8Array { + return QueryAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + value: QueryAccountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountResponse.typeUrl, QueryAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountResponse.aminoType, QueryAccountResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.auth.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "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.auth.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; +} +export const QueryModuleAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + aminoType: "cosmos-sdk/QueryModuleAccountsRequest", + is(o: any): o is QueryModuleAccountsRequest { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountsRequestAmino { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseQueryModuleAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsRequestAminoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsRequestProtoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountsRequest): Uint8Array { + return QueryModuleAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountsRequest.typeUrl, QueryModuleAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsRequest.aminoType, QueryModuleAccountsRequest.typeUrl); +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { + return { + accounts: [] + }; +} +export const QueryModuleAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + aminoType: "cosmos-sdk/QueryModuleAccountsResponse", + is(o: any): o is QueryModuleAccountsResponse { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isAmino(o: any): o is QueryModuleAccountsResponseAmino { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + 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 = createBaseQueryModuleAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + return message; + }, + fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; + }, + toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsResponseAminoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsResponseProtoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountsResponse): Uint8Array { + return QueryModuleAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountsResponse.typeUrl, QueryModuleAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsResponse.aminoType, QueryModuleAccountsResponse.typeUrl); +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: "" + }; +} +export const QueryModuleAccountByNameRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + aminoType: "cosmos-sdk/QueryModuleAccountByNameRequest", + is(o: any): o is QueryModuleAccountByNameRequest { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is QueryModuleAccountByNameRequestAmino { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountByNameRequest.typeUrl, QueryModuleAccountByNameRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameRequest.aminoType, QueryModuleAccountByNameRequest.typeUrl); +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { + account: undefined + }; +} +export const QueryModuleAccountByNameResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + aminoType: "cosmos-sdk/QueryModuleAccountByNameResponse", + is(o: any): o is QueryModuleAccountByNameResponse { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountByNameResponseAmino { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; + }, + toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + const obj: any = {}; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(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 { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountByNameResponse.typeUrl, QueryModuleAccountByNameResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameResponse.aminoType, QueryModuleAccountByNameResponse.typeUrl); +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + aminoType: "cosmos-sdk/Bech32PrefixRequest", + is(o: any): o is Bech32PrefixRequest { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + isAmino(o: any): o is Bech32PrefixRequestAmino { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Bech32PrefixRequest.typeUrl, Bech32PrefixRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixRequest.aminoType, Bech32PrefixRequest.typeUrl); +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + aminoType: "cosmos-sdk/Bech32PrefixResponse", + is(o: any): o is Bech32PrefixResponse { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32Prefix === "string"); + }, + isAmino(o: any): o is Bech32PrefixResponseAmino { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32_prefix === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Bech32PrefixResponse.typeUrl, Bech32PrefixResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixResponse.aminoType, Bech32PrefixResponse.typeUrl); +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + aminoType: "cosmos-sdk/AddressBytesToStringRequest", + is(o: any): o is AddressBytesToStringRequest { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isAmino(o: any): o is AddressBytesToStringRequestAmino { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringRequest.typeUrl, AddressBytesToStringRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringRequest.aminoType, AddressBytesToStringRequest.typeUrl); +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + aminoType: "cosmos-sdk/AddressBytesToStringResponse", + is(o: any): o is AddressBytesToStringResponse { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.addressString === "string"); + }, + isAmino(o: any): o is AddressBytesToStringResponseAmino { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.address_string === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringResponse.typeUrl, AddressBytesToStringResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringResponse.aminoType, AddressBytesToStringResponse.typeUrl); +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + aminoType: "cosmos-sdk/AddressStringToBytesRequest", + is(o: any): o is AddressStringToBytesRequest { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.addressString === "string"); + }, + isAmino(o: any): o is AddressStringToBytesRequestAmino { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.address_string === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesRequest.typeUrl, AddressStringToBytesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesRequest.aminoType, AddressStringToBytesRequest.typeUrl); +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + aminoType: "cosmos-sdk/AddressStringToBytesResponse", + is(o: any): o is AddressStringToBytesResponse { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isAmino(o: any): o is AddressStringToBytesResponseAmino { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesResponse.typeUrl, AddressStringToBytesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesResponse.aminoType, AddressStringToBytesResponse.typeUrl); +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + accountId: BigInt(0) + }; +} +export const QueryAccountAddressByIDRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + aminoType: "cosmos-sdk/QueryAccountAddressByIDRequest", + is(o: any): o is QueryAccountAddressByIDRequest { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.accountId === "bigint"); + }, + isAmino(o: any): o is QueryAccountAddressByIDRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.account_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDRequest.typeUrl, QueryAccountAddressByIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDRequest.aminoType, QueryAccountAddressByIDRequest.typeUrl); +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: "" + }; +} +export const QueryAccountAddressByIDResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + aminoType: "cosmos-sdk/QueryAccountAddressByIDResponse", + is(o: any): o is QueryAccountAddressByIDResponse { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressByIDResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.account_address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDResponse.typeUrl, QueryAccountAddressByIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDResponse.aminoType, QueryAccountAddressByIDResponse.typeUrl); +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { + address: "" + }; +} +export const QueryAccountInfoRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + aminoType: "cosmos-sdk/QueryAccountInfoRequest", + is(o: any): o is QueryAccountInfoRequest { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountInfoRequestAmino { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoRequest.typeUrl, QueryAccountInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoRequest.aminoType, QueryAccountInfoRequest.typeUrl); +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { + info: undefined + }; +} +export const QueryAccountInfoResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + aminoType: "cosmos-sdk/QueryAccountInfoResponse", + is(o: any): o is QueryAccountInfoResponse { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountInfoResponseAmino { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoResponse.typeUrl, QueryAccountInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoResponse.aminoType, QueryAccountInfoResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/authz/v1beta1/authz.ts b/libs/injective-query/src/cosmos/authz/v1beta1/authz.ts new file mode 100644 index 00000000..e71c3fee --- /dev/null +++ b/libs/injective-query/src/cosmos/authz/v1beta1/authz.ts @@ -0,0 +1,477 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorization { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string; +} +export interface GenericAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization"; + value: Uint8Array; +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationAmino { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string; +} +export interface GenericAuthorizationAminoMsg { + type: "cosmos-sdk/GenericAuthorization"; + value: GenericAuthorizationAmino; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface Grant { + authorization?: GenericAuthorization | Any | undefined; + /** + * 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"; + value: Uint8Array; +} +export type GrantEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +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 { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorization { + granter: string; + grantee: string; + authorization?: GenericAuthorization | Any | undefined; + expiration?: Date; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +export type GrantAuthorizationEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationAmino { + granter: string; + grantee: string; + authorization?: AnyAmino; + expiration?: string; +} +export interface GrantAuthorizationAminoMsg { + type: "cosmos-sdk/GrantAuthorization"; + value: GrantAuthorizationAmino; +} +/** 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; +} +function createBaseGenericAuthorization(): GenericAuthorization { + return { + msg: "" + }; +} +export const GenericAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + aminoType: "cosmos-sdk/GenericAuthorization", + is(o: any): o is GenericAuthorization { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + isAmino(o: any): o is GenericAuthorizationAmino { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + encode(message: GenericAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msg !== "") { + writer.uint32(10).string(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenericAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenericAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msg = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenericAuthorization { + const message = createBaseGenericAuthorization(); + message.msg = object.msg ?? ""; + return message; + }, + fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { + const message = createBaseGenericAuthorization(); + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } + return message; + }, + toAmino(message: GenericAuthorization): GenericAuthorizationAmino { + const obj: any = {}; + obj.msg = message.msg === "" ? undefined : message.msg; + return obj; + }, + fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization { + return GenericAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GenericAuthorization", + value: GenericAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization { + return GenericAuthorization.decode(message.value); + }, + toProto(message: GenericAuthorization): Uint8Array { + return GenericAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GenericAuthorization): GenericAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + value: GenericAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenericAuthorization.typeUrl, GenericAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GenericAuthorization.aminoType, GenericAuthorization.typeUrl); +function createBaseGrant(): Grant { + return { + authorization: undefined, + expiration: undefined + }; +} +export const Grant = { + typeUrl: "/cosmos.authz.v1beta1.Grant", + aminoType: "cosmos-sdk/Grant", + is(o: any): o is Grant { + return o && o.$typeUrl === Grant.typeUrl; + }, + isAmino(o: any): o is GrantAmino { + return o && o.$typeUrl === Grant.typeUrl; + }, + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authorization !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(10).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorization = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Grant { + const message = createBaseGrant(); + message.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAmino): Grant { + const message = createBaseGrant(); + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: Grant): GrantAmino { + const obj: any = {}; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value); + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish(); + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.Grant", + value: Grant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Grant.typeUrl, Grant); +GlobalDecoderRegistry.registerAminoProtoMapping(Grant.aminoType, Grant.typeUrl); +function createBaseGrantAuthorization(): GrantAuthorization { + return { + granter: "", + grantee: "", + authorization: undefined, + expiration: undefined + }; +} +export const GrantAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + aminoType: "cosmos-sdk/GrantAuthorization", + is(o: any): o is GrantAuthorization { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is GrantAuthorizationAmino { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: GrantAuthorization, 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.authorization !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(26).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantAuthorization(); + 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.authorization = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 4: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantAuthorization { + const message = createBaseGrantAuthorization(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + const message = createBaseGrantAuthorization(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: GrantAuthorization): GrantAuthorizationAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { + return GrantAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GrantAuthorization", + value: GrantAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value); + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + value: GrantAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantAuthorization.typeUrl, GrantAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantAuthorization.aminoType, GrantAuthorization.typeUrl); +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + aminoType: "cosmos-sdk/GrantQueueItem", + is(o: any): o is GrantQueueItem { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msgTypeUrls) && (!o.msgTypeUrls.length || typeof o.msgTypeUrls[0] === "string")); + }, + isAmino(o: any): o is GrantQueueItemAmino { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msg_type_urls) && (!o.msg_type_urls.length || typeof o.msg_type_urls[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GrantQueueItem.typeUrl, GrantQueueItem); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantQueueItem.aminoType, GrantQueueItem.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/authz/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..de818f66 --- /dev/null +++ b/libs/injective-query/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -0,0 +1,31 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrant.typeUrl, + encoders: toEncoders(MsgGrant), + converters: toConverters(MsgGrant) +}); +export const useGrant = buildUseMutation({ + builderMutationFn: createGrant +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevoke.typeUrl, + encoders: toEncoders(MsgRevoke), + converters: toConverters(MsgRevoke) +}); +export const useRevoke = buildUseMutation({ + builderMutationFn: createRevoke +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/authz/v1beta1/tx.ts b/libs/injective-query/src/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 00000000..80640ebe --- /dev/null +++ b/libs/injective-query/src/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,647 @@ +import { Grant, GrantAmino } from "./authz"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrant { + granter: string; + grantee: string; + grant: Grant; +} +export interface MsgGrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; + value: Uint8Array; +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantAmino { + granter: string; + grantee: string; + grant: GrantAmino; +} +export interface MsgGrantAminoMsg { + type: "cosmos-sdk/MsgGrant"; + value: MsgGrantAmino; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; + value: Uint8Array; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: "cosmos-sdk/MsgGrantResponse"; + value: MsgGrantResponseAmino; +} +/** + * 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. + */ +export interface MsgExec { + grantee: string; + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (Any)[] | Any[]; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExec"; + value: Uint8Array; +} +export type MsgExecEncoded = Omit & { + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (AnyProtoMsg)[]; +}; +/** + * 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. + */ +export interface MsgExecAmino { + grantee: string; + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: AnyAmino[]; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/MsgExec"; + value: MsgExecAmino; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[]; +} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results: string[]; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevoke { + granter: string; + grantee: string; + msgTypeUrl: string; +} +export interface MsgRevokeProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; + value: Uint8Array; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeAmino { + granter: string; + grantee: string; + msg_type_url: string; +} +export interface MsgRevokeAminoMsg { + type: "cosmos-sdk/MsgRevoke"; + value: MsgRevokeAmino; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponse {} +export interface MsgRevokeResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; + value: Uint8Array; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseAmino {} +export interface MsgRevokeResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeResponse"; + value: MsgRevokeResponseAmino; +} +function createBaseMsgGrant(): MsgGrant { + return { + granter: "", + grantee: "", + grant: Grant.fromPartial({}) + }; +} +export const MsgGrant = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + aminoType: "cosmos-sdk/MsgGrant", + is(o: any): o is MsgGrant { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.is(o.grant)); + }, + isAmino(o: any): o is MsgGrantAmino { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.isAmino(o.grant)); + }, + encode(message: MsgGrant, 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.grant !== undefined) { + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrant(); + 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.grant = Grant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgGrant { + const message = createBaseMsgGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.grant = object.grant !== undefined && object.grant !== null ? Grant.fromPartial(object.grant) : undefined; + return message; + }, + fromAmino(object: MsgGrantAmino): MsgGrant { + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; + }, + toAmino(message: MsgGrant): MsgGrantAmino { + 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) : Grant.toAmino(Grant.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { + return MsgGrant.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrant): MsgGrantAminoMsg { + return { + type: "cosmos-sdk/MsgGrant", + value: MsgGrant.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant { + return MsgGrant.decode(message.value); + }, + toProto(message: MsgGrant): Uint8Array { + return MsgGrant.encode(message).finish(); + }, + toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrant.typeUrl, MsgGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrant.aminoType, MsgGrant.typeUrl); +function createBaseMsgGrantResponse(): MsgGrantResponse { + return {}; +} +export const MsgGrantResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + aminoType: "cosmos-sdk/MsgGrantResponse", + is(o: any): o is MsgGrantResponse { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + isAmino(o: any): o is MsgGrantResponseAmino { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantResponse", + value: MsgGrantResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { + return MsgGrantResponse.decode(message.value); + }, + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + value: MsgGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantResponse.typeUrl, MsgGrantResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantResponse.aminoType, MsgGrantResponse.typeUrl); +function createBaseMsgExec(): MsgExec { + return { + grantee: "", + msgs: [] + }; +} +export const MsgExec = { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + aminoType: "cosmos-sdk/MsgExec", + is(o: any): o is MsgExec { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.is(o.msgs[0]))); + }, + isAmino(o: any): o is MsgExecAmino { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.isAmino(o.msgs[0]))); + }, + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + for (const v of message.msgs) { + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(18).fork()).ldelim(); + } + 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.grantee = reader.string(); + break; + case 2: + message.msgs.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExec { + const message = createBaseMsgExec(); + message.grantee = object.grantee ?? ""; + message.msgs = object.msgs?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + return message; + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; + }, + toAmino(message: MsgExec): MsgExecAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.msgs = message.msgs; + } + return obj; + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value); + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: "cosmos-sdk/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.authz.v1beta1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExec.typeUrl, MsgExec); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExec.aminoType, MsgExec.typeUrl); +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [] + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + aminoType: "cosmos-sdk/MsgExecResponse", + is(o: any): o is MsgExecResponse { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + isAmino(o: any): o is MsgExecResponseAmino { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + 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): 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 1: + message.results.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; + }, + 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: 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.authz.v1beta1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecResponse.aminoType, MsgExecResponse.typeUrl); +function createBaseMsgRevoke(): MsgRevoke { + return { + granter: "", + grantee: "", + msgTypeUrl: "" + }; +} +export const MsgRevoke = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + aminoType: "cosmos-sdk/MsgRevoke", + is(o: any): o is MsgRevoke { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msgTypeUrl === "string"); + }, + isAmino(o: any): o is MsgRevokeAmino { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, + encode(message: MsgRevoke, 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.msgTypeUrl !== "") { + writer.uint32(26).string(message.msgTypeUrl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevoke(); + 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.msgTypeUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevoke { + const message = createBaseMsgRevoke(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.msgTypeUrl = object.msgTypeUrl ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAmino): MsgRevoke { + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; + }, + toAmino(message: MsgRevoke): MsgRevokeAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + return obj; + }, + fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { + return MsgRevoke.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg { + return { + type: "cosmos-sdk/MsgRevoke", + value: MsgRevoke.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke { + return MsgRevoke.decode(message.value); + }, + toProto(message: MsgRevoke): Uint8Array { + return MsgRevoke.encode(message).finish(); + }, + toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevoke.typeUrl, MsgRevoke); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevoke.aminoType, MsgRevoke.typeUrl); +function createBaseMsgRevokeResponse(): MsgRevokeResponse { + return {}; +} +export const MsgRevokeResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + aminoType: "cosmos-sdk/MsgRevokeResponse", + is(o: any): o is MsgRevokeResponse { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeResponseAmino { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { + return MsgRevokeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeResponse", + value: MsgRevokeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value); + }, + toProto(message: MsgRevokeResponse): Uint8Array { + return MsgRevokeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + value: MsgRevokeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeResponse.typeUrl, MsgRevokeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeResponse.aminoType, MsgRevokeResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/bank/v1beta1/bank.ts b/libs/injective-query/src/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..2c115ba3 --- /dev/null +++ b/libs/injective-query/src/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,974 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Params"; + value: Uint8Array; +} +/** 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/x/bank/Params"; + value: ParamsAmino; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} +export interface SendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled"; + value: Uint8Array; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledAmino { + denom: string; + enabled: boolean; +} +export interface SendEnabledAminoMsg { + type: "cosmos-sdk/SendEnabled"; + value: SendEnabledAmino; +} +/** Input models transaction input. */ +export interface Input { + address: string; + coins: Coin[]; +} +export interface InputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Input"; + value: Uint8Array; +} +/** Input models transaction input. */ +export interface InputAmino { + address: string; + coins: CoinAmino[]; +} +export interface InputAminoMsg { + type: "cosmos-sdk/Input"; + value: InputAmino; +} +/** Output models transaction outputs. */ +export interface Output { + address: string; + coins: Coin[]; +} +export interface OutputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Output"; + value: Uint8Array; +} +/** Output models transaction outputs. */ +export interface OutputAmino { + address: string; + coins: CoinAmino[]; +} +export interface OutputAminoMsg { + type: "cosmos-sdk/Output"; + value: OutputAmino; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface Supply { + total: Coin[]; +} +export interface SupplyProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Supply"; + value: Uint8Array; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplyAmino { + total: CoinAmino[]; +} +export interface SupplyAminoMsg { + type: "cosmos-sdk/Supply"; + value: SupplyAmino; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * 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 = 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). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit"; + value: Uint8Array; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitAmino { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * 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 = 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). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitAminoMsg { + type: "cosmos-sdk/DenomUnit"; + value: DenomUnitAmino; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * 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"; + value: Uint8Array; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataAmino { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denom_units: DenomUnitAmino[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * 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"; + value: MetadataAmino; +} +function createBaseParams(): Params { + return { + sendEnabled: [], + defaultSendEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.bank.v1beta1.Params", + aminoType: "cosmos-sdk/x/bank/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && typeof o.defaultSendEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && typeof o.default_send_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); + } + 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.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + 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.default_send_enabled = message.defaultSendEnabled === false ? undefined : message.defaultSendEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/bank/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.bank.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseSendEnabled(): SendEnabled { + return { + denom: "", + enabled: false + }; +} +export const SendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + aminoType: "cosmos-sdk/SendEnabled", + is(o: any): o is SendEnabled { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + isAmino(o: any): o is SendEnabledAmino { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ""; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: SendEnabledAmino): SendEnabled { + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: SendEnabled): SendEnabledAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { + return SendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { + return { + type: "cosmos-sdk/SendEnabled", + value: SendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { + return SendEnabled.decode(message.value); + }, + toProto(message: SendEnabled): Uint8Array { + return SendEnabled.encode(message).finish(); + }, + toProtoMsg(message: SendEnabled): SendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + value: SendEnabled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SendEnabled.typeUrl, SendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(SendEnabled.aminoType, SendEnabled.typeUrl); +function createBaseInput(): Input { + return { + address: "", + coins: [] + }; +} +export const Input = { + typeUrl: "/cosmos.bank.v1beta1.Input", + aminoType: "cosmos-sdk/Input", + is(o: any): o is Input { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is InputAmino { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Input { + const message = createBaseInput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InputAmino): Input { + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Input): InputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: InputAminoMsg): Input { + return Input.fromAmino(object.value); + }, + toAminoMsg(message: Input): InputAminoMsg { + return { + type: "cosmos-sdk/Input", + value: Input.toAmino(message) + }; + }, + fromProtoMsg(message: InputProtoMsg): Input { + return Input.decode(message.value); + }, + toProto(message: Input): Uint8Array { + return Input.encode(message).finish(); + }, + toProtoMsg(message: Input): InputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Input", + value: Input.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Input.typeUrl, Input); +GlobalDecoderRegistry.registerAminoProtoMapping(Input.aminoType, Input.typeUrl); +function createBaseOutput(): Output { + return { + address: "", + coins: [] + }; +} +export const Output = { + typeUrl: "/cosmos.bank.v1beta1.Output", + aminoType: "cosmos-sdk/Output", + is(o: any): o is Output { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is OutputAmino { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Output { + const message = createBaseOutput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OutputAmino): Output { + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Output): OutputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: OutputAminoMsg): Output { + return Output.fromAmino(object.value); + }, + toAminoMsg(message: Output): OutputAminoMsg { + return { + type: "cosmos-sdk/Output", + value: Output.toAmino(message) + }; + }, + fromProtoMsg(message: OutputProtoMsg): Output { + return Output.decode(message.value); + }, + toProto(message: Output): Uint8Array { + return Output.encode(message).finish(); + }, + toProtoMsg(message: Output): OutputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Output", + value: Output.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Output.typeUrl, Output); +GlobalDecoderRegistry.registerAminoProtoMapping(Output.aminoType, Output.typeUrl); +function createBaseSupply(): Supply { + return { + total: [] + }; +} +export const Supply = { + typeUrl: "/cosmos.bank.v1beta1.Supply", + aminoType: "cosmos-sdk/Supply", + is(o: any): o is Supply { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.is(o.total[0]))); + }, + isAmino(o: any): o is SupplyAmino { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.isAmino(o.total[0]))); + }, + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSupply(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SupplyAmino): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Supply): SupplyAmino { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total = message.total; + } + return obj; + }, + fromAminoMsg(object: SupplyAminoMsg): Supply { + return Supply.fromAmino(object.value); + }, + toAminoMsg(message: Supply): SupplyAminoMsg { + return { + type: "cosmos-sdk/Supply", + value: Supply.toAmino(message) + }; + }, + fromProtoMsg(message: SupplyProtoMsg): Supply { + return Supply.decode(message.value); + }, + toProto(message: Supply): Uint8Array { + return Supply.encode(message).finish(); + }, + toProtoMsg(message: Supply): SupplyProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Supply", + value: Supply.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Supply.typeUrl, Supply); +GlobalDecoderRegistry.registerAminoProtoMapping(Supply.aminoType, Supply.typeUrl); +function createBaseDenomUnit(): DenomUnit { + return { + denom: "", + exponent: 0, + aliases: [] + }; +} +export const DenomUnit = { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + aminoType: "cosmos-sdk/DenomUnit", + is(o: any): o is DenomUnit { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + isAmino(o: any): o is DenomUnitAmino { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent); + } + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomUnit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ""; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + fromAmino(object: DenomUnitAmino): DenomUnit { + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + toAmino(message: DenomUnit): DenomUnitAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + if (message.aliases) { + obj.aliases = message.aliases.map(e => e); + } else { + obj.aliases = message.aliases; + } + return obj; + }, + fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { + return DenomUnit.fromAmino(object.value); + }, + toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { + return { + type: "cosmos-sdk/DenomUnit", + value: DenomUnit.toAmino(message) + }; + }, + fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { + return DenomUnit.decode(message.value); + }, + toProto(message: DenomUnit): Uint8Array { + return DenomUnit.encode(message).finish(); + }, + toProtoMsg(message: DenomUnit): DenomUnitProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + value: DenomUnit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomUnit.typeUrl, DenomUnit); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomUnit.aminoType, DenomUnit.typeUrl); +function createBaseMetadata(): Metadata { + return { + description: "", + denomUnits: [], + base: "", + display: "", + name: "", + symbol: "", + uri: "", + uriHash: "" + }; +} +export const Metadata = { + typeUrl: "/cosmos.bank.v1beta1.Metadata", + aminoType: "cosmos-sdk/Metadata", + is(o: any): o is Metadata { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denomUnits) && (!o.denomUnits.length || DenomUnit.is(o.denomUnits[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uriHash === "string"); + }, + isAmino(o: any): o is MetadataAmino { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denom_units) && (!o.denom_units.length || DenomUnit.isAmino(o.denom_units[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uri_hash === "string"); + }, + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.display !== "") { + writer.uint32(34).string(message.display); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + 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 { + 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.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ""; + message.denomUnits = object.denomUnits?.map(e => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ""; + 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 { + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + 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 { + const obj: any = {}; + obj.description = message.description === "" ? undefined : message.description; + if (message.denomUnits) { + obj.denom_units = message.denomUnits.map(e => e ? DenomUnit.toAmino(e) : undefined); + } else { + obj.denom_units = message.denomUnits; + } + obj.base = message.base === "" ? undefined : message.base; + 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 { + 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.bank.v1beta1.Metadata", + value: Metadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping(Metadata.aminoType, Metadata.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/injective-query/src/cosmos/bank/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..3ba6a682 --- /dev/null +++ b/libs/injective-query/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -0,0 +1,146 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-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"; +export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceRequest.encode, + decode: QueryBalanceResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Balance", + clientResolver +}); +export const useGetBalance = buildUseQuery({ + builderQueryFn: createGetBalance, + queryKeyPrefix: "BalanceQuery" +}); +export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllBalancesRequest.encode, + decode: QueryAllBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "AllBalances", + clientResolver +}); +export const useGetAllBalances = buildUseQuery({ + builderQueryFn: createGetAllBalances, + queryKeyPrefix: "AllBalancesQuery" +}); +export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalancesRequest.encode, + decode: QuerySpendableBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalances", + clientResolver +}); +export const useGetSpendableBalances = buildUseQuery({ + builderQueryFn: createGetSpendableBalances, + queryKeyPrefix: "SpendableBalancesQuery" +}); +export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalanceByDenomRequest.encode, + decode: QuerySpendableBalanceByDenomResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalanceByDenom", + clientResolver +}); +export const useGetSpendableBalanceByDenom = buildUseQuery({ + builderQueryFn: createGetSpendableBalanceByDenom, + queryKeyPrefix: "SpendableBalanceByDenomQuery" +}); +export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTotalSupplyRequest.encode, + decode: QueryTotalSupplyResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "TotalSupply", + clientResolver +}); +export const useGetTotalSupply = buildUseQuery({ + builderQueryFn: createGetTotalSupply, + queryKeyPrefix: "TotalSupplyQuery" +}); +export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySupplyOfRequest.encode, + decode: QuerySupplyOfResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SupplyOf", + clientResolver +}); +export const useGetSupplyOf = buildUseQuery({ + builderQueryFn: createGetSupplyOf, + queryKeyPrefix: "SupplyOfQuery" +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataRequest.encode, + decode: QueryDenomMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadata", + clientResolver +}); +export const useGetDenomMetadata = buildUseQuery({ + builderQueryFn: createGetDenomMetadata, + queryKeyPrefix: "DenomMetadataQuery" +}); +export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataByQueryStringRequest.encode, + decode: QueryDenomMetadataByQueryStringResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadataByQueryString", + clientResolver +}); +export const useGetDenomMetadataByQueryString = buildUseQuery({ + builderQueryFn: createGetDenomMetadataByQueryString, + queryKeyPrefix: "DenomMetadataByQueryStringQuery" +}); +export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsMetadataRequest.encode, + decode: QueryDenomsMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomsMetadata", + clientResolver +}); +export const useGetDenomsMetadata = buildUseQuery({ + builderQueryFn: createGetDenomsMetadata, + queryKeyPrefix: "DenomsMetadataQuery" +}); +export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersRequest.encode, + decode: QueryDenomOwnersResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwners", + clientResolver +}); +export const useGetDenomOwners = buildUseQuery({ + builderQueryFn: createGetDenomOwners, + queryKeyPrefix: "DenomOwnersQuery" +}); +export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersByQueryRequest.encode, + decode: QueryDenomOwnersByQueryResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwnersByQuery", + clientResolver +}); +export const useGetDenomOwnersByQuery = buildUseQuery({ + builderQueryFn: createGetDenomOwnersByQuery, + queryKeyPrefix: "DenomOwnersByQueryQuery" +}); +export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySendEnabledRequest.encode, + decode: QuerySendEnabledResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SendEnabled", + clientResolver +}); +export const useGetSendEnabled = buildUseQuery({ + builderQueryFn: createGetSendEnabled, + queryKeyPrefix: "SendEnabledQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/bank/v1beta1/query.ts b/libs/injective-query/src/cosmos/bank/v1beta1/query.ts new file mode 100644 index 00000000..45f3fa82 --- /dev/null +++ b/libs/injective-query/src/cosmos/bank/v1beta1/query.ts @@ -0,0 +1,3027 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, Metadata, MetadataAmino, SendEnabled, SendEnabledAmino } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QueryBalanceRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequestAmino { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QueryBalanceRequestAminoMsg { + type: "cosmos-sdk/QueryBalanceRequest"; + value: QueryBalanceRequestAmino; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QueryBalanceResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; + value: Uint8Array; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QueryBalanceResponseAminoMsg { + type: "cosmos-sdk/QueryBalanceResponse"; + value: QueryBalanceResponseAmino; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequest { + /** address is the address to query balances for. */ + 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"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequestAmino { + /** address is the address to query balances for. */ + 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"; + value: QueryAllBalancesRequestAmino; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponse { + /** balances is the balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; + value: Uint8Array; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponseAmino { + /** balances is the balances of all the coins. */ + balances: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllBalancesResponseAminoMsg { + type: "cosmos-sdk/QueryAllBalancesResponse"; + value: QueryAllBalancesResponseAmino; +} +/** + * 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. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QuerySpendableBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; + value: Uint8Array; +} +/** + * 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. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QuerySpendableBalancesRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesRequest"; + value: QuerySpendableBalancesRequestAmino; +} +/** + * 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. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QuerySpendableBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; + value: Uint8Array; +} +/** + * 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[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QuerySpendableBalancesResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesResponse"; + value: QuerySpendableBalancesResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequest { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequest; +} +export interface QueryTotalSupplyRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; + value: Uint8Array; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequestAmino { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequestAmino; +} +export interface QueryTotalSupplyRequestAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyRequest"; + value: QueryTotalSupplyRequestAmino; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponse { + /** supply is the supply of the coins */ + supply: Coin[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponse; +} +export interface QueryTotalSupplyResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; + value: Uint8Array; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponseAmino { + /** supply is the supply of the coins */ + supply: CoinAmino[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponseAmino; +} +export interface QueryTotalSupplyResponseAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyResponse"; + value: QueryTotalSupplyResponseAmino; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequest { + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySupplyOfRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest"; + value: Uint8Array; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequestAmino { + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySupplyOfRequestAminoMsg { + type: "cosmos-sdk/QuerySupplyOfRequest"; + value: QuerySupplyOfRequestAmino; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponse { + /** amount is the supply of the coin. */ + amount: Coin; +} +export interface QuerySupplyOfResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse"; + value: Uint8Array; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponseAmino { + /** amount is the supply of the coin. */ + amount: CoinAmino; +} +export interface QuerySupplyOfResponseAminoMsg { + type: "cosmos-sdk/QuerySupplyOfResponse"; + value: QuerySupplyOfResponseAmino; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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 { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponseAmino { + /** params provides the parameters of the bank module. */ + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomsMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomsMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataRequest"; + value: QueryDenomsMetadataRequestAmino; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponse { + /** metadata provides the client information for all the registered tokens. */ + metadatas: Metadata[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomsMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponseAmino { + /** metadata provides the client information for all the registered tokens. */ + metadatas: MetadataAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomsMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataResponse"; + value: QueryDenomsMetadataResponseAmino; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequest { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequestAmino { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataRequest"; + value: QueryDenomMetadataRequestAmino; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponse { + /** metadata describes and provides all the client information for the requested token. */ + metadata: Metadata; +} +export interface QueryDenomMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponseAmino { + /** metadata describes and provides all the client information for the requested token. */ + metadata: MetadataAmino; +} +export interface QueryDenomMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataResponse"; + value: QueryDenomMetadataResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { + address: "", + denom: "" + }; +} +export const QueryBalanceRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + aminoType: "cosmos-sdk/QueryBalanceRequest", + is(o: any): o is QueryBalanceRequest { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryBalanceRequestAmino { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + encode(message: QueryBalanceRequest, 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): 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.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + 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: QueryBalanceRequest): QueryBalanceRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + 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.bank.v1beta1.QueryBalanceRequest", + value: QueryBalanceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceRequest.typeUrl, QueryBalanceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceRequest.aminoType, QueryBalanceRequest.typeUrl); +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { + balance: undefined + }; +} +export const QueryBalanceResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + aminoType: "cosmos-sdk/QueryBalanceResponse", + is(o: any): o is QueryBalanceResponse { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + isAmino(o: any): o is QueryBalanceResponseAmino { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + encode(message: QueryBalanceResponse, 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): 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.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance) : 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.bank.v1beta1.QueryBalanceResponse", + value: QueryBalanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceResponse.typeUrl, QueryBalanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceResponse.aminoType, QueryBalanceResponse.typeUrl); +function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { + return { + address: "", + pagination: undefined, + resolveDenom: false + }; +} +export const QueryAllBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + aminoType: "cosmos-sdk/QueryAllBalancesRequest", + is(o: any): o is QueryAllBalancesRequest { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolveDenom === "boolean"); + }, + isAmino(o: any): o is QueryAllBalancesRequestAmino { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolve_denom === "boolean"); + }, + encode(message: QueryAllBalancesRequest, 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(); + } + if (message.resolveDenom === true) { + writer.uint32(24).bool(message.resolveDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesRequest(); + 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; + case 3: + message.resolveDenom = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + 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 { + return QueryAllBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesRequest", + value: QueryAllBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesRequestProtoMsg): QueryAllBalancesRequest { + return QueryAllBalancesRequest.decode(message.value); + }, + toProto(message: QueryAllBalancesRequest): Uint8Array { + return QueryAllBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + value: QueryAllBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllBalancesRequest.typeUrl, QueryAllBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesRequest.aminoType, QueryAllBalancesRequest.typeUrl); +function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QueryAllBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + aminoType: "cosmos-sdk/QueryAllBalancesResponse", + is(o: any): o is QueryAllBalancesResponse { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is QueryAllBalancesResponseAmino { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.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): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.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: DeepPartial): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllBalancesResponseAminoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesResponse", + value: QueryAllBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesResponseProtoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.decode(message.value); + }, + toProto(message: QueryAllBalancesResponse): Uint8Array { + return QueryAllBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + value: QueryAllBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllBalancesResponse.typeUrl, QueryAllBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesResponse.aminoType, QueryAllBalancesResponse.typeUrl); +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { + return { + address: "", + pagination: undefined + }; +} +export const QuerySpendableBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + aminoType: "cosmos-sdk/QuerySpendableBalancesRequest", + is(o: any): o is QuerySpendableBalancesRequest { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QuerySpendableBalancesRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QuerySpendableBalancesRequest, 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): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesRequest(); + 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: DeepPartial): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + 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: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesRequestAminoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesRequestProtoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalancesRequest): Uint8Array { + return QuerySpendableBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesRequest.typeUrl, QuerySpendableBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesRequest.aminoType, QuerySpendableBalancesRequest.typeUrl); +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QuerySpendableBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + aminoType: "cosmos-sdk/QuerySpendableBalancesResponse", + is(o: any): o is QuerySpendableBalancesResponse { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is QuerySpendableBalancesResponseAmino { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.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): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.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: DeepPartial): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesResponseAminoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesResponseProtoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalancesResponse): Uint8Array { + return QuerySpendableBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesResponse.typeUrl, QuerySpendableBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesResponse.aminoType, QuerySpendableBalancesResponse.typeUrl); +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { + return { + address: "", + denom: "" + }; +} +export const QuerySpendableBalanceByDenomRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + is(o: any): o is QuerySpendableBalanceByDenomRequest { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + 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): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + 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: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomRequestAminoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomRequestProtoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomRequest): Uint8Array { + return QuerySpendableBalanceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomRequest.typeUrl, QuerySpendableBalanceByDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomRequest.aminoType, QuerySpendableBalanceByDenomRequest.typeUrl); +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { + balance: undefined + }; +} +export const QuerySpendableBalanceByDenomResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + is(o: any): o is QuerySpendableBalanceByDenomResponse { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomResponseAmino { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomResponse.typeUrl, QuerySpendableBalanceByDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomResponse.aminoType, QuerySpendableBalanceByDenomResponse.typeUrl); +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { + pagination: undefined + }; +} +export const QueryTotalSupplyRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + aminoType: "cosmos-sdk/QueryTotalSupplyRequest", + is(o: any): o is QueryTotalSupplyRequest { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + isAmino(o: any): o is QueryTotalSupplyRequestAmino { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + 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: DeepPartial): 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 { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalSupplyRequest.typeUrl, QueryTotalSupplyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyRequest.aminoType, QueryTotalSupplyRequest.typeUrl); +function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { + return { + supply: [], + pagination: undefined + }; +} +export const QueryTotalSupplyResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + aminoType: "cosmos-sdk/QueryTotalSupplyResponse", + is(o: any): o is QueryTotalSupplyResponse { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0]))); + }, + isAmino(o: any): o is QueryTotalSupplyResponseAmino { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0]))); + }, + encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.supply) { + Coin.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): QueryTotalSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supply.push(Coin.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: DeepPartial): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.supply = message.supply; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyResponseAminoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyResponseProtoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.decode(message.value); + }, + toProto(message: QueryTotalSupplyResponse): Uint8Array { + return QueryTotalSupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalSupplyResponse.typeUrl, QueryTotalSupplyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyResponse.aminoType, QueryTotalSupplyResponse.typeUrl); +function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { + return { + denom: "" + }; +} +export const QuerySupplyOfRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + aminoType: "cosmos-sdk/QuerySupplyOfRequest", + is(o: any): o is QuerySupplyOfRequest { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySupplyOfRequestAmino { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfRequest(); + 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: DeepPartial): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySupplyOfRequestAminoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfRequest", + value: QuerySupplyOfRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfRequestProtoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.decode(message.value); + }, + toProto(message: QuerySupplyOfRequest): Uint8Array { + return QuerySupplyOfRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + value: QuerySupplyOfRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySupplyOfRequest.typeUrl, QuerySupplyOfRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfRequest.aminoType, QuerySupplyOfRequest.typeUrl); +function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QuerySupplyOfResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + aminoType: "cosmos-sdk/QuerySupplyOfResponse", + is(o: any): o is QuerySupplyOfResponse { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.is(o.amount)); + }, + isAmino(o: any): o is QuerySupplyOfResponseAmino { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QuerySupplyOfResponse, 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): QuerySupplyOfResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfResponse(); + 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: DeepPartial): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfResponse", + value: QuerySupplyOfResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfResponseProtoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.decode(message.value); + }, + toProto(message: QuerySupplyOfResponse): Uint8Array { + return QuerySupplyOfResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + value: QuerySupplyOfResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySupplyOfResponse.typeUrl, QuerySupplyOfResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfResponse.aminoType, QuerySupplyOfResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.bank.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.bank.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { + return { + pagination: undefined + }; +} +export const QueryDenomsMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomsMetadataRequest", + is(o: any): o is QueryDenomsMetadataRequest { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + isAmino(o: any): o is QueryDenomsMetadataRequestAmino { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + encode(message: QueryDenomsMetadataRequest, 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): QueryDenomsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataRequest(); + 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: DeepPartial): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataRequestAminoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataRequestProtoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomsMetadataRequest): Uint8Array { + return QueryDenomsMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsMetadataRequest.typeUrl, QueryDenomsMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataRequest.aminoType, QueryDenomsMetadataRequest.typeUrl); +function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { + return { + metadatas: [], + pagination: undefined + }; +} +export const QueryDenomsMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomsMetadataResponse", + is(o: any): o is QueryDenomsMetadataResponse { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.is(o.metadatas[0]))); + }, + isAmino(o: any): o is QueryDenomsMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.isAmino(o.metadatas[0]))); + }, + encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.metadatas) { + Metadata.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): QueryDenomsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadatas.push(Metadata.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: DeepPartial): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { + const obj: any = {}; + if (message.metadatas) { + obj.metadatas = message.metadatas.map(e => e ? Metadata.toAmino(e) : undefined); + } else { + obj.metadatas = message.metadatas; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataResponseAminoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataResponseProtoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomsMetadataResponse): Uint8Array { + return QueryDenomsMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsMetadataResponse.typeUrl, QueryDenomsMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataResponse.aminoType, QueryDenomsMetadataResponse.typeUrl); +function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomMetadataRequest", + is(o: any): o is QueryDenomMetadataRequest { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataRequest(); + 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: DeepPartial): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataRequestAminoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataRequestProtoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomMetadataRequest): Uint8Array { + return QueryDenomMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataRequest.typeUrl, QueryDenomMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataRequest.aminoType, QueryDenomMetadataRequest.typeUrl); +function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomMetadataResponse", + is(o: any): o is QueryDenomMetadataResponse { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.is(o.metadata)); + }, + isAmino(o: any): o is QueryDenomMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.isAmino(o.metadata)); + }, + encode(message: QueryDenomMetadataResponse, 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): QueryDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataResponse(); + 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: DeepPartial): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { + const obj: any = {}; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.toAmino(Metadata.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataResponseProtoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomMetadataResponse): Uint8Array { + return QueryDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataResponse.typeUrl, QueryDenomMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataResponse.aminoType, QueryDenomMetadataResponse.typeUrl); +function createBaseQueryDenomMetadataByQueryStringRequest(): QueryDenomMetadataByQueryStringRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataByQueryStringRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + aminoType: "cosmos-sdk/QueryDenomMetadataByQueryStringRequest", + is(o: any): o is QueryDenomMetadataByQueryStringRequest { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomMetadataByQueryStringRequestAmino { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataByQueryStringRequest.typeUrl, QueryDenomMetadataByQueryStringRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataByQueryStringRequest.aminoType, QueryDenomMetadataByQueryStringRequest.typeUrl); +function createBaseQueryDenomMetadataByQueryStringResponse(): QueryDenomMetadataByQueryStringResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataByQueryStringResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + aminoType: "cosmos-sdk/QueryDenomMetadataByQueryStringResponse", + is(o: any): o is QueryDenomMetadataByQueryStringResponse { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringResponse.typeUrl || Metadata.is(o.metadata)); + }, + isAmino(o: any): o is QueryDenomMetadataByQueryStringResponseAmino { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringResponse.typeUrl || Metadata.isAmino(o.metadata)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataByQueryStringResponse.typeUrl, QueryDenomMetadataByQueryStringResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataByQueryStringResponse.aminoType, QueryDenomMetadataByQueryStringResponse.typeUrl); +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + aminoType: "cosmos-sdk/QueryDenomOwnersRequest", + is(o: any): o is QueryDenomOwnersRequest { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomOwnersRequestAmino { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersRequest.typeUrl, QueryDenomOwnersRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersRequest.aminoType, QueryDenomOwnersRequest.typeUrl); +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + aminoType: "cosmos-sdk/DenomOwner", + is(o: any): o is DenomOwner { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.is(o.balance)); + }, + isAmino(o: any): o is DenomOwnerAmino { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.isAmino(o.balance)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DenomOwner.typeUrl, DenomOwner); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomOwner.aminoType, DenomOwner.typeUrl); +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + aminoType: "cosmos-sdk/QueryDenomOwnersResponse", + is(o: any): o is QueryDenomOwnersResponse { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denomOwners) && (!o.denomOwners.length || DenomOwner.is(o.denomOwners[0]))); + }, + isAmino(o: any): o is QueryDenomOwnersResponseAmino { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isAmino(o.denom_owners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersResponse.typeUrl, QueryDenomOwnersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersResponse.aminoType, QueryDenomOwnersResponse.typeUrl); +function createBaseQueryDenomOwnersByQueryRequest(): QueryDenomOwnersByQueryRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", + aminoType: "cosmos-sdk/QueryDenomOwnersByQueryRequest", + is(o: any): o is QueryDenomOwnersByQueryRequest { + return o && (o.$typeUrl === QueryDenomOwnersByQueryRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomOwnersByQueryRequestAmino { + return o && (o.$typeUrl === QueryDenomOwnersByQueryRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersByQueryRequest.typeUrl, QueryDenomOwnersByQueryRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersByQueryRequest.aminoType, QueryDenomOwnersByQueryRequest.typeUrl); +function createBaseQueryDenomOwnersByQueryResponse(): QueryDenomOwnersByQueryResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", + aminoType: "cosmos-sdk/QueryDenomOwnersByQueryResponse", + is(o: any): o is QueryDenomOwnersByQueryResponse { + return o && (o.$typeUrl === QueryDenomOwnersByQueryResponse.typeUrl || Array.isArray(o.denomOwners) && (!o.denomOwners.length || DenomOwner.is(o.denomOwners[0]))); + }, + isAmino(o: any): o is QueryDenomOwnersByQueryResponseAmino { + return o && (o.$typeUrl === QueryDenomOwnersByQueryResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isAmino(o.denom_owners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersByQueryResponse.typeUrl, QueryDenomOwnersByQueryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersByQueryResponse.aminoType, QueryDenomOwnersByQueryResponse.typeUrl); +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { + return { + denoms: [], + pagination: undefined + }; +} +export const QuerySendEnabledRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + aminoType: "cosmos-sdk/QuerySendEnabledRequest", + is(o: any): o is QuerySendEnabledRequest { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QuerySendEnabledRequestAmino { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySendEnabledRequest.typeUrl, QuerySendEnabledRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledRequest.aminoType, QuerySendEnabledRequest.typeUrl); +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { + sendEnabled: [], + pagination: undefined + }; +} +export const QuerySendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + aminoType: "cosmos-sdk/QuerySendEnabledResponse", + is(o: any): o is QuerySendEnabledResponse { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0]))); + }, + isAmino(o: any): o is QuerySendEnabledResponseAmino { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySendEnabledResponse.typeUrl, QuerySendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledResponse.aminoType, QuerySendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/bank/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aa76bfe3 --- /dev/null +++ b/libs/injective-query/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -0,0 +1,40 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSend.typeUrl, + encoders: toEncoders(MsgSend), + converters: toConverters(MsgSend) +}); +export const useSend = buildUseMutation({ + builderMutationFn: createSend +}); +export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMultiSend.typeUrl, + encoders: toEncoders(MsgMultiSend), + converters: toConverters(MsgMultiSend) +}); +export const useMultiSend = buildUseMutation({ + builderMutationFn: createMultiSend +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetSendEnabled.typeUrl, + encoders: toEncoders(MsgSetSendEnabled), + converters: toConverters(MsgSetSendEnabled) +}); +export const useSetSendEnabled = buildUseMutation({ + builderMutationFn: createSetSendEnabled +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/bank/v1beta1/tx.ts b/libs/injective-query/src/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..afc67365 --- /dev/null +++ b/libs/injective-query/src/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,861 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Input, InputAmino, Output, OutputAmino, Params, ParamsAmino, SendEnabled, SendEnabledAmino } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSend"; + value: Uint8Array; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendAmino { + from_address: string; + to_address: string; + amount: CoinAmino[]; +} +export interface MsgSendAminoMsg { + type: "cosmos-sdk/MsgSend"; + value: MsgSendAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse"; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: "cosmos-sdk/MsgSendResponse"; + value: MsgSendResponseAmino; +} +/** 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[]; +} +export interface MsgMultiSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend"; + value: Uint8Array; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendAmino { + /** + * 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"; + value: MsgMultiSendAmino; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse"; + value: Uint8Array; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseAmino {} +export interface MsgMultiSendResponseAminoMsg { + type: "cosmos-sdk/MsgMultiSendResponse"; + value: MsgMultiSendResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSend(): MsgSend { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + aminoType: "cosmos-sdk/MsgSend", + is(o: any): o is MsgSend { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgSendAmino { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: MsgSend, 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): 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.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: DeepPartial): MsgSend { + const message = createBaseMsgSend(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSendAmino): MsgSend { + const message = createBaseMsgSend(); + 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: MsgSend): MsgSendAmino { + 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: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: "cosmos-sdk/MsgSend", + 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.bank.v1beta1.MsgSend", + value: MsgSend.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSend.typeUrl, MsgSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSend.aminoType, MsgSend.typeUrl); +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} +export const MsgSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + aminoType: "cosmos-sdk/MsgSendResponse", + is(o: any): o is MsgSendResponse { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendResponseAmino { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + 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(_: DeepPartial): 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.bank.v1beta1.MsgSendResponse", + value: MsgSendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendResponse.typeUrl, MsgSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendResponse.aminoType, MsgSendResponse.typeUrl); +function createBaseMsgMultiSend(): MsgMultiSend { + return { + inputs: [], + outputs: [] + }; +} +export const MsgMultiSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + aminoType: "cosmos-sdk/MsgMultiSend", + is(o: any): o is MsgMultiSend { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.is(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.is(o.outputs[0]))); + }, + isAmino(o: any): o is MsgMultiSendAmino { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.isAmino(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.isAmino(o.outputs[0]))); + }, + encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromPartial(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgMultiSendAmino): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgMultiSend): MsgMultiSendAmino { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map(e => e ? Input.toAmino(e) : undefined); + } else { + obj.inputs = message.inputs; + } + if (message.outputs) { + obj.outputs = message.outputs.map(e => e ? Output.toAmino(e) : undefined); + } else { + obj.outputs = message.outputs; + } + return obj; + }, + fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { + return MsgMultiSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSend", + value: MsgMultiSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { + return MsgMultiSend.decode(message.value); + }, + toProto(message: MsgMultiSend): Uint8Array { + return MsgMultiSend.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSend): MsgMultiSendProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMultiSend.typeUrl, MsgMultiSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSend.aminoType, MsgMultiSend.typeUrl); +function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { + return {}; +} +export const MsgMultiSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + aminoType: "cosmos-sdk/MsgMultiSendResponse", + is(o: any): o is MsgMultiSendResponse { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgMultiSendResponseAmino { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSendResponse", + value: MsgMultiSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.decode(message.value); + }, + toProto(message: MsgMultiSendResponse): Uint8Array { + return MsgMultiSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + value: MsgMultiSendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMultiSendResponse.typeUrl, MsgMultiSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSendResponse.aminoType, MsgMultiSendResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: "", + sendEnabled: [], + useDefaultFor: [] + }; +} +export const MsgSetSendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + aminoType: "cosmos-sdk/MsgSetSendEnabled", + is(o: any): o is MsgSetSendEnabled { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && Array.isArray(o.useDefaultFor) && (!o.useDefaultFor.length || typeof o.useDefaultFor[0] === "string")); + }, + isAmino(o: any): o is MsgSetSendEnabledAmino { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && Array.isArray(o.use_default_for) && (!o.use_default_for.length || typeof o.use_default_for[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabled.typeUrl, MsgSetSendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabled.aminoType, MsgSetSendEnabled.typeUrl); +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + aminoType: "cosmos-sdk/MsgSetSendEnabledResponse", + is(o: any): o is MsgSetSendEnabledResponse { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetSendEnabledResponseAmino { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabledResponse.typeUrl, MsgSetSendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabledResponse.aminoType, MsgSetSendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/base/abci/v1beta1/abci.ts b/libs/injective-query/src/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 00000000..06316ec9 --- /dev/null +++ b/libs/injective-query/src/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,1698 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Event, EventAmino } from "../../../../tendermint/abci/types"; +import { Block, BlockAmino } from "../../../../tendermint/types/block"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponse { + /** The block height */ + height: bigint; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + rawLog: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLog[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gasWanted: bigint; + /** Amount of gas consumed by transaction. */ + gasUsed: bigint; + /** The request transaction bytes. */ + tx?: Any; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; + /** + * 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. 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 + */ + events: Event[]; +} +export interface TxResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse"; + value: Uint8Array; +} +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponseAmino { + /** The block height */ + height: string; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + raw_log: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLogAmino[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gas_wanted: string; + /** Amount of gas consumed by transaction. */ + gas_used: string; + /** The request transaction bytes. */ + tx?: AnyAmino; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; + /** + * 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. 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 + */ + events: EventAmino[]; +} +export interface TxResponseAminoMsg { + type: "cosmos-sdk/TxResponse"; + value: TxResponseAmino; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLog { + msgIndex: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEvent[]; +} +export interface ABCIMessageLogProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog"; + value: Uint8Array; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLogAmino { + msg_index: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEventAmino[]; +} +export interface ABCIMessageLogAminoMsg { + type: "cosmos-sdk/ABCIMessageLog"; + value: ABCIMessageLogAmino; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEvent { + type: string; + attributes: Attribute[]; +} +export interface StringEventProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent"; + value: Uint8Array; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEventAmino { + type: string; + attributes: AttributeAmino[]; +} +export interface StringEventAminoMsg { + type: "cosmos-sdk/StringEvent"; + value: StringEventAmino; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface Attribute { + key: string; + value: string; +} +export interface AttributeProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute"; + value: Uint8Array; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface AttributeAmino { + key: string; + value: string; +} +export interface AttributeAminoMsg { + type: "cosmos-sdk/Attribute"; + value: AttributeAmino; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfo { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gasWanted: bigint; + /** GasUsed is the amount of gas actually consumed. */ + gasUsed: bigint; +} +export interface GasInfoProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; + value: Uint8Array; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfoAmino { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gas_wanted: string; + /** GasUsed is the amount of gas actually consumed. */ + gas_used: string; +} +export interface GasInfoAminoMsg { + type: "cosmos-sdk/GasInfo"; + value: GasInfoAmino; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +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; + /** + * Events contains a slice of Event objects that were emitted during message + * 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"; + value: Uint8Array; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +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; + /** + * Events contains a slice of Event objects that were emitted during message + * 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"; + value: ResultAmino; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponse { + gasInfo: GasInfo; + result?: Result; +} +export interface SimulationResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; + value: Uint8Array; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponseAmino { + gas_info: GasInfoAmino; + result?: ResultAmino; +} +export interface SimulationResponseAminoMsg { + type: "cosmos-sdk/SimulationResponse"; + value: SimulationResponseAmino; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgData { + msgType: string; + data: Uint8Array; +} +export interface MsgDataProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData"; + value: Uint8Array; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgDataAmino { + msg_type: string; + data: string; +} +export interface MsgDataAminoMsg { + type: "cosmos-sdk/MsgData"; + value: MsgDataAmino; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * 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"; + value: Uint8Array; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * 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"; + value: TxMsgDataAmino; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResult { + /** Count of all txs */ + totalCount: bigint; + /** Count of txs in current page */ + count: bigint; + /** Index of current page, start from 1 */ + pageNumber: bigint; + /** Count of total pages */ + pageTotal: bigint; + /** Max count txs per page */ + limit: bigint; + /** List of txs in current page */ + txs: TxResponse[]; +} +export interface SearchTxsResultProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult"; + value: Uint8Array; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResultAmino { + /** Count of all txs */ + total_count: string; + /** Count of txs in current page */ + count: string; + /** Index of current page, start from 1 */ + page_number: string; + /** Count of total pages */ + page_total: string; + /** Max count txs per page */ + limit: string; + /** List of txs in current page */ + txs: TxResponseAmino[]; +} +export interface SearchTxsResultAminoMsg { + type: "cosmos-sdk/SearchTxsResult"; + value: SearchTxsResultAmino; +} +/** 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; +} +function createBaseTxResponse(): TxResponse { + return { + height: BigInt(0), + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + logs: [], + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + tx: undefined, + timestamp: "", + events: [] + }; +} +export const TxResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + aminoType: "cosmos-sdk/TxResponse", + is(o: any): o is TxResponse { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.rawLog === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.is(o.logs[0])) && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0]))); + }, + isAmino(o: any): o is TxResponseAmino { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.raw_log === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.isAmino(o.logs[0])) && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0]))); + }, + encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.txhash !== "") { + writer.uint32(18).string(message.txhash); + } + if (message.codespace !== "") { + writer.uint32(26).string(message.codespace); + } + if (message.code !== 0) { + writer.uint32(32).uint32(message.code); + } + if (message.data !== "") { + writer.uint32(42).string(message.data); + } + if (message.rawLog !== "") { + writer.uint32(50).string(message.rawLog); + } + for (const v of message.logs) { + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.info !== "") { + writer.uint32(66).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(72).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(80).int64(message.gasUsed); + } + if (message.tx !== undefined) { + Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + } + if (message.timestamp !== "") { + writer.uint32(98).string(message.timestamp); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64(); + break; + case 10: + message.gasUsed = reader.int64(); + break; + case 11: + message.tx = Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + case 13: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponse { + const message = createBaseTxResponse(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.txhash = object.txhash ?? ""; + message.codespace = object.codespace ?? ""; + message.code = object.code ?? 0; + message.data = object.data ?? ""; + message.rawLog = object.rawLog ?? ""; + message.logs = object.logs?.map(e => ABCIMessageLog.fromPartial(e)) || []; + 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.tx = object.tx !== undefined && object.tx !== null ? Any.fromPartial(object.tx) : undefined; + message.timestamp = object.timestamp ?? ""; + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxResponseAmino): TxResponse { + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + 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); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxResponse): TxResponseAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.txhash = message.txhash === "" ? undefined : message.txhash; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data === "" ? undefined : message.data; + obj.raw_log = message.rawLog === "" ? undefined : message.rawLog; + if (message.logs) { + obj.logs = message.logs.map(e => e ? ABCIMessageLog.toAmino(e) : undefined); + } else { + obj.logs = message.logs; + } + 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; + obj.tx = message.tx ? Any.toAmino(message.tx) : undefined; + obj.timestamp = message.timestamp === "" ? undefined : message.timestamp; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: TxResponseAminoMsg): TxResponse { + return TxResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxResponse): TxResponseAminoMsg { + return { + type: "cosmos-sdk/TxResponse", + value: TxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxResponseProtoMsg): TxResponse { + return TxResponse.decode(message.value); + }, + toProto(message: TxResponse): Uint8Array { + return TxResponse.encode(message).finish(); + }, + toProtoMsg(message: TxResponse): TxResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + value: TxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponse.typeUrl, TxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxResponse.aminoType, TxResponse.typeUrl); +function createBaseABCIMessageLog(): ABCIMessageLog { + return { + msgIndex: 0, + log: "", + events: [] + }; +} +export const ABCIMessageLog = { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + aminoType: "cosmos-sdk/ABCIMessageLog", + is(o: any): o is ABCIMessageLog { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msgIndex === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.is(o.events[0]))); + }, + isAmino(o: any): o is ABCIMessageLogAmino { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msg_index === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.isAmino(o.events[0]))); + }, + encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgIndex !== 0) { + writer.uint32(8).uint32(message.msgIndex); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIMessageLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + message.msgIndex = object.msgIndex ?? 0; + message.log = object.log ?? ""; + message.events = object.events?.map(e => StringEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { + const obj: any = {}; + 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); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: ABCIMessageLogAminoMsg): ABCIMessageLog { + return ABCIMessageLog.fromAmino(object.value); + }, + toAminoMsg(message: ABCIMessageLog): ABCIMessageLogAminoMsg { + return { + type: "cosmos-sdk/ABCIMessageLog", + value: ABCIMessageLog.toAmino(message) + }; + }, + fromProtoMsg(message: ABCIMessageLogProtoMsg): ABCIMessageLog { + return ABCIMessageLog.decode(message.value); + }, + toProto(message: ABCIMessageLog): Uint8Array { + return ABCIMessageLog.encode(message).finish(); + }, + toProtoMsg(message: ABCIMessageLog): ABCIMessageLogProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + value: ABCIMessageLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ABCIMessageLog.typeUrl, ABCIMessageLog); +GlobalDecoderRegistry.registerAminoProtoMapping(ABCIMessageLog.aminoType, ABCIMessageLog.typeUrl); +function createBaseStringEvent(): StringEvent { + return { + type: "", + attributes: [] + }; +} +export const StringEvent = { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + aminoType: "cosmos-sdk/StringEvent", + is(o: any): o is StringEvent { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.is(o.attributes[0]))); + }, + isAmino(o: any): o is StringEventAmino { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.isAmino(o.attributes[0]))); + }, + encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StringEvent { + const message = createBaseStringEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => Attribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StringEventAmino): StringEvent { + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: StringEvent): StringEventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? Attribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: StringEventAminoMsg): StringEvent { + return StringEvent.fromAmino(object.value); + }, + toAminoMsg(message: StringEvent): StringEventAminoMsg { + return { + type: "cosmos-sdk/StringEvent", + value: StringEvent.toAmino(message) + }; + }, + fromProtoMsg(message: StringEventProtoMsg): StringEvent { + return StringEvent.decode(message.value); + }, + toProto(message: StringEvent): Uint8Array { + return StringEvent.encode(message).finish(); + }, + toProtoMsg(message: StringEvent): StringEventProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + value: StringEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StringEvent.typeUrl, StringEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(StringEvent.aminoType, StringEvent.typeUrl); +function createBaseAttribute(): Attribute { + return { + key: "", + value: "" + }; +} +export const Attribute = { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + aminoType: "cosmos-sdk/Attribute", + is(o: any): o is Attribute { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + isAmino(o: any): o is AttributeAmino { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + encode(message: Attribute, 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): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + 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: DeepPartial): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: AttributeAmino): Attribute { + const message = createBaseAttribute(); + 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: Attribute): AttributeAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AttributeAminoMsg): Attribute { + return Attribute.fromAmino(object.value); + }, + toAminoMsg(message: Attribute): AttributeAminoMsg { + return { + type: "cosmos-sdk/Attribute", + value: Attribute.toAmino(message) + }; + }, + fromProtoMsg(message: AttributeProtoMsg): Attribute { + return Attribute.decode(message.value); + }, + toProto(message: Attribute): Uint8Array { + return Attribute.encode(message).finish(); + }, + toProtoMsg(message: Attribute): AttributeProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + value: Attribute.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Attribute.typeUrl, Attribute); +GlobalDecoderRegistry.registerAminoProtoMapping(Attribute.aminoType, Attribute.typeUrl); +function createBaseGasInfo(): GasInfo { + return { + gasWanted: BigInt(0), + gasUsed: BigInt(0) + }; +} +export const GasInfo = { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + aminoType: "cosmos-sdk/GasInfo", + is(o: any): o is GasInfo { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint"); + }, + isAmino(o: any): o is GasInfoAmino { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint"); + }, + encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasWanted !== BigInt(0)) { + writer.uint32(8).uint64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(16).uint64(message.gasUsed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64(); + break; + case 2: + message.gasUsed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GasInfo { + const message = createBaseGasInfo(); + 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); + return message; + }, + fromAmino(object: GasInfoAmino): GasInfo { + const message = createBaseGasInfo(); + 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); + } + return message; + }, + toAmino(message: GasInfo): GasInfoAmino { + const obj: any = {}; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted?.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GasInfoAminoMsg): GasInfo { + return GasInfo.fromAmino(object.value); + }, + toAminoMsg(message: GasInfo): GasInfoAminoMsg { + return { + type: "cosmos-sdk/GasInfo", + value: GasInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GasInfoProtoMsg): GasInfo { + return GasInfo.decode(message.value); + }, + toProto(message: GasInfo): Uint8Array { + return GasInfo.encode(message).finish(); + }, + toProtoMsg(message: GasInfo): GasInfoProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + value: GasInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GasInfo.typeUrl, GasInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GasInfo.aminoType, GasInfo.typeUrl); +function createBaseResult(): Result { + return { + data: new Uint8Array(), + log: "", + events: [], + msgResponses: [] + }; +} +export const Result = { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + aminoType: "cosmos-sdk/Result", + is(o: any): o is Result { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isAmino(o: any): o is ResultAmino { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, + encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Result { + const message = createBaseResult(); + 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 { + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + 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 { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } 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 { + return Result.fromAmino(object.value); + }, + toAminoMsg(message: Result): ResultAminoMsg { + return { + type: "cosmos-sdk/Result", + value: Result.toAmino(message) + }; + }, + fromProtoMsg(message: ResultProtoMsg): Result { + return Result.decode(message.value); + }, + toProto(message: Result): Uint8Array { + return Result.encode(message).finish(); + }, + toProtoMsg(message: Result): ResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + value: Result.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Result.typeUrl, Result); +GlobalDecoderRegistry.registerAminoProtoMapping(Result.aminoType, Result.typeUrl); +function createBaseSimulationResponse(): SimulationResponse { + return { + gasInfo: GasInfo.fromPartial({}), + result: undefined + }; +} +export const SimulationResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + aminoType: "cosmos-sdk/SimulationResponse", + is(o: any): o is SimulationResponse { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.is(o.gasInfo)); + }, + isAmino(o: any): o is SimulationResponseAmino { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.isAmino(o.gas_info)); + }, + encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulationResponse { + const message = createBaseSimulationResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulationResponseAmino): SimulationResponse { + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulationResponse): SimulationResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulationResponseAminoMsg): SimulationResponse { + return SimulationResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulationResponse): SimulationResponseAminoMsg { + return { + type: "cosmos-sdk/SimulationResponse", + value: SimulationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulationResponseProtoMsg): SimulationResponse { + return SimulationResponse.decode(message.value); + }, + toProto(message: SimulationResponse): Uint8Array { + return SimulationResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulationResponse): SimulationResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + value: SimulationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulationResponse.typeUrl, SimulationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulationResponse.aminoType, SimulationResponse.typeUrl); +function createBaseMsgData(): MsgData { + return { + msgType: "", + data: new Uint8Array() + }; +} +export const MsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + aminoType: "cosmos-sdk/MsgData", + is(o: any): o is MsgData { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msgType === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgDataAmino { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msg_type === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgType !== "") { + writer.uint32(10).string(message.msgType); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgData { + const message = createBaseMsgData(); + message.msgType = object.msgType ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgDataAmino): MsgData { + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgData): MsgDataAmino { + const obj: any = {}; + obj.msg_type = message.msgType === "" ? undefined : message.msgType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDataAminoMsg): MsgData { + return MsgData.fromAmino(object.value); + }, + toAminoMsg(message: MsgData): MsgDataAminoMsg { + return { + type: "cosmos-sdk/MsgData", + value: MsgData.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDataProtoMsg): MsgData { + return MsgData.decode(message.value); + }, + toProto(message: MsgData): Uint8Array { + return MsgData.encode(message).finish(); + }, + toProtoMsg(message: MsgData): MsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + value: MsgData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgData.typeUrl, MsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgData.aminoType, MsgData.typeUrl); +function createBaseTxMsgData(): TxMsgData { + return { + data: [], + msgResponses: [] + }; +} +export const TxMsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + aminoType: "cosmos-sdk/TxMsgData", + is(o: any): o is TxMsgData { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.is(o.data[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isAmino(o: any): o is TxMsgDataAmino { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.isAmino(o.data[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, + encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? MsgData.toAmino(e) : undefined); + } 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 { + return TxMsgData.fromAmino(object.value); + }, + toAminoMsg(message: TxMsgData): TxMsgDataAminoMsg { + return { + type: "cosmos-sdk/TxMsgData", + value: TxMsgData.toAmino(message) + }; + }, + fromProtoMsg(message: TxMsgDataProtoMsg): TxMsgData { + return TxMsgData.decode(message.value); + }, + toProto(message: TxMsgData): Uint8Array { + return TxMsgData.encode(message).finish(); + }, + toProtoMsg(message: TxMsgData): TxMsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + value: TxMsgData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxMsgData.typeUrl, TxMsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(TxMsgData.aminoType, TxMsgData.typeUrl); +function createBaseSearchTxsResult(): SearchTxsResult { + return { + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), + txs: [] + }; +} +export const SearchTxsResult = { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + aminoType: "cosmos-sdk/SearchTxsResult", + is(o: any): o is SearchTxsResult { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.totalCount === "bigint" && typeof o.count === "bigint" && typeof o.pageNumber === "bigint" && typeof o.pageTotal === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.is(o.txs[0]))); + }, + isAmino(o: any): o is SearchTxsResultAmino { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.isAmino(o.txs[0]))); + }, + encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { + writer.uint32(8).uint64(message.totalCount); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + if (message.pageNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.pageNumber); + } + if (message.pageTotal !== BigInt(0)) { + writer.uint32(32).uint64(message.pageTotal); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } + for (const v of message.txs) { + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSearchTxsResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + case 3: + message.pageNumber = reader.uint64(); + break; + case 4: + message.pageTotal = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; + case 6: + message.txs.push(TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SearchTxsResult { + const message = createBaseSearchTxsResult(); + 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.txs = object.txs?.map(e => TxResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SearchTxsResultAmino): SearchTxsResult { + const message = createBaseSearchTxsResult(); + 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.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: SearchTxsResult): SearchTxsResultAmino { + 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.txs) { + obj.txs = message.txs.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: SearchTxsResultAminoMsg): SearchTxsResult { + return SearchTxsResult.fromAmino(object.value); + }, + toAminoMsg(message: SearchTxsResult): SearchTxsResultAminoMsg { + return { + type: "cosmos-sdk/SearchTxsResult", + value: SearchTxsResult.toAmino(message) + }; + }, + fromProtoMsg(message: SearchTxsResultProtoMsg): SearchTxsResult { + return SearchTxsResult.decode(message.value); + }, + toProto(message: SearchTxsResult): Uint8Array { + return SearchTxsResult.encode(message).finish(); + }, + toProtoMsg(message: SearchTxsResult): SearchTxsResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + value: SearchTxsResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SearchTxsResult.typeUrl, SearchTxsResult); +GlobalDecoderRegistry.registerAminoProtoMapping(SearchTxsResult.aminoType, SearchTxsResult.typeUrl); +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", + aminoType: "cosmos-sdk/SearchBlocksResult", + is(o: any): o is SearchBlocksResult { + return o && (o.$typeUrl === SearchBlocksResult.typeUrl || typeof o.totalCount === "bigint" && typeof o.count === "bigint" && typeof o.pageNumber === "bigint" && typeof o.pageTotal === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.blocks) && (!o.blocks.length || Block.is(o.blocks[0]))); + }, + isAmino(o: any): o is SearchBlocksResultAmino { + return o && (o.$typeUrl === SearchBlocksResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.blocks) && (!o.blocks.length || Block.isAmino(o.blocks[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SearchBlocksResult.typeUrl, SearchBlocksResult); +GlobalDecoderRegistry.registerAminoProtoMapping(SearchBlocksResult.aminoType, SearchBlocksResult.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/base/query/v1beta1/pagination.ts b/libs/injective-query/src/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..35272ec2 --- /dev/null +++ b/libs/injective-query/src/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,361 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: 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; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} +export interface PageRequestProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest"; + value: Uint8Array; +} +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequestAmino { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: string; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: 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; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} +export interface PageRequestAminoMsg { + type: "cosmos-sdk/PageRequest"; + value: PageRequestAmino; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + nextKey: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: bigint; +} +export interface PageResponseProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; + value: Uint8Array; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponseAmino { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + next_key: string; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: string; +} +export interface PageResponseAminoMsg { + type: "cosmos-sdk/PageResponse"; + value: PageResponseAmino; +} +function createBasePageRequest(): PageRequest { + return { + key: new Uint8Array(), + offset: BigInt(0), + limit: BigInt(0), + countTotal: false, + reverse: false + }; +} +export const PageRequest = { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + aminoType: "cosmos-sdk/PageRequest", + is(o: any): o is PageRequest { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.countTotal === "boolean" && typeof o.reverse === "boolean"); + }, + isAmino(o: any): o is PageRequestAmino { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.count_total === "boolean" && typeof o.reverse === "boolean"); + }, + encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== BigInt(0)) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset !== undefined && object.offset !== null ? BigInt(object.offset.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, + fromAmino(object: PageRequestAmino): PageRequest { + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; + }, + toAmino(message: PageRequest): PageRequestAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.offset = message.offset !== BigInt(0) ? message.offset?.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.count_total = message.countTotal === false ? undefined : message.countTotal; + obj.reverse = message.reverse === false ? undefined : message.reverse; + return obj; + }, + fromAminoMsg(object: PageRequestAminoMsg): PageRequest { + return PageRequest.fromAmino(object.value); + }, + toAminoMsg(message: PageRequest): PageRequestAminoMsg { + return { + type: "cosmos-sdk/PageRequest", + value: PageRequest.toAmino(message) + }; + }, + fromProtoMsg(message: PageRequestProtoMsg): PageRequest { + return PageRequest.decode(message.value); + }, + toProto(message: PageRequest): Uint8Array { + return PageRequest.encode(message).finish(); + }, + toProtoMsg(message: PageRequest): PageRequestProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + value: PageRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PageRequest.typeUrl, PageRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PageRequest.aminoType, PageRequest.typeUrl); +function createBasePageResponse(): PageResponse { + return { + nextKey: new Uint8Array(), + total: BigInt(0) + }; +} +export const PageResponse = { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + aminoType: "cosmos-sdk/PageResponse", + is(o: any): o is PageResponse { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.nextKey instanceof Uint8Array || typeof o.nextKey === "string") && typeof o.total === "bigint"); + }, + isAmino(o: any): o is PageResponseAmino { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.next_key instanceof Uint8Array || typeof o.next_key === "string") && typeof o.total === "bigint"); + }, + encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextKey.length !== 0) { + writer.uint32(10).bytes(message.nextKey); + } + if (message.total !== BigInt(0)) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PageResponseAmino): PageResponse { + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; + }, + toAmino(message: PageResponse): PageResponseAmino { + const obj: any = {}; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; + obj.total = message.total !== BigInt(0) ? message.total?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PageResponseAminoMsg): PageResponse { + return PageResponse.fromAmino(object.value); + }, + toAminoMsg(message: PageResponse): PageResponseAminoMsg { + return { + type: "cosmos-sdk/PageResponse", + value: PageResponse.toAmino(message) + }; + }, + fromProtoMsg(message: PageResponseProtoMsg): PageResponse { + return PageResponse.decode(message.value); + }, + toProto(message: PageResponse): Uint8Array { + return PageResponse.encode(message).finish(); + }, + toProtoMsg(message: PageResponse): PageResponseProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + value: PageResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PageResponse.typeUrl, PageResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PageResponse.aminoType, PageResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/base/v1beta1/coin.ts b/libs/injective-query/src/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..155e8009 --- /dev/null +++ b/libs/injective-query/src/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,439 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} +export interface CoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.Coin"; + value: Uint8Array; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinAmino { + denom: string; + amount: string; +} +export interface CoinAminoMsg { + type: "cosmos-sdk/Coin"; + value: CoinAmino; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} +export interface DecCoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecCoin"; + value: Uint8Array; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinAmino { + denom: string; + amount: string; +} +export interface DecCoinAminoMsg { + type: "cosmos-sdk/DecCoin"; + value: DecCoinAmino; +} +/** + * 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; +} +export interface IntProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.IntProto"; + value: Uint8Array; +} +/** + * 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; +} +export interface IntProtoAminoMsg { + type: "cosmos-sdk/IntProto"; + value: IntProtoAmino; +} +/** + * 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; +} +export interface DecProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecProto"; + value: Uint8Array; +} +/** + * 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; +} +export interface DecProtoAminoMsg { + type: "cosmos-sdk/DecProto"; + value: DecProtoAmino; +} +function createBaseCoin(): Coin { + return { + denom: "", + amount: "" + }; +} +export const Coin = { + typeUrl: "/cosmos.base.v1beta1.Coin", + aminoType: "cosmos-sdk/Coin", + is(o: any): o is Coin { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is CoinAmino { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: CoinAmino): Coin { + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Coin): CoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount ?? ""; + return obj; + }, + fromAminoMsg(object: CoinAminoMsg): Coin { + return Coin.fromAmino(object.value); + }, + toAminoMsg(message: Coin): CoinAminoMsg { + return { + type: "cosmos-sdk/Coin", + value: Coin.toAmino(message) + }; + }, + fromProtoMsg(message: CoinProtoMsg): Coin { + return Coin.decode(message.value); + }, + toProto(message: Coin): Uint8Array { + return Coin.encode(message).finish(); + }, + toProtoMsg(message: Coin): CoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.Coin", + value: Coin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Coin.typeUrl, Coin); +GlobalDecoderRegistry.registerAminoProtoMapping(Coin.aminoType, Coin.typeUrl); +function createBaseDecCoin(): DecCoin { + return { + denom: "", + amount: "" + }; +} +export const DecCoin = { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + aminoType: "cosmos-sdk/DecCoin", + is(o: any): o is DecCoin { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is DecCoinAmino { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: DecCoinAmino): DecCoin { + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: DecCoin): DecCoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: DecCoinAminoMsg): DecCoin { + return DecCoin.fromAmino(object.value); + }, + toAminoMsg(message: DecCoin): DecCoinAminoMsg { + return { + type: "cosmos-sdk/DecCoin", + value: DecCoin.toAmino(message) + }; + }, + fromProtoMsg(message: DecCoinProtoMsg): DecCoin { + return DecCoin.decode(message.value); + }, + toProto(message: DecCoin): Uint8Array { + return DecCoin.encode(message).finish(); + }, + toProtoMsg(message: DecCoin): DecCoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + value: DecCoin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DecCoin.typeUrl, DecCoin); +GlobalDecoderRegistry.registerAminoProtoMapping(DecCoin.aminoType, DecCoin.typeUrl); +function createBaseIntProto(): IntProto { + return { + int: "" + }; +} +export const IntProto = { + typeUrl: "/cosmos.base.v1beta1.IntProto", + aminoType: "cosmos-sdk/IntProto", + is(o: any): o is IntProto { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + isAmino(o: any): o is IntProtoAmino { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; + return message; + }, + fromAmino(object: IntProtoAmino): IntProto { + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; + }, + toAmino(message: IntProto): IntProtoAmino { + const obj: any = {}; + obj.int = message.int === "" ? undefined : message.int; + return obj; + }, + fromAminoMsg(object: IntProtoAminoMsg): IntProto { + return IntProto.fromAmino(object.value); + }, + toAminoMsg(message: IntProto): IntProtoAminoMsg { + return { + type: "cosmos-sdk/IntProto", + value: IntProto.toAmino(message) + }; + }, + fromProtoMsg(message: IntProtoProtoMsg): IntProto { + return IntProto.decode(message.value); + }, + toProto(message: IntProto): Uint8Array { + return IntProto.encode(message).finish(); + }, + toProtoMsg(message: IntProto): IntProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.IntProto", + value: IntProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IntProto.typeUrl, IntProto); +GlobalDecoderRegistry.registerAminoProtoMapping(IntProto.aminoType, IntProto.typeUrl); +function createBaseDecProto(): DecProto { + return { + dec: "" + }; +} +export const DecProto = { + typeUrl: "/cosmos.base.v1beta1.DecProto", + aminoType: "cosmos-sdk/DecProto", + is(o: any): o is DecProto { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + isAmino(o: any): o is DecProtoAmino { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; + return message; + }, + fromAmino(object: DecProtoAmino): DecProto { + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; + }, + toAmino(message: DecProto): DecProtoAmino { + const obj: any = {}; + obj.dec = message.dec === "" ? undefined : message.dec; + return obj; + }, + fromAminoMsg(object: DecProtoAminoMsg): DecProto { + return DecProto.fromAmino(object.value); + }, + toAminoMsg(message: DecProto): DecProtoAminoMsg { + return { + type: "cosmos-sdk/DecProto", + value: DecProto.toAmino(message) + }; + }, + fromProtoMsg(message: DecProtoProtoMsg): DecProto { + return DecProto.decode(message.value); + }, + toProto(message: DecProto): Uint8Array { + return DecProto.encode(message).finish(); + }, + toProtoMsg(message: DecProto): DecProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecProto", + value: DecProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DecProto.typeUrl, DecProto); +GlobalDecoderRegistry.registerAminoProtoMapping(DecProto.aminoType, DecProto.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/crypto/ed25519/keys.ts b/libs/injective-query/src/cosmos/crypto/ed25519/keys.ts new file mode 100644 index 00000000..6f544d77 --- /dev/null +++ b/libs/injective-query/src/cosmos/crypto/ed25519/keys.ts @@ -0,0 +1,209 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * 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. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PubKey"; + value: Uint8Array; +} +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * 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. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "tendermint/PubKeyEd25519"; + value: PubKeyAmino; +} +/** + * 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 { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PrivKey"; + value: Uint8Array; +} +/** + * 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: "tendermint/PrivKeyEd25519"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + aminoType: "tendermint/PubKeyEd25519", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "tendermint/PubKeyEd25519", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + aminoType: "tendermint/PrivKeyEd25519", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "tendermint/PrivKeyEd25519", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/libs/injective-query/src/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..1d46639b --- /dev/null +++ b/libs/injective-query/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,225 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} +export interface MultiSignatureProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature"; + value: Uint8Array; +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureAmino { + signatures: string[]; +} +export interface MultiSignatureAminoMsg { + type: "cosmos-sdk/MultiSignature"; + value: MultiSignatureAmino; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} +export interface CompactBitArrayProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray"; + value: Uint8Array; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArrayAmino { + extra_bits_stored: number; + elems: string; +} +export interface CompactBitArrayAminoMsg { + type: "cosmos-sdk/CompactBitArray"; + value: CompactBitArrayAmino; +} +function createBaseMultiSignature(): MultiSignature { + return { + signatures: [] + }; +} +export const MultiSignature = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + aminoType: "cosmos-sdk/MultiSignature", + is(o: any): o is MultiSignature { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MultiSignatureAmino { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMultiSignature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MultiSignatureAmino): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MultiSignature): MultiSignatureAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MultiSignatureAminoMsg): MultiSignature { + return MultiSignature.fromAmino(object.value); + }, + toAminoMsg(message: MultiSignature): MultiSignatureAminoMsg { + return { + type: "cosmos-sdk/MultiSignature", + value: MultiSignature.toAmino(message) + }; + }, + fromProtoMsg(message: MultiSignatureProtoMsg): MultiSignature { + return MultiSignature.decode(message.value); + }, + toProto(message: MultiSignature): Uint8Array { + return MultiSignature.encode(message).finish(); + }, + toProtoMsg(message: MultiSignature): MultiSignatureProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + value: MultiSignature.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MultiSignature.typeUrl, MultiSignature); +GlobalDecoderRegistry.registerAminoProtoMapping(MultiSignature.aminoType, MultiSignature.typeUrl); +function createBaseCompactBitArray(): CompactBitArray { + return { + extraBitsStored: 0, + elems: new Uint8Array() + }; +} +export const CompactBitArray = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + aminoType: "cosmos-sdk/CompactBitArray", + is(o: any): o is CompactBitArray { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extraBitsStored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + isAmino(o: any): o is CompactBitArrayAmino { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extra_bits_stored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.extraBitsStored !== 0) { + writer.uint32(8).uint32(message.extraBitsStored); + } + if (message.elems.length !== 0) { + writer.uint32(18).bytes(message.elems); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompactBitArray(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CompactBitArray { + const message = createBaseCompactBitArray(); + message.extraBitsStored = object.extraBitsStored ?? 0; + message.elems = object.elems ?? new Uint8Array(); + return message; + }, + fromAmino(object: CompactBitArrayAmino): CompactBitArray { + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + toAmino(message: CompactBitArray): CompactBitArrayAmino { + const obj: any = {}; + obj.extra_bits_stored = message.extraBitsStored === 0 ? undefined : message.extraBitsStored; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; + return obj; + }, + fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { + return CompactBitArray.fromAmino(object.value); + }, + toAminoMsg(message: CompactBitArray): CompactBitArrayAminoMsg { + return { + type: "cosmos-sdk/CompactBitArray", + value: CompactBitArray.toAmino(message) + }; + }, + fromProtoMsg(message: CompactBitArrayProtoMsg): CompactBitArray { + return CompactBitArray.decode(message.value); + }, + toProto(message: CompactBitArray): Uint8Array { + return CompactBitArray.encode(message).finish(); + }, + toProtoMsg(message: CompactBitArray): CompactBitArrayProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + value: CompactBitArray.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CompactBitArray.typeUrl, CompactBitArray); +GlobalDecoderRegistry.registerAminoProtoMapping(CompactBitArray.aminoType, CompactBitArray.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/crypto/secp256k1/keys.ts b/libs/injective-query/src/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..c0fdd0ac --- /dev/null +++ b/libs/injective-query/src/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,203 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PubKey"; + value: Uint8Array; +} +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "tendermint/PubKeySecp256k1"; + value: PubKeyAmino; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKeyAmino { + key: string; +} +export interface PrivKeyAminoMsg { + type: "tendermint/PrivKeySecp256k1"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + aminoType: "tendermint/PubKeySecp256k1", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "tendermint/PubKeySecp256k1", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + aminoType: "tendermint/PrivKeySecp256k1", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "tendermint/PrivKeySecp256k1", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/crypto/secp256r1/keys.ts b/libs/injective-query/src/cosmos/crypto/secp256r1/keys.ts new file mode 100644 index 00000000..6b1edf68 --- /dev/null +++ b/libs/injective-query/src/cosmos/crypto/secp256r1/keys.ts @@ -0,0 +1,201 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKey { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PubKey"; + value: Uint8Array; +} +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKeyAmino { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key: string; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKey { + /** secret number serialized using big-endian encoding */ + secret: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKeyAmino { + /** secret number serialized using big-endian encoding */ + secret: string; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + aminoType: "cosmos-sdk/PubKey", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "cosmos-sdk/PubKey", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + secret: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + aminoType: "cosmos-sdk/PrivKey", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.secret.length !== 0) { + writer.uint32(10).bytes(message.secret); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.secret = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.secret = object.secret ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "cosmos-sdk/PrivKey", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/distribution/v1beta1/distribution.ts b/libs/injective-query/src/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 00000000..fdf747a5 --- /dev/null +++ b/libs/injective-query/src/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,1494 @@ +import { DecCoin, DecCoinAmino, Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsAmino { + 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/x/distribution/Params"; + value: ParamsAmino; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; +} +export interface ValidatorHistoricalRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards"; + value: Uint8Array; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsAmino { + cumulative_reward_ratio: DecCoinAmino[]; + reference_count: number; +} +export interface ValidatorHistoricalRewardsAminoMsg { + type: "cosmos-sdk/ValidatorHistoricalRewards"; + value: ValidatorHistoricalRewardsAmino; +} +/** + * 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. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[]; + period: bigint; +} +export interface ValidatorCurrentRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; + value: Uint8Array; +} +/** + * 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. + */ +export interface ValidatorCurrentRewardsAmino { + rewards: DecCoinAmino[]; + period: string; +} +export interface ValidatorCurrentRewardsAminoMsg { + type: "cosmos-sdk/ValidatorCurrentRewards"; + value: ValidatorCurrentRewardsAmino; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[]; +} +export interface ValidatorAccumulatedCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"; + value: Uint8Array; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionAmino { + commission: DecCoinAmino[]; +} +export interface ValidatorAccumulatedCommissionAminoMsg { + type: "cosmos-sdk/ValidatorAccumulatedCommission"; + value: ValidatorAccumulatedCommissionAmino; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[]; +} +export interface ValidatorOutstandingRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards"; + value: Uint8Array; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsAmino { + rewards: DecCoinAmino[]; +} +export interface ValidatorOutstandingRewardsAminoMsg { + type: "cosmos-sdk/ValidatorOutstandingRewards"; + value: ValidatorOutstandingRewardsAmino; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: bigint; + fraction: string; +} +export interface ValidatorSlashEventProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent"; + value: Uint8Array; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventAmino { + validator_period: string; + fraction: string; +} +export interface ValidatorSlashEventAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvent"; + value: ValidatorSlashEventAmino; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[]; +} +export interface ValidatorSlashEventsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents"; + value: Uint8Array; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsAmino { + validator_slash_events: ValidatorSlashEventAmino[]; +} +export interface ValidatorSlashEventsAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvents"; + value: ValidatorSlashEventsAmino; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[]; +} +export interface FeePoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.FeePool"; + value: Uint8Array; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolAmino { + community_pool: DecCoinAmino[]; +} +export interface FeePoolAminoMsg { + type: "cosmos-sdk/FeePool"; + value: FeePoolAmino; +} +/** + * 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; + recipient: string; + amount: Coin[]; +} +export interface CommunityPoolSpendProposalProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; + value: Uint8Array; +} +/** + * 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[]; +} +export interface CommunityPoolSpendProposalAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposal"; + value: CommunityPoolSpendProposalAmino; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: bigint; + stake: string; + height: bigint; +} +export interface DelegatorStartingInfoProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; + value: Uint8Array; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoAmino { + previous_period: string; + stake: string; + height: string; +} +export interface DelegatorStartingInfoAminoMsg { + type: "cosmos-sdk/DelegatorStartingInfo"; + value: DelegatorStartingInfoAmino; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string; + reward: DecCoin[]; +} +export interface DelegationDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward"; + value: Uint8Array; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardAmino { + validator_address: string; + reward: DecCoinAmino[]; +} +export interface DelegationDelegatorRewardAminoMsg { + type: "cosmos-sdk/DelegationDelegatorReward"; + value: DelegationDelegatorRewardAmino; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export interface CommunityPoolSpendProposalWithDepositProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; + value: Uint8Array; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositAmino { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export interface CommunityPoolSpendProposalWithDepositAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; + value: CommunityPoolSpendProposalWithDepositAmino; +} +function createBaseParams(): Params { + return { + communityTax: "", + baseProposerReward: "", + bonusProposerReward: "", + withdrawAddrEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.distribution.v1beta1.Params", + aminoType: "cosmos-sdk/x/distribution/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.communityTax === "string" && typeof o.baseProposerReward === "string" && typeof o.bonusProposerReward === "string" && typeof o.withdrawAddrEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.community_tax === "string" && typeof o.base_proposer_reward === "string" && typeof o.bonus_proposer_reward === "string" && typeof o.withdraw_addr_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.communityTax !== "") { + writer.uint32(10).string(message.communityTax); + } + if (message.baseProposerReward !== "") { + writer.uint32(18).string(message.baseProposerReward); + } + if (message.bonusProposerReward !== "") { + writer.uint32(26).string(message.bonusProposerReward); + } + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled); + } + 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.communityTax = reader.string(); + break; + case 2: + message.baseProposerReward = reader.string(); + break; + case 3: + message.bonusProposerReward = reader.string(); + break; + case 4: + message.withdrawAddrEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.communityTax = object.communityTax ?? ""; + message.baseProposerReward = object.baseProposerReward ?? ""; + message.bonusProposerReward = object.bonusProposerReward ?? ""; + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + 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; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/distribution/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.distribution.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { + return { + cumulativeRewardRatio: [], + referenceCount: 0 + }; +} +export const ValidatorHistoricalRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + aminoType: "cosmos-sdk/ValidatorHistoricalRewards", + is(o: any): o is ValidatorHistoricalRewards { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulativeRewardRatio) && (!o.cumulativeRewardRatio.length || DecCoin.is(o.cumulativeRewardRatio[0])) && typeof o.referenceCount === "number"); + }, + isAmino(o: any): o is ValidatorHistoricalRewardsAmino { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulative_reward_ratio) && (!o.cumulative_reward_ratio.length || DecCoin.isAmino(o.cumulative_reward_ratio[0])) && typeof o.reference_count === "number"); + }, + encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cumulativeRewardRatio) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorHistoricalRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.referenceCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map(e => DecCoin.fromPartial(e)) || []; + message.referenceCount = object.referenceCount ?? 0; + return message; + }, + fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; + }, + toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { + const obj: any = {}; + if (message.cumulativeRewardRatio) { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio; + } + obj.reference_count = message.referenceCount === 0 ? undefined : message.referenceCount; + return obj; + }, + fromAminoMsg(object: ValidatorHistoricalRewardsAminoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorHistoricalRewardsProtoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.decode(message.value); + }, + toProto(message: ValidatorHistoricalRewards): Uint8Array { + return ValidatorHistoricalRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorHistoricalRewards.typeUrl, ValidatorHistoricalRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorHistoricalRewards.aminoType, ValidatorHistoricalRewards.typeUrl); +function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { + return { + rewards: [], + period: BigInt(0) + }; +} +export const ValidatorCurrentRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + aminoType: "cosmos-sdk/ValidatorCurrentRewards", + is(o: any): o is ValidatorCurrentRewards { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0])) && typeof o.period === "bigint"); + }, + isAmino(o: any): o is ValidatorCurrentRewardsAmino { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0])) && typeof o.period === "bigint"); + }, + encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.period !== BigInt(0)) { + writer.uint32(16).uint64(message.period); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorCurrentRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.period = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; + }, + toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + obj.period = message.period !== BigInt(0) ? message.period?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorCurrentRewardsAminoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorCurrentRewards", + value: ValidatorCurrentRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorCurrentRewardsProtoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.decode(message.value); + }, + toProto(message: ValidatorCurrentRewards): Uint8Array { + return ValidatorCurrentRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + value: ValidatorCurrentRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorCurrentRewards.typeUrl, ValidatorCurrentRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorCurrentRewards.aminoType, ValidatorCurrentRewards.typeUrl); +function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { + return { + commission: [] + }; +} +export const ValidatorAccumulatedCommission = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + aminoType: "cosmos-sdk/ValidatorAccumulatedCommission", + is(o: any): o is ValidatorAccumulatedCommission { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.is(o.commission[0]))); + }, + isAmino(o: any): o is ValidatorAccumulatedCommissionAmino { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.isAmino(o.commission[0]))); + }, + encode(message: ValidatorAccumulatedCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAccumulatedCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { + const obj: any = {}; + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = message.commission; + } + return obj; + }, + fromAminoMsg(object: ValidatorAccumulatedCommissionAminoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAminoMsg { + return { + type: "cosmos-sdk/ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorAccumulatedCommissionProtoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.decode(message.value); + }, + toProto(message: ValidatorAccumulatedCommission): Uint8Array { + return ValidatorAccumulatedCommission.encode(message).finish(); + }, + toProtoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorAccumulatedCommission.typeUrl, ValidatorAccumulatedCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorAccumulatedCommission.aminoType, ValidatorAccumulatedCommission.typeUrl); +function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { + return { + rewards: [] + }; +} +export const ValidatorOutstandingRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + aminoType: "cosmos-sdk/ValidatorOutstandingRewards", + is(o: any): o is ValidatorOutstandingRewards { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0]))); + }, + isAmino(o: any): o is ValidatorOutstandingRewardsAmino { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0]))); + }, + encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorOutstandingRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: ValidatorOutstandingRewardsAminoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorOutstandingRewardsProtoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.decode(message.value); + }, + toProto(message: ValidatorOutstandingRewards): Uint8Array { + return ValidatorOutstandingRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorOutstandingRewards.typeUrl, ValidatorOutstandingRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorOutstandingRewards.aminoType, ValidatorOutstandingRewards.typeUrl); +function createBaseValidatorSlashEvent(): ValidatorSlashEvent { + return { + validatorPeriod: BigInt(0), + fraction: "" + }; +} +export const ValidatorSlashEvent = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + aminoType: "cosmos-sdk/ValidatorSlashEvent", + is(o: any): o is ValidatorSlashEvent { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validatorPeriod === "bigint" && typeof o.fraction === "string"); + }, + isAmino(o: any): o is ValidatorSlashEventAmino { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validator_period === "bigint" && typeof o.fraction === "string"); + }, + encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.validatorPeriod); + } + if (message.fraction !== "") { + writer.uint32(18).string(message.fraction); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64(); + break; + case 2: + message.fraction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? BigInt(object.validatorPeriod.toString()) : BigInt(0); + message.fraction = object.fraction ?? ""; + return message; + }, + fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; + }, + toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { + const obj: any = {}; + obj.validator_period = message.validatorPeriod !== BigInt(0) ? message.validatorPeriod?.toString() : undefined; + obj.fraction = message.fraction === "" ? undefined : message.fraction; + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvent): ValidatorSlashEventAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvent", + value: ValidatorSlashEvent.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventProtoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.decode(message.value); + }, + toProto(message: ValidatorSlashEvent): Uint8Array { + return ValidatorSlashEvent.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvent): ValidatorSlashEventProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + value: ValidatorSlashEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSlashEvent.typeUrl, ValidatorSlashEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvent.aminoType, ValidatorSlashEvent.typeUrl); +function createBaseValidatorSlashEvents(): ValidatorSlashEvents { + return { + validatorSlashEvents: [] + }; +} +export const ValidatorSlashEvents = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + aminoType: "cosmos-sdk/ValidatorSlashEvents", + is(o: any): o is ValidatorSlashEvents { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validatorSlashEvents) && (!o.validatorSlashEvents.length || ValidatorSlashEvent.is(o.validatorSlashEvents[0]))); + }, + isAmino(o: any): o is ValidatorSlashEventsAmino { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEvent.isAmino(o.validator_slash_events[0]))); + }, + encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorSlashEvents) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validatorSlashEvents?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { + const obj: any = {}; + if (message.validatorSlashEvents) { + obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); + } else { + obj.validator_slash_events = message.validatorSlashEvents; + } + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventsAminoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvents", + value: ValidatorSlashEvents.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventsProtoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.decode(message.value); + }, + toProto(message: ValidatorSlashEvents): Uint8Array { + return ValidatorSlashEvents.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + value: ValidatorSlashEvents.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSlashEvents.typeUrl, ValidatorSlashEvents); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvents.aminoType, ValidatorSlashEvents.typeUrl); +function createBaseFeePool(): FeePool { + return { + communityPool: [] + }; +} +export const FeePool = { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + aminoType: "cosmos-sdk/FeePool", + is(o: any): o is FeePool { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.communityPool) && (!o.communityPool.length || DecCoin.is(o.communityPool[0]))); + }, + isAmino(o: any): o is FeePoolAmino { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.community_pool) && (!o.community_pool.length || DecCoin.isAmino(o.community_pool[0]))); + }, + encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.communityPool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityPool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.communityPool?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeePoolAmino): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeePool): FeePoolAmino { + const obj: any = {}; + if (message.communityPool) { + obj.community_pool = message.communityPool.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.community_pool = message.communityPool; + } + return obj; + }, + fromAminoMsg(object: FeePoolAminoMsg): FeePool { + return FeePool.fromAmino(object.value); + }, + toAminoMsg(message: FeePool): FeePoolAminoMsg { + return { + type: "cosmos-sdk/FeePool", + value: FeePool.toAmino(message) + }; + }, + fromProtoMsg(message: FeePoolProtoMsg): FeePool { + return FeePool.decode(message.value); + }, + toProto(message: FeePool): Uint8Array { + return FeePool.encode(message).finish(); + }, + toProtoMsg(message: FeePool): FeePoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + value: FeePool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeePool.typeUrl, FeePool); +GlobalDecoderRegistry.registerAminoProtoMapping(FeePool.aminoType, FeePool.typeUrl); +function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { + return { + title: "", + description: "", + recipient: "", + amount: [] + }; +} +export const CommunityPoolSpendProposal = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + aminoType: "cosmos-sdk/CommunityPoolSpendProposal", + is(o: any): o is CommunityPoolSpendProposal { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is CommunityPoolSpendProposalAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: CommunityPoolSpendProposal, 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.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposal(); + 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.recipient = reader.string(); + break; + case 4: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + 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: CommunityPoolSpendProposalAminoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalProtoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposal): Uint8Array { + return CommunityPoolSpendProposal.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommunityPoolSpendProposal.typeUrl, CommunityPoolSpendProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposal.aminoType, CommunityPoolSpendProposal.typeUrl); +function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { + return { + previousPeriod: BigInt(0), + stake: "", + height: BigInt(0) + }; +} +export const DelegatorStartingInfo = { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + aminoType: "cosmos-sdk/DelegatorStartingInfo", + is(o: any): o is DelegatorStartingInfo { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previousPeriod === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + isAmino(o: any): o is DelegatorStartingInfoAmino { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previous_period === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.previousPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.previousPeriod); + } + if (message.stake !== "") { + writer.uint32(18).string(message.stake); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorStartingInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64(); + break; + case 2: + message.stake = reader.string(); + break; + case 3: + message.height = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? BigInt(object.previousPeriod.toString()) : BigInt(0); + message.stake = object.stake ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { + const obj: any = {}; + obj.previous_period = message.previousPeriod !== BigInt(0) ? message.previousPeriod?.toString() : undefined; + obj.stake = message.stake ?? ""; + obj.height = message.height ? message.height?.toString() : "0"; + return obj; + }, + fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.fromAmino(object.value); + }, + toAminoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoAminoMsg { + return { + type: "cosmos-sdk/DelegatorStartingInfo", + value: DelegatorStartingInfo.toAmino(message) + }; + }, + fromProtoMsg(message: DelegatorStartingInfoProtoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.decode(message.value); + }, + toProto(message: DelegatorStartingInfo): Uint8Array { + return DelegatorStartingInfo.encode(message).finish(); + }, + toProtoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + value: DelegatorStartingInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegatorStartingInfo.typeUrl, DelegatorStartingInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegatorStartingInfo.aminoType, DelegatorStartingInfo.typeUrl); +function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { + return { + validatorAddress: "", + reward: [] + }; +} +export const DelegationDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + aminoType: "cosmos-sdk/DelegationDelegatorReward", + is(o: any): o is DelegationDelegatorReward { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validatorAddress === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.is(o.reward[0]))); + }, + isAmino(o: any): o is DelegationDelegatorRewardAmino { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.isAmino(o.reward[0]))); + }, + encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.reward) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationDelegatorReward(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.reward.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + message.validatorAddress = object.validatorAddress ?? ""; + message.reward = object.reward?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.reward) { + obj.reward = message.reward.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.reward = message.reward; + } + return obj; + }, + fromAminoMsg(object: DelegationDelegatorRewardAminoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/DelegationDelegatorReward", + value: DelegationDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationDelegatorRewardProtoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.decode(message.value); + }, + toProto(message: DelegationDelegatorReward): Uint8Array { + return DelegationDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + value: DelegationDelegatorReward.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegationDelegatorReward.typeUrl, DelegationDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationDelegatorReward.aminoType, DelegationDelegatorReward.typeUrl); +function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { + return { + title: "", + description: "", + recipient: "", + amount: "", + deposit: "" + }; +} +export const CommunityPoolSpendProposalWithDeposit = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + aminoType: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + is(o: any): o is CommunityPoolSpendProposalWithDeposit { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + isAmino(o: any): o is CommunityPoolSpendProposalWithDepositAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + encode(message: CommunityPoolSpendProposalWithDeposit, 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.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.deposit !== "") { + writer.uint32(42).string(message.deposit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + 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.recipient = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.deposit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount ?? ""; + message.deposit = object.deposit ?? ""; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; + }, + toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.deposit = message.deposit === "" ? undefined : message.deposit; + return obj; + }, + fromAminoMsg(object: CommunityPoolSpendProposalWithDepositAminoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalWithDepositProtoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposalWithDeposit): Uint8Array { + return CommunityPoolSpendProposalWithDeposit.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommunityPoolSpendProposalWithDeposit.typeUrl, CommunityPoolSpendProposalWithDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposalWithDeposit.aminoType, CommunityPoolSpendProposalWithDeposit.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/distribution/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..79204615 --- /dev/null +++ b/libs/injective-query/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -0,0 +1,67 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetWithdrawAddress.typeUrl, + encoders: toEncoders(MsgSetWithdrawAddress), + converters: toConverters(MsgSetWithdrawAddress) +}); +export const useSetWithdrawAddress = buildUseMutation({ + builderMutationFn: createSetWithdrawAddress +}); +export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawDelegatorReward.typeUrl, + encoders: toEncoders(MsgWithdrawDelegatorReward), + converters: toConverters(MsgWithdrawDelegatorReward) +}); +export const useWithdrawDelegatorReward = buildUseMutation({ + builderMutationFn: createWithdrawDelegatorReward +}); +export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawValidatorCommission.typeUrl, + encoders: toEncoders(MsgWithdrawValidatorCommission), + converters: toConverters(MsgWithdrawValidatorCommission) +}); +export const useWithdrawValidatorCommission = buildUseMutation({ + builderMutationFn: createWithdrawValidatorCommission +}); +export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundCommunityPool.typeUrl, + encoders: toEncoders(MsgFundCommunityPool), + converters: toConverters(MsgFundCommunityPool) +}); +export const useFundCommunityPool = buildUseMutation({ + builderMutationFn: createFundCommunityPool +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCommunityPoolSpend.typeUrl, + encoders: toEncoders(MsgCommunityPoolSpend), + converters: toConverters(MsgCommunityPoolSpend) +}); +export const useCommunityPoolSpend = buildUseMutation({ + builderMutationFn: createCommunityPoolSpend +}); +export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositValidatorRewardsPool.typeUrl, + encoders: toEncoders(MsgDepositValidatorRewardsPool), + converters: toConverters(MsgDepositValidatorRewardsPool) +}); +export const useDepositValidatorRewardsPool = buildUseMutation({ + builderMutationFn: createDepositValidatorRewardsPool +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/distribution/v1beta1/tx.ts b/libs/injective-query/src/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 00000000..64517d0b --- /dev/null +++ b/libs/injective-query/src/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,1478 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino } from "./distribution"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string; + withdrawAddress: string; +} +export interface MsgSetWithdrawAddressProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress"; + value: Uint8Array; +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressAmino { + delegator_address: string; + withdraw_address: string; +} +export interface MsgSetWithdrawAddressAminoMsg { + type: "cosmos-sdk/MsgModifyWithdrawAddress"; + value: MsgSetWithdrawAddressAmino; +} +/** + * 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. + */ +export interface MsgSetWithdrawAddressResponseAmino {} +export interface MsgSetWithdrawAddressResponseAminoMsg { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; + value: MsgSetWithdrawAddressResponseAmino; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string; + validatorAddress: string; +} +export interface MsgWithdrawDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"; + value: Uint8Array; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardAmino { + delegator_address: string; + validator_address: string; +} +export interface MsgWithdrawDelegatorRewardAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegationReward"; + value: MsgWithdrawDelegatorRewardAmino; +} +/** + * 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 { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} +export interface MsgWithdrawDelegatorRewardResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; + value: MsgWithdrawDelegatorRewardResponseAmino; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string; +} +export interface MsgWithdrawValidatorCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"; + value: Uint8Array; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionAmino { + validator_address: string; +} +export interface MsgWithdrawValidatorCommissionAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; + value: MsgWithdrawValidatorCommissionAmino; +} +/** + * 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 { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} +export interface MsgWithdrawValidatorCommissionResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; + value: MsgWithdrawValidatorCommissionResponseAmino; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[]; + depositor: string; +} +export interface MsgFundCommunityPoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool"; + value: Uint8Array; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolAmino { + amount: CoinAmino[]; + depositor: string; +} +export interface MsgFundCommunityPoolAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPool"; + value: MsgFundCommunityPoolAmino; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} +export interface MsgFundCommunityPoolResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse"; + value: Uint8Array; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseAmino {} +export interface MsgFundCommunityPoolResponseAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPoolResponse"; + value: MsgFundCommunityPoolResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { + return { + delegatorAddress: "", + withdrawAddress: "" + }; +} +export const MsgSetWithdrawAddress = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + is(o: any): o is MsgSetWithdrawAddress { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegatorAddress === "string" && typeof o.withdrawAddress === "string"); + }, + isAmino(o: any): o is MsgSetWithdrawAddressAmino { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, + encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; + }, + toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoMsg { + return { + type: "cosmos-sdk/MsgModifyWithdrawAddress", + value: MsgSetWithdrawAddress.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressProtoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddress): Uint8Array { + return MsgSetWithdrawAddress.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetWithdrawAddress.typeUrl, MsgSetWithdrawAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddress.aminoType, MsgSetWithdrawAddress.typeUrl); +function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { + return {}; +} +export const MsgSetWithdrawAddressResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + aminoType: "cosmos-sdk/MsgSetWithdrawAddressResponse", + is(o: any): o is MsgSetWithdrawAddressResponse { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetWithdrawAddressResponseAmino { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressResponseAminoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressResponseProtoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddressResponse): Uint8Array { + return MsgSetWithdrawAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetWithdrawAddressResponse.typeUrl, MsgSetWithdrawAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddressResponse.aminoType, MsgSetWithdrawAddressResponse.typeUrl); +function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const MsgWithdrawDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + is(o: any): o is MsgWithdrawDelegatorReward { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorReward(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + 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; + } + return message; + }, + toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawDelegatorRewardAminoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegationReward", + value: MsgWithdrawDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardProtoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorReward): Uint8Array { + return MsgWithdrawDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorReward.typeUrl, MsgWithdrawDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorReward.aminoType, MsgWithdrawDelegatorReward.typeUrl); +function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { + return { + amount: [] + }; +} +export const MsgWithdrawDelegatorRewardResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + aminoType: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + is(o: any): o is MsgWithdrawDelegatorRewardResponse { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardResponseAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + 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 { + return MsgWithdrawDelegatorRewardResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardResponseProtoMsg): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorRewardResponse): Uint8Array { + return MsgWithdrawDelegatorRewardResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorRewardResponse.typeUrl, MsgWithdrawDelegatorRewardResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorRewardResponse.aminoType, MsgWithdrawDelegatorRewardResponse.typeUrl); +function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { + return { + validatorAddress: "" + }; +} +export const MsgWithdrawValidatorCommission = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + is(o: any): o is MsgWithdrawValidatorCommission { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validator_address === "string"); + }, + encode(message: MsgWithdrawValidatorCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommission(); + 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: DeepPartial): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawValidatorCommissionAminoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionProtoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommission): Uint8Array { + return MsgWithdrawValidatorCommission.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommission.typeUrl, MsgWithdrawValidatorCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommission.aminoType, MsgWithdrawValidatorCommission.typeUrl); +function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { + return { + amount: [] + }; +} +export const MsgWithdrawValidatorCommissionResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + is(o: any): o is MsgWithdrawValidatorCommissionResponse { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionResponseAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + 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 { + return MsgWithdrawValidatorCommissionResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionResponseProtoMsg): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommissionResponse): Uint8Array { + return MsgWithdrawValidatorCommissionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommissionResponse.typeUrl, MsgWithdrawValidatorCommissionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommissionResponse.aminoType, MsgWithdrawValidatorCommissionResponse.typeUrl); +function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { + return { + amount: [], + depositor: "" + }; +} +export const MsgFundCommunityPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + aminoType: "cosmos-sdk/MsgFundCommunityPool", + is(o: any): o is MsgFundCommunityPool { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.depositor === "string"); + }, + isAmino(o: any): o is MsgFundCommunityPoolAmino { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.depositor === "string"); + }, + encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPool(); + 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.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPool", + value: MsgFundCommunityPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolProtoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.decode(message.value); + }, + toProto(message: MsgFundCommunityPool): Uint8Array { + return MsgFundCommunityPool.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundCommunityPool.typeUrl, MsgFundCommunityPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPool.aminoType, MsgFundCommunityPool.typeUrl); +function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { + return {}; +} +export const MsgFundCommunityPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + aminoType: "cosmos-sdk/MsgFundCommunityPoolResponse", + is(o: any): o is MsgFundCommunityPoolResponse { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgFundCommunityPoolResponseAmino { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolResponseAminoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolResponseProtoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.decode(message.value); + }, + toProto(message: MsgFundCommunityPoolResponse): Uint8Array { + return MsgFundCommunityPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundCommunityPoolResponse.typeUrl, MsgFundCommunityPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPoolResponse.aminoType, MsgFundCommunityPoolResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { + authority: "", + recipient: "", + amount: [] + }; +} +export const MsgCommunityPoolSpend = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + is(o: any): o is MsgCommunityPoolSpend { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgCommunityPoolSpendAmino { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpend.typeUrl, MsgCommunityPoolSpend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpend.aminoType, MsgCommunityPoolSpend.typeUrl); +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} +export const MsgCommunityPoolSpendResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + aminoType: "cosmos-sdk/MsgCommunityPoolSpendResponse", + is(o: any): o is MsgCommunityPoolSpendResponse { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + isAmino(o: any): o is MsgCommunityPoolSpendResponseAmino { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpendResponse.typeUrl, MsgCommunityPoolSpendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpendResponse.aminoType, MsgCommunityPoolSpendResponse.typeUrl); +function createBaseMsgDepositValidatorRewardsPool(): MsgDepositValidatorRewardsPool { + return { + depositor: "", + validatorAddress: "", + amount: [] + }; +} +export const MsgDepositValidatorRewardsPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + aminoType: "cosmos-sdk/distr/MsgDepositValRewards", + is(o: any): o is MsgDepositValidatorRewardsPool { + return o && (o.$typeUrl === MsgDepositValidatorRewardsPool.typeUrl || typeof o.depositor === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositValidatorRewardsPoolAmino { + return o && (o.$typeUrl === MsgDepositValidatorRewardsPool.typeUrl || typeof o.depositor === "string" && typeof o.validator_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositValidatorRewardsPool.typeUrl, MsgDepositValidatorRewardsPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositValidatorRewardsPool.aminoType, MsgDepositValidatorRewardsPool.typeUrl); +function createBaseMsgDepositValidatorRewardsPoolResponse(): MsgDepositValidatorRewardsPoolResponse { + return {}; +} +export const MsgDepositValidatorRewardsPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + aminoType: "cosmos-sdk/MsgDepositValidatorRewardsPoolResponse", + is(o: any): o is MsgDepositValidatorRewardsPoolResponse { + return o && o.$typeUrl === MsgDepositValidatorRewardsPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositValidatorRewardsPoolResponseAmino { + return o && o.$typeUrl === MsgDepositValidatorRewardsPoolResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositValidatorRewardsPoolResponse.typeUrl, MsgDepositValidatorRewardsPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositValidatorRewardsPoolResponse.aminoType, MsgDepositValidatorRewardsPoolResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..3cfc4271 --- /dev/null +++ b/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -0,0 +1,31 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrantAllowance.typeUrl, + encoders: toEncoders(MsgGrantAllowance), + converters: toConverters(MsgGrantAllowance) +}); +export const useGrantAllowance = buildUseMutation({ + builderMutationFn: createGrantAllowance +}); +export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeAllowance.typeUrl, + encoders: toEncoders(MsgRevokeAllowance), + converters: toConverters(MsgRevokeAllowance) +}); +export const useRevokeAllowance = buildUseMutation({ + builderMutationFn: createRevokeAllowance +}); +export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAllowances.typeUrl, + encoders: toEncoders(MsgPruneAllowances), + converters: toConverters(MsgPruneAllowances) +}); +export const usePruneAllowances = buildUseMutation({ + builderMutationFn: createPruneAllowances +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.ts b/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 00000000..9e674784 --- /dev/null +++ b/libs/injective-query/src/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,596 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + 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, periodic, allowed fee allowance. */ + allowance?: Any | undefined; +} +export interface MsgGrantAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; + value: Uint8Array; +} +export type MsgGrantAllowanceEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: AnyProtoMsg | undefined; +}; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + 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, periodic, allowed fee allowance. */ + allowance?: AnyAmino; +} +export interface MsgGrantAllowanceAminoMsg { + type: "cosmos-sdk/MsgGrantAllowance"; + value: MsgGrantAllowanceAmino; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponse {} +export interface MsgGrantAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; + value: Uint8Array; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseAmino {} +export interface MsgGrantAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgGrantAllowanceResponse"; + value: MsgGrantAllowanceResponseAmino; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; + value: Uint8Array; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowance"; + value: MsgRevokeAllowanceAmino; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponse {} +export interface MsgRevokeAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; + value: Uint8Array; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseAmino {} +export interface MsgRevokeAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowanceResponse"; + value: MsgRevokeAllowanceResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgGrantAllowance(): MsgGrantAllowance { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const MsgGrantAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + aminoType: "cosmos-sdk/MsgGrantAllowance", + is(o: any): o is MsgGrantAllowance { + return o && (o.$typeUrl === MsgGrantAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is MsgGrantAllowanceAmino { + return o && (o.$typeUrl === MsgGrantAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: MsgGrantAllowance, 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.allowance !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.allowance), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowance(); + 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.allowance = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? GlobalDecoderRegistry.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = GlobalDecoderRegistry.fromAminoMsg(object.allowance); + } + return message; + }, + toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? GlobalDecoderRegistry.toAminoMsg(message.allowance) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { + return MsgGrantAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowance): MsgGrantAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowance", + value: MsgGrantAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceProtoMsg): MsgGrantAllowance { + return MsgGrantAllowance.decode(message.value); + }, + toProto(message: MsgGrantAllowance): Uint8Array { + return MsgGrantAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowance): MsgGrantAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantAllowance.typeUrl, MsgGrantAllowance); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantAllowance.aminoType, MsgGrantAllowance.typeUrl); +function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { + return {}; +} +export const MsgGrantAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + aminoType: "cosmos-sdk/MsgGrantAllowanceResponse", + is(o: any): o is MsgGrantAllowanceResponse { + return o && o.$typeUrl === MsgGrantAllowanceResponse.typeUrl; + }, + isAmino(o: any): o is MsgGrantAllowanceResponseAmino { + return o && o.$typeUrl === MsgGrantAllowanceResponse.typeUrl; + }, + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + toAmino(_: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceResponseAminoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceResponseProtoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.decode(message.value); + }, + toProto(message: MsgGrantAllowanceResponse): Uint8Array { + return MsgGrantAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantAllowanceResponse.typeUrl, MsgGrantAllowanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantAllowanceResponse.aminoType, MsgGrantAllowanceResponse.typeUrl); +function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { + return { + granter: "", + grantee: "" + }; +} +export const MsgRevokeAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + aminoType: "cosmos-sdk/MsgRevokeAllowance", + is(o: any): o is MsgRevokeAllowance { + return o && (o.$typeUrl === MsgRevokeAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is MsgRevokeAllowanceAmino { + return o && (o.$typeUrl === MsgRevokeAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowance(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: MsgRevokeAllowance): MsgRevokeAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowance", + value: MsgRevokeAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceProtoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.decode(message.value); + }, + toProto(message: MsgRevokeAllowance): Uint8Array { + return MsgRevokeAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeAllowance.typeUrl, MsgRevokeAllowance); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeAllowance.aminoType, MsgRevokeAllowance.typeUrl); +function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { + return {}; +} +export const MsgRevokeAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + aminoType: "cosmos-sdk/MsgRevokeAllowanceResponse", + is(o: any): o is MsgRevokeAllowanceResponse { + return o && o.$typeUrl === MsgRevokeAllowanceResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeAllowanceResponseAmino { + return o && o.$typeUrl === MsgRevokeAllowanceResponse.typeUrl; + }, + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + toAmino(_: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceResponseAminoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceResponseProtoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.decode(message.value); + }, + toProto(message: MsgRevokeAllowanceResponse): Uint8Array { + return MsgRevokeAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeAllowanceResponse.typeUrl, MsgRevokeAllowanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeAllowanceResponse.aminoType, MsgRevokeAllowanceResponse.typeUrl); +function createBaseMsgPruneAllowances(): MsgPruneAllowances { + return { + pruner: "" + }; +} +export const MsgPruneAllowances = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + aminoType: "cosmos-sdk/MsgPruneAllowances", + is(o: any): o is MsgPruneAllowances { + return o && (o.$typeUrl === MsgPruneAllowances.typeUrl || typeof o.pruner === "string"); + }, + isAmino(o: any): o is MsgPruneAllowancesAmino { + return o && (o.$typeUrl === MsgPruneAllowances.typeUrl || typeof o.pruner === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAllowances.typeUrl, MsgPruneAllowances); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAllowances.aminoType, MsgPruneAllowances.typeUrl); +function createBaseMsgPruneAllowancesResponse(): MsgPruneAllowancesResponse { + return {}; +} +export const MsgPruneAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + aminoType: "cosmos-sdk/MsgPruneAllowancesResponse", + is(o: any): o is MsgPruneAllowancesResponse { + return o && o.$typeUrl === MsgPruneAllowancesResponse.typeUrl; + }, + isAmino(o: any): o is MsgPruneAllowancesResponseAmino { + return o && o.$typeUrl === MsgPruneAllowancesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAllowancesResponse.typeUrl, MsgPruneAllowancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAllowancesResponse.aminoType, MsgPruneAllowancesResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1/gov.ts b/libs/injective-query/src/cosmos/gov/v1/gov.ts new file mode 100644 index 00000000..434920f3 --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1/gov.ts @@ -0,0 +1,1843 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { isSet, DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + aminoType: "cosmos-sdk/v1/WeightedVoteOption", + is(o: any): o is WeightedVoteOption { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedVoteOptionAmino { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedVoteOption.aminoType, WeightedVoteOption.typeUrl); +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1.Deposit", + aminoType: "cosmos-sdk/v1/Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +GlobalDecoderRegistry.registerAminoProtoMapping(Deposit.aminoType, Deposit.typeUrl); +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", + aminoType: "cosmos-sdk/v1/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && isSet(o.status) && Array.isArray(o.totalDeposit) && (!o.totalDeposit.length || Coin.is(o.totalDeposit[0])) && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.proposer === "string" && typeof o.expedited === "boolean" && typeof o.failedReason === "string"); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && isSet(o.status) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isAmino(o.total_deposit[0])) && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.proposer === "string" && typeof o.expedited === "boolean" && typeof o.failed_reason === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1.TallyResult", + aminoType: "cosmos-sdk/v1/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yesCount === "string" && typeof o.abstainCount === "string" && typeof o.noCount === "string" && typeof o.noWithVetoCount === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes_count === "string" && typeof o.abstain_count === "string" && typeof o.no_count === "string" && typeof o.no_with_veto_count === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1.Vote", + aminoType: "cosmos-sdk/v1/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: undefined + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1.DepositParams", + aminoType: "cosmos-sdk/v1/DepositParams", + is(o: any): o is DepositParams { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0]))); + }, + isAmino(o: any): o is DepositParamsAmino { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams); +GlobalDecoderRegistry.registerAminoProtoMapping(DepositParams.aminoType, DepositParams.typeUrl); +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: undefined + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1.VotingParams", + aminoType: "cosmos-sdk/v1/VotingParams", + is(o: any): o is VotingParams { + return o && o.$typeUrl === VotingParams.typeUrl; + }, + isAmino(o: any): o is VotingParamsAmino { + return o && o.$typeUrl === VotingParams.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams); +GlobalDecoderRegistry.registerAminoProtoMapping(VotingParams.aminoType, VotingParams.typeUrl); +function createBaseTallyParams(): TallyParams { + return { + quorum: "", + threshold: "", + vetoThreshold: "" + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1.TallyParams", + aminoType: "cosmos-sdk/v1/TallyParams", + is(o: any): o is TallyParams { + return o && (o.$typeUrl === TallyParams.typeUrl || typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.vetoThreshold === "string"); + }, + isAmino(o: any): o is TallyParamsAmino { + return o && (o.$typeUrl === TallyParams.typeUrl || typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.veto_threshold === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyParams.aminoType, TallyParams.typeUrl); +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", + aminoType: "cosmos-sdk/v1/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0])) && typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.vetoThreshold === "string" && typeof o.minInitialDepositRatio === "string" && typeof o.proposalCancelRatio === "string" && typeof o.proposalCancelDest === "string" && typeof o.expeditedThreshold === "string" && Array.isArray(o.expeditedMinDeposit) && (!o.expeditedMinDeposit.length || Coin.is(o.expeditedMinDeposit[0])) && typeof o.burnVoteQuorum === "boolean" && typeof o.burnProposalDepositPrevote === "boolean" && typeof o.burnVoteVeto === "boolean" && typeof o.minDepositRatio === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0])) && typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.veto_threshold === "string" && typeof o.min_initial_deposit_ratio === "string" && typeof o.proposal_cancel_ratio === "string" && typeof o.proposal_cancel_dest === "string" && typeof o.expedited_threshold === "string" && Array.isArray(o.expedited_min_deposit) && (!o.expedited_min_deposit.length || Coin.isAmino(o.expedited_min_deposit[0])) && typeof o.burn_vote_quorum === "boolean" && typeof o.burn_proposal_deposit_prevote === "boolean" && typeof o.burn_vote_veto === "boolean" && typeof o.min_deposit_ratio === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/gov/v1/tx.rpc.func.ts new file mode 100644 index 00000000..cb094f2e --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1/tx.rpc.func.ts @@ -0,0 +1,67 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecLegacyContent.typeUrl, + encoders: toEncoders(MsgExecLegacyContent), + converters: toConverters(MsgExecLegacyContent) +}); +export const useExecLegacyContent = buildUseMutation({ + builderMutationFn: createExecLegacyContent +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelProposal.typeUrl, + encoders: toEncoders(MsgCancelProposal), + converters: toConverters(MsgCancelProposal) +}); +export const useCancelProposal = buildUseMutation({ + builderMutationFn: createCancelProposal +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1/tx.ts b/libs/injective-query/src/cosmos/gov/v1/tx.ts new file mode 100644 index 00000000..d01c6807 --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1/tx.ts @@ -0,0 +1,1660 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, Params, ParamsAmino } from "./gov"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { TextProposal, TextProposalProtoMsg } from "../v1beta1/gov"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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; +} +/** 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; +} +/** + * 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?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; +} +export type MsgExecLegacyContentEncoded = Omit & { + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + initialDeposit: [], + proposer: "", + metadata: "", + title: "", + summary: "", + expedited: false + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && Array.isArray(o.initialDeposit) && (!o.initialDeposit.length || Coin.is(o.initialDeposit[0])) && typeof o.proposer === "string" && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.expedited === "boolean"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isAmino(o.initial_deposit[0])) && typeof o.proposer === "string" && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.expedited === "boolean"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/v1/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { + content: undefined, + authority: "" + }; +} +export const MsgExecLegacyContent = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", + is(o: any): o is MsgExecLegacyContent { + return o && (o.$typeUrl === MsgExecLegacyContent.typeUrl || typeof o.authority === "string"); + }, + isAmino(o: any): o is MsgExecLegacyContentAmino { + return o && (o.$typeUrl === MsgExecLegacyContent.typeUrl || typeof o.authority === "string"); + }, + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecLegacyContent.typeUrl, MsgExecLegacyContent); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecLegacyContent.aminoType, MsgExecLegacyContent.typeUrl); +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {}; +} +export const MsgExecLegacyContentResponse = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + aminoType: "cosmos-sdk/v1/MsgExecLegacyContentResponse", + is(o: any): o is MsgExecLegacyContentResponse { + return o && o.$typeUrl === MsgExecLegacyContentResponse.typeUrl; + }, + isAmino(o: any): o is MsgExecLegacyContentResponseAmino { + return o && o.$typeUrl === MsgExecLegacyContentResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecLegacyContentResponse.typeUrl, MsgExecLegacyContentResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecLegacyContentResponse.aminoType, MsgExecLegacyContentResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "" + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1.MsgVote", + aminoType: "cosmos-sdk/v1/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + aminoType: "cosmos-sdk/v1/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + is(o: any): o is MsgVoteWeighted { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgVoteWeightedAmino { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeighted.typeUrl, MsgVoteWeighted); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeighted.aminoType, MsgVoteWeighted.typeUrl); +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + aminoType: "cosmos-sdk/v1/MsgVoteWeightedResponse", + is(o: any): o is MsgVoteWeightedResponse { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteWeightedResponseAmino { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeightedResponse.typeUrl, MsgVoteWeightedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeightedResponse.aminoType, MsgVoteWeightedResponse.typeUrl); +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + aminoType: "cosmos-sdk/v1/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + aminoType: "cosmos-sdk/v1/MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositResponse.aminoType, MsgDepositResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/v1/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgCancelProposal(): MsgCancelProposal { + return { + proposalId: BigInt(0), + proposer: "" + }; +} +export const MsgCancelProposal = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + aminoType: "cosmos-sdk/v1/MsgCancelProposal", + is(o: any): o is MsgCancelProposal { + return o && (o.$typeUrl === MsgCancelProposal.typeUrl || typeof o.proposalId === "bigint" && typeof o.proposer === "string"); + }, + isAmino(o: any): o is MsgCancelProposalAmino { + return o && (o.$typeUrl === MsgCancelProposal.typeUrl || typeof o.proposal_id === "bigint" && typeof o.proposer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelProposal.typeUrl, MsgCancelProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelProposal.aminoType, MsgCancelProposal.typeUrl); +function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { + return { + proposalId: BigInt(0), + canceledTime: new Date(), + canceledHeight: BigInt(0) + }; +} +export const MsgCancelProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + aminoType: "cosmos-sdk/v1/MsgCancelProposalResponse", + is(o: any): o is MsgCancelProposalResponse { + return o && (o.$typeUrl === MsgCancelProposalResponse.typeUrl || typeof o.proposalId === "bigint" && Timestamp.is(o.canceledTime) && typeof o.canceledHeight === "bigint"); + }, + isAmino(o: any): o is MsgCancelProposalResponseAmino { + return o && (o.$typeUrl === MsgCancelProposalResponse.typeUrl || typeof o.proposal_id === "bigint" && Timestamp.isAmino(o.canceled_time) && typeof o.canceled_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelProposalResponse.typeUrl, MsgCancelProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelProposalResponse.aminoType, MsgCancelProposalResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1beta1/gov.ts b/libs/injective-query/src/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 00000000..cf660d2d --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,1428 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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. + * + * 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 { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption"; + value: Uint8Array; +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +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/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * 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 { + typeUrl: "/cosmos.gov.v1beta1.TextProposal"; + value: Uint8Array; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * 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 { + type: "cosmos-sdk/TextProposal"; + value: TextProposalAmino; +} +/** + * 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.v1beta1.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/Deposit"; + value: DepositAmino; +} +/** 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?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** 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 { + typeUrl: "/cosmos.gov.v1beta1.Proposal"; + value: Uint8Array; +} +export type ProposalEncoded = Omit & { + /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + /** 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 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"; + value: ProposalAmino; +} +/** 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 { + typeUrl: "/cosmos.gov.v1beta1.TallyResult"; + value: Uint8Array; +} +/** 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 { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** + * 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; + /** + * 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. + */ + /** @deprecated */ + option: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOption[]; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.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; + /** + * 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. + */ + /** @deprecated */ + option: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOptionAmino[]; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +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.v1beta1.DepositParams"; + value: Uint8Array; +} +/** DepositParams defines the params for deposits on governance proposals. */ +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/DepositParams"; + value: DepositParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Duration of the voting period. */ + votingPeriod: Duration; +} +export interface VotingParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.VotingParams"; + value: Uint8Array; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsAmino { + /** Duration of the voting period. */ + voting_period: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/VotingParams"; + value: VotingParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * 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. + */ + vetoThreshold: Uint8Array; +} +export interface TallyParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.TallyParams"; + value: Uint8Array; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +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/TallyParams"; + value: TallyParamsAmino; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + aminoType: "cosmos-sdk/WeightedVoteOption", + is(o: any): o is WeightedVoteOption { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedVoteOptionAmino { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + 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: DeepPartial): 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 ?? ""; + return obj; + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value); + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.WeightedVoteOption", + value: WeightedVoteOption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedVoteOption.aminoType, WeightedVoteOption.typeUrl); +function createBaseTextProposal(): TextProposal { + return { + title: "", + description: "" + }; +} +export const TextProposal = { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + aminoType: "cosmos-sdk/TextProposal", + is(o: any): o is TextProposal { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is TextProposalAmino { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTextProposal(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TextProposal { + const message = createBaseTextProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: TextProposalAmino): TextProposal { + const message = createBaseTextProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: TextProposal): TextProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: TextProposalAminoMsg): TextProposal { + return TextProposal.fromAmino(object.value); + }, + toAminoMsg(message: TextProposal): TextProposalAminoMsg { + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TextProposalProtoMsg): TextProposal { + return TextProposal.decode(message.value); + }, + toProto(message: TextProposal): Uint8Array { + return TextProposal.encode(message).finish(); + }, + toProtoMsg(message: TextProposal): TextProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TextProposal.typeUrl, TextProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TextProposal.aminoType, TextProposal.typeUrl); +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1beta1.Deposit", + aminoType: "cosmos-sdk/Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +GlobalDecoderRegistry.registerAminoProtoMapping(Deposit.aminoType, Deposit.typeUrl); +function createBaseProposal(): Proposal { + return { + proposalId: BigInt(0), + content: undefined, + status: 0, + finalTallyResult: TallyResult.fromPartial({}), + submitTime: new Date(), + depositEndTime: new Date(), + totalDeposit: [], + votingStartTime: new Date(), + votingEndTime: new Date() + }; +} +export const Proposal = { + typeUrl: "/cosmos.gov.v1beta1.Proposal", + aminoType: "cosmos-sdk/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposalId === "bigint" && isSet(o.status) && TallyResult.is(o.finalTallyResult) && Timestamp.is(o.submitTime) && Timestamp.is(o.depositEndTime) && Array.isArray(o.totalDeposit) && (!o.totalDeposit.length || Coin.is(o.totalDeposit[0])) && Timestamp.is(o.votingStartTime) && Timestamp.is(o.votingEndTime)); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposal_id === "bigint" && isSet(o.status) && TallyResult.isAmino(o.final_tally_result) && Timestamp.isAmino(o.submit_time) && Timestamp.isAmino(o.deposit_end_time) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isAmino(o.total_deposit[0])) && Timestamp.isAmino(o.voting_start_time) && Timestamp.isAmino(o.voting_end_time)); + }, + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), 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(); + } + 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.proposalId = reader.uint64(); + break; + case 2: + message.content = GlobalDecoderRegistry.unwrapAny(reader); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proposal { + const message = createBaseProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.fromPartial(object.content) : undefined; + 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; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + 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)); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId?.toString() : undefined; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; + obj.status = message.status === 0 ? undefined : message.status; + 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)) : new Date(); + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : new Date(); + 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.gov.v1beta1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yes: "", + abstain: "", + no: "", + noWithVeto: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1beta1.TallyResult", + aminoType: "cosmos-sdk/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.noWithVeto === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.no_with_veto === "string"); + }, + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yes !== "") { + writer.uint32(10).string(message.yes); + } + if (message.abstain !== "") { + writer.uint32(18).string(message.abstain); + } + if (message.no !== "") { + writer.uint32(26).string(message.no); + } + if (message.noWithVeto !== "") { + writer.uint32(34).string(message.noWithVeto); + } + 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.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TallyResult { + const message = createBaseTallyResult(); + message.yes = object.yes ?? ""; + message.abstain = object.abstain ?? ""; + message.no = object.no ?? ""; + message.noWithVeto = object.noWithVeto ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes = message.yes === "" ? undefined : message.yes; + obj.abstain = message.abstain === "" ? undefined : message.abstain; + obj.no = message.no === "" ? undefined : message.no; + obj.no_with_veto = message.noWithVeto === "" ? undefined : message.noWithVeto; + 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.gov.v1beta1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + options: [] + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1beta1.Vote", + aminoType: "cosmos-sdk/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, + 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); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).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.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + 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; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: Vote): VoteAmino { + 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; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + 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.gov.v1beta1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: Duration.fromPartial({}) + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1beta1.DepositParams", + aminoType: "cosmos-sdk/DepositParams", + is(o: any): o is DepositParams { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0])) && Duration.is(o.maxDepositPeriod)); + }, + isAmino(o: any): o is DepositParamsAmino { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0])) && Duration.isAmino(o.max_deposit_period)); + }, + 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: DeepPartial): 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/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.v1beta1.DepositParams", + value: DepositParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams); +GlobalDecoderRegistry.registerAminoProtoMapping(DepositParams.aminoType, DepositParams.typeUrl); +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: Duration.fromPartial({}) + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1beta1.VotingParams", + aminoType: "cosmos-sdk/VotingParams", + is(o: any): o is VotingParams { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.is(o.votingPeriod)); + }, + isAmino(o: any): o is VotingParamsAmino { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.isAmino(o.voting_period)); + }, + 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: DeepPartial): 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/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.v1beta1.VotingParams", + value: VotingParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams); +GlobalDecoderRegistry.registerAminoProtoMapping(VotingParams.aminoType, VotingParams.typeUrl); +function createBaseTallyParams(): TallyParams { + return { + quorum: new Uint8Array(), + threshold: new Uint8Array(), + vetoThreshold: new Uint8Array() + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1beta1.TallyParams", + aminoType: "cosmos-sdk/TallyParams", + is(o: any): o is TallyParams { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.vetoThreshold instanceof Uint8Array || typeof o.vetoThreshold === "string")); + }, + isAmino(o: any): o is TallyParamsAmino { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.veto_threshold instanceof Uint8Array || typeof o.veto_threshold === "string")); + }, + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quorum.length !== 0) { + writer.uint32(10).bytes(message.quorum); + } + if (message.threshold.length !== 0) { + writer.uint32(18).bytes(message.threshold); + } + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(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.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? new Uint8Array(); + message.threshold = object.threshold ?? new Uint8Array(); + message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); + return message; + }, + fromAmino(object: TallyParamsAmino): TallyParams { + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; + }, + toAmino(message: TallyParams): TallyParamsAmino { + const obj: any = {}; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; + return obj; + }, + fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { + return TallyParams.fromAmino(object.value); + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.TallyParams", + value: TallyParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyParams.aminoType, TallyParams.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/injective-query/src/cosmos/gov/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..5add14c4 --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -0,0 +1,91 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposal", + clientResolver +}); +export const useGetProposal = buildUseQuery({ + builderQueryFn: createGetProposal, + queryKeyPrefix: "ProposalQuery" +}); +export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsRequest.encode, + decode: QueryProposalsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposals", + clientResolver +}); +export const useGetProposals = buildUseQuery({ + builderQueryFn: createGetProposals, + queryKeyPrefix: "ProposalsQuery" +}); +export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteRequest.encode, + decode: QueryVoteResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Vote", + clientResolver +}); +export const useGetVote = buildUseQuery({ + builderQueryFn: createGetVote, + queryKeyPrefix: "VoteQuery" +}); +export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesRequest.encode, + decode: QueryVotesResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Votes", + clientResolver +}); +export const useGetVotes = buildUseQuery({ + builderQueryFn: createGetVotes, + queryKeyPrefix: "VotesQuery" +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositRequest.encode, + decode: QueryDepositResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposit", + clientResolver +}); +export const useGetDeposit = buildUseQuery({ + builderQueryFn: createGetDeposit, + queryKeyPrefix: "DepositQuery" +}); +export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositsRequest.encode, + decode: QueryDepositsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposits", + clientResolver +}); +export const useGetDeposits = buildUseQuery({ + builderQueryFn: createGetDeposits, + queryKeyPrefix: "DepositsQuery" +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "TallyResult", + clientResolver +}); +export const useGetTallyResult = buildUseQuery({ + builderQueryFn: createGetTallyResult, + queryKeyPrefix: "TallyResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1beta1/query.ts b/libs/injective-query/src/cosmos/gov/v1beta1/query.ts new file mode 100644 index 00000000..15053043 --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1beta1/query.ts @@ -0,0 +1,1749 @@ +import { ProposalStatus, Proposal, ProposalAmino, Vote, VoteAmino, VotingParams, VotingParamsAmino, DepositParams, DepositParamsAmino, TallyParams, TallyParamsAmino, Deposit, DepositAmino, TallyResult, TallyResultAmino } from "./gov"; +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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.v1beta1.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/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + proposal: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseAmino { + proposal: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** 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.v1beta1.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/QueryProposalsRequest"; + value: QueryProposalsRequestAmino; +} +/** + * 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.v1beta1.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/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +/** 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.v1beta1.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/QueryVoteRequest"; + value: QueryVoteRequestAmino; +} +/** 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.v1beta1.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/QueryVoteResponse"; + value: QueryVoteResponseAmino; +} +/** 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.v1beta1.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/QueryVotesRequest"; + value: QueryVotesRequestAmino; +} +/** 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.v1beta1.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/QueryVotesResponse"; + value: QueryVotesResponseAmino; +} +/** 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.v1beta1.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/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** voting_params defines the parameters related to voting. */ + votingParams: VotingParams; + /** deposit_params defines the parameters related to deposit. */ + depositParams: DepositParams; + /** tally_params defines the parameters related to tally. */ + tallyParams: TallyParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** 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; + /** deposit_params defines the parameters related to deposit. */ + deposit_params: DepositParamsAmino; + /** tally_params defines the parameters related to tally. */ + tally_params: TallyParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** 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.v1beta1.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/QueryDepositRequest"; + value: QueryDepositRequestAmino; +} +/** 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.v1beta1.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/QueryDepositResponse"; + value: QueryDepositResponseAmino; +} +/** 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.v1beta1.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/QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +/** 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.v1beta1.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/QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +/** 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.v1beta1.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/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** 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.v1beta1.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/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + aminoType: "cosmos-sdk/QueryProposalRequest", + is(o: any): o is QueryProposalRequest { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryProposalRequestAmino { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalRequest.typeUrl, QueryProposalRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalRequest.aminoType, QueryProposalRequest.typeUrl); +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: Proposal.fromPartial({}) + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + aminoType: "cosmos-sdk/QueryProposalResponse", + is(o: any): o is QueryProposalResponse { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.is(o.proposal)); + }, + isAmino(o: any): o is QueryProposalResponseAmino { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.isAmino(o.proposal)); + }, + 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: DeepPartial): 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) : Proposal.toAmino(Proposal.fromPartial({})); + 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.gov.v1beta1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalResponse.typeUrl, QueryProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalResponse.aminoType, QueryProposalResponse.typeUrl); +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { + proposalStatus: 0, + voter: "", + depositor: "", + pagination: undefined + }; +} +export const QueryProposalsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + aminoType: "cosmos-sdk/QueryProposalsRequest", + is(o: any): o is QueryProposalsRequest { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposalStatus) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryProposalsRequestAmino { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposal_status) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryProposalsRequest", + value: QueryProposalsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalsRequest.typeUrl, QueryProposalsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsRequest.aminoType, QueryProposalsRequest.typeUrl); +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + aminoType: "cosmos-sdk/QueryProposalsResponse", + is(o: any): o is QueryProposalsResponse { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is QueryProposalsResponseAmino { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isAmino(o.proposals[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalsResponse.typeUrl, QueryProposalsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsResponse.aminoType, QueryProposalsResponse.typeUrl); +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + aminoType: "cosmos-sdk/QueryVoteRequest", + is(o: any): o is QueryVoteRequest { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string"); + }, + isAmino(o: any): o is QueryVoteRequestAmino { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVoteRequest", + value: QueryVoteRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVoteRequest.typeUrl, QueryVoteRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteRequest.aminoType, QueryVoteRequest.typeUrl); +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { + vote: Vote.fromPartial({}) + }; +} +export const QueryVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + aminoType: "cosmos-sdk/QueryVoteResponse", + is(o: any): o is QueryVoteResponse { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.is(o.vote)); + }, + isAmino(o: any): o is QueryVoteResponseAmino { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.isAmino(o.vote)); + }, + 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: DeepPartial): 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) : Vote.toAmino(Vote.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { + return QueryVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.QueryVoteResponse", + value: QueryVoteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVoteResponse.typeUrl, QueryVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteResponse.aminoType, QueryVoteResponse.typeUrl); +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + aminoType: "cosmos-sdk/QueryVotesRequest", + is(o: any): o is QueryVotesRequest { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryVotesRequestAmino { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVotesRequest", + value: QueryVotesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVotesRequest.typeUrl, QueryVotesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesRequest.aminoType, QueryVotesRequest.typeUrl); +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + aminoType: "cosmos-sdk/QueryVotesResponse", + is(o: any): o is QueryVotesResponse { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.is(o.votes[0]))); + }, + isAmino(o: any): o is QueryVotesResponseAmino { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.isAmino(o.votes[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVotesResponse", + value: QueryVotesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVotesResponse.typeUrl, QueryVotesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesResponse.aminoType, QueryVotesResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + paramsType: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.paramsType === "string"); + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.params_type === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + votingParams: VotingParams.fromPartial({}), + depositParams: DepositParams.fromPartial({}), + tallyParams: TallyParams.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.is(o.votingParams) && DepositParams.is(o.depositParams) && TallyParams.is(o.tallyParams)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.isAmino(o.voting_params) && DepositParams.isAmino(o.deposit_params) && TallyParams.isAmino(o.tally_params)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + 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); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + 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 { + 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.gov.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { + proposalId: BigInt(0), + depositor: "" + }; +} +export const QueryDepositRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + aminoType: "cosmos-sdk/QueryDepositRequest", + is(o: any): o is QueryDepositRequest { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryDepositRequestAmino { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositRequest", + value: QueryDepositRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositRequest.typeUrl, QueryDepositRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositRequest.aminoType, QueryDepositRequest.typeUrl); +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { + deposit: Deposit.fromPartial({}) + }; +} +export const QueryDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + aminoType: "cosmos-sdk/QueryDepositResponse", + is(o: any): o is QueryDepositResponse { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.is(o.deposit)); + }, + isAmino(o: any): o is QueryDepositResponseAmino { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.isAmino(o.deposit)); + }, + 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: DeepPartial): 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) : Deposit.toAmino(Deposit.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { + return QueryDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.QueryDepositResponse", + value: QueryDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositResponse.typeUrl, QueryDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositResponse.aminoType, QueryDepositResponse.typeUrl); +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryDepositsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + aminoType: "cosmos-sdk/QueryDepositsRequest", + is(o: any): o is QueryDepositsRequest { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryDepositsRequestAmino { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositsRequest.typeUrl, QueryDepositsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsRequest.aminoType, QueryDepositsRequest.typeUrl); +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [], + pagination: undefined + }; +} +export const QueryDepositsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + aminoType: "cosmos-sdk/QueryDepositsResponse", + is(o: any): o is QueryDepositsResponse { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is QueryDepositsResponseAmino { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isAmino(o.deposits[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositsResponse.typeUrl, QueryDepositsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsResponse.aminoType, QueryDepositsResponse.typeUrl); +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + aminoType: "cosmos-sdk/QueryTallyResultRequest", + is(o: any): o is QueryTallyResultRequest { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryTallyResultRequestAmino { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTallyResultRequest.typeUrl, QueryTallyResultRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultRequest.aminoType, QueryTallyResultRequest.typeUrl); +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: TallyResult.fromPartial({}) + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + aminoType: "cosmos-sdk/QueryTallyResultResponse", + is(o: any): o is QueryTallyResultResponse { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.is(o.tally)); + }, + isAmino(o: any): o is QueryTallyResultResponseAmino { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.isAmino(o.tally)); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTallyResultResponse.typeUrl, QueryTallyResultResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultResponse.aminoType, QueryTallyResultResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/gov/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..ff3449ec --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -0,0 +1,40 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const useVoteWeighted = buildUseMutation({ + builderMutationFn: createVoteWeighted +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/gov/v1beta1/tx.ts b/libs/injective-query/src/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 00000000..2235f820 --- /dev/null +++ b/libs/injective-query/src/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,884 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, TextProposal, TextProposalProtoMsg } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** content is the proposal's content. */ + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** 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 { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; + value: Uint8Array; +} +export type MsgSubmitProposalEncoded = Omit & { + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + /** content is the proposal's content. */ + content?: 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; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** 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.v1beta1.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/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** 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 { + typeUrl: "/cosmos.gov.v1beta1.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; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * 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 { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted"; + value: Uint8Array; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +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[]; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** 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.v1beta1.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/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + content: undefined, + initialDeposit: [], + proposer: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + aminoType: "cosmos-sdk/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initialDeposit) && (!o.initialDeposit.length || Coin.is(o.initialDeposit[0])) && typeof o.proposer === "string"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isAmino(o.initial_deposit[0])) && typeof o.proposer === "string"); + }, + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), 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); + } + 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.content = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.fromPartial(object.content) : undefined; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; + 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; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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 ? message.proposalId?.toString() : "0"; + 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.gov.v1beta1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + aminoType: "cosmos-sdk/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + 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); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + 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; + } + 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; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + aminoType: "cosmos-sdk/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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.gov.v1beta1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [] + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + aminoType: "cosmos-sdk/MsgVoteWeighted", + is(o: any): o is MsgVoteWeighted { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isAmino(o: any): o is MsgVoteWeightedAmino { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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)) || []; + 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)) || []; + 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; + } + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeighted.typeUrl, MsgVoteWeighted); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeighted.aminoType, MsgVoteWeighted.typeUrl); +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + aminoType: "cosmos-sdk/MsgVoteWeightedResponse", + is(o: any): o is MsgVoteWeightedResponse { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteWeightedResponseAmino { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + 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(_: DeepPartial): 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/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.v1beta1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeightedResponse.typeUrl, MsgVoteWeightedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeightedResponse.aminoType, MsgVoteWeightedResponse.typeUrl); +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + aminoType: "cosmos-sdk/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + aminoType: "cosmos-sdk/MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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/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.v1beta1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositResponse.aminoType, MsgDepositResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/group/v1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/group/v1/tx.rpc.func.ts new file mode 100644 index 00000000..95673a00 --- /dev/null +++ b/libs/injective-query/src/cosmos/group/v1/tx.rpc.func.ts @@ -0,0 +1,130 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroup.typeUrl, + encoders: toEncoders(MsgCreateGroup), + converters: toConverters(MsgCreateGroup) +}); +export const useCreateGroup = buildUseMutation({ + builderMutationFn: createCreateGroup +}); +export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMembers.typeUrl, + encoders: toEncoders(MsgUpdateGroupMembers), + converters: toConverters(MsgUpdateGroupMembers) +}); +export const useUpdateGroupMembers = buildUseMutation({ + builderMutationFn: createUpdateGroupMembers +}); +export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupAdmin), + converters: toConverters(MsgUpdateGroupAdmin) +}); +export const useUpdateGroupAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupAdmin +}); +export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupMetadata), + converters: toConverters(MsgUpdateGroupMetadata) +}); +export const useUpdateGroupMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupMetadata +}); +export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupPolicy), + converters: toConverters(MsgCreateGroupPolicy) +}); +export const useCreateGroupPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupPolicy +}); +export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupWithPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupWithPolicy), + converters: toConverters(MsgCreateGroupWithPolicy) +}); +export const useCreateGroupWithPolicy = buildUseMutation({ + builderMutationFn: createCreateGroupWithPolicy +}); +export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyAdmin), + converters: toConverters(MsgUpdateGroupPolicyAdmin) +}); +export const useUpdateGroupPolicyAdmin = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyAdmin +}); +export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyDecisionPolicy), + converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy) +}); +export const useUpdateGroupPolicyDecisionPolicy = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyDecisionPolicy +}); +export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyMetadata), + converters: toConverters(MsgUpdateGroupPolicyMetadata) +}); +export const useUpdateGroupPolicyMetadata = buildUseMutation({ + builderMutationFn: createUpdateGroupPolicyMetadata +}); +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const useSubmitProposal = buildUseMutation({ + builderMutationFn: createSubmitProposal +}); +export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawProposal.typeUrl, + encoders: toEncoders(MsgWithdrawProposal), + converters: toConverters(MsgWithdrawProposal) +}); +export const useWithdrawProposal = buildUseMutation({ + builderMutationFn: createWithdrawProposal +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const useVote = buildUseMutation({ + builderMutationFn: createVote +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const useExec = buildUseMutation({ + builderMutationFn: createExec +}); +export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLeaveGroup.typeUrl, + encoders: toEncoders(MsgLeaveGroup), + converters: toConverters(MsgLeaveGroup) +}); +export const useLeaveGroup = buildUseMutation({ + builderMutationFn: createLeaveGroup +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/group/v1/tx.ts b/libs/injective-query/src/cosmos/group/v1/tx.ts new file mode 100644 index 00000000..492b0084 --- /dev/null +++ b/libs/injective-query/src/cosmos/group/v1/tx.ts @@ -0,0 +1,3207 @@ +import { MemberRequest, MemberRequestAmino, VoteOption, ProposalExecutorResult, ThresholdDecisionPolicy, ThresholdDecisionPolicyProtoMsg, PercentageDecisionPolicy, PercentageDecisionPolicyProtoMsg } from "./types"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupWithPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupWithPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; + value: Uint8Array; +} +export type MsgUpdateGroupPolicyDecisionPolicyEncoded = Omit & { + /** decision_policy is the updated group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + admin: "", + members: [], + metadata: "" + }; +} +export const MsgCreateGroup = { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + aminoType: "cosmos-sdk/MsgCreateGroup", + is(o: any): o is MsgCreateGroup { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.is(o.members[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgCreateGroupAmino { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.isAmino(o.members[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroup.typeUrl, MsgCreateGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroup.aminoType, MsgCreateGroup.typeUrl); +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + aminoType: "cosmos-sdk/MsgCreateGroupResponse", + is(o: any): o is MsgCreateGroupResponse { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is MsgCreateGroupResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupResponse.typeUrl, MsgCreateGroupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupResponse.aminoType, MsgCreateGroupResponse.typeUrl); +function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { + return { + admin: "", + groupId: BigInt(0), + memberUpdates: [] + }; +} +export const MsgUpdateGroupMembers = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + aminoType: "cosmos-sdk/MsgUpdateGroupMembers", + is(o: any): o is MsgUpdateGroupMembers { + return o && (o.$typeUrl === MsgUpdateGroupMembers.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && Array.isArray(o.memberUpdates) && (!o.memberUpdates.length || MemberRequest.is(o.memberUpdates[0]))); + }, + isAmino(o: any): o is MsgUpdateGroupMembersAmino { + return o && (o.$typeUrl === MsgUpdateGroupMembers.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && Array.isArray(o.member_updates) && (!o.member_updates.length || MemberRequest.isAmino(o.member_updates[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMembers.typeUrl, MsgUpdateGroupMembers); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMembers.aminoType, MsgUpdateGroupMembers.typeUrl); +function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersResponse { + return {}; +} +export const MsgUpdateGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupMembersResponse", + is(o: any): o is MsgUpdateGroupMembersResponse { + return o && o.$typeUrl === MsgUpdateGroupMembersResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupMembersResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupMembersResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMembersResponse.typeUrl, MsgUpdateGroupMembersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMembersResponse.aminoType, MsgUpdateGroupMembersResponse.typeUrl); +function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { + return { + admin: "", + groupId: BigInt(0), + newAdmin: "" + }; +} +export const MsgUpdateGroupAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", + is(o: any): o is MsgUpdateGroupAdmin { + return o && (o.$typeUrl === MsgUpdateGroupAdmin.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupAdminAmino { + return o && (o.$typeUrl === MsgUpdateGroupAdmin.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupAdmin.typeUrl, MsgUpdateGroupAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupAdmin.aminoType, MsgUpdateGroupAdmin.typeUrl); +function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { + return {}; +} +export const MsgUpdateGroupAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupAdminResponse", + is(o: any): o is MsgUpdateGroupAdminResponse { + return o && o.$typeUrl === MsgUpdateGroupAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupAdminResponse.typeUrl, MsgUpdateGroupAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupAdminResponse.aminoType, MsgUpdateGroupAdminResponse.typeUrl); +function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { + return { + admin: "", + groupId: BigInt(0), + metadata: "" + }; +} +export const MsgUpdateGroupMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", + is(o: any): o is MsgUpdateGroupMetadata { + return o && (o.$typeUrl === MsgUpdateGroupMetadata.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupMetadataAmino { + return o && (o.$typeUrl === MsgUpdateGroupMetadata.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMetadata.typeUrl, MsgUpdateGroupMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMetadata.aminoType, MsgUpdateGroupMetadata.typeUrl); +function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataResponse { + return {}; +} +export const MsgUpdateGroupMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupMetadataResponse", + is(o: any): o is MsgUpdateGroupMetadataResponse { + return o && o.$typeUrl === MsgUpdateGroupMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupMetadataResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMetadataResponse.typeUrl, MsgUpdateGroupMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMetadataResponse.aminoType, MsgUpdateGroupMetadataResponse.typeUrl); +function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { + return { + admin: "", + groupId: BigInt(0), + metadata: "", + decisionPolicy: undefined + }; +} +export const MsgCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + aminoType: "cosmos-sdk/MsgCreateGroupPolicy", + is(o: any): o is MsgCreateGroupPolicy { + return o && (o.$typeUrl === MsgCreateGroupPolicy.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgCreateGroupPolicyAmino { + return o && (o.$typeUrl === MsgCreateGroupPolicy.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.metadata === "string"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupPolicy.typeUrl, MsgCreateGroupPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupPolicy.aminoType, MsgCreateGroupPolicy.typeUrl); +function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse { + return { + address: "" + }; +} +export const MsgCreateGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + aminoType: "cosmos-sdk/MsgCreateGroupPolicyResponse", + is(o: any): o is MsgCreateGroupPolicyResponse { + return o && (o.$typeUrl === MsgCreateGroupPolicyResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is MsgCreateGroupPolicyResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupPolicyResponse.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupPolicyResponse.typeUrl, MsgCreateGroupPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupPolicyResponse.aminoType, MsgCreateGroupPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { + return { + admin: "", + groupPolicyAddress: "", + newAdmin: "" + }; +} +export const MsgUpdateGroupPolicyAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + is(o: any): o is MsgUpdateGroupPolicyAdmin { + return o && (o.$typeUrl === MsgUpdateGroupPolicyAdmin.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyAdminAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyAdmin.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyAdmin.typeUrl, MsgUpdateGroupPolicyAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyAdmin.aminoType, MsgUpdateGroupPolicyAdmin.typeUrl); +function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdminResponse { + return {}; +} +export const MsgUpdateGroupPolicyAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse", + is(o: any): o is MsgUpdateGroupPolicyAdminResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyAdminResponse.typeUrl, MsgUpdateGroupPolicyAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyAdminResponse.aminoType, MsgUpdateGroupPolicyAdminResponse.typeUrl); +function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { + return { + admin: "", + members: [], + groupMetadata: "", + groupPolicyMetadata: "", + groupPolicyAsAdmin: false, + decisionPolicy: undefined + }; +} +export const MsgCreateGroupWithPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", + is(o: any): o is MsgCreateGroupWithPolicy { + return o && (o.$typeUrl === MsgCreateGroupWithPolicy.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.is(o.members[0])) && typeof o.groupMetadata === "string" && typeof o.groupPolicyMetadata === "string" && typeof o.groupPolicyAsAdmin === "boolean"); + }, + isAmino(o: any): o is MsgCreateGroupWithPolicyAmino { + return o && (o.$typeUrl === MsgCreateGroupWithPolicy.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.isAmino(o.members[0])) && typeof o.group_metadata === "string" && typeof o.group_policy_metadata === "string" && typeof o.group_policy_as_admin === "boolean"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupWithPolicy.typeUrl, MsgCreateGroupWithPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupWithPolicy.aminoType, MsgCreateGroupWithPolicy.typeUrl); +function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { + return { + groupId: BigInt(0), + groupPolicyAddress: "" + }; +} +export const MsgCreateGroupWithPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicyResponse", + is(o: any): o is MsgCreateGroupWithPolicyResponse { + return o && (o.$typeUrl === MsgCreateGroupWithPolicyResponse.typeUrl || typeof o.groupId === "bigint" && typeof o.groupPolicyAddress === "string"); + }, + isAmino(o: any): o is MsgCreateGroupWithPolicyResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupWithPolicyResponse.typeUrl || typeof o.group_id === "bigint" && typeof o.group_policy_address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupWithPolicyResponse.typeUrl, MsgCreateGroupWithPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupWithPolicyResponse.aminoType, MsgCreateGroupWithPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDecisionPolicy { + return { + admin: "", + groupPolicyAddress: "", + decisionPolicy: undefined + }; +} +export const MsgUpdateGroupPolicyDecisionPolicy = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", + is(o: any): o is MsgUpdateGroupPolicyDecisionPolicy { + return o && (o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicy.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyDecisionPolicyAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicy.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + message.admin = object.admin ?? ""; + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyDecisionPolicy.typeUrl, MsgUpdateGroupPolicyDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyDecisionPolicy.aminoType, MsgUpdateGroupPolicyDecisionPolicy.typeUrl); +function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupPolicyDecisionPolicyResponse { + return {}; +} +export const MsgUpdateGroupPolicyDecisionPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse", + is(o: any): o is MsgUpdateGroupPolicyDecisionPolicyResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyDecisionPolicyResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl, MsgUpdateGroupPolicyDecisionPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyDecisionPolicyResponse.aminoType, MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata { + return { + admin: "", + groupPolicyAddress: "", + metadata: "" + }; +} +export const MsgUpdateGroupPolicyMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + is(o: any): o is MsgUpdateGroupPolicyMetadata { + return o && (o.$typeUrl === MsgUpdateGroupPolicyMetadata.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyMetadataAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyMetadata.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyMetadata.typeUrl, MsgUpdateGroupPolicyMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyMetadata.aminoType, MsgUpdateGroupPolicyMetadata.typeUrl); +function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyMetadataResponse { + return {}; +} +export const MsgUpdateGroupPolicyMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse", + is(o: any): o is MsgUpdateGroupPolicyMetadataResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyMetadataResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyMetadataResponse.typeUrl, MsgUpdateGroupPolicyMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyMetadataResponse.aminoType, MsgUpdateGroupPolicyMetadataResponse.typeUrl); +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + groupPolicyAddress: "", + proposers: [], + metadata: "", + messages: [], + exec: 0, + title: "", + summary: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + aminoType: "cosmos-sdk/group/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || typeof o.groupPolicyAddress === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && typeof o.metadata === "string" && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && isSet(o.exec) && typeof o.title === "string" && typeof o.summary === "string"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || typeof o.group_policy_address === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && typeof o.metadata === "string" && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && isSet(o.exec) && typeof o.title === "string" && typeof o.summary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { + return { + proposalId: BigInt(0), + address: "" + }; +} +export const MsgWithdrawProposal = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + aminoType: "cosmos-sdk/group/MsgWithdrawProposal", + is(o: any): o is MsgWithdrawProposal { + return o && (o.$typeUrl === MsgWithdrawProposal.typeUrl || typeof o.proposalId === "bigint" && typeof o.address === "string"); + }, + isAmino(o: any): o is MsgWithdrawProposalAmino { + return o && (o.$typeUrl === MsgWithdrawProposal.typeUrl || typeof o.proposal_id === "bigint" && typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawProposal.typeUrl, MsgWithdrawProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawProposal.aminoType, MsgWithdrawProposal.typeUrl); +function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { + return {}; +} +export const MsgWithdrawProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + aminoType: "cosmos-sdk/MsgWithdrawProposalResponse", + is(o: any): o is MsgWithdrawProposalResponse { + return o && o.$typeUrl === MsgWithdrawProposalResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawProposalResponseAmino { + return o && o.$typeUrl === MsgWithdrawProposalResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawProposalResponse.typeUrl, MsgWithdrawProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawProposalResponse.aminoType, MsgWithdrawProposalResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + exec: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.group.v1.MsgVote", + aminoType: "cosmos-sdk/group/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && isSet(o.exec)); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && isSet(o.exec)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + aminoType: "cosmos-sdk/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgExec(): MsgExec { + return { + proposalId: BigInt(0), + executor: "" + }; +} +export const MsgExec = { + typeUrl: "/cosmos.group.v1.MsgExec", + aminoType: "cosmos-sdk/group/MsgExec", + is(o: any): o is MsgExec { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.proposalId === "bigint" && typeof o.executor === "string"); + }, + isAmino(o: any): o is MsgExecAmino { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.proposal_id === "bigint" && typeof o.executor === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExec.typeUrl, MsgExec); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExec.aminoType, MsgExec.typeUrl); +function createBaseMsgExecResponse(): MsgExecResponse { + return { + result: 0 + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + aminoType: "cosmos-sdk/MsgExecResponse", + is(o: any): o is MsgExecResponse { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgExecResponseAmino { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecResponse.aminoType, MsgExecResponse.typeUrl); +function createBaseMsgLeaveGroup(): MsgLeaveGroup { + return { + address: "", + groupId: BigInt(0) + }; +} +export const MsgLeaveGroup = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + aminoType: "cosmos-sdk/group/MsgLeaveGroup", + is(o: any): o is MsgLeaveGroup { + return o && (o.$typeUrl === MsgLeaveGroup.typeUrl || typeof o.address === "string" && typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is MsgLeaveGroupAmino { + return o && (o.$typeUrl === MsgLeaveGroup.typeUrl || typeof o.address === "string" && typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgLeaveGroup.typeUrl, MsgLeaveGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLeaveGroup.aminoType, MsgLeaveGroup.typeUrl); +function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { + return {}; +} +export const MsgLeaveGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + aminoType: "cosmos-sdk/MsgLeaveGroupResponse", + is(o: any): o is MsgLeaveGroupResponse { + return o && o.$typeUrl === MsgLeaveGroupResponse.typeUrl; + }, + isAmino(o: any): o is MsgLeaveGroupResponseAmino { + return o && o.$typeUrl === MsgLeaveGroupResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgLeaveGroupResponse.typeUrl, MsgLeaveGroupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLeaveGroupResponse.aminoType, MsgLeaveGroupResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/group/v1/types.ts b/libs/injective-query/src/cosmos/group/v1/types.ts new file mode 100644 index 00000000..f8e9c860 --- /dev/null +++ b/libs/injective-query/src/cosmos/group/v1/types.ts @@ -0,0 +1,2081 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; + /** created_at is a timestamp specifying when a group policy was created. */ + createdAt: Date; +} +export interface GroupPolicyInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; + value: Uint8Array; +} +export type GroupPolicyInfoEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +function createBaseMember(): Member { + return { + address: "", + weight: "", + metadata: "", + addedAt: new Date() + }; +} +export const Member = { + typeUrl: "/cosmos.group.v1.Member", + aminoType: "cosmos-sdk/Member", + is(o: any): o is Member { + return o && (o.$typeUrl === Member.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string" && Timestamp.is(o.addedAt)); + }, + isAmino(o: any): o is MemberAmino { + return o && (o.$typeUrl === Member.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string" && Timestamp.isAmino(o.added_at)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Member.typeUrl, Member); +GlobalDecoderRegistry.registerAminoProtoMapping(Member.aminoType, Member.typeUrl); +function createBaseMemberRequest(): MemberRequest { + return { + address: "", + weight: "", + metadata: "" + }; +} +export const MemberRequest = { + typeUrl: "/cosmos.group.v1.MemberRequest", + aminoType: "cosmos-sdk/MemberRequest", + is(o: any): o is MemberRequest { + return o && (o.$typeUrl === MemberRequest.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MemberRequestAmino { + return o && (o.$typeUrl === MemberRequest.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MemberRequest.typeUrl, MemberRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(MemberRequest.aminoType, MemberRequest.typeUrl); +function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { + return { + threshold: "", + windows: undefined + }; +} +export const ThresholdDecisionPolicy = { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + aminoType: "cosmos-sdk/ThresholdDecisionPolicy", + is(o: any): o is ThresholdDecisionPolicy { + return o && (o.$typeUrl === ThresholdDecisionPolicy.typeUrl || typeof o.threshold === "string"); + }, + isAmino(o: any): o is ThresholdDecisionPolicyAmino { + return o && (o.$typeUrl === ThresholdDecisionPolicy.typeUrl || typeof o.threshold === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ThresholdDecisionPolicy.typeUrl, ThresholdDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(ThresholdDecisionPolicy.aminoType, ThresholdDecisionPolicy.typeUrl); +function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { + return { + percentage: "", + windows: undefined + }; +} +export const PercentageDecisionPolicy = { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + aminoType: "cosmos-sdk/PercentageDecisionPolicy", + is(o: any): o is PercentageDecisionPolicy { + return o && (o.$typeUrl === PercentageDecisionPolicy.typeUrl || typeof o.percentage === "string"); + }, + isAmino(o: any): o is PercentageDecisionPolicyAmino { + return o && (o.$typeUrl === PercentageDecisionPolicy.typeUrl || typeof o.percentage === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(PercentageDecisionPolicy.typeUrl, PercentageDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(PercentageDecisionPolicy.aminoType, PercentageDecisionPolicy.typeUrl); +function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { + return { + votingPeriod: Duration.fromPartial({}), + minExecutionPeriod: Duration.fromPartial({}) + }; +} +export const DecisionPolicyWindows = { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + aminoType: "cosmos-sdk/DecisionPolicyWindows", + is(o: any): o is DecisionPolicyWindows { + return o && (o.$typeUrl === DecisionPolicyWindows.typeUrl || Duration.is(o.votingPeriod) && Duration.is(o.minExecutionPeriod)); + }, + isAmino(o: any): o is DecisionPolicyWindowsAmino { + return o && (o.$typeUrl === DecisionPolicyWindows.typeUrl || Duration.isAmino(o.voting_period) && Duration.isAmino(o.min_execution_period)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DecisionPolicyWindows.typeUrl, DecisionPolicyWindows); +GlobalDecoderRegistry.registerAminoProtoMapping(DecisionPolicyWindows.aminoType, DecisionPolicyWindows.typeUrl); +function createBaseGroupInfo(): GroupInfo { + return { + id: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + totalWeight: "", + createdAt: new Date() + }; +} +export const GroupInfo = { + typeUrl: "/cosmos.group.v1.GroupInfo", + aminoType: "cosmos-sdk/GroupInfo", + is(o: any): o is GroupInfo { + return o && (o.$typeUrl === GroupInfo.typeUrl || typeof o.id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && typeof o.totalWeight === "string" && Timestamp.is(o.createdAt)); + }, + isAmino(o: any): o is GroupInfoAmino { + return o && (o.$typeUrl === GroupInfo.typeUrl || typeof o.id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && typeof o.total_weight === "string" && Timestamp.isAmino(o.created_at)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GroupInfo.typeUrl, GroupInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupInfo.aminoType, GroupInfo.typeUrl); +function createBaseGroupMember(): GroupMember { + return { + groupId: BigInt(0), + member: undefined + }; +} +export const GroupMember = { + typeUrl: "/cosmos.group.v1.GroupMember", + aminoType: "cosmos-sdk/GroupMember", + is(o: any): o is GroupMember { + return o && (o.$typeUrl === GroupMember.typeUrl || typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is GroupMemberAmino { + return o && (o.$typeUrl === GroupMember.typeUrl || typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GroupMember.typeUrl, GroupMember); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupMember.aminoType, GroupMember.typeUrl); +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", + aminoType: "cosmos-sdk/GroupPolicyInfo", + is(o: any): o is GroupPolicyInfo { + return o && (o.$typeUrl === GroupPolicyInfo.typeUrl || typeof o.address === "string" && typeof o.groupId === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && Timestamp.is(o.createdAt)); + }, + isAmino(o: any): o is GroupPolicyInfoAmino { + return o && (o.$typeUrl === GroupPolicyInfo.typeUrl || typeof o.address === "string" && typeof o.group_id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && Timestamp.isAmino(o.created_at)); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(GroupPolicyInfo.typeUrl, GroupPolicyInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupPolicyInfo.aminoType, GroupPolicyInfo.typeUrl); +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", + aminoType: "cosmos-sdk/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && typeof o.groupPolicyAddress === "string" && typeof o.metadata === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && Timestamp.is(o.submitTime) && typeof o.groupVersion === "bigint" && typeof o.groupPolicyVersion === "bigint" && isSet(o.status) && TallyResult.is(o.finalTallyResult) && Timestamp.is(o.votingPeriodEnd) && isSet(o.executorResult) && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && typeof o.title === "string" && typeof o.summary === "string"); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && typeof o.group_policy_address === "string" && typeof o.metadata === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && Timestamp.isAmino(o.submit_time) && typeof o.group_version === "bigint" && typeof o.group_policy_version === "bigint" && isSet(o.status) && TallyResult.isAmino(o.final_tally_result) && Timestamp.isAmino(o.voting_period_end) && isSet(o.executor_result) && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && typeof o.title === "string" && typeof o.summary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.group.v1.TallyResult", + aminoType: "cosmos-sdk/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yesCount === "string" && typeof o.abstainCount === "string" && typeof o.noCount === "string" && typeof o.noWithVetoCount === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes_count === "string" && typeof o.abstain_count === "string" && typeof o.no_count === "string" && typeof o.no_with_veto_count === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + submitTime: new Date() + }; +} +export const Vote = { + typeUrl: "/cosmos.group.v1.Vote", + aminoType: "cosmos-sdk/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && Timestamp.is(o.submitTime)); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && Timestamp.isAmino(o.submit_time)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/ics23/v1/proofs.ts b/libs/injective-query/src/cosmos/ics23/v1/proofs.ts new file mode 100644 index 00000000..27759bde --- /dev/null +++ b/libs/injective-query/src/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,2060 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +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, + KECCAK256 = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + SHA512_256 = 6, + BLAKE2B_512 = 7, + BLAKE2S_256 = 8, + BLAKE3 = 9, + UNRECOGNIZED = -1, +} +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 "KECCAK256": + return HashOp.KECCAK256; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case 6: + case "SHA512_256": + return HashOp.SHA512_256; + case 7: + case "BLAKE2B_512": + return HashOp.BLAKE2B_512; + case 8: + case "BLAKE2S_256": + return HashOp.BLAKE2S_256; + case 9: + case "BLAKE3": + return HashOp.BLAKE3; + 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.KECCAK256: + return "KECCAK256"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.SHA512_256: + return "SHA512_256"; + case HashOp.BLAKE2B_512: + return "BLAKE2B_512"; + case HashOp.BLAKE2S_256: + return "BLAKE2S_256"; + case HashOp.BLAKE3: + return "BLAKE3"; + 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 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; +} +/** + * 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; +} +/** 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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) + * the max_depth is interpreted as 128 if set to 0 + */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehashKeyBeforeComparison: boolean; +} +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) + * the max_depth is interpreted as 128 if set to 0 + */ + max_depth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + min_depth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehash_key_before_comparison: boolean; +} +export interface ProofSpecAminoMsg { + type: "cosmos-sdk/ProofSpec"; + value: ProofSpecAmino; +} +/** + * 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; + /** the max prefix length must be less than the minimum prefix length + child size */ + 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; + /** the max prefix length must be less than the minimum prefix length + child size */ + 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; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + 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 { + entries: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "cosmos-sdk/BatchProof"; + value: BatchProofAmino; +} +/** 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; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; + value: Uint8Array; +} +export interface CompressedBatchProofAmino { + entries: CompressedBatchEntryAmino[]; + lookup_inners: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "cosmos-sdk/CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +/** 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; +} +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 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; +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const ExistenceProof = { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + aminoType: "cosmos-sdk/ExistenceProof", + is(o: any): o is ExistenceProof { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.is(o.path[0]))); + }, + isAmino(o: any): o is ExistenceProofAmino { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isAmino(o.path[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExistenceProof.typeUrl, ExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(ExistenceProof.aminoType, ExistenceProof.typeUrl); +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const NonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + aminoType: "cosmos-sdk/NonExistenceProof", + is(o: any): o is NonExistenceProof { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is NonExistenceProofAmino { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(NonExistenceProof.typeUrl, NonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(NonExistenceProof.aminoType, NonExistenceProof.typeUrl); +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + }; +} +export const CommitmentProof = { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + aminoType: "cosmos-sdk/CommitmentProof", + is(o: any): o is CommitmentProof { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isAmino(o: any): o is CommitmentProofAmino { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CommitmentProof.typeUrl, CommitmentProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CommitmentProof.aminoType, CommitmentProof.typeUrl); +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + }; +} +export const LeafOp = { + typeUrl: "/cosmos.ics23.v1.LeafOp", + aminoType: "cosmos-sdk/LeafOp", + is(o: any): o is LeafOp { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehashKey) && isSet(o.prehashValue) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isAmino(o: any): o is LeafOpAmino { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(LeafOp.typeUrl, LeafOp); +GlobalDecoderRegistry.registerAminoProtoMapping(LeafOp.aminoType, LeafOp.typeUrl); +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + }; +} +export const InnerOp = { + typeUrl: "/cosmos.ics23.v1.InnerOp", + aminoType: "cosmos-sdk/InnerOp", + is(o: any): o is InnerOp { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isAmino(o: any): o is InnerOpAmino { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InnerOp.typeUrl, InnerOp); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerOp.aminoType, InnerOp.typeUrl); +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 0, + minDepth: 0, + prehashKeyBeforeComparison: false + }; +} +export const ProofSpec = { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + aminoType: "cosmos-sdk/ProofSpec", + is(o: any): o is ProofSpec { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.maxDepth === "number" && typeof o.minDepth === "number" && typeof o.prehashKeyBeforeComparison === "boolean"); + }, + isAmino(o: any): o is ProofSpecAmino { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number" && typeof o.prehash_key_before_comparison === "boolean"); + }, + 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); + } + if (message.prehashKeyBeforeComparison === true) { + writer.uint32(40).bool(message.prehashKeyBeforeComparison); + } + 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; + case 5: + message.prehashKeyBeforeComparison = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + message.prehashKeyBeforeComparison = object.prehashKeyBeforeComparison ?? false; + 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; + } + if (object.prehash_key_before_comparison !== undefined && object.prehash_key_before_comparison !== null) { + message.prehashKeyBeforeComparison = object.prehash_key_before_comparison; + } + 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; + obj.prehash_key_before_comparison = message.prehashKeyBeforeComparison === false ? undefined : message.prehashKeyBeforeComparison; + 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() + }; + } +}; +GlobalDecoderRegistry.register(ProofSpec.typeUrl, ProofSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(ProofSpec.aminoType, ProofSpec.typeUrl); +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + }; +} +export const InnerSpec = { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + aminoType: "cosmos-sdk/InnerSpec", + is(o: any): o is InnerSpec { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.childOrder) && (!o.childOrder.length || typeof o.childOrder[0] === "number") && typeof o.childSize === "number" && typeof o.minPrefixLength === "number" && typeof o.maxPrefixLength === "number" && (o.emptyChild instanceof Uint8Array || typeof o.emptyChild === "string") && isSet(o.hash)); + }, + isAmino(o: any): o is InnerSpecAmino { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InnerSpec.typeUrl, InnerSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerSpec.aminoType, InnerSpec.typeUrl); +function createBaseBatchProof(): BatchProof { + return { + entries: [] + }; +} +export const BatchProof = { + typeUrl: "/cosmos.ics23.v1.BatchProof", + aminoType: "cosmos-sdk/BatchProof", + is(o: any): o is BatchProof { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is BatchProofAmino { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isAmino(o.entries[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(BatchProof.typeUrl, BatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchProof.aminoType, BatchProof.typeUrl); +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const BatchEntry = { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + aminoType: "cosmos-sdk/BatchEntry", + is(o: any): o is BatchEntry { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isAmino(o: any): o is BatchEntryAmino { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(BatchEntry.typeUrl, BatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchEntry.aminoType, BatchEntry.typeUrl); +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + }; +} +export const CompressedBatchProof = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + aminoType: "cosmos-sdk/CompressedBatchProof", + is(o: any): o is CompressedBatchProof { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.is(o.entries[0])) && Array.isArray(o.lookupInners) && (!o.lookupInners.length || InnerOp.is(o.lookupInners[0]))); + }, + isAmino(o: any): o is CompressedBatchProofAmino { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isAmino(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isAmino(o.lookup_inners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedBatchProof.typeUrl, CompressedBatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchProof.aminoType, CompressedBatchProof.typeUrl); +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const CompressedBatchEntry = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + aminoType: "cosmos-sdk/CompressedBatchEntry", + is(o: any): o is CompressedBatchEntry { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isAmino(o: any): o is CompressedBatchEntryAmino { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedBatchEntry.typeUrl, CompressedBatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchEntry.aminoType, CompressedBatchEntry.typeUrl); +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const CompressedExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + aminoType: "cosmos-sdk/CompressedExistenceProof", + is(o: any): o is CompressedExistenceProof { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isAmino(o: any): o is CompressedExistenceProofAmino { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedExistenceProof.typeUrl, CompressedExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedExistenceProof.aminoType, CompressedExistenceProof.typeUrl); +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const CompressedNonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + aminoType: "cosmos-sdk/CompressedNonExistenceProof", + is(o: any): o is CompressedNonExistenceProof { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is CompressedNonExistenceProofAmino { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedNonExistenceProof.typeUrl, CompressedNonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedNonExistenceProof.aminoType, CompressedNonExistenceProof.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/msg/v1/msg.ts b/libs/injective-query/src/cosmos/msg/v1/msg.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injective-query/src/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/query/v1/query.ts b/libs/injective-query/src/cosmos/query/v1/query.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injective-query/src/cosmos/query/v1/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/injective-query/src/cosmos/staking/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..0d3c0cfc --- /dev/null +++ b/libs/injective-query/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -0,0 +1,157 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +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"; +export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorsRequest.encode, + decode: QueryValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validators", + clientResolver +}); +export const useGetValidators = buildUseQuery({ + builderQueryFn: createGetValidators, + queryKeyPrefix: "ValidatorsQuery" +}); +export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorRequest.encode, + decode: QueryValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validator", + clientResolver +}); +export const useGetValidator = buildUseQuery({ + builderQueryFn: createGetValidator, + queryKeyPrefix: "ValidatorQuery" +}); +export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorDelegationsRequest.encode, + decode: QueryValidatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorDelegations", + clientResolver +}); +export const useGetValidatorDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorDelegations, + queryKeyPrefix: "ValidatorDelegationsQuery" +}); +export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorUnbondingDelegationsRequest.encode, + decode: QueryValidatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorUnbondingDelegations", + clientResolver +}); +export const useGetValidatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetValidatorUnbondingDelegations, + queryKeyPrefix: "ValidatorUnbondingDelegationsQuery" +}); +export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationRequest.encode, + decode: QueryDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Delegation", + clientResolver +}); +export const useGetDelegation = buildUseQuery({ + builderQueryFn: createGetDelegation, + queryKeyPrefix: "DelegationQuery" +}); +export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryUnbondingDelegationRequest.encode, + decode: QueryUnbondingDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "UnbondingDelegation", + clientResolver +}); +export const useGetUnbondingDelegation = buildUseQuery({ + builderQueryFn: createGetUnbondingDelegation, + queryKeyPrefix: "UnbondingDelegationQuery" +}); +export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorDelegationsRequest.encode, + decode: QueryDelegatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorDelegations", + clientResolver +}); +export const useGetDelegatorDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorDelegations, + queryKeyPrefix: "DelegatorDelegationsQuery" +}); +export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorUnbondingDelegationsRequest.encode, + decode: QueryDelegatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorUnbondingDelegations", + clientResolver +}); +export const useGetDelegatorUnbondingDelegations = buildUseQuery({ + builderQueryFn: createGetDelegatorUnbondingDelegations, + queryKeyPrefix: "DelegatorUnbondingDelegationsQuery" +}); +export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRedelegationsRequest.encode, + decode: QueryRedelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Redelegations", + clientResolver +}); +export const useGetRedelegations = buildUseQuery({ + builderQueryFn: createGetRedelegations, + queryKeyPrefix: "RedelegationsQuery" +}); +export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorsRequest.encode, + decode: QueryDelegatorValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidators", + clientResolver +}); +export const useGetDelegatorValidators = buildUseQuery({ + builderQueryFn: createGetDelegatorValidators, + queryKeyPrefix: "DelegatorValidatorsQuery" +}); +export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorRequest.encode, + decode: QueryDelegatorValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidator", + clientResolver +}); +export const useGetDelegatorValidator = buildUseQuery({ + builderQueryFn: createGetDelegatorValidator, + queryKeyPrefix: "DelegatorValidatorQuery" +}); +export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalInfoRequest.encode, + decode: QueryHistoricalInfoResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "HistoricalInfo", + clientResolver +}); +export const useGetHistoricalInfo = buildUseQuery({ + builderQueryFn: createGetHistoricalInfo, + queryKeyPrefix: "HistoricalInfoQuery" +}); +export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPoolRequest.encode, + decode: QueryPoolResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Pool", + clientResolver +}); +export const useGetPool = buildUseQuery({ + builderQueryFn: createGetPool, + queryKeyPrefix: "PoolQuery" +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/staking/v1beta1/query.ts b/libs/injective-query/src/cosmos/staking/v1beta1/query.ts new file mode 100644 index 00000000..f4754096 --- /dev/null +++ b/libs/injective-query/src/cosmos/staking/v1beta1/query.ts @@ -0,0 +1,3073 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Validator, ValidatorAmino, DelegationResponse, DelegationResponseAmino, UnbondingDelegation, UnbondingDelegationAmino, RedelegationResponse, RedelegationResponseAmino, HistoricalInfo, HistoricalInfoAmino, Pool, PoolAmino, Params, ParamsAmino } from "./staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequest { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; + value: Uint8Array; +} +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequestAmino { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorsRequest"; + value: QueryValidatorsRequestAmino; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponse { + /** validators contains all the queried validators. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; + value: Uint8Array; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponseAmino { + /** validators contains all the queried validators. */ + validators: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorsResponse"; + value: QueryValidatorsResponseAmino; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest"; + value: Uint8Array; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorRequest"; + value: QueryValidatorRequestAmino; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponse { + /** validator defines the validator info. */ + validator: Validator; +} +export interface QueryValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse"; + value: Uint8Array; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponseAmino { + /** validator defines the validator info. */ + validator: ValidatorAmino; +} +export interface QueryValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorResponse"; + value: QueryValidatorResponseAmino; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsRequest"; + value: QueryValidatorDelegationsRequestAmino; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponse { + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponseAmino { + delegation_responses: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsResponse"; + value: QueryValidatorDelegationsResponseAmino; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest"; + value: QueryValidatorUnbondingDelegationsRequestAmino; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponseAmino { + unbonding_responses: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse"; + value: QueryValidatorUnbondingDelegationsResponseAmino; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest"; + value: Uint8Array; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryDelegationRequest"; + value: QueryDelegationRequestAmino; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponse { + /** delegation_responses defines the delegation info of a delegation. */ + delegationResponse?: DelegationResponse; +} +export interface QueryDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; + value: Uint8Array; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponseAmino { + /** delegation_responses defines the delegation info of a delegation. */ + delegation_response?: DelegationResponseAmino; +} +export interface QueryDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryDelegationResponse"; + value: QueryDelegationResponseAmino; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryUnbondingDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryUnbondingDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationRequest"; + value: QueryUnbondingDelegationRequestAmino; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponse { + /** unbond defines the unbonding information of a delegation. */ + unbond: UnbondingDelegation; +} +export interface QueryUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponseAmino { + /** unbond defines the unbonding information of a delegation. */ + unbond: UnbondingDelegationAmino; +} +export interface QueryUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationResponse"; + value: QueryUnbondingDelegationResponseAmino; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest"; + value: QueryDelegatorDelegationsRequestAmino; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponse { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponseAmino { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegation_responses: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse"; + value: QueryDelegatorDelegationsResponseAmino; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest"; + value: QueryDelegatorUnbondingDelegationsRequestAmino; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponseAmino { + unbonding_responses: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse"; + value: QueryDelegatorUnbondingDelegationsResponseAmino; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + srcValidatorAddr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dstValidatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryRedelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; + value: Uint8Array; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + src_validator_addr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dst_validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryRedelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryRedelegationsRequest"; + value: QueryRedelegationsRequestAmino; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponse { + redelegationResponses: RedelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryRedelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; + value: Uint8Array; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponseAmino { + redelegation_responses: RedelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryRedelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryRedelegationsResponse"; + value: QueryRedelegationsResponseAmino; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; + value: QueryDelegatorValidatorsRequestAmino; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the validators' info of a delegator. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseAmino { + /** validators defines the validators' info of a delegator. */ + validators: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; + value: QueryDelegatorValidatorsResponseAmino; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegatorValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryDelegatorValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorRequest"; + value: QueryDelegatorValidatorRequestAmino; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponse { + /** validator defines the validator info. */ + validator: Validator; +} +export interface QueryDelegatorValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponseAmino { + /** validator defines the validator info. */ + validator: ValidatorAmino; +} +export interface QueryDelegatorValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorResponse"; + value: QueryDelegatorValidatorResponseAmino; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequest { + /** height defines at which height to query the historical info. */ + height: bigint; +} +export interface QueryHistoricalInfoRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequestAmino { + /** height defines at which height to query the historical info. */ + height: string; +} +export interface QueryHistoricalInfoRequestAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoRequest"; + value: QueryHistoricalInfoRequestAmino; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponse { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfo; +} +export interface QueryHistoricalInfoResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponseAmino { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfoAmino; +} +export interface QueryHistoricalInfoResponseAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoResponse"; + value: QueryHistoricalInfoResponseAmino; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequest {} +export interface QueryPoolRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest"; + value: Uint8Array; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequestAmino {} +export interface QueryPoolRequestAminoMsg { + type: "cosmos-sdk/QueryPoolRequest"; + value: QueryPoolRequestAmino; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponse { + /** pool defines the pool info. */ + pool: Pool; +} +export interface QueryPoolResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse"; + value: Uint8Array; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponseAmino { + /** pool defines the pool info. */ + pool: PoolAmino; +} +export interface QueryPoolResponseAminoMsg { + type: "cosmos-sdk/QueryPoolResponse"; + value: QueryPoolResponseAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { + return { + status: "", + pagination: undefined + }; +} +export const QueryValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + aminoType: "cosmos-sdk/QueryValidatorsRequest", + is(o: any): o is QueryValidatorsRequest { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryValidatorsRequestAmino { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + message.status = object.status ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsRequestAminoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsRequest", + value: QueryValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsRequestProtoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.decode(message.value); + }, + toProto(message: QueryValidatorsRequest): Uint8Array { + return QueryValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + value: QueryValidatorsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorsRequest.typeUrl, QueryValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsRequest.aminoType, QueryValidatorsRequest.typeUrl); +function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + aminoType: "cosmos-sdk/QueryValidatorsResponse", + is(o: any): o is QueryValidatorsResponse { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isAmino(o: any): o is QueryValidatorsResponseAmino { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, + encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.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): QueryValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.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: DeepPartial): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsResponseAminoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsResponse", + value: QueryValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsResponseProtoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.decode(message.value); + }, + toProto(message: QueryValidatorsResponse): Uint8Array { + return QueryValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + value: QueryValidatorsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorsResponse.typeUrl, QueryValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsResponse.aminoType, QueryValidatorsResponse.typeUrl); +function createBaseQueryValidatorRequest(): QueryValidatorRequest { + return { + validatorAddr: "" + }; +} +export const QueryValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + aminoType: "cosmos-sdk/QueryValidatorRequest", + is(o: any): o is QueryValidatorRequest { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorRequestAmino { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryValidatorRequestAminoMsg): QueryValidatorRequest { + return QueryValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorRequest): QueryValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorRequest", + value: QueryValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorRequestProtoMsg): QueryValidatorRequest { + return QueryValidatorRequest.decode(message.value); + }, + toProto(message: QueryValidatorRequest): Uint8Array { + return QueryValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorRequest): QueryValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + value: QueryValidatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorRequest.typeUrl, QueryValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorRequest.aminoType, QueryValidatorRequest.typeUrl); +function createBaseQueryValidatorResponse(): QueryValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + aminoType: "cosmos-sdk/QueryValidatorResponse", + is(o: any): o is QueryValidatorResponse { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isAmino(o: any): o is QueryValidatorResponseAmino { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, + encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { + return QueryValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorResponse): QueryValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorResponse", + value: QueryValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorResponseProtoMsg): QueryValidatorResponse { + return QueryValidatorResponse.decode(message.value); + }, + toProto(message: QueryValidatorResponse): Uint8Array { + return QueryValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorResponse): QueryValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + value: QueryValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorResponse.typeUrl, QueryValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorResponse.aminoType, QueryValidatorResponse.typeUrl); +function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorDelegationsRequest", + is(o: any): o is QueryValidatorDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsRequestAminoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsRequestProtoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsRequest): Uint8Array { + return QueryValidatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDelegationsRequest.typeUrl, QueryValidatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsRequest.aminoType, QueryValidatorDelegationsRequest.typeUrl); +function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryValidatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorDelegationsResponse", + is(o: any): o is QueryValidatorDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isAmino(o: any): o is QueryValidatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, + encode(message: QueryValidatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.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): QueryValidatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.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: DeepPartial): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsResponseAminoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsResponseProtoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsResponse): Uint8Array { + return QueryValidatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDelegationsResponse.typeUrl, QueryValidatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsResponse.aminoType, QueryValidatorDelegationsResponse.typeUrl); +function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + is(o: any): o is QueryValidatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsRequestAminoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsRequestProtoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsRequest): Uint8Array { + return QueryValidatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsRequest.typeUrl, QueryValidatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsRequest.aminoType, QueryValidatorUnbondingDelegationsRequest.typeUrl); +function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + is(o: any): o is QueryValidatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, + encode(message: QueryValidatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.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): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.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: DeepPartial): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsResponseAminoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsResponseProtoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsResponse): Uint8Array { + return QueryValidatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsResponse.typeUrl, QueryValidatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsResponse.aminoType, QueryValidatorUnbondingDelegationsResponse.typeUrl); +function createBaseQueryDelegationRequest(): QueryDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + aminoType: "cosmos-sdk/QueryDelegationRequest", + is(o: any): o is QueryDelegationRequest { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegationRequestAmino { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegationRequestAminoMsg): QueryDelegationRequest { + return QueryDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationRequest): QueryDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationRequest", + value: QueryDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationRequestProtoMsg): QueryDelegationRequest { + return QueryDelegationRequest.decode(message.value); + }, + toProto(message: QueryDelegationRequest): Uint8Array { + return QueryDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationRequest): QueryDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + value: QueryDelegationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegationRequest.typeUrl, QueryDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationRequest.aminoType, QueryDelegationRequest.typeUrl); +function createBaseQueryDelegationResponse(): QueryDelegationResponse { + return { + delegationResponse: undefined + }; +} +export const QueryDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + aminoType: "cosmos-sdk/QueryDelegationResponse", + is(o: any): o is QueryDelegationResponse { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + isAmino(o: any): o is QueryDelegationResponseAmino { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegationResponse !== undefined) { + DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + message.delegationResponse = object.delegationResponse !== undefined && object.delegationResponse !== null ? DelegationResponse.fromPartial(object.delegationResponse) : undefined; + return message; + }, + fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; + }, + toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { + const obj: any = {}; + obj.delegation_response = message.delegationResponse ? DelegationResponse.toAmino(message.delegationResponse) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegationResponseAminoMsg): QueryDelegationResponse { + return QueryDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationResponse): QueryDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationResponse", + value: QueryDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationResponseProtoMsg): QueryDelegationResponse { + return QueryDelegationResponse.decode(message.value); + }, + toProto(message: QueryDelegationResponse): Uint8Array { + return QueryDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationResponse): QueryDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + value: QueryDelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegationResponse.typeUrl, QueryDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationResponse.aminoType, QueryDelegationResponse.typeUrl); +function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryUnbondingDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + aminoType: "cosmos-sdk/QueryUnbondingDelegationRequest", + is(o: any): o is QueryUnbondingDelegationRequest { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryUnbondingDelegationRequestAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryUnbondingDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationRequestAminoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationRequestProtoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationRequest): Uint8Array { + return QueryUnbondingDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUnbondingDelegationRequest.typeUrl, QueryUnbondingDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationRequest.aminoType, QueryUnbondingDelegationRequest.typeUrl); +function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { + return { + unbond: UnbondingDelegation.fromPartial({}) + }; +} +export const QueryUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + aminoType: "cosmos-sdk/QueryUnbondingDelegationResponse", + is(o: any): o is QueryUnbondingDelegationResponse { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.is(o.unbond)); + }, + isAmino(o: any): o is QueryUnbondingDelegationResponseAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.isAmino(o.unbond)); + }, + encode(message: QueryUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbond !== undefined) { + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + message.unbond = object.unbond !== undefined && object.unbond !== null ? UnbondingDelegation.fromPartial(object.unbond) : undefined; + return message; + }, + fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; + }, + toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { + const obj: any = {}; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : UnbondingDelegation.toAmino(UnbondingDelegation.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationResponseProtoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationResponse): Uint8Array { + return QueryUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUnbondingDelegationResponse.typeUrl, QueryUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationResponse.aminoType, QueryUnbondingDelegationResponse.typeUrl); +function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsRequest", + is(o: any): o is QueryDelegatorDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsRequestAminoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsRequestProtoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsRequest): Uint8Array { + return QueryDelegatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsRequest.typeUrl, QueryDelegatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsRequest.aminoType, QueryDelegatorDelegationsRequest.typeUrl); +function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsResponse", + is(o: any): o is QueryDelegatorDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isAmino(o: any): o is QueryDelegatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, + encode(message: QueryDelegatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.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): QueryDelegatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.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: DeepPartial): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsResponseAminoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsResponseProtoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsResponse): Uint8Array { + return QueryDelegatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsResponse.typeUrl, QueryDelegatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsResponse.aminoType, QueryDelegatorDelegationsResponse.typeUrl); +function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + is(o: any): o is QueryDelegatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsRequestAminoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsRequestProtoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsRequest): Uint8Array { + return QueryDelegatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsRequest.typeUrl, QueryDelegatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsRequest.aminoType, QueryDelegatorUnbondingDelegationsRequest.typeUrl); +function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + is(o: any): o is QueryDelegatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.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): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.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: DeepPartial): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsResponseAminoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsResponseProtoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsResponse): Uint8Array { + return QueryDelegatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsResponse.typeUrl, QueryDelegatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsResponse.aminoType, QueryDelegatorUnbondingDelegationsResponse.typeUrl); +function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { + return { + delegatorAddr: "", + srcValidatorAddr: "", + dstValidatorAddr: "", + pagination: undefined + }; +} +export const QueryRedelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + aminoType: "cosmos-sdk/QueryRedelegationsRequest", + is(o: any): o is QueryRedelegationsRequest { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.srcValidatorAddr === "string" && typeof o.dstValidatorAddr === "string"); + }, + isAmino(o: any): o is QueryRedelegationsRequestAmino { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.src_validator_addr === "string" && typeof o.dst_validator_addr === "string"); + }, + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.srcValidatorAddr !== "") { + writer.uint32(18).string(message.srcValidatorAddr); + } + if (message.dstValidatorAddr !== "") { + writer.uint32(26).string(message.dstValidatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.srcValidatorAddr = reader.string(); + break; + case 3: + message.dstValidatorAddr = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.srcValidatorAddr = object.srcValidatorAddr ?? ""; + message.dstValidatorAddr = object.dstValidatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.src_validator_addr = message.srcValidatorAddr === "" ? undefined : message.srcValidatorAddr; + obj.dst_validator_addr = message.dstValidatorAddr === "" ? undefined : message.dstValidatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsRequestAminoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsRequest", + value: QueryRedelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsRequestProtoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.decode(message.value); + }, + toProto(message: QueryRedelegationsRequest): Uint8Array { + return QueryRedelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + value: QueryRedelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRedelegationsRequest.typeUrl, QueryRedelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsRequest.aminoType, QueryRedelegationsRequest.typeUrl); +function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { + return { + redelegationResponses: [], + pagination: undefined + }; +} +export const QueryRedelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + aminoType: "cosmos-sdk/QueryRedelegationsResponse", + is(o: any): o is QueryRedelegationsResponse { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegationResponses) && (!o.redelegationResponses.length || RedelegationResponse.is(o.redelegationResponses[0]))); + }, + isAmino(o: any): o is QueryRedelegationsResponseAmino { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegation_responses) && (!o.redelegation_responses.length || RedelegationResponse.isAmino(o.redelegation_responses[0]))); + }, + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.redelegationResponses) { + RedelegationResponse.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): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationResponses.push(RedelegationResponse.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: DeepPartial): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegationResponses?.map(e => RedelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { + const obj: any = {}; + if (message.redelegationResponses) { + obj.redelegation_responses = message.redelegationResponses.map(e => e ? RedelegationResponse.toAmino(e) : undefined); + } else { + obj.redelegation_responses = message.redelegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsResponseAminoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsResponse", + value: QueryRedelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsResponseProtoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.decode(message.value); + }, + toProto(message: QueryRedelegationsResponse): Uint8Array { + return QueryRedelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + value: QueryRedelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRedelegationsResponse.typeUrl, QueryRedelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsResponse.aminoType, QueryRedelegationsResponse.typeUrl); +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsRequest", + is(o: any): o is QueryDelegatorValidatorsRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsRequestAminoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsRequestProtoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsRequest): Uint8Array { + return QueryDelegatorValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsRequest.typeUrl, QueryDelegatorValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsRequest.aminoType, QueryDelegatorValidatorsRequest.typeUrl); +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryDelegatorValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsResponse", + is(o: any): o is QueryDelegatorValidatorsResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isAmino(o: any): o is QueryDelegatorValidatorsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.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): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.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: DeepPartial): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsResponseAminoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsResponseProtoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsResponse): Uint8Array { + return QueryDelegatorValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsResponse.typeUrl, QueryDelegatorValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsResponse.aminoType, QueryDelegatorValidatorsResponse.typeUrl); +function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegatorValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorRequest", + is(o: any): o is QueryDelegatorValidatorRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryDelegatorValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorRequestAminoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorRequestProtoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorRequest): Uint8Array { + return QueryDelegatorValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorRequest.typeUrl, QueryDelegatorValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorRequest.aminoType, QueryDelegatorValidatorRequest.typeUrl); +function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryDelegatorValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorResponse", + is(o: any): o is QueryDelegatorValidatorResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isAmino(o: any): o is QueryDelegatorValidatorResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, + encode(message: QueryDelegatorValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorResponseProtoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorResponse): Uint8Array { + return QueryDelegatorValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorResponse.typeUrl, QueryDelegatorValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorResponse.aminoType, QueryDelegatorValidatorResponse.typeUrl); +function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { + return { + height: BigInt(0) + }; +} +export const QueryHistoricalInfoRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + aminoType: "cosmos-sdk/QueryHistoricalInfoRequest", + is(o: any): o is QueryHistoricalInfoRequest { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is QueryHistoricalInfoRequestAmino { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoRequest(); + 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: DeepPartial): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoRequestAminoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoRequestProtoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.decode(message.value); + }, + toProto(message: QueryHistoricalInfoRequest): Uint8Array { + return QueryHistoricalInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalInfoRequest.typeUrl, QueryHistoricalInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoRequest.aminoType, QueryHistoricalInfoRequest.typeUrl); +function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { + return { + hist: undefined + }; +} +export const QueryHistoricalInfoResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + aminoType: "cosmos-sdk/QueryHistoricalInfoResponse", + is(o: any): o is QueryHistoricalInfoResponse { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryHistoricalInfoResponseAmino { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hist !== undefined) { + HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hist = HistoricalInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + message.hist = object.hist !== undefined && object.hist !== null ? HistoricalInfo.fromPartial(object.hist) : undefined; + return message; + }, + fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; + }, + toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { + const obj: any = {}; + obj.hist = message.hist ? HistoricalInfo.toAmino(message.hist) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoResponseAminoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoResponseProtoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.decode(message.value); + }, + toProto(message: QueryHistoricalInfoResponse): Uint8Array { + return QueryHistoricalInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalInfoResponse.typeUrl, QueryHistoricalInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoResponse.aminoType, QueryHistoricalInfoResponse.typeUrl); +function createBaseQueryPoolRequest(): QueryPoolRequest { + return {}; +} +export const QueryPoolRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + aminoType: "cosmos-sdk/QueryPoolRequest", + is(o: any): o is QueryPoolRequest { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + isAmino(o: any): o is QueryPoolRequestAmino { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPoolRequestAminoMsg): QueryPoolRequest { + return QueryPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolRequest): QueryPoolRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPoolRequest", + value: QueryPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolRequestProtoMsg): QueryPoolRequest { + return QueryPoolRequest.decode(message.value); + }, + toProto(message: QueryPoolRequest): Uint8Array { + return QueryPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolRequest): QueryPoolRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + value: QueryPoolRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPoolRequest.typeUrl, QueryPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolRequest.aminoType, QueryPoolRequest.typeUrl); +function createBaseQueryPoolResponse(): QueryPoolResponse { + return { + pool: Pool.fromPartial({}) + }; +} +export const QueryPoolResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + aminoType: "cosmos-sdk/QueryPoolResponse", + is(o: any): o is QueryPoolResponse { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.is(o.pool)); + }, + isAmino(o: any): o is QueryPoolResponseAmino { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.isAmino(o.pool)); + }, + encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pool !== undefined) { + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = Pool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + message.pool = object.pool !== undefined && object.pool !== null ? Pool.fromPartial(object.pool) : undefined; + return message; + }, + fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; + }, + toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { + const obj: any = {}; + obj.pool = message.pool ? Pool.toAmino(message.pool) : Pool.toAmino(Pool.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { + return QueryPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolResponse): QueryPoolResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPoolResponse", + value: QueryPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolResponseProtoMsg): QueryPoolResponse { + return QueryPoolResponse.decode(message.value); + }, + toProto(message: QueryPoolResponse): Uint8Array { + return QueryPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolResponse): QueryPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + value: QueryPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPoolResponse.typeUrl, QueryPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolResponse.aminoType, QueryPoolResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.staking.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.staking.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/staking/v1beta1/staking.ts b/libs/injective-query/src/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 00000000..ab2a299e --- /dev/null +++ b/libs/injective-query/src/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,3005 @@ +import { Header, HeaderAmino } from "../../../tendermint/types/types"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { ValidatorUpdate, ValidatorUpdateAmino } from "../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +/** BondStatus is the status of a validator. */ +export enum BondStatus { + /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1, +} +export const BondStatusAmino = BondStatus; +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case "BOND_STATUS_UNSPECIFIED": + return BondStatus.BOND_STATUS_UNSPECIFIED; + case 1: + case "BOND_STATUS_UNBONDED": + return BondStatus.BOND_STATUS_UNBONDED; + case 2: + case "BOND_STATUS_UNBONDING": + return BondStatus.BOND_STATUS_UNBONDING; + case 3: + case "BOND_STATUS_BONDED": + return BondStatus.BOND_STATUS_BONDED; + case -1: + case "UNRECOGNIZED": + default: + return BondStatus.UNRECOGNIZED; + } +} +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return "BOND_STATUS_UNSPECIFIED"; + case BondStatus.BOND_STATUS_UNBONDED: + return "BOND_STATUS_UNBONDED"; + case BondStatus.BOND_STATUS_UNBONDING: + return "BOND_STATUS_UNBONDING"; + case BondStatus.BOND_STATUS_BONDED: + return "BOND_STATUS_BONDED"; + case BondStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** 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 InfractionAmino = Infraction; +export function infractionFromJSON(object: any): Infraction { + switch (object) { + case 0: + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; + case 1: + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; + case 2: + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return Infraction.UNRECOGNIZED; + } +} +export function infractionToJSON(object: Infraction): string { + switch (object) { + 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"; + } +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header: Header; + valset: Validator[]; +} +export interface HistoricalInfoProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo"; + value: Uint8Array; +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoAmino { + header: HeaderAmino; + valset: ValidatorAmino[]; +} +export interface HistoricalInfoAminoMsg { + type: "cosmos-sdk/HistoricalInfo"; + value: HistoricalInfoAmino; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + maxRate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + maxChangeRate: string; +} +export interface CommissionRatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates"; + value: Uint8Array; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesAmino { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + max_rate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + max_change_rate: string; +} +export interface CommissionRatesAminoMsg { + type: "cosmos-sdk/CommissionRates"; + value: CommissionRatesAmino; +} +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commissionRates: CommissionRates; + /** update_time is the last time the commission rate was changed. */ + updateTime: Date; +} +export interface CommissionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Commission"; + value: Uint8Array; +} +/** 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; + /** update_time is the last time the commission rate was changed. */ + update_time: string; +} +export interface CommissionAminoMsg { + type: "cosmos-sdk/Commission"; + value: CommissionAmino; +} +/** Description defines a validator description. */ +export interface Description { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + securityContact: string; + /** details define other optional details. */ + details: string; +} +export interface DescriptionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Description"; + value: Uint8Array; +} +/** Description defines a validator description. */ +export interface DescriptionAmino { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + security_contact: string; + /** details define other optional details. */ + details: string; +} +export interface DescriptionAminoMsg { + type: "cosmos-sdk/Description"; + value: DescriptionAmino; +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface Validator { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensusPubkey?: Any | undefined; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegatorShares: string; + /** description defines the description terms for the validator. */ + description: Description; + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbondingHeight: bigint; + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbondingTime: Date; + /** commission defines the commission parameters. */ + commission: Commission; + /** + * 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; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbondingIds: bigint[]; +} +export interface ValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validator"; + value: Uint8Array; +} +export type ValidatorEncoded = Omit & { + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */consensusPubkey?: AnyProtoMsg | undefined; +}; +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operator_address: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensus_pubkey?: AnyAmino; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegator_shares: string; + /** description defines the description terms for the validator. */ + 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; + /** commission defines the commission parameters. */ + 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; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbonding_ids: string[]; +} +export interface ValidatorAminoMsg { + type: "cosmos-sdk/Validator"; + value: ValidatorAmino; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + addresses: string[]; +} +export interface ValAddressesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses"; + value: Uint8Array; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesAmino { + addresses: string[]; +} +export interface ValAddressesAminoMsg { + type: "cosmos-sdk/ValAddresses"; + value: ValAddressesAmino; +} +/** + * 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. + */ +export interface DVPair { + delegatorAddress: string; + validatorAddress: string; +} +export interface DVPairProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPair"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DVPairAmino { + delegator_address: string; + validator_address: string; +} +export interface DVPairAminoMsg { + type: "cosmos-sdk/DVPair"; + value: DVPairAmino; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} +export interface DVPairsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPairs"; + value: Uint8Array; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsAmino { + pairs: DVPairAmino[]; +} +export interface DVPairsAminoMsg { + type: "cosmos-sdk/DVPairs"; + value: DVPairsAmino; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; +} +export interface DVVTripletProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet"; + value: Uint8Array; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletAmino { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; +} +export interface DVVTripletAminoMsg { + type: "cosmos-sdk/DVVTriplet"; + value: DVVTripletAmino; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} +export interface DVVTripletsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets"; + value: Uint8Array; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsAmino { + triplets: DVVTripletAmino[]; +} +export interface DVVTripletsAminoMsg { + type: "cosmos-sdk/DVVTriplets"; + value: DVVTripletsAmino; +} +/** + * 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. + */ +export interface Delegation { + /** delegator_address is the encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the encoded address of the validator. */ + validatorAddress: string; + /** shares define the delegation shares received. */ + shares: string; +} +export interface DelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Delegation"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DelegationAmino { + /** delegator_address is the encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the encoded address of the validator. */ + validator_address: string; + /** shares define the delegation shares received. */ + shares: string; +} +export interface DelegationAminoMsg { + type: "cosmos-sdk/Delegation"; + value: DelegationAmino; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + /** delegator_address is the encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the encoded address of the validator. */ + validatorAddress: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntry[]; +} +export interface UnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation"; + value: Uint8Array; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationAmino { + /** delegator_address is the encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the encoded address of the validator. */ + validator_address: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntryAmino[]; +} +export interface UnbondingDelegationAminoMsg { + type: "cosmos-sdk/UnbondingDelegation"; + value: UnbondingDelegationAmino; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; + /** completion_time is the unix time for unbonding completion. */ + completionTime: Date; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initialBalance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; +} +export interface UnbondingDelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; + value: Uint8Array; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +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; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initial_balance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count: string; +} +export interface UnbondingDelegationEntryAminoMsg { + type: "cosmos-sdk/UnbondingDelegationEntry"; + value: UnbondingDelegationEntryAmino; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: bigint; + /** completion_time defines the unix time for redelegation completion. */ + completionTime: Date; + /** initial_balance defines the initial balance when redelegation started. */ + initialBalance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + sharesDst: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; +} +export interface RedelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; + value: Uint8Array; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +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; + /** initial_balance defines the initial balance when redelegation started. */ + initial_balance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + shares_dst: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count: string; +} +export interface RedelegationEntryAminoMsg { + type: "cosmos-sdk/RedelegationEntry"; + value: RedelegationEntryAmino; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_src_address is the validator redelegation source operator address. */ + validatorSrcAddress: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validatorDstAddress: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntry[]; +} +export interface RedelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Redelegation"; + value: Uint8Array; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address: string; + /** validator_src_address is the validator redelegation source operator address. */ + validator_src_address: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validator_dst_address: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntryAmino[]; +} +export interface RedelegationAminoMsg { + type: "cosmos-sdk/Redelegation"; + value: RedelegationAmino; +} +/** Params defines the parameters for the x/staking module. */ +export interface Params { + /** unbonding_time is the time duration of unbonding. */ + unbondingTime: Duration; + /** max_validators is the maximum number of validators. */ + maxValidators: number; + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + maxEntries: number; + /** historical_entries is the number of historical entries to persist. */ + 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 x/staking module. */ +export interface ParamsAmino { + /** unbonding_time is the time duration of unbonding. */ + 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). */ + max_entries: number; + /** historical_entries is the number of historical entries to persist. */ + 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/x/staking/Params"; + value: ParamsAmino; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation: Delegation; + balance: Coin; +} +export interface DelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse"; + value: Uint8Array; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseAmino { + delegation: DelegationAmino; + balance: CoinAmino; +} +export interface DelegationResponseAminoMsg { + type: "cosmos-sdk/DelegationResponse"; + value: DelegationResponseAmino; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry: RedelegationEntry; + balance: string; +} +export interface RedelegationEntryResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse"; + value: Uint8Array; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseAmino { + redelegation_entry: RedelegationEntryAmino; + balance: string; +} +export interface RedelegationEntryResponseAminoMsg { + type: "cosmos-sdk/RedelegationEntryResponse"; + value: RedelegationEntryResponseAmino; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation: Redelegation; + entries: RedelegationEntryResponse[]; +} +export interface RedelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse"; + value: Uint8Array; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseAmino { + redelegation: RedelegationAmino; + entries: RedelegationEntryResponseAmino[]; +} +export interface RedelegationResponseAminoMsg { + type: "cosmos-sdk/RedelegationResponse"; + value: RedelegationResponseAmino; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} +export interface PoolProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Pool"; + value: Uint8Array; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolAmino { + not_bonded_tokens: string; + bonded_tokens: string; +} +export interface PoolAminoMsg { + type: "cosmos-sdk/Pool"; + value: PoolAmino; +} +/** + * 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[]; +} +export interface ValidatorUpdatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; + value: Uint8Array; +} +/** + * 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[]; +} +export interface ValidatorUpdatesAminoMsg { + type: "cosmos-sdk/ValidatorUpdates"; + value: ValidatorUpdatesAmino; +} +function createBaseHistoricalInfo(): HistoricalInfo { + return { + header: Header.fromPartial({}), + valset: [] + }; +} +export const HistoricalInfo = { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + aminoType: "cosmos-sdk/HistoricalInfo", + is(o: any): o is HistoricalInfo { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.is(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.is(o.valset[0]))); + }, + isAmino(o: any): o is HistoricalInfoAmino { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.isAmino(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.isAmino(o.valset[0]))); + }, + encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HistoricalInfo { + const message = createBaseHistoricalInfo(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.valset = object.valset?.map(e => Validator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HistoricalInfoAmino): HistoricalInfo { + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; + }, + toAmino(message: HistoricalInfo): HistoricalInfoAmino { + const obj: any = {}; + 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 { + obj.valset = message.valset; + } + return obj; + }, + fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo { + return HistoricalInfo.fromAmino(object.value); + }, + toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg { + return { + type: "cosmos-sdk/HistoricalInfo", + value: HistoricalInfo.toAmino(message) + }; + }, + fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo { + return HistoricalInfo.decode(message.value); + }, + toProto(message: HistoricalInfo): Uint8Array { + return HistoricalInfo.encode(message).finish(); + }, + toProtoMsg(message: HistoricalInfo): HistoricalInfoProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + value: HistoricalInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HistoricalInfo.typeUrl, HistoricalInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(HistoricalInfo.aminoType, HistoricalInfo.typeUrl); +function createBaseCommissionRates(): CommissionRates { + return { + rate: "", + maxRate: "", + maxChangeRate: "" + }; +} +export const CommissionRates = { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + aminoType: "cosmos-sdk/CommissionRates", + is(o: any): o is CommissionRates { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.maxRate === "string" && typeof o.maxChangeRate === "string"); + }, + isAmino(o: any): o is CommissionRatesAmino { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.max_rate === "string" && typeof o.max_change_rate === "string"); + }, + encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rate !== "") { + writer.uint32(10).string(message.rate); + } + if (message.maxRate !== "") { + writer.uint32(18).string(message.maxRate); + } + if (message.maxChangeRate !== "") { + writer.uint32(26).string(message.maxChangeRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommissionRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommissionRates { + const message = createBaseCommissionRates(); + message.rate = object.rate ?? ""; + message.maxRate = object.maxRate ?? ""; + message.maxChangeRate = object.maxChangeRate ?? ""; + return message; + }, + fromAmino(object: CommissionRatesAmino): CommissionRates { + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; + }, + toAmino(message: CommissionRates): CommissionRatesAmino { + const obj: any = {}; + obj.rate = message.rate ?? ""; + obj.max_rate = message.maxRate ?? ""; + obj.max_change_rate = message.maxChangeRate ?? ""; + return obj; + }, + fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { + return CommissionRates.fromAmino(object.value); + }, + toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg { + return { + type: "cosmos-sdk/CommissionRates", + value: CommissionRates.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates { + return CommissionRates.decode(message.value); + }, + toProto(message: CommissionRates): Uint8Array { + return CommissionRates.encode(message).finish(); + }, + toProtoMsg(message: CommissionRates): CommissionRatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + value: CommissionRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommissionRates.typeUrl, CommissionRates); +GlobalDecoderRegistry.registerAminoProtoMapping(CommissionRates.aminoType, CommissionRates.typeUrl); +function createBaseCommission(): Commission { + return { + commissionRates: CommissionRates.fromPartial({}), + updateTime: new Date() + }; +} +export const Commission = { + typeUrl: "/cosmos.staking.v1beta1.Commission", + aminoType: "cosmos-sdk/Commission", + is(o: any): o is Commission { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.is(o.commissionRates) && Timestamp.is(o.updateTime)); + }, + isAmino(o: any): o is CommissionAmino { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.isAmino(o.commission_rates) && Timestamp.isAmino(o.update_time)); + }, + encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Commission { + const message = createBaseCommission(); + message.commissionRates = object.commissionRates !== undefined && object.commissionRates !== null ? CommissionRates.fromPartial(object.commissionRates) : undefined; + message.updateTime = object.updateTime ?? undefined; + return message; + }, + fromAmino(object: CommissionAmino): Commission { + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time)); + } + return message; + }, + toAmino(message: Commission): CommissionAmino { + const obj: any = {}; + 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 { + return Commission.fromAmino(object.value); + }, + toAminoMsg(message: Commission): CommissionAminoMsg { + return { + type: "cosmos-sdk/Commission", + value: Commission.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionProtoMsg): Commission { + return Commission.decode(message.value); + }, + toProto(message: Commission): Uint8Array { + return Commission.encode(message).finish(); + }, + toProtoMsg(message: Commission): CommissionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Commission", + value: Commission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Commission.typeUrl, Commission); +GlobalDecoderRegistry.registerAminoProtoMapping(Commission.aminoType, Commission.typeUrl); +function createBaseDescription(): Description { + return { + moniker: "", + identity: "", + website: "", + securityContact: "", + details: "" + }; +} +export const Description = { + typeUrl: "/cosmos.staking.v1beta1.Description", + aminoType: "cosmos-sdk/Description", + is(o: any): o is Description { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.securityContact === "string" && typeof o.details === "string"); + }, + isAmino(o: any): o is DescriptionAmino { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.security_contact === "string" && typeof o.details === "string"); + }, + encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moniker !== "") { + writer.uint32(10).string(message.moniker); + } + if (message.identity !== "") { + writer.uint32(18).string(message.identity); + } + if (message.website !== "") { + writer.uint32(26).string(message.website); + } + if (message.securityContact !== "") { + writer.uint32(34).string(message.securityContact); + } + if (message.details !== "") { + writer.uint32(42).string(message.details); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Description { + const message = createBaseDescription(); + message.moniker = object.moniker ?? ""; + message.identity = object.identity ?? ""; + message.website = object.website ?? ""; + message.securityContact = object.securityContact ?? ""; + message.details = object.details ?? ""; + return message; + }, + fromAmino(object: DescriptionAmino): Description { + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; + }, + toAmino(message: Description): DescriptionAmino { + const obj: any = {}; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + obj.identity = message.identity === "" ? undefined : message.identity; + obj.website = message.website === "" ? undefined : message.website; + obj.security_contact = message.securityContact === "" ? undefined : message.securityContact; + obj.details = message.details === "" ? undefined : message.details; + return obj; + }, + fromAminoMsg(object: DescriptionAminoMsg): Description { + return Description.fromAmino(object.value); + }, + toAminoMsg(message: Description): DescriptionAminoMsg { + return { + type: "cosmos-sdk/Description", + value: Description.toAmino(message) + }; + }, + fromProtoMsg(message: DescriptionProtoMsg): Description { + return Description.decode(message.value); + }, + toProto(message: Description): Uint8Array { + return Description.encode(message).finish(); + }, + toProtoMsg(message: Description): DescriptionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Description", + value: Description.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Description.typeUrl, Description); +GlobalDecoderRegistry.registerAminoProtoMapping(Description.aminoType, Description.typeUrl); +function createBaseValidator(): Validator { + return { + operatorAddress: "", + consensusPubkey: undefined, + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + description: Description.fromPartial({}), + unbondingHeight: BigInt(0), + unbondingTime: new Date(), + commission: Commission.fromPartial({}), + minSelfDelegation: "", + unbondingOnHoldRefCount: BigInt(0), + unbondingIds: [] + }; +} +export const Validator = { + typeUrl: "/cosmos.staking.v1beta1.Validator", + aminoType: "cosmos-sdk/Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operatorAddress === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegatorShares === "string" && Description.is(o.description) && typeof o.unbondingHeight === "bigint" && Timestamp.is(o.unbondingTime) && Commission.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.unbondingOnHoldRefCount === "bigint" && Array.isArray(o.unbondingIds) && (!o.unbondingIds.length || typeof o.unbondingIds[0] === "bigint")); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operator_address === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegator_shares === "string" && Description.isAmino(o.description) && typeof o.unbonding_height === "bigint" && Timestamp.isAmino(o.unbonding_time) && Commission.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.unbonding_on_hold_ref_count === "bigint" && Array.isArray(o.unbonding_ids) && (!o.unbonding_ids.length || typeof o.unbonding_ids[0] === "bigint")); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.consensusPubkey !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.consensusPubkey), writer.uint32(18).fork()).ldelim(); + } + if (message.jailed === true) { + writer.uint32(24).bool(message.jailed); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.tokens !== "") { + writer.uint32(42).string(message.tokens); + } + if (message.delegatorShares !== "") { + writer.uint32(50).string(message.delegatorShares); + } + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + } + if (message.unbondingHeight !== BigInt(0)) { + writer.uint32(64).int64(message.unbondingHeight); + } + if (message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + } + if (message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(90).string(message.minSelfDelegation); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(96).int64(message.unbondingOnHoldRefCount); + } + writer.uint32(106).fork(); + for (const v of message.unbondingIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = (reader.int32() as any); + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.commission = Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + case 12: + message.unbondingOnHoldRefCount = reader.int64(); + break; + case 13: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.unbondingIds.push(reader.uint64()); + } + } else { + message.unbondingIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? GlobalDecoderRegistry.fromPartial(object.consensusPubkey) : undefined; + message.jailed = object.jailed ?? false; + message.status = object.status ?? 0; + message.tokens = object.tokens ?? ""; + message.delegatorShares = object.delegatorShares ?? ""; + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? BigInt(object.unbondingHeight.toString()) : BigInt(0); + message.unbondingTime = object.unbondingTime ?? undefined; + message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + message.unbondingIds = object.unbondingIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time)); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + message.unbondingIds = object.unbonding_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; + obj.jailed = message.jailed === false ? undefined : message.jailed; + 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) : 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)) : 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) { + obj.unbonding_ids = message.unbondingIds.map(e => e.toString()); + } else { + obj.unbonding_ids = message.unbondingIds; + } + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + toAminoMsg(message: Validator): ValidatorAminoMsg { + return { + type: "cosmos-sdk/Validator", + value: Validator.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +GlobalDecoderRegistry.registerAminoProtoMapping(Validator.aminoType, Validator.typeUrl); +function createBaseValAddresses(): ValAddresses { + return { + addresses: [] + }; +} +export const ValAddresses = { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + aminoType: "cosmos-sdk/ValAddresses", + is(o: any): o is ValAddresses { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is ValAddressesAmino { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: ValAddressesAmino): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: ValAddresses): ValAddressesAmino { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses { + return ValAddresses.fromAmino(object.value); + }, + toAminoMsg(message: ValAddresses): ValAddressesAminoMsg { + return { + type: "cosmos-sdk/ValAddresses", + value: ValAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses { + return ValAddresses.decode(message.value); + }, + toProto(message: ValAddresses): Uint8Array { + return ValAddresses.encode(message).finish(); + }, + toProtoMsg(message: ValAddresses): ValAddressesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + value: ValAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValAddresses.typeUrl, ValAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(ValAddresses.aminoType, ValAddresses.typeUrl); +function createBaseDVPair(): DVPair { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const DVPair = { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + aminoType: "cosmos-sdk/DVPair", + is(o: any): o is DVPair { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is DVPairAmino { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPair(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVPair { + const message = createBaseDVPair(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: DVPairAmino): DVPair { + const message = createBaseDVPair(); + 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; + } + return message; + }, + toAmino(message: DVPair): DVPairAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: DVPairAminoMsg): DVPair { + return DVPair.fromAmino(object.value); + }, + toAminoMsg(message: DVPair): DVPairAminoMsg { + return { + type: "cosmos-sdk/DVPair", + value: DVPair.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairProtoMsg): DVPair { + return DVPair.decode(message.value); + }, + toProto(message: DVPair): Uint8Array { + return DVPair.encode(message).finish(); + }, + toProtoMsg(message: DVPair): DVPairProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + value: DVPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVPair.typeUrl, DVPair); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPair.aminoType, DVPair.typeUrl); +function createBaseDVPairs(): DVPairs { + return { + pairs: [] + }; +} +export const DVPairs = { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + aminoType: "cosmos-sdk/DVPairs", + is(o: any): o is DVPairs { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.is(o.pairs[0]))); + }, + isAmino(o: any): o is DVPairsAmino { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.isAmino(o.pairs[0]))); + }, + encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pairs) { + DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVPairsAmino): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVPairs): DVPairsAmino { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map(e => e ? DVPair.toAmino(e) : undefined); + } else { + obj.pairs = message.pairs; + } + return obj; + }, + fromAminoMsg(object: DVPairsAminoMsg): DVPairs { + return DVPairs.fromAmino(object.value); + }, + toAminoMsg(message: DVPairs): DVPairsAminoMsg { + return { + type: "cosmos-sdk/DVPairs", + value: DVPairs.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairsProtoMsg): DVPairs { + return DVPairs.decode(message.value); + }, + toProto(message: DVPairs): Uint8Array { + return DVPairs.encode(message).finish(); + }, + toProtoMsg(message: DVPairs): DVPairsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + value: DVPairs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVPairs.typeUrl, DVPairs); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPairs.aminoType, DVPairs.typeUrl); +function createBaseDVVTriplet(): DVVTriplet { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "" + }; +} +export const DVVTriplet = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + aminoType: "cosmos-sdk/DVVTriplet", + is(o: any): o is DVVTriplet { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string"); + }, + isAmino(o: any): o is DVVTripletAmino { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string"); + }, + encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplet { + const message = createBaseDVVTriplet(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + return message; + }, + fromAmino(object: DVVTripletAmino): DVVTriplet { + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; + }, + toAmino(message: DVVTriplet): DVVTripletAmino { + const obj: any = {}; + 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; + return obj; + }, + fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { + return DVVTriplet.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg { + return { + type: "cosmos-sdk/DVVTriplet", + value: DVVTriplet.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet { + return DVVTriplet.decode(message.value); + }, + toProto(message: DVVTriplet): Uint8Array { + return DVVTriplet.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplet): DVVTripletProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + value: DVVTriplet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVVTriplet.typeUrl, DVVTriplet); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplet.aminoType, DVVTriplet.typeUrl); +function createBaseDVVTriplets(): DVVTriplets { + return { + triplets: [] + }; +} +export const DVVTriplets = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + aminoType: "cosmos-sdk/DVVTriplets", + is(o: any): o is DVVTriplets { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.is(o.triplets[0]))); + }, + isAmino(o: any): o is DVVTripletsAmino { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.isAmino(o.triplets[0]))); + }, + encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.triplets) { + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVVTripletsAmino): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVVTriplets): DVVTripletsAmino { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map(e => e ? DVVTriplet.toAmino(e) : undefined); + } else { + obj.triplets = message.triplets; + } + return obj; + }, + fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets { + return DVVTriplets.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg { + return { + type: "cosmos-sdk/DVVTriplets", + value: DVVTriplets.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets { + return DVVTriplets.decode(message.value); + }, + toProto(message: DVVTriplets): Uint8Array { + return DVVTriplets.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplets): DVVTripletsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + value: DVVTriplets.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVVTriplets.typeUrl, DVVTriplets); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplets.aminoType, DVVTriplets.typeUrl); +function createBaseDelegation(): Delegation { + return { + delegatorAddress: "", + validatorAddress: "", + shares: "" + }; +} +export const Delegation = { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + aminoType: "cosmos-sdk/Delegation", + is(o: any): o is Delegation { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && typeof o.shares === "string"); + }, + isAmino(o: any): o is DelegationAmino { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.shares === "string"); + }, + encode(message: Delegation, 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.shares !== "") { + writer.uint32(26).string(message.shares); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegation(); + 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.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Delegation { + const message = createBaseDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.shares = object.shares ?? ""; + return message; + }, + fromAmino(object: DelegationAmino): Delegation { + const message = createBaseDelegation(); + 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.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; + }, + toAmino(message: Delegation): DelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.shares = message.shares === "" ? undefined : message.shares; + return obj; + }, + fromAminoMsg(object: DelegationAminoMsg): Delegation { + return Delegation.fromAmino(object.value); + }, + toAminoMsg(message: Delegation): DelegationAminoMsg { + return { + type: "cosmos-sdk/Delegation", + value: Delegation.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationProtoMsg): Delegation { + return Delegation.decode(message.value); + }, + toProto(message: Delegation): Uint8Array { + return Delegation.encode(message).finish(); + }, + toProtoMsg(message: Delegation): DelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + value: Delegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Delegation.typeUrl, Delegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Delegation.aminoType, Delegation.typeUrl); +function createBaseUnbondingDelegation(): UnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + entries: [] + }; +} +export const UnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + aminoType: "cosmos-sdk/UnbondingDelegation", + is(o: any): o is UnbondingDelegation { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is UnbondingDelegationAmino { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.isAmino(o.entries[0]))); + }, + encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegation(); + 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.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + 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; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.entries) { + obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation { + return UnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegation", + value: UnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation { + return UnbondingDelegation.decode(message.value); + }, + toProto(message: UnbondingDelegation): Uint8Array { + return UnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegation): UnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + value: UnbondingDelegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UnbondingDelegation.typeUrl, UnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegation.aminoType, UnbondingDelegation.typeUrl); +function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + balance: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) + }; +} +export const UnbondingDelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + aminoType: "cosmos-sdk/UnbondingDelegationEntry", + is(o: any): o is UnbondingDelegationEntry { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.balance === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isAmino(o: any): o is UnbondingDelegationEntryAmino { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.balance === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.balance = object.balance ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; + }, + 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)) : 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; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegationEntry", + value: UnbondingDelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationEntryProtoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.decode(message.value); + }, + toProto(message: UnbondingDelegationEntry): Uint8Array { + return UnbondingDelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + value: UnbondingDelegationEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UnbondingDelegationEntry.typeUrl, UnbondingDelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegationEntry.aminoType, UnbondingDelegationEntry.typeUrl); +function createBaseRedelegationEntry(): RedelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + sharesDst: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) + }; +} +export const RedelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + aminoType: "cosmos-sdk/RedelegationEntry", + is(o: any): o is RedelegationEntry { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.sharesDst === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isAmino(o: any): o is RedelegationEntryAmino { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.shares_dst === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.sharesDst !== "") { + writer.uint32(34).string(message.sharesDst); + } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntry { + const message = createBaseRedelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.sharesDst = object.sharesDst ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RedelegationEntryAmino): RedelegationEntry { + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; + }, + 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)) : 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; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { + return RedelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntry", + value: RedelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry { + return RedelegationEntry.decode(message.value); + }, + toProto(message: RedelegationEntry): Uint8Array { + return RedelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntry): RedelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + value: RedelegationEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationEntry.typeUrl, RedelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntry.aminoType, RedelegationEntry.typeUrl); +function createBaseRedelegation(): Redelegation { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + entries: [] + }; +} +export const Redelegation = { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + aminoType: "cosmos-sdk/Redelegation", + is(o: any): o is Redelegation { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationAmino { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.isAmino(o.entries[0]))); + }, + encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Redelegation { + const message = createBaseRedelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.entries = object.entries?.map(e => RedelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationAmino): Redelegation { + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: Redelegation): RedelegationAmino { + const obj: any = {}; + 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; + if (message.entries) { + obj.entries = message.entries.map(e => e ? RedelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationAminoMsg): Redelegation { + return Redelegation.fromAmino(object.value); + }, + toAminoMsg(message: Redelegation): RedelegationAminoMsg { + return { + type: "cosmos-sdk/Redelegation", + value: Redelegation.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationProtoMsg): Redelegation { + return Redelegation.decode(message.value); + }, + toProto(message: Redelegation): Uint8Array { + return Redelegation.encode(message).finish(); + }, + toProtoMsg(message: Redelegation): RedelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + value: Redelegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Redelegation.typeUrl, Redelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Redelegation.aminoType, Redelegation.typeUrl); +function createBaseParams(): Params { + return { + unbondingTime: Duration.fromPartial({}), + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + minCommissionRate: "" + }; +} +export const Params = { + typeUrl: "/cosmos.staking.v1beta1.Params", + aminoType: "cosmos-sdk/x/staking/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.unbondingTime) && typeof o.maxValidators === "number" && typeof o.maxEntries === "number" && typeof o.historicalEntries === "number" && typeof o.bondDenom === "string" && typeof o.minCommissionRate === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.unbonding_time) && typeof o.max_validators === "number" && typeof o.max_entries === "number" && typeof o.historical_entries === "number" && typeof o.bond_denom === "string" && typeof o.min_commission_rate === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators); + } + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries); + } + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries); + } + if (message.bondDenom !== "") { + writer.uint32(42).string(message.bondDenom); + } + if (message.minCommissionRate !== "") { + writer.uint32(50).string(message.minCommissionRate); + } + 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.unbondingTime = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + case 6: + message.minCommissionRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Duration.fromPartial(object.unbondingTime) : undefined; + message.maxValidators = object.maxValidators ?? 0; + message.maxEntries = object.maxEntries ?? 0; + message.historicalEntries = object.historicalEntries ?? 0; + message.bondDenom = object.bondDenom ?? ""; + message.minCommissionRate = object.minCommissionRate ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + 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) : 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 { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/staking/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.staking.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseDelegationResponse(): DelegationResponse { + return { + delegation: Delegation.fromPartial({}), + balance: Coin.fromPartial({}) + }; +} +export const DelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + aminoType: "cosmos-sdk/DelegationResponse", + is(o: any): o is DelegationResponse { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.is(o.delegation) && Coin.is(o.balance)); + }, + isAmino(o: any): o is DelegationResponseAmino { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.isAmino(o.delegation) && Coin.isAmino(o.balance)); + }, + encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegation !== undefined) { + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegationResponse { + const message = createBaseDelegationResponse(); + message.delegation = object.delegation !== undefined && object.delegation !== null ? Delegation.fromPartial(object.delegation) : undefined; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DelegationResponseAmino): DelegationResponse { + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DelegationResponse): DelegationResponseAmino { + const obj: any = {}; + 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 { + return DelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg { + return { + type: "cosmos-sdk/DelegationResponse", + value: DelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse { + return DelegationResponse.decode(message.value); + }, + toProto(message: DelegationResponse): Uint8Array { + return DelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: DelegationResponse): DelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + value: DelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegationResponse.typeUrl, DelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationResponse.aminoType, DelegationResponse.typeUrl); +function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { + return { + redelegationEntry: RedelegationEntry.fromPartial({}), + balance: "" + }; +} +export const RedelegationEntryResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + aminoType: "cosmos-sdk/RedelegationEntryResponse", + is(o: any): o is RedelegationEntryResponse { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.is(o.redelegationEntry) && typeof o.balance === "string"); + }, + isAmino(o: any): o is RedelegationEntryResponseAmino { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.isAmino(o.redelegation_entry) && typeof o.balance === "string"); + }, + encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + message.redelegationEntry = object.redelegationEntry !== undefined && object.redelegationEntry !== null ? RedelegationEntry.fromPartial(object.redelegationEntry) : undefined; + message.balance = object.balance ?? ""; + return message; + }, + fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; + }, + toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { + const obj: any = {}; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.toAmino(RedelegationEntry.fromPartial({})); + obj.balance = message.balance === "" ? undefined : message.balance; + return obj; + }, + fromAminoMsg(object: RedelegationEntryResponseAminoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntryResponse", + value: RedelegationEntryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryResponseProtoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.decode(message.value); + }, + toProto(message: RedelegationEntryResponse): Uint8Array { + return RedelegationEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + value: RedelegationEntryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationEntryResponse.typeUrl, RedelegationEntryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntryResponse.aminoType, RedelegationEntryResponse.typeUrl); +function createBaseRedelegationResponse(): RedelegationResponse { + return { + redelegation: Redelegation.fromPartial({}), + entries: [] + }; +} +export const RedelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + aminoType: "cosmos-sdk/RedelegationResponse", + is(o: any): o is RedelegationResponse { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.is(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.is(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationResponseAmino { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.isAmino(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.isAmino(o.entries[0]))); + }, + encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegation !== undefined) { + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationResponse { + const message = createBaseRedelegationResponse(); + message.redelegation = object.redelegation !== undefined && object.redelegation !== null ? Redelegation.fromPartial(object.redelegation) : undefined; + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationResponseAmino): RedelegationResponse { + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: RedelegationResponse): RedelegationResponseAmino { + const obj: any = {}; + 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 { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse { + return RedelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationResponse", + value: RedelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse { + return RedelegationResponse.decode(message.value); + }, + toProto(message: RedelegationResponse): Uint8Array { + return RedelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationResponse): RedelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + value: RedelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationResponse.typeUrl, RedelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationResponse.aminoType, RedelegationResponse.typeUrl); +function createBasePool(): Pool { + return { + notBondedTokens: "", + bondedTokens: "" + }; +} +export const Pool = { + typeUrl: "/cosmos.staking.v1beta1.Pool", + aminoType: "cosmos-sdk/Pool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.notBondedTokens === "string" && typeof o.bondedTokens === "string"); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.not_bonded_tokens === "string" && typeof o.bonded_tokens === "string"); + }, + encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.notBondedTokens !== "") { + writer.uint32(10).string(message.notBondedTokens); + } + if (message.bondedTokens !== "") { + writer.uint32(18).string(message.bondedTokens); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Pool { + const message = createBasePool(); + message.notBondedTokens = object.notBondedTokens ?? ""; + message.bondedTokens = object.bondedTokens ?? ""; + return message; + }, + fromAmino(object: PoolAmino): Pool { + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; + }, + toAmino(message: Pool): PoolAmino { + const obj: any = {}; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; + return obj; + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value); + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: "cosmos-sdk/Pool", + value: Pool.toAmino(message) + }; + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value); + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish(); + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Pool", + value: Pool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); +function createBaseValidatorUpdates(): ValidatorUpdates { + return { + updates: [] + }; +} +export const ValidatorUpdates = { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + aminoType: "cosmos-sdk/ValidatorUpdates", + is(o: any): o is ValidatorUpdates { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.is(o.updates[0]))); + }, + isAmino(o: any): o is ValidatorUpdatesAmino { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.isAmino(o.updates[0]))); + }, + encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorUpdatesAmino): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorUpdates): ValidatorUpdatesAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.updates = message.updates; + } + return obj; + }, + fromAminoMsg(object: ValidatorUpdatesAminoMsg): ValidatorUpdates { + return ValidatorUpdates.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorUpdates): ValidatorUpdatesAminoMsg { + return { + type: "cosmos-sdk/ValidatorUpdates", + value: ValidatorUpdates.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorUpdatesProtoMsg): ValidatorUpdates { + return ValidatorUpdates.decode(message.value); + }, + toProto(message: ValidatorUpdates): Uint8Array { + return ValidatorUpdates.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdates): ValidatorUpdatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + value: ValidatorUpdates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorUpdates.typeUrl, ValidatorUpdates); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorUpdates.aminoType, ValidatorUpdates.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/staking/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..78bf119c --- /dev/null +++ b/libs/injective-query/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -0,0 +1,67 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateValidator.typeUrl, + encoders: toEncoders(MsgCreateValidator), + converters: toConverters(MsgCreateValidator) +}); +export const useCreateValidator = buildUseMutation({ + builderMutationFn: createCreateValidator +}); +export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEditValidator.typeUrl, + encoders: toEncoders(MsgEditValidator), + converters: toConverters(MsgEditValidator) +}); +export const useEditValidator = buildUseMutation({ + builderMutationFn: createEditValidator +}); +export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDelegate.typeUrl, + encoders: toEncoders(MsgDelegate), + converters: toConverters(MsgDelegate) +}); +export const useDelegate = buildUseMutation({ + builderMutationFn: createDelegate +}); +export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBeginRedelegate.typeUrl, + encoders: toEncoders(MsgBeginRedelegate), + converters: toConverters(MsgBeginRedelegate) +}); +export const useBeginRedelegate = buildUseMutation({ + builderMutationFn: createBeginRedelegate +}); +export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUndelegate.typeUrl, + encoders: toEncoders(MsgUndelegate), + converters: toConverters(MsgUndelegate) +}); +export const useUndelegate = buildUseMutation({ + builderMutationFn: createUndelegate +}); +export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelUnbondingDelegation.typeUrl, + encoders: toEncoders(MsgCancelUnbondingDelegation), + converters: toConverters(MsgCancelUnbondingDelegation) +}); +export const useCancelUnbondingDelegation = buildUseMutation({ + builderMutationFn: createCancelUnbondingDelegation +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/staking/v1beta1/tx.ts b/libs/injective-query/src/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 00000000..ef9fba80 --- /dev/null +++ b/libs/injective-query/src/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,1638 @@ +import { Description, DescriptionAmino, CommissionRates, CommissionRatesAmino, Params, ParamsAmino } from "./staking"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +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 | undefined; + value: Coin; +} +export interface MsgCreateValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; + value: Uint8Array; +} +export type MsgCreateValidatorEncoded = Omit & { + pubkey?: AnyProtoMsg | undefined; +}; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorAmino { + 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; +} +export interface MsgCreateValidatorAminoMsg { + type: "cosmos-sdk/MsgCreateValidator"; + value: MsgCreateValidatorAmino; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponse {} +export interface MsgCreateValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse"; + value: Uint8Array; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseAmino {} +export interface MsgCreateValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgCreateValidatorResponse"; + value: MsgCreateValidatorResponseAmino; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidator { + description: Description; + validatorAddress: string; + /** + * 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 + */ + commissionRate: string; + minSelfDelegation: string; +} +export interface MsgEditValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator"; + value: Uint8Array; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorAmino { + description: DescriptionAmino; + validator_address: string; + /** + * 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 + */ + commission_rate: string; + min_self_delegation: string; +} +export interface MsgEditValidatorAminoMsg { + type: "cosmos-sdk/MsgEditValidator"; + value: MsgEditValidatorAmino; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponse {} +export interface MsgEditValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse"; + value: Uint8Array; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseAmino {} +export interface MsgEditValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgEditValidatorResponse"; + value: MsgEditValidatorResponseAmino; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgDelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate"; + value: Uint8Array; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateAmino { + delegator_address: string; + validator_address: string; + amount: CoinAmino; +} +export interface MsgDelegateAminoMsg { + type: "cosmos-sdk/MsgDelegate"; + value: MsgDelegateAmino; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponse {} +export interface MsgDelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse"; + value: Uint8Array; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseAmino {} +export interface MsgDelegateResponseAminoMsg { + type: "cosmos-sdk/MsgDelegateResponse"; + value: MsgDelegateResponseAmino; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + amount: Coin; +} +export interface MsgBeginRedelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate"; + value: Uint8Array; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateAmino { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + amount: CoinAmino; +} +export interface MsgBeginRedelegateAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegate"; + value: MsgBeginRedelegateAmino; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponse { + completionTime: Date; +} +export interface MsgBeginRedelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse"; + value: Uint8Array; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseAmino { + completion_time: string; +} +export interface MsgBeginRedelegateResponseAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegateResponse"; + value: MsgBeginRedelegateResponseAmino; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgUndelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate"; + value: Uint8Array; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateAmino { + delegator_address: string; + validator_address: string; + amount: CoinAmino; +} +export interface MsgUndelegateAminoMsg { + type: "cosmos-sdk/MsgUndelegate"; + value: MsgUndelegateAmino; +} +/** 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"; + value: Uint8Array; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseAmino { + completion_time: string; + /** + * amount returns the amount of undelegated coins + * + * Since: cosmos-sdk 0.50 + */ + amount: CoinAmino; +} +export interface MsgUndelegateResponseAminoMsg { + type: "cosmos-sdk/MsgUndelegateResponse"; + value: MsgUndelegateResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgCreateValidator(): MsgCreateValidator { + return { + description: Description.fromPartial({}), + commission: CommissionRates.fromPartial({}), + minSelfDelegation: "", + delegatorAddress: "", + validatorAddress: "", + pubkey: undefined, + value: Coin.fromPartial({}) + }; +} +export const MsgCreateValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + aminoType: "cosmos-sdk/MsgCreateValidator", + is(o: any): o is MsgCreateValidator { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.is(o.description) && CommissionRates.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.value)); + }, + isAmino(o: any): o is MsgCreateValidatorAmino { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.isAmino(o.description) && CommissionRates.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.value)); + }, + encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.commission !== undefined) { + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(26).string(message.minSelfDelegation); + } + if (message.delegatorAddress !== "") { + writer.uint32(34).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(42).string(message.validatorAddress); + } + if (message.pubkey !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.pubkey), writer.uint32(50).fork()).ldelim(); + } + if (message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 7: + message.value = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.commission = object.commission !== undefined && object.commission !== null ? CommissionRates.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.pubkey = object.pubkey !== undefined && object.pubkey !== null ? GlobalDecoderRegistry.fromPartial(object.pubkey) : undefined; + message.value = object.value !== undefined && object.value !== null ? Coin.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + 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.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; + }, + toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { + const obj: any = {}; + 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) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { + return MsgCreateValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidator): MsgCreateValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidator", + value: MsgCreateValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorProtoMsg): MsgCreateValidator { + return MsgCreateValidator.decode(message.value); + }, + toProto(message: MsgCreateValidator): Uint8Array { + return MsgCreateValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidator): MsgCreateValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateValidator.typeUrl, MsgCreateValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidator.aminoType, MsgCreateValidator.typeUrl); +function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { + return {}; +} +export const MsgCreateValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + aminoType: "cosmos-sdk/MsgCreateValidatorResponse", + is(o: any): o is MsgCreateValidatorResponse { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateValidatorResponseAmino { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorResponseAminoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorResponseProtoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.decode(message.value); + }, + toProto(message: MsgCreateValidatorResponse): Uint8Array { + return MsgCreateValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateValidatorResponse.typeUrl, MsgCreateValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidatorResponse.aminoType, MsgCreateValidatorResponse.typeUrl); +function createBaseMsgEditValidator(): MsgEditValidator { + return { + description: Description.fromPartial({}), + validatorAddress: "", + commissionRate: "", + minSelfDelegation: "" + }; +} +export const MsgEditValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + aminoType: "cosmos-sdk/MsgEditValidator", + is(o: any): o is MsgEditValidator { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.is(o.description) && typeof o.validatorAddress === "string" && typeof o.commissionRate === "string" && typeof o.minSelfDelegation === "string"); + }, + isAmino(o: any): o is MsgEditValidatorAmino { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.isAmino(o.description) && typeof o.validator_address === "string" && typeof o.commission_rate === "string" && typeof o.min_self_delegation === "string"); + }, + encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.commissionRate !== "") { + writer.uint32(26).string(message.commissionRate); + } + if (message.minSelfDelegation !== "") { + writer.uint32(34).string(message.minSelfDelegation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgEditValidator { + const message = createBaseMsgEditValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.validatorAddress = object.validatorAddress ?? ""; + message.commissionRate = object.commissionRate ?? ""; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + return message; + }, + fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; + }, + toAmino(message: MsgEditValidator): MsgEditValidatorAmino { + const obj: any = {}; + 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; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { + return MsgEditValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidator): MsgEditValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidator", + value: MsgEditValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorProtoMsg): MsgEditValidator { + return MsgEditValidator.decode(message.value); + }, + toProto(message: MsgEditValidator): Uint8Array { + return MsgEditValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidator): MsgEditValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEditValidator.typeUrl, MsgEditValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidator.aminoType, MsgEditValidator.typeUrl); +function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { + return {}; +} +export const MsgEditValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + aminoType: "cosmos-sdk/MsgEditValidatorResponse", + is(o: any): o is MsgEditValidatorResponse { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgEditValidatorResponseAmino { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorResponseAminoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidatorResponse", + value: MsgEditValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorResponseProtoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.decode(message.value); + }, + toProto(message: MsgEditValidatorResponse): Uint8Array { + return MsgEditValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + value: MsgEditValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEditValidatorResponse.typeUrl, MsgEditValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidatorResponse.aminoType, MsgEditValidatorResponse.typeUrl); +function createBaseMsgDelegate(): MsgDelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgDelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + aminoType: "cosmos-sdk/MsgDelegate", + is(o: any): o is MsgDelegate { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgDelegateAmino { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgDelegate, 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(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegate(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDelegate { + const message = createBaseMsgDelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgDelegateAmino): MsgDelegate { + const message = createBaseMsgDelegate(); + 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); + } + return message; + }, + toAmino(message: MsgDelegate): MsgDelegateAmino { + 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({})); + return obj; + }, + fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { + return MsgDelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegate): MsgDelegateAminoMsg { + return { + type: "cosmos-sdk/MsgDelegate", + value: MsgDelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateProtoMsg): MsgDelegate { + return MsgDelegate.decode(message.value); + }, + toProto(message: MsgDelegate): Uint8Array { + return MsgDelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegate): MsgDelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDelegate.typeUrl, MsgDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegate.aminoType, MsgDelegate.typeUrl); +function createBaseMsgDelegateResponse(): MsgDelegateResponse { + return {}; +} +export const MsgDelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + aminoType: "cosmos-sdk/MsgDelegateResponse", + is(o: any): o is MsgDelegateResponse { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateResponseAmino { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDelegateResponseAminoMsg): MsgDelegateResponse { + return MsgDelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegateResponse): MsgDelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDelegateResponse", + value: MsgDelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateResponseProtoMsg): MsgDelegateResponse { + return MsgDelegateResponse.decode(message.value); + }, + toProto(message: MsgDelegateResponse): Uint8Array { + return MsgDelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegateResponse): MsgDelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + value: MsgDelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDelegateResponse.typeUrl, MsgDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateResponse.aminoType, MsgDelegateResponse.typeUrl); +function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBeginRedelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + aminoType: "cosmos-sdk/MsgBeginRedelegate", + is(o: any): o is MsgBeginRedelegate { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgBeginRedelegateAmino { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { + const obj: any = {}; + 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) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegate", + value: MsgBeginRedelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateProtoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.decode(message.value); + }, + toProto(message: MsgBeginRedelegate): Uint8Array { + return MsgBeginRedelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBeginRedelegate.typeUrl, MsgBeginRedelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegate.aminoType, MsgBeginRedelegate.typeUrl); +function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { + return { + completionTime: new Date() + }; +} +export const MsgBeginRedelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + aminoType: "cosmos-sdk/MsgBeginRedelegateResponse", + is(o: any): o is MsgBeginRedelegateResponse { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.is(o.completionTime)); + }, + isAmino(o: any): o is MsgBeginRedelegateResponseAmino { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time)); + }, + encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; + }, + toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { + const obj: any = {}; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateResponseProtoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.decode(message.value); + }, + toProto(message: MsgBeginRedelegateResponse): Uint8Array { + return MsgBeginRedelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBeginRedelegateResponse.typeUrl, MsgBeginRedelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegateResponse.aminoType, MsgBeginRedelegateResponse.typeUrl); +function createBaseMsgUndelegate(): MsgUndelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgUndelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + aminoType: "cosmos-sdk/MsgUndelegate", + is(o: any): o is MsgUndelegate { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgUndelegateAmino { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgUndelegate, 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(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegate(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUndelegate { + const message = createBaseMsgUndelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgUndelegateAmino): MsgUndelegate { + const message = createBaseMsgUndelegate(); + 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); + } + return message; + }, + toAmino(message: MsgUndelegate): MsgUndelegateAmino { + 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({})); + return obj; + }, + fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { + return MsgUndelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegate): MsgUndelegateAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegate", + value: MsgUndelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateProtoMsg): MsgUndelegate { + return MsgUndelegate.decode(message.value); + }, + toProto(message: MsgUndelegate): Uint8Array { + return MsgUndelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegate): MsgUndelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegate.typeUrl, MsgUndelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegate.aminoType, MsgUndelegate.typeUrl); +function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { + return { + completionTime: new Date(), + amount: Coin.fromPartial({}) + }; +} +export const MsgUndelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + aminoType: "cosmos-sdk/MsgUndelegateResponse", + is(o: any): o is MsgUndelegateResponse { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.is(o.completionTime) && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgUndelegateResponseAmino { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time) && Coin.isAmino(o.amount)); + }, + encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseMsgUndelegateResponse(); + 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)) : new Date(); + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegateResponse", + value: MsgUndelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.decode(message.value); + }, + toProto(message: MsgUndelegateResponse): Uint8Array { + return MsgUndelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + value: MsgUndelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegateResponse.typeUrl, MsgUndelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateResponse.aminoType, MsgUndelegateResponse.typeUrl); +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + is(o: any): o is MsgCancelUnbondingDelegation { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount) && typeof o.creationHeight === "bigint"); + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationAmino { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount) && typeof o.creation_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegation.typeUrl, MsgCancelUnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegation.aminoType, MsgCancelUnbondingDelegation.typeUrl); +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + is(o: any): o is MsgCancelUnbondingDelegationResponse { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationResponseAmino { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegationResponse.typeUrl, MsgCancelUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegationResponse.aminoType, MsgCancelUnbondingDelegationResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/tx/signing/v1beta1/signing.ts b/libs/injective-query/src/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..8c90655f --- /dev/null +++ b/libs/injective-query/src/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,688 @@ +import { CompactBitArray, CompactBitArrayAmino } from "../../../crypto/multisig/v1beta1/multisig"; +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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. + */ + 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. + */ + 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. + * + * 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. + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + /** + * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + * + * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + * but is not implemented on the SDK by default. To enable EIP-191, you need + * to pass a custom `TxConfig` that has an implementation of + * `SignModeHandler` for EIP-191. The SDK may decide to fully support + * EIP-191 in the future. + * + * Since: cosmos-sdk 0.45.2 + */ + SIGN_MODE_EIP_191 = 191, + UNRECOGNIZED = -1, +} +export const SignModeAmino = SignMode; +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + 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; + case 191: + case "SIGN_MODE_EIP_191": + return SignMode.SIGN_MODE_EIP_191; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + 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: + return "SIGN_MODE_EIP_191"; + case SignMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} +export interface SignatureDescriptorsProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors"; + value: Uint8Array; +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsAmino { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptorAmino[]; +} +export interface SignatureDescriptorsAminoMsg { + type: "cosmos-sdk/SignatureDescriptors"; + value: SignatureDescriptorsAmino; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: bigint; +} +export interface SignatureDescriptorProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; + value: Uint8Array; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorAmino { + /** public_key is the public key of the signer */ + public_key?: AnyAmino; + data?: SignatureDescriptor_DataAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: string; +} +export interface SignatureDescriptorAminoMsg { + type: "cosmos-sdk/SignatureDescriptor"; + value: SignatureDescriptorAmino; +} +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi; +} +export interface SignatureDescriptor_DataProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Data"; + value: Uint8Array; +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataAmino { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_SingleAmino; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_MultiAmino; +} +export interface SignatureDescriptor_DataAminoMsg { + type: "cosmos-sdk/Data"; + value: SignatureDescriptor_DataAmino; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: Uint8Array; +} +export interface SignatureDescriptor_Data_SingleProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Single"; + value: Uint8Array; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleAmino { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: string; +} +export interface SignatureDescriptor_Data_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: SignatureDescriptor_Data_SingleAmino; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[]; +} +export interface SignatureDescriptor_Data_MultiProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_DataAmino[]; +} +export interface SignatureDescriptor_Data_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: SignatureDescriptor_Data_MultiAmino; +} +function createBaseSignatureDescriptors(): SignatureDescriptors { + return { + signatures: [] + }; +} +export const SignatureDescriptors = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + aminoType: "cosmos-sdk/SignatureDescriptors", + is(o: any): o is SignatureDescriptors { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.is(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptorsAmino { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.isAmino(o.signatures[0]))); + }, + encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptors(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptorsAminoMsg): SignatureDescriptors { + return SignatureDescriptors.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptors): SignatureDescriptorsAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptors", + value: SignatureDescriptors.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorsProtoMsg): SignatureDescriptors { + return SignatureDescriptors.decode(message.value); + }, + toProto(message: SignatureDescriptors): Uint8Array { + return SignatureDescriptors.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptors): SignatureDescriptorsProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + value: SignatureDescriptors.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptors.typeUrl, SignatureDescriptors); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptors.aminoType, SignatureDescriptors.typeUrl); +function createBaseSignatureDescriptor(): SignatureDescriptor { + return { + publicKey: undefined, + data: undefined, + sequence: BigInt(0) + }; +} +export const SignatureDescriptor = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + aminoType: "cosmos-sdk/SignatureDescriptor", + is(o: any): o is SignatureDescriptor { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignatureDescriptorAmino { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.data = object.data !== undefined && object.data !== null ? SignatureDescriptor_Data.fromPartial(object.data) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.data = message.data ? SignatureDescriptor_Data.toAmino(message.data) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { + return SignatureDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor): SignatureDescriptorAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptor", + value: SignatureDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorProtoMsg): SignatureDescriptor { + return SignatureDescriptor.decode(message.value); + }, + toProto(message: SignatureDescriptor): Uint8Array { + return SignatureDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor): SignatureDescriptorProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + value: SignatureDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor.typeUrl, SignatureDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor.aminoType, SignatureDescriptor.typeUrl); +function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { + return { + single: undefined, + multi: undefined + }; +} +export const SignatureDescriptor_Data = { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + aminoType: "cosmos-sdk/Data", + is(o: any): o is SignatureDescriptor_Data { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + isAmino(o: any): o is SignatureDescriptor_DataAmino { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + message.single = object.single !== undefined && object.single !== null ? SignatureDescriptor_Data_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { + const obj: any = {}; + obj.single = message.single ? SignatureDescriptor_Data_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_DataAminoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataAminoMsg { + return { + type: "cosmos-sdk/Data", + value: SignatureDescriptor_Data.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_DataProtoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data): Uint8Array { + return SignatureDescriptor_Data.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + value: SignatureDescriptor_Data.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data.typeUrl, SignatureDescriptor_Data); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data.aminoType, SignatureDescriptor_Data.typeUrl); +function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { + return { + mode: 0, + signature: new Uint8Array() + }; +} +export const SignatureDescriptor_Data_Single = { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is SignatureDescriptor_Data_Single { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is SignatureDescriptor_Data_SingleAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: SignatureDescriptor_Data_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = (reader.int32() as any); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + message.mode = object.mode ?? 0; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: SignatureDescriptor_Data_Single.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_SingleProtoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Single): Uint8Array { + return SignatureDescriptor_Data_Single.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + value: SignatureDescriptor_Data_Single.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Single.typeUrl, SignatureDescriptor_Data_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Single.aminoType, SignatureDescriptor_Data_Single.typeUrl); +function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { + return { + bitarray: undefined, + signatures: [] + }; +} +export const SignatureDescriptor_Data_Multi = { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is SignatureDescriptor_Data_Multi { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.is(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptor_Data_MultiAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.isAmino(o.signatures[0]))); + }, + encode(message: SignatureDescriptor_Data_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor_Data.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_MultiAminoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: SignatureDescriptor_Data_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_MultiProtoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Multi): Uint8Array { + return SignatureDescriptor_Data_Multi.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + value: SignatureDescriptor_Data_Multi.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Multi.typeUrl, SignatureDescriptor_Data_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Multi.aminoType, SignatureDescriptor_Data_Multi.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/injective-query/src/cosmos/tx/v1beta1/service.rpc.func.ts new file mode 100644 index 00000000..4fb651f5 --- /dev/null +++ b/libs/injective-query/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -0,0 +1,102 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ + encode: SimulateRequest.encode, + decode: SimulateResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "Simulate", + clientResolver +}); +export const useGetSimulate = buildUseQuery({ + builderQueryFn: createGetSimulate, + queryKeyPrefix: "SimulateQuery" +}); +export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxRequest.encode, + decode: GetTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTx", + clientResolver +}); +export const useGetGetTx = buildUseQuery({ + builderQueryFn: createGetGetTx, + queryKeyPrefix: "GetTxQuery" +}); +export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: BroadcastTxRequest.encode, + decode: BroadcastTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "BroadcastTx", + clientResolver +}); +export const useGetBroadcastTx = buildUseQuery({ + builderQueryFn: createGetBroadcastTx, + queryKeyPrefix: "BroadcastTxQuery" +}); +export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxsEventRequest.encode, + decode: GetTxsEventResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTxsEvent", + clientResolver +}); +export const useGetGetTxsEvent = buildUseQuery({ + builderQueryFn: createGetGetTxsEvent, + queryKeyPrefix: "GetTxsEventQuery" +}); +export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetBlockWithTxsRequest.encode, + decode: GetBlockWithTxsResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetBlockWithTxs", + clientResolver +}); +export const useGetGetBlockWithTxs = buildUseQuery({ + builderQueryFn: createGetGetBlockWithTxs, + queryKeyPrefix: "GetBlockWithTxsQuery" +}); +export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeRequest.encode, + decode: TxDecodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecode", + clientResolver +}); +export const useGetTxDecode = buildUseQuery({ + builderQueryFn: createGetTxDecode, + queryKeyPrefix: "TxDecodeQuery" +}); +export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeRequest.encode, + decode: TxEncodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncode", + clientResolver +}); +export const useGetTxEncode = buildUseQuery({ + builderQueryFn: createGetTxEncode, + queryKeyPrefix: "TxEncodeQuery" +}); +export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeAminoRequest.encode, + decode: TxEncodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncodeAmino", + clientResolver +}); +export const useGetTxEncodeAmino = buildUseQuery({ + builderQueryFn: createGetTxEncodeAmino, + queryKeyPrefix: "TxEncodeAminoQuery" +}); +export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeAminoRequest.encode, + decode: TxDecodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecodeAmino", + clientResolver +}); +export const useGetTxDecodeAmino = buildUseQuery({ + builderQueryFn: createGetTxDecodeAmino, + queryKeyPrefix: "TxDecodeAminoQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/tx/v1beta1/service.ts b/libs/injective-query/src/cosmos/tx/v1beta1/service.ts new file mode 100644 index 00000000..9c0eaf31 --- /dev/null +++ b/libs/injective-query/src/cosmos/tx/v1beta1/service.ts @@ -0,0 +1,2294 @@ +import { Tx, TxAmino } from "./tx"; +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { TxResponse, TxResponseAmino, GasInfo, GasInfoAmino, Result, ResultAmino } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino } from "../../../tendermint/types/types"; +import { Block, BlockAmino } from "../../../tendermint/types/block"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 = 0, + /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ + ORDER_BY_ASC = 1, + /** ORDER_BY_DESC - ORDER_BY_DESC defines descending order */ + ORDER_BY_DESC = 2, + UNRECOGNIZED = -1, +} +export const OrderByAmino = OrderBy; +export function orderByFromJSON(object: any): OrderBy { + switch (object) { + case 0: + case "ORDER_BY_UNSPECIFIED": + return OrderBy.ORDER_BY_UNSPECIFIED; + case 1: + case "ORDER_BY_ASC": + return OrderBy.ORDER_BY_ASC; + case 2: + case "ORDER_BY_DESC": + return OrderBy.ORDER_BY_DESC; + case -1: + case "UNRECOGNIZED": + default: + return OrderBy.UNRECOGNIZED; + } +} +export function orderByToJSON(object: OrderBy): string { + switch (object) { + case OrderBy.ORDER_BY_UNSPECIFIED: + return "ORDER_BY_UNSPECIFIED"; + case OrderBy.ORDER_BY_ASC: + return "ORDER_BY_ASC"; + case OrderBy.ORDER_BY_DESC: + return "ORDER_BY_DESC"; + case OrderBy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * 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 - 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 = 2, + /** + * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + * returns immediately. + */ + BROADCAST_MODE_ASYNC = 3, + UNRECOGNIZED = -1, +} +export const BroadcastModeAmino = BroadcastMode; +export function broadcastModeFromJSON(object: any): BroadcastMode { + switch (object) { + case 0: + case "BROADCAST_MODE_UNSPECIFIED": + return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; + case 1: + case "BROADCAST_MODE_BLOCK": + return BroadcastMode.BROADCAST_MODE_BLOCK; + case 2: + case "BROADCAST_MODE_SYNC": + return BroadcastMode.BROADCAST_MODE_SYNC; + case 3: + case "BROADCAST_MODE_ASYNC": + return BroadcastMode.BROADCAST_MODE_ASYNC; + case -1: + case "UNRECOGNIZED": + default: + return BroadcastMode.UNRECOGNIZED; + } +} +export function broadcastModeToJSON(object: BroadcastMode): string { + switch (object) { + case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: + return "BROADCAST_MODE_UNSPECIFIED"; + case BroadcastMode.BROADCAST_MODE_BLOCK: + return "BROADCAST_MODE_BLOCK"; + case BroadcastMode.BROADCAST_MODE_SYNC: + return "BROADCAST_MODE_SYNC"; + case BroadcastMode.BROADCAST_MODE_ASYNC: + return "BROADCAST_MODE_ASYNC"; + case BroadcastMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequest { + /** + * 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. + * 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"; + value: Uint8Array; +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequestAmino { + /** + * 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. + * 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"; + value: GetTxsEventRequestAmino; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponse { + /** txs is the list of queried transactions. */ + txs: Tx[]; + /** tx_responses is the list of queried TxResponses. */ + txResponses: TxResponse[]; + /** + * 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"; + value: Uint8Array; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponseAmino { + /** txs is the list of queried transactions. */ + txs: TxAmino[]; + /** tx_responses is the list of queried TxResponses. */ + tx_responses: TxResponseAmino[]; + /** + * 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"; + value: GetTxsEventResponseAmino; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; + mode: BroadcastMode; +} +export interface BroadcastTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest"; + value: Uint8Array; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes: string; + mode: BroadcastMode; +} +export interface BroadcastTxRequestAminoMsg { + type: "cosmos-sdk/BroadcastTxRequest"; + value: BroadcastTxRequestAmino; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponse { + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface BroadcastTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; + value: Uint8Array; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponseAmino { + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface BroadcastTxResponseAminoMsg { + type: "cosmos-sdk/BroadcastTxResponse"; + value: BroadcastTxResponseAmino; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequest { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: Tx; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + txBytes: Uint8Array; +} +export interface SimulateRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest"; + value: Uint8Array; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequestAmino { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: TxAmino; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + tx_bytes: string; +} +export interface SimulateRequestAminoMsg { + type: "cosmos-sdk/SimulateRequest"; + value: SimulateRequestAmino; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponse { + /** gas_info is the information about gas used in the simulation. */ + gasInfo?: GasInfo; + /** result is the result of the simulation. */ + result?: Result; +} +export interface SimulateResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; + value: Uint8Array; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponseAmino { + /** gas_info is the information about gas used in the simulation. */ + gas_info?: GasInfoAmino; + /** result is the result of the simulation. */ + result?: ResultAmino; +} +export interface SimulateResponseAminoMsg { + type: "cosmos-sdk/SimulateResponse"; + value: SimulateResponseAmino; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequest { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} +export interface GetTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest"; + value: Uint8Array; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequestAmino { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} +export interface GetTxRequestAminoMsg { + type: "cosmos-sdk/GetTxRequest"; + value: GetTxRequestAmino; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponse { + /** tx is the queried transaction. */ + tx?: Tx; + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface GetTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; + value: Uint8Array; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponseAmino { + /** tx is the queried transaction. */ + tx?: TxAmino; + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface GetTxResponseAminoMsg { + type: "cosmos-sdk/GetTxResponse"; + value: GetTxResponseAmino; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequest { + /** height is the height of the block to query. */ + height: bigint; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; +} +export interface GetBlockWithTxsRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; + value: Uint8Array; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestAmino { + /** height is the height of the block to query. */ + height: string; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface GetBlockWithTxsRequestAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsRequest"; + value: GetBlockWithTxsRequestAmino; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponse { + /** txs are the transactions in the block. */ + txs: Tx[]; + blockId?: BlockID; + block?: Block; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetBlockWithTxsResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; + value: Uint8Array; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseAmino { + /** txs are the transactions in the block. */ + txs: TxAmino[]; + block_id?: BlockIDAmino; + block?: BlockAmino; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetBlockWithTxsResponseAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsResponse"; + value: GetBlockWithTxsResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseGetTxsEventRequest(): GetTxsEventRequest { + return { + events: [], + pagination: undefined, + orderBy: 0, + page: BigInt(0), + limit: BigInt(0), + query: "" + }; +} +export const GetTxsEventRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + aminoType: "cosmos-sdk/GetTxsEventRequest", + is(o: any): o is GetTxsEventRequest { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.orderBy) && typeof o.page === "bigint" && typeof o.limit === "bigint" && typeof o.query === "string"); + }, + isAmino(o: any): o is GetTxsEventRequestAmino { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.order_by) && typeof o.page === "bigint" && typeof o.limit === "bigint" && typeof o.query === "string"); + }, + encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(reader.string()); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest(); + 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 { + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + 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 { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e); + } else { + obj.events = message.events; + } + 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 { + return GetTxsEventRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventRequest): GetTxsEventRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventRequest", + value: GetTxsEventRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventRequestProtoMsg): GetTxsEventRequest { + return GetTxsEventRequest.decode(message.value); + }, + toProto(message: GetTxsEventRequest): Uint8Array { + return GetTxsEventRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventRequest): GetTxsEventRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + value: GetTxsEventRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxsEventRequest.typeUrl, GetTxsEventRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventRequest.aminoType, GetTxsEventRequest.typeUrl); +function createBaseGetTxsEventResponse(): GetTxsEventResponse { + return { + txs: [], + txResponses: [], + pagination: undefined, + total: BigInt(0) + }; +} +export const GetTxsEventResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + aminoType: "cosmos-sdk/GetTxsEventResponse", + is(o: any): o is GetTxsEventResponse { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0])) && Array.isArray(o.txResponses) && (!o.txResponses.length || TxResponse.is(o.txResponses[0])) && typeof o.total === "bigint"); + }, + isAmino(o: any): o is GetTxsEventResponseAmino { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0])) && Array.isArray(o.tx_responses) && (!o.tx_responses.length || TxResponse.isAmino(o.tx_responses[0])) && typeof o.total === "bigint"); + }, + encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.txResponses) { + TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.txResponses.push(TxResponse.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 4: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse(); + 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 { + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + 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 { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + if (message.txResponses) { + obj.tx_responses = message.txResponses.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + 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 { + return GetTxsEventResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventResponse): GetTxsEventResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventResponse", + value: GetTxsEventResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventResponseProtoMsg): GetTxsEventResponse { + return GetTxsEventResponse.decode(message.value); + }, + toProto(message: GetTxsEventResponse): Uint8Array { + return GetTxsEventResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventResponse): GetTxsEventResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + value: GetTxsEventResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxsEventResponse.typeUrl, GetTxsEventResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventResponse.aminoType, GetTxsEventResponse.typeUrl); +function createBaseBroadcastTxRequest(): BroadcastTxRequest { + return { + txBytes: new Uint8Array(), + mode: 0 + }; +} +export const BroadcastTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + aminoType: "cosmos-sdk/BroadcastTxRequest", + is(o: any): o is BroadcastTxRequest { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.txBytes instanceof Uint8Array || typeof o.txBytes === "string") && isSet(o.mode)); + }, + isAmino(o: any): o is BroadcastTxRequestAmino { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string") && isSet(o.mode)); + }, + encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + if (message.mode !== 0) { + writer.uint32(16).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + case 2: + message.mode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { + return BroadcastTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxRequest): BroadcastTxRequestAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxRequest", + value: BroadcastTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxRequestProtoMsg): BroadcastTxRequest { + return BroadcastTxRequest.decode(message.value); + }, + toProto(message: BroadcastTxRequest): Uint8Array { + return BroadcastTxRequest.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxRequest): BroadcastTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + value: BroadcastTxRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BroadcastTxRequest.typeUrl, BroadcastTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxRequest.aminoType, BroadcastTxRequest.typeUrl); +function createBaseBroadcastTxResponse(): BroadcastTxResponse { + return { + txResponse: undefined + }; +} +export const BroadcastTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + aminoType: "cosmos-sdk/BroadcastTxResponse", + is(o: any): o is BroadcastTxResponse { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + isAmino(o: any): o is BroadcastTxResponseAmino { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { + const obj: any = {}; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: BroadcastTxResponseAminoMsg): BroadcastTxResponse { + return BroadcastTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxResponse): BroadcastTxResponseAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxResponse", + value: BroadcastTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxResponseProtoMsg): BroadcastTxResponse { + return BroadcastTxResponse.decode(message.value); + }, + toProto(message: BroadcastTxResponse): Uint8Array { + return BroadcastTxResponse.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxResponse): BroadcastTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + value: BroadcastTxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BroadcastTxResponse.typeUrl, BroadcastTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxResponse.aminoType, BroadcastTxResponse.typeUrl); +function createBaseSimulateRequest(): SimulateRequest { + return { + tx: undefined, + txBytes: new Uint8Array() + }; +} +export const SimulateRequest = { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + aminoType: "cosmos-sdk/SimulateRequest", + is(o: any): o is SimulateRequest { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is SimulateRequestAmino { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txBytes.length !== 0) { + writer.uint32(18).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulateRequest { + const message = createBaseSimulateRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: SimulateRequestAmino): SimulateRequest { + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: SimulateRequest): SimulateRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { + return SimulateRequest.fromAmino(object.value); + }, + toAminoMsg(message: SimulateRequest): SimulateRequestAminoMsg { + return { + type: "cosmos-sdk/SimulateRequest", + value: SimulateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateRequestProtoMsg): SimulateRequest { + return SimulateRequest.decode(message.value); + }, + toProto(message: SimulateRequest): Uint8Array { + return SimulateRequest.encode(message).finish(); + }, + toProtoMsg(message: SimulateRequest): SimulateRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + value: SimulateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulateRequest.typeUrl, SimulateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateRequest.aminoType, SimulateRequest.typeUrl); +function createBaseSimulateResponse(): SimulateResponse { + return { + gasInfo: undefined, + result: undefined + }; +} +export const SimulateResponse = { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + aminoType: "cosmos-sdk/SimulateResponse", + is(o: any): o is SimulateResponse { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + isAmino(o: any): o is SimulateResponseAmino { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulateResponse { + const message = createBaseSimulateResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulateResponseAmino): SimulateResponse { + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulateResponse): SimulateResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateResponseAminoMsg): SimulateResponse { + return SimulateResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulateResponse): SimulateResponseAminoMsg { + return { + type: "cosmos-sdk/SimulateResponse", + value: SimulateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateResponseProtoMsg): SimulateResponse { + return SimulateResponse.decode(message.value); + }, + toProto(message: SimulateResponse): Uint8Array { + return SimulateResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulateResponse): SimulateResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + value: SimulateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulateResponse.typeUrl, SimulateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateResponse.aminoType, SimulateResponse.typeUrl); +function createBaseGetTxRequest(): GetTxRequest { + return { + hash: "" + }; +} +export const GetTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + aminoType: "cosmos-sdk/GetTxRequest", + is(o: any): o is GetTxRequest { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + isAmino(o: any): o is GetTxRequestAmino { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxRequest { + const message = createBaseGetTxRequest(); + message.hash = object.hash ?? ""; + return message; + }, + fromAmino(object: GetTxRequestAmino): GetTxRequest { + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: GetTxRequest): GetTxRequestAmino { + const obj: any = {}; + obj.hash = message.hash === "" ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: GetTxRequestAminoMsg): GetTxRequest { + return GetTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxRequest): GetTxRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxRequest", + value: GetTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxRequestProtoMsg): GetTxRequest { + return GetTxRequest.decode(message.value); + }, + toProto(message: GetTxRequest): Uint8Array { + return GetTxRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxRequest): GetTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + value: GetTxRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxRequest.typeUrl, GetTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxRequest.aminoType, GetTxRequest.typeUrl); +function createBaseGetTxResponse(): GetTxResponse { + return { + tx: undefined, + txResponse: undefined + }; +} +export const GetTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + aminoType: "cosmos-sdk/GetTxResponse", + is(o: any): o is GetTxResponse { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + isAmino(o: any): o is GetTxResponseAmino { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxResponse { + const message = createBaseGetTxResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: GetTxResponseAmino): GetTxResponse { + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: GetTxResponse): GetTxResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: GetTxResponseAminoMsg): GetTxResponse { + return GetTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxResponse): GetTxResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxResponse", + value: GetTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxResponseProtoMsg): GetTxResponse { + return GetTxResponse.decode(message.value); + }, + toProto(message: GetTxResponse): Uint8Array { + return GetTxResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxResponse): GetTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + value: GetTxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxResponse.typeUrl, GetTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxResponse.aminoType, GetTxResponse.typeUrl); +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { + height: BigInt(0), + pagination: undefined + }; +} +export const GetBlockWithTxsRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + aminoType: "cosmos-sdk/GetBlockWithTxsRequest", + is(o: any): o is GetBlockWithTxsRequest { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is GetBlockWithTxsRequestAmino { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsRequestProtoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.decode(message.value); + }, + toProto(message: GetBlockWithTxsRequest): Uint8Array { + return GetBlockWithTxsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsRequest.typeUrl, GetBlockWithTxsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsRequest.aminoType, GetBlockWithTxsRequest.typeUrl); +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { + txs: [], + blockId: undefined, + block: undefined, + pagination: undefined + }; +} +export const GetBlockWithTxsResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + aminoType: "cosmos-sdk/GetBlockWithTxsResponse", + is(o: any): o is GetBlockWithTxsResponse { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0]))); + }, + isAmino(o: any): o is GetBlockWithTxsResponseAmino { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0]))); + }, + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 3: + message.block = Block.decode(reader, reader.uint32()); + break; + case 4: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; + 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.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsResponseAminoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsResponseProtoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.decode(message.value); + }, + toProto(message: GetBlockWithTxsResponse): Uint8Array { + return GetBlockWithTxsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsResponse.typeUrl, GetBlockWithTxsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsResponse.aminoType, GetBlockWithTxsResponse.typeUrl); +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { + txBytes: new Uint8Array() + }; +} +export const TxDecodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + aminoType: "cosmos-sdk/TxDecodeRequest", + is(o: any): o is TxDecodeRequest { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is TxDecodeRequestAmino { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeRequest.typeUrl, TxDecodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeRequest.aminoType, TxDecodeRequest.typeUrl); +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { + tx: undefined + }; +} +export const TxDecodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + aminoType: "cosmos-sdk/TxDecodeResponse", + is(o: any): o is TxDecodeResponse { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + isAmino(o: any): o is TxDecodeResponseAmino { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeResponse.typeUrl, TxDecodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeResponse.aminoType, TxDecodeResponse.typeUrl); +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { + tx: undefined + }; +} +export const TxEncodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + aminoType: "cosmos-sdk/TxEncodeRequest", + is(o: any): o is TxEncodeRequest { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + isAmino(o: any): o is TxEncodeRequestAmino { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeRequest.typeUrl, TxEncodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeRequest.aminoType, TxEncodeRequest.typeUrl); +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { + txBytes: new Uint8Array() + }; +} +export const TxEncodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + aminoType: "cosmos-sdk/TxEncodeResponse", + is(o: any): o is TxEncodeResponse { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is TxEncodeResponseAmino { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeResponse.typeUrl, TxEncodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeResponse.aminoType, TxEncodeResponse.typeUrl); +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { + aminoJson: "" + }; +} +export const TxEncodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + aminoType: "cosmos-sdk/TxEncodeAminoRequest", + is(o: any): o is TxEncodeAminoRequest { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.aminoJson === "string"); + }, + isAmino(o: any): o is TxEncodeAminoRequestAmino { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.amino_json === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoRequest.typeUrl, TxEncodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoRequest.aminoType, TxEncodeAminoRequest.typeUrl); +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxEncodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + aminoType: "cosmos-sdk/TxEncodeAminoResponse", + is(o: any): o is TxEncodeAminoResponse { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isAmino(o: any): o is TxEncodeAminoResponseAmino { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoResponse.typeUrl, TxEncodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoResponse.aminoType, TxEncodeAminoResponse.typeUrl); +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxDecodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + aminoType: "cosmos-sdk/TxDecodeAminoRequest", + is(o: any): o is TxDecodeAminoRequest { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isAmino(o: any): o is TxDecodeAminoRequestAmino { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoRequest.typeUrl, TxDecodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoRequest.aminoType, TxDecodeAminoRequest.typeUrl); +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { + aminoJson: "" + }; +} +export const TxDecodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + aminoType: "cosmos-sdk/TxDecodeAminoResponse", + is(o: any): o is TxDecodeAminoResponse { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.aminoJson === "string"); + }, + isAmino(o: any): o is TxDecodeAminoResponseAmino { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.amino_json === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoResponse.typeUrl, TxDecodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoResponse.aminoType, TxDecodeAminoResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/tx/v1beta1/tx.ts b/libs/injective-query/src/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..6e8614bb --- /dev/null +++ b/libs/injective-query/src/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,2029 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { SignMode } from "../signing/v1beta1/signing"; +import { CompactBitArray, CompactBitArrayAmino } from "../../crypto/multisig/v1beta1/multisig"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Tx is the standard type used for broadcasting transactions. */ +export interface Tx { + /** body is the processable content of the transaction */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tx"; + value: Uint8Array; +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxAmino { + /** body is the processable content of the transaction */ + body?: TxBodyAmino; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + auth_info?: AuthInfoAmino; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: string[]; +} +export interface TxAminoMsg { + type: "cosmos-sdk/Tx"; + value: TxAmino; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxRawProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxRaw"; + value: Uint8Array; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawAmino { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + body_bytes: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + auth_info_bytes: string; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: string[]; +} +export interface TxRawAminoMsg { + type: "cosmos-sdk/TxRaw"; + value: TxRawAmino; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique 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; +} +export interface SignDocProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDoc"; + value: Uint8Array; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + auth_info_bytes: string; + /** + * chain_id is the unique 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; +} +export interface SignDocAminoMsg { + type: "cosmos-sdk/SignDoc"; + value: SignDocAmino; +} +/** + * 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; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: bigint; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} +export interface TxBodyProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxBody"; + value: Uint8Array; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodyAmino { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: AnyAmino[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeout_height: string; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extension_options: AnyAmino[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + non_critical_extension_options: AnyAmino[]; +} +export interface TxBodyAminoMsg { + type: "cosmos-sdk/TxBody"; + value: TxBodyAmino; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * 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"; + value: Uint8Array; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoAmino { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signer_infos: SignerInfoAmino[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * 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"; + value: AuthInfoAmino; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: bigint; +} +export interface SignerInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; + value: Uint8Array; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoAmino { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + public_key?: AnyAmino; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + mode_info?: ModeInfoAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: string; +} +export interface SignerInfoAminoMsg { + type: "cosmos-sdk/SignerInfo"; + value: SignerInfoAmino; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfo { + /** single represents a single signer */ + single?: ModeInfo_Single; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_Multi; +} +export interface ModeInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo"; + value: Uint8Array; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoAmino { + /** single represents a single signer */ + single?: ModeInfo_SingleAmino; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_MultiAmino; +} +export interface ModeInfoAminoMsg { + type: "cosmos-sdk/ModeInfo"; + value: ModeInfoAmino; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} +export interface ModeInfo_SingleProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Single"; + value: Uint8Array; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleAmino { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} +export interface ModeInfo_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: ModeInfo_SingleAmino; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} +export interface ModeInfo_MultiProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + mode_infos: ModeInfoAmino[]; +} +export interface ModeInfo_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: ModeInfo_MultiAmino; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** amount is the amount of coins to be paid as a fee */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: bigint; + /** + * 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. + */ + payer: string; + /** + * 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 + */ + granter: string; +} +export interface FeeProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Fee"; + value: Uint8Array; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeAmino { + /** amount is the amount of coins to be paid as a fee */ + amount: CoinAmino[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gas_limit: string; + /** + * 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. + */ + payer: string; + /** + * 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 + */ + granter: string; +} +export interface FeeAminoMsg { + type: "cosmos-sdk/Fee"; + value: FeeAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseTx(): Tx { + return { + body: undefined, + authInfo: undefined, + signatures: [] + }; +} +export const Tx = { + typeUrl: "/cosmos.tx.v1beta1.Tx", + aminoType: "cosmos-sdk/Tx", + is(o: any): o is Tx { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxAmino { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.body !== undefined) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Tx { + const message = createBaseTx(); + message.body = object.body !== undefined && object.body !== null ? TxBody.fromPartial(object.body) : undefined; + message.authInfo = object.authInfo !== undefined && object.authInfo !== null ? AuthInfo.fromPartial(object.authInfo) : undefined; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxAmino): Tx { + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Tx): TxAmino { + const obj: any = {}; + obj.body = message.body ? TxBody.toAmino(message.body) : undefined; + obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxAminoMsg): Tx { + return Tx.fromAmino(object.value); + }, + toAminoMsg(message: Tx): TxAminoMsg { + return { + type: "cosmos-sdk/Tx", + value: Tx.toAmino(message) + }; + }, + fromProtoMsg(message: TxProtoMsg): Tx { + return Tx.decode(message.value); + }, + toProto(message: Tx): Uint8Array { + return Tx.encode(message).finish(); + }, + toProtoMsg(message: Tx): TxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tx", + value: Tx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Tx.typeUrl, Tx); +GlobalDecoderRegistry.registerAminoProtoMapping(Tx.aminoType, Tx.typeUrl); +function createBaseTxRaw(): TxRaw { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + signatures: [] + }; +} +export const TxRaw = { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + aminoType: "cosmos-sdk/TxRaw", + is(o: any): o is TxRaw { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxRawAmino { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxRaw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxRaw { + const message = createBaseTxRaw(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxRawAmino): TxRaw { + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: TxRaw): TxRawAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxRawAminoMsg): TxRaw { + return TxRaw.fromAmino(object.value); + }, + toAminoMsg(message: TxRaw): TxRawAminoMsg { + return { + type: "cosmos-sdk/TxRaw", + value: TxRaw.toAmino(message) + }; + }, + fromProtoMsg(message: TxRawProtoMsg): TxRaw { + return TxRaw.decode(message.value); + }, + toProto(message: TxRaw): Uint8Array { + return TxRaw.encode(message).finish(); + }, + toProtoMsg(message: TxRaw): TxRawProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + value: TxRaw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxRaw.typeUrl, TxRaw); +GlobalDecoderRegistry.registerAminoProtoMapping(TxRaw.aminoType, TxRaw.typeUrl); +function createBaseSignDoc(): SignDoc { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + chainId: "", + accountNumber: BigInt(0) + }; +} +export const SignDoc = { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + aminoType: "cosmos-sdk/SignDoc", + is(o: any): o is SignDoc { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint"); + }, + isAmino(o: any): o is SignDocAmino { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint"); + }, + encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDoc(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignDoc { + const message = createBaseSignDoc(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignDocAmino): SignDoc { + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + 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); + } + return message; + }, + toAmino(message: SignDoc): SignDocAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignDocAminoMsg): SignDoc { + return SignDoc.fromAmino(object.value); + }, + toAminoMsg(message: SignDoc): SignDocAminoMsg { + return { + type: "cosmos-sdk/SignDoc", + value: SignDoc.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocProtoMsg): SignDoc { + return SignDoc.decode(message.value); + }, + toProto(message: SignDoc): Uint8Array { + return SignDoc.encode(message).finish(); + }, + toProtoMsg(message: SignDoc): SignDocProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + value: SignDoc.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignDoc.typeUrl, SignDoc); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDoc.aminoType, SignDoc.typeUrl); +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", + aminoType: "cosmos-sdk/SignDocDirectAux", + is(o: any): o is SignDocDirectAux { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignDocDirectAuxAmino { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SignDocDirectAux.typeUrl, SignDocDirectAux); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDocDirectAux.aminoType, SignDocDirectAux.typeUrl); +function createBaseTxBody(): TxBody { + return { + messages: [], + memo: "", + timeoutHeight: BigInt(0), + extensionOptions: [], + nonCriticalExtensionOptions: [] + }; +} +export const TxBody = { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + aminoType: "cosmos-sdk/TxBody", + is(o: any): o is TxBody { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && typeof o.memo === "string" && typeof o.timeoutHeight === "bigint" && Array.isArray(o.extensionOptions) && (!o.extensionOptions.length || Any.is(o.extensionOptions[0])) && Array.isArray(o.nonCriticalExtensionOptions) && (!o.nonCriticalExtensionOptions.length || Any.is(o.nonCriticalExtensionOptions[0]))); + }, + isAmino(o: any): o is TxBodyAmino { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && typeof o.memo === "string" && typeof o.timeout_height === "bigint" && Array.isArray(o.extension_options) && (!o.extension_options.length || Any.isAmino(o.extension_options[0])) && Array.isArray(o.non_critical_extension_options) && (!o.non_critical_extension_options.length || Any.isAmino(o.non_critical_extension_options[0]))); + }, + encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.memo !== "") { + writer.uint32(18).string(message.memo); + } + if (message.timeoutHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.timeoutHeight); + } + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxBody(); + 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.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.memo = object.memo ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? BigInt(object.timeoutHeight.toString()) : BigInt(0); + message.extensionOptions = object.extensionOptions?.map(e => Any.fromPartial(e)) || []; + message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxBodyAmino): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxBody): TxBodyAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.memo = message.memo === "" ? undefined : message.memo; + obj.timeout_height = message.timeoutHeight !== BigInt(0) ? message.timeoutHeight?.toString() : undefined; + if (message.extensionOptions) { + obj.extension_options = message.extensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.extension_options = message.extensionOptions; + } + if (message.nonCriticalExtensionOptions) { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions; + } + return obj; + }, + fromAminoMsg(object: TxBodyAminoMsg): TxBody { + return TxBody.fromAmino(object.value); + }, + toAminoMsg(message: TxBody): TxBodyAminoMsg { + return { + type: "cosmos-sdk/TxBody", + value: TxBody.toAmino(message) + }; + }, + fromProtoMsg(message: TxBodyProtoMsg): TxBody { + return TxBody.decode(message.value); + }, + toProto(message: TxBody): Uint8Array { + return TxBody.encode(message).finish(); + }, + toProtoMsg(message: TxBody): TxBodyProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + value: TxBody.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxBody.typeUrl, TxBody); +GlobalDecoderRegistry.registerAminoProtoMapping(TxBody.aminoType, TxBody.typeUrl); +function createBaseAuthInfo(): AuthInfo { + return { + signerInfos: [], + fee: undefined, + tip: undefined + }; +} +export const AuthInfo = { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + aminoType: "cosmos-sdk/AuthInfo", + is(o: any): o is AuthInfo { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signerInfos) && (!o.signerInfos.length || SignerInfo.is(o.signerInfos[0]))); + }, + isAmino(o: any): o is AuthInfoAmino { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signer_infos) && (!o.signer_infos.length || SignerInfo.isAmino(o.signer_infos[0]))); + }, + encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + 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 { + const obj: any = {}; + if (message.signerInfos) { + obj.signer_infos = message.signerInfos.map(e => e ? SignerInfo.toAmino(e) : undefined); + } else { + 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 { + return AuthInfo.fromAmino(object.value); + }, + toAminoMsg(message: AuthInfo): AuthInfoAminoMsg { + return { + type: "cosmos-sdk/AuthInfo", + value: AuthInfo.toAmino(message) + }; + }, + fromProtoMsg(message: AuthInfoProtoMsg): AuthInfo { + return AuthInfo.decode(message.value); + }, + toProto(message: AuthInfo): Uint8Array { + return AuthInfo.encode(message).finish(); + }, + toProtoMsg(message: AuthInfo): AuthInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + value: AuthInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AuthInfo.typeUrl, AuthInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthInfo.aminoType, AuthInfo.typeUrl); +function createBaseSignerInfo(): SignerInfo { + return { + publicKey: undefined, + modeInfo: undefined, + sequence: BigInt(0) + }; +} +export const SignerInfo = { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + aminoType: "cosmos-sdk/SignerInfo", + is(o: any): o is SignerInfo { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignerInfoAmino { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignerInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignerInfo { + const message = createBaseSignerInfo(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.modeInfo = object.modeInfo !== undefined && object.modeInfo !== null ? ModeInfo.fromPartial(object.modeInfo) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignerInfoAmino): SignerInfo { + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignerInfo): SignerInfoAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.mode_info = message.modeInfo ? ModeInfo.toAmino(message.modeInfo) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { + return SignerInfo.fromAmino(object.value); + }, + toAminoMsg(message: SignerInfo): SignerInfoAminoMsg { + return { + type: "cosmos-sdk/SignerInfo", + value: SignerInfo.toAmino(message) + }; + }, + fromProtoMsg(message: SignerInfoProtoMsg): SignerInfo { + return SignerInfo.decode(message.value); + }, + toProto(message: SignerInfo): Uint8Array { + return SignerInfo.encode(message).finish(); + }, + toProtoMsg(message: SignerInfo): SignerInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + value: SignerInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignerInfo.typeUrl, SignerInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(SignerInfo.aminoType, SignerInfo.typeUrl); +function createBaseModeInfo(): ModeInfo { + return { + single: undefined, + multi: undefined + }; +} +export const ModeInfo = { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + aminoType: "cosmos-sdk/ModeInfo", + is(o: any): o is ModeInfo { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + isAmino(o: any): o is ModeInfoAmino { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo { + const message = createBaseModeInfo(); + message.single = object.single !== undefined && object.single !== null ? ModeInfo_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? ModeInfo_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: ModeInfoAmino): ModeInfo { + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: ModeInfo): ModeInfoAmino { + const obj: any = {}; + obj.single = message.single ? ModeInfo_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? ModeInfo_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: ModeInfoAminoMsg): ModeInfo { + return ModeInfo.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo): ModeInfoAminoMsg { + return { + type: "cosmos-sdk/ModeInfo", + value: ModeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfoProtoMsg): ModeInfo { + return ModeInfo.decode(message.value); + }, + toProto(message: ModeInfo): Uint8Array { + return ModeInfo.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo): ModeInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + value: ModeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo.typeUrl, ModeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo.aminoType, ModeInfo.typeUrl); +function createBaseModeInfo_Single(): ModeInfo_Single { + return { + mode: 0 + }; +} +export const ModeInfo_Single = { + typeUrl: "/cosmos.tx.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is ModeInfo_Single { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + isAmino(o: any): o is ModeInfo_SingleAmino { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { + return ModeInfo_Single.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Single): ModeInfo_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: ModeInfo_Single.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_SingleProtoMsg): ModeInfo_Single { + return ModeInfo_Single.decode(message.value); + }, + toProto(message: ModeInfo_Single): Uint8Array { + return ModeInfo_Single.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Single): ModeInfo_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Single", + value: ModeInfo_Single.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo_Single.typeUrl, ModeInfo_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Single.aminoType, ModeInfo_Single.typeUrl); +function createBaseModeInfo_Multi(): ModeInfo_Multi { + return { + bitarray: undefined, + modeInfos: [] + }; +} +export const ModeInfo_Multi = { + typeUrl: "/cosmos.tx.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is ModeInfo_Multi { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.modeInfos) && (!o.modeInfos.length || ModeInfo.is(o.modeInfos[0]))); + }, + isAmino(o: any): o is ModeInfo_MultiAmino { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.mode_infos) && (!o.mode_infos.length || ModeInfo.isAmino(o.mode_infos[0]))); + }, + encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.modeInfos = object.modeInfos?.map(e => ModeInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.modeInfos) { + obj.mode_infos = message.modeInfos.map(e => e ? ModeInfo.toAmino(e) : undefined); + } else { + obj.mode_infos = message.modeInfos; + } + return obj; + }, + fromAminoMsg(object: ModeInfo_MultiAminoMsg): ModeInfo_Multi { + return ModeInfo_Multi.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Multi): ModeInfo_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: ModeInfo_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_MultiProtoMsg): ModeInfo_Multi { + return ModeInfo_Multi.decode(message.value); + }, + toProto(message: ModeInfo_Multi): Uint8Array { + return ModeInfo_Multi.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Multi): ModeInfo_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Multi", + value: ModeInfo_Multi.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo_Multi.typeUrl, ModeInfo_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Multi.aminoType, ModeInfo_Multi.typeUrl); +function createBaseFee(): Fee { + return { + amount: [], + gasLimit: BigInt(0), + payer: "", + granter: "" + }; +} +export const Fee = { + typeUrl: "/cosmos.tx.v1beta1.Fee", + aminoType: "cosmos-sdk/Fee", + is(o: any): o is Fee { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.gasLimit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is FeeAmino { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.gas_limit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.payer !== "") { + writer.uint32(26).string(message.payer); + } + if (message.granter !== "") { + writer.uint32(34).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFee(); + 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.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.payer = object.payer ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: FeeAmino): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: Fee): FeeAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.payer = message.payer === "" ? undefined : message.payer; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: FeeAminoMsg): Fee { + return Fee.fromAmino(object.value); + }, + toAminoMsg(message: Fee): FeeAminoMsg { + return { + type: "cosmos-sdk/Fee", + value: Fee.toAmino(message) + }; + }, + fromProtoMsg(message: FeeProtoMsg): Fee { + return Fee.decode(message.value); + }, + toProto(message: Fee): Uint8Array { + return Fee.encode(message).finish(); + }, + toProtoMsg(message: Fee): FeeProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Fee", + value: Fee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Fee.typeUrl, Fee); +GlobalDecoderRegistry.registerAminoProtoMapping(Fee.aminoType, Fee.typeUrl); +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + aminoType: "cosmos-sdk/Tip", + is(o: any): o is Tip { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.tipper === "string"); + }, + isAmino(o: any): o is TipAmino { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.tipper === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Tip.typeUrl, Tip); +GlobalDecoderRegistry.registerAminoProtoMapping(Tip.aminoType, Tip.typeUrl); +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + aminoType: "cosmos-sdk/AuxSignerData", + is(o: any): o is AuxSignerData { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + isAmino(o: any): o is AuxSignerDataAmino { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AuxSignerData.typeUrl, AuxSignerData); +GlobalDecoderRegistry.registerAminoProtoMapping(AuxSignerData.aminoType, AuxSignerData.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/upgrade/v1beta1/upgrade.ts b/libs/injective-query/src/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 00000000..c2adfcb7 --- /dev/null +++ b/libs/injective-query/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,591 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * 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 + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * 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. + */ + /** @deprecated */ + time: Date; + /** The height at which the upgrade must be performed. */ + height: bigint; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * 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. + */ + /** @deprecated */ + upgradedClientState?: Any; +} +export interface PlanProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.Plan"; + value: Uint8Array; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * 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 + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * 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. + */ + /** @deprecated */ + time: string; + /** The height at which the upgrade must be performed. */ + height: string; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * 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. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino; +} +export interface PlanAminoMsg { + type: "cosmos-sdk/Plan"; + value: PlanAmino; +} +/** + * 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 { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * 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 of the proposal */ + plan: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/SoftwareUpgradeProposal"; + value: SoftwareUpgradeProposalAmino; +} +/** + * 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 { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * 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 { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: bigint; +} +export interface ModuleVersionProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; + value: Uint8Array; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: string; +} +export interface ModuleVersionAminoMsg { + type: "cosmos-sdk/ModuleVersion"; + value: ModuleVersionAmino; +} +function createBasePlan(): Plan { + return { + name: "", + time: new Date(), + height: BigInt(0), + info: "", + upgradedClientState: undefined + }; +} +export const Plan = { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + aminoType: "cosmos-sdk/Plan", + is(o: any): o is Plan { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.is(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + isAmino(o: any): o is PlanAmino { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.isAmino(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.info = object.info ?? ""; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: PlanAmino): Plan { + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: Plan): PlanAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + 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; + return obj; + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value); + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: "cosmos-sdk/Plan", + value: Plan.toAmino(message) + }; + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value); + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish(); + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + value: Plan.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Plan.typeUrl, Plan); +GlobalDecoderRegistry.registerAminoProtoMapping(Plan.aminoType, Plan.typeUrl); +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { + title: "", + description: "", + plan: Plan.fromPartial({}) + }; +} +export const SoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + aminoType: "cosmos-sdk/SoftwareUpgradeProposal", + is(o: any): o is SoftwareUpgradeProposal { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.is(o.plan)); + }, + isAmino(o: any): o is SoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isAmino(o.plan)); + }, + encode(message: SoftwareUpgradeProposal, 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.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + 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.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { + 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) : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SoftwareUpgradeProposalProtoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SoftwareUpgradeProposal.typeUrl, SoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SoftwareUpgradeProposal.aminoType, SoftwareUpgradeProposal.typeUrl); +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { + title: "", + description: "" + }; +} +export const CancelSoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + aminoType: "cosmos-sdk/CancelSoftwareUpgradeProposal", + is(o: any): o is CancelSoftwareUpgradeProposal { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is CancelSoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: CancelSoftwareUpgradeProposalAminoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSoftwareUpgradeProposalProtoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelSoftwareUpgradeProposal.typeUrl, CancelSoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelSoftwareUpgradeProposal.aminoType, CancelSoftwareUpgradeProposal.typeUrl); +function createBaseModuleVersion(): ModuleVersion { + return { + name: "", + version: BigInt(0) + }; +} +export const ModuleVersion = { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + aminoType: "cosmos-sdk/ModuleVersion", + is(o: any): o is ModuleVersion { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + isAmino(o: any): o is ModuleVersionAmino { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; + }, + toAmino(message: ModuleVersion): ModuleVersionAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.version = message.version !== BigInt(0) ? message.version?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value); + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: "cosmos-sdk/ModuleVersion", + value: ModuleVersion.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value); + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish(); + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + value: ModuleVersion.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleVersion.typeUrl, ModuleVersion); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleVersion.aminoType, ModuleVersion.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/cosmos/vesting/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..a0043688 --- /dev/null +++ b/libs/injective-query/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -0,0 +1,31 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateVestingAccount.typeUrl, + encoders: toEncoders(MsgCreateVestingAccount), + converters: toConverters(MsgCreateVestingAccount) +}); +export const useCreateVestingAccount = buildUseMutation({ + builderMutationFn: createCreateVestingAccount +}); +export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePermanentLockedAccount.typeUrl, + encoders: toEncoders(MsgCreatePermanentLockedAccount), + converters: toConverters(MsgCreatePermanentLockedAccount) +}); +export const useCreatePermanentLockedAccount = buildUseMutation({ + builderMutationFn: createCreatePermanentLockedAccount +}); +export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, + encoders: toEncoders(MsgCreatePeriodicVestingAccount), + converters: toConverters(MsgCreatePeriodicVestingAccount) +}); +export const useCreatePeriodicVestingAccount = buildUseMutation({ + builderMutationFn: createCreatePeriodicVestingAccount +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/vesting/v1beta1/tx.ts b/libs/injective-query/src/cosmos/vesting/v1beta1/tx.ts new file mode 100644 index 00000000..4e9fcb3f --- /dev/null +++ b/libs/injective-query/src/cosmos/vesting/v1beta1/tx.ts @@ -0,0 +1,698 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Period, PeriodAmino } from "./vesting"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; + /** end of vesting as unix time (in seconds). */ + endTime: bigint; + delayed: boolean; +} +export interface MsgCreateVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccountAmino { + from_address: string; + to_address: string; + amount: CoinAmino[]; + /** end of vesting as unix time (in seconds). */ + end_time: string; + delayed: boolean; +} +export interface MsgCreateVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccount"; + value: MsgCreateVestingAccountAmino; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponse {} +export interface MsgCreateVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse"; + value: Uint8Array; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponseAmino {} +export interface MsgCreateVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccountResponse"; + value: MsgCreateVestingAccountResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { + return { + fromAddress: "", + toAddress: "", + amount: [], + endTime: BigInt(0), + delayed: false + }; +} +export const MsgCreateVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + aminoType: "cosmos-sdk/MsgCreateVestingAccount", + is(o: any): o is MsgCreateVestingAccount { + return o && (o.$typeUrl === MsgCreateVestingAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.endTime === "bigint" && typeof o.delayed === "boolean"); + }, + isAmino(o: any): o is MsgCreateVestingAccountAmino { + return o && (o.$typeUrl === MsgCreateVestingAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.end_time === "bigint" && typeof o.delayed === "boolean"); + }, + encode(message: MsgCreateVestingAccount, 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(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(32).int64(message.endTime); + } + if (message.delayed === true) { + writer.uint32(40).bool(message.delayed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccount(); + 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; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + message.delayed = object.delayed ?? false; + return message; + }, + fromAmino(object: MsgCreateVestingAccountAmino): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + 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)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = object.delayed; + } + return message; + }, + toAmino(message: MsgCreateVestingAccount): MsgCreateVestingAccountAmino { + 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; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime?.toString() : undefined; + obj.delayed = message.delayed === false ? undefined : message.delayed; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountAminoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccount", + value: MsgCreateVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountProtoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.decode(message.value); + }, + toProto(message: MsgCreateVestingAccount): Uint8Array { + return MsgCreateVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateVestingAccount.typeUrl, MsgCreateVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateVestingAccount.aminoType, MsgCreateVestingAccount.typeUrl); +function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountResponse { + return {}; +} +export const MsgCreateVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + aminoType: "cosmos-sdk/MsgCreateVestingAccountResponse", + is(o: any): o is MsgCreateVestingAccountResponse { + return o && o.$typeUrl === MsgCreateVestingAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateVestingAccountResponseAmino { + return o && o.$typeUrl === MsgCreateVestingAccountResponse.typeUrl; + }, + encode(_: MsgCreateVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + fromAmino(_: MsgCreateVestingAccountResponseAmino): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + toAmino(_: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountResponseAminoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountResponseProtoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreateVestingAccountResponse): Uint8Array { + return MsgCreateVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateVestingAccountResponse.typeUrl, MsgCreateVestingAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateVestingAccountResponse.aminoType, MsgCreateVestingAccountResponse.typeUrl); +function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAccount { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgCreatePermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", + is(o: any): o is MsgCreatePermanentLockedAccount { + return o && (o.$typeUrl === MsgCreatePermanentLockedAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgCreatePermanentLockedAccountAmino { + return o && (o.$typeUrl === MsgCreatePermanentLockedAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePermanentLockedAccount.typeUrl, MsgCreatePermanentLockedAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePermanentLockedAccount.aminoType, MsgCreatePermanentLockedAccount.typeUrl); +function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanentLockedAccountResponse { + return {}; +} +export const MsgCreatePermanentLockedAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + aminoType: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse", + is(o: any): o is MsgCreatePermanentLockedAccountResponse { + return o && o.$typeUrl === MsgCreatePermanentLockedAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreatePermanentLockedAccountResponseAmino { + return o && o.$typeUrl === MsgCreatePermanentLockedAccountResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePermanentLockedAccountResponse.typeUrl, MsgCreatePermanentLockedAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePermanentLockedAccountResponse.aminoType, MsgCreatePermanentLockedAccountResponse.typeUrl); +function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAccount { + return { + fromAddress: "", + toAddress: "", + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const MsgCreatePeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + aminoType: "cosmos-sdk/MsgCreatePeriodVestAccount", + is(o: any): o is MsgCreatePeriodicVestingAccount { + return o && (o.$typeUrl === MsgCreatePeriodicVestingAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && typeof o.startTime === "bigint" && Array.isArray(o.vestingPeriods) && (!o.vestingPeriods.length || Period.is(o.vestingPeriods[0]))); + }, + isAmino(o: any): o is MsgCreatePeriodicVestingAccountAmino { + return o && (o.$typeUrl === MsgCreatePeriodicVestingAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && typeof o.start_time === "bigint" && Array.isArray(o.vesting_periods) && (!o.vesting_periods.length || Period.isAmino(o.vesting_periods[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePeriodicVestingAccount.typeUrl, MsgCreatePeriodicVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePeriodicVestingAccount.aminoType, MsgCreatePeriodicVestingAccount.typeUrl); +function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicVestingAccountResponse { + return {}; +} +export const MsgCreatePeriodicVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + aminoType: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse", + is(o: any): o is MsgCreatePeriodicVestingAccountResponse { + return o && o.$typeUrl === MsgCreatePeriodicVestingAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreatePeriodicVestingAccountResponseAmino { + return o && o.$typeUrl === MsgCreatePeriodicVestingAccountResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePeriodicVestingAccountResponse.typeUrl, MsgCreatePeriodicVestingAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePeriodicVestingAccountResponse.aminoType, MsgCreatePeriodicVestingAccountResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos/vesting/v1beta1/vesting.ts b/libs/injective-query/src/cosmos/vesting/v1beta1/vesting.ts new file mode 100644 index 00000000..91f05562 --- /dev/null +++ b/libs/injective-query/src/cosmos/vesting/v1beta1/vesting.ts @@ -0,0 +1,735 @@ +import { BaseAccount, BaseAccountAmino } from "../../auth/v1beta1/auth"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccount { + baseAccount?: BaseAccount; + originalVesting: Coin[]; + delegatedFree: Coin[]; + delegatedVesting: Coin[]; + /** Vesting end time, as unix timestamp (in seconds). */ + endTime: bigint; +} +export interface BaseVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; + value: Uint8Array; +} +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccountAmino { + base_account?: BaseAccountAmino; + original_vesting: CoinAmino[]; + delegated_free: CoinAmino[]; + delegated_vesting: CoinAmino[]; + /** Vesting end time, as unix timestamp (in seconds). */ + end_time: string; +} +export interface BaseVestingAccountAminoMsg { + type: "cosmos-sdk/BaseVestingAccount"; + value: BaseVestingAccountAmino; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccount { + baseVestingAccount?: BaseVestingAccount; + /** Vesting start time, as unix timestamp (in seconds). */ + startTime: bigint; +} +export interface ContinuousVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; + value: Uint8Array; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + /** Vesting start time, as unix timestamp (in seconds). */ + start_time: string; +} +export interface ContinuousVestingAccountAminoMsg { + type: "cosmos-sdk/ContinuousVestingAccount"; + value: ContinuousVestingAccountAmino; +} +/** + * 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. + */ +export interface DelayedVestingAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface DelayedVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DelayedVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface DelayedVestingAccountAminoMsg { + type: "cosmos-sdk/DelayedVestingAccount"; + value: DelayedVestingAccountAmino; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface Period { + /** Period duration in seconds. */ + length: bigint; + amount: Coin[]; +} +export interface PeriodProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.Period"; + value: Uint8Array; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface PeriodAmino { + /** Period duration in seconds. */ + length: string; + amount: CoinAmino[]; +} +export interface PeriodAminoMsg { + type: "cosmos-sdk/Period"; + value: PeriodAmino; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; + vestingPeriods: Period[]; +} +export interface PeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount"; + value: Uint8Array; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + start_time: string; + vesting_periods: PeriodAmino[]; +} +export interface PeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/PeriodicVestingAccount"; + value: PeriodicVestingAccountAmino; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface PermanentLockedAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; + value: Uint8Array; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface PermanentLockedAccountAminoMsg { + type: "cosmos-sdk/PermanentLockedAccount"; + value: PermanentLockedAccountAmino; +} +function createBaseBaseVestingAccount(): BaseVestingAccount { + return { + baseAccount: undefined, + originalVesting: [], + delegatedFree: [], + delegatedVesting: [], + endTime: BigInt(0) + }; +} +export const BaseVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + aminoType: "cosmos-sdk/BaseVestingAccount", + is(o: any): o is BaseVestingAccount { + return o && (o.$typeUrl === BaseVestingAccount.typeUrl || Array.isArray(o.originalVesting) && (!o.originalVesting.length || Coin.is(o.originalVesting[0])) && Array.isArray(o.delegatedFree) && (!o.delegatedFree.length || Coin.is(o.delegatedFree[0])) && Array.isArray(o.delegatedVesting) && (!o.delegatedVesting.length || Coin.is(o.delegatedVesting[0])) && typeof o.endTime === "bigint"); + }, + isAmino(o: any): o is BaseVestingAccountAmino { + return o && (o.$typeUrl === BaseVestingAccount.typeUrl || Array.isArray(o.original_vesting) && (!o.original_vesting.length || Coin.isAmino(o.original_vesting[0])) && Array.isArray(o.delegated_free) && (!o.delegated_free.length || Coin.isAmino(o.delegated_free[0])) && Array.isArray(o.delegated_vesting) && (!o.delegated_vesting.length || Coin.isAmino(o.delegated_vesting[0])) && typeof o.end_time === "bigint"); + }, + encode(message: BaseVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.originalVesting) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatedFree) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.delegatedVesting) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(40).int64(message.endTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.originalVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.delegatedFree.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.originalVesting = object.originalVesting?.map(e => Coin.fromPartial(e)) || []; + message.delegatedFree = object.delegatedFree?.map(e => Coin.fromPartial(e)) || []; + message.delegatedVesting = object.delegatedVesting?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BaseVestingAccountAmino): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + message.originalVesting = object.original_vesting?.map(e => Coin.fromAmino(e)) || []; + message.delegatedFree = object.delegated_free?.map(e => Coin.fromAmino(e)) || []; + message.delegatedVesting = object.delegated_vesting?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + return message; + }, + toAmino(message: BaseVestingAccount): BaseVestingAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + if (message.originalVesting) { + obj.original_vesting = message.originalVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.original_vesting = message.originalVesting; + } + if (message.delegatedFree) { + obj.delegated_free = message.delegatedFree.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_free = message.delegatedFree; + } + if (message.delegatedVesting) { + obj.delegated_vesting = message.delegatedVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_vesting = message.delegatedVesting; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseVestingAccountAminoMsg): BaseVestingAccount { + return BaseVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseVestingAccount): BaseVestingAccountAminoMsg { + return { + type: "cosmos-sdk/BaseVestingAccount", + value: BaseVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseVestingAccountProtoMsg): BaseVestingAccount { + return BaseVestingAccount.decode(message.value); + }, + toProto(message: BaseVestingAccount): Uint8Array { + return BaseVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseVestingAccount): BaseVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + value: BaseVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BaseVestingAccount.typeUrl, BaseVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseVestingAccount.aminoType, BaseVestingAccount.typeUrl); +function createBaseContinuousVestingAccount(): ContinuousVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0) + }; +} +export const ContinuousVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + aminoType: "cosmos-sdk/ContinuousVestingAccount", + is(o: any): o is ContinuousVestingAccount { + return o && (o.$typeUrl === ContinuousVestingAccount.typeUrl || typeof o.startTime === "bigint"); + }, + isAmino(o: any): o is ContinuousVestingAccountAmino { + return o && (o.$typeUrl === ContinuousVestingAccount.typeUrl || typeof o.start_time === "bigint"); + }, + encode(message: ContinuousVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContinuousVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ContinuousVestingAccountAmino): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + return message; + }, + toAmino(message: ContinuousVestingAccount): ContinuousVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ContinuousVestingAccountAminoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountAminoMsg { + return { + type: "cosmos-sdk/ContinuousVestingAccount", + value: ContinuousVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ContinuousVestingAccountProtoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.decode(message.value); + }, + toProto(message: ContinuousVestingAccount): Uint8Array { + return ContinuousVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + value: ContinuousVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContinuousVestingAccount.typeUrl, ContinuousVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(ContinuousVestingAccount.aminoType, ContinuousVestingAccount.typeUrl); +function createBaseDelayedVestingAccount(): DelayedVestingAccount { + return { + baseVestingAccount: undefined + }; +} +export const DelayedVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + aminoType: "cosmos-sdk/DelayedVestingAccount", + is(o: any): o is DelayedVestingAccount { + return o && o.$typeUrl === DelayedVestingAccount.typeUrl; + }, + isAmino(o: any): o is DelayedVestingAccountAmino { + return o && o.$typeUrl === DelayedVestingAccount.typeUrl; + }, + encode(message: DelayedVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelayedVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: DelayedVestingAccountAmino): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: DelayedVestingAccount): DelayedVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: DelayedVestingAccountAminoMsg): DelayedVestingAccount { + return DelayedVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: DelayedVestingAccount): DelayedVestingAccountAminoMsg { + return { + type: "cosmos-sdk/DelayedVestingAccount", + value: DelayedVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: DelayedVestingAccountProtoMsg): DelayedVestingAccount { + return DelayedVestingAccount.decode(message.value); + }, + toProto(message: DelayedVestingAccount): Uint8Array { + return DelayedVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: DelayedVestingAccount): DelayedVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + value: DelayedVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelayedVestingAccount.typeUrl, DelayedVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(DelayedVestingAccount.aminoType, DelayedVestingAccount.typeUrl); +function createBasePeriod(): Period { + return { + length: BigInt(0), + amount: [] + }; +} +export const Period = { + typeUrl: "/cosmos.vesting.v1beta1.Period", + aminoType: "cosmos-sdk/Period", + is(o: any): o is Period { + return o && (o.$typeUrl === Period.typeUrl || typeof o.length === "bigint" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is PeriodAmino { + return o && (o.$typeUrl === Period.typeUrl || typeof o.length === "bigint" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: Period, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.length !== BigInt(0)) { + writer.uint32(8).int64(message.length); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Period { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriod(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.length = reader.int64(); + break; + case 2: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Period { + const message = createBasePeriod(); + message.length = object.length !== undefined && object.length !== null ? BigInt(object.length.toString()) : BigInt(0); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PeriodAmino): Period { + const message = createBasePeriod(); + if (object.length !== undefined && object.length !== null) { + message.length = BigInt(object.length); + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Period): PeriodAmino { + const obj: any = {}; + obj.length = message.length !== BigInt(0) ? message.length?.toString() : undefined; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: PeriodAminoMsg): Period { + return Period.fromAmino(object.value); + }, + toAminoMsg(message: Period): PeriodAminoMsg { + return { + type: "cosmos-sdk/Period", + value: Period.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodProtoMsg): Period { + return Period.decode(message.value); + }, + toProto(message: Period): Uint8Array { + return Period.encode(message).finish(); + }, + toProtoMsg(message: Period): PeriodProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.Period", + value: Period.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Period.typeUrl, Period); +GlobalDecoderRegistry.registerAminoProtoMapping(Period.aminoType, Period.typeUrl); +function createBasePeriodicVestingAccount(): PeriodicVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const PeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + aminoType: "cosmos-sdk/PeriodicVestingAccount", + is(o: any): o is PeriodicVestingAccount { + return o && (o.$typeUrl === PeriodicVestingAccount.typeUrl || typeof o.startTime === "bigint" && Array.isArray(o.vestingPeriods) && (!o.vestingPeriods.length || Period.is(o.vestingPeriods[0]))); + }, + isAmino(o: any): o is PeriodicVestingAccountAmino { + return o && (o.$typeUrl === PeriodicVestingAccount.typeUrl || typeof o.start_time === "bigint" && Array.isArray(o.vesting_periods) && (!o.vesting_periods.length || Period.isAmino(o.vesting_periods[0]))); + }, + encode(message: PeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + case 3: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + 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: PeriodicVestingAccountAmino): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + 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: PeriodicVestingAccount): PeriodicVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + 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: PeriodicVestingAccountAminoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountAminoMsg { + return { + type: "cosmos-sdk/PeriodicVestingAccount", + value: PeriodicVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodicVestingAccountProtoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.decode(message.value); + }, + toProto(message: PeriodicVestingAccount): Uint8Array { + return PeriodicVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + value: PeriodicVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PeriodicVestingAccount.typeUrl, PeriodicVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(PeriodicVestingAccount.aminoType, PeriodicVestingAccount.typeUrl); +function createBasePermanentLockedAccount(): PermanentLockedAccount { + return { + baseVestingAccount: undefined + }; +} +export const PermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + aminoType: "cosmos-sdk/PermanentLockedAccount", + is(o: any): o is PermanentLockedAccount { + return o && o.$typeUrl === PermanentLockedAccount.typeUrl; + }, + isAmino(o: any): o is PermanentLockedAccountAmino { + return o && o.$typeUrl === PermanentLockedAccount.typeUrl; + }, + encode(message: PermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: PermanentLockedAccountAmino): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: PermanentLockedAccount): PermanentLockedAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: PermanentLockedAccountAminoMsg): PermanentLockedAccount { + return PermanentLockedAccount.fromAmino(object.value); + }, + toAminoMsg(message: PermanentLockedAccount): PermanentLockedAccountAminoMsg { + return { + type: "cosmos-sdk/PermanentLockedAccount", + value: PermanentLockedAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PermanentLockedAccountProtoMsg): PermanentLockedAccount { + return PermanentLockedAccount.decode(message.value); + }, + toProto(message: PermanentLockedAccount): Uint8Array { + return PermanentLockedAccount.encode(message).finish(); + }, + toProtoMsg(message: PermanentLockedAccount): PermanentLockedAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + value: PermanentLockedAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PermanentLockedAccount.typeUrl, PermanentLockedAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(PermanentLockedAccount.aminoType, PermanentLockedAccount.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmos_proto/cosmos.ts b/libs/injective-query/src/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..0a97877f --- /dev/null +++ b/libs/injective-query/src/cosmos_proto/cosmos.ts @@ -0,0 +1,341 @@ +import { BinaryReader, BinaryWriter } from "../binary"; +import { DeepPartial } from "../helpers"; +import { GlobalDecoderRegistry } from "../registry"; +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} +export const ScalarTypeAmino = ScalarType; +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: "/cosmos_proto.InterfaceDescriptor"; + value: Uint8Array; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorAmino { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorAminoMsg { + type: "/cosmos_proto.InterfaceDescriptor"; + value: InterfaceDescriptorAmino; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} +export interface ScalarDescriptorProtoMsg { + typeUrl: "/cosmos_proto.ScalarDescriptor"; + value: Uint8Array; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorAmino { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + field_type: ScalarType[]; +} +export interface ScalarDescriptorAminoMsg { + type: "/cosmos_proto.ScalarDescriptor"; + value: ScalarDescriptorAmino; +} +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { + name: "", + description: "" + }; +} +export const InterfaceDescriptor = { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + is(o: any): o is InterfaceDescriptor { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is InterfaceDescriptorAmino { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { + return InterfaceDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { + return InterfaceDescriptor.decode(message.value); + }, + toProto(message: InterfaceDescriptor): Uint8Array { + return InterfaceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceDescriptor): InterfaceDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + value: InterfaceDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InterfaceDescriptor.typeUrl, InterfaceDescriptor); +function createBaseScalarDescriptor(): ScalarDescriptor { + return { + name: "", + description: "", + fieldType: [] + }; +} +export const ScalarDescriptor = { + typeUrl: "/cosmos_proto.ScalarDescriptor", + is(o: any): o is ScalarDescriptor { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.fieldType)); + }, + isAmino(o: any): o is ScalarDescriptorAmino { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.field_type)); + }, + encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = 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.fieldType.push((reader.int32() as any)); + } + } else { + message.fieldType.push((reader.int32() as any)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map(e => e) || []; + return message; + }, + fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => e) || []; + return message; + }, + toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + if (message.fieldType) { + obj.field_type = message.fieldType.map(e => e); + } else { + obj.field_type = message.fieldType; + } + return obj; + }, + fromAminoMsg(object: ScalarDescriptorAminoMsg): ScalarDescriptor { + return ScalarDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: ScalarDescriptorProtoMsg): ScalarDescriptor { + return ScalarDescriptor.decode(message.value); + }, + toProto(message: ScalarDescriptor): Uint8Array { + return ScalarDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ScalarDescriptor): ScalarDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.ScalarDescriptor", + value: ScalarDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ScalarDescriptor.typeUrl, ScalarDescriptor); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/proposal_legacy.ts b/libs/injective-query/src/cosmwasm/wasm/v1/proposal_legacy.ts new file mode 100644 index 00000000..0a986632 --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/proposal_legacy.ts @@ -0,0 +1,2432 @@ +import { AccessConfig, AccessConfigAmino } from "./types"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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 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 contract 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 contract 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 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 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 contract 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 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 contract 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 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 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 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 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 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 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 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; +} +/** + * 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; +} +/** + * 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 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 contract 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 contract 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; +} +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", + aminoType: "wasm/StoreCodeProposal", + is(o: any): o is StoreCodeProposal { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is StoreCodeProposalAmino { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(StoreCodeProposal.typeUrl, StoreCodeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreCodeProposal.aminoType, StoreCodeProposal.typeUrl); +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const InstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + aminoType: "wasm/InstantiateContractProposal", + is(o: any): o is InstantiateContractProposal { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is InstantiateContractProposalAmino { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InstantiateContractProposal.typeUrl, InstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContractProposal.aminoType, InstantiateContractProposal.typeUrl); +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", + aminoType: "wasm/InstantiateContract2Proposal", + is(o: any): o is InstantiateContract2Proposal { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isAmino(o: any): o is InstantiateContract2ProposalAmino { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InstantiateContract2Proposal.typeUrl, InstantiateContract2Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContract2Proposal.aminoType, InstantiateContract2Proposal.typeUrl); +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + title: "", + description: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MigrateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + aminoType: "wasm/MigrateContractProposal", + is(o: any): o is MigrateContractProposal { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MigrateContractProposalAmino { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MigrateContractProposal.typeUrl, MigrateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrateContractProposal.aminoType, MigrateContractProposal.typeUrl); +function createBaseSudoContractProposal(): SudoContractProposal { + return { + title: "", + description: "", + contract: "", + msg: new Uint8Array() + }; +} +export const SudoContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + aminoType: "wasm/SudoContractProposal", + is(o: any): o is SudoContractProposal { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is SudoContractProposalAmino { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SudoContractProposal.typeUrl, SudoContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SudoContractProposal.aminoType, SudoContractProposal.typeUrl); +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + title: "", + description: "", + runAs: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const ExecuteContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + aminoType: "wasm/ExecuteContractProposal", + is(o: any): o is ExecuteContractProposal { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is ExecuteContractProposalAmino { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExecuteContractProposal.typeUrl, ExecuteContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExecuteContractProposal.aminoType, ExecuteContractProposal.typeUrl); +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + title: "", + description: "", + newAdmin: "", + contract: "" + }; +} +export const UpdateAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + aminoType: "wasm/UpdateAdminProposal", + is(o: any): o is UpdateAdminProposal { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is UpdateAdminProposalAmino { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpdateAdminProposal.typeUrl, UpdateAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateAdminProposal.aminoType, UpdateAdminProposal.typeUrl); +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + title: "", + description: "", + contract: "" + }; +} +export const ClearAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + aminoType: "wasm/ClearAdminProposal", + is(o: any): o is ClearAdminProposal { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is ClearAdminProposalAmino { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ClearAdminProposal.typeUrl, ClearAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ClearAdminProposal.aminoType, ClearAdminProposal.typeUrl); +function createBasePinCodesProposal(): PinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const PinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + aminoType: "wasm/PinCodesProposal", + is(o: any): o is PinCodesProposal { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is PinCodesProposalAmino { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(PinCodesProposal.typeUrl, PinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(PinCodesProposal.aminoType, PinCodesProposal.typeUrl); +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const UnpinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + aminoType: "wasm/UnpinCodesProposal", + is(o: any): o is UnpinCodesProposal { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is UnpinCodesProposalAmino { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UnpinCodesProposal.typeUrl, UnpinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UnpinCodesProposal.aminoType, UnpinCodesProposal.typeUrl); +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const AccessConfigUpdate = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + aminoType: "wasm/AccessConfigUpdate", + is(o: any): o is AccessConfigUpdate { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.codeId === "bigint" && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is AccessConfigUpdateAmino { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.code_id === "bigint" && AccessConfig.isAmino(o.instantiate_permission)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AccessConfigUpdate.typeUrl, AccessConfigUpdate); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfigUpdate.aminoType, AccessConfigUpdate.typeUrl); +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + title: "", + description: "", + accessConfigUpdates: [] + }; +} +export const UpdateInstantiateConfigProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + aminoType: "wasm/UpdateInstantiateConfigProposal", + is(o: any): o is UpdateInstantiateConfigProposal { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.accessConfigUpdates) && (!o.accessConfigUpdates.length || AccessConfigUpdate.is(o.accessConfigUpdates[0]))); + }, + isAmino(o: any): o is UpdateInstantiateConfigProposalAmino { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.access_config_updates) && (!o.access_config_updates.length || AccessConfigUpdate.isAmino(o.access_config_updates[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpdateInstantiateConfigProposal.typeUrl, UpdateInstantiateConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateInstantiateConfigProposal.aminoType, UpdateInstantiateConfigProposal.typeUrl); +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", + aminoType: "wasm/StoreAndInstantiateContractProposal", + is(o: any): o is StoreAndInstantiateContractProposal { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is StoreAndInstantiateContractProposalAmino { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(StoreAndInstantiateContractProposal.typeUrl, StoreAndInstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreAndInstantiateContractProposal.aminoType, StoreAndInstantiateContractProposal.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/injective-query/src/cosmwasm/wasm/v1/query.rpc.func.ts new file mode 100644 index 00000000..19541ee4 --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -0,0 +1,157 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractInfoRequest.encode, + decode: QueryContractInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractInfo", + clientResolver +}); +export const useGetContractInfo = buildUseQuery({ + builderQueryFn: createGetContractInfo, + queryKeyPrefix: "ContractInfoQuery" +}); +export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractHistoryRequest.encode, + decode: QueryContractHistoryResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractHistory", + clientResolver +}); +export const useGetContractHistory = buildUseQuery({ + builderQueryFn: createGetContractHistory, + queryKeyPrefix: "ContractHistoryQuery" +}); +export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCodeRequest.encode, + decode: QueryContractsByCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCode", + clientResolver +}); +export const useGetContractsByCode = buildUseQuery({ + builderQueryFn: createGetContractsByCode, + queryKeyPrefix: "ContractsByCodeQuery" +}); +export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllContractStateRequest.encode, + decode: QueryAllContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "AllContractState", + clientResolver +}); +export const useGetAllContractState = buildUseQuery({ + builderQueryFn: createGetAllContractState, + queryKeyPrefix: "AllContractStateQuery" +}); +export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRawContractStateRequest.encode, + decode: QueryRawContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "RawContractState", + clientResolver +}); +export const useGetRawContractState = buildUseQuery({ + builderQueryFn: createGetRawContractState, + queryKeyPrefix: "RawContractStateQuery" +}); +export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySmartContractStateRequest.encode, + decode: QuerySmartContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "SmartContractState", + clientResolver +}); +export const useGetSmartContractState = buildUseQuery({ + builderQueryFn: createGetSmartContractState, + queryKeyPrefix: "SmartContractStateQuery" +}); +export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeRequest.encode, + decode: QueryCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Code", + clientResolver +}); +export const useGetCode = buildUseQuery({ + builderQueryFn: createGetCode, + queryKeyPrefix: "CodeQuery" +}); +export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodesRequest.encode, + decode: QueryCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Codes", + clientResolver +}); +export const useGetCodes = buildUseQuery({ + builderQueryFn: createGetCodes, + queryKeyPrefix: "CodesQuery" +}); +export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeInfoRequest.encode, + decode: QueryCodeInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "CodeInfo", + clientResolver +}); +export const useGetCodeInfo = buildUseQuery({ + builderQueryFn: createGetCodeInfo, + queryKeyPrefix: "CodeInfoQuery" +}); +export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPinnedCodesRequest.encode, + decode: QueryPinnedCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "PinnedCodes", + clientResolver +}); +export const useGetPinnedCodes = buildUseQuery({ + builderQueryFn: createGetPinnedCodes, + queryKeyPrefix: "PinnedCodesQuery" +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCreatorRequest.encode, + decode: QueryContractsByCreatorResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCreator", + clientResolver +}); +export const useGetContractsByCreator = buildUseQuery({ + builderQueryFn: createGetContractsByCreator, + queryKeyPrefix: "ContractsByCreatorQuery" +}); +export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmLimitsConfigRequest.encode, + decode: QueryWasmLimitsConfigResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "WasmLimitsConfig", + clientResolver +}); +export const useGetWasmLimitsConfig = buildUseQuery({ + builderQueryFn: createGetWasmLimitsConfig, + queryKeyPrefix: "WasmLimitsConfigQuery" +}); +export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBuildAddressRequest.encode, + decode: QueryBuildAddressResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "BuildAddress", + clientResolver +}); +export const useGetBuildAddress = buildUseQuery({ + builderQueryFn: createGetBuildAddress, + queryKeyPrefix: "BuildAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/query.ts b/libs/injective-query/src/cosmwasm/wasm/v1/query.ts new file mode 100644 index 00000000..cd8c0b8e --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/query.ts @@ -0,0 +1,3235 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../../cosmos/base/query/v1beta1/pagination"; +import { ContractInfo, ContractInfoAmino, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, Model, ModelAmino, AccessConfig, AccessConfigAmino, Params, ParamsAmino } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequest { + /** address is the address of the contract to query */ + address: string; +} +export interface QueryContractInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest"; + value: Uint8Array; +} +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequestAmino { + /** address is the address of the contract to query */ + address: string; +} +export interface QueryContractInfoRequestAminoMsg { + type: "wasm/QueryContractInfoRequest"; + value: QueryContractInfoRequestAmino; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponse { + /** address is the address of the contract */ + address: string; + contractInfo: ContractInfo; +} +export interface QueryContractInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse"; + value: Uint8Array; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponseAmino { + /** address is the address of the contract */ + address: string; + contract_info: ContractInfoAmino; +} +export interface QueryContractInfoResponseAminoMsg { + type: "wasm/QueryContractInfoResponse"; + value: QueryContractInfoResponseAmino; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequest { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractHistoryRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; + value: Uint8Array; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestAmino { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractHistoryRequestAminoMsg { + type: "wasm/QueryContractHistoryRequest"; + value: QueryContractHistoryRequestAmino; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponse { + entries: ContractCodeHistoryEntry[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractHistoryResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; + value: Uint8Array; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseAmino { + entries: ContractCodeHistoryEntryAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractHistoryResponseAminoMsg { + type: "wasm/QueryContractHistoryResponse"; + value: QueryContractHistoryResponseAmino; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCodeRequestAminoMsg { + type: "wasm/QueryContractsByCodeRequest"; + value: QueryContractsByCodeRequestAmino; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponse { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponseAmino { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCodeResponseAminoMsg { + type: "wasm/QueryContractsByCodeResponse"; + value: QueryContractsByCodeResponseAmino; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequest { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; + value: Uint8Array; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllContractStateRequestAminoMsg { + type: "wasm/QueryAllContractStateRequest"; + value: QueryAllContractStateRequestAmino; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponse { + models: Model[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; + value: Uint8Array; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponseAmino { + models: ModelAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllContractStateResponseAminoMsg { + type: "wasm/QueryAllContractStateResponse"; + value: QueryAllContractStateResponseAmino; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequest { + /** address is the address of the contract */ + address: string; + queryData: Uint8Array; +} +export interface QueryRawContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest"; + value: Uint8Array; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + query_data: string; +} +export interface QueryRawContractStateRequestAminoMsg { + type: "wasm/QueryRawContractStateRequest"; + value: QueryRawContractStateRequestAmino; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponse { + /** Data contains the raw store data */ + data: Uint8Array; +} +export interface QueryRawContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse"; + value: Uint8Array; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponseAmino { + /** Data contains the raw store data */ + data: string; +} +export interface QueryRawContractStateResponseAminoMsg { + type: "wasm/QueryRawContractStateResponse"; + value: QueryRawContractStateResponseAmino; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequest { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + queryData: Uint8Array; +} +export interface QuerySmartContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest"; + value: Uint8Array; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + query_data: any; +} +export interface QuerySmartContractStateRequestAminoMsg { + type: "wasm/QuerySmartContractStateRequest"; + value: QuerySmartContractStateRequestAmino; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponse { + /** Data contains the json data returned from the smart contract */ + data: Uint8Array; +} +export interface QuerySmartContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse"; + value: Uint8Array; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponseAmino { + /** Data contains the json data returned from the smart contract */ + data: any; +} +export interface QuerySmartContractStateResponseAminoMsg { + type: "wasm/QuerySmartContractStateResponse"; + value: QuerySmartContractStateResponseAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; +} +export interface QueryCodeRequestAminoMsg { + type: "wasm/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; +} +export interface QueryCodeInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest"; + value: Uint8Array; +} +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; +} +export interface QueryCodeInfoRequestAminoMsg { + type: "wasm/QueryCodeInfoRequest"; + value: QueryCodeInfoRequestAmino; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponse { + codeId: bigint; + creator: string; + checksum: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface QueryCodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse"; + value: Uint8Array; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponseAmino { + code_id: string; + creator: string; + checksum: string; + instantiate_permission: AccessConfigAmino; +} +export interface QueryCodeInfoResponseAminoMsg { + type: "wasm/QueryCodeInfoResponse"; + value: QueryCodeInfoResponseAmino; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponse { + codeId: bigint; + creator: string; + dataHash: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface CodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse"; + value: Uint8Array; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponseAmino { + code_id: string; + creator: string; + data_hash: string; + instantiate_permission: AccessConfigAmino; +} +export interface CodeInfoResponseAminoMsg { + type: "wasm/CodeInfoResponse"; + value: CodeInfoResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponse { + codeInfo?: CodeInfoResponse; + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponseAmino { + code_info?: CodeInfoResponseAmino; + data: string; +} +export interface QueryCodeResponseAminoMsg { + type: "wasm/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; + value: Uint8Array; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryCodesRequestAminoMsg { + type: "wasm/QueryCodesRequest"; + value: QueryCodesRequestAmino; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponse { + codeInfos: CodeInfoResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; + value: Uint8Array; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponseAmino { + code_infos: CodeInfoResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryCodesResponseAminoMsg { + type: "wasm/QueryCodesResponse"; + value: QueryCodesResponseAmino; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryPinnedCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; + value: Uint8Array; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryPinnedCodesRequestAminoMsg { + type: "wasm/QueryPinnedCodesRequest"; + value: QueryPinnedCodesRequestAmino; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponse { + codeIds: bigint[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryPinnedCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; + value: Uint8Array; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponseAmino { + code_ids: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryPinnedCodesResponseAminoMsg { + type: "wasm/QueryPinnedCodesResponse"; + value: QueryPinnedCodesResponseAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.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; +} +/** 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.wasm.v1.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; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequest { + /** CreatorAddress is the address of contract creator */ + creatorAddress: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCreatorRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequestAmino { + /** CreatorAddress is the address of contract creator */ + creator_address: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCreatorRequestAminoMsg { + type: "wasm/QueryContractsByCreatorRequest"; + value: QueryContractsByCreatorRequestAmino; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponse { + /** ContractAddresses result set */ + contractAddresses: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCreatorResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponseAmino { + /** ContractAddresses result set */ + contract_addresses: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCreatorResponseAminoMsg { + type: "wasm/QueryContractsByCreatorResponse"; + value: QueryContractsByCreatorResponseAmino; +} +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequest {} +export interface QueryWasmLimitsConfigRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequestAmino {} +export interface QueryWasmLimitsConfigRequestAminoMsg { + type: "wasm/QueryWasmLimitsConfigRequest"; + value: QueryWasmLimitsConfigRequestAmino; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponse { + config: string; +} +export interface QueryWasmLimitsConfigResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponseAmino { + config: string; +} +export interface QueryWasmLimitsConfigResponseAminoMsg { + type: "wasm/QueryWasmLimitsConfigResponse"; + value: QueryWasmLimitsConfigResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { + return { + address: "" + }; +} +export const QueryContractInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + aminoType: "wasm/QueryContractInfoRequest", + is(o: any): o is QueryContractInfoRequest { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractInfoRequestAmino { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryContractInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoRequest(); + 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: DeepPartial): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryContractInfoRequestAmino): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryContractInfoRequest): QueryContractInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryContractInfoRequestAminoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestAminoMsg { + return { + type: "wasm/QueryContractInfoRequest", + value: QueryContractInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoRequestProtoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.decode(message.value); + }, + toProto(message: QueryContractInfoRequest): Uint8Array { + return QueryContractInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + value: QueryContractInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractInfoRequest.typeUrl, QueryContractInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoRequest.aminoType, QueryContractInfoRequest.typeUrl); +function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { + return { + address: "", + contractInfo: ContractInfo.fromPartial({}) + }; +} +export const QueryContractInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + aminoType: "wasm/QueryContractInfoResponse", + is(o: any): o is QueryContractInfoResponse { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.is(o.contractInfo)); + }, + isAmino(o: any): o is QueryContractInfoResponseAmino { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.isAmino(o.contract_info)); + }, + encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + message.address = object.address ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + return message; + }, + fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; + }, + toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.toAmino(ContractInfo.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseAminoMsg { + return { + type: "wasm/QueryContractInfoResponse", + value: QueryContractInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoResponseProtoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.decode(message.value); + }, + toProto(message: QueryContractInfoResponse): Uint8Array { + return QueryContractInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + value: QueryContractInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractInfoResponse.typeUrl, QueryContractInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoResponse.aminoType, QueryContractInfoResponse.typeUrl); +function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryContractHistoryRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + aminoType: "wasm/QueryContractHistoryRequest", + is(o: any): o is QueryContractHistoryRequest { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractHistoryRequestAmino { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryContractHistoryRequest, 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): QueryContractHistoryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryRequest(); + 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: DeepPartial): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + 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: QueryContractHistoryRequest): QueryContractHistoryRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryRequestAminoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestAminoMsg { + return { + type: "wasm/QueryContractHistoryRequest", + value: QueryContractHistoryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryRequestProtoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.decode(message.value); + }, + toProto(message: QueryContractHistoryRequest): Uint8Array { + return QueryContractHistoryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + value: QueryContractHistoryRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractHistoryRequest.typeUrl, QueryContractHistoryRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryRequest.aminoType, QueryContractHistoryRequest.typeUrl); +function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { + return { + entries: [], + pagination: undefined + }; +} +export const QueryContractHistoryResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + aminoType: "wasm/QueryContractHistoryResponse", + is(o: any): o is QueryContractHistoryResponse { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is QueryContractHistoryResponseAmino { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.isAmino(o.entries[0]))); + }, + encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + ContractCodeHistoryEntry.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): QueryContractHistoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(ContractCodeHistoryEntry.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: DeepPartial): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractHistoryResponse): QueryContractHistoryResponseAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? ContractCodeHistoryEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryResponseAminoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseAminoMsg { + return { + type: "wasm/QueryContractHistoryResponse", + value: QueryContractHistoryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryResponseProtoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.decode(message.value); + }, + toProto(message: QueryContractHistoryResponse): Uint8Array { + return QueryContractHistoryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + value: QueryContractHistoryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractHistoryResponse.typeUrl, QueryContractHistoryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryResponse.aminoType, QueryContractHistoryResponse.typeUrl); +function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { + return { + codeId: BigInt(0), + pagination: undefined + }; +} +export const QueryContractsByCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + aminoType: "wasm/QueryContractsByCodeRequest", + is(o: any): o is QueryContractsByCodeRequest { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryContractsByCodeRequestAmino { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryContractsByCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeRequestAmino): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeRequestAminoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAminoMsg { + return { + type: "wasm/QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeRequestProtoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.decode(message.value); + }, + toProto(message: QueryContractsByCodeRequest): Uint8Array { + return QueryContractsByCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCodeRequest.typeUrl, QueryContractsByCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeRequest.aminoType, QueryContractsByCodeRequest.typeUrl); +function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { + return { + contracts: [], + pagination: undefined + }; +} +export const QueryContractsByCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + aminoType: "wasm/QueryContractsByCodeResponse", + is(o: any): o is QueryContractsByCodeResponse { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCodeResponseAmino { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + encode(message: QueryContractsByCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + 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): QueryContractsByCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeResponseAmino): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeResponseAminoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAminoMsg { + return { + type: "wasm/QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeResponseProtoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.decode(message.value); + }, + toProto(message: QueryContractsByCodeResponse): Uint8Array { + return QueryContractsByCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCodeResponse.typeUrl, QueryContractsByCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeResponse.aminoType, QueryContractsByCodeResponse.typeUrl); +function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAllContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + aminoType: "wasm/QueryAllContractStateRequest", + is(o: any): o is QueryAllContractStateRequest { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAllContractStateRequestAmino { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryAllContractStateRequest, 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): QueryAllContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateRequest(); + 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: DeepPartial): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateRequestAmino): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + 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: QueryAllContractStateRequest): QueryAllContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateRequestAminoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestAminoMsg { + return { + type: "wasm/QueryAllContractStateRequest", + value: QueryAllContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateRequestProtoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.decode(message.value); + }, + toProto(message: QueryAllContractStateRequest): Uint8Array { + return QueryAllContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + value: QueryAllContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllContractStateRequest.typeUrl, QueryAllContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateRequest.aminoType, QueryAllContractStateRequest.typeUrl); +function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { + return { + models: [], + pagination: undefined + }; +} +export const QueryAllContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + aminoType: "wasm/QueryAllContractStateResponse", + is(o: any): o is QueryAllContractStateResponse { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.is(o.models[0]))); + }, + isAmino(o: any): o is QueryAllContractStateResponseAmino { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.isAmino(o.models[0]))); + }, + encode(message: QueryAllContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.models) { + Model.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): QueryAllContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.models.push(Model.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: DeepPartial): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateResponseAmino): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllContractStateResponse): QueryAllContractStateResponseAmino { + const obj: any = {}; + if (message.models) { + obj.models = message.models.map(e => e ? Model.toAmino(e) : undefined); + } else { + obj.models = message.models; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateResponseAminoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseAminoMsg { + return { + type: "wasm/QueryAllContractStateResponse", + value: QueryAllContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateResponseProtoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.decode(message.value); + }, + toProto(message: QueryAllContractStateResponse): Uint8Array { + return QueryAllContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + value: QueryAllContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllContractStateResponse.typeUrl, QueryAllContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateResponse.aminoType, QueryAllContractStateResponse.typeUrl); +function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QueryRawContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + aminoType: "wasm/QueryRawContractStateRequest", + is(o: any): o is QueryRawContractStateRequest { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isAmino(o: any): o is QueryRawContractStateRequestAmino { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + encode(message: QueryRawContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateRequestAmino): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = bytesFromBase64(object.query_data); + } + return message; + }, + toAmino(message: QueryRawContractStateRequest): QueryRawContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? base64FromBytes(message.queryData) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateRequestAminoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestAminoMsg { + return { + type: "wasm/QueryRawContractStateRequest", + value: QueryRawContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateRequestProtoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.decode(message.value); + }, + toProto(message: QueryRawContractStateRequest): Uint8Array { + return QueryRawContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + value: QueryRawContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRawContractStateRequest.typeUrl, QueryRawContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateRequest.aminoType, QueryRawContractStateRequest.typeUrl); +function createBaseQueryRawContractStateResponse(): QueryRawContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QueryRawContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + aminoType: "wasm/QueryRawContractStateResponse", + is(o: any): o is QueryRawContractStateResponse { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryRawContractStateResponseAmino { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QueryRawContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateResponse(); + 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: DeepPartial): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateResponseAmino): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryRawContractStateResponse): QueryRawContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateResponseAminoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseAminoMsg { + return { + type: "wasm/QueryRawContractStateResponse", + value: QueryRawContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateResponseProtoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.decode(message.value); + }, + toProto(message: QueryRawContractStateResponse): Uint8Array { + return QueryRawContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + value: QueryRawContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRawContractStateResponse.typeUrl, QueryRawContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateResponse.aminoType, QueryRawContractStateResponse.typeUrl); +function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QuerySmartContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + aminoType: "wasm/QuerySmartContractStateRequest", + is(o: any): o is QuerySmartContractStateRequest { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isAmino(o: any): o is QuerySmartContractStateRequestAmino { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + encode(message: QuerySmartContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateRequestAmino): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = toUtf8(JSON.stringify(object.query_data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? JSON.parse(fromUtf8(message.queryData)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateRequestAminoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAminoMsg { + return { + type: "wasm/QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateRequestProtoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.decode(message.value); + }, + toProto(message: QuerySmartContractStateRequest): Uint8Array { + return QuerySmartContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySmartContractStateRequest.typeUrl, QuerySmartContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateRequest.aminoType, QuerySmartContractStateRequest.typeUrl); +function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QuerySmartContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + aminoType: "wasm/QuerySmartContractStateResponse", + is(o: any): o is QuerySmartContractStateResponse { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QuerySmartContractStateResponseAmino { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QuerySmartContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateResponse(); + 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: DeepPartial): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateResponseAmino): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = toUtf8(JSON.stringify(object.data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? JSON.parse(fromUtf8(message.data)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateResponseAminoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAminoMsg { + return { + type: "wasm/QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateResponseProtoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.decode(message.value); + }, + toProto(message: QuerySmartContractStateResponse): Uint8Array { + return QuerySmartContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySmartContractStateResponse.typeUrl, QuerySmartContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateResponse.aminoType, QuerySmartContractStateResponse.typeUrl); +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest", + aminoType: "wasm/QueryCodeRequest", + is(o: any): o is QueryCodeRequest { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryCodeRequestAmino { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + 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.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "wasm/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: "/cosmwasm.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeRequest.typeUrl, QueryCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeRequest.aminoType, QueryCodeRequest.typeUrl); +function createBaseQueryCodeInfoRequest(): QueryCodeInfoRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + aminoType: "wasm/QueryCodeInfoRequest", + is(o: any): o is QueryCodeInfoRequest { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryCodeInfoRequestAmino { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryCodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeInfoRequestAmino): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeInfoRequest): QueryCodeInfoRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeInfoRequestAminoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestAminoMsg { + return { + type: "wasm/QueryCodeInfoRequest", + value: QueryCodeInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoRequestProtoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.decode(message.value); + }, + toProto(message: QueryCodeInfoRequest): Uint8Array { + return QueryCodeInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + value: QueryCodeInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoRequest.typeUrl, QueryCodeInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoRequest.aminoType, QueryCodeInfoRequest.typeUrl); +function createBaseQueryCodeInfoResponse(): QueryCodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + checksum: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const QueryCodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + aminoType: "wasm/QueryCodeInfoResponse", + is(o: any): o is QueryCodeInfoResponse { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is QueryCodeInfoResponseAmino { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, + encode(message: QueryCodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: QueryCodeInfoResponseAmino): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: QueryCodeInfoResponse): QueryCodeInfoResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryCodeInfoResponseAminoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseAminoMsg { + return { + type: "wasm/QueryCodeInfoResponse", + value: QueryCodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoResponseProtoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.decode(message.value); + }, + toProto(message: QueryCodeInfoResponse): Uint8Array { + return QueryCodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + value: QueryCodeInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoResponse.typeUrl, QueryCodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoResponse.aminoType, QueryCodeInfoResponse.typeUrl); +function createBaseCodeInfoResponse(): CodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + dataHash: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const CodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + aminoType: "wasm/CodeInfoResponse", + is(o: any): o is CodeInfoResponse { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is CodeInfoResponseAmino { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, + encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.dataHash.length !== 0) { + writer.uint32(26).bytes(message.dataHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.dataHash = reader.bytes(); + break; + case 6: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.dataHash = object.dataHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeInfoResponse): CodeInfoResponseAmino { + const obj: any = {}; + 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) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { + return CodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfoResponse): CodeInfoResponseAminoMsg { + return { + type: "wasm/CodeInfoResponse", + value: CodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoResponseProtoMsg): CodeInfoResponse { + return CodeInfoResponse.decode(message.value); + }, + toProto(message: CodeInfoResponse): Uint8Array { + return CodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: CodeInfoResponse): CodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + value: CodeInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CodeInfoResponse.typeUrl, CodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfoResponse.aminoType, CodeInfoResponse.typeUrl); +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + codeInfo: undefined, + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse", + aminoType: "wasm/QueryCodeResponse", + is(o: any): o is QueryCodeResponse { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryCodeResponseAmino { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.data.length !== 0) { + writer.uint32(18).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.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfoResponse.fromPartial(object.codeInfo) : undefined; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : ""; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "wasm/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: "/cosmwasm.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeResponse.typeUrl, QueryCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeResponse.aminoType, QueryCodeResponse.typeUrl); +function createBaseQueryCodesRequest(): QueryCodesRequest { + return { + pagination: undefined + }; +} +export const QueryCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + aminoType: "wasm/QueryCodesRequest", + is(o: any): o is QueryCodesRequest { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryCodesRequestAmino { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + encode(message: QueryCodesRequest, 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): QueryCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesRequest(); + 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: DeepPartial): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesRequestAmino): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesRequest): QueryCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesRequestAminoMsg): QueryCodesRequest { + return QueryCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesRequest): QueryCodesRequestAminoMsg { + return { + type: "wasm/QueryCodesRequest", + value: QueryCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesRequestProtoMsg): QueryCodesRequest { + return QueryCodesRequest.decode(message.value); + }, + toProto(message: QueryCodesRequest): Uint8Array { + return QueryCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesRequest): QueryCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + value: QueryCodesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodesRequest.typeUrl, QueryCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesRequest.aminoType, QueryCodesRequest.typeUrl); +function createBaseQueryCodesResponse(): QueryCodesResponse { + return { + codeInfos: [], + pagination: undefined + }; +} +export const QueryCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + aminoType: "wasm/QueryCodesResponse", + is(o: any): o is QueryCodesResponse { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.codeInfos) && (!o.codeInfos.length || CodeInfoResponse.is(o.codeInfos[0]))); + }, + isAmino(o: any): o is QueryCodesResponseAmino { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.code_infos) && (!o.code_infos.length || CodeInfoResponse.isAmino(o.code_infos[0]))); + }, + encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.codeInfos) { + CodeInfoResponse.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): QueryCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfos.push(CodeInfoResponse.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: DeepPartial): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.codeInfos?.map(e => CodeInfoResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesResponse): QueryCodesResponseAmino { + const obj: any = {}; + if (message.codeInfos) { + obj.code_infos = message.codeInfos.map(e => e ? CodeInfoResponse.toAmino(e) : undefined); + } else { + obj.code_infos = message.codeInfos; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesResponseAminoMsg): QueryCodesResponse { + return QueryCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesResponse): QueryCodesResponseAminoMsg { + return { + type: "wasm/QueryCodesResponse", + value: QueryCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesResponseProtoMsg): QueryCodesResponse { + return QueryCodesResponse.decode(message.value); + }, + toProto(message: QueryCodesResponse): Uint8Array { + return QueryCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesResponse): QueryCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + value: QueryCodesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodesResponse.typeUrl, QueryCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesResponse.aminoType, QueryCodesResponse.typeUrl); +function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { + return { + pagination: undefined + }; +} +export const QueryPinnedCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + aminoType: "wasm/QueryPinnedCodesRequest", + is(o: any): o is QueryPinnedCodesRequest { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPinnedCodesRequestAmino { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + encode(message: QueryPinnedCodesRequest, 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): QueryPinnedCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesRequest(); + 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: DeepPartial): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesRequestAmino): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesRequestAminoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAminoMsg { + return { + type: "wasm/QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesRequestProtoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.decode(message.value); + }, + toProto(message: QueryPinnedCodesRequest): Uint8Array { + return QueryPinnedCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPinnedCodesRequest.typeUrl, QueryPinnedCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesRequest.aminoType, QueryPinnedCodesRequest.typeUrl); +function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { + return { + codeIds: [], + pagination: undefined + }; +} +export const QueryPinnedCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + aminoType: "wasm/QueryPinnedCodesResponse", + is(o: any): o is QueryPinnedCodesResponse { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is QueryPinnedCodesResponseAmino { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + encode(message: QueryPinnedCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesResponse(); + 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.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesResponseAmino): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAmino { + const obj: any = {}; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesResponseAminoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAminoMsg { + return { + type: "wasm/QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesResponseProtoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.decode(message.value); + }, + toProto(message: QueryPinnedCodesResponse): Uint8Array { + return QueryPinnedCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPinnedCodesResponse.typeUrl, QueryPinnedCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesResponse.aminoType, QueryPinnedCodesResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest", + aminoType: "wasm/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.wasm.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse", + aminoType: "wasm/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.wasm.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { + return { + creatorAddress: "", + pagination: undefined + }; +} +export const QueryContractsByCreatorRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + aminoType: "wasm/QueryContractsByCreatorRequest", + is(o: any): o is QueryContractsByCreatorRequest { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creatorAddress === "string"); + }, + isAmino(o: any): o is QueryContractsByCreatorRequestAmino { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creator_address === "string"); + }, + encode(message: QueryContractsByCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creatorAddress !== "") { + writer.uint32(10).string(message.creatorAddress); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creatorAddress = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + message.creatorAddress = object.creatorAddress ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorRequestAmino): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAmino { + const obj: any = {}; + obj.creator_address = message.creatorAddress === "" ? undefined : message.creatorAddress; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorRequestAminoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAminoMsg { + return { + type: "wasm/QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorRequestProtoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.decode(message.value); + }, + toProto(message: QueryContractsByCreatorRequest): Uint8Array { + return QueryContractsByCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCreatorRequest.typeUrl, QueryContractsByCreatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorRequest.aminoType, QueryContractsByCreatorRequest.typeUrl); +function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { + return { + contractAddresses: [], + pagination: undefined + }; +} +export const QueryContractsByCreatorResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + aminoType: "wasm/QueryContractsByCreatorResponse", + is(o: any): o is QueryContractsByCreatorResponse { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contractAddresses) && (!o.contractAddresses.length || typeof o.contractAddresses[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCreatorResponseAmino { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contract_addresses) && (!o.contract_addresses.length || typeof o.contract_addresses[0] === "string")); + }, + encode(message: QueryContractsByCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contractAddresses) { + 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): QueryContractsByCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddresses.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contractAddresses?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorResponseAmino): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAmino { + const obj: any = {}; + if (message.contractAddresses) { + obj.contract_addresses = message.contractAddresses.map(e => e); + } else { + obj.contract_addresses = message.contractAddresses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorResponseAminoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAminoMsg { + return { + type: "wasm/QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorResponseProtoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.decode(message.value); + }, + toProto(message: QueryContractsByCreatorResponse): Uint8Array { + return QueryContractsByCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCreatorResponse.typeUrl, QueryContractsByCreatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorResponse.aminoType, QueryContractsByCreatorResponse.typeUrl); +function createBaseQueryWasmLimitsConfigRequest(): QueryWasmLimitsConfigRequest { + return {}; +} +export const QueryWasmLimitsConfigRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + aminoType: "wasm/QueryWasmLimitsConfigRequest", + is(o: any): o is QueryWasmLimitsConfigRequest { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + isAmino(o: any): o is QueryWasmLimitsConfigRequestAmino { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + encode(_: QueryWasmLimitsConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + fromAmino(_: QueryWasmLimitsConfigRequestAmino): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + toAmino(_: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigRequestAminoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigRequestProtoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigRequest): Uint8Array { + return QueryWasmLimitsConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigRequest.typeUrl, QueryWasmLimitsConfigRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigRequest.aminoType, QueryWasmLimitsConfigRequest.typeUrl); +function createBaseQueryWasmLimitsConfigResponse(): QueryWasmLimitsConfigResponse { + return { + config: "" + }; +} +export const QueryWasmLimitsConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + aminoType: "wasm/QueryWasmLimitsConfigResponse", + is(o: any): o is QueryWasmLimitsConfigResponse { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + isAmino(o: any): o is QueryWasmLimitsConfigResponseAmino { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + encode(message: QueryWasmLimitsConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.config !== "") { + writer.uint32(10).string(message.config); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + message.config = object.config ?? ""; + return message; + }, + fromAmino(object: QueryWasmLimitsConfigResponseAmino): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = object.config; + } + return message; + }, + toAmino(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAmino { + const obj: any = {}; + obj.config = message.config === "" ? undefined : message.config; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigResponseAminoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigResponseProtoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigResponse): Uint8Array { + return QueryWasmLimitsConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigResponse.typeUrl, QueryWasmLimitsConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigResponse.aminoType, QueryWasmLimitsConfigResponse.typeUrl); +function createBaseQueryBuildAddressRequest(): QueryBuildAddressRequest { + return { + codeHash: "", + creatorAddress: "", + salt: "", + initArgs: new Uint8Array() + }; +} +export const QueryBuildAddressRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest", + aminoType: "wasm/QueryBuildAddressRequest", + is(o: any): o is QueryBuildAddressRequest { + return o && (o.$typeUrl === QueryBuildAddressRequest.typeUrl || typeof o.codeHash === "string" && typeof o.creatorAddress === "string" && typeof o.salt === "string" && (o.initArgs instanceof Uint8Array || typeof o.initArgs === "string")); + }, + isAmino(o: any): o is QueryBuildAddressRequestAmino { + return o && (o.$typeUrl === QueryBuildAddressRequest.typeUrl || typeof o.code_hash === "string" && typeof o.creator_address === "string" && typeof o.salt === "string" && (o.init_args instanceof Uint8Array || typeof o.init_args === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryBuildAddressRequest.typeUrl, QueryBuildAddressRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBuildAddressRequest.aminoType, QueryBuildAddressRequest.typeUrl); +function createBaseQueryBuildAddressResponse(): QueryBuildAddressResponse { + return { + address: "" + }; +} +export const QueryBuildAddressResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse", + aminoType: "wasm/QueryBuildAddressResponse", + is(o: any): o is QueryBuildAddressResponse { + return o && (o.$typeUrl === QueryBuildAddressResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryBuildAddressResponseAmino { + return o && (o.$typeUrl === QueryBuildAddressResponse.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryBuildAddressResponse.typeUrl, QueryBuildAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBuildAddressResponse.aminoType, QueryBuildAddressResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/injective-query/src/cosmwasm/wasm/v1/tx.rpc.func.ts new file mode 100644 index 00000000..82a34fc7 --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -0,0 +1,157 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreCode.typeUrl, + encoders: toEncoders(MsgStoreCode), + converters: toConverters(MsgStoreCode) +}); +export const useStoreCode = buildUseMutation({ + builderMutationFn: createStoreCode +}); +export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract.typeUrl, + encoders: toEncoders(MsgInstantiateContract), + converters: toConverters(MsgInstantiateContract) +}); +export const useInstantiateContract = buildUseMutation({ + builderMutationFn: createInstantiateContract +}); +export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract2.typeUrl, + encoders: toEncoders(MsgInstantiateContract2), + converters: toConverters(MsgInstantiateContract2) +}); +export const useInstantiateContract2 = buildUseMutation({ + builderMutationFn: createInstantiateContract2 +}); +export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContract.typeUrl, + encoders: toEncoders(MsgExecuteContract), + converters: toConverters(MsgExecuteContract) +}); +export const useExecuteContract = buildUseMutation({ + builderMutationFn: createExecuteContract +}); +export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMigrateContract.typeUrl, + encoders: toEncoders(MsgMigrateContract), + converters: toConverters(MsgMigrateContract) +}); +export const useMigrateContract = buildUseMutation({ + builderMutationFn: createMigrateContract +}); +export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateAdmin.typeUrl, + encoders: toEncoders(MsgUpdateAdmin), + converters: toConverters(MsgUpdateAdmin) +}); +export const useUpdateAdmin = buildUseMutation({ + builderMutationFn: createUpdateAdmin +}); +export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClearAdmin.typeUrl, + encoders: toEncoders(MsgClearAdmin), + converters: toConverters(MsgClearAdmin) +}); +export const useClearAdmin = buildUseMutation({ + builderMutationFn: createClearAdmin +}); +export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateInstantiateConfig.typeUrl, + encoders: toEncoders(MsgUpdateInstantiateConfig), + converters: toConverters(MsgUpdateInstantiateConfig) +}); +export const useUpdateInstantiateConfig = buildUseMutation({ + builderMutationFn: createUpdateInstantiateConfig +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSudoContract.typeUrl, + encoders: toEncoders(MsgSudoContract), + converters: toConverters(MsgSudoContract) +}); +export const useSudoContract = buildUseMutation({ + builderMutationFn: createSudoContract +}); +export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPinCodes.typeUrl, + encoders: toEncoders(MsgPinCodes), + converters: toConverters(MsgPinCodes) +}); +export const usePinCodes = buildUseMutation({ + builderMutationFn: createPinCodes +}); +export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnpinCodes.typeUrl, + encoders: toEncoders(MsgUnpinCodes), + converters: toConverters(MsgUnpinCodes) +}); +export const useUnpinCodes = buildUseMutation({ + builderMutationFn: createUnpinCodes +}); +export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndInstantiateContract.typeUrl, + encoders: toEncoders(MsgStoreAndInstantiateContract), + converters: toConverters(MsgStoreAndInstantiateContract) +}); +export const useStoreAndInstantiateContract = buildUseMutation({ + builderMutationFn: createStoreAndInstantiateContract +}); +export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgRemoveCodeUploadParamsAddresses), + converters: toConverters(MsgRemoveCodeUploadParamsAddresses) +}); +export const useRemoveCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createRemoveCodeUploadParamsAddresses +}); +export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgAddCodeUploadParamsAddresses), + converters: toConverters(MsgAddCodeUploadParamsAddresses) +}); +export const useAddCodeUploadParamsAddresses = buildUseMutation({ + builderMutationFn: createAddCodeUploadParamsAddresses +}); +export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndMigrateContract.typeUrl, + encoders: toEncoders(MsgStoreAndMigrateContract), + converters: toConverters(MsgStoreAndMigrateContract) +}); +export const useStoreAndMigrateContract = buildUseMutation({ + builderMutationFn: createStoreAndMigrateContract +}); +export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContractLabel.typeUrl, + encoders: toEncoders(MsgUpdateContractLabel), + converters: toConverters(MsgUpdateContractLabel) +}); +export const useUpdateContractLabel = buildUseMutation({ + builderMutationFn: createUpdateContractLabel +}); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/tx.ts b/libs/injective-query/src/cosmwasm/wasm/v1/tx.ts new file mode 100644 index 00000000..c97c9907 --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/tx.ts @@ -0,0 +1,4191 @@ +import { AccessConfig, AccessConfigAmino, Params, ParamsAmino } from "./types"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiatePermission?: AccessConfig; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeAmino { + /** Sender is the actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code: string; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface MsgStoreCodeAminoMsg { + type: "wasm/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Checksum is the sha256 hash of the stored code */ + checksum: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "wasm/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContract { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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 MsgInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract"; + value: Uint8Array; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractAmino { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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 MsgInstantiateContractAminoMsg { + type: "wasm/MsgInstantiateContract"; + value: MsgInstantiateContractAmino; +} +/** 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; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predictable address. + */ +export interface MsgInstantiateContract2 { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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[]; + /** 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 MsgInstantiateContract2ProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2"; + value: Uint8Array; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predictable address. + */ +export interface MsgInstantiateContract2Amino { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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[]; + /** 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 MsgInstantiateContract2AminoMsg { + type: "wasm/MsgInstantiateContract2"; + value: MsgInstantiateContract2Amino; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2Response { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContract2ResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response"; + value: Uint8Array; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgInstantiateContract2ResponseAminoMsg { + type: "wasm/MsgInstantiateContract2Response"; + value: MsgInstantiateContract2ResponseAmino; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on execution */ + funds: Coin[]; +} +export interface MsgExecuteContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract"; + value: Uint8Array; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: any; + /** Funds coins that are transferred to the contract on execution */ + funds: CoinAmino[]; +} +export interface MsgExecuteContractAminoMsg { + type: "wasm/MsgExecuteContract"; + value: MsgExecuteContractAmino; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse"; + value: Uint8Array; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgExecuteContractResponseAminoMsg { + type: "wasm/MsgExecuteContractResponse"; + value: MsgExecuteContractResponseAmino; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: 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 MsgMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractAmino { + /** Sender is the that actor that signed the messages */ + sender: 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 MsgMigrateContractAminoMsg { + type: "wasm/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseAmino { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: string; +} +export interface MsgMigrateContractResponseAminoMsg { + type: "wasm/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin"; + value: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + new_admin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateAdminAminoMsg { + type: "wasm/MsgUpdateAdmin"; + value: MsgUpdateAdminAmino; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseAmino {} +export interface MsgUpdateAdminResponseAminoMsg { + type: "wasm/MsgUpdateAdminResponse"; + value: MsgUpdateAdminResponseAmino; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgClearAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin"; + value: Uint8Array; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminAmino { + /** Sender is the actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgClearAdminAminoMsg { + type: "wasm/MsgClearAdmin"; + value: MsgClearAdminAmino; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse"; + value: Uint8Array; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseAmino {} +export interface MsgClearAdminResponseAminoMsg { + type: "wasm/MsgClearAdminResponse"; + value: MsgClearAdminResponseAmino; +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfig { + /** Sender is the that actor that signed the messages */ + sender: string; + /** CodeID references the stored WASM code */ + codeId: bigint; + /** NewInstantiatePermission is the new access control */ + newInstantiatePermission?: AccessConfig; +} +export interface MsgUpdateInstantiateConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; + value: Uint8Array; +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfigAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** CodeID references the stored WASM code */ + code_id: string; + /** NewInstantiatePermission is the new access control */ + new_instantiate_permission?: AccessConfigAmino; +} +export interface MsgUpdateInstantiateConfigAminoMsg { + type: "wasm/MsgUpdateInstantiateConfig"; + value: MsgUpdateInstantiateConfigAmino; +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponse {} +export interface MsgUpdateInstantiateConfigResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse"; + value: Uint8Array; +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponseAmino {} +export interface MsgUpdateInstantiateConfigResponseAminoMsg { + type: "wasm/MsgUpdateInstantiateConfigResponse"; + value: MsgUpdateInstantiateConfigResponseAmino; +} +/** + * 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 interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * 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 interface MsgUpdateParamsAminoMsg { + type: "wasm/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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 contract 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 contract 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + aminoType: "wasm/MsgStoreCode", + is(o: any): o is MsgStoreCode { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string")); + }, + isAmino(o: any): o is MsgStoreCodeAmino { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCode.typeUrl, MsgStoreCode); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCode.aminoType, MsgStoreCode.typeUrl); +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + aminoType: "wasm/MsgStoreCodeResponse", + is(o: any): o is MsgStoreCodeResponse { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isAmino(o: any): o is MsgStoreCodeResponseAmino { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCodeResponse.typeUrl, MsgStoreCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCodeResponse.aminoType, MsgStoreCodeResponse.typeUrl); +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + aminoType: "wasm/MsgInstantiateContract", + is(o: any): o is MsgInstantiateContract { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is MsgInstantiateContractAmino { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract.typeUrl, MsgInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract.aminoType, MsgInstantiateContract.typeUrl); +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + aminoType: "wasm/MsgInstantiateContractResponse", + is(o: any): o is MsgInstantiateContractResponse { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContractResponse.typeUrl, MsgInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContractResponse.aminoType, MsgInstantiateContractResponse.typeUrl); +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", + aminoType: "wasm/MsgInstantiateContract2", + is(o: any): o is MsgInstantiateContract2 { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isAmino(o: any): o is MsgInstantiateContract2Amino { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + 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); + } + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2.typeUrl, MsgInstantiateContract2); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2.aminoType, MsgInstantiateContract2.typeUrl); +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + aminoType: "wasm/MsgInstantiateContract2Response", + is(o: any): o is MsgInstantiateContract2Response { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContract2ResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2Response.typeUrl, MsgInstantiateContract2Response); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2Response.aminoType, MsgInstantiateContract2Response.typeUrl); +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + aminoType: "wasm/MsgExecuteContract", + is(o: any): o is MsgExecuteContract { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is MsgExecuteContractAmino { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContract.typeUrl, MsgExecuteContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContract.aminoType, MsgExecuteContract.typeUrl); +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + aminoType: "wasm/MsgExecuteContractResponse", + is(o: any): o is MsgExecuteContractResponse { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgExecuteContractResponseAmino { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractResponse.typeUrl, MsgExecuteContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContractResponse.aminoType, MsgExecuteContractResponse.typeUrl); +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + aminoType: "wasm/MsgMigrateContract", + is(o: any): o is MsgMigrateContract { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgMigrateContractAmino { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContract.typeUrl, MsgMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContract.aminoType, MsgMigrateContract.typeUrl); +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + aminoType: "wasm/MsgMigrateContractResponse", + is(o: any): o is MsgMigrateContractResponse { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContractResponse.typeUrl, MsgMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContractResponse.aminoType, MsgMigrateContractResponse.typeUrl); +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + aminoType: "wasm/MsgUpdateAdmin", + is(o: any): o is MsgUpdateAdmin { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateAdminAmino { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdmin.typeUrl, MsgUpdateAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdmin.aminoType, MsgUpdateAdmin.typeUrl); +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + aminoType: "wasm/MsgUpdateAdminResponse", + is(o: any): o is MsgUpdateAdminResponse { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdminResponse.typeUrl, MsgUpdateAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdminResponse.aminoType, MsgUpdateAdminResponse.typeUrl); +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + aminoType: "wasm/MsgClearAdmin", + is(o: any): o is MsgClearAdmin { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgClearAdminAmino { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdmin.typeUrl, MsgClearAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdmin.aminoType, MsgClearAdmin.typeUrl); +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + aminoType: "wasm/MsgClearAdminResponse", + is(o: any): o is MsgClearAdminResponse { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgClearAdminResponseAmino { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdminResponse.typeUrl, MsgClearAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdminResponse.aminoType, MsgClearAdminResponse.typeUrl); +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { + sender: "", + codeId: BigInt(0), + newInstantiatePermission: undefined + }; +} +export const MsgUpdateInstantiateConfig = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + aminoType: "wasm/MsgUpdateInstantiateConfig", + is(o: any): o is MsgUpdateInstantiateConfig { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigAmino { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.code_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfig.typeUrl, MsgUpdateInstantiateConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfig.aminoType, MsgUpdateInstantiateConfig.typeUrl); +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} +export const MsgUpdateInstantiateConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + aminoType: "wasm/MsgUpdateInstantiateConfigResponse", + is(o: any): o is MsgUpdateInstantiateConfigResponse { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigResponseAmino { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfigResponse.typeUrl, MsgUpdateInstantiateConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfigResponse.aminoType, MsgUpdateInstantiateConfigResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + aminoType: "wasm/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + aminoType: "wasm/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + aminoType: "wasm/MsgSudoContract", + is(o: any): o is MsgSudoContract { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgSudoContractAmino { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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); + } + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSudoContract.typeUrl, MsgSudoContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContract.aminoType, MsgSudoContract.typeUrl); +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + aminoType: "wasm/MsgSudoContractResponse", + is(o: any): o is MsgSudoContractResponse { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgSudoContractResponseAmino { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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): MsgSudoContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSudoContractResponse.typeUrl, MsgSudoContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContractResponse.aminoType, MsgSudoContractResponse.typeUrl); +function createBaseMsgPinCodes(): MsgPinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + aminoType: "wasm/MsgPinCodes", + is(o: any): o is MsgPinCodes { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is MsgPinCodesAmino { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPinCodes.typeUrl, MsgPinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodes.aminoType, MsgPinCodes.typeUrl); +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + aminoType: "wasm/MsgPinCodesResponse", + is(o: any): o is MsgPinCodesResponse { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgPinCodesResponseAmino { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPinCodesResponse.typeUrl, MsgPinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodesResponse.aminoType, MsgPinCodesResponse.typeUrl); +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + aminoType: "wasm/MsgUnpinCodes", + is(o: any): o is MsgUnpinCodes { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is MsgUnpinCodesAmino { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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.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: DeepPartial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgUnpinCodesAmino): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { + 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: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { + return { + type: "wasm/MsgUnpinCodes", + value: MsgUnpinCodes.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value); + }, + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish(); + }, + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnpinCodes.typeUrl, MsgUnpinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodes.aminoType, MsgUnpinCodes.typeUrl); +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + aminoType: "wasm/MsgUnpinCodesResponse", + is(o: any): o is MsgUnpinCodesResponse { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgUnpinCodesResponseAmino { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnpinCodesResponse.typeUrl, MsgUnpinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodesResponse.aminoType, MsgUnpinCodesResponse.typeUrl); +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + aminoType: "wasm/MsgStoreAndInstantiateContract", + is(o: any): o is MsgStoreAndInstantiateContract { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); + } + 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(58).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(66).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(82).string(message.source); + } + 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): MsgStoreAndInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreAndInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 3: + message.wasmByteCode = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 5: + message.unpinCode = reader.bool(); + break; + case 6: + message.admin = reader.string(); + break; + case 7: + message.label = reader.string(); + break; + case 8: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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.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: 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.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: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { + const obj: any = {}; + 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.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: MsgStoreAndInstantiateContractAminoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoMsg { + return { + type: "wasm/MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndInstantiateContractProtoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value); + }, + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContract.typeUrl, MsgStoreAndInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContract.aminoType, MsgStoreAndInstantiateContract.typeUrl); +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + aminoType: "wasm/MsgStoreAndInstantiateContractResponse", + is(o: any): o is MsgStoreAndInstantiateContractResponse { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgStoreAndInstantiateContractResponse, 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): MsgStoreAndInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreAndInstantiateContractResponse(); + 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: DeepPartial): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreAndInstantiateContractResponseAmino): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + 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: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreAndInstantiateContractResponseAminoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndInstantiateContractResponseProtoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContractResponse.typeUrl, MsgStoreAndInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContractResponse.aminoType, MsgStoreAndInstantiateContractResponse.typeUrl); +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { + return { + authority: "", + addresses: [] + }; +} +export const MsgAddCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + is(o: any): o is MsgAddCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgAddCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.addresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + 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 = createBaseMsgAddCodeUploadParamsAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgAddCodeUploadParamsAddressesAmino): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAmino { + const obj: any = {}; + 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: MsgAddCodeUploadParamsAddressesAminoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAminoMsg { + return { + type: "wasm/MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesProtoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value); + }, + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddresses.typeUrl, MsgAddCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddresses.aminoType, MsgAddCodeUploadParamsAddresses.typeUrl); +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; +} +export const MsgAddCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgAddCodeUploadParamsAddressesResponse", + is(o: any): o is MsgAddCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgAddCodeUploadParamsAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; + }, + fromAmino(_: MsgAddCodeUploadParamsAddressesResponseAmino): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; + }, + toAmino(_: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesResponseAminoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAminoMsg { + return { + type: "wasm/MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesResponseProtoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value); + }, + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddressesResponse.typeUrl, MsgAddCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddressesResponse.aminoType, MsgAddCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { + return { + authority: "", + addresses: [] + }; +} +export const MsgRemoveCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + is(o: any): o is MsgRemoveCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.addresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + 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 = createBaseMsgRemoveCodeUploadParamsAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + 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: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAmino { + const obj: any = {}; + 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: MsgRemoveCodeUploadParamsAddressesAminoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAminoMsg { + return { + type: "wasm/MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesProtoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value); + }, + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddresses.typeUrl, MsgRemoveCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddresses.aminoType, MsgRemoveCodeUploadParamsAddresses.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; +} +export const MsgRemoveCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + is(o: any): o is MsgRemoveCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; + }, + fromAmino(_: MsgRemoveCodeUploadParamsAddressesResponseAmino): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; + }, + toAmino(_: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + return { + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value); + }, + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddressesResponse.typeUrl, MsgRemoveCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddressesResponse.aminoType, MsgRemoveCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array() + }; +} +export const MsgStoreAndMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + aminoType: "wasm/MsgStoreAndMigrateContract", + is(o: any): o is MsgStoreAndMigrateContract { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgStoreAndMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + 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(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + return writer; + }, + 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 = createBaseMsgStoreAndMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: MsgStoreAndMigrateContractAmino): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + 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.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: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAmino { + const obj: any = {}; + 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: MsgStoreAndMigrateContractAminoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAminoMsg { + return { + type: "wasm/MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndMigrateContractProtoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value); + }, + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndMigrateContract.typeUrl, MsgStoreAndMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContract.aminoType, MsgStoreAndMigrateContract.typeUrl); +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array(), + data: new Uint8Array() + }; +} +export const MsgStoreAndMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + aminoType: "wasm/MsgStoreAndMigrateContractResponse", + is(o: any): o is MsgStoreAndMigrateContractResponse { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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): MsgStoreAndMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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(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(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: MsgStoreAndMigrateContractResponseAminoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndMigrateContractResponseProtoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndMigrateContractResponse.typeUrl, MsgStoreAndMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContractResponse.aminoType, MsgStoreAndMigrateContractResponse.typeUrl); +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { + return { + sender: "", + newLabel: "", + contract: "" + }; +} +export const MsgUpdateContractLabel = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + aminoType: "wasm/MsgUpdateContractLabel", + is(o: any): o is MsgUpdateContractLabel { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.newLabel === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateContractLabelAmino { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.new_label === "string" && typeof o.contract === "string"); + }, + 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): MsgUpdateContractLabel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); + message.sender = object.sender ?? ""; + message.newLabel = object.newLabel ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + 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: 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: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { + return { + type: "wasm/MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractLabelProtoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value); + }, + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractLabel.typeUrl, MsgUpdateContractLabel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabel.aminoType, MsgUpdateContractLabel.typeUrl); +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { + return {}; +} +export const MsgUpdateContractLabelResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + aminoType: "wasm/MsgUpdateContractLabelResponse", + is(o: any): o is MsgUpdateContractLabelResponse { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateContractLabelResponseAmino { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + encode(_: MsgUpdateContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgUpdateContractLabelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; + }, + fromAmino(_: MsgUpdateContractLabelResponseAmino): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; + }, + toAmino(_: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractLabelResponseAminoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAminoMsg { + return { + type: "wasm/MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractLabelResponseProtoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value); + }, + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractLabelResponse.typeUrl, MsgUpdateContractLabelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabelResponse.aminoType, MsgUpdateContractLabelResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/cosmwasm/wasm/v1/types.ts b/libs/injective-query/src/cosmwasm/wasm/v1/types.ts new file mode 100644 index 00000000..3dccb816 --- /dev/null +++ b/libs/injective-query/src/cosmwasm/wasm/v1/types.ts @@ -0,0 +1,1120 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** AccessType permission types */ +export enum AccessType { + /** 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 AccessTypeAmino = AccessType; +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case "ACCESS_TYPE_UNSPECIFIED": + return AccessType.ACCESS_TYPE_UNSPECIFIED; + case 1: + case "ACCESS_TYPE_NOBODY": + return AccessType.ACCESS_TYPE_NOBODY; + case 3: + case "ACCESS_TYPE_EVERYBODY": + return AccessType.ACCESS_TYPE_EVERYBODY; + case 4: + case "ACCESS_TYPE_ANY_OF_ADDRESSES": + return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES; + case -1: + case "UNRECOGNIZED": + default: + return AccessType.UNRECOGNIZED; + } +} +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: + return "ACCESS_TYPE_UNSPECIFIED"; + case AccessType.ACCESS_TYPE_NOBODY: + return "ACCESS_TYPE_NOBODY"; + case AccessType.ACCESS_TYPE_EVERYBODY: + return "ACCESS_TYPE_EVERYBODY"; + case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: + return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + case AccessType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1, +} +export const ContractCodeHistoryOperationTypeAmino = ContractCodeHistoryOperationType; +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; + case 1: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; + case 2: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; + case 3: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; + case -1: + case "UNRECOGNIZED": + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED; + } +} +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + case ContractCodeHistoryOperationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** AccessTypeParam */ +export interface AccessTypeParam { + value: AccessType; +} +export interface AccessTypeParamProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam"; + value: Uint8Array; +} +/** AccessTypeParam */ +export interface AccessTypeParamAmino { + value: AccessType; +} +export interface AccessTypeParamAminoMsg { + type: "wasm/AccessTypeParam"; + value: AccessTypeParamAmino; +} +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType; + addresses: string[]; +} +export interface AccessConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; + value: Uint8Array; +} +/** AccessConfig access control type. */ +export interface AccessConfigAmino { + permission: AccessType; + addresses: string[]; +} +export interface AccessConfigAminoMsg { + type: "wasm/AccessConfig"; + value: AccessConfigAmino; +} +/** Params defines the set of wasm parameters. */ +export interface Params { + codeUploadAccess: AccessConfig; + instantiateDefaultPermission: AccessType; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of wasm parameters. */ +export interface ParamsAmino { + code_upload_access: AccessConfigAmino; + instantiate_default_permission: AccessType; +} +export interface ParamsAminoMsg { + type: "wasm/Params"; + value: ParamsAmino; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + /** CodeHash is the unique identifier created by wasmvm */ + codeHash: Uint8Array; + /** Creator address who initially stored the code */ + creator: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiateConfig: AccessConfig; +} +export interface CodeInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo"; + value: Uint8Array; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoAmino { + /** CodeHash is the unique identifier created by wasmvm */ + code_hash: string; + /** Creator address who initially stored the code */ + creator: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiate_config: AccessConfigAmino; +} +export interface CodeInfoAminoMsg { + type: "wasm/CodeInfo"; + value: CodeInfoAmino; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: bigint; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPosition; + ibcPortId: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: Any | undefined; +} +export interface ContractInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; + value: Uint8Array; +} +export type ContractInfoEncoded = Omit & { + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyProtoMsg | undefined; +}; +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoAmino { + /** CodeID is the reference to the stored Wasm code */ + code_id: string; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPositionAmino; + ibc_port_id: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyAmino; +} +export interface ContractInfoAminoMsg { + type: "wasm/ContractInfo"; + value: ContractInfoAmino; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition; + msg: Uint8Array; +} +export interface ContractCodeHistoryEntryProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry"; + value: Uint8Array; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntryAmino { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPositionAmino; + msg: any; +} +export interface ContractCodeHistoryEntryAminoMsg { + type: "wasm/ContractCodeHistoryEntry"; + value: ContractCodeHistoryEntryAmino; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: bigint; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: bigint; +} +export interface AbsoluteTxPositionProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition"; + value: Uint8Array; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionAmino { + /** BlockHeight is the block the contract was created at */ + block_height: string; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + tx_index: string; +} +export interface AbsoluteTxPositionAminoMsg { + type: "wasm/AbsoluteTxPosition"; + value: AbsoluteTxPositionAmino; +} +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + key: Uint8Array; + /** base64-encode raw value */ + value: Uint8Array; +} +export interface ModelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Model"; + value: Uint8Array; +} +/** Model is a struct that holds a KV pair */ +export interface ModelAmino { + /** hex-encode key to read it better (this is often ascii) */ + key: string; + /** base64-encode raw value */ + value: string; +} +export interface ModelAminoMsg { + type: "wasm/Model"; + value: ModelAmino; +} +function createBaseAccessTypeParam(): AccessTypeParam { + return { + value: 0 + }; +} +export const AccessTypeParam = { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + aminoType: "wasm/AccessTypeParam", + is(o: any): o is AccessTypeParam { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + isAmino(o: any): o is AccessTypeParamAmino { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTypeParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccessTypeParam { + const message = createBaseAccessTypeParam(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: AccessTypeParamAmino): AccessTypeParam { + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: AccessTypeParam): AccessTypeParamAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { + return AccessTypeParam.fromAmino(object.value); + }, + toAminoMsg(message: AccessTypeParam): AccessTypeParamAminoMsg { + return { + type: "wasm/AccessTypeParam", + value: AccessTypeParam.toAmino(message) + }; + }, + fromProtoMsg(message: AccessTypeParamProtoMsg): AccessTypeParam { + return AccessTypeParam.decode(message.value); + }, + toProto(message: AccessTypeParam): Uint8Array { + return AccessTypeParam.encode(message).finish(); + }, + toProtoMsg(message: AccessTypeParam): AccessTypeParamProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + value: AccessTypeParam.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccessTypeParam.typeUrl, AccessTypeParam); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessTypeParam.aminoType, AccessTypeParam.typeUrl); +function createBaseAccessConfig(): AccessConfig { + return { + permission: 0, + addresses: [] + }; +} +export const AccessConfig = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + aminoType: "wasm/AccessConfig", + is(o: any): o is AccessConfig { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is AccessConfigAmino { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: AccessConfig, 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): AccessConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfig(); + 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: DeepPartial): AccessConfig { + const message = createBaseAccessConfig(); + message.permission = object.permission ?? 0; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: AccessConfigAmino): AccessConfig { + const message = createBaseAccessConfig(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: AccessConfig): AccessConfigAmino { + 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: AccessConfigAminoMsg): AccessConfig { + return AccessConfig.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfig): AccessConfigAminoMsg { + return { + type: "wasm/AccessConfig", + value: AccessConfig.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigProtoMsg): AccessConfig { + return AccessConfig.decode(message.value); + }, + toProto(message: AccessConfig): Uint8Array { + return AccessConfig.encode(message).finish(); + }, + toProtoMsg(message: AccessConfig): AccessConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + value: AccessConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccessConfig.typeUrl, AccessConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfig.aminoType, AccessConfig.typeUrl); +function createBaseParams(): Params { + return { + codeUploadAccess: AccessConfig.fromPartial({}), + instantiateDefaultPermission: 0 + }; +} +export const Params = { + typeUrl: "/cosmwasm.wasm.v1.Params", + aminoType: "wasm/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.is(o.codeUploadAccess) && isSet(o.instantiateDefaultPermission)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.isAmino(o.code_upload_access) && isSet(o.instantiate_default_permission)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeUploadAccess !== undefined) { + AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); + } + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission); + } + 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.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); + break; + case 2: + message.instantiateDefaultPermission = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.codeUploadAccess = object.codeUploadAccess !== undefined && object.codeUploadAccess !== null ? AccessConfig.fromPartial(object.codeUploadAccess) : undefined; + message.instantiateDefaultPermission = object.instantiateDefaultPermission ?? 0; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.code_upload_access !== undefined && object.code_upload_access !== null) { + message.codeUploadAccess = AccessConfig.fromAmino(object.code_upload_access); + } + if (object.instantiate_default_permission !== undefined && object.instantiate_default_permission !== null) { + message.instantiateDefaultPermission = object.instantiate_default_permission; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + 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; + }, + 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.wasm.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseCodeInfo(): CodeInfo { + return { + codeHash: new Uint8Array(), + creator: "", + instantiateConfig: AccessConfig.fromPartial({}) + }; +} +export const CodeInfo = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + aminoType: "wasm/CodeInfo", + is(o: any): o is CodeInfo { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string") && typeof o.creator === "string" && AccessConfig.is(o.instantiateConfig)); + }, + isAmino(o: any): o is CodeInfoAmino { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string") && typeof o.creator === "string" && AccessConfig.isAmino(o.instantiate_config)); + }, + encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.instantiateConfig !== undefined) { + AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.creator = reader.string(); + break; + case 5: + message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CodeInfo { + const message = createBaseCodeInfo(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.creator = object.creator ?? ""; + message.instantiateConfig = object.instantiateConfig !== undefined && object.instantiateConfig !== null ? AccessConfig.fromPartial(object.instantiateConfig) : undefined; + return message; + }, + fromAmino(object: CodeInfoAmino): CodeInfo { + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.instantiate_config !== undefined && object.instantiate_config !== null) { + message.instantiateConfig = AccessConfig.fromAmino(object.instantiate_config); + } + return message; + }, + toAmino(message: CodeInfo): CodeInfoAmino { + 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) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { + return CodeInfo.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfo): CodeInfoAminoMsg { + return { + type: "wasm/CodeInfo", + value: CodeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoProtoMsg): CodeInfo { + return CodeInfo.decode(message.value); + }, + toProto(message: CodeInfo): Uint8Array { + return CodeInfo.encode(message).finish(); + }, + toProtoMsg(message: CodeInfo): CodeInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + value: CodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CodeInfo.typeUrl, CodeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfo.aminoType, CodeInfo.typeUrl); +function createBaseContractInfo(): ContractInfo { + return { + codeId: BigInt(0), + creator: "", + admin: "", + label: "", + created: undefined, + ibcPortId: "", + extension: undefined + }; +} +export const ContractInfo = { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + aminoType: "wasm/ContractInfo", + is(o: any): o is ContractInfo { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibcPortId === "string"); + }, + isAmino(o: any): o is ContractInfoAmino { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibc_port_id === "string"); + }, + encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); + } + if (message.extension !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.extension), writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 6: + message.ibcPortId = reader.string(); + break; + case 7: + message.extension = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractInfo { + const message = createBaseContractInfo(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.created = object.created !== undefined && object.created !== null ? AbsoluteTxPosition.fromPartial(object.created) : undefined; + message.ibcPortId = object.ibcPortId ?? ""; + message.extension = object.extension !== undefined && object.extension !== null ? GlobalDecoderRegistry.fromPartial(object.extension) : undefined; + return message; + }, + fromAmino(object: ContractInfoAmino): ContractInfo { + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = GlobalDecoderRegistry.fromAminoMsg(object.extension); + } + return message; + }, + toAmino(message: ContractInfo): ContractInfoAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.created = message.created ? AbsoluteTxPosition.toAmino(message.created) : undefined; + obj.ibc_port_id = message.ibcPortId === "" ? undefined : message.ibcPortId; + obj.extension = message.extension ? GlobalDecoderRegistry.toAminoMsg(message.extension) : undefined; + return obj; + }, + fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { + return ContractInfo.fromAmino(object.value); + }, + toAminoMsg(message: ContractInfo): ContractInfoAminoMsg { + return { + type: "wasm/ContractInfo", + value: ContractInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ContractInfoProtoMsg): ContractInfo { + return ContractInfo.decode(message.value); + }, + toProto(message: ContractInfo): Uint8Array { + return ContractInfo.encode(message).finish(); + }, + toProtoMsg(message: ContractInfo): ContractInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + value: ContractInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractInfo.typeUrl, ContractInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractInfo.aminoType, ContractInfo.typeUrl); +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { + operation: 0, + codeId: BigInt(0), + updated: undefined, + msg: new Uint8Array() + }; +} +export const ContractCodeHistoryEntry = { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + aminoType: "wasm/ContractCodeHistoryEntry", + is(o: any): o is ContractCodeHistoryEntry { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is ContractCodeHistoryEntryAmino { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractCodeHistoryEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operation = (reader.int32() as any); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + message.operation = object.operation ?? 0; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.updated = object.updated !== undefined && object.updated !== null ? AbsoluteTxPosition.fromPartial(object.updated) : undefined; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = object.operation; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAmino { + const obj: any = {}; + obj.operation = message.operation === 0 ? undefined : message.operation; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: ContractCodeHistoryEntryAminoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.fromAmino(object.value); + }, + toAminoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAminoMsg { + return { + type: "wasm/ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.toAmino(message) + }; + }, + fromProtoMsg(message: ContractCodeHistoryEntryProtoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.decode(message.value); + }, + toProto(message: ContractCodeHistoryEntry): Uint8Array { + return ContractCodeHistoryEntry.encode(message).finish(); + }, + toProtoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractCodeHistoryEntry.typeUrl, ContractCodeHistoryEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractCodeHistoryEntry.aminoType, ContractCodeHistoryEntry.typeUrl); +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { + blockHeight: BigInt(0), + txIndex: BigInt(0) + }; +} +export const AbsoluteTxPosition = { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + aminoType: "wasm/AbsoluteTxPosition", + is(o: any): o is AbsoluteTxPosition { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.blockHeight === "bigint" && typeof o.txIndex === "bigint"); + }, + isAmino(o: any): o is AbsoluteTxPositionAmino { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.block_height === "bigint" && typeof o.tx_index === "bigint"); + }, + encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.blockHeight); + } + if (message.txIndex !== BigInt(0)) { + writer.uint32(16).uint64(message.txIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAbsoluteTxPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.txIndex = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.txIndex = object.txIndex !== undefined && object.txIndex !== null ? BigInt(object.txIndex.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; + }, + toAmino(message: AbsoluteTxPosition): AbsoluteTxPositionAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.tx_index = message.txIndex !== BigInt(0) ? message.txIndex?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.fromAmino(object.value); + }, + toAminoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionAminoMsg { + return { + type: "wasm/AbsoluteTxPosition", + value: AbsoluteTxPosition.toAmino(message) + }; + }, + fromProtoMsg(message: AbsoluteTxPositionProtoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.decode(message.value); + }, + toProto(message: AbsoluteTxPosition): Uint8Array { + return AbsoluteTxPosition.encode(message).finish(); + }, + toProtoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + value: AbsoluteTxPosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AbsoluteTxPosition.typeUrl, AbsoluteTxPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(AbsoluteTxPosition.aminoType, AbsoluteTxPosition.typeUrl); +function createBaseModel(): Model { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const Model = { + typeUrl: "/cosmwasm.wasm.v1.Model", + aminoType: "wasm/Model", + is(o: any): o is Model { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is ModelAmino { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + encode(message: Model, 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): Model { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModel(); + 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: DeepPartial): Model { + const message = createBaseModel(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: ModelAmino): Model { + const message = createBaseModel(); + 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: Model): ModelAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: ModelAminoMsg): Model { + return Model.fromAmino(object.value); + }, + toAminoMsg(message: Model): ModelAminoMsg { + return { + type: "wasm/Model", + value: Model.toAmino(message) + }; + }, + fromProtoMsg(message: ModelProtoMsg): Model { + return Model.decode(message.value); + }, + toProto(message: Model): Uint8Array { + return Model.encode(message).finish(); + }, + toProtoMsg(message: Model): ModelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Model", + value: Model.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Model.typeUrl, Model); +GlobalDecoderRegistry.registerAminoProtoMapping(Model.aminoType, Model.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/extern.ts b/libs/injective-query/src/extern.ts new file mode 100644 index 00000000..dd4c7d6e --- /dev/null +++ b/libs/injective-query/src/extern.ts @@ -0,0 +1,38 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { + createQueryRpc, +} from '@interchainjs/cosmos/utils'; +import { Rpc } from "./helpers"; + +const _rpcClients: Record = {}; + +export const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => { + if (typeof rpcEndpoint === 'string') { + return rpcEndpoint; + } else if (!!rpcEndpoint) { + //@ts-ignore + return rpcEndpoint.url; + } +} + +export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + const key = getRpcEndpointKey(rpcEndpoint); + if (!key) return; + if (_rpcClients.hasOwnProperty(key)) { + return _rpcClients[key]; + } + const rpc = await createRpcClient(rpcEndpoint); + _rpcClients[key] = rpc; + return rpc; +} + +export const createRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + return createQueryRpc(rpcEndpoint) +} diff --git a/libs/injective-query/src/gogoproto/gogo.ts b/libs/injective-query/src/gogoproto/gogo.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injective-query/src/gogoproto/gogo.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injective-query/src/google/api/annotations.ts b/libs/injective-query/src/google/api/annotations.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injective-query/src/google/api/annotations.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injective-query/src/google/api/http.ts b/libs/injective-query/src/google/api/http.ts new file mode 100644 index 00000000..3fd3a11b --- /dev/null +++ b/libs/injective-query/src/google/api/http.ts @@ -0,0 +1,1069 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} +export interface HttpProtoMsg { + typeUrl: "/google.api.Http"; + value: Uint8Array; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpAmino { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRuleAmino[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} +export interface HttpAminoMsg { + type: "/google.api.Http"; + value: HttpAmino; +} +/** + * gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` + * + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * The following example selects a gRPC method and applies an `HttpRule` to it: + * + * http: + * rules: + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} +export interface HttpRuleProtoMsg { + typeUrl: "/google.api.HttpRule"; + value: Uint8Array; +} +/** + * gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` + * + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * The following example selects a gRPC method and applies an `HttpRule` to it: + * + * http: + * rules: + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleAmino { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPatternAmino; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRuleAmino[]; +} +export interface HttpRuleAminoMsg { + type: "/google.api.HttpRule"; + value: HttpRuleAmino; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternProtoMsg { + typeUrl: "/google.api.CustomHttpPattern"; + value: Uint8Array; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternAmino { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternAminoMsg { + type: "/google.api.CustomHttpPattern"; + value: CustomHttpPatternAmino; +} +function createBaseHttp(): Http { + return { + rules: [], + fullyDecodeReservedExpansion: false + }; +} +export const Http = { + typeUrl: "/google.api.Http", + is(o: any): o is Http { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.is(o.rules[0])) && typeof o.fullyDecodeReservedExpansion === "boolean"); + }, + isAmino(o: any): o is HttpAmino { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.isAmino(o.rules[0])) && typeof o.fully_decode_reserved_expansion === "boolean"); + }, + encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, + fromAmino(object: HttpAmino): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; + }, + toAmino(message: Http): HttpAmino { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.rules = message.rules; + } + obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion === false ? undefined : message.fullyDecodeReservedExpansion; + return obj; + }, + fromAminoMsg(object: HttpAminoMsg): Http { + return Http.fromAmino(object.value); + }, + fromProtoMsg(message: HttpProtoMsg): Http { + return Http.decode(message.value); + }, + toProto(message: Http): Uint8Array { + return Http.encode(message).finish(); + }, + toProtoMsg(message: Http): HttpProtoMsg { + return { + typeUrl: "/google.api.Http", + value: Http.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Http.typeUrl, Http); +function createBaseHttpRule(): HttpRule { + return { + selector: "", + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: "", + responseBody: "", + additionalBindings: [] + }; +} +export const HttpRule = { + typeUrl: "/google.api.HttpRule", + is(o: any): o is HttpRule { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.responseBody === "string" && Array.isArray(o.additionalBindings) && (!o.additionalBindings.length || HttpRule.is(o.additionalBindings[0]))); + }, + isAmino(o: any): o is HttpRuleAmino { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.response_body === "string" && Array.isArray(o.additional_bindings) && (!o.additional_bindings.length || HttpRule.isAmino(o.additional_bindings[0]))); + }, + encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = object.custom !== undefined && object.custom !== null ? CustomHttpPattern.fromPartial(object.custom) : undefined; + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HttpRuleAmino): HttpRule { + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; + }, + toAmino(message: HttpRule): HttpRuleAmino { + const obj: any = {}; + obj.selector = message.selector === "" ? undefined : message.selector; + obj.get = message.get === null ? undefined : message.get; + obj.put = message.put === null ? undefined : message.put; + obj.post = message.post === null ? undefined : message.post; + obj.delete = message.delete === null ? undefined : message.delete; + obj.patch = message.patch === null ? undefined : message.patch; + obj.custom = message.custom ? CustomHttpPattern.toAmino(message.custom) : undefined; + obj.body = message.body === "" ? undefined : message.body; + obj.response_body = message.responseBody === "" ? undefined : message.responseBody; + if (message.additionalBindings) { + obj.additional_bindings = message.additionalBindings.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.additional_bindings = message.additionalBindings; + } + return obj; + }, + fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { + return HttpRule.fromAmino(object.value); + }, + fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { + return HttpRule.decode(message.value); + }, + toProto(message: HttpRule): Uint8Array { + return HttpRule.encode(message).finish(); + }, + toProtoMsg(message: HttpRule): HttpRuleProtoMsg { + return { + typeUrl: "/google.api.HttpRule", + value: HttpRule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HttpRule.typeUrl, HttpRule); +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { + kind: "", + path: "" + }; +} +export const CustomHttpPattern = { + typeUrl: "/google.api.CustomHttpPattern", + is(o: any): o is CustomHttpPattern { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + isAmino(o: any): o is CustomHttpPatternAmino { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, + fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; + }, + toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.path = message.path === "" ? undefined : message.path; + return obj; + }, + fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { + return CustomHttpPattern.fromAmino(object.value); + }, + fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { + return CustomHttpPattern.decode(message.value); + }, + toProto(message: CustomHttpPattern): Uint8Array { + return CustomHttpPattern.encode(message).finish(); + }, + toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg { + return { + typeUrl: "/google.api.CustomHttpPattern", + value: CustomHttpPattern.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CustomHttpPattern.typeUrl, CustomHttpPattern); \ No newline at end of file diff --git a/libs/injective-query/src/google/protobuf/any.ts b/libs/injective-query/src/google/protobuf/any.ts new file mode 100644 index 00000000..bbae1be1 --- /dev/null +++ b/libs/injective-query/src/google/protobuf/any.ts @@ -0,0 +1,331 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} +export interface AnyProtoMsg { + typeUrl: "/google.protobuf.Any"; + value: Uint8Array; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnyAmino { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + type: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: any; +} +export interface AnyAminoMsg { + type: string; + value: AnyAmino; +} +function createBaseAny(): Any { + return { + typeUrl: "", + value: new Uint8Array() + }; +} +export const Any = { + typeUrl: "/google.protobuf.Any", + is(o: any): o is Any { + return o && (o.$typeUrl === Any.typeUrl || typeof o.typeUrl === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is AnyAmino { + return o && (o.$typeUrl === Any.typeUrl || typeof o.type === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: AnyAmino): Any { + return { + typeUrl: object.type, + value: object.value + }; + }, + toAmino(message: Any): AnyAmino { + const obj: any = {}; + obj.type = message.typeUrl; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: AnyAminoMsg): Any { + return Any.fromAmino(object.value); + }, + fromProtoMsg(message: AnyProtoMsg): Any { + return Any.decode(message.value); + }, + toProto(message: Any): Uint8Array { + return Any.encode(message).finish(); + }, + toProtoMsg(message: Any): AnyProtoMsg { + return { + typeUrl: "/google.protobuf.Any", + value: Any.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/libs/injective-query/src/google/protobuf/descriptor.ts b/libs/injective-query/src/google/protobuf/descriptor.ts new file mode 100644 index 00000000..53b60923 --- /dev/null +++ b/libs/injective-query/src/google/protobuf/descriptor.ts @@ -0,0 +1,7177 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** The full set of known editions. */ +export enum Edition { + /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ + EDITION_UNKNOWN = 0, + /** + * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + */ + EDITION_LEGACY = 900, + /** + * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + */ + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + /** + * EDITION_2023 - Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + */ + EDITION_2023 = 1000, + EDITION_2024 = 1001, + /** + * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + */ + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + /** + * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + */ + EDITION_MAX = 2147483647, + UNRECOGNIZED = -1, +} +export const EditionAmino = Edition; +export function editionFromJSON(object: any): Edition { + switch (object) { + case 0: + case "EDITION_UNKNOWN": + return Edition.EDITION_UNKNOWN; + case 900: + case "EDITION_LEGACY": + return Edition.EDITION_LEGACY; + case 998: + case "EDITION_PROTO2": + return Edition.EDITION_PROTO2; + case 999: + case "EDITION_PROTO3": + return Edition.EDITION_PROTO3; + case 1000: + case "EDITION_2023": + return Edition.EDITION_2023; + case 1001: + case "EDITION_2024": + return Edition.EDITION_2024; + case 1: + case "EDITION_1_TEST_ONLY": + return Edition.EDITION_1_TEST_ONLY; + case 2: + case "EDITION_2_TEST_ONLY": + return Edition.EDITION_2_TEST_ONLY; + case 99997: + case "EDITION_99997_TEST_ONLY": + return Edition.EDITION_99997_TEST_ONLY; + case 99998: + case "EDITION_99998_TEST_ONLY": + return Edition.EDITION_99998_TEST_ONLY; + case 99999: + case "EDITION_99999_TEST_ONLY": + return Edition.EDITION_99999_TEST_ONLY; + case 2147483647: + case "EDITION_MAX": + return Edition.EDITION_MAX; + case -1: + case "UNRECOGNIZED": + default: + return Edition.UNRECOGNIZED; + } +} +export function editionToJSON(object: Edition): string { + switch (object) { + case Edition.EDITION_UNKNOWN: + return "EDITION_UNKNOWN"; + case Edition.EDITION_LEGACY: + return "EDITION_LEGACY"; + case Edition.EDITION_PROTO2: + return "EDITION_PROTO2"; + case Edition.EDITION_PROTO3: + return "EDITION_PROTO3"; + case Edition.EDITION_2023: + return "EDITION_2023"; + case Edition.EDITION_2024: + return "EDITION_2024"; + case Edition.EDITION_1_TEST_ONLY: + return "EDITION_1_TEST_ONLY"; + case Edition.EDITION_2_TEST_ONLY: + return "EDITION_2_TEST_ONLY"; + case Edition.EDITION_99997_TEST_ONLY: + return "EDITION_99997_TEST_ONLY"; + case Edition.EDITION_99998_TEST_ONLY: + return "EDITION_99998_TEST_ONLY"; + case Edition.EDITION_99999_TEST_ONLY: + return "EDITION_99999_TEST_ONLY"; + case Edition.EDITION_MAX: + return "EDITION_MAX"; + case Edition.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** The verification state of the extension range. */ +export enum ExtensionRangeOptions_VerificationState { + /** DECLARATION - All the extensions of the range must be declared. */ + DECLARATION = 0, + UNVERIFIED = 1, + UNRECOGNIZED = -1, +} +export const ExtensionRangeOptions_VerificationStateAmino = ExtensionRangeOptions_VerificationState; +export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState { + switch (object) { + case 0: + case "DECLARATION": + return ExtensionRangeOptions_VerificationState.DECLARATION; + case 1: + case "UNVERIFIED": + return ExtensionRangeOptions_VerificationState.UNVERIFIED; + case -1: + case "UNRECOGNIZED": + default: + return ExtensionRangeOptions_VerificationState.UNRECOGNIZED; + } +} +export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string { + switch (object) { + case ExtensionRangeOptions_VerificationState.DECLARATION: + return "DECLARATION"; + case ExtensionRangeOptions_VerificationState.UNVERIFIED: + return "UNVERIFIED"; + case ExtensionRangeOptions_VerificationState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - 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, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_TypeAmino = FieldDescriptorProto_Type; +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + /** + * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + */ + LABEL_REQUIRED = 2, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_LabelAmino = FieldDescriptorProto_Label; +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export const FileOptions_OptimizeModeAmino = FileOptions_OptimizeMode; +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + /** + * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + */ + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_CTypeAmino = FieldOptions_CType; +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_JSTypeAmino = FieldOptions_JSType; +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_OptionRetentionAmino = FieldOptions_OptionRetention; +export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { + switch (object) { + case 0: + case "RETENTION_UNKNOWN": + return FieldOptions_OptionRetention.RETENTION_UNKNOWN; + case 1: + case "RETENTION_RUNTIME": + return FieldOptions_OptionRetention.RETENTION_RUNTIME; + case 2: + case "RETENTION_SOURCE": + return FieldOptions_OptionRetention.RETENTION_SOURCE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionRetention.UNRECOGNIZED; + } +} +export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { + switch (object) { + case FieldOptions_OptionRetention.RETENTION_UNKNOWN: + return "RETENTION_UNKNOWN"; + case FieldOptions_OptionRetention.RETENTION_RUNTIME: + return "RETENTION_RUNTIME"; + case FieldOptions_OptionRetention.RETENTION_SOURCE: + return "RETENTION_SOURCE"; + case FieldOptions_OptionRetention.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} +export const FieldOptions_OptionTargetTypeAmino = FieldOptions_OptionTargetType; +export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { + switch (object) { + case 0: + case "TARGET_TYPE_UNKNOWN": + return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; + case 1: + case "TARGET_TYPE_FILE": + return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; + case 2: + case "TARGET_TYPE_EXTENSION_RANGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; + case 3: + case "TARGET_TYPE_MESSAGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; + case 4: + case "TARGET_TYPE_FIELD": + return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; + case 5: + case "TARGET_TYPE_ONEOF": + return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; + case 6: + case "TARGET_TYPE_ENUM": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; + case 7: + case "TARGET_TYPE_ENUM_ENTRY": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; + case 8: + case "TARGET_TYPE_SERVICE": + return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; + case 9: + case "TARGET_TYPE_METHOD": + return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionTargetType.UNRECOGNIZED; + } +} +export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { + switch (object) { + case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: + return "TARGET_TYPE_UNKNOWN"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: + return "TARGET_TYPE_FILE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: + return "TARGET_TYPE_EXTENSION_RANGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: + return "TARGET_TYPE_MESSAGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: + return "TARGET_TYPE_FIELD"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: + return "TARGET_TYPE_ONEOF"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: + return "TARGET_TYPE_ENUM"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: + return "TARGET_TYPE_ENUM_ENTRY"; + case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: + return "TARGET_TYPE_SERVICE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: + return "TARGET_TYPE_METHOD"; + case FieldOptions_OptionTargetType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * 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. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} +export const MethodOptions_IdempotencyLevelAmino = MethodOptions_IdempotencyLevel; +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3, + UNRECOGNIZED = -1, +} +export const FeatureSet_FieldPresenceAmino = FeatureSet_FieldPresence; +export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence { + switch (object) { + case 0: + case "FIELD_PRESENCE_UNKNOWN": + return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; + case 1: + case "EXPLICIT": + return FeatureSet_FieldPresence.EXPLICIT; + case 2: + case "IMPLICIT": + return FeatureSet_FieldPresence.IMPLICIT; + case 3: + case "LEGACY_REQUIRED": + return FeatureSet_FieldPresence.LEGACY_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_FieldPresence.UNRECOGNIZED; + } +} +export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string { + switch (object) { + case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: + return "FIELD_PRESENCE_UNKNOWN"; + case FeatureSet_FieldPresence.EXPLICIT: + return "EXPLICIT"; + case FeatureSet_FieldPresence.IMPLICIT: + return "IMPLICIT"; + case FeatureSet_FieldPresence.LEGACY_REQUIRED: + return "LEGACY_REQUIRED"; + case FeatureSet_FieldPresence.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_EnumTypeAmino = FeatureSet_EnumType; +export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType { + switch (object) { + case 0: + case "ENUM_TYPE_UNKNOWN": + return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; + case 1: + case "OPEN": + return FeatureSet_EnumType.OPEN; + case 2: + case "CLOSED": + return FeatureSet_EnumType.CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_EnumType.UNRECOGNIZED; + } +} +export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string { + switch (object) { + case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: + return "ENUM_TYPE_UNKNOWN"; + case FeatureSet_EnumType.OPEN: + return "OPEN"; + case FeatureSet_EnumType.CLOSED: + return "CLOSED"; + case FeatureSet_EnumType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_RepeatedFieldEncodingAmino = FeatureSet_RepeatedFieldEncoding; +export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding { + switch (object) { + case 0: + case "REPEATED_FIELD_ENCODING_UNKNOWN": + return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; + case 1: + case "PACKED": + return FeatureSet_RepeatedFieldEncoding.PACKED; + case 2: + case "EXPANDED": + return FeatureSet_RepeatedFieldEncoding.EXPANDED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED; + } +} +export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string { + switch (object) { + case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: + return "REPEATED_FIELD_ENCODING_UNKNOWN"; + case FeatureSet_RepeatedFieldEncoding.PACKED: + return "PACKED"; + case FeatureSet_RepeatedFieldEncoding.EXPANDED: + return "EXPANDED"; + case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3, + UNRECOGNIZED = -1, +} +export const FeatureSet_Utf8ValidationAmino = FeatureSet_Utf8Validation; +export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation { + switch (object) { + case 0: + case "UTF8_VALIDATION_UNKNOWN": + return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; + case 2: + case "VERIFY": + return FeatureSet_Utf8Validation.VERIFY; + case 3: + case "NONE": + return FeatureSet_Utf8Validation.NONE; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_Utf8Validation.UNRECOGNIZED; + } +} +export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string { + switch (object) { + case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: + return "UTF8_VALIDATION_UNKNOWN"; + case FeatureSet_Utf8Validation.VERIFY: + return "VERIFY"; + case FeatureSet_Utf8Validation.NONE: + return "NONE"; + case FeatureSet_Utf8Validation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_MessageEncodingAmino = FeatureSet_MessageEncoding; +export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding { + switch (object) { + case 0: + case "MESSAGE_ENCODING_UNKNOWN": + return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; + case 1: + case "LENGTH_PREFIXED": + return FeatureSet_MessageEncoding.LENGTH_PREFIXED; + case 2: + case "DELIMITED": + return FeatureSet_MessageEncoding.DELIMITED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_MessageEncoding.UNRECOGNIZED; + } +} +export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string { + switch (object) { + case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: + return "MESSAGE_ENCODING_UNKNOWN"; + case FeatureSet_MessageEncoding.LENGTH_PREFIXED: + return "LENGTH_PREFIXED"; + case FeatureSet_MessageEncoding.DELIMITED: + return "DELIMITED"; + case FeatureSet_MessageEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_JsonFormatAmino = FeatureSet_JsonFormat; +export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat { + switch (object) { + case 0: + case "JSON_FORMAT_UNKNOWN": + return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; + case 1: + case "ALLOW": + return FeatureSet_JsonFormat.ALLOW; + case 2: + case "LEGACY_BEST_EFFORT": + return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_JsonFormat.UNRECOGNIZED; + } +} +export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string { + switch (object) { + case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: + return "JSON_FORMAT_UNKNOWN"; + case FeatureSet_JsonFormat.ALLOW: + return "ALLOW"; + case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: + return "LEGACY_BEST_EFFORT"; + case FeatureSet_JsonFormat.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} +export const GeneratedCodeInfo_Annotation_SemanticAmino = GeneratedCodeInfo_Annotation_Semantic; +export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { + switch (object) { + case 0: + case "NONE": + return GeneratedCodeInfo_Annotation_Semantic.NONE; + case 1: + case "SET": + return GeneratedCodeInfo_Annotation_Semantic.SET; + case 2: + case "ALIAS": + return GeneratedCodeInfo_Annotation_Semantic.ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; + } +} +export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { + switch (object) { + case GeneratedCodeInfo_Annotation_Semantic.NONE: + return "NONE"; + case GeneratedCodeInfo_Annotation_Semantic.SET: + return "SET"; + case GeneratedCodeInfo_Annotation_Semantic.ALIAS: + return "ALIAS"; + case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} +export interface FileDescriptorSetProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorSet"; + value: Uint8Array; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetAmino { + file: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorSetAminoMsg { + type: "/google.protobuf.FileDescriptorSet"; + value: FileDescriptorSetAmino; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * 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. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + edition: Edition; +} +export interface FileDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorProto"; + value: Uint8Array; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoAmino { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProtoAmino[]; + enum_type: EnumDescriptorProtoAmino[]; + service: ServiceDescriptorProtoAmino[]; + extension: FieldDescriptorProtoAmino[]; + options?: FileOptionsAmino; + /** + * 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. + */ + source_code_info?: SourceCodeInfoAmino; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + edition: Edition; +} +export interface FileDescriptorProtoAminoMsg { + type: "/google.protobuf.FileDescriptorProto"; + value: FileDescriptorProtoAmino; +} +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} +export interface DescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.DescriptorProto"; + value: Uint8Array; +} +/** Describes a message type. */ +export interface DescriptorProtoAmino { + name: string; + field: FieldDescriptorProtoAmino[]; + extension: FieldDescriptorProtoAmino[]; + nested_type: DescriptorProtoAmino[]; + enum_type: EnumDescriptorProtoAmino[]; + extension_range: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl: OneofDescriptorProtoAmino[]; + options?: MessageOptionsAmino; + reserved_range: DescriptorProto_ReservedRangeAmino[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} +export interface DescriptorProtoAminoMsg { + type: "/google.protobuf.DescriptorProto"; + value: DescriptorProtoAmino; +} +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} +export interface DescriptorProto_ExtensionRangeProtoMsg { + typeUrl: "/google.protobuf.ExtensionRange"; + value: Uint8Array; +} +export interface DescriptorProto_ExtensionRangeAmino { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptionsAmino; +} +export interface DescriptorProto_ExtensionRangeAminoMsg { + type: "/google.protobuf.ExtensionRange"; + value: DescriptorProto_ExtensionRangeAmino; +} +/** + * 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. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeProtoMsg { + typeUrl: "/google.protobuf.ReservedRange"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DescriptorProto_ReservedRangeAmino { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeAminoMsg { + type: "/google.protobuf.ReservedRange"; + value: DescriptorProto_ReservedRangeAmino; +} +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** Any features defined in the specific edition. */ + features?: FeatureSet; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification: ExtensionRangeOptions_VerificationState; +} +export interface ExtensionRangeOptionsProtoMsg { + typeUrl: "/google.protobuf.ExtensionRangeOptions"; + value: Uint8Array; +} +export interface ExtensionRangeOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_DeclarationAmino[]; + /** Any features defined in the specific edition. */ + features?: FeatureSetAmino; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification: ExtensionRangeOptions_VerificationState; +} +export interface ExtensionRangeOptionsAminoMsg { + type: "/google.protobuf.ExtensionRangeOptions"; + value: ExtensionRangeOptionsAmino; +} +export interface ExtensionRangeOptions_Declaration { + /** The extension number declared within the extension range. */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + fullName: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated: boolean; +} +export interface ExtensionRangeOptions_DeclarationProtoMsg { + typeUrl: "/google.protobuf.Declaration"; + value: Uint8Array; +} +export interface ExtensionRangeOptions_DeclarationAmino { + /** The extension number declared within the extension range. */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + full_name: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated: boolean; +} +export interface ExtensionRangeOptions_DeclarationAminoMsg { + type: "/google.protobuf.Declaration"; + value: ExtensionRangeOptions_DeclarationAmino; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * 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. + */ + type: FieldDescriptorProto_Type; + /** + * 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). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * 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. + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * 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. + */ + jsonName: string; + options?: FieldOptions; + /** + * 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 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`. + */ + proto3Optional: boolean; +} +export interface FieldDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FieldDescriptorProto"; + value: Uint8Array; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoAmino { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * 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. + */ + type: FieldDescriptorProto_Type; + /** + * 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). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * 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. + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * 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. + */ + json_name: string; + options?: FieldOptionsAmino; + /** + * 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 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`. + */ + proto3_optional: boolean; +} +export interface FieldDescriptorProtoAminoMsg { + type: "/google.protobuf.FieldDescriptorProto"; + value: FieldDescriptorProtoAmino; +} +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +export interface OneofDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.OneofDescriptorProto"; + value: Uint8Array; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoAmino { + name: string; + options?: OneofOptionsAmino; +} +export interface OneofDescriptorProtoAminoMsg { + type: "/google.protobuf.OneofDescriptorProto"; + value: OneofDescriptorProtoAmino; +} +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * 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. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +export interface EnumDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumDescriptorProto"; + value: Uint8Array; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoAmino { + name: string; + value: EnumValueDescriptorProtoAmino[]; + options?: EnumOptionsAmino; + /** + * 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. + */ + reserved_range: EnumDescriptorProto_EnumReservedRangeAmino[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} +export interface EnumDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumDescriptorProto"; + value: EnumDescriptorProtoAmino; +} +/** + * 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. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { + typeUrl: "/google.protobuf.EnumReservedRange"; + value: Uint8Array; +} +/** + * 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. + */ +export interface EnumDescriptorProto_EnumReservedRangeAmino { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { + type: "/google.protobuf.EnumReservedRange"; + value: EnumDescriptorProto_EnumReservedRangeAmino; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +export interface EnumValueDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumValueDescriptorProto"; + value: Uint8Array; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoAmino { + name: string; + number: number; + options?: EnumValueOptionsAmino; +} +export interface EnumValueDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumValueDescriptorProto"; + value: EnumValueDescriptorProtoAmino; +} +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +export interface ServiceDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.ServiceDescriptorProto"; + value: Uint8Array; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoAmino { + name: string; + method: MethodDescriptorProtoAmino[]; + options?: ServiceOptionsAmino; +} +export interface ServiceDescriptorProtoAminoMsg { + type: "/google.protobuf.ServiceDescriptorProto"; + value: ServiceDescriptorProtoAmino; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} +export interface MethodDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.MethodDescriptorProto"; + value: Uint8Array; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoAmino { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options?: MethodOptionsAmino; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} +export interface MethodDescriptorProtoAminoMsg { + type: "/google.protobuf.MethodDescriptorProto"; + value: MethodDescriptorProtoAmino; +} +export interface 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. + */ + javaPackage: string; + /** + * 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. + */ + javaOuterClassname: string; + /** + * 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. + */ + javaMultipleFiles: boolean; + /** This option does nothing. */ + /** @deprecated */ + javaGenerateEqualsAndHash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * 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. + */ + goPackage: string; + /** + * 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. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * 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. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * 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. + */ + phpNamespace: string; + /** + * 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. + */ + phpMetadataNamespace: string; + /** + * 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. + */ + rubyPackage: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FileOptionsProtoMsg { + typeUrl: "/google.protobuf.FileOptions"; + value: Uint8Array; +} +export interface FileOptionsAmino { + /** + * 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. + */ + java_package: string; + /** + * 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. + */ + java_outer_classname: string; + /** + * 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. + */ + java_multiple_files: boolean; + /** This option does nothing. */ + /** @deprecated */ + java_generate_equals_and_hash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * 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. + */ + go_package: string; + /** + * 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. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * 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. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * 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. + */ + php_namespace: string; + /** + * 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. + */ + php_metadata_namespace: string; + /** + * 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. + */ + ruby_package: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface FileOptionsAminoMsg { + type: "/google.protobuf.FileOptions"; + value: FileOptionsAmino; +} +export interface 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. + */ + messageSetWireFormat: boolean; + /** + * 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". + */ + noStandardDescriptorAccessor: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * 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. + * + * 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. + */ + mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + */ + /** @deprecated */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MessageOptionsProtoMsg { + typeUrl: "/google.protobuf.MessageOptions"; + value: Uint8Array; +} +export interface MessageOptionsAmino { + /** + * 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. + */ + message_set_wire_format: boolean; + /** + * 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". + */ + no_standard_descriptor_accessor: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * 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. + * + * 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. + */ + map_entry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + */ + /** @deprecated */ + deprecated_legacy_json_field_conflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface MessageOptionsAminoMsg { + type: "/google.protobuf.MessageOptions"; + value: MessageOptionsAmino; +} +export interface FieldOptions { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * 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 only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + */ + ctype: FieldOptions_CType; + /** + * 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. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed: boolean; + /** + * 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. + */ + jstype: FieldOptions_JSType; + /** + * 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 lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy: boolean; + /** + * 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. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact: boolean; + retention: FieldOptions_OptionRetention; + targets: FieldOptions_OptionTargetType[]; + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + featureSupport?: FieldOptions_FeatureSupport; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FieldOptionsProtoMsg { + typeUrl: "/google.protobuf.FieldOptions"; + value: Uint8Array; +} +export interface FieldOptionsAmino { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * 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 only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + */ + ctype: FieldOptions_CType; + /** + * 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. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed: boolean; + /** + * 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. + */ + jstype: FieldOptions_JSType; + /** + * 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 lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverified_lazy: boolean; + /** + * 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. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debug_redact: boolean; + retention: FieldOptions_OptionRetention; + targets: FieldOptions_OptionTargetType[]; + edition_defaults: FieldOptions_EditionDefaultAmino[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + feature_support?: FieldOptions_FeatureSupportAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface FieldOptionsAminoMsg { + type: "/google.protobuf.FieldOptions"; + value: FieldOptionsAmino; +} +export interface FieldOptions_EditionDefault { + edition: Edition; + /** Textproto value. */ + value: string; +} +export interface FieldOptions_EditionDefaultProtoMsg { + typeUrl: "/google.protobuf.EditionDefault"; + value: Uint8Array; +} +export interface FieldOptions_EditionDefaultAmino { + edition: Edition; + /** Textproto value. */ + value: string; +} +export interface FieldOptions_EditionDefaultAminoMsg { + type: "/google.protobuf.EditionDefault"; + value: FieldOptions_EditionDefaultAmino; +} +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupport { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + editionIntroduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + editionDeprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecationWarning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + editionRemoved: Edition; +} +export interface FieldOptions_FeatureSupportProtoMsg { + typeUrl: "/google.protobuf.FeatureSupport"; + value: Uint8Array; +} +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupportAmino { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + edition_introduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + edition_deprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecation_warning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + edition_removed: Edition; +} +export interface FieldOptions_FeatureSupportAminoMsg { + type: "/google.protobuf.FeatureSupport"; + value: FieldOptions_FeatureSupportAmino; +} +export interface OneofOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface OneofOptionsProtoMsg { + typeUrl: "/google.protobuf.OneofOptions"; + value: Uint8Array; +} +export interface OneofOptionsAmino { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface OneofOptionsAminoMsg { + type: "/google.protobuf.OneofOptions"; + value: OneofOptionsAmino; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + */ + /** @deprecated */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumOptions"; + value: Uint8Array; +} +export interface EnumOptionsAmino { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + */ + /** @deprecated */ + deprecated_legacy_json_field_conflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface EnumOptionsAminoMsg { + type: "/google.protobuf.EnumOptions"; + value: EnumOptionsAmino; +} +export interface 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. + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debugRedact: boolean; + /** Information about the support window of a feature value. */ + featureSupport?: FieldOptions_FeatureSupport; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumValueOptions"; + value: Uint8Array; +} +export interface EnumValueOptionsAmino { + /** + * 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. + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debug_redact: boolean; + /** Information about the support window of a feature value. */ + feature_support?: FieldOptions_FeatureSupportAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface EnumValueOptionsAminoMsg { + type: "/google.protobuf.EnumValueOptions"; + value: EnumValueOptionsAmino; +} +export interface ServiceOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * 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. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptionsProtoMsg { + typeUrl: "/google.protobuf.ServiceOptions"; + value: Uint8Array; +} +export interface ServiceOptionsAmino { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * 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. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface ServiceOptionsAminoMsg { + type: "/google.protobuf.ServiceOptions"; + value: ServiceOptionsAmino; +} +export interface MethodOptions { + /** + * 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. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptionsProtoMsg { + typeUrl: "/google.protobuf.MethodOptions"; + value: Uint8Array; +} +export interface MethodOptionsAmino { + /** + * 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. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface MethodOptionsAminoMsg { + type: "/google.protobuf.MethodOptions"; + value: MethodOptionsAmino; +} +/** + * 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. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: bigint; + negativeIntValue: bigint; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} +export interface UninterpretedOptionProtoMsg { + typeUrl: "/google.protobuf.UninterpretedOption"; + value: Uint8Array; +} +/** + * 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. + */ +export interface UninterpretedOptionAmino { + name: UninterpretedOption_NamePartAmino[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: string; + negative_int_value: string; + double_value: number; + string_value: string; + aggregate_value: string; +} +export interface UninterpretedOptionAminoMsg { + type: "/google.protobuf.UninterpretedOption"; + value: UninterpretedOptionAmino; +} +/** + * 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". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} +export interface UninterpretedOption_NamePartProtoMsg { + typeUrl: "/google.protobuf.NamePart"; + value: Uint8Array; +} +/** + * 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". + */ +export interface UninterpretedOption_NamePartAmino { + name_part: string; + is_extension: boolean; +} +export interface UninterpretedOption_NamePartAminoMsg { + type: "/google.protobuf.NamePart"; + value: UninterpretedOption_NamePartAmino; +} +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSet { + fieldPresence: FeatureSet_FieldPresence; + enumType: FeatureSet_EnumType; + repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; + utf8Validation: FeatureSet_Utf8Validation; + messageEncoding: FeatureSet_MessageEncoding; + jsonFormat: FeatureSet_JsonFormat; +} +export interface FeatureSetProtoMsg { + typeUrl: "/google.protobuf.FeatureSet"; + value: Uint8Array; +} +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSetAmino { + field_presence: FeatureSet_FieldPresence; + enum_type: FeatureSet_EnumType; + repeated_field_encoding: FeatureSet_RepeatedFieldEncoding; + utf8_validation: FeatureSet_Utf8Validation; + message_encoding: FeatureSet_MessageEncoding; + json_format: FeatureSet_JsonFormat; +} +export interface FeatureSetAminoMsg { + type: "/google.protobuf.FeatureSet"; + value: FeatureSetAmino; +} +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaults { + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimumEdition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximumEdition: Edition; +} +export interface FeatureSetDefaultsProtoMsg { + typeUrl: "/google.protobuf.FeatureSetDefaults"; + value: Uint8Array; +} +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaultsAmino { + defaults: FeatureSetDefaults_FeatureSetEditionDefaultAmino[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimum_edition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximum_edition: Edition; +} +export interface FeatureSetDefaultsAminoMsg { + type: "/google.protobuf.FeatureSetDefaults"; + value: FeatureSetDefaultsAmino; +} +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefault { + edition: Edition; + /** Defaults of features that can be overridden in this edition. */ + overridableFeatures?: FeatureSet; + /** Defaults of features that can't be overridden in this edition. */ + fixedFeatures?: FeatureSet; +} +export interface FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { + typeUrl: "/google.protobuf.FeatureSetEditionDefault"; + value: Uint8Array; +} +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefaultAmino { + edition: Edition; + /** Defaults of features that can be overridden in this edition. */ + overridable_features?: FeatureSetAmino; + /** Defaults of features that can't be overridden in this edition. */ + fixed_features?: FeatureSetAmino; +} +export interface FeatureSetDefaults_FeatureSetEditionDefaultAminoMsg { + type: "/google.protobuf.FeatureSetEditionDefault"; + value: FeatureSetDefaults_FeatureSetEditionDefaultAmino; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface 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. + */ + location: SourceCodeInfo_Location[]; +} +export interface SourceCodeInfoProtoMsg { + typeUrl: "/google.protobuf.SourceCodeInfo"; + value: Uint8Array; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoAmino { + /** + * 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. + */ + location: SourceCodeInfo_LocationAmino[]; +} +export interface SourceCodeInfoAminoMsg { + type: "/google.protobuf.SourceCodeInfo"; + value: SourceCodeInfoAmino; +} +export interface SourceCodeInfo_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 appears. + * 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). + */ + path: number[]; + /** + * 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. + */ + span: number[]; + /** + * 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. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} +export interface SourceCodeInfo_LocationProtoMsg { + typeUrl: "/google.protobuf.Location"; + value: Uint8Array; +} +export interface SourceCodeInfo_LocationAmino { + /** + * 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 appears. + * 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). + */ + path: number[]; + /** + * 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. + */ + span: number[]; + /** + * 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. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} +export interface SourceCodeInfo_LocationAminoMsg { + type: "/google.protobuf.Location"; + value: SourceCodeInfo_LocationAmino; +} +/** + * 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. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +export interface GeneratedCodeInfoProtoMsg { + typeUrl: "/google.protobuf.GeneratedCodeInfo"; + value: Uint8Array; +} +/** + * 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. + */ +export interface GeneratedCodeInfoAmino { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_AnnotationAmino[]; +} +export interface GeneratedCodeInfoAminoMsg { + type: "/google.protobuf.GeneratedCodeInfo"; + value: GeneratedCodeInfoAmino; +} +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * 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). + */ + end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} +export interface GeneratedCodeInfo_AnnotationProtoMsg { + typeUrl: "/google.protobuf.Annotation"; + value: Uint8Array; +} +export interface GeneratedCodeInfo_AnnotationAmino { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * 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). + */ + end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} +export interface GeneratedCodeInfo_AnnotationAminoMsg { + type: "/google.protobuf.Annotation"; + value: GeneratedCodeInfo_AnnotationAmino; +} +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { + file: [] + }; +} +export const FileDescriptorSet = { + typeUrl: "/google.protobuf.FileDescriptorSet", + is(o: any): o is FileDescriptorSet { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.is(o.file[0]))); + }, + isAmino(o: any): o is FileDescriptorSetAmino { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.isAmino(o.file[0]))); + }, + encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.file = message.file; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorSetAminoMsg): FileDescriptorSet { + return FileDescriptorSet.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorSetProtoMsg): FileDescriptorSet { + return FileDescriptorSet.decode(message.value); + }, + toProto(message: FileDescriptorSet): Uint8Array { + return FileDescriptorSet.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorSet): FileDescriptorSetProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorSet", + value: FileDescriptorSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorSet.typeUrl, FileDescriptorSet); +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + edition: 1 + }; +} +export const FileDescriptorProto = { + typeUrl: "/google.protobuf.FileDescriptorProto", + is(o: any): o is FileDescriptorProto { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.publicDependency) && (!o.publicDependency.length || typeof o.publicDependency[0] === "number") && Array.isArray(o.weakDependency) && (!o.weakDependency.length || typeof o.weakDependency[0] === "number") && Array.isArray(o.messageType) && (!o.messageType.length || DescriptorProto.is(o.messageType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.is(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && typeof o.syntax === "string" && isSet(o.edition)); + }, + isAmino(o: any): o is FileDescriptorProtoAmino { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.public_dependency) && (!o.public_dependency.length || typeof o.public_dependency[0] === "number") && Array.isArray(o.weak_dependency) && (!o.weak_dependency.length || typeof o.weak_dependency[0] === "number") && Array.isArray(o.message_type) && (!o.message_type.length || DescriptorProto.isAmino(o.message_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.isAmino(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && typeof o.syntax === "string" && isSet(o.edition)); + }, + encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + if (message.edition !== 1) { + writer.uint32(112).int32(message.edition); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + case 14: + message.edition = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.publicDependency?.map(e => e) || []; + message.weakDependency = object.weakDependency?.map(e => e) || []; + message.messageType = object.messageType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? FileOptions.fromPartial(object.options) : undefined; + message.sourceCodeInfo = object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) : undefined; + message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? 1; + return message; + }, + fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + return message; + }, + toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.package = message.package === "" ? undefined : message.package; + if (message.dependency) { + obj.dependency = message.dependency.map(e => e); + } else { + obj.dependency = message.dependency; + } + if (message.publicDependency) { + obj.public_dependency = message.publicDependency.map(e => e); + } else { + obj.public_dependency = message.publicDependency; + } + if (message.weakDependency) { + obj.weak_dependency = message.weakDependency.map(e => e); + } else { + obj.weak_dependency = message.weakDependency; + } + if (message.messageType) { + obj.message_type = message.messageType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.message_type = message.messageType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.service) { + obj.service = message.service.map(e => e ? ServiceDescriptorProto.toAmino(e) : undefined); + } else { + obj.service = message.service; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + obj.options = message.options ? FileOptions.toAmino(message.options) : undefined; + obj.source_code_info = message.sourceCodeInfo ? SourceCodeInfo.toAmino(message.sourceCodeInfo) : undefined; + obj.syntax = message.syntax === "" ? undefined : message.syntax; + obj.edition = message.edition === 1 ? undefined : message.edition; + return obj; + }, + fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { + return FileDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorProtoProtoMsg): FileDescriptorProto { + return FileDescriptorProto.decode(message.value); + }, + toProto(message: FileDescriptorProto): Uint8Array { + return FileDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorProto): FileDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorProto", + value: FileDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorProto.typeUrl, FileDescriptorProto); +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const DescriptorProto = { + typeUrl: "/google.protobuf.DescriptorProto", + is(o: any): o is DescriptorProto { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.is(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && Array.isArray(o.nestedType) && (!o.nestedType.length || DescriptorProto.is(o.nestedType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.extensionRange) && (!o.extensionRange.length || DescriptorProto_ExtensionRange.is(o.extensionRange[0])) && Array.isArray(o.oneofDecl) && (!o.oneofDecl.length || OneofDescriptorProto.is(o.oneofDecl[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || DescriptorProto_ReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isAmino(o: any): o is DescriptorProtoAmino { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.isAmino(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && Array.isArray(o.nested_type) && (!o.nested_type.length || DescriptorProto.isAmino(o.nested_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.extension_range) && (!o.extension_range.length || DescriptorProto_ExtensionRange.isAmino(o.extension_range[0])) && Array.isArray(o.oneof_decl) && (!o.oneof_decl.length || OneofDescriptorProto.isAmino(o.oneof_decl[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || DescriptorProto_ReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map(e => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map(e => OneofDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? MessageOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: DescriptorProtoAmino): DescriptorProto { + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: DescriptorProto): DescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.field) { + obj.field = message.field.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.field = message.field; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + if (message.nestedType) { + obj.nested_type = message.nestedType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.nested_type = message.nestedType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.extensionRange) { + obj.extension_range = message.extensionRange.map(e => e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined); + } else { + obj.extension_range = message.extensionRange; + } + if (message.oneofDecl) { + obj.oneof_decl = message.oneofDecl.map(e => e ? OneofDescriptorProto.toAmino(e) : undefined); + } else { + obj.oneof_decl = message.oneofDecl; + } + obj.options = message.options ? MessageOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? DescriptorProto_ReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: DescriptorProtoAminoMsg): DescriptorProto { + return DescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProtoProtoMsg): DescriptorProto { + return DescriptorProto.decode(message.value); + }, + toProto(message: DescriptorProto): Uint8Array { + return DescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto): DescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.DescriptorProto", + value: DescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto.typeUrl, DescriptorProto); +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { + start: 0, + end: 0, + options: undefined + }; +} +export const DescriptorProto_ExtensionRange = { + typeUrl: "/google.protobuf.ExtensionRange", + is(o: any): o is DescriptorProto_ExtensionRange { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ExtensionRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = object.options !== undefined && object.options !== null ? ExtensionRangeOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + obj.options = message.options ? ExtensionRangeOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ExtensionRangeAminoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ExtensionRangeProtoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.decode(message.value); + }, + toProto(message: DescriptorProto_ExtensionRange): Uint8Array { + return DescriptorProto_ExtensionRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRange", + value: DescriptorProto_ExtensionRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto_ExtensionRange.typeUrl, DescriptorProto_ExtensionRange); +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { + start: 0, + end: 0 + }; +} +export const DescriptorProto_ReservedRange = { + typeUrl: "/google.protobuf.ReservedRange", + is(o: any): o is DescriptorProto_ReservedRange { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ReservedRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ReservedRangeAminoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ReservedRangeProtoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.decode(message.value); + }, + toProto(message: DescriptorProto_ReservedRange): Uint8Array { + return DescriptorProto_ReservedRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ReservedRange", + value: DescriptorProto_ReservedRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto_ReservedRange.typeUrl, DescriptorProto_ReservedRange); +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { + uninterpretedOption: [], + declaration: [], + features: undefined, + verification: 1 + }; +} +export const ExtensionRangeOptions = { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + is(o: any): o is ExtensionRangeOptions { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0])) && Array.isArray(o.declaration) && (!o.declaration.length || ExtensionRangeOptions_Declaration.is(o.declaration[0])) && isSet(o.verification)); + }, + isAmino(o: any): o is ExtensionRangeOptionsAmino { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0])) && Array.isArray(o.declaration) && (!o.declaration.length || ExtensionRangeOptions_Declaration.isAmino(o.declaration[0])) && isSet(o.verification)); + }, + encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + for (const v of message.declaration) { + ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim(); + } + if (message.verification !== 1) { + writer.uint32(24).int32(message.verification); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + case 2: + message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32())); + break; + case 50: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 3: + message.verification = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + message.declaration = object.declaration?.map(e => ExtensionRangeOptions_Declaration.fromPartial(e)) || []; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.verification = object.verification ?? 1; + return message; + }, + fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + message.declaration = object.declaration?.map(e => ExtensionRangeOptions_Declaration.fromAmino(e)) || []; + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.verification !== undefined && object.verification !== null) { + message.verification = object.verification; + } + return message; + }, + toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + if (message.declaration) { + obj.declaration = message.declaration.map(e => e ? ExtensionRangeOptions_Declaration.toAmino(e) : undefined); + } else { + obj.declaration = message.declaration; + } + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.verification = message.verification === 1 ? undefined : message.verification; + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptionsAminoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptionsProtoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.decode(message.value); + }, + toProto(message: ExtensionRangeOptions): Uint8Array { + return ExtensionRangeOptions.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions): ExtensionRangeOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + value: ExtensionRangeOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionRangeOptions.typeUrl, ExtensionRangeOptions); +function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration { + return { + number: 0, + fullName: "", + type: "", + reserved: false, + repeated: false + }; +} +export const ExtensionRangeOptions_Declaration = { + typeUrl: "/google.protobuf.Declaration", + is(o: any): o is ExtensionRangeOptions_Declaration { + return o && (o.$typeUrl === ExtensionRangeOptions_Declaration.typeUrl || typeof o.number === "number" && typeof o.fullName === "string" && typeof o.type === "string" && typeof o.reserved === "boolean" && typeof o.repeated === "boolean"); + }, + isAmino(o: any): o is ExtensionRangeOptions_DeclarationAmino { + return o && (o.$typeUrl === ExtensionRangeOptions_Declaration.typeUrl || typeof o.number === "number" && typeof o.full_name === "string" && typeof o.type === "string" && typeof o.reserved === "boolean" && typeof o.repeated === "boolean"); + }, + encode(message: ExtensionRangeOptions_Declaration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.number !== 0) { + writer.uint32(8).int32(message.number); + } + if (message.fullName !== "") { + writer.uint32(18).string(message.fullName); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.reserved === true) { + writer.uint32(40).bool(message.reserved); + } + if (message.repeated === true) { + writer.uint32(48).bool(message.repeated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions_Declaration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.number = reader.int32(); + break; + case 2: + message.fullName = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + case 5: + message.reserved = reader.bool(); + break; + case 6: + message.repeated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + message.number = object.number ?? 0; + message.fullName = object.fullName ?? ""; + message.type = object.type ?? ""; + message.reserved = object.reserved ?? false; + message.repeated = object.repeated ?? false; + return message; + }, + fromAmino(object: ExtensionRangeOptions_DeclarationAmino): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.full_name !== undefined && object.full_name !== null) { + message.fullName = object.full_name; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.reserved !== undefined && object.reserved !== null) { + message.reserved = object.reserved; + } + if (object.repeated !== undefined && object.repeated !== null) { + message.repeated = object.repeated; + } + return message; + }, + toAmino(message: ExtensionRangeOptions_Declaration): ExtensionRangeOptions_DeclarationAmino { + const obj: any = {}; + obj.number = message.number === 0 ? undefined : message.number; + obj.full_name = message.fullName === "" ? undefined : message.fullName; + obj.type = message.type === "" ? undefined : message.type; + obj.reserved = message.reserved === false ? undefined : message.reserved; + obj.repeated = message.repeated === false ? undefined : message.repeated; + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptions_DeclarationAminoMsg): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptions_DeclarationProtoMsg): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.decode(message.value); + }, + toProto(message: ExtensionRangeOptions_Declaration): Uint8Array { + return ExtensionRangeOptions_Declaration.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions_Declaration): ExtensionRangeOptions_DeclarationProtoMsg { + return { + typeUrl: "/google.protobuf.Declaration", + value: ExtensionRangeOptions_Declaration.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionRangeOptions_Declaration.typeUrl, ExtensionRangeOptions_Declaration); +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false + }; +} +export const FieldDescriptorProto = { + typeUrl: "/google.protobuf.FieldDescriptorProto", + is(o: any): o is FieldDescriptorProto { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.typeName === "string" && typeof o.extendee === "string" && typeof o.defaultValue === "string" && typeof o.oneofIndex === "number" && typeof o.jsonName === "string" && typeof o.proto3Optional === "boolean"); + }, + isAmino(o: any): o is FieldDescriptorProtoAmino { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.type_name === "string" && typeof o.extendee === "string" && typeof o.default_value === "string" && typeof o.oneof_index === "number" && typeof o.json_name === "string" && typeof o.proto3_optional === "boolean"); + }, + encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = (reader.int32() as any); + break; + case 5: + message.type = (reader.int32() as any); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = object.options !== undefined && object.options !== null ? FieldOptions.fromPartial(object.options) : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, + fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + if (object.proto3_optional !== undefined && object.proto3_optional !== null) { + message.proto3Optional = object.proto3_optional; + } + return message; + }, + toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.label = message.label === 1 ? undefined : message.label; + obj.type = message.type === 1 ? undefined : message.type; + obj.type_name = message.typeName === "" ? undefined : message.typeName; + obj.extendee = message.extendee === "" ? undefined : message.extendee; + obj.default_value = message.defaultValue === "" ? undefined : message.defaultValue; + obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; + obj.json_name = message.jsonName === "" ? undefined : message.jsonName; + obj.options = message.options ? FieldOptions.toAmino(message.options) : undefined; + obj.proto3_optional = message.proto3Optional === false ? undefined : message.proto3Optional; + return obj; + }, + fromAminoMsg(object: FieldDescriptorProtoAminoMsg): FieldDescriptorProto { + return FieldDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FieldDescriptorProtoProtoMsg): FieldDescriptorProto { + return FieldDescriptorProto.decode(message.value); + }, + toProto(message: FieldDescriptorProto): Uint8Array { + return FieldDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FieldDescriptorProto): FieldDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FieldDescriptorProto", + value: FieldDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldDescriptorProto.typeUrl, FieldDescriptorProto); +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { + name: "", + options: undefined + }; +} +export const OneofDescriptorProto = { + typeUrl: "/google.protobuf.OneofDescriptorProto", + is(o: any): o is OneofDescriptorProto { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is OneofDescriptorProtoAmino { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = object.options !== undefined && object.options !== null ? OneofOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.options = message.options ? OneofOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: OneofDescriptorProtoAminoMsg): OneofDescriptorProto { + return OneofDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: OneofDescriptorProtoProtoMsg): OneofDescriptorProto { + return OneofDescriptorProto.decode(message.value); + }, + toProto(message: OneofDescriptorProto): Uint8Array { + return OneofDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: OneofDescriptorProto): OneofDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.OneofDescriptorProto", + value: OneofDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OneofDescriptorProto.typeUrl, OneofDescriptorProto); +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + name: "", + value: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const EnumDescriptorProto = { + typeUrl: "/google.protobuf.EnumDescriptorProto", + is(o: any): o is EnumDescriptorProto { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.is(o.value[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || EnumDescriptorProto_EnumReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isAmino(o: any): o is EnumDescriptorProtoAmino { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.isAmino(o.value[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || EnumDescriptorProto_EnumReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map(e => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? EnumOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.value) { + obj.value = message.value.map(e => e ? EnumValueDescriptorProto.toAmino(e) : undefined); + } else { + obj.value = message.value; + } + obj.options = message.options ? EnumOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: EnumDescriptorProtoAminoMsg): EnumDescriptorProto { + return EnumDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProtoProtoMsg): EnumDescriptorProto { + return EnumDescriptorProto.decode(message.value); + }, + toProto(message: EnumDescriptorProto): Uint8Array { + return EnumDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto): EnumDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumDescriptorProto", + value: EnumDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumDescriptorProto.typeUrl, EnumDescriptorProto); +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { + start: 0, + end: 0 + }; +} +export const EnumDescriptorProto_EnumReservedRange = { + typeUrl: "/google.protobuf.EnumReservedRange", + is(o: any): o is EnumDescriptorProto_EnumReservedRange { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is EnumDescriptorProto_EnumReservedRangeAmino { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: EnumDescriptorProto_EnumReservedRangeAminoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProto_EnumReservedRangeProtoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.decode(message.value); + }, + toProto(message: EnumDescriptorProto_EnumReservedRange): Uint8Array { + return EnumDescriptorProto_EnumReservedRange.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.EnumReservedRange", + value: EnumDescriptorProto_EnumReservedRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumDescriptorProto_EnumReservedRange.typeUrl, EnumDescriptorProto_EnumReservedRange); +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { + name: "", + number: 0, + options: undefined + }; +} +export const EnumValueDescriptorProto = { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + is(o: any): o is EnumValueDescriptorProto { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + isAmino(o: any): o is EnumValueDescriptorProtoAmino { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = object.options !== undefined && object.options !== null ? EnumValueOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.options = message.options ? EnumValueOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: EnumValueDescriptorProtoAminoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueDescriptorProtoProtoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.decode(message.value); + }, + toProto(message: EnumValueDescriptorProto): Uint8Array { + return EnumValueDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumValueDescriptorProto): EnumValueDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + value: EnumValueDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumValueDescriptorProto.typeUrl, EnumValueDescriptorProto); +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { + name: "", + method: [], + options: undefined + }; +} +export const ServiceDescriptorProto = { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + is(o: any): o is ServiceDescriptorProto { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.is(o.method[0]))); + }, + isAmino(o: any): o is ServiceDescriptorProtoAmino { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.isAmino(o.method[0]))); + }, + encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map(e => MethodDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? ServiceOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.method) { + obj.method = message.method.map(e => e ? MethodDescriptorProto.toAmino(e) : undefined); + } else { + obj.method = message.method; + } + obj.options = message.options ? ServiceOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: ServiceDescriptorProtoAminoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceDescriptorProtoProtoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.decode(message.value); + }, + toProto(message: ServiceDescriptorProto): Uint8Array { + return ServiceDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: ServiceDescriptorProto): ServiceDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + value: ServiceDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ServiceDescriptorProto.typeUrl, ServiceDescriptorProto); +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false + }; +} +export const MethodDescriptorProto = { + typeUrl: "/google.protobuf.MethodDescriptorProto", + is(o: any): o is MethodDescriptorProto { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.inputType === "string" && typeof o.outputType === "string" && typeof o.clientStreaming === "boolean" && typeof o.serverStreaming === "boolean"); + }, + isAmino(o: any): o is MethodDescriptorProtoAmino { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.input_type === "string" && typeof o.output_type === "string" && typeof o.client_streaming === "boolean" && typeof o.server_streaming === "boolean"); + }, + encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = object.options !== undefined && object.options !== null ? MethodOptions.fromPartial(object.options) : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, + fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; + }, + toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.input_type = message.inputType === "" ? undefined : message.inputType; + obj.output_type = message.outputType === "" ? undefined : message.outputType; + obj.options = message.options ? MethodOptions.toAmino(message.options) : undefined; + obj.client_streaming = message.clientStreaming === false ? undefined : message.clientStreaming; + obj.server_streaming = message.serverStreaming === false ? undefined : message.serverStreaming; + return obj; + }, + fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { + return MethodDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: MethodDescriptorProtoProtoMsg): MethodDescriptorProto { + return MethodDescriptorProto.decode(message.value); + }, + toProto(message: MethodDescriptorProto): Uint8Array { + return MethodDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: MethodDescriptorProto): MethodDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.MethodDescriptorProto", + value: MethodDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MethodDescriptorProto.typeUrl, MethodDescriptorProto); +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + features: undefined, + uninterpretedOption: [] + }; +} +export const FileOptions = { + typeUrl: "/google.protobuf.FileOptions", + is(o: any): o is FileOptions { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.javaPackage === "string" && typeof o.javaOuterClassname === "string" && typeof o.javaMultipleFiles === "boolean" && typeof o.javaGenerateEqualsAndHash === "boolean" && typeof o.javaStringCheckUtf8 === "boolean" && isSet(o.optimizeFor) && typeof o.goPackage === "string" && typeof o.ccGenericServices === "boolean" && typeof o.javaGenericServices === "boolean" && typeof o.pyGenericServices === "boolean" && typeof o.deprecated === "boolean" && typeof o.ccEnableArenas === "boolean" && typeof o.objcClassPrefix === "string" && typeof o.csharpNamespace === "string" && typeof o.swiftPrefix === "string" && typeof o.phpClassPrefix === "string" && typeof o.phpNamespace === "string" && typeof o.phpMetadataNamespace === "string" && typeof o.rubyPackage === "string" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is FileOptionsAmino { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.java_package === "string" && typeof o.java_outer_classname === "string" && typeof o.java_multiple_files === "boolean" && typeof o.java_generate_equals_and_hash === "boolean" && typeof o.java_string_check_utf8 === "boolean" && isSet(o.optimize_for) && typeof o.go_package === "string" && typeof o.cc_generic_services === "boolean" && typeof o.java_generic_services === "boolean" && typeof o.py_generic_services === "boolean" && typeof o.deprecated === "boolean" && typeof o.cc_enable_arenas === "boolean" && typeof o.objc_class_prefix === "string" && typeof o.csharp_namespace === "string" && typeof o.swift_prefix === "string" && typeof o.php_class_prefix === "string" && typeof o.php_namespace === "string" && typeof o.php_metadata_namespace === "string" && typeof o.ruby_package === "string" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = (reader.int32() as any); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 50: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileOptionsAmino): FileOptions { + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = object.optimize_for; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileOptions): FileOptionsAmino { + const obj: any = {}; + obj.java_package = message.javaPackage === "" ? undefined : message.javaPackage; + obj.java_outer_classname = message.javaOuterClassname === "" ? undefined : message.javaOuterClassname; + obj.java_multiple_files = message.javaMultipleFiles === false ? undefined : message.javaMultipleFiles; + obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash === false ? undefined : message.javaGenerateEqualsAndHash; + obj.java_string_check_utf8 = message.javaStringCheckUtf8 === false ? undefined : message.javaStringCheckUtf8; + obj.optimize_for = message.optimizeFor === 1 ? undefined : message.optimizeFor; + obj.go_package = message.goPackage === "" ? undefined : message.goPackage; + obj.cc_generic_services = message.ccGenericServices === false ? undefined : message.ccGenericServices; + obj.java_generic_services = message.javaGenericServices === false ? undefined : message.javaGenericServices; + obj.py_generic_services = message.pyGenericServices === false ? undefined : message.pyGenericServices; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.cc_enable_arenas = message.ccEnableArenas === false ? undefined : message.ccEnableArenas; + obj.objc_class_prefix = message.objcClassPrefix === "" ? undefined : message.objcClassPrefix; + obj.csharp_namespace = message.csharpNamespace === "" ? undefined : message.csharpNamespace; + obj.swift_prefix = message.swiftPrefix === "" ? undefined : message.swiftPrefix; + obj.php_class_prefix = message.phpClassPrefix === "" ? undefined : message.phpClassPrefix; + obj.php_namespace = message.phpNamespace === "" ? undefined : message.phpNamespace; + obj.php_metadata_namespace = message.phpMetadataNamespace === "" ? undefined : message.phpMetadataNamespace; + obj.ruby_package = message.rubyPackage === "" ? undefined : message.rubyPackage; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FileOptionsAminoMsg): FileOptions { + return FileOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FileOptionsProtoMsg): FileOptions { + return FileOptions.decode(message.value); + }, + toProto(message: FileOptions): Uint8Array { + return FileOptions.encode(message).finish(); + }, + toProtoMsg(message: FileOptions): FileOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FileOptions", + value: FileOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileOptions.typeUrl, FileOptions); +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [] + }; +} +export const MessageOptions = { + typeUrl: "/google.protobuf.MessageOptions", + is(o: any): o is MessageOptions { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.messageSetWireFormat === "boolean" && typeof o.noStandardDescriptorAccessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.mapEntry === "boolean" && typeof o.deprecatedLegacyJsonFieldConflicts === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is MessageOptionsAmino { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.message_set_wire_format === "boolean" && typeof o.no_standard_descriptor_accessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.map_entry === "boolean" && typeof o.deprecated_legacy_json_field_conflicts === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 11: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case 12: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MessageOptionsAmino): MessageOptions { + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + if (object.deprecated_legacy_json_field_conflicts !== undefined && object.deprecated_legacy_json_field_conflicts !== null) { + message.deprecatedLegacyJsonFieldConflicts = object.deprecated_legacy_json_field_conflicts; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MessageOptions): MessageOptionsAmino { + const obj: any = {}; + obj.message_set_wire_format = message.messageSetWireFormat === false ? undefined : message.messageSetWireFormat; + obj.no_standard_descriptor_accessor = message.noStandardDescriptorAccessor === false ? undefined : message.noStandardDescriptorAccessor; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; + obj.deprecated_legacy_json_field_conflicts = message.deprecatedLegacyJsonFieldConflicts === false ? undefined : message.deprecatedLegacyJsonFieldConflicts; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MessageOptionsAminoMsg): MessageOptions { + return MessageOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MessageOptionsProtoMsg): MessageOptions { + return MessageOptions.decode(message.value); + }, + toProto(message: MessageOptions): Uint8Array { + return MessageOptions.encode(message).finish(); + }, + toProtoMsg(message: MessageOptions): MessageOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MessageOptions", + value: MessageOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MessageOptions.typeUrl, MessageOptions); +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 1, + packed: false, + jstype: 1, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 1, + targets: [], + editionDefaults: [], + features: undefined, + featureSupport: undefined, + uninterpretedOption: [] + }; +} +export const FieldOptions = { + typeUrl: "/google.protobuf.FieldOptions", + is(o: any): o is FieldOptions { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.unverifiedLazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && typeof o.debugRedact === "boolean" && isSet(o.retention) && Array.isArray(o.targets) && Array.isArray(o.editionDefaults) && (!o.editionDefaults.length || FieldOptions_EditionDefault.is(o.editionDefaults[0])) && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is FieldOptionsAmino { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.unverified_lazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && typeof o.debug_redact === "boolean" && isSet(o.retention) && Array.isArray(o.targets) && Array.isArray(o.edition_defaults) && (!o.edition_defaults.length || FieldOptions_EditionDefault.isAmino(o.edition_defaults[0])) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ctype !== 1) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 1) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy === true) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + if (message.debugRedact === true) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== 1) { + writer.uint32(136).int32(message.retention); + } + writer.uint32(154).fork(); + for (const v of message.targets) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.editionDefaults) { + FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).ldelim(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim(); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = (reader.int32() as any); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = (reader.int32() as any); + break; + case 5: + message.lazy = reader.bool(); + break; + case 15: + message.unverifiedLazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 16: + message.debugRedact = reader.bool(); + break; + case 17: + message.retention = (reader.int32() as any); + break; + case 19: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.targets.push((reader.int32() as any)); + } + } else { + message.targets.push((reader.int32() as any)); + } + break; + case 20: + message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32())); + break; + case 21: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 22: + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 1; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 1; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 1; + message.targets = object.targets?.map(e => e) || []; + message.editionDefaults = object.editionDefaults?.map(e => FieldOptions_EditionDefault.fromPartial(e)) || []; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.featureSupport = object.featureSupport !== undefined && object.featureSupport !== null ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FieldOptionsAmino): FieldOptions { + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.unverified_lazy !== undefined && object.unverified_lazy !== null) { + message.unverifiedLazy = object.unverified_lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + if (object.debug_redact !== undefined && object.debug_redact !== null) { + message.debugRedact = object.debug_redact; + } + if (object.retention !== undefined && object.retention !== null) { + message.retention = object.retention; + } + message.targets = object.targets?.map(e => e) || []; + message.editionDefaults = object.edition_defaults?.map(e => FieldOptions_EditionDefault.fromAmino(e)) || []; + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.feature_support !== undefined && object.feature_support !== null) { + message.featureSupport = FieldOptions_FeatureSupport.fromAmino(object.feature_support); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FieldOptions): FieldOptionsAmino { + const obj: any = {}; + obj.ctype = message.ctype === 1 ? undefined : message.ctype; + obj.packed = message.packed === false ? undefined : message.packed; + obj.jstype = message.jstype === 1 ? undefined : message.jstype; + obj.lazy = message.lazy === false ? undefined : message.lazy; + obj.unverified_lazy = message.unverifiedLazy === false ? undefined : message.unverifiedLazy; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.weak = message.weak === false ? undefined : message.weak; + obj.debug_redact = message.debugRedact === false ? undefined : message.debugRedact; + obj.retention = message.retention === 1 ? undefined : message.retention; + if (message.targets) { + obj.targets = message.targets.map(e => e); + } else { + obj.targets = message.targets; + } + if (message.editionDefaults) { + obj.edition_defaults = message.editionDefaults.map(e => e ? FieldOptions_EditionDefault.toAmino(e) : undefined); + } else { + obj.edition_defaults = message.editionDefaults; + } + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.feature_support = message.featureSupport ? FieldOptions_FeatureSupport.toAmino(message.featureSupport) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FieldOptionsAminoMsg): FieldOptions { + return FieldOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptionsProtoMsg): FieldOptions { + return FieldOptions.decode(message.value); + }, + toProto(message: FieldOptions): Uint8Array { + return FieldOptions.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions): FieldOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FieldOptions", + value: FieldOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions.typeUrl, FieldOptions); +function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault { + return { + edition: 1, + value: "" + }; +} +export const FieldOptions_EditionDefault = { + typeUrl: "/google.protobuf.EditionDefault", + is(o: any): o is FieldOptions_EditionDefault { + return o && (o.$typeUrl === FieldOptions_EditionDefault.typeUrl || isSet(o.edition) && typeof o.value === "string"); + }, + isAmino(o: any): o is FieldOptions_EditionDefaultAmino { + return o && (o.$typeUrl === FieldOptions_EditionDefault.typeUrl || isSet(o.edition) && typeof o.value === "string"); + }, + encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.edition !== 1) { + writer.uint32(24).int32(message.edition); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_EditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.edition = (reader.int32() as any); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + message.edition = object.edition ?? 1; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: FieldOptions_EditionDefaultAmino): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: FieldOptions_EditionDefault): FieldOptions_EditionDefaultAmino { + const obj: any = {}; + obj.edition = message.edition === 1 ? undefined : message.edition; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: FieldOptions_EditionDefaultAminoMsg): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptions_EditionDefaultProtoMsg): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.decode(message.value); + }, + toProto(message: FieldOptions_EditionDefault): Uint8Array { + return FieldOptions_EditionDefault.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions_EditionDefault): FieldOptions_EditionDefaultProtoMsg { + return { + typeUrl: "/google.protobuf.EditionDefault", + value: FieldOptions_EditionDefault.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions_EditionDefault.typeUrl, FieldOptions_EditionDefault); +function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport { + return { + editionIntroduced: 1, + editionDeprecated: 1, + deprecationWarning: "", + editionRemoved: 1 + }; +} +export const FieldOptions_FeatureSupport = { + typeUrl: "/google.protobuf.FeatureSupport", + is(o: any): o is FieldOptions_FeatureSupport { + return o && (o.$typeUrl === FieldOptions_FeatureSupport.typeUrl || isSet(o.editionIntroduced) && isSet(o.editionDeprecated) && typeof o.deprecationWarning === "string" && isSet(o.editionRemoved)); + }, + isAmino(o: any): o is FieldOptions_FeatureSupportAmino { + return o && (o.$typeUrl === FieldOptions_FeatureSupport.typeUrl || isSet(o.edition_introduced) && isSet(o.edition_deprecated) && typeof o.deprecation_warning === "string" && isSet(o.edition_removed)); + }, + encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.editionIntroduced !== 1) { + writer.uint32(8).int32(message.editionIntroduced); + } + if (message.editionDeprecated !== 1) { + writer.uint32(16).int32(message.editionDeprecated); + } + if (message.deprecationWarning !== "") { + writer.uint32(26).string(message.deprecationWarning); + } + if (message.editionRemoved !== 1) { + writer.uint32(32).int32(message.editionRemoved); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_FeatureSupport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.editionIntroduced = (reader.int32() as any); + break; + case 2: + message.editionDeprecated = (reader.int32() as any); + break; + case 3: + message.deprecationWarning = reader.string(); + break; + case 4: + message.editionRemoved = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + message.editionIntroduced = object.editionIntroduced ?? 1; + message.editionDeprecated = object.editionDeprecated ?? 1; + message.deprecationWarning = object.deprecationWarning ?? ""; + message.editionRemoved = object.editionRemoved ?? 1; + return message; + }, + fromAmino(object: FieldOptions_FeatureSupportAmino): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + if (object.edition_introduced !== undefined && object.edition_introduced !== null) { + message.editionIntroduced = object.edition_introduced; + } + if (object.edition_deprecated !== undefined && object.edition_deprecated !== null) { + message.editionDeprecated = object.edition_deprecated; + } + if (object.deprecation_warning !== undefined && object.deprecation_warning !== null) { + message.deprecationWarning = object.deprecation_warning; + } + if (object.edition_removed !== undefined && object.edition_removed !== null) { + message.editionRemoved = object.edition_removed; + } + return message; + }, + toAmino(message: FieldOptions_FeatureSupport): FieldOptions_FeatureSupportAmino { + const obj: any = {}; + obj.edition_introduced = message.editionIntroduced === 1 ? undefined : message.editionIntroduced; + obj.edition_deprecated = message.editionDeprecated === 1 ? undefined : message.editionDeprecated; + obj.deprecation_warning = message.deprecationWarning === "" ? undefined : message.deprecationWarning; + obj.edition_removed = message.editionRemoved === 1 ? undefined : message.editionRemoved; + return obj; + }, + fromAminoMsg(object: FieldOptions_FeatureSupportAminoMsg): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptions_FeatureSupportProtoMsg): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.decode(message.value); + }, + toProto(message: FieldOptions_FeatureSupport): Uint8Array { + return FieldOptions_FeatureSupport.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions_FeatureSupport): FieldOptions_FeatureSupportProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSupport", + value: FieldOptions_FeatureSupport.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions_FeatureSupport.typeUrl, FieldOptions_FeatureSupport); +function createBaseOneofOptions(): OneofOptions { + return { + features: undefined, + uninterpretedOption: [] + }; +} +export const OneofOptions = { + typeUrl: "/google.protobuf.OneofOptions", + is(o: any): o is OneofOptions { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is OneofOptionsAmino { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofOptions { + const message = createBaseOneofOptions(); + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OneofOptionsAmino): OneofOptions { + const message = createBaseOneofOptions(); + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: OneofOptions): OneofOptionsAmino { + const obj: any = {}; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: OneofOptionsAminoMsg): OneofOptions { + return OneofOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OneofOptionsProtoMsg): OneofOptions { + return OneofOptions.decode(message.value); + }, + toProto(message: OneofOptions): Uint8Array { + return OneofOptions.encode(message).finish(); + }, + toProtoMsg(message: OneofOptions): OneofOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.OneofOptions", + value: OneofOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OneofOptions.typeUrl, OneofOptions); +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [] + }; +} +export const EnumOptions = { + typeUrl: "/google.protobuf.EnumOptions", + is(o: any): o is EnumOptions { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allowAlias === "boolean" && typeof o.deprecated === "boolean" && typeof o.deprecatedLegacyJsonFieldConflicts === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is EnumOptionsAmino { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allow_alias === "boolean" && typeof o.deprecated === "boolean" && typeof o.deprecated_legacy_json_field_conflicts === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 6: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case 7: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumOptionsAmino): EnumOptions { + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.deprecated_legacy_json_field_conflicts !== undefined && object.deprecated_legacy_json_field_conflicts !== null) { + message.deprecatedLegacyJsonFieldConflicts = object.deprecated_legacy_json_field_conflicts; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumOptions): EnumOptionsAmino { + const obj: any = {}; + obj.allow_alias = message.allowAlias === false ? undefined : message.allowAlias; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.deprecated_legacy_json_field_conflicts = message.deprecatedLegacyJsonFieldConflicts === false ? undefined : message.deprecatedLegacyJsonFieldConflicts; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumOptionsAminoMsg): EnumOptions { + return EnumOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumOptionsProtoMsg): EnumOptions { + return EnumOptions.decode(message.value); + }, + toProto(message: EnumOptions): Uint8Array { + return EnumOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumOptions): EnumOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumOptions", + value: EnumOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumOptions.typeUrl, EnumOptions); +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + features: undefined, + debugRedact: false, + featureSupport: undefined, + uninterpretedOption: [] + }; +} +export const EnumValueOptions = { + typeUrl: "/google.protobuf.EnumValueOptions", + is(o: any): o is EnumValueOptions { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && typeof o.debugRedact === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is EnumValueOptionsAmino { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && typeof o.debug_redact === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim(); + } + if (message.debugRedact === true) { + writer.uint32(24).bool(message.debugRedact); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 2: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 3: + message.debugRedact = reader.bool(); + break; + case 4: + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.debugRedact = object.debugRedact ?? false; + message.featureSupport = object.featureSupport !== undefined && object.featureSupport !== null ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.debug_redact !== undefined && object.debug_redact !== null) { + message.debugRedact = object.debug_redact; + } + if (object.feature_support !== undefined && object.feature_support !== null) { + message.featureSupport = FieldOptions_FeatureSupport.fromAmino(object.feature_support); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumValueOptions): EnumValueOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.debug_redact = message.debugRedact === false ? undefined : message.debugRedact; + obj.feature_support = message.featureSupport ? FieldOptions_FeatureSupport.toAmino(message.featureSupport) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumValueOptionsAminoMsg): EnumValueOptions { + return EnumValueOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueOptionsProtoMsg): EnumValueOptions { + return EnumValueOptions.decode(message.value); + }, + toProto(message: EnumValueOptions): Uint8Array { + return EnumValueOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumValueOptions): EnumValueOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueOptions", + value: EnumValueOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumValueOptions.typeUrl, EnumValueOptions); +function createBaseServiceOptions(): ServiceOptions { + return { + features: undefined, + deprecated: false, + uninterpretedOption: [] + }; +} +export const ServiceOptions = { + typeUrl: "/google.protobuf.ServiceOptions", + is(o: any): o is ServiceOptions { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is ServiceOptionsAmino { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(274).fork()).ldelim(); + } + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 34: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceOptions { + const message = createBaseServiceOptions(); + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ServiceOptionsAmino): ServiceOptions { + const message = createBaseServiceOptions(); + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: ServiceOptions): ServiceOptionsAmino { + const obj: any = {}; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ServiceOptionsAminoMsg): ServiceOptions { + return ServiceOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceOptionsProtoMsg): ServiceOptions { + return ServiceOptions.decode(message.value); + }, + toProto(message: ServiceOptions): Uint8Array { + return ServiceOptions.encode(message).finish(); + }, + toProtoMsg(message: ServiceOptions): ServiceOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceOptions", + value: ServiceOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ServiceOptions.typeUrl, ServiceOptions); +function createBaseMethodOptions(): MethodOptions { + return { + deprecated: false, + idempotencyLevel: 1, + features: undefined, + uninterpretedOption: [] + }; +} +export const MethodOptions = { + typeUrl: "/google.protobuf.MethodOptions", + is(o: any): o is MethodOptions { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotencyLevel) && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is MethodOptionsAmino { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotency_level) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 1) { + writer.uint32(272).int32(message.idempotencyLevel); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(282).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = (reader.int32() as any); + break; + case 35: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 1; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MethodOptionsAmino): MethodOptions { + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + message.idempotencyLevel = object.idempotency_level; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MethodOptions): MethodOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.idempotency_level = message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MethodOptionsAminoMsg): MethodOptions { + return MethodOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MethodOptionsProtoMsg): MethodOptions { + return MethodOptions.decode(message.value); + }, + toProto(message: MethodOptions): Uint8Array { + return MethodOptions.encode(message).finish(); + }, + toProtoMsg(message: MethodOptions): MethodOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MethodOptions", + value: MethodOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MethodOptions.typeUrl, MethodOptions); +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "" + }; +} +export const UninterpretedOption = { + typeUrl: "/google.protobuf.UninterpretedOption", + is(o: any): o is UninterpretedOption { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.is(o.name[0])) && typeof o.identifierValue === "string" && typeof o.positiveIntValue === "bigint" && typeof o.negativeIntValue === "bigint" && typeof o.doubleValue === "number" && (o.stringValue instanceof Uint8Array || typeof o.stringValue === "string") && typeof o.aggregateValue === "string"); + }, + isAmino(o: any): o is UninterpretedOptionAmino { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.isAmino(o.name[0])) && typeof o.identifier_value === "string" && typeof o.positive_int_value === "bigint" && typeof o.negative_int_value === "bigint" && typeof o.double_value === "number" && (o.string_value instanceof Uint8Array || typeof o.string_value === "string") && typeof o.aggregate_value === "string"); + }, + encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== BigInt(0)) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== BigInt(0)) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = object.positiveIntValue !== undefined && object.positiveIntValue !== null ? BigInt(object.positiveIntValue.toString()) : BigInt(0); + message.negativeIntValue = object.negativeIntValue !== undefined && object.negativeIntValue !== null ? BigInt(object.negativeIntValue.toString()) : BigInt(0); + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, + fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; + }, + toAmino(message: UninterpretedOption): UninterpretedOptionAmino { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toAmino(e) : undefined); + } else { + obj.name = message.name; + } + obj.identifier_value = message.identifierValue === "" ? undefined : message.identifierValue; + obj.positive_int_value = message.positiveIntValue !== BigInt(0) ? message.positiveIntValue?.toString() : undefined; + obj.negative_int_value = message.negativeIntValue !== BigInt(0) ? message.negativeIntValue?.toString() : undefined; + obj.double_value = message.doubleValue === 0 ? undefined : message.doubleValue; + obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; + obj.aggregate_value = message.aggregateValue === "" ? undefined : message.aggregateValue; + return obj; + }, + fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { + return UninterpretedOption.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOptionProtoMsg): UninterpretedOption { + return UninterpretedOption.decode(message.value); + }, + toProto(message: UninterpretedOption): Uint8Array { + return UninterpretedOption.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption): UninterpretedOptionProtoMsg { + return { + typeUrl: "/google.protobuf.UninterpretedOption", + value: UninterpretedOption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UninterpretedOption.typeUrl, UninterpretedOption); +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { + namePart: "", + isExtension: false + }; +} +export const UninterpretedOption_NamePart = { + typeUrl: "/google.protobuf.NamePart", + is(o: any): o is UninterpretedOption_NamePart { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.namePart === "string" && typeof o.isExtension === "boolean"); + }, + isAmino(o: any): o is UninterpretedOption_NamePartAmino { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.name_part === "string" && typeof o.is_extension === "boolean"); + }, + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, + fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; + }, + toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { + const obj: any = {}; + obj.name_part = message.namePart === "" ? undefined : message.namePart; + obj.is_extension = message.isExtension === false ? undefined : message.isExtension; + return obj; + }, + fromAminoMsg(object: UninterpretedOption_NamePartAminoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOption_NamePartProtoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.decode(message.value); + }, + toProto(message: UninterpretedOption_NamePart): Uint8Array { + return UninterpretedOption_NamePart.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartProtoMsg { + return { + typeUrl: "/google.protobuf.NamePart", + value: UninterpretedOption_NamePart.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UninterpretedOption_NamePart.typeUrl, UninterpretedOption_NamePart); +function createBaseFeatureSet(): FeatureSet { + return { + fieldPresence: 1, + enumType: 1, + repeatedFieldEncoding: 1, + utf8Validation: 0, + messageEncoding: 1, + jsonFormat: 1 + }; +} +export const FeatureSet = { + typeUrl: "/google.protobuf.FeatureSet", + is(o: any): o is FeatureSet { + return o && (o.$typeUrl === FeatureSet.typeUrl || isSet(o.fieldPresence) && isSet(o.enumType) && isSet(o.repeatedFieldEncoding) && isSet(o.utf8Validation) && isSet(o.messageEncoding) && isSet(o.jsonFormat)); + }, + isAmino(o: any): o is FeatureSetAmino { + return o && (o.$typeUrl === FeatureSet.typeUrl || isSet(o.field_presence) && isSet(o.enum_type) && isSet(o.repeated_field_encoding) && isSet(o.utf8_validation) && isSet(o.message_encoding) && isSet(o.json_format)); + }, + encode(message: FeatureSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fieldPresence !== 1) { + writer.uint32(8).int32(message.fieldPresence); + } + if (message.enumType !== 1) { + writer.uint32(16).int32(message.enumType); + } + if (message.repeatedFieldEncoding !== 1) { + writer.uint32(24).int32(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== 0) { + writer.uint32(32).int32(message.utf8Validation); + } + if (message.messageEncoding !== 1) { + writer.uint32(40).int32(message.messageEncoding); + } + if (message.jsonFormat !== 1) { + writer.uint32(48).int32(message.jsonFormat); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fieldPresence = (reader.int32() as any); + break; + case 2: + message.enumType = (reader.int32() as any); + break; + case 3: + message.repeatedFieldEncoding = (reader.int32() as any); + break; + case 4: + message.utf8Validation = (reader.int32() as any); + break; + case 5: + message.messageEncoding = (reader.int32() as any); + break; + case 6: + message.jsonFormat = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSet { + const message = createBaseFeatureSet(); + message.fieldPresence = object.fieldPresence ?? 1; + message.enumType = object.enumType ?? 1; + message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 1; + message.utf8Validation = object.utf8Validation ?? 0; + message.messageEncoding = object.messageEncoding ?? 1; + message.jsonFormat = object.jsonFormat ?? 1; + return message; + }, + fromAmino(object: FeatureSetAmino): FeatureSet { + const message = createBaseFeatureSet(); + if (object.field_presence !== undefined && object.field_presence !== null) { + message.fieldPresence = object.field_presence; + } + if (object.enum_type !== undefined && object.enum_type !== null) { + message.enumType = object.enum_type; + } + if (object.repeated_field_encoding !== undefined && object.repeated_field_encoding !== null) { + message.repeatedFieldEncoding = object.repeated_field_encoding; + } + if (object.utf8_validation !== undefined && object.utf8_validation !== null) { + message.utf8Validation = object.utf8_validation; + } + if (object.message_encoding !== undefined && object.message_encoding !== null) { + message.messageEncoding = object.message_encoding; + } + if (object.json_format !== undefined && object.json_format !== null) { + message.jsonFormat = object.json_format; + } + return message; + }, + toAmino(message: FeatureSet): FeatureSetAmino { + const obj: any = {}; + obj.field_presence = message.fieldPresence === 1 ? undefined : message.fieldPresence; + obj.enum_type = message.enumType === 1 ? undefined : message.enumType; + obj.repeated_field_encoding = message.repeatedFieldEncoding === 1 ? undefined : message.repeatedFieldEncoding; + obj.utf8_validation = message.utf8Validation === 0 ? undefined : message.utf8Validation; + obj.message_encoding = message.messageEncoding === 1 ? undefined : message.messageEncoding; + obj.json_format = message.jsonFormat === 1 ? undefined : message.jsonFormat; + return obj; + }, + fromAminoMsg(object: FeatureSetAminoMsg): FeatureSet { + return FeatureSet.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetProtoMsg): FeatureSet { + return FeatureSet.decode(message.value); + }, + toProto(message: FeatureSet): Uint8Array { + return FeatureSet.encode(message).finish(); + }, + toProtoMsg(message: FeatureSet): FeatureSetProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSet", + value: FeatureSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSet.typeUrl, FeatureSet); +function createBaseFeatureSetDefaults(): FeatureSetDefaults { + return { + defaults: [], + minimumEdition: 1, + maximumEdition: 1 + }; +} +export const FeatureSetDefaults = { + typeUrl: "/google.protobuf.FeatureSetDefaults", + is(o: any): o is FeatureSetDefaults { + return o && (o.$typeUrl === FeatureSetDefaults.typeUrl || Array.isArray(o.defaults) && (!o.defaults.length || FeatureSetDefaults_FeatureSetEditionDefault.is(o.defaults[0])) && isSet(o.minimumEdition) && isSet(o.maximumEdition)); + }, + isAmino(o: any): o is FeatureSetDefaultsAmino { + return o && (o.$typeUrl === FeatureSetDefaults.typeUrl || Array.isArray(o.defaults) && (!o.defaults.length || FeatureSetDefaults_FeatureSetEditionDefault.isAmino(o.defaults[0])) && isSet(o.minimum_edition) && isSet(o.maximum_edition)); + }, + encode(message: FeatureSetDefaults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.defaults) { + FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.minimumEdition !== 1) { + writer.uint32(32).int32(message.minimumEdition); + } + if (message.maximumEdition !== 1) { + writer.uint32(40).int32(message.maximumEdition); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + case 4: + message.minimumEdition = (reader.int32() as any); + break; + case 5: + message.maximumEdition = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map(e => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || []; + message.minimumEdition = object.minimumEdition ?? 1; + message.maximumEdition = object.maximumEdition ?? 1; + return message; + }, + fromAmino(object: FeatureSetDefaultsAmino): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map(e => FeatureSetDefaults_FeatureSetEditionDefault.fromAmino(e)) || []; + if (object.minimum_edition !== undefined && object.minimum_edition !== null) { + message.minimumEdition = object.minimum_edition; + } + if (object.maximum_edition !== undefined && object.maximum_edition !== null) { + message.maximumEdition = object.maximum_edition; + } + return message; + }, + toAmino(message: FeatureSetDefaults): FeatureSetDefaultsAmino { + const obj: any = {}; + if (message.defaults) { + obj.defaults = message.defaults.map(e => e ? FeatureSetDefaults_FeatureSetEditionDefault.toAmino(e) : undefined); + } else { + obj.defaults = message.defaults; + } + obj.minimum_edition = message.minimumEdition === 1 ? undefined : message.minimumEdition; + obj.maximum_edition = message.maximumEdition === 1 ? undefined : message.maximumEdition; + return obj; + }, + fromAminoMsg(object: FeatureSetDefaultsAminoMsg): FeatureSetDefaults { + return FeatureSetDefaults.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetDefaultsProtoMsg): FeatureSetDefaults { + return FeatureSetDefaults.decode(message.value); + }, + toProto(message: FeatureSetDefaults): Uint8Array { + return FeatureSetDefaults.encode(message).finish(); + }, + toProtoMsg(message: FeatureSetDefaults): FeatureSetDefaultsProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSetDefaults", + value: FeatureSetDefaults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSetDefaults.typeUrl, FeatureSetDefaults); +function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault { + return { + edition: 1, + overridableFeatures: undefined, + fixedFeatures: undefined + }; +} +export const FeatureSetDefaults_FeatureSetEditionDefault = { + typeUrl: "/google.protobuf.FeatureSetEditionDefault", + is(o: any): o is FeatureSetDefaults_FeatureSetEditionDefault { + return o && (o.$typeUrl === FeatureSetDefaults_FeatureSetEditionDefault.typeUrl || isSet(o.edition)); + }, + isAmino(o: any): o is FeatureSetDefaults_FeatureSetEditionDefaultAmino { + return o && (o.$typeUrl === FeatureSetDefaults_FeatureSetEditionDefault.typeUrl || isSet(o.edition)); + }, + encode(message: FeatureSetDefaults_FeatureSetEditionDefault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.edition !== 1) { + writer.uint32(24).int32(message.edition); + } + if (message.overridableFeatures !== undefined) { + FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).ldelim(); + } + if (message.fixedFeatures !== undefined) { + FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.edition = (reader.int32() as any); + break; + case 4: + message.overridableFeatures = FeatureSet.decode(reader, reader.uint32()); + break; + case 5: + message.fixedFeatures = FeatureSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + message.edition = object.edition ?? 1; + message.overridableFeatures = object.overridableFeatures !== undefined && object.overridableFeatures !== null ? FeatureSet.fromPartial(object.overridableFeatures) : undefined; + message.fixedFeatures = object.fixedFeatures !== undefined && object.fixedFeatures !== null ? FeatureSet.fromPartial(object.fixedFeatures) : undefined; + return message; + }, + fromAmino(object: FeatureSetDefaults_FeatureSetEditionDefaultAmino): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + if (object.overridable_features !== undefined && object.overridable_features !== null) { + message.overridableFeatures = FeatureSet.fromAmino(object.overridable_features); + } + if (object.fixed_features !== undefined && object.fixed_features !== null) { + message.fixedFeatures = FeatureSet.fromAmino(object.fixed_features); + } + return message; + }, + toAmino(message: FeatureSetDefaults_FeatureSetEditionDefault): FeatureSetDefaults_FeatureSetEditionDefaultAmino { + const obj: any = {}; + obj.edition = message.edition === 1 ? undefined : message.edition; + obj.overridable_features = message.overridableFeatures ? FeatureSet.toAmino(message.overridableFeatures) : undefined; + obj.fixed_features = message.fixedFeatures ? FeatureSet.toAmino(message.fixedFeatures) : undefined; + return obj; + }, + fromAminoMsg(object: FeatureSetDefaults_FeatureSetEditionDefaultAminoMsg): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.decode(message.value); + }, + toProto(message: FeatureSetDefaults_FeatureSetEditionDefault): Uint8Array { + return FeatureSetDefaults_FeatureSetEditionDefault.encode(message).finish(); + }, + toProtoMsg(message: FeatureSetDefaults_FeatureSetEditionDefault): FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSetEditionDefault", + value: FeatureSetDefaults_FeatureSetEditionDefault.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSetDefaults_FeatureSetEditionDefault.typeUrl, FeatureSetDefaults_FeatureSetEditionDefault); +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { + location: [] + }; +} +export const SourceCodeInfo = { + typeUrl: "/google.protobuf.SourceCodeInfo", + is(o: any): o is SourceCodeInfo { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.is(o.location[0]))); + }, + isAmino(o: any): o is SourceCodeInfoAmino { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.isAmino(o.location[0]))); + }, + encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; + }, + toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toAmino(e) : undefined); + } else { + obj.location = message.location; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfoAminoMsg): SourceCodeInfo { + return SourceCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfoProtoMsg): SourceCodeInfo { + return SourceCodeInfo.decode(message.value); + }, + toProto(message: SourceCodeInfo): Uint8Array { + return SourceCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo): SourceCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.SourceCodeInfo", + value: SourceCodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SourceCodeInfo.typeUrl, SourceCodeInfo); +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + path: [], + span: [], + leadingComments: "", + trailingComments: "", + leadingDetachedComments: [] + }; +} +export const SourceCodeInfo_Location = { + typeUrl: "/google.protobuf.Location", + is(o: any): o is SourceCodeInfo_Location { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leadingComments === "string" && typeof o.trailingComments === "string" && Array.isArray(o.leadingDetachedComments) && (!o.leadingDetachedComments.length || typeof o.leadingDetachedComments[0] === "string")); + }, + isAmino(o: any): o is SourceCodeInfo_LocationAmino { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leading_comments === "string" && typeof o.trailing_comments === "string" && Array.isArray(o.leading_detached_comments) && (!o.leading_detached_comments.length || typeof o.leading_detached_comments[0] === "string")); + }, + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + 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.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map(e => e) || []; + return message; + }, + fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; + }, + toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + if (message.span) { + obj.span = message.span.map(e => e); + } else { + obj.span = message.span; + } + obj.leading_comments = message.leadingComments === "" ? undefined : message.leadingComments; + obj.trailing_comments = message.trailingComments === "" ? undefined : message.trailingComments; + if (message.leadingDetachedComments) { + obj.leading_detached_comments = message.leadingDetachedComments.map(e => e); + } else { + obj.leading_detached_comments = message.leadingDetachedComments; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfo_LocationAminoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfo_LocationProtoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.decode(message.value); + }, + toProto(message: SourceCodeInfo_Location): Uint8Array { + return SourceCodeInfo_Location.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo_Location): SourceCodeInfo_LocationProtoMsg { + return { + typeUrl: "/google.protobuf.Location", + value: SourceCodeInfo_Location.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SourceCodeInfo_Location.typeUrl, SourceCodeInfo_Location); +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { + annotation: [] + }; +} +export const GeneratedCodeInfo = { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + is(o: any): o is GeneratedCodeInfo { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.is(o.annotation[0]))); + }, + isAmino(o: any): o is GeneratedCodeInfoAmino { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.isAmino(o.annotation[0]))); + }, + encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; + }, + toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined); + } else { + obj.annotation = message.annotation; + } + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfoAminoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfoProtoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.decode(message.value); + }, + toProto(message: GeneratedCodeInfo): Uint8Array { + return GeneratedCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo): GeneratedCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + value: GeneratedCodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo.typeUrl, GeneratedCodeInfo); +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { + path: [], + sourceFile: "", + begin: 0, + end: 0, + semantic: 1 + }; +} +export const GeneratedCodeInfo_Annotation = { + typeUrl: "/google.protobuf.Annotation", + is(o: any): o is GeneratedCodeInfo_Annotation { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.sourceFile === "string" && typeof o.begin === "number" && typeof o.end === "number" && isSet(o.semantic)); + }, + isAmino(o: any): o is GeneratedCodeInfo_AnnotationAmino { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.source_file === "string" && typeof o.begin === "number" && typeof o.end === "number" && isSet(o.semantic)); + }, + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + if (message.semantic !== 1) { + writer.uint32(40).int32(message.semantic); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + 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.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + case 5: + message.semantic = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + message.semantic = object.semantic ?? 1; + return message; + }, + fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.semantic !== undefined && object.semantic !== null) { + message.semantic = object.semantic; + } + return message; + }, + toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + obj.source_file = message.sourceFile === "" ? undefined : message.sourceFile; + obj.begin = message.begin === 0 ? undefined : message.begin; + obj.end = message.end === 0 ? undefined : message.end; + obj.semantic = message.semantic === 1 ? undefined : message.semantic; + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfo_AnnotationAminoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfo_AnnotationProtoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.decode(message.value); + }, + toProto(message: GeneratedCodeInfo_Annotation): Uint8Array { + return GeneratedCodeInfo_Annotation.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationProtoMsg { + return { + typeUrl: "/google.protobuf.Annotation", + value: GeneratedCodeInfo_Annotation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo_Annotation.typeUrl, GeneratedCodeInfo_Annotation); \ No newline at end of file diff --git a/libs/injective-query/src/google/protobuf/duration.ts b/libs/injective-query/src/google/protobuf/duration.ts new file mode 100644 index 00000000..6e3e301a --- /dev/null +++ b/libs/injective-query/src/google/protobuf/duration.ts @@ -0,0 +1,225 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} +export interface DurationProtoMsg { + typeUrl: "/google.protobuf.Duration"; + value: Uint8Array; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export type DurationAmino = string; +export interface DurationAminoMsg { + type: "/google.protobuf.Duration"; + value: DurationAmino; +} +function createBaseDuration(): Duration { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Duration = { + typeUrl: "/google.protobuf.Duration", + is(o: any): o is Duration { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is DurationAmino { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: DurationAmino): Duration { + const value = BigInt(object); + return { + seconds: value / BigInt("1000000000"), + nanos: Number(value % BigInt("1000000000")) + }; + }, + toAmino(message: Duration): DurationAmino { + return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString(); + }, + fromAminoMsg(object: DurationAminoMsg): Duration { + return Duration.fromAmino(object.value); + }, + fromProtoMsg(message: DurationProtoMsg): Duration { + return Duration.decode(message.value); + }, + toProto(message: Duration): Uint8Array { + return Duration.encode(message).finish(); + }, + toProtoMsg(message: Duration): DurationProtoMsg { + return { + typeUrl: "/google.protobuf.Duration", + value: Duration.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Duration.typeUrl, Duration); \ No newline at end of file diff --git a/libs/injective-query/src/google/protobuf/timestamp.ts b/libs/injective-query/src/google/protobuf/timestamp.ts new file mode 100644 index 00000000..d4d255b3 --- /dev/null +++ b/libs/injective-query/src/google/protobuf/timestamp.ts @@ -0,0 +1,281 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} +export interface TimestampProtoMsg { + typeUrl: "/google.protobuf.Timestamp"; + value: Uint8Array; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export type TimestampAmino = string; +export interface TimestampAminoMsg { + type: "/google.protobuf.Timestamp"; + value: TimestampAmino; +} +function createBaseTimestamp(): Timestamp { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Timestamp = { + typeUrl: "/google.protobuf.Timestamp", + is(o: any): o is Timestamp { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is TimestampAmino { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: TimestampAmino): Timestamp { + return fromJsonTimestamp(object); + }, + toAmino(message: Timestamp): TimestampAmino { + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); + }, + fromAminoMsg(object: TimestampAminoMsg): Timestamp { + return Timestamp.fromAmino(object.value); + }, + fromProtoMsg(message: TimestampProtoMsg): Timestamp { + return Timestamp.decode(message.value); + }, + toProto(message: Timestamp): Uint8Array { + return Timestamp.encode(message).finish(); + }, + toProtoMsg(message: Timestamp): TimestampProtoMsg { + return { + typeUrl: "/google.protobuf.Timestamp", + value: Timestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Timestamp.typeUrl, Timestamp); \ No newline at end of file diff --git a/libs/injective-query/src/helper-func-types.ts b/libs/injective-query/src/helper-func-types.ts new file mode 100644 index 00000000..89c4980f --- /dev/null +++ b/libs/injective-query/src/helper-func-types.ts @@ -0,0 +1,191 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { BinaryReader, BinaryWriter } from "./binary"; +import { getRpcClient } from "./extern"; +import { isRpc, Rpc } from "./helpers"; + +export interface QueryBuilderOptions { + encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter + decode: (input: BinaryReader | Uint8Array, length?: number) => TRes + service: string, + method: string, + clientResolver?: RpcResolver +} + +export function buildQuery(opts: QueryBuilderOptions) { + return async (request: TReq) => { + let rpc: Rpc | undefined; + + if(isRpc(opts.clientResolver)) { + rpc = opts.clientResolver; + } else { + rpc = opts.clientResolver ? await getRpcClient(opts.clientResolver) : undefined; + } + + if (!rpc) throw new Error("Query Rpc is not initialized"); + + const data = opts.encode(request).finish(); + const response = await rpc.request(opts.service, opts.method, data); + return opts.decode(response); + }; +} + +export interface ITxArgs { + signerAddress: string; + message: TMsg; + fee: StdFee | 'auto'; + memo: string; +} + +export function isISigningClient(client: unknown): client is ISigningClient { + return client !== null && client !== undefined + && typeof (client as ISigningClient).signAndBroadcast === 'function' + && typeof (client as ISigningClient).addConverters === 'function' + && typeof (client as ISigningClient).addEncoders === 'function'; +} + +export interface ISigningClient { + /** + * register converters + */ + addConverters: (converters: AminoConverter[]) => void; + /** + * register encoders + */ + addEncoders: (encoders: Encoder[]) => void; + + signAndBroadcast: ( + signerAddress: string, + message: Message[], + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export interface TxBuilderOptions { + clientResolver?: SigningClientResolver, + typeUrl: string, + encoders?: Encoder[], + converters?: AminoConverter[], +} + +export function buildTx(opts: TxBuilderOptions) { + return async ( + signerAddress: string, + message: TMsg, + fee: StdFee | 'auto', + memo: string + ): Promise => { + let client: ISigningClient | undefined; + + // if opts.getSigningClient is a function, call it to get the SigningClient instance + if(isISigningClient(opts.clientResolver)) { + client = opts.clientResolver; + } + + if (!client) throw new Error("SigningClient is not initialized"); + + //register all related encoders and converters + client.addEncoders(opts.encoders ?? []); + client.addConverters(opts.converters ?? []); + + const data = [ + { + typeUrl: opts.typeUrl, + value: message, + }, + ]; + return client.signAndBroadcast!(signerAddress, data, fee, memo); + }; +} + +export interface Coin { + denom: string; + amount: string; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +export interface Message { + typeUrl: string; + value: T; +} + +export interface Encoder { + typeUrl: string; + fromPartial: (data: any) => any; + encode: (data: any) => Uint8Array; +} + +export interface AminoConverter { + typeUrl: string; + aminoType: string; + fromAmino: (data: any) => any; + toAmino: (data: any) => any; +} + +export type SigningClientResolver = string | HttpEndpoint | ISigningClient; +export type RpcResolver = string | HttpEndpoint | Rpc ; diff --git a/libs/injective-query/src/helpers.ts b/libs/injective-query/src/helpers.ts new file mode 100644 index 00000000..1179995a --- /dev/null +++ b/libs/injective-query/src/helpers.ts @@ -0,0 +1,259 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== 'undefined') return globalThis; + if (typeof self !== 'undefined') return self; + if (typeof window !== 'undefined') return window; + if (typeof global !== 'undefined') return global; + throw 'Unable to locate global object'; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); + +export function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); + +export function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return btoa(bin.join('')); +} + +export interface AminoHeight { + readonly revision_number?: string; + readonly revision_height?: string; +} + +export function omitDefault( + input: T +): T | undefined { + if (typeof input === 'string') { + return input === '' ? undefined : input; + } + + if (typeof input === 'number') { + return input === 0 ? undefined : input; + } + + if (typeof input === "boolean"){ + return input === false ? undefined : input; + } + + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input; + } + + throw new Error(`Got unsupported type ${typeof input}`); +} + +interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + + nanos: number; +} + +export function toDuration(duration: string): Duration { + return { + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000 + }; +} + +export function fromDuration(duration: Duration): string { + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString(); +} + +export function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export function isObject(value: any): boolean { + return typeof value === 'object' && value !== null; +} + +export interface PageRequest { + key: Uint8Array; + offset: bigint; + limit: bigint; + countTotal: boolean; + reverse: boolean; +} + +export interface PageRequestParams { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; +} + +export interface Params { + params: PageRequestParams; +} + +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { + if (!pagination) { + return options; + } + + if (typeof pagination?.countTotal !== 'undefined') { + options.params['pagination.count_total'] = pagination.countTotal; + } + if (typeof pagination?.key !== 'undefined') { + // String to Uint8Array + // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); + + // Uint8Array to String + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ); + } + if (typeof pagination?.limit !== 'undefined') { + options.params['pagination.limit'] = pagination.limit.toString(); + } + if (typeof pagination?.offset !== 'undefined') { + options.params['pagination.offset'] = pagination.offset.toString(); + } + if (typeof pagination?.reverse !== 'undefined') { + options.params['pagination.reverse'] = pagination.reverse; + } + + return options; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + >; + +export interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +export function isRpc(rpc: unknown): rpc is Rpc { + return rpc !== null && rpc !== undefined && typeof (rpc as Rpc).request === 'function'; +} + +interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + + nanos: number; +} + +export function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1000) * 1000000; + return { + seconds, + nanos + }; +} + +export function fromTimestamp(t: Timestamp): Date { + let millis = Number(t.seconds) * 1000; + millis += t.nanos / 1000000; + return new Date(millis); +} + +const timestampFromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; +}; + +export function fromJsonTimestamp(o: any): Timestamp { + if (o instanceof Date) { + return toTimestamp(o); + } else if (typeof o === 'string') { + return toTimestamp(new Date(o)); + } else { + return timestampFromJSON(o); + } +} + +function numberToLong(number: number) { + return BigInt(Math.trunc(number)); +} + diff --git a/libs/injective-query/src/ibc/applications/transfer/v1/transfer.ts b/libs/injective-query/src/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 00000000..12d6526c --- /dev/null +++ b/libs/injective-query/src/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,373 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Params"; + value: Uint8Array; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsAmino { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + send_enabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receive_enabled: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface Forwarding { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: Hop[]; +} +export interface ForwardingProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Forwarding"; + value: Uint8Array; +} +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface ForwardingAmino { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: HopAmino[]; +} +export interface ForwardingAminoMsg { + type: "cosmos-sdk/Forwarding"; + value: ForwardingAmino; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface Hop { + portId: string; + channelId: string; +} +export interface HopProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Hop"; + value: Uint8Array; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface HopAmino { + port_id: string; + channel_id: string; +} +export interface HopAminoMsg { + type: "cosmos-sdk/Hop"; + value: HopAmino; +} +function createBaseParams(): Params { + return { + sendEnabled: false, + receiveEnabled: false + }; +} +export const Params = { + typeUrl: "/ibc.applications.transfer.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.sendEnabled === "boolean" && typeof o.receiveEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.send_enabled === "boolean" && typeof o.receive_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + 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.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled ?? false; + message.receiveEnabled = object.receiveEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.send_enabled = message.sendEnabled === false ? undefined : message.sendEnabled; + obj.receive_enabled = message.receiveEnabled === false ? undefined : message.receiveEnabled; + 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.applications.transfer.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseForwarding(): Forwarding { + return { + unwind: false, + hops: [] + }; +} +export const Forwarding = { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + aminoType: "cosmos-sdk/Forwarding", + is(o: any): o is Forwarding { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.is(o.hops[0]))); + }, + isAmino(o: any): o is ForwardingAmino { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.isAmino(o.hops[0]))); + }, + encode(message: Forwarding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unwind === true) { + writer.uint32(8).bool(message.unwind); + } + for (const v of message.hops) { + Hop.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Forwarding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForwarding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unwind = reader.bool(); + break; + case 2: + message.hops.push(Hop.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Forwarding { + const message = createBaseForwarding(); + message.unwind = object.unwind ?? false; + message.hops = object.hops?.map(e => Hop.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ForwardingAmino): Forwarding { + const message = createBaseForwarding(); + if (object.unwind !== undefined && object.unwind !== null) { + message.unwind = object.unwind; + } + message.hops = object.hops?.map(e => Hop.fromAmino(e)) || []; + return message; + }, + toAmino(message: Forwarding): ForwardingAmino { + const obj: any = {}; + obj.unwind = message.unwind === false ? undefined : message.unwind; + if (message.hops) { + obj.hops = message.hops.map(e => e ? Hop.toAmino(e) : undefined); + } else { + obj.hops = message.hops; + } + return obj; + }, + fromAminoMsg(object: ForwardingAminoMsg): Forwarding { + return Forwarding.fromAmino(object.value); + }, + toAminoMsg(message: Forwarding): ForwardingAminoMsg { + return { + type: "cosmos-sdk/Forwarding", + value: Forwarding.toAmino(message) + }; + }, + fromProtoMsg(message: ForwardingProtoMsg): Forwarding { + return Forwarding.decode(message.value); + }, + toProto(message: Forwarding): Uint8Array { + return Forwarding.encode(message).finish(); + }, + toProtoMsg(message: Forwarding): ForwardingProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + value: Forwarding.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Forwarding.typeUrl, Forwarding); +GlobalDecoderRegistry.registerAminoProtoMapping(Forwarding.aminoType, Forwarding.typeUrl); +function createBaseHop(): Hop { + return { + portId: "", + channelId: "" + }; +} +export const Hop = { + typeUrl: "/ibc.applications.transfer.v1.Hop", + aminoType: "cosmos-sdk/Hop", + is(o: any): o is Hop { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is HopAmino { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: Hop, 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): Hop { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHop(); + 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: DeepPartial): Hop { + const message = createBaseHop(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: HopAmino): Hop { + const message = createBaseHop(); + 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: Hop): HopAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: HopAminoMsg): Hop { + return Hop.fromAmino(object.value); + }, + toAminoMsg(message: Hop): HopAminoMsg { + return { + type: "cosmos-sdk/Hop", + value: Hop.toAmino(message) + }; + }, + fromProtoMsg(message: HopProtoMsg): Hop { + return Hop.decode(message.value); + }, + toProto(message: Hop): Uint8Array { + return Hop.encode(message).finish(); + }, + toProtoMsg(message: Hop): HopProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Hop", + value: Hop.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Hop.typeUrl, Hop); +GlobalDecoderRegistry.registerAminoProtoMapping(Hop.aminoType, Hop.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/injective-query/src/ibc/applications/transfer/v1/tx.rpc.func.ts new file mode 100644 index 00000000..2e888d2c --- /dev/null +++ b/libs/injective-query/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -0,0 +1,22 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { buildUseMutation } from "../../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransfer.typeUrl, + encoders: toEncoders(MsgTransfer), + converters: toConverters(MsgTransfer) +}); +export const useTransfer = buildUseMutation({ + builderMutationFn: createTransfer +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/applications/transfer/v1/tx.ts b/libs/injective-query/src/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 00000000..f4fb581c --- /dev/null +++ b/libs/injective-query/src/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,569 @@ +import { Coin, CoinAmino } from "../../../../cosmos/base/v1beta1/coin"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../../core/client/v1/client"; +import { Forwarding, ForwardingAmino } from "./transfer"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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 + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the token to be transferred. this field has been replaced by the tokens field. */ + /** @deprecated */ + token: Coin; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Height; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint; + /** optional memo */ + memo: string; + /** tokens to be transferred */ + tokens: Coin[]; + /** optional forwarding information */ + forwarding?: Forwarding; +} +export interface MsgTransferProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; + value: Uint8Array; +} +/** + * 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 + */ +export interface MsgTransferAmino { + /** the port on which the packet will be sent */ + source_port: string; + /** the channel by which the packet will be sent */ + source_channel: string; + /** the token to be transferred. this field has been replaced by the tokens field. */ + /** @deprecated */ + token: CoinAmino; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height: HeightAmino; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeout_timestamp: string; + /** optional memo */ + memo: string; + /** tokens to be transferred */ + tokens: CoinAmino[]; + /** optional forwarding information */ + forwarding?: ForwardingAmino; +} +export interface MsgTransferAminoMsg { + type: "cosmos-sdk/MsgTransfer"; + value: MsgTransferAmino; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse { + /** sequence number of the transfer packet sent */ + sequence: bigint; +} +export interface MsgTransferResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; + value: Uint8Array; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino { + /** sequence number of the transfer packet sent */ + sequence: string; +} +export interface MsgTransferResponseAminoMsg { + type: "cosmos-sdk/MsgTransferResponse"; + value: MsgTransferResponseAmino; +} +/** 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; +} +/** + * 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; +} +function createBaseMsgTransfer(): MsgTransfer { + return { + sourcePort: "", + sourceChannel: "", + token: Coin.fromPartial({}), + sender: "", + receiver: "", + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0), + memo: "", + tokens: [], + forwarding: undefined + }; +} +export const MsgTransfer = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + aminoType: "cosmos-sdk/MsgTransfer", + is(o: any): o is MsgTransfer { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && Coin.is(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint" && typeof o.memo === "string" && Array.isArray(o.tokens) && (!o.tokens.length || Coin.is(o.tokens[0]))); + }, + isAmino(o: any): o is MsgTransferAmino { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Coin.isAmino(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint" && typeof o.memo === "string" && Array.isArray(o.tokens) && (!o.tokens.length || Coin.isAmino(o.tokens[0]))); + }, + encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + if (message.memo !== "") { + writer.uint32(66).string(message.memo); + } + for (const v of message.tokens) { + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.forwarding !== undefined) { + Forwarding.encode(message.forwarding, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransfer(); + 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.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + case 8: + message.memo = reader.string(); + break; + case 9: + message.tokens.push(Coin.decode(reader, reader.uint32())); + break; + case 10: + message.forwarding = Forwarding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransfer { + const message = createBaseMsgTransfer(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.token = object.token !== undefined && object.token !== null ? Coin.fromPartial(object.token) : undefined; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + message.memo = object.memo ?? ""; + message.tokens = object.tokens?.map(e => Coin.fromPartial(e)) || []; + message.forwarding = object.forwarding !== undefined && object.forwarding !== null ? Forwarding.fromPartial(object.forwarding) : undefined; + return message; + }, + fromAmino(object: MsgTransferAmino): MsgTransfer { + const message = createBaseMsgTransfer(); + 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; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + message.tokens = object.tokens?.map(e => Coin.fromAmino(e)) || []; + if (object.forwarding !== undefined && object.forwarding !== null) { + message.forwarding = Forwarding.fromAmino(object.forwarding); + } + return message; + }, + toAmino(message: MsgTransfer): MsgTransferAmino { + 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) : 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) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp?.toString() : undefined; + obj.memo = message.memo === "" ? undefined : message.memo; + if (message.tokens) { + obj.tokens = message.tokens.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.tokens = message.tokens; + } + obj.forwarding = message.forwarding ? Forwarding.toAmino(message.forwarding) : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { + return MsgTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransfer): MsgTransferAminoMsg { + return { + type: "cosmos-sdk/MsgTransfer", + value: MsgTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferProtoMsg): MsgTransfer { + return MsgTransfer.decode(message.value); + }, + toProto(message: MsgTransfer): Uint8Array { + return MsgTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgTransfer): MsgTransferProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransfer.typeUrl, MsgTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransfer.aminoType, MsgTransfer.typeUrl); +function createBaseMsgTransferResponse(): MsgTransferResponse { + return { + sequence: BigInt(0) + }; +} +export const MsgTransferResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + aminoType: "cosmos-sdk/MsgTransferResponse", + is(o: any): o is MsgTransferResponse { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MsgTransferResponseAmino { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferResponse(); + 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: DeepPartial): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgTransferResponseAmino): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { + return MsgTransferResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferResponse): MsgTransferResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTransferResponse", + value: MsgTransferResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferResponseProtoMsg): MsgTransferResponse { + return MsgTransferResponse.decode(message.value); + }, + toProto(message: MsgTransferResponse): Uint8Array { + return MsgTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferResponse): MsgTransferResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + value: MsgTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferResponse.typeUrl, MsgTransferResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferResponse.aminoType, MsgTransferResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/channel/v1/channel.ts b/libs/injective-query/src/ibc/core/channel/v1/channel.ts new file mode 100644 index 00000000..6965c083 --- /dev/null +++ b/libs/injective-query/src/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1510 @@ +import { Height, HeightAmino } from "../../client/v1/client"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * 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 StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + 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: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + 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"; + } +} +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} +export const OrderAmino = Order; +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + case Order.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + 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"; + value: Uint8Array; +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelAmino { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + 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"; + value: ChannelAmino; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + 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"; + value: Uint8Array; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelAmino { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + 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"; + value: IdentifiedChannelAmino; +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.channel.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartyAmino { + /** port on the counterparty chain which owns the other end of the channel. */ + port_id: string; + /** channel end on the counterparty chain */ + channel_id: string; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: bigint; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: bigint; +} +export interface PacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.Packet"; + value: Uint8Array; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketAmino { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: string; + /** identifies the port on the sending chain. */ + source_port: string; + /** identifies the channel end on the sending chain. */ + source_channel: string; + /** identifies the port on the receiving chain. */ + destination_port: string; + /** identifies the channel end on the receiving chain. */ + destination_channel: string; + /** actual opaque bytes transferred directly to the application module */ + data: string; + /** block height after which the packet times out */ + timeout_height: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeout_timestamp: string; +} +export interface PacketAminoMsg { + type: "cosmos-sdk/Packet"; + value: PacketAmino; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: bigint; + /** embedded data that represents packet state. */ + data: Uint8Array; +} +export interface PacketStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketState"; + value: Uint8Array; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateAmino { + /** channel port identifier. */ + port_id: string; + /** channel unique identifier. */ + channel_id: string; + /** packet sequence. */ + sequence: string; + /** embedded data that represents packet state. */ + data: string; +} +export interface PacketStateAminoMsg { + type: "cosmos-sdk/PacketState"; + value: PacketStateAmino; +} +/** + * PacketId is an identifier for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketId { + /** channel port identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface PacketIdProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketId"; + value: Uint8Array; +} +/** + * PacketId is an identifier for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketIdAmino { + /** channel port identifier */ + port_id: string; + /** channel unique identifier */ + channel_id: string; + /** packet sequence */ + sequence: string; +} +export interface PacketIdAminoMsg { + type: "cosmos-sdk/PacketId"; + value: PacketIdAmino; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result?: Uint8Array; + error?: string; +} +export interface AcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.Acknowledgement"; + value: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementAmino { + result?: string; + error?: string; +} +export interface AcknowledgementAminoMsg { + type: "cosmos-sdk/Acknowledgement"; + value: AcknowledgementAmino; +} +/** + * 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; +} +/** 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; +} +function createBaseChannel(): Channel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + upgradeSequence: BigInt(0) + }; +} +export const Channel = { + typeUrl: "/ibc.core.channel.v1.Channel", + aminoType: "cosmos-sdk/Channel", + is(o: any): o is Channel { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is ChannelAmino { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.upgrade_sequence === "bigint"); + }, + encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Channel { + const message = createBaseChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + 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 { + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + 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 { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + 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 { + return Channel.fromAmino(object.value); + }, + toAminoMsg(message: Channel): ChannelAminoMsg { + return { + type: "cosmos-sdk/Channel", + value: Channel.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelProtoMsg): Channel { + return Channel.decode(message.value); + }, + toProto(message: Channel): Uint8Array { + return Channel.encode(message).finish(); + }, + toProtoMsg(message: Channel): ChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Channel", + value: Channel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Channel.typeUrl, Channel); +GlobalDecoderRegistry.registerAminoProtoMapping(Channel.aminoType, Channel.typeUrl); +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + portId: "", + channelId: "", + upgradeSequence: BigInt(0) + }; +} +export const IdentifiedChannel = { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + aminoType: "cosmos-sdk/IdentifiedChannel", + is(o: any): o is IdentifiedChannel { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is IdentifiedChannelAmino { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.upgrade_sequence === "bigint"); + }, + encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + case 8: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + 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.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 { + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + 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.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; + }, + toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + 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 { + return IdentifiedChannel.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { + return { + type: "cosmos-sdk/IdentifiedChannel", + value: IdentifiedChannel.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { + return IdentifiedChannel.decode(message.value); + }, + toProto(message: IdentifiedChannel): Uint8Array { + return IdentifiedChannel.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + value: IdentifiedChannel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedChannel.typeUrl, IdentifiedChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedChannel.aminoType, IdentifiedChannel.typeUrl); +function createBaseCounterparty(): Counterparty { + return { + portId: "", + channelId: "" + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.channel.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: Counterparty, 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): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + 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: DeepPartial): Counterparty { + const message = createBaseCounterparty(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + 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: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); +function createBasePacket(): Packet { + return { + sequence: BigInt(0), + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + data: new Uint8Array(), + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + }; +} +export const Packet = { + typeUrl: "/ibc.core.channel.v1.Packet", + aminoType: "cosmos-sdk/Packet", + is(o: any): o is Packet { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && typeof o.destinationPort === "string" && typeof o.destinationChannel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint"); + }, + isAmino(o: any): o is PacketAmino { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.source_port === "string" && typeof o.source_channel === "string" && typeof o.destination_port === "string" && typeof o.destination_channel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint"); + }, + encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Packet { + const message = createBasePacket(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.destinationPort = object.destinationPort ?? ""; + message.destinationChannel = object.destinationChannel ?? ""; + message.data = object.data ?? new Uint8Array(); + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketAmino): Packet { + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + 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; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; + }, + toAmino(message: Packet): PacketAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + obj.destination_port = message.destinationPort === "" ? undefined : message.destinationPort; + obj.destination_channel = message.destinationChannel === "" ? undefined : message.destinationChannel; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketAminoMsg): Packet { + return Packet.fromAmino(object.value); + }, + toAminoMsg(message: Packet): PacketAminoMsg { + return { + type: "cosmos-sdk/Packet", + value: Packet.toAmino(message) + }; + }, + fromProtoMsg(message: PacketProtoMsg): Packet { + return Packet.decode(message.value); + }, + toProto(message: Packet): Uint8Array { + return Packet.encode(message).finish(); + }, + toProtoMsg(message: Packet): PacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Packet", + value: Packet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Packet.typeUrl, Packet); +GlobalDecoderRegistry.registerAminoProtoMapping(Packet.aminoType, Packet.typeUrl); +function createBasePacketState(): PacketState { + return { + portId: "", + channelId: "", + sequence: BigInt(0), + data: new Uint8Array() + }; +} +export const PacketState = { + typeUrl: "/ibc.core.channel.v1.PacketState", + aminoType: "cosmos-sdk/PacketState", + is(o: any): o is PacketState { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is PacketStateAmino { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: PacketState, 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.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketState(); + 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.sequence = reader.uint64(); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PacketState { + const message = createBasePacketState(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketStateAmino): PacketState { + const message = createBasePacketState(); + 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.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: PacketState): PacketStateAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: PacketStateAminoMsg): PacketState { + return PacketState.fromAmino(object.value); + }, + toAminoMsg(message: PacketState): PacketStateAminoMsg { + return { + type: "cosmos-sdk/PacketState", + value: PacketState.toAmino(message) + }; + }, + fromProtoMsg(message: PacketStateProtoMsg): PacketState { + return PacketState.decode(message.value); + }, + toProto(message: PacketState): Uint8Array { + return PacketState.encode(message).finish(); + }, + toProtoMsg(message: PacketState): PacketStateProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketState", + value: PacketState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PacketState.typeUrl, PacketState); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketState.aminoType, PacketState.typeUrl); +function createBasePacketId(): PacketId { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const PacketId = { + typeUrl: "/ibc.core.channel.v1.PacketId", + aminoType: "cosmos-sdk/PacketId", + is(o: any): o is PacketId { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is PacketIdAmino { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + encode(message: PacketId, 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.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketId(); + 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.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PacketId { + const message = createBasePacketId(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketIdAmino): PacketId { + const message = createBasePacketId(); + 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.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: PacketId): PacketIdAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketIdAminoMsg): PacketId { + return PacketId.fromAmino(object.value); + }, + toAminoMsg(message: PacketId): PacketIdAminoMsg { + return { + type: "cosmos-sdk/PacketId", + value: PacketId.toAmino(message) + }; + }, + fromProtoMsg(message: PacketIdProtoMsg): PacketId { + return PacketId.decode(message.value); + }, + toProto(message: PacketId): Uint8Array { + return PacketId.encode(message).finish(); + }, + toProtoMsg(message: PacketId): PacketIdProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketId", + value: PacketId.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PacketId.typeUrl, PacketId); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketId.aminoType, PacketId.typeUrl); +function createBaseAcknowledgement(): Acknowledgement { + return { + result: undefined, + error: undefined + }; +} +export const Acknowledgement = { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + aminoType: "cosmos-sdk/Acknowledgement", + is(o: any): o is Acknowledgement { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + isAmino(o: any): o is AcknowledgementAmino { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Acknowledgement { + const message = createBaseAcknowledgement(); + message.result = object.result ?? undefined; + message.error = object.error ?? undefined; + return message; + }, + fromAmino(object: AcknowledgementAmino): Acknowledgement { + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: Acknowledgement): AcknowledgementAmino { + const obj: any = {}; + obj.result = message.result ? base64FromBytes(message.result) : undefined; + obj.error = message.error === null ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { + return Acknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { + return { + type: "cosmos-sdk/Acknowledgement", + value: Acknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { + return Acknowledgement.decode(message.value); + }, + toProto(message: Acknowledgement): Uint8Array { + return Acknowledgement.encode(message).finish(); + }, + toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + value: Acknowledgement.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Acknowledgement.typeUrl, Acknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(Acknowledgement.aminoType, Acknowledgement.typeUrl); +function createBaseTimeout(): Timeout { + return { + height: Height.fromPartial({}), + timestamp: BigInt(0) + }; +} +export const Timeout = { + typeUrl: "/ibc.core.channel.v1.Timeout", + aminoType: "cosmos-sdk/Timeout", + is(o: any): o is Timeout { + return o && (o.$typeUrl === Timeout.typeUrl || Height.is(o.height) && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is TimeoutAmino { + return o && (o.$typeUrl === Timeout.typeUrl || Height.isAmino(o.height) && typeof o.timestamp === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Timeout.typeUrl, Timeout); +GlobalDecoderRegistry.registerAminoProtoMapping(Timeout.aminoType, Timeout.typeUrl); +function createBaseParams(): Params { + return { + upgradeTimeout: Timeout.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/ibc.core.channel.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Timeout.is(o.upgradeTimeout)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Timeout.isAmino(o.upgrade_timeout)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/injective-query/src/ibc/core/channel/v1/tx.rpc.func.ts new file mode 100644 index 00000000..a7fc06c2 --- /dev/null +++ b/libs/injective-query/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -0,0 +1,175 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { buildUseMutation } from "../../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenInit.typeUrl, + encoders: toEncoders(MsgChannelOpenInit), + converters: toConverters(MsgChannelOpenInit) +}); +export const useChannelOpenInit = buildUseMutation({ + builderMutationFn: createChannelOpenInit +}); +export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenTry.typeUrl, + encoders: toEncoders(MsgChannelOpenTry), + converters: toConverters(MsgChannelOpenTry) +}); +export const useChannelOpenTry = buildUseMutation({ + builderMutationFn: createChannelOpenTry +}); +export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenAck.typeUrl, + encoders: toEncoders(MsgChannelOpenAck), + converters: toConverters(MsgChannelOpenAck) +}); +export const useChannelOpenAck = buildUseMutation({ + builderMutationFn: createChannelOpenAck +}); +export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenConfirm.typeUrl, + encoders: toEncoders(MsgChannelOpenConfirm), + converters: toConverters(MsgChannelOpenConfirm) +}); +export const useChannelOpenConfirm = buildUseMutation({ + builderMutationFn: createChannelOpenConfirm +}); +export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseInit.typeUrl, + encoders: toEncoders(MsgChannelCloseInit), + converters: toConverters(MsgChannelCloseInit) +}); +export const useChannelCloseInit = buildUseMutation({ + builderMutationFn: createChannelCloseInit +}); +export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseConfirm.typeUrl, + encoders: toEncoders(MsgChannelCloseConfirm), + converters: toConverters(MsgChannelCloseConfirm) +}); +export const useChannelCloseConfirm = buildUseMutation({ + builderMutationFn: createChannelCloseConfirm +}); +export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecvPacket.typeUrl, + encoders: toEncoders(MsgRecvPacket), + converters: toConverters(MsgRecvPacket) +}); +export const useRecvPacket = buildUseMutation({ + builderMutationFn: createRecvPacket +}); +export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeout.typeUrl, + encoders: toEncoders(MsgTimeout), + converters: toConverters(MsgTimeout) +}); +export const useTimeout = buildUseMutation({ + builderMutationFn: createTimeout +}); +export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeoutOnClose.typeUrl, + encoders: toEncoders(MsgTimeoutOnClose), + converters: toConverters(MsgTimeoutOnClose) +}); +export const useTimeoutOnClose = buildUseMutation({ + builderMutationFn: createTimeoutOnClose +}); +export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcknowledgement.typeUrl, + encoders: toEncoders(MsgAcknowledgement), + converters: toConverters(MsgAcknowledgement) +}); +export const useAcknowledgement = buildUseMutation({ + builderMutationFn: createAcknowledgement +}); +export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeInit.typeUrl, + encoders: toEncoders(MsgChannelUpgradeInit), + converters: toConverters(MsgChannelUpgradeInit) +}); +export const useChannelUpgradeInit = buildUseMutation({ + builderMutationFn: createChannelUpgradeInit +}); +export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTry.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTry), + converters: toConverters(MsgChannelUpgradeTry) +}); +export const useChannelUpgradeTry = buildUseMutation({ + builderMutationFn: createChannelUpgradeTry +}); +export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeAck.typeUrl, + encoders: toEncoders(MsgChannelUpgradeAck), + converters: toConverters(MsgChannelUpgradeAck) +}); +export const useChannelUpgradeAck = buildUseMutation({ + builderMutationFn: createChannelUpgradeAck +}); +export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeConfirm.typeUrl, + encoders: toEncoders(MsgChannelUpgradeConfirm), + converters: toConverters(MsgChannelUpgradeConfirm) +}); +export const useChannelUpgradeConfirm = buildUseMutation({ + builderMutationFn: createChannelUpgradeConfirm +}); +export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeOpen.typeUrl, + encoders: toEncoders(MsgChannelUpgradeOpen), + converters: toConverters(MsgChannelUpgradeOpen) +}); +export const useChannelUpgradeOpen = buildUseMutation({ + builderMutationFn: createChannelUpgradeOpen +}); +export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTimeout.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTimeout), + converters: toConverters(MsgChannelUpgradeTimeout) +}); +export const useChannelUpgradeTimeout = buildUseMutation({ + builderMutationFn: createChannelUpgradeTimeout +}); +export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeCancel.typeUrl, + encoders: toEncoders(MsgChannelUpgradeCancel), + converters: toConverters(MsgChannelUpgradeCancel) +}); +export const useChannelUpgradeCancel = buildUseMutation({ + builderMutationFn: createChannelUpgradeCancel +}); +export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateChannelParams = buildUseMutation({ + builderMutationFn: createUpdateChannelParams +}); +export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAcknowledgements.typeUrl, + encoders: toEncoders(MsgPruneAcknowledgements), + converters: toConverters(MsgPruneAcknowledgements) +}); +export const usePruneAcknowledgements = buildUseMutation({ + builderMutationFn: createPruneAcknowledgements +}); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/channel/v1/tx.ts b/libs/injective-query/src/ibc/core/channel/v1/tx.ts new file mode 100644 index 00000000..b7023355 --- /dev/null +++ b/libs/injective-query/src/ibc/core/channel/v1/tx.ts @@ -0,0 +1,4866 @@ +import { Channel, ChannelAmino, Packet, PacketAmino, State } from "./channel"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client"; +import { UpgradeFields, UpgradeFieldsAmino, Upgrade, UpgradeAmino, ErrorReceipt, ErrorReceiptAmino } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** ResponseResultType defines the possible outcomes of the execution of a message */ +export enum ResponseResultType { + /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0, + /** RESPONSE_RESULT_TYPE_NOOP - The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) */ + 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 ResponseResultTypeAmino = ResponseResultType; +export function responseResultTypeFromJSON(object: any): ResponseResultType { + switch (object) { + case 0: + case "RESPONSE_RESULT_TYPE_UNSPECIFIED": + return ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED; + case 1: + case "RESPONSE_RESULT_TYPE_NOOP": + return ResponseResultType.RESPONSE_RESULT_TYPE_NOOP; + 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: + return ResponseResultType.UNRECOGNIZED; + } +} +export function responseResultTypeToJSON(object: ResponseResultType): string { + switch (object) { + case ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED: + return "RESPONSE_RESULT_TYPE_UNSPECIFIED"; + case ResponseResultType.RESPONSE_RESULT_TYPE_NOOP: + 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"; + } +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string; + channel: Channel; + signer: string; +} +export interface MsgChannelOpenInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitAmino { + port_id: string; + channel: ChannelAmino; + signer: string; +} +export interface MsgChannelOpenInitAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInit"; + value: MsgChannelOpenInitAmino; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse { + channelId: string; + version: string; +} +export interface MsgChannelOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; + value: Uint8Array; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseAmino { + channel_id: string; + version: string; +} +export interface MsgChannelOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInitResponse"; + value: MsgChannelOpenInitResponseAmino; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTry { + portId: string; + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + previousChannelId: string; + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: Channel; + counterpartyVersion: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTryAmino { + port_id: string; + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + previous_channel_id: string; + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: ChannelAmino; + counterparty_version: string; + proof_init: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenTryAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTry"; + value: MsgChannelOpenTryAmino; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse { + version: string; + channelId: string; +} +export interface MsgChannelOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; + value: Uint8Array; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseAmino { + version: string; + channel_id: string; +} +export interface MsgChannelOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTryResponse"; + value: MsgChannelOpenTryResponseAmino; +} +/** + * 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; + channelId: string; + counterpartyChannelId: string; + counterpartyVersion: string; + proofTry: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck"; + value: Uint8Array; +} +/** + * 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; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenAckAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAck"; + value: MsgChannelOpenAckAmino; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse {} +export interface MsgChannelOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse"; + value: Uint8Array; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseAmino {} +export interface MsgChannelOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAckResponse"; + value: MsgChannelOpenAckResponseAmino; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string; + channelId: string; + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmAmino { + port_id: string; + channel_id: string; + proof_ack: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirm"; + value: MsgChannelOpenConfirmAmino; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponse {} +export interface MsgChannelOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseAmino {} +export interface MsgChannelOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse"; + value: MsgChannelOpenConfirmResponseAmino; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string; + channelId: string; + signer: string; +} +export interface MsgChannelCloseInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit"; + value: Uint8Array; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitAmino { + port_id: string; + channel_id: string; + signer: string; +} +export interface MsgChannelCloseInitAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInit"; + value: MsgChannelCloseInitAmino; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse {} +export interface MsgChannelCloseInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse"; + value: Uint8Array; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseAmino {} +export interface MsgChannelCloseInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInitResponse"; + value: MsgChannelCloseInitResponseAmino; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string; + channelId: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; + counterpartyUpgradeSequence: bigint; +} +export interface MsgChannelCloseConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmAmino { + port_id: string; + channel_id: string; + proof_init: string; + proof_height: HeightAmino; + signer: string; + counterparty_upgrade_sequence: string; +} +export interface MsgChannelCloseConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirm"; + value: MsgChannelCloseConfirmAmino; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponse {} +export interface MsgChannelCloseConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseAmino {} +export interface MsgChannelCloseConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse"; + value: MsgChannelCloseConfirmResponseAmino; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet: Packet; + proofCommitment: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgRecvPacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket"; + value: Uint8Array; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketAmino { + packet: PacketAmino; + proof_commitment: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgRecvPacketAminoMsg { + type: "cosmos-sdk/MsgRecvPacket"; + value: MsgRecvPacketAmino; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse { + result: ResponseResultType; +} +export interface MsgRecvPacketResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; + value: Uint8Array; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseAmino { + result: ResponseResultType; +} +export interface MsgRecvPacketResponseAminoMsg { + type: "cosmos-sdk/MsgRecvPacketResponse"; + value: MsgRecvPacketResponseAmino; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet; + proofUnreceived: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; +} +export interface MsgTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeout"; + value: Uint8Array; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutAmino { + packet: PacketAmino; + proof_unreceived: string; + proof_height: HeightAmino; + next_sequence_recv: string; + signer: string; +} +export interface MsgTimeoutAminoMsg { + type: "cosmos-sdk/MsgTimeout"; + value: MsgTimeoutAmino; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse { + result: ResponseResultType; +} +export interface MsgTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; + value: Uint8Array; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseAmino { + result: ResponseResultType; +} +export interface MsgTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutResponse"; + value: MsgTimeoutResponseAmino; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; + counterpartyUpgradeSequence: bigint; +} +export interface MsgTimeoutOnCloseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; + value: Uint8Array; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseAmino { + packet: PacketAmino; + proof_unreceived: string; + proof_close: string; + proof_height: HeightAmino; + next_sequence_recv: string; + signer: string; + counterparty_upgrade_sequence: string; +} +export interface MsgTimeoutOnCloseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnClose"; + value: MsgTimeoutOnCloseAmino; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse { + result: ResponseResultType; +} +export interface MsgTimeoutOnCloseResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; + value: Uint8Array; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseAmino { + result: ResponseResultType; +} +export interface MsgTimeoutOnCloseResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; + value: MsgTimeoutOnCloseResponseAmino; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet: Packet; + acknowledgement: Uint8Array; + proofAcked: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgAcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement"; + value: Uint8Array; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementAmino { + packet: PacketAmino; + acknowledgement: string; + proof_acked: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgAcknowledgementAminoMsg { + type: "cosmos-sdk/MsgAcknowledgement"; + value: MsgAcknowledgementAmino; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse { + result: ResponseResultType; +} +export interface MsgAcknowledgementResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseAmino { + result: ResponseResultType; +} +export interface MsgAcknowledgementResponseAminoMsg { + type: "cosmos-sdk/MsgAcknowledgementResponse"; + value: MsgAcknowledgementResponseAmino; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponse {} +export interface MsgChannelUpgradeTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseAmino {} +export interface MsgChannelUpgradeTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; + value: MsgChannelUpgradeTimeoutResponseAmino; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { + return { + portId: "", + channel: Channel.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + aminoType: "cosmos-sdk/MsgChannelOpenInit", + is(o: any): o is MsgChannelOpenInit { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.portId === "string" && Channel.is(o.channel) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitAmino { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.port_id === "string" && Channel.isAmino(o.channel) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + message.portId = object.portId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenInit): MsgChannelOpenInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitAminoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInit", + value: MsgChannelOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitProtoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.decode(message.value); + }, + toProto(message: MsgChannelOpenInit): Uint8Array { + return MsgChannelOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenInit.typeUrl, MsgChannelOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInit.aminoType, MsgChannelOpenInit.typeUrl); +function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { + return { + channelId: "", + version: "" + }; +} +export const MsgChannelOpenInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + aminoType: "cosmos-sdk/MsgChannelOpenInitResponse", + is(o: any): o is MsgChannelOpenInitResponse { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channelId === "string" && typeof o.version === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channel_id === "string" && typeof o.version === "string"); + }, + encode(message: MsgChannelOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + message.channelId = object.channelId ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenInitResponseAmino): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAmino { + const obj: any = {}; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitResponseAminoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitResponseProtoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenInitResponse): Uint8Array { + return MsgChannelOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenInitResponse.typeUrl, MsgChannelOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInitResponse.aminoType, MsgChannelOpenInitResponse.typeUrl); +function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { + return { + portId: "", + previousChannelId: "", + channel: Channel.fromPartial({}), + counterpartyVersion: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + aminoType: "cosmos-sdk/MsgChannelOpenTry", + is(o: any): o is MsgChannelOpenTry { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.portId === "string" && typeof o.previousChannelId === "string" && Channel.is(o.channel) && typeof o.counterpartyVersion === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryAmino { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.port_id === "string" && typeof o.previous_channel_id === "string" && Channel.isAmino(o.channel) && typeof o.counterparty_version === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.previousChannelId !== "") { + writer.uint32(18).string(message.previousChannelId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit); + } + 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): MsgChannelOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = 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: DeepPartial): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + message.portId = object.portId ?? ""; + message.previousChannelId = object.previousChannelId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { + message.previousChannelId = object.previous_channel_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + 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: MsgChannelOpenTry): MsgChannelOpenTryAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.previous_channel_id = message.previousChannelId === "" ? undefined : message.previousChannelId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + 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; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenTryAminoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTry", + value: MsgChannelOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryProtoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.decode(message.value); + }, + toProto(message: MsgChannelOpenTry): Uint8Array { + return MsgChannelOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenTry.typeUrl, MsgChannelOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTry.aminoType, MsgChannelOpenTry.typeUrl); +function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { + return { + version: "", + channelId: "" + }; +} +export const MsgChannelOpenTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + aminoType: "cosmos-sdk/MsgChannelOpenTryResponse", + is(o: any): o is MsgChannelOpenTryResponse { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channel_id === "string"); + }, + encode(message: MsgChannelOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + message.version = object.version ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + 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 { + return MsgChannelOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryResponseProtoMsg): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenTryResponse): Uint8Array { + return MsgChannelOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenTryResponse.typeUrl, MsgChannelOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTryResponse.aminoType, MsgChannelOpenTryResponse.typeUrl); +function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { + return { + portId: "", + channelId: "", + counterpartyChannelId: "", + counterpartyVersion: "", + proofTry: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + aminoType: "cosmos-sdk/MsgChannelOpenAck", + is(o: any): o is MsgChannelOpenAck { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.counterpartyChannelId === "string" && typeof o.counterpartyVersion === "string" && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenAckAmino { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.counterparty_channel_id === "string" && typeof o.counterparty_version === "string" && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenAck, 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.counterpartyChannelId !== "") { + writer.uint32(26).string(message.counterpartyChannelId); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry); + } + 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): MsgChannelOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAck(); + 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.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = 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: DeepPartial): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelId = object.counterpartyChannelId ?? ""; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + 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_id !== undefined && object.counterparty_channel_id !== null) { + message.counterpartyChannelId = object.counterparty_channel_id; + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + 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: MsgChannelOpenAck): MsgChannelOpenAckAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel_id = message.counterpartyChannelId === "" ? undefined : message.counterpartyChannelId; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckAminoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAck", + value: MsgChannelOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckProtoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.decode(message.value); + }, + toProto(message: MsgChannelOpenAck): Uint8Array { + return MsgChannelOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenAck.typeUrl, MsgChannelOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAck.aminoType, MsgChannelOpenAck.typeUrl); +function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { + return {}; +} +export const MsgChannelOpenAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + aminoType: "cosmos-sdk/MsgChannelOpenAckResponse", + is(o: any): o is MsgChannelOpenAckResponse { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenAckResponseAmino { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + encode(_: MsgChannelOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckResponseAminoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckResponseProtoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenAckResponse): Uint8Array { + return MsgChannelOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenAckResponse.typeUrl, MsgChannelOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAckResponse.aminoType, MsgChannelOpenAckResponse.typeUrl); +function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { + return { + portId: "", + channelId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + aminoType: "cosmos-sdk/MsgChannelOpenConfirm", + is(o: any): o is MsgChannelOpenConfirm { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenConfirmAmino { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenConfirm, 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.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirm(); + 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.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + 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.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + 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: MsgChannelOpenConfirm): MsgChannelOpenConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmAminoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmProtoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirm): Uint8Array { + return MsgChannelOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenConfirm.typeUrl, MsgChannelOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirm.aminoType, MsgChannelOpenConfirm.typeUrl); +function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmResponse { + return {}; +} +export const MsgChannelOpenConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelOpenConfirmResponse", + is(o: any): o is MsgChannelOpenConfirmResponse { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + encode(_: MsgChannelOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenConfirmResponseAmino): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmResponseAminoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmResponseProtoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirmResponse): Uint8Array { + return MsgChannelOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenConfirmResponse.typeUrl, MsgChannelOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirmResponse.aminoType, MsgChannelOpenConfirmResponse.typeUrl); +function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { + return { + portId: "", + channelId: "", + signer: "" + }; +} +export const MsgChannelCloseInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + aminoType: "cosmos-sdk/MsgChannelCloseInit", + is(o: any): o is MsgChannelCloseInit { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelCloseInitAmino { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgChannelCloseInit, 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.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInit(); + 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.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + 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.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelCloseInit): MsgChannelCloseInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitAminoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInit", + value: MsgChannelCloseInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitProtoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.decode(message.value); + }, + toProto(message: MsgChannelCloseInit): Uint8Array { + return MsgChannelCloseInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseInit.typeUrl, MsgChannelCloseInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInit.aminoType, MsgChannelCloseInit.typeUrl); +function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { + return {}; +} +export const MsgChannelCloseInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + aminoType: "cosmos-sdk/MsgChannelCloseInitResponse", + is(o: any): o is MsgChannelCloseInitResponse { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseInitResponseAmino { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + encode(_: MsgChannelCloseInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitResponseAminoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitResponseProtoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseInitResponse): Uint8Array { + return MsgChannelCloseInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseInitResponse.typeUrl, MsgChannelCloseInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInitResponse.aminoType, MsgChannelCloseInitResponse.typeUrl); +function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { + return { + portId: "", + channelId: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "", + counterpartyUpgradeSequence: BigInt(0) + }; +} +export const MsgChannelCloseConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + aminoType: "cosmos-sdk/MsgChannelCloseConfirm", + is(o: any): o is MsgChannelCloseConfirm { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelCloseConfirmAmino { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + encode(message: MsgChannelCloseConfirm, 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.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirm(); + 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.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + case 6: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + 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 { + const message = createBaseMsgChannelCloseConfirm(); + 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.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + 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; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; + }, + toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + 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 { + return MsgChannelCloseConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmProtoMsg): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirm): Uint8Array { + return MsgChannelCloseConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseConfirm.typeUrl, MsgChannelCloseConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirm.aminoType, MsgChannelCloseConfirm.typeUrl); +function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmResponse { + return {}; +} +export const MsgChannelCloseConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelCloseConfirmResponse", + is(o: any): o is MsgChannelCloseConfirmResponse { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + encode(_: MsgChannelCloseConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseConfirmResponseAmino): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseConfirmResponseAminoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmResponseProtoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirmResponse): Uint8Array { + return MsgChannelCloseConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseConfirmResponse.typeUrl, MsgChannelCloseConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirmResponse.aminoType, MsgChannelCloseConfirmResponse.typeUrl); +function createBaseMsgRecvPacket(): MsgRecvPacket { + return { + packet: Packet.fromPartial({}), + proofCommitment: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgRecvPacket = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + aminoType: "cosmos-sdk/MsgRecvPacket", + is(o: any): o is MsgRecvPacket { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.is(o.packet) && (o.proofCommitment instanceof Uint8Array || typeof o.proofCommitment === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecvPacketAmino { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.isAmino(o.packet) && (o.proof_commitment instanceof Uint8Array || typeof o.proof_commitment === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgRecvPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofCommitment = object.proofCommitment ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_commitment !== undefined && object.proof_commitment !== null) { + message.proofCommitment = bytesFromBase64(object.proof_commitment); + } + 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: MsgRecvPacket): MsgRecvPacketAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_commitment = message.proofCommitment ? base64FromBytes(message.proofCommitment) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketAminoMsg): MsgRecvPacket { + return MsgRecvPacket.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacket): MsgRecvPacketAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacket", + value: MsgRecvPacket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketProtoMsg): MsgRecvPacket { + return MsgRecvPacket.decode(message.value); + }, + toProto(message: MsgRecvPacket): Uint8Array { + return MsgRecvPacket.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacket): MsgRecvPacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecvPacket.typeUrl, MsgRecvPacket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacket.aminoType, MsgRecvPacket.typeUrl); +function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { + return { + result: 0 + }; +} +export const MsgRecvPacketResponse = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + aminoType: "cosmos-sdk/MsgRecvPacketResponse", + is(o: any): o is MsgRecvPacketResponse { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgRecvPacketResponseAmino { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgRecvPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacketResponse(); + 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: DeepPartial): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacketResponse", + value: MsgRecvPacketResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketResponseProtoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.decode(message.value); + }, + toProto(message: MsgRecvPacketResponse): Uint8Array { + return MsgRecvPacketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + value: MsgRecvPacketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecvPacketResponse.typeUrl, MsgRecvPacketResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacketResponse.aminoType, MsgRecvPacketResponse.typeUrl); +function createBaseMsgTimeout(): MsgTimeout { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "" + }; +} +export const MsgTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + aminoType: "cosmos-sdk/MsgTimeout", + is(o: any): o is MsgTimeout { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgTimeoutAmino { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string"); + }, + encode(message: MsgTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(32).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTimeout { + const message = createBaseMsgTimeout(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + 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 ?? ""; + return message; + }, + fromAmino(object: MsgTimeoutAmino): MsgTimeout { + const message = createBaseMsgTimeout(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgTimeout): MsgTimeoutAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + 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; + return obj; + }, + fromAminoMsg(object: MsgTimeoutAminoMsg): MsgTimeout { + return MsgTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeout): MsgTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgTimeout", + value: MsgTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutProtoMsg): MsgTimeout { + return MsgTimeout.decode(message.value); + }, + toProto(message: MsgTimeout): Uint8Array { + return MsgTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeout): MsgTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeout.typeUrl, MsgTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeout.aminoType, MsgTimeout.typeUrl); +function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { + return { + result: 0 + }; +} +export const MsgTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + aminoType: "cosmos-sdk/MsgTimeoutResponse", + is(o: any): o is MsgTimeoutResponse { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutResponseAmino { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutResponse(); + 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: DeepPartial): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgTimeoutResponseAmino): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgTimeoutResponse): MsgTimeoutResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutResponse", + value: MsgTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutResponseProtoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.decode(message.value); + }, + toProto(message: MsgTimeoutResponse): Uint8Array { + return MsgTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + value: MsgTimeoutResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutResponse.typeUrl, MsgTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutResponse.aminoType, MsgTimeoutResponse.typeUrl); +function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofClose: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "", + counterpartyUpgradeSequence: BigInt(0) + }; +} +export const MsgTimeoutOnClose = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + aminoType: "cosmos-sdk/MsgTimeoutOnClose", + is(o: any): o is MsgTimeoutOnClose { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && (o.proofClose instanceof Uint8Array || typeof o.proofClose === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgTimeoutOnCloseAmino { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && (o.proof_close instanceof Uint8Array || typeof o.proof_close === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + encode(message: MsgTimeoutOnClose, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(40).uint64(message.nextSequenceRecv); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = reader.uint64(); + break; + case 6: + message.signer = reader.string(); + break; + case 7: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofClose = object.proofClose ?? new Uint8Array(); + 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 { + const message = createBaseMsgTimeoutOnClose(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_close !== undefined && object.proof_close !== null) { + message.proofClose = bytesFromBase64(object.proof_close); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + 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 { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_close = message.proofClose ? base64FromBytes(message.proofClose) : undefined; + 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 { + return MsgTimeoutOnClose.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnClose", + value: MsgTimeoutOnClose.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseProtoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.decode(message.value); + }, + toProto(message: MsgTimeoutOnClose): Uint8Array { + return MsgTimeoutOnClose.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutOnClose.typeUrl, MsgTimeoutOnClose); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnClose.aminoType, MsgTimeoutOnClose.typeUrl); +function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { + return { + result: 0 + }; +} +export const MsgTimeoutOnCloseResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + aminoType: "cosmos-sdk/MsgTimeoutOnCloseResponse", + is(o: any): o is MsgTimeoutOnCloseResponse { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutOnCloseResponseAmino { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgTimeoutOnCloseResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnCloseResponse(); + 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: DeepPartial): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgTimeoutOnCloseResponseAminoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseResponseProtoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.decode(message.value); + }, + toProto(message: MsgTimeoutOnCloseResponse): Uint8Array { + return MsgTimeoutOnCloseResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutOnCloseResponse.typeUrl, MsgTimeoutOnCloseResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnCloseResponse.aminoType, MsgTimeoutOnCloseResponse.typeUrl); +function createBaseMsgAcknowledgement(): MsgAcknowledgement { + return { + packet: Packet.fromPartial({}), + acknowledgement: new Uint8Array(), + proofAcked: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgAcknowledgement = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + aminoType: "cosmos-sdk/MsgAcknowledgement", + is(o: any): o is MsgAcknowledgement { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.is(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proofAcked instanceof Uint8Array || typeof o.proofAcked === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgAcknowledgementAmino { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.isAmino(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof_acked instanceof Uint8Array || typeof o.proof_acked === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proofAcked = object.proofAcked ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof_acked !== undefined && object.proof_acked !== null) { + message.proofAcked = bytesFromBase64(object.proof_acked); + } + 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: MsgAcknowledgement): MsgAcknowledgementAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof_acked = message.proofAcked ? base64FromBytes(message.proofAcked) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementAminoMsg): MsgAcknowledgement { + return MsgAcknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgement): MsgAcknowledgementAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgement", + value: MsgAcknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementProtoMsg): MsgAcknowledgement { + return MsgAcknowledgement.decode(message.value); + }, + toProto(message: MsgAcknowledgement): Uint8Array { + return MsgAcknowledgement.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgement): MsgAcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcknowledgement.typeUrl, MsgAcknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgement.aminoType, MsgAcknowledgement.typeUrl); +function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { + return { + result: 0 + }; +} +export const MsgAcknowledgementResponse = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + aminoType: "cosmos-sdk/MsgAcknowledgementResponse", + is(o: any): o is MsgAcknowledgementResponse { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgAcknowledgementResponseAmino { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgementResponse(); + 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: DeepPartial): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgAcknowledgementResponseAmino): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementResponseAminoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementResponseProtoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.decode(message.value); + }, + toProto(message: MsgAcknowledgementResponse): Uint8Array { + return MsgAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcknowledgementResponse.typeUrl, MsgAcknowledgementResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgementResponse.aminoType, MsgAcknowledgementResponse.typeUrl); +function createBaseMsgChannelUpgradeInit(): MsgChannelUpgradeInit { + return { + portId: "", + channelId: "", + fields: UpgradeFields.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + is(o: any): o is MsgChannelUpgradeInit { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && UpgradeFields.is(o.fields) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && UpgradeFields.isAmino(o.fields) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInit.typeUrl, MsgChannelUpgradeInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInit.aminoType, MsgChannelUpgradeInit.typeUrl); +function createBaseMsgChannelUpgradeInitResponse(): MsgChannelUpgradeInitResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0) + }; +} +export const MsgChannelUpgradeInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeInitResponse", + is(o: any): o is MsgChannelUpgradeInitResponse { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInitResponse.typeUrl, MsgChannelUpgradeInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInitResponse.aminoType, MsgChannelUpgradeInitResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + is(o: any): o is MsgChannelUpgradeTry { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.proposedUpgradeConnectionHops) && (!o.proposedUpgradeConnectionHops.length || typeof o.proposedUpgradeConnectionHops[0] === "string") && UpgradeFields.is(o.counterpartyUpgradeFields) && typeof o.counterpartyUpgradeSequence === "bigint" && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTryAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.proposed_upgrade_connection_hops) && (!o.proposed_upgrade_connection_hops.length || typeof o.proposed_upgrade_connection_hops[0] === "string") && UpgradeFields.isAmino(o.counterparty_upgrade_fields) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTry.typeUrl, MsgChannelUpgradeTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTry.aminoType, MsgChannelUpgradeTry.typeUrl); +function createBaseMsgChannelUpgradeTryResponse(): MsgChannelUpgradeTryResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0), + result: 0 + }; +} +export const MsgChannelUpgradeTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTryResponse", + is(o: any): o is MsgChannelUpgradeTryResponse { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint" && isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeTryResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint" && isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTryResponse.typeUrl, MsgChannelUpgradeTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTryResponse.aminoType, MsgChannelUpgradeTryResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + is(o: any): o is MsgChannelUpgradeAck { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeAckAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAck.typeUrl, MsgChannelUpgradeAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAck.aminoType, MsgChannelUpgradeAck.typeUrl); +function createBaseMsgChannelUpgradeAckResponse(): MsgChannelUpgradeAckResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeAckResponse", + is(o: any): o is MsgChannelUpgradeAckResponse { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeAckResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAckResponse.typeUrl, MsgChannelUpgradeAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAckResponse.aminoType, MsgChannelUpgradeAckResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + is(o: any): o is MsgChannelUpgradeConfirm { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirm.typeUrl, MsgChannelUpgradeConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirm.aminoType, MsgChannelUpgradeConfirm.typeUrl); +function createBaseMsgChannelUpgradeConfirmResponse(): MsgChannelUpgradeConfirmResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + is(o: any): o is MsgChannelUpgradeConfirmResponse { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirmResponse.typeUrl, MsgChannelUpgradeConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirmResponse.aminoType, MsgChannelUpgradeConfirmResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + is(o: any): o is MsgChannelUpgradeOpen { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && typeof o.counterpartyUpgradeSequence === "bigint" && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeOpenAmino { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpen.typeUrl, MsgChannelUpgradeOpen); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpen.aminoType, MsgChannelUpgradeOpen.typeUrl); +function createBaseMsgChannelUpgradeOpenResponse(): MsgChannelUpgradeOpenResponse { + return {}; +} +export const MsgChannelUpgradeOpenResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + is(o: any): o is MsgChannelUpgradeOpenResponse { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeOpenResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpenResponse.typeUrl, MsgChannelUpgradeOpenResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpenResponse.aminoType, MsgChannelUpgradeOpenResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + is(o: any): o is MsgChannelUpgradeTimeout { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Channel.is(o.counterpartyChannel) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Channel.isAmino(o.counterparty_channel) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeout.typeUrl, MsgChannelUpgradeTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeout.aminoType, MsgChannelUpgradeTimeout.typeUrl); +function createBaseMsgChannelUpgradeTimeoutResponse(): MsgChannelUpgradeTimeoutResponse { + return {}; +} +export const MsgChannelUpgradeTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + is(o: any): o is MsgChannelUpgradeTimeoutResponse { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeoutResponse.typeUrl, MsgChannelUpgradeTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeoutResponse.aminoType, MsgChannelUpgradeTimeoutResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + is(o: any): o is MsgChannelUpgradeCancel { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && ErrorReceipt.is(o.errorReceipt) && (o.proofErrorReceipt instanceof Uint8Array || typeof o.proofErrorReceipt === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeCancelAmino { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && ErrorReceipt.isAmino(o.error_receipt) && (o.proof_error_receipt instanceof Uint8Array || typeof o.proof_error_receipt === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancel.typeUrl, MsgChannelUpgradeCancel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancel.aminoType, MsgChannelUpgradeCancel.typeUrl); +function createBaseMsgChannelUpgradeCancelResponse(): MsgChannelUpgradeCancelResponse { + return {}; +} +export const MsgChannelUpgradeCancelResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + is(o: any): o is MsgChannelUpgradeCancelResponse { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeCancelResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancelResponse.typeUrl, MsgChannelUpgradeCancelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancelResponse.aminoType, MsgChannelUpgradeCancelResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgPruneAcknowledgements(): MsgPruneAcknowledgements { + return { + portId: "", + channelId: "", + limit: BigInt(0), + signer: "" + }; +} +export const MsgPruneAcknowledgements = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + is(o: any): o is MsgPruneAcknowledgements { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgements.typeUrl, MsgPruneAcknowledgements); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgements.aminoType, MsgPruneAcknowledgements.typeUrl); +function createBaseMsgPruneAcknowledgementsResponse(): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: BigInt(0), + totalRemainingSequences: BigInt(0) + }; +} +export const MsgPruneAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + aminoType: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + is(o: any): o is MsgPruneAcknowledgementsResponse { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.totalPrunedSequences === "bigint" && typeof o.totalRemainingSequences === "bigint"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsResponseAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.total_pruned_sequences === "bigint" && typeof o.total_remaining_sequences === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgementsResponse.typeUrl, MsgPruneAcknowledgementsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgementsResponse.aminoType, MsgPruneAcknowledgementsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/channel/v1/upgrade.ts b/libs/injective-query/src/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 00000000..8ce98e36 --- /dev/null +++ b/libs/injective-query/src/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,388 @@ +import { Timeout, TimeoutAmino, Order } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseUpgrade(): Upgrade { + return { + fields: UpgradeFields.fromPartial({}), + timeout: Timeout.fromPartial({}), + nextSequenceSend: BigInt(0) + }; +} +export const Upgrade = { + typeUrl: "/ibc.core.channel.v1.Upgrade", + aminoType: "cosmos-sdk/Upgrade", + is(o: any): o is Upgrade { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.is(o.fields) && Timeout.is(o.timeout) && typeof o.nextSequenceSend === "bigint"); + }, + isAmino(o: any): o is UpgradeAmino { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.isAmino(o.fields) && Timeout.isAmino(o.timeout) && typeof o.next_sequence_send === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Upgrade.typeUrl, Upgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(Upgrade.aminoType, Upgrade.typeUrl); +function createBaseUpgradeFields(): UpgradeFields { + return { + ordering: 0, + connectionHops: [], + version: "" + }; +} +export const UpgradeFields = { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + aminoType: "cosmos-sdk/UpgradeFields", + is(o: any): o is UpgradeFields { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string"); + }, + isAmino(o: any): o is UpgradeFieldsAmino { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpgradeFields.typeUrl, UpgradeFields); +GlobalDecoderRegistry.registerAminoProtoMapping(UpgradeFields.aminoType, UpgradeFields.typeUrl); +function createBaseErrorReceipt(): ErrorReceipt { + return { + sequence: BigInt(0), + message: "" + }; +} +export const ErrorReceipt = { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + aminoType: "cosmos-sdk/ErrorReceipt", + is(o: any): o is ErrorReceipt { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + isAmino(o: any): o is ErrorReceiptAmino { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ErrorReceipt.typeUrl, ErrorReceipt); +GlobalDecoderRegistry.registerAminoProtoMapping(ErrorReceipt.aminoType, ErrorReceipt.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/client/v1/client.ts b/libs/injective-query/src/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..f6c36539 --- /dev/null +++ b/libs/injective-query/src/ibc/core/client/v1/client.ts @@ -0,0 +1,602 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; + value: Uint8Array; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id: string; + /** client state */ + client_state?: AnyAmino; +} +export interface IdentifiedClientStateAminoMsg { + type: "cosmos-sdk/IdentifiedClientState"; + value: IdentifiedClientStateAmino; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height; + /** consensus state */ + consensusState?: Any; +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; + value: Uint8Array; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height: HeightAmino; + /** consensus state */ + consensus_state?: AnyAmino; +} +export interface ConsensusStateWithHeightAminoMsg { + type: "cosmos-sdk/ConsensusStateWithHeight"; + value: ConsensusStateWithHeightAmino; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; + value: Uint8Array; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id: string; + /** consensus states and their heights associated with the client */ + consensus_states: ConsensusStateWithHeightAmino[]; +} +export interface ClientConsensusStatesAminoMsg { + type: "cosmos-sdk/ClientConsensusStates"; + value: ClientConsensusStatesAmino; +} +/** + * 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 + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. + */ +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 + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. + */ +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; +} +/** 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; +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: "", + clientState: undefined + }; +} +export const IdentifiedClientState = { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + aminoType: "cosmos-sdk/IdentifiedClientState", + is(o: any): o is IdentifiedClientState { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.clientId === "string"); + }, + isAmino(o: any): o is IdentifiedClientStateAmino { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.client_id === "string"); + }, + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: "cosmos-sdk/IdentifiedClientState", + value: IdentifiedClientState.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value); + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + value: IdentifiedClientState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedClientState.typeUrl, IdentifiedClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedClientState.aminoType, IdentifiedClientState.typeUrl); +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined + }; +} +export const ConsensusStateWithHeight = { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + aminoType: "cosmos-sdk/ConsensusStateWithHeight", + is(o: any): o is ConsensusStateWithHeight { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.is(o.height)); + }, + isAmino(o: any): o is ConsensusStateWithHeightAmino { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.isAmino(o.height)); + }, + encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateWithHeightAminoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateWithHeight", + value: ConsensusStateWithHeight.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateWithHeightProtoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value); + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + value: ConsensusStateWithHeight.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConsensusStateWithHeight.typeUrl, ConsensusStateWithHeight); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusStateWithHeight.aminoType, ConsensusStateWithHeight.typeUrl); +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: "", + consensusStates: [] + }; +} +export const ClientConsensusStates = { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + aminoType: "cosmos-sdk/ClientConsensusStates", + is(o: any): o is ClientConsensusStates { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.clientId === "string" && Array.isArray(o.consensusStates) && (!o.consensusStates.length || ConsensusStateWithHeight.is(o.consensusStates[0]))); + }, + isAmino(o: any): o is ClientConsensusStatesAmino { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.client_id === "string" && Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isAmino(o.consensus_states[0]))); + }, + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); + } else { + obj.consensus_states = message.consensusStates; + } + return obj; + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value); + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: "cosmos-sdk/ClientConsensusStates", + value: ClientConsensusStates.toAmino(message) + }; + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value); + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish(); + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + value: ClientConsensusStates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientConsensusStates.typeUrl, ClientConsensusStates); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientConsensusStates.aminoType, ClientConsensusStates.typeUrl); +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + aminoType: "cosmos-sdk/Height", + is(o: any): o is Height { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); + }, + isAmino(o: any): o is HeightAmino { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + 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: DeepPartial): 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 ? message.revisionNumber?.toString() : "0"; + obj.revision_height = message.revisionHeight ? message.revisionHeight?.toString() : "0"; + 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() + }; + } +}; +GlobalDecoderRegistry.register(Height.typeUrl, Height); +GlobalDecoderRegistry.registerAminoProtoMapping(Height.aminoType, Height.typeUrl); +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowedClients) && (!o.allowedClients.length || typeof o.allowedClients[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_clients) && (!o.allowed_clients.length || typeof o.allowed_clients[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/injective-query/src/ibc/core/client/v1/tx.rpc.func.ts new file mode 100644 index 00000000..cf8b181c --- /dev/null +++ b/libs/injective-query/src/ibc/core/client/v1/tx.rpc.func.ts @@ -0,0 +1,67 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { buildUseMutation } from "../../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateClient.typeUrl, + encoders: toEncoders(MsgCreateClient), + converters: toConverters(MsgCreateClient) +}); +export const useCreateClient = buildUseMutation({ + builderMutationFn: createCreateClient +}); +export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateClient.typeUrl, + encoders: toEncoders(MsgUpdateClient), + converters: toConverters(MsgUpdateClient) +}); +export const useUpdateClient = buildUseMutation({ + builderMutationFn: createUpdateClient +}); +export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpgradeClient.typeUrl, + encoders: toEncoders(MsgUpgradeClient), + converters: toConverters(MsgUpgradeClient) +}); +export const useUpgradeClient = buildUseMutation({ + builderMutationFn: createUpgradeClient +}); +export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitMisbehaviour.typeUrl, + encoders: toEncoders(MsgSubmitMisbehaviour), + converters: toConverters(MsgSubmitMisbehaviour) +}); +export const useSubmitMisbehaviour = buildUseMutation({ + builderMutationFn: createSubmitMisbehaviour +}); +export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecoverClient.typeUrl, + encoders: toEncoders(MsgRecoverClient), + converters: toConverters(MsgRecoverClient) +}); +export const useRecoverClient = buildUseMutation({ + builderMutationFn: createRecoverClient +}); +export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIBCSoftwareUpgrade.typeUrl, + encoders: toEncoders(MsgIBCSoftwareUpgrade), + converters: toConverters(MsgIBCSoftwareUpgrade) +}); +export const useIBCSoftwareUpgrade = buildUseMutation({ + builderMutationFn: createIBCSoftwareUpgrade +}); +export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateClientParams = buildUseMutation({ + builderMutationFn: createUpdateClientParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/client/v1/tx.ts b/libs/injective-query/src/ibc/core/client/v1/tx.ts new file mode 100644 index 00000000..c0281aac --- /dev/null +++ b/libs/injective-query/src/ibc/core/client/v1/tx.ts @@ -0,0 +1,1560 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Params, ParamsAmino } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any; + /** signer address */ + signer: string; +} +export interface MsgCreateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClient"; + value: Uint8Array; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientAmino { + /** light client state */ + client_state?: AnyAmino; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensus_state?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgCreateClientAminoMsg { + type: "cosmos-sdk/MsgCreateClient"; + value: MsgCreateClientAmino; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse { + clientId: string; +} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; + value: Uint8Array; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino { + client_id: string; +} +export interface MsgCreateClientResponseAminoMsg { + type: "cosmos-sdk/MsgCreateClientResponse"; + value: MsgCreateClientResponseAmino; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** client message to update the light client */ + clientMessage?: Any; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; + value: Uint8Array; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id: string; + /** client message to update the light client */ + client_message?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientAminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: MsgUpdateClientAmino; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} +export interface MsgUpdateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; + value: Uint8Array; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseAmino {} +export interface MsgUpdateClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateClientResponse"; + value: MsgUpdateClientResponseAmino; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState?: Any; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState?: Any; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; + value: Uint8Array; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientAmino { + /** client unique identifier */ + client_id: string; + /** upgraded client state */ + client_state?: AnyAmino; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensus_state?: AnyAmino; + /** proof that old chain committed to new client */ + proof_upgrade_client: string; + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state: string; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientAminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: MsgUpgradeClientAmino; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} +export interface MsgUpgradeClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; + value: Uint8Array; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseAmino {} +export interface MsgUpgradeClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpgradeClientResponse"; + value: MsgUpgradeClientResponseAmino; +} +/** + * 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; + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; + value: Uint8Array; +} +/** + * 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; + /** misbehaviour used for freezing the light client */ + misbehaviour?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviour"; + value: MsgSubmitMisbehaviourAmino; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse {} +export interface MsgSubmitMisbehaviourResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseAmino {} +export interface MsgSubmitMisbehaviourResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse"; + value: MsgSubmitMisbehaviourResponseAmino; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgCreateClient(): MsgCreateClient { + return { + clientState: undefined, + consensusState: undefined, + signer: "" + }; +} +export const MsgCreateClient = { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + aminoType: "cosmos-sdk/MsgCreateClient", + is(o: any): o is MsgCreateClient { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgCreateClientAmino { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateClient { + const message = createBaseMsgCreateClient(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientAmino): MsgCreateClient { + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgCreateClient): MsgCreateClientAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { + return MsgCreateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClient): MsgCreateClientAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClient", + value: MsgCreateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientProtoMsg): MsgCreateClient { + return MsgCreateClient.decode(message.value); + }, + toProto(message: MsgCreateClient): Uint8Array { + return MsgCreateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClient): MsgCreateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateClient.typeUrl, MsgCreateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClient.aminoType, MsgCreateClient.typeUrl); +function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { + return { + clientId: "" + }; +} +export const MsgCreateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + aminoType: "cosmos-sdk/MsgCreateClientResponse", + is(o: any): o is MsgCreateClientResponse { + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.clientId === "string"); + }, + isAmino(o: any): o is MsgCreateClientResponseAmino { + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.client_id === "string"); + }, + encode(message: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientResponseAmino): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: MsgCreateClientResponse): MsgCreateClientResponseAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + return obj; + }, + fromAminoMsg(object: MsgCreateClientResponseAminoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClientResponse", + value: MsgCreateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientResponseProtoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.decode(message.value); + }, + toProto(message: MsgCreateClientResponse): Uint8Array { + return MsgCreateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + value: MsgCreateClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateClientResponse.typeUrl, MsgCreateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClientResponse.aminoType, MsgCreateClientResponse.typeUrl); +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { + clientId: "", + clientMessage: undefined, + signer: "" + }; +} +export const MsgUpdateClient = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + aminoType: "cosmos-sdk/MsgUpdateClient", + is(o: any): o is MsgUpdateClient { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpdateClientAmino { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMessage = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + message.clientId = object.clientId ?? ""; + message.clientMessage = object.clientMessage !== undefined && object.clientMessage !== null ? Any.fromPartial(object.clientMessage) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + 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; + } + return message; + }, + toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_message = message.clientMessage ? Any.toAmino(message.clientMessage) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { + return MsgUpdateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClient): MsgUpdateClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClient", + value: MsgUpdateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientProtoMsg): MsgUpdateClient { + return MsgUpdateClient.decode(message.value); + }, + toProto(message: MsgUpdateClient): Uint8Array { + return MsgUpdateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClient): MsgUpdateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateClient.typeUrl, MsgUpdateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClient.aminoType, MsgUpdateClient.typeUrl); +function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { + return {}; +} +export const MsgUpdateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + aminoType: "cosmos-sdk/MsgUpdateClientResponse", + is(o: any): o is MsgUpdateClientResponse { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateClientResponseAmino { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientResponseAminoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClientResponse", + value: MsgUpdateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientResponseProtoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.decode(message.value); + }, + toProto(message: MsgUpdateClientResponse): Uint8Array { + return MsgUpdateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + value: MsgUpdateClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateClientResponse.typeUrl, MsgUpdateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClientResponse.aminoType, MsgUpdateClientResponse.typeUrl); +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: "", + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: "" + }; +} +export const MsgUpgradeClient = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + aminoType: "cosmos-sdk/MsgUpgradeClient", + is(o: any): o is MsgUpgradeClient { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.clientId === "string" && (o.proofUpgradeClient instanceof Uint8Array || typeof o.proofUpgradeClient === "string") && (o.proofUpgradeConsensusState instanceof Uint8Array || typeof o.proofUpgradeConsensusState === "string") && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpgradeClientAmino { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.client_id === "string" && (o.proof_upgrade_client instanceof Uint8Array || typeof o.proof_upgrade_client === "string") && (o.proof_upgrade_consensus_state instanceof Uint8Array || typeof o.proof_upgrade_consensus_state === "string") && typeof o.signer === "string"); + }, + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array(); + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { + return MsgUpgradeClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClient): MsgUpgradeClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClient", + value: MsgUpgradeClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientProtoMsg): MsgUpgradeClient { + return MsgUpgradeClient.decode(message.value); + }, + toProto(message: MsgUpgradeClient): Uint8Array { + return MsgUpgradeClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClient): MsgUpgradeClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpgradeClient.typeUrl, MsgUpgradeClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClient.aminoType, MsgUpgradeClient.typeUrl); +function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { + return {}; +} +export const MsgUpgradeClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + aminoType: "cosmos-sdk/MsgUpgradeClientResponse", + is(o: any): o is MsgUpgradeClientResponse { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpgradeClientResponseAmino { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientResponseAminoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientResponseProtoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.decode(message.value); + }, + toProto(message: MsgUpgradeClientResponse): Uint8Array { + return MsgUpgradeClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpgradeClientResponse.typeUrl, MsgUpgradeClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClientResponse.aminoType, MsgUpgradeClientResponse.typeUrl); +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { + clientId: "", + misbehaviour: undefined, + signer: "" + }; +} +export const MsgSubmitMisbehaviour = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + is(o: any): o is MsgSubmitMisbehaviour { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgSubmitMisbehaviourAmino { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.misbehaviour = object.misbehaviour !== undefined && object.misbehaviour !== null ? Any.fromPartial(object.misbehaviour) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.misbehaviour = message.misbehaviour ? Any.toAmino(message.misbehaviour) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourProtoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviour): Uint8Array { + return MsgSubmitMisbehaviour.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviour.typeUrl, MsgSubmitMisbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviour.aminoType, MsgSubmitMisbehaviour.typeUrl); +function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { + return {}; +} +export const MsgSubmitMisbehaviourResponse = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + is(o: any): o is MsgSubmitMisbehaviourResponse { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubmitMisbehaviourResponseAmino { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourResponseAminoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourResponseProtoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviourResponse): Uint8Array { + return MsgSubmitMisbehaviourResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviourResponse.typeUrl, MsgSubmitMisbehaviourResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviourResponse.aminoType, MsgSubmitMisbehaviourResponse.typeUrl); +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "" + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + aminoType: "cosmos-sdk/MsgRecoverClient", + is(o: any): o is MsgRecoverClient { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subjectClientId === "string" && typeof o.substituteClientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecoverClientAmino { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string" && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClient.typeUrl, MsgRecoverClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClient.aminoType, MsgRecoverClient.typeUrl); +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + aminoType: "cosmos-sdk/MsgRecoverClientResponse", + is(o: any): o is MsgRecoverClientResponse { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgRecoverClientResponseAmino { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClientResponse.typeUrl, MsgRecoverClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClientResponse.aminoType, MsgRecoverClientResponse.typeUrl); +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "" + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + is(o: any): o is MsgIBCSoftwareUpgrade { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.is(o.plan) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeAmino { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.isAmino(o.plan) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgrade.typeUrl, MsgIBCSoftwareUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgrade.aminoType, MsgIBCSoftwareUpgrade.typeUrl); +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + is(o: any): o is MsgIBCSoftwareUpgradeResponse { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeResponseAmino { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgradeResponse.typeUrl, MsgIBCSoftwareUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgradeResponse.aminoType, MsgIBCSoftwareUpgradeResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/commitment/v1/commitment.ts b/libs/injective-query/src/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 00000000..051efcdf --- /dev/null +++ b/libs/injective-query/src/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,314 @@ +import { CommitmentProof, CommitmentProofAmino } from "../../../../cosmos/ics23/v1/proofs"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} +export interface MerkleRootProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; + value: Uint8Array; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootAmino { + hash: string; +} +export interface MerkleRootAminoMsg { + type: "cosmos-sdk/MerkleRoot"; + value: MerkleRootAmino; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} +export interface MerklePrefixProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; + value: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixAmino { + key_prefix: string; +} +export interface MerklePrefixAminoMsg { + type: "cosmos-sdk/MerklePrefix"; + value: MerklePrefixAmino; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} +export interface MerkleProofProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleProof"; + value: Uint8Array; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofAmino { + proofs: CommitmentProofAmino[]; +} +export interface MerkleProofAminoMsg { + type: "cosmos-sdk/MerkleProof"; + value: MerkleProofAmino; +} +function createBaseMerkleRoot(): MerkleRoot { + return { + hash: new Uint8Array() + }; +} +export const MerkleRoot = { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + aminoType: "cosmos-sdk/MerkleRoot", + is(o: any): o is MerkleRoot { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + isAmino(o: any): o is MerkleRootAmino { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleRoot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerkleRoot { + const message = createBaseMerkleRoot(); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerkleRootAmino): MerkleRoot { + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: MerkleRoot): MerkleRootAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { + return MerkleRoot.fromAmino(object.value); + }, + toAminoMsg(message: MerkleRoot): MerkleRootAminoMsg { + return { + type: "cosmos-sdk/MerkleRoot", + value: MerkleRoot.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleRootProtoMsg): MerkleRoot { + return MerkleRoot.decode(message.value); + }, + toProto(message: MerkleRoot): Uint8Array { + return MerkleRoot.encode(message).finish(); + }, + toProtoMsg(message: MerkleRoot): MerkleRootProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + value: MerkleRoot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerkleRoot.typeUrl, MerkleRoot); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleRoot.aminoType, MerkleRoot.typeUrl); +function createBaseMerklePrefix(): MerklePrefix { + return { + keyPrefix: new Uint8Array() + }; +} +export const MerklePrefix = { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + aminoType: "cosmos-sdk/MerklePrefix", + is(o: any): o is MerklePrefix { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.keyPrefix instanceof Uint8Array || typeof o.keyPrefix === "string"); + }, + isAmino(o: any): o is MerklePrefixAmino { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.key_prefix instanceof Uint8Array || typeof o.key_prefix === "string"); + }, + encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePrefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerklePrefix { + const message = createBaseMerklePrefix(); + message.keyPrefix = object.keyPrefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerklePrefixAmino): MerklePrefix { + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; + }, + toAmino(message: MerklePrefix): MerklePrefixAmino { + const obj: any = {}; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; + return obj; + }, + fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { + return MerklePrefix.fromAmino(object.value); + }, + toAminoMsg(message: MerklePrefix): MerklePrefixAminoMsg { + return { + type: "cosmos-sdk/MerklePrefix", + value: MerklePrefix.toAmino(message) + }; + }, + fromProtoMsg(message: MerklePrefixProtoMsg): MerklePrefix { + return MerklePrefix.decode(message.value); + }, + toProto(message: MerklePrefix): Uint8Array { + return MerklePrefix.encode(message).finish(); + }, + toProtoMsg(message: MerklePrefix): MerklePrefixProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + value: MerklePrefix.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerklePrefix.typeUrl, MerklePrefix); +GlobalDecoderRegistry.registerAminoProtoMapping(MerklePrefix.aminoType, MerklePrefix.typeUrl); +function createBaseMerkleProof(): MerkleProof { + return { + proofs: [] + }; +} +export const MerkleProof = { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + aminoType: "cosmos-sdk/MerkleProof", + is(o: any): o is MerkleProof { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.is(o.proofs[0]))); + }, + isAmino(o: any): o is MerkleProofAmino { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.isAmino(o.proofs[0]))); + }, + encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MerkleProofAmino): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; + }, + toAmino(message: MerkleProof): MerkleProofAmino { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map(e => e ? CommitmentProof.toAmino(e) : undefined); + } else { + obj.proofs = message.proofs; + } + return obj; + }, + fromAminoMsg(object: MerkleProofAminoMsg): MerkleProof { + return MerkleProof.fromAmino(object.value); + }, + toAminoMsg(message: MerkleProof): MerkleProofAminoMsg { + return { + type: "cosmos-sdk/MerkleProof", + value: MerkleProof.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleProofProtoMsg): MerkleProof { + return MerkleProof.decode(message.value); + }, + toProto(message: MerkleProof): Uint8Array { + return MerkleProof.encode(message).finish(); + }, + toProtoMsg(message: MerkleProof): MerkleProofProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + value: MerkleProof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerkleProof.typeUrl, MerkleProof); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleProof.aminoType, MerkleProof.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/connection/v1/connection.ts b/libs/injective-query/src/ibc/core/connection/v1/connection.ts new file mode 100644 index 00000000..1791709d --- /dev/null +++ b/libs/injective-query/src/ibc/core/connection/v1/connection.ts @@ -0,0 +1,1010 @@ +import { MerklePrefix, MerklePrefixAmino } from "../../commitment/v1/commitment"; +import { isSet, DeepPartial } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** + * 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. + */ + delayPeriod: bigint; +} +export interface ConnectionEndProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; + value: Uint8Array; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndAmino { + /** client associated with this connection. */ + client_id: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: VersionAmino[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: CounterpartyAmino; + /** + * 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. + */ + delay_period: string; +} +export interface ConnectionEndAminoMsg { + type: "cosmos-sdk/ConnectionEnd"; + value: ConnectionEndAmino; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** delay period associated with this connection. */ + delayPeriod: bigint; +} +export interface IdentifiedConnectionProtoMsg { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; + value: Uint8Array; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionAmino { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + client_id: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: VersionAmino[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: CounterpartyAmino; + /** delay period associated with this connection. */ + delay_period: string; +} +export interface IdentifiedConnectionAminoMsg { + type: "cosmos-sdk/IdentifiedConnection"; + value: IdentifiedConnectionAmino; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.connection.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartyAmino { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefixAmino; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ClientPaths"; + value: Uint8Array; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsAmino { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsAminoMsg { + type: "cosmos-sdk/ClientPaths"; + value: ClientPathsAmino; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; + value: Uint8Array; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsAmino { + /** client state unique identifier */ + client_id: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsAminoMsg { + type: "cosmos-sdk/ConnectionPaths"; + value: ConnectionPathsAmino; +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionProtoMsg { + typeUrl: "/ibc.core.connection.v1.Version"; + value: Uint8Array; +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface VersionAmino { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionAminoMsg { + type: "cosmos-sdk/Version"; + value: VersionAmino; +} +/** Params defines the set of Connection parameters. */ +export interface 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. + */ + maxExpectedTimePerBlock: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsAmino { + /** + * 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. + */ + max_expected_time_per_block: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +function createBaseConnectionEnd(): ConnectionEnd { + return { + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const ConnectionEnd = { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + aminoType: "cosmos-sdk/ConnectionEnd", + is(o: any): o is ConnectionEnd { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isAmino(o: any): o is ConnectionEndAmino { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, + encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = (reader.int32() as any); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionEnd { + const message = createBaseConnectionEnd(); + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConnectionEndAmino): ConnectionEnd { + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: ConnectionEnd): ConnectionEndAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionEndAminoMsg): ConnectionEnd { + return ConnectionEnd.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionEnd): ConnectionEndAminoMsg { + return { + type: "cosmos-sdk/ConnectionEnd", + value: ConnectionEnd.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionEndProtoMsg): ConnectionEnd { + return ConnectionEnd.decode(message.value); + }, + toProto(message: ConnectionEnd): Uint8Array { + return ConnectionEnd.encode(message).finish(); + }, + toProtoMsg(message: ConnectionEnd): ConnectionEndProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + value: ConnectionEnd.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConnectionEnd.typeUrl, ConnectionEnd); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionEnd.aminoType, ConnectionEnd.typeUrl); +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { + id: "", + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const IdentifiedConnection = { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + aminoType: "cosmos-sdk/IdentifiedConnection", + is(o: any): o is IdentifiedConnection { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isAmino(o: any): o is IdentifiedConnectionAmino { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, + encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = (reader.int32() as any); + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + message.id = object.id ?? ""; + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: IdentifiedConnection): IdentifiedConnectionAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedConnectionAminoMsg): IdentifiedConnection { + return IdentifiedConnection.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedConnection): IdentifiedConnectionAminoMsg { + return { + type: "cosmos-sdk/IdentifiedConnection", + value: IdentifiedConnection.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedConnectionProtoMsg): IdentifiedConnection { + return IdentifiedConnection.decode(message.value); + }, + toProto(message: IdentifiedConnection): Uint8Array { + return IdentifiedConnection.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedConnection): IdentifiedConnectionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + value: IdentifiedConnection.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedConnection.typeUrl, IdentifiedConnection); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedConnection.aminoType, IdentifiedConnection.typeUrl); +function createBaseCounterparty(): Counterparty { + return { + clientId: "", + connectionId: "", + prefix: MerklePrefix.fromPartial({}) + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.connection.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.clientId === "string" && typeof o.connectionId === "string" && MerklePrefix.is(o.prefix)); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.client_id === "string" && typeof o.connection_id === "string" && MerklePrefix.isAmino(o.prefix)); + }, + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Counterparty { + const message = createBaseCounterparty(); + message.clientId = object.clientId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? MerklePrefix.fromPartial(object.prefix) : undefined; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; + }, + toAmino(message: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.prefix = message.prefix ? MerklePrefix.toAmino(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); +function createBaseClientPaths(): ClientPaths { + return { + paths: [] + }; +} +export const ClientPaths = { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + aminoType: "cosmos-sdk/ClientPaths", + is(o: any): o is ClientPaths { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ClientPathsAmino { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ClientPathsAmino): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ClientPaths): ClientPathsAmino { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ClientPathsAminoMsg): ClientPaths { + return ClientPaths.fromAmino(object.value); + }, + toAminoMsg(message: ClientPaths): ClientPathsAminoMsg { + return { + type: "cosmos-sdk/ClientPaths", + value: ClientPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ClientPathsProtoMsg): ClientPaths { + return ClientPaths.decode(message.value); + }, + toProto(message: ClientPaths): Uint8Array { + return ClientPaths.encode(message).finish(); + }, + toProtoMsg(message: ClientPaths): ClientPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + value: ClientPaths.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientPaths.typeUrl, ClientPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientPaths.aminoType, ClientPaths.typeUrl); +function createBaseConnectionPaths(): ConnectionPaths { + return { + clientId: "", + paths: [] + }; +} +export const ConnectionPaths = { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + aminoType: "cosmos-sdk/ConnectionPaths", + is(o: any): o is ConnectionPaths { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.clientId === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ConnectionPathsAmino { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.client_id === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionPaths { + const message = createBaseConnectionPaths(); + message.clientId = object.clientId ?? ""; + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ConnectionPathsAmino): ConnectionPaths { + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ConnectionPaths): ConnectionPathsAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ConnectionPathsAminoMsg): ConnectionPaths { + return ConnectionPaths.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionPaths): ConnectionPathsAminoMsg { + return { + type: "cosmos-sdk/ConnectionPaths", + value: ConnectionPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionPathsProtoMsg): ConnectionPaths { + return ConnectionPaths.decode(message.value); + }, + toProto(message: ConnectionPaths): Uint8Array { + return ConnectionPaths.encode(message).finish(); + }, + toProtoMsg(message: ConnectionPaths): ConnectionPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + value: ConnectionPaths.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConnectionPaths.typeUrl, ConnectionPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionPaths.aminoType, ConnectionPaths.typeUrl); +function createBaseVersion(): Version { + return { + identifier: "", + features: [] + }; +} +export const Version = { + typeUrl: "/ibc.core.connection.v1.Version", + aminoType: "cosmos-sdk/Version", + is(o: any): o is Version { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + isAmino(o: any): o is VersionAmino { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Version { + const message = createBaseVersion(); + message.identifier = object.identifier ?? ""; + message.features = object.features?.map(e => e) || []; + return message; + }, + fromAmino(object: VersionAmino): Version { + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; + }, + toAmino(message: Version): VersionAmino { + const obj: any = {}; + obj.identifier = message.identifier === "" ? undefined : message.identifier; + if (message.features) { + obj.features = message.features.map(e => e); + } else { + obj.features = message.features; + } + return obj; + }, + fromAminoMsg(object: VersionAminoMsg): Version { + return Version.fromAmino(object.value); + }, + toAminoMsg(message: Version): VersionAminoMsg { + return { + type: "cosmos-sdk/Version", + value: Version.toAmino(message) + }; + }, + fromProtoMsg(message: VersionProtoMsg): Version { + return Version.decode(message.value); + }, + toProto(message: Version): Uint8Array { + return Version.encode(message).finish(); + }, + toProtoMsg(message: Version): VersionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Version", + value: Version.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Version.typeUrl, Version); +GlobalDecoderRegistry.registerAminoProtoMapping(Version.aminoType, Version.typeUrl); +function createBaseParams(): Params { + return { + maxExpectedTimePerBlock: BigInt(0) + }; +} +export const Params = { + typeUrl: "/ibc.core.connection.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxExpectedTimePerBlock === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_expected_time_per_block === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxExpectedTimePerBlock !== BigInt(0)) { + writer.uint32(8).uint64(message.maxExpectedTimePerBlock); + } + 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.maxExpectedTimePerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_expected_time_per_block = message.maxExpectedTimePerBlock !== BigInt(0) ? message.maxExpectedTimePerBlock?.toString() : 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.connection.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/injective-query/src/ibc/core/connection/v1/tx.rpc.func.ts new file mode 100644 index 00000000..2c81e862 --- /dev/null +++ b/libs/injective-query/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -0,0 +1,49 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { buildUseMutation } from "../../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenInit.typeUrl, + encoders: toEncoders(MsgConnectionOpenInit), + converters: toConverters(MsgConnectionOpenInit) +}); +export const useConnectionOpenInit = buildUseMutation({ + builderMutationFn: createConnectionOpenInit +}); +export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenTry.typeUrl, + encoders: toEncoders(MsgConnectionOpenTry), + converters: toConverters(MsgConnectionOpenTry) +}); +export const useConnectionOpenTry = buildUseMutation({ + builderMutationFn: createConnectionOpenTry +}); +export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenAck.typeUrl, + encoders: toEncoders(MsgConnectionOpenAck), + converters: toConverters(MsgConnectionOpenAck) +}); +export const useConnectionOpenAck = buildUseMutation({ + builderMutationFn: createConnectionOpenAck +}); +export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenConfirm.typeUrl, + encoders: toEncoders(MsgConnectionOpenConfirm), + converters: toConverters(MsgConnectionOpenConfirm) +}); +export const useConnectionOpenConfirm = buildUseMutation({ + builderMutationFn: createConnectionOpenConfirm +}); +export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateConnectionParams = buildUseMutation({ + builderMutationFn: createUpdateConnectionParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/ibc/core/connection/v1/tx.ts b/libs/injective-query/src/ibc/core/connection/v1/tx.ts new file mode 100644 index 00000000..fd194d48 --- /dev/null +++ b/libs/injective-query/src/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1393 @@ +import { Counterparty, CounterpartyAmino, Version, VersionAmino } from "./connection"; +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty: Counterparty; + version?: Version; + delayPeriod: bigint; + signer: string; +} +export interface MsgConnectionOpenInitProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitAmino { + client_id: string; + counterparty: CounterpartyAmino; + version?: VersionAmino; + delay_period: string; + signer: string; +} +export interface MsgConnectionOpenInitAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInit"; + value: MsgConnectionOpenInitAmino; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse {} +export interface MsgConnectionOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseAmino {} +export interface MsgConnectionOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInitResponse"; + value: MsgConnectionOpenInitResponseAmino; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previousConnectionId: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + clientState?: Any; + counterparty: Counterparty; + delayPeriod: bigint; + counterpartyVersions: Version[]; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofClient: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensusHeight: Height; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenTryProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; + value: Uint8Array; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTryAmino { + client_id: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previous_connection_id: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + client_state?: AnyAmino; + counterparty: CounterpartyAmino; + delay_period: string; + counterparty_versions: VersionAmino[]; + proof_height: HeightAmino; + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proof_init: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_client: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensus_height: HeightAmino; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + host_consensus_state_proof: string; +} +export interface MsgConnectionOpenTryAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: MsgConnectionOpenTryAmino; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} +export interface MsgConnectionOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseAmino {} +export interface MsgConnectionOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTryResponse"; + value: MsgConnectionOpenTryResponseAmino; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version?: Version; + /** Deprecated: this field is unused. */ + /** @deprecated */ + clientState?: Any; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofClient: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensusHeight: Height; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenAckProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; + value: Uint8Array; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckAmino { + connection_id: string; + counterparty_connection_id: string; + version?: VersionAmino; + /** Deprecated: this field is unused. */ + /** @deprecated */ + client_state?: AnyAmino; + proof_height: HeightAmino; + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proof_try: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_client: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensus_height: HeightAmino; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + host_consensus_state_proof: string; +} +export interface MsgConnectionOpenAckAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: MsgConnectionOpenAckAmino; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} +export interface MsgConnectionOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseAmino {} +export interface MsgConnectionOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAckResponse"; + value: MsgConnectionOpenAckResponseAmino; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgConnectionOpenConfirmProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmAmino { + connection_id: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proof_ack: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: MsgConnectionOpenConfirmAmino; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse {} +export interface MsgConnectionOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseAmino {} +export interface MsgConnectionOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse"; + value: MsgConnectionOpenConfirmResponseAmino; +} +/** 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; +} +/** 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; +} +function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { + return { + clientId: "", + counterparty: Counterparty.fromPartial({}), + version: undefined, + delayPeriod: BigInt(0), + signer: "" + }; +} +export const MsgConnectionOpenInit = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + is(o: any): o is MsgConnectionOpenInit { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.clientId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenInitAmino { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.client_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && typeof o.signer === "string"); + }, + encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + message.clientId = object.clientId ?? ""; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenInit): MsgConnectionOpenInitAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitAminoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitProtoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.decode(message.value); + }, + toProto(message: MsgConnectionOpenInit): Uint8Array { + return MsgConnectionOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenInit.typeUrl, MsgConnectionOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInit.aminoType, MsgConnectionOpenInit.typeUrl); +function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { + return {}; +} +export const MsgConnectionOpenInitResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenInitResponse", + is(o: any): o is MsgConnectionOpenInitResponse { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenInitResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitResponseAminoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitResponseProtoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenInitResponse): Uint8Array { + return MsgConnectionOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenInitResponse.typeUrl, MsgConnectionOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInitResponse.aminoType, MsgConnectionOpenInitResponse.typeUrl); +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: "", + previousConnectionId: "", + clientState: undefined, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0), + counterpartyVersions: [], + proofHeight: Height.fromPartial({}), + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenTry = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + is(o: any): o is MsgConnectionOpenTry { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.clientId === "string" && typeof o.previousConnectionId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && Array.isArray(o.counterpartyVersions) && (!o.counterpartyVersions.length || Version.is(o.counterpartyVersions[0])) && Height.is(o.proofHeight) && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenTryAmino { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.client_id === "string" && typeof o.previous_connection_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && Array.isArray(o.counterparty_versions) && (!o.counterparty_versions.length || Version.isAmino(o.counterparty_versions[0])) && Height.isAmino(o.proof_height) && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + case 13: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + message.clientId = object.clientId ?? ""; + message.previousConnectionId = object.previousConnectionId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.counterpartyVersions = object.counterpartyVersions?.map(e => Version.fromPartial(e)) || []; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + 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 { + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + 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 { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.previous_connection_id = message.previousConnectionId === "" ? undefined : message.previousConnectionId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + if (message.counterpartyVersions) { + obj.counterparty_versions = message.counterpartyVersions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.counterparty_versions = message.counterpartyVersions; + } + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + 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 { + return MsgConnectionOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryProtoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.decode(message.value); + }, + toProto(message: MsgConnectionOpenTry): Uint8Array { + return MsgConnectionOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenTry.typeUrl, MsgConnectionOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTry.aminoType, MsgConnectionOpenTry.typeUrl); +function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { + return {}; +} +export const MsgConnectionOpenTryResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenTryResponse", + is(o: any): o is MsgConnectionOpenTryResponse { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenTryResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryResponseAminoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryResponseProtoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenTryResponse): Uint8Array { + return MsgConnectionOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenTryResponse.typeUrl, MsgConnectionOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTryResponse.aminoType, MsgConnectionOpenTryResponse.typeUrl); +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: "", + counterpartyConnectionId: "", + version: undefined, + clientState: undefined, + proofHeight: Height.fromPartial({}), + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenAck = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + is(o: any): o is MsgConnectionOpenAck { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connectionId === "string" && typeof o.counterpartyConnectionId === "string" && Height.is(o.proofHeight) && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenAckAmino { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connection_id === "string" && typeof o.counterparty_connection_id === "string" && Height.isAmino(o.proof_height) && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + case 11: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + message.connectionId = object.connectionId ?? ""; + message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + 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 { + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + 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 { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.counterparty_connection_id = message.counterpartyConnectionId === "" ? undefined : message.counterpartyConnectionId; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + 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 { + return MsgConnectionOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckProtoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.decode(message.value); + }, + toProto(message: MsgConnectionOpenAck): Uint8Array { + return MsgConnectionOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenAck.typeUrl, MsgConnectionOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAck.aminoType, MsgConnectionOpenAck.typeUrl); +function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { + return {}; +} +export const MsgConnectionOpenAckResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenAckResponse", + is(o: any): o is MsgConnectionOpenAckResponse { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenAckResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckResponseAminoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckResponseProtoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenAckResponse): Uint8Array { + return MsgConnectionOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenAckResponse.typeUrl, MsgConnectionOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAckResponse.aminoType, MsgConnectionOpenAckResponse.typeUrl); +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { + connectionId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenConfirm = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + is(o: any): o is MsgConnectionOpenConfirm { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connectionId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenConfirmAmino { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connection_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + message.connectionId = object.connectionId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + 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: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmAminoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmProtoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirm): Uint8Array { + return MsgConnectionOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirm.typeUrl, MsgConnectionOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirm.aminoType, MsgConnectionOpenConfirm.typeUrl); +function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { + return {}; +} +export const MsgConnectionOpenConfirmResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + is(o: any): o is MsgConnectionOpenConfirmResponse { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmResponseAminoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmResponseProtoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirmResponse): Uint8Array { + return MsgConnectionOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirmResponse.typeUrl, MsgConnectionOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirmResponse.aminoType, MsgConnectionOpenConfirmResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/auction.ts b/libs/injective-query/src/injective/auction/v1beta1/auction.ts new file mode 100644 index 00000000..7fd1367f --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/auction.ts @@ -0,0 +1,692 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** auction_period_duration defines the auction period duration */ + auctionPeriod: bigint; + /** min_next_bid_increment_rate defines the minimum increment rate for new bids */ + minNextBidIncrementRate: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.auction.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** auction_period_duration defines the auction period duration */ + auction_period: string; + /** min_next_bid_increment_rate defines the minimum increment rate for new bids */ + min_next_bid_increment_rate: string; +} +export interface ParamsAminoMsg { + type: "auction/Params"; + value: ParamsAmino; +} +export interface Bid { + bidder: string; + amount: string; +} +export interface BidProtoMsg { + typeUrl: "/injective.auction.v1beta1.Bid"; + value: Uint8Array; +} +export interface BidAmino { + bidder: string; + amount: string; +} +export interface BidAminoMsg { + type: "/injective.auction.v1beta1.Bid"; + value: BidAmino; +} +export interface LastAuctionResult { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface LastAuctionResultProtoMsg { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult"; + value: Uint8Array; +} +export interface LastAuctionResultAmino { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface LastAuctionResultAminoMsg { + type: "/injective.auction.v1beta1.LastAuctionResult"; + value: LastAuctionResultAmino; +} +export interface EventBid { + /** bidder describes the address of bidder */ + bidder: string; + /** amount describes the amount the bidder put on the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface EventBidProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventBid"; + value: Uint8Array; +} +export interface EventBidAmino { + /** bidder describes the address of bidder */ + bidder: string; + /** amount describes the amount the bidder put on the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface EventBidAminoMsg { + type: "/injective.auction.v1beta1.EventBid"; + value: EventBidAmino; +} +export interface EventAuctionResult { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface EventAuctionResultProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult"; + value: Uint8Array; +} +export interface EventAuctionResultAmino { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface EventAuctionResultAminoMsg { + type: "/injective.auction.v1beta1.EventAuctionResult"; + value: EventAuctionResultAmino; +} +export interface EventAuctionStart { + /** round defines the round number of auction */ + round: bigint; + /** ending_timestamp describes auction end time */ + endingTimestamp: bigint; + /** + * new_basket describes auction module balance at the time of new auction + * start + */ + newBasket: Coin[]; +} +export interface EventAuctionStartProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart"; + value: Uint8Array; +} +export interface EventAuctionStartAmino { + /** round defines the round number of auction */ + round: string; + /** ending_timestamp describes auction end time */ + ending_timestamp: string; + /** + * new_basket describes auction module balance at the time of new auction + * start + */ + new_basket: CoinAmino[]; +} +export interface EventAuctionStartAminoMsg { + type: "/injective.auction.v1beta1.EventAuctionStart"; + value: EventAuctionStartAmino; +} +function createBaseParams(): Params { + return { + auctionPeriod: BigInt(0), + minNextBidIncrementRate: "" + }; +} +export const Params = { + typeUrl: "/injective.auction.v1beta1.Params", + aminoType: "auction/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.auctionPeriod === "bigint" && typeof o.minNextBidIncrementRate === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.auction_period === "bigint" && typeof o.min_next_bid_increment_rate === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.auctionPeriod !== BigInt(0)) { + writer.uint32(8).int64(message.auctionPeriod); + } + if (message.minNextBidIncrementRate !== "") { + writer.uint32(18).string(message.minNextBidIncrementRate); + } + 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.auctionPeriod = reader.int64(); + break; + case 2: + message.minNextBidIncrementRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.auctionPeriod = object.auctionPeriod !== undefined && object.auctionPeriod !== null ? BigInt(object.auctionPeriod.toString()) : BigInt(0); + message.minNextBidIncrementRate = object.minNextBidIncrementRate ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.auction_period !== undefined && object.auction_period !== null) { + message.auctionPeriod = BigInt(object.auction_period); + } + if (object.min_next_bid_increment_rate !== undefined && object.min_next_bid_increment_rate !== null) { + message.minNextBidIncrementRate = object.min_next_bid_increment_rate; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.auction_period = message.auctionPeriod !== BigInt(0) ? message.auctionPeriod?.toString() : undefined; + obj.min_next_bid_increment_rate = message.minNextBidIncrementRate === "" ? undefined : message.minNextBidIncrementRate; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "auction/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: "/injective.auction.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseBid(): Bid { + return { + bidder: "", + amount: "" + }; +} +export const Bid = { + typeUrl: "/injective.auction.v1beta1.Bid", + is(o: any): o is Bid { + return o && (o.$typeUrl === Bid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is BidAmino { + return o && (o.$typeUrl === Bid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string"); + }, + encode(message: Bid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bidder !== "") { + writer.uint32(10).string(message.bidder); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bidder = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Bid { + const message = createBaseBid(); + message.bidder = object.bidder ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: BidAmino): Bid { + const message = createBaseBid(); + if (object.bidder !== undefined && object.bidder !== null) { + message.bidder = object.bidder; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Bid): BidAmino { + const obj: any = {}; + obj.bidder = message.bidder ?? ""; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: BidAminoMsg): Bid { + return Bid.fromAmino(object.value); + }, + fromProtoMsg(message: BidProtoMsg): Bid { + return Bid.decode(message.value); + }, + toProto(message: Bid): Uint8Array { + return Bid.encode(message).finish(); + }, + toProtoMsg(message: Bid): BidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.Bid", + value: Bid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Bid.typeUrl, Bid); +function createBaseLastAuctionResult(): LastAuctionResult { + return { + winner: "", + amount: "", + round: BigInt(0) + }; +} +export const LastAuctionResult = { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult", + is(o: any): o is LastAuctionResult { + return o && (o.$typeUrl === LastAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is LastAuctionResultAmino { + return o && (o.$typeUrl === LastAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: LastAuctionResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.winner !== "") { + writer.uint32(10).string(message.winner); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastAuctionResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastAuctionResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.winner = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastAuctionResult { + const message = createBaseLastAuctionResult(); + message.winner = object.winner ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastAuctionResultAmino): LastAuctionResult { + const message = createBaseLastAuctionResult(); + if (object.winner !== undefined && object.winner !== null) { + message.winner = object.winner; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: LastAuctionResult): LastAuctionResultAmino { + const obj: any = {}; + obj.winner = message.winner === "" ? undefined : message.winner; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastAuctionResultAminoMsg): LastAuctionResult { + return LastAuctionResult.fromAmino(object.value); + }, + fromProtoMsg(message: LastAuctionResultProtoMsg): LastAuctionResult { + return LastAuctionResult.decode(message.value); + }, + toProto(message: LastAuctionResult): Uint8Array { + return LastAuctionResult.encode(message).finish(); + }, + toProtoMsg(message: LastAuctionResult): LastAuctionResultProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult", + value: LastAuctionResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastAuctionResult.typeUrl, LastAuctionResult); +function createBaseEventBid(): EventBid { + return { + bidder: "", + amount: "", + round: BigInt(0) + }; +} +export const EventBid = { + typeUrl: "/injective.auction.v1beta1.EventBid", + is(o: any): o is EventBid { + return o && (o.$typeUrl === EventBid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EventBidAmino { + return o && (o.$typeUrl === EventBid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: EventBid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bidder !== "") { + writer.uint32(10).string(message.bidder); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bidder = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBid { + const message = createBaseEventBid(); + message.bidder = object.bidder ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBidAmino): EventBid { + const message = createBaseEventBid(); + if (object.bidder !== undefined && object.bidder !== null) { + message.bidder = object.bidder; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EventBid): EventBidAmino { + const obj: any = {}; + obj.bidder = message.bidder === "" ? undefined : message.bidder; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBidAminoMsg): EventBid { + return EventBid.fromAmino(object.value); + }, + fromProtoMsg(message: EventBidProtoMsg): EventBid { + return EventBid.decode(message.value); + }, + toProto(message: EventBid): Uint8Array { + return EventBid.encode(message).finish(); + }, + toProtoMsg(message: EventBid): EventBidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventBid", + value: EventBid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBid.typeUrl, EventBid); +function createBaseEventAuctionResult(): EventAuctionResult { + return { + winner: "", + amount: "", + round: BigInt(0) + }; +} +export const EventAuctionResult = { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult", + is(o: any): o is EventAuctionResult { + return o && (o.$typeUrl === EventAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EventAuctionResultAmino { + return o && (o.$typeUrl === EventAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: EventAuctionResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.winner !== "") { + writer.uint32(10).string(message.winner); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAuctionResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAuctionResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.winner = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAuctionResult { + const message = createBaseEventAuctionResult(); + message.winner = object.winner ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventAuctionResultAmino): EventAuctionResult { + const message = createBaseEventAuctionResult(); + if (object.winner !== undefined && object.winner !== null) { + message.winner = object.winner; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EventAuctionResult): EventAuctionResultAmino { + const obj: any = {}; + obj.winner = message.winner === "" ? undefined : message.winner; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventAuctionResultAminoMsg): EventAuctionResult { + return EventAuctionResult.fromAmino(object.value); + }, + fromProtoMsg(message: EventAuctionResultProtoMsg): EventAuctionResult { + return EventAuctionResult.decode(message.value); + }, + toProto(message: EventAuctionResult): Uint8Array { + return EventAuctionResult.encode(message).finish(); + }, + toProtoMsg(message: EventAuctionResult): EventAuctionResultProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult", + value: EventAuctionResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAuctionResult.typeUrl, EventAuctionResult); +function createBaseEventAuctionStart(): EventAuctionStart { + return { + round: BigInt(0), + endingTimestamp: BigInt(0), + newBasket: [] + }; +} +export const EventAuctionStart = { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart", + is(o: any): o is EventAuctionStart { + return o && (o.$typeUrl === EventAuctionStart.typeUrl || typeof o.round === "bigint" && typeof o.endingTimestamp === "bigint" && Array.isArray(o.newBasket) && (!o.newBasket.length || Coin.is(o.newBasket[0]))); + }, + isAmino(o: any): o is EventAuctionStartAmino { + return o && (o.$typeUrl === EventAuctionStart.typeUrl || typeof o.round === "bigint" && typeof o.ending_timestamp === "bigint" && Array.isArray(o.new_basket) && (!o.new_basket.length || Coin.isAmino(o.new_basket[0]))); + }, + encode(message: EventAuctionStart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== BigInt(0)) { + writer.uint32(8).uint64(message.round); + } + if (message.endingTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.endingTimestamp); + } + for (const v of message.newBasket) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAuctionStart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAuctionStart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.uint64(); + break; + case 2: + message.endingTimestamp = reader.int64(); + break; + case 3: + message.newBasket.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAuctionStart { + const message = createBaseEventAuctionStart(); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.endingTimestamp = object.endingTimestamp !== undefined && object.endingTimestamp !== null ? BigInt(object.endingTimestamp.toString()) : BigInt(0); + message.newBasket = object.newBasket?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAuctionStartAmino): EventAuctionStart { + const message = createBaseEventAuctionStart(); + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.ending_timestamp !== undefined && object.ending_timestamp !== null) { + message.endingTimestamp = BigInt(object.ending_timestamp); + } + message.newBasket = object.new_basket?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventAuctionStart): EventAuctionStartAmino { + const obj: any = {}; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.ending_timestamp = message.endingTimestamp !== BigInt(0) ? message.endingTimestamp?.toString() : undefined; + if (message.newBasket) { + obj.new_basket = message.newBasket.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.new_basket = message.newBasket; + } + return obj; + }, + fromAminoMsg(object: EventAuctionStartAminoMsg): EventAuctionStart { + return EventAuctionStart.fromAmino(object.value); + }, + fromProtoMsg(message: EventAuctionStartProtoMsg): EventAuctionStart { + return EventAuctionStart.decode(message.value); + }, + toProto(message: EventAuctionStart): Uint8Array { + return EventAuctionStart.encode(message).finish(); + }, + toProtoMsg(message: EventAuctionStart): EventAuctionStartProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart", + value: EventAuctionStart.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAuctionStart.typeUrl, EventAuctionStart); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/genesis.ts b/libs/injective-query/src/injective/auction/v1beta1/genesis.ts new file mode 100644 index 00000000..6ea94963 --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/genesis.ts @@ -0,0 +1,156 @@ +import { Params, ParamsAmino, Bid, BidAmino, LastAuctionResult, LastAuctionResultAmino } from "./auction"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the auction module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to auction. */ + params: Params; + /** current auction round */ + auctionRound: bigint; + /** current highest bid */ + highestBid?: Bid; + /** auction ending timestamp */ + auctionEndingTimestamp: bigint; + /** last auction result */ + lastAuctionResult?: LastAuctionResult; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.auction.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the auction module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to auction. */ + params: ParamsAmino; + /** current auction round */ + auction_round: string; + /** current highest bid */ + highest_bid?: BidAmino; + /** auction ending timestamp */ + auction_ending_timestamp: string; + /** last auction result */ + last_auction_result?: LastAuctionResultAmino; +} +export interface GenesisStateAminoMsg { + type: "/injective.auction.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + auctionRound: BigInt(0), + highestBid: undefined, + auctionEndingTimestamp: BigInt(0), + lastAuctionResult: undefined + }; +} +export const GenesisState = { + typeUrl: "/injective.auction.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && typeof o.auctionRound === "bigint" && typeof o.auctionEndingTimestamp === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && typeof o.auction_round === "bigint" && typeof o.auction_ending_timestamp === "bigint"); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.auctionRound !== BigInt(0)) { + writer.uint32(16).uint64(message.auctionRound); + } + if (message.highestBid !== undefined) { + Bid.encode(message.highestBid, writer.uint32(26).fork()).ldelim(); + } + if (message.auctionEndingTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.auctionEndingTimestamp); + } + if (message.lastAuctionResult !== undefined) { + LastAuctionResult.encode(message.lastAuctionResult, writer.uint32(42).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.auctionRound = reader.uint64(); + break; + case 3: + message.highestBid = Bid.decode(reader, reader.uint32()); + break; + case 4: + message.auctionEndingTimestamp = reader.int64(); + break; + case 5: + message.lastAuctionResult = LastAuctionResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.auctionRound = object.auctionRound !== undefined && object.auctionRound !== null ? BigInt(object.auctionRound.toString()) : BigInt(0); + message.highestBid = object.highestBid !== undefined && object.highestBid !== null ? Bid.fromPartial(object.highestBid) : undefined; + message.auctionEndingTimestamp = object.auctionEndingTimestamp !== undefined && object.auctionEndingTimestamp !== null ? BigInt(object.auctionEndingTimestamp.toString()) : BigInt(0); + message.lastAuctionResult = object.lastAuctionResult !== undefined && object.lastAuctionResult !== null ? LastAuctionResult.fromPartial(object.lastAuctionResult) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.auction_round !== undefined && object.auction_round !== null) { + message.auctionRound = BigInt(object.auction_round); + } + if (object.highest_bid !== undefined && object.highest_bid !== null) { + message.highestBid = Bid.fromAmino(object.highest_bid); + } + if (object.auction_ending_timestamp !== undefined && object.auction_ending_timestamp !== null) { + message.auctionEndingTimestamp = BigInt(object.auction_ending_timestamp); + } + if (object.last_auction_result !== undefined && object.last_auction_result !== null) { + message.lastAuctionResult = LastAuctionResult.fromAmino(object.last_auction_result); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.auction_round = message.auctionRound !== BigInt(0) ? message.auctionRound?.toString() : undefined; + obj.highest_bid = message.highestBid ? Bid.toAmino(message.highestBid) : undefined; + obj.auction_ending_timestamp = message.auctionEndingTimestamp !== BigInt(0) ? message.auctionEndingTimestamp?.toString() : undefined; + obj.last_auction_result = message.lastAuctionResult ? LastAuctionResult.toAmino(message.lastAuctionResult) : undefined; + 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: "/injective.auction.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/auction/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..09c769a9 --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/query.rpc.func.ts @@ -0,0 +1,47 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; +export const createGetAuctionParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAuctionParamsRequest.encode, + decode: QueryAuctionParamsResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionParams", + clientResolver +}); +export const useGetAuctionParams = buildUseQuery({ + builderQueryFn: createGetAuctionParams, + queryKeyPrefix: "AuctionParamsQuery" +}); +export const createGetCurrentAuctionBasket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentAuctionBasketRequest.encode, + decode: QueryCurrentAuctionBasketResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "CurrentAuctionBasket", + clientResolver +}); +export const useGetCurrentAuctionBasket = buildUseQuery({ + builderQueryFn: createGetCurrentAuctionBasket, + queryKeyPrefix: "CurrentAuctionBasketQuery" +}); +export const createGetAuctionModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionModuleState", + clientResolver +}); +export const useGetAuctionModuleState = buildUseQuery({ + builderQueryFn: createGetAuctionModuleState, + queryKeyPrefix: "AuctionModuleStateQuery" +}); +export const createGetLastAuctionResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastAuctionResultRequest.encode, + decode: QueryLastAuctionResultResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "LastAuctionResult", + clientResolver +}); +export const useGetLastAuctionResult = buildUseQuery({ + builderQueryFn: createGetLastAuctionResult, + queryKeyPrefix: "LastAuctionResultQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/query.ts b/libs/injective-query/src/injective/auction/v1beta1/query.ts new file mode 100644 index 00000000..723f9496 --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/query.ts @@ -0,0 +1,726 @@ +import { Params, ParamsAmino, LastAuctionResult, LastAuctionResultAmino } from "./auction"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC + * method. + */ +export interface QueryAuctionParamsRequest {} +export interface QueryAuctionParamsRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest"; + value: Uint8Array; +} +/** + * QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC + * method. + */ +export interface QueryAuctionParamsRequestAmino {} +export interface QueryAuctionParamsRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryAuctionParamsRequest"; + value: QueryAuctionParamsRequestAmino; +} +/** + * QueryAuctionParamsRequest is the response type for the Query/AuctionParams + * RPC method. + */ +export interface QueryAuctionParamsResponse { + params: Params; +} +export interface QueryAuctionParamsResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse"; + value: Uint8Array; +} +/** + * QueryAuctionParamsRequest is the response type for the Query/AuctionParams + * RPC method. + */ +export interface QueryAuctionParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryAuctionParamsResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryAuctionParamsResponse"; + value: QueryAuctionParamsResponseAmino; +} +/** + * QueryCurrentAuctionBasketRequest is the request type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketRequest {} +export interface QueryCurrentAuctionBasketRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest"; + value: Uint8Array; +} +/** + * QueryCurrentAuctionBasketRequest is the request type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketRequestAmino {} +export interface QueryCurrentAuctionBasketRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest"; + value: QueryCurrentAuctionBasketRequestAmino; +} +/** + * QueryCurrentAuctionBasketResponse is the response type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketResponse { + /** amount describes the amount put on auction */ + amount: Coin[]; + /** auctionRound describes current auction round */ + auctionRound: bigint; + /** auctionClosingTime describes auction close time for the round */ + auctionClosingTime: bigint; + /** highestBidder describes highest bidder on current round */ + highestBidder: string; + /** highestBidAmount describes highest bid amount on current round */ + highestBidAmount: string; +} +export interface QueryCurrentAuctionBasketResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse"; + value: Uint8Array; +} +/** + * QueryCurrentAuctionBasketResponse is the response type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketResponseAmino { + /** amount describes the amount put on auction */ + amount: CoinAmino[]; + /** auctionRound describes current auction round */ + auctionRound: string; + /** auctionClosingTime describes auction close time for the round */ + auctionClosingTime: string; + /** highestBidder describes highest bidder on current round */ + highestBidder: string; + /** highestBidAmount describes highest bid amount on current round */ + highestBidAmount: string; +} +export interface QueryCurrentAuctionBasketResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse"; + value: QueryCurrentAuctionBasketResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/AuctionModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/AuctionModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/AuctionModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/AuctionModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface QueryLastAuctionResultRequest {} +export interface QueryLastAuctionResultRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest"; + value: Uint8Array; +} +export interface QueryLastAuctionResultRequestAmino {} +export interface QueryLastAuctionResultRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryLastAuctionResultRequest"; + value: QueryLastAuctionResultRequestAmino; +} +export interface QueryLastAuctionResultResponse { + lastAuctionResult?: LastAuctionResult; +} +export interface QueryLastAuctionResultResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse"; + value: Uint8Array; +} +export interface QueryLastAuctionResultResponseAmino { + last_auction_result?: LastAuctionResultAmino; +} +export interface QueryLastAuctionResultResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryLastAuctionResultResponse"; + value: QueryLastAuctionResultResponseAmino; +} +function createBaseQueryAuctionParamsRequest(): QueryAuctionParamsRequest { + return {}; +} +export const QueryAuctionParamsRequest = { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest", + is(o: any): o is QueryAuctionParamsRequest { + return o && o.$typeUrl === QueryAuctionParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAuctionParamsRequestAmino { + return o && o.$typeUrl === QueryAuctionParamsRequest.typeUrl; + }, + encode(_: QueryAuctionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuctionParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuctionParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryAuctionParamsRequest { + const message = createBaseQueryAuctionParamsRequest(); + return message; + }, + fromAmino(_: QueryAuctionParamsRequestAmino): QueryAuctionParamsRequest { + const message = createBaseQueryAuctionParamsRequest(); + return message; + }, + toAmino(_: QueryAuctionParamsRequest): QueryAuctionParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuctionParamsRequestAminoMsg): QueryAuctionParamsRequest { + return QueryAuctionParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAuctionParamsRequestProtoMsg): QueryAuctionParamsRequest { + return QueryAuctionParamsRequest.decode(message.value); + }, + toProto(message: QueryAuctionParamsRequest): Uint8Array { + return QueryAuctionParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuctionParamsRequest): QueryAuctionParamsRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest", + value: QueryAuctionParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuctionParamsRequest.typeUrl, QueryAuctionParamsRequest); +function createBaseQueryAuctionParamsResponse(): QueryAuctionParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryAuctionParamsResponse = { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse", + is(o: any): o is QueryAuctionParamsResponse { + return o && (o.$typeUrl === QueryAuctionParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryAuctionParamsResponseAmino { + return o && (o.$typeUrl === QueryAuctionParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryAuctionParamsResponse, 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): QueryAuctionParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuctionParamsResponse(); + 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: DeepPartial): QueryAuctionParamsResponse { + const message = createBaseQueryAuctionParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryAuctionParamsResponseAmino): QueryAuctionParamsResponse { + const message = createBaseQueryAuctionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryAuctionParamsResponse): QueryAuctionParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAuctionParamsResponseAminoMsg): QueryAuctionParamsResponse { + return QueryAuctionParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAuctionParamsResponseProtoMsg): QueryAuctionParamsResponse { + return QueryAuctionParamsResponse.decode(message.value); + }, + toProto(message: QueryAuctionParamsResponse): Uint8Array { + return QueryAuctionParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuctionParamsResponse): QueryAuctionParamsResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse", + value: QueryAuctionParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuctionParamsResponse.typeUrl, QueryAuctionParamsResponse); +function createBaseQueryCurrentAuctionBasketRequest(): QueryCurrentAuctionBasketRequest { + return {}; +} +export const QueryCurrentAuctionBasketRequest = { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest", + is(o: any): o is QueryCurrentAuctionBasketRequest { + return o && o.$typeUrl === QueryCurrentAuctionBasketRequest.typeUrl; + }, + isAmino(o: any): o is QueryCurrentAuctionBasketRequestAmino { + return o && o.$typeUrl === QueryCurrentAuctionBasketRequest.typeUrl; + }, + encode(_: QueryCurrentAuctionBasketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentAuctionBasketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentAuctionBasketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCurrentAuctionBasketRequest { + const message = createBaseQueryCurrentAuctionBasketRequest(); + return message; + }, + fromAmino(_: QueryCurrentAuctionBasketRequestAmino): QueryCurrentAuctionBasketRequest { + const message = createBaseQueryCurrentAuctionBasketRequest(); + return message; + }, + toAmino(_: QueryCurrentAuctionBasketRequest): QueryCurrentAuctionBasketRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCurrentAuctionBasketRequestAminoMsg): QueryCurrentAuctionBasketRequest { + return QueryCurrentAuctionBasketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentAuctionBasketRequestProtoMsg): QueryCurrentAuctionBasketRequest { + return QueryCurrentAuctionBasketRequest.decode(message.value); + }, + toProto(message: QueryCurrentAuctionBasketRequest): Uint8Array { + return QueryCurrentAuctionBasketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentAuctionBasketRequest): QueryCurrentAuctionBasketRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest", + value: QueryCurrentAuctionBasketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentAuctionBasketRequest.typeUrl, QueryCurrentAuctionBasketRequest); +function createBaseQueryCurrentAuctionBasketResponse(): QueryCurrentAuctionBasketResponse { + return { + amount: [], + auctionRound: BigInt(0), + auctionClosingTime: BigInt(0), + highestBidder: "", + highestBidAmount: "" + }; +} +export const QueryCurrentAuctionBasketResponse = { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse", + is(o: any): o is QueryCurrentAuctionBasketResponse { + return o && (o.$typeUrl === QueryCurrentAuctionBasketResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.auctionRound === "bigint" && typeof o.auctionClosingTime === "bigint" && typeof o.highestBidder === "string" && typeof o.highestBidAmount === "string"); + }, + isAmino(o: any): o is QueryCurrentAuctionBasketResponseAmino { + return o && (o.$typeUrl === QueryCurrentAuctionBasketResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.auctionRound === "bigint" && typeof o.auctionClosingTime === "bigint" && typeof o.highestBidder === "string" && typeof o.highestBidAmount === "string"); + }, + encode(message: QueryCurrentAuctionBasketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.auctionRound !== BigInt(0)) { + writer.uint32(16).uint64(message.auctionRound); + } + if (message.auctionClosingTime !== BigInt(0)) { + writer.uint32(24).int64(message.auctionClosingTime); + } + if (message.highestBidder !== "") { + writer.uint32(34).string(message.highestBidder); + } + if (message.highestBidAmount !== "") { + writer.uint32(42).string(message.highestBidAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentAuctionBasketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentAuctionBasketResponse(); + 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.auctionRound = reader.uint64(); + break; + case 3: + message.auctionClosingTime = reader.int64(); + break; + case 4: + message.highestBidder = reader.string(); + break; + case 5: + message.highestBidAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCurrentAuctionBasketResponse { + const message = createBaseQueryCurrentAuctionBasketResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.auctionRound = object.auctionRound !== undefined && object.auctionRound !== null ? BigInt(object.auctionRound.toString()) : BigInt(0); + message.auctionClosingTime = object.auctionClosingTime !== undefined && object.auctionClosingTime !== null ? BigInt(object.auctionClosingTime.toString()) : BigInt(0); + message.highestBidder = object.highestBidder ?? ""; + message.highestBidAmount = object.highestBidAmount ?? ""; + return message; + }, + fromAmino(object: QueryCurrentAuctionBasketResponseAmino): QueryCurrentAuctionBasketResponse { + const message = createBaseQueryCurrentAuctionBasketResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.auctionRound !== undefined && object.auctionRound !== null) { + message.auctionRound = BigInt(object.auctionRound); + } + if (object.auctionClosingTime !== undefined && object.auctionClosingTime !== null) { + message.auctionClosingTime = BigInt(object.auctionClosingTime); + } + if (object.highestBidder !== undefined && object.highestBidder !== null) { + message.highestBidder = object.highestBidder; + } + if (object.highestBidAmount !== undefined && object.highestBidAmount !== null) { + message.highestBidAmount = object.highestBidAmount; + } + return message; + }, + toAmino(message: QueryCurrentAuctionBasketResponse): QueryCurrentAuctionBasketResponseAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.auctionRound = message.auctionRound !== BigInt(0) ? message.auctionRound?.toString() : undefined; + obj.auctionClosingTime = message.auctionClosingTime !== BigInt(0) ? message.auctionClosingTime?.toString() : undefined; + obj.highestBidder = message.highestBidder === "" ? undefined : message.highestBidder; + obj.highestBidAmount = message.highestBidAmount === "" ? undefined : message.highestBidAmount; + return obj; + }, + fromAminoMsg(object: QueryCurrentAuctionBasketResponseAminoMsg): QueryCurrentAuctionBasketResponse { + return QueryCurrentAuctionBasketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentAuctionBasketResponseProtoMsg): QueryCurrentAuctionBasketResponse { + return QueryCurrentAuctionBasketResponse.decode(message.value); + }, + toProto(message: QueryCurrentAuctionBasketResponse): Uint8Array { + return QueryCurrentAuctionBasketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentAuctionBasketResponse): QueryCurrentAuctionBasketResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse", + value: QueryCurrentAuctionBasketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentAuctionBasketResponse.typeUrl, QueryCurrentAuctionBasketResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryLastAuctionResultRequest(): QueryLastAuctionResultRequest { + return {}; +} +export const QueryLastAuctionResultRequest = { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest", + is(o: any): o is QueryLastAuctionResultRequest { + return o && o.$typeUrl === QueryLastAuctionResultRequest.typeUrl; + }, + isAmino(o: any): o is QueryLastAuctionResultRequestAmino { + return o && o.$typeUrl === QueryLastAuctionResultRequest.typeUrl; + }, + encode(_: QueryLastAuctionResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastAuctionResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastAuctionResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryLastAuctionResultRequest { + const message = createBaseQueryLastAuctionResultRequest(); + return message; + }, + fromAmino(_: QueryLastAuctionResultRequestAmino): QueryLastAuctionResultRequest { + const message = createBaseQueryLastAuctionResultRequest(); + return message; + }, + toAmino(_: QueryLastAuctionResultRequest): QueryLastAuctionResultRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLastAuctionResultRequestAminoMsg): QueryLastAuctionResultRequest { + return QueryLastAuctionResultRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastAuctionResultRequestProtoMsg): QueryLastAuctionResultRequest { + return QueryLastAuctionResultRequest.decode(message.value); + }, + toProto(message: QueryLastAuctionResultRequest): Uint8Array { + return QueryLastAuctionResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastAuctionResultRequest): QueryLastAuctionResultRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest", + value: QueryLastAuctionResultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastAuctionResultRequest.typeUrl, QueryLastAuctionResultRequest); +function createBaseQueryLastAuctionResultResponse(): QueryLastAuctionResultResponse { + return { + lastAuctionResult: undefined + }; +} +export const QueryLastAuctionResultResponse = { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse", + is(o: any): o is QueryLastAuctionResultResponse { + return o && o.$typeUrl === QueryLastAuctionResultResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastAuctionResultResponseAmino { + return o && o.$typeUrl === QueryLastAuctionResultResponse.typeUrl; + }, + encode(message: QueryLastAuctionResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastAuctionResult !== undefined) { + LastAuctionResult.encode(message.lastAuctionResult, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastAuctionResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastAuctionResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastAuctionResult = LastAuctionResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastAuctionResultResponse { + const message = createBaseQueryLastAuctionResultResponse(); + message.lastAuctionResult = object.lastAuctionResult !== undefined && object.lastAuctionResult !== null ? LastAuctionResult.fromPartial(object.lastAuctionResult) : undefined; + return message; + }, + fromAmino(object: QueryLastAuctionResultResponseAmino): QueryLastAuctionResultResponse { + const message = createBaseQueryLastAuctionResultResponse(); + if (object.last_auction_result !== undefined && object.last_auction_result !== null) { + message.lastAuctionResult = LastAuctionResult.fromAmino(object.last_auction_result); + } + return message; + }, + toAmino(message: QueryLastAuctionResultResponse): QueryLastAuctionResultResponseAmino { + const obj: any = {}; + obj.last_auction_result = message.lastAuctionResult ? LastAuctionResult.toAmino(message.lastAuctionResult) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastAuctionResultResponseAminoMsg): QueryLastAuctionResultResponse { + return QueryLastAuctionResultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastAuctionResultResponseProtoMsg): QueryLastAuctionResultResponse { + return QueryLastAuctionResultResponse.decode(message.value); + }, + toProto(message: QueryLastAuctionResultResponse): Uint8Array { + return QueryLastAuctionResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastAuctionResultResponse): QueryLastAuctionResultResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse", + value: QueryLastAuctionResultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastAuctionResultResponse.typeUrl, QueryLastAuctionResultResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/auction/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..ae16ff91 --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/tx.rpc.func.ts @@ -0,0 +1,22 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgBid, MsgUpdateParams } from "./tx"; +export const createBid = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBid.typeUrl, + encoders: toEncoders(MsgBid), + converters: toConverters(MsgBid) +}); +export const useBid = buildUseMutation({ + builderMutationFn: createBid +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/auction/v1beta1/tx.ts b/libs/injective-query/src/injective/auction/v1beta1/tx.ts new file mode 100644 index 00000000..9905ad0e --- /dev/null +++ b/libs/injective-query/src/injective/auction/v1beta1/tx.ts @@ -0,0 +1,383 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino } from "./auction"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Bid defines a SDK message for placing a bid for an auction */ +export interface MsgBid { + sender: string; + /** amount of the bid in INJ tokens */ + bidAmount: Coin; + /** the current auction round being bid on */ + round: bigint; +} +export interface MsgBidProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgBid"; + value: Uint8Array; +} +/** Bid defines a SDK message for placing a bid for an auction */ +export interface MsgBidAmino { + sender: string; + /** amount of the bid in INJ tokens */ + bid_amount: CoinAmino; + /** the current auction round being bid on */ + round: string; +} +export interface MsgBidAminoMsg { + type: "auction/MsgBid"; + value: MsgBidAmino; +} +export interface MsgBidResponse {} +export interface MsgBidResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse"; + value: Uint8Array; +} +export interface MsgBidResponseAmino {} +export interface MsgBidResponseAminoMsg { + type: "/injective.auction.v1beta1.MsgBidResponse"; + value: MsgBidResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "auction/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.auction.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgBid(): MsgBid { + return { + sender: "", + bidAmount: Coin.fromPartial({}), + round: BigInt(0) + }; +} +export const MsgBid = { + typeUrl: "/injective.auction.v1beta1.MsgBid", + aminoType: "auction/MsgBid", + is(o: any): o is MsgBid { + return o && (o.$typeUrl === MsgBid.typeUrl || typeof o.sender === "string" && Coin.is(o.bidAmount) && typeof o.round === "bigint"); + }, + isAmino(o: any): o is MsgBidAmino { + return o && (o.$typeUrl === MsgBid.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.bid_amount) && typeof o.round === "bigint"); + }, + encode(message: MsgBid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.bidAmount !== undefined) { + Coin.encode(message.bidAmount, writer.uint32(18).fork()).ldelim(); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.bidAmount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBid { + const message = createBaseMsgBid(); + message.sender = object.sender ?? ""; + message.bidAmount = object.bidAmount !== undefined && object.bidAmount !== null ? Coin.fromPartial(object.bidAmount) : undefined; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgBidAmino): MsgBid { + const message = createBaseMsgBid(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.bid_amount !== undefined && object.bid_amount !== null) { + message.bidAmount = Coin.fromAmino(object.bid_amount); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: MsgBid): MsgBidAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.bid_amount = message.bidAmount ? Coin.toAmino(message.bidAmount) : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgBidAminoMsg): MsgBid { + return MsgBid.fromAmino(object.value); + }, + toAminoMsg(message: MsgBid): MsgBidAminoMsg { + return { + type: "auction/MsgBid", + value: MsgBid.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBidProtoMsg): MsgBid { + return MsgBid.decode(message.value); + }, + toProto(message: MsgBid): Uint8Array { + return MsgBid.encode(message).finish(); + }, + toProtoMsg(message: MsgBid): MsgBidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgBid", + value: MsgBid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBid.typeUrl, MsgBid); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBid.aminoType, MsgBid.typeUrl); +function createBaseMsgBidResponse(): MsgBidResponse { + return {}; +} +export const MsgBidResponse = { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse", + is(o: any): o is MsgBidResponse { + return o && o.$typeUrl === MsgBidResponse.typeUrl; + }, + isAmino(o: any): o is MsgBidResponseAmino { + return o && o.$typeUrl === MsgBidResponse.typeUrl; + }, + encode(_: MsgBidResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBidResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgBidResponse { + const message = createBaseMsgBidResponse(); + return message; + }, + fromAmino(_: MsgBidResponseAmino): MsgBidResponse { + const message = createBaseMsgBidResponse(); + return message; + }, + toAmino(_: MsgBidResponse): MsgBidResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBidResponseAminoMsg): MsgBidResponse { + return MsgBidResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBidResponseProtoMsg): MsgBidResponse { + return MsgBidResponse.decode(message.value); + }, + toProto(message: MsgBidResponse): Uint8Array { + return MsgBidResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBidResponse): MsgBidResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse", + value: MsgBidResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBidResponse.typeUrl, MsgBidResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParams", + aminoType: "auction/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "auction/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: "/injective.auction.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts b/libs/injective-query/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts new file mode 100644 index 00000000..0017ec6a --- /dev/null +++ b/libs/injective-query/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts @@ -0,0 +1,205 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * PubKey defines a type alias for an ecdsa.PublicKey that implements + * Tendermint's PubKey interface. It represents the 33-byte compressed public + * key format. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey"; + value: Uint8Array; +} +/** + * PubKey defines a type alias for an ecdsa.PublicKey that implements + * Tendermint's PubKey interface. It represents the 33-byte compressed public + * key format. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "injective/PubKeyEthSecp256k1"; + value: PubKeyAmino; +} +/** + * PrivKey defines a type alias for an ecdsa.PrivateKey that implements + * Tendermint's PrivateKey interface. + */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey"; + value: Uint8Array; +} +/** + * PrivKey defines a type alias for an ecdsa.PrivateKey that implements + * Tendermint's PrivateKey interface. + */ +export interface PrivKeyAmino { + key: string; +} +export interface PrivKeyAminoMsg { + type: "injective/PrivKeyEthSecp256k1"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey", + aminoType: "injective/PubKeyEthSecp256k1", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "injective/PubKeyEthSecp256k1", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey", + aminoType: "injective/PrivKeyEthSecp256k1", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "injective/PrivKeyEthSecp256k1", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/authz.ts b/libs/injective-query/src/injective/exchange/v1beta1/authz.ts new file mode 100644 index 00000000..96f2d111 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/authz.ts @@ -0,0 +1,1213 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** spot authz messages */ +export interface CreateSpotLimitOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateSpotLimitOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz"; + value: Uint8Array; +} +/** spot authz messages */ +export interface CreateSpotLimitOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateSpotLimitOrderAuthzAminoMsg { + type: "exchange/CreateSpotLimitOrderAuthz"; + value: CreateSpotLimitOrderAuthzAmino; +} +export interface CreateSpotMarketOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateSpotMarketOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz"; + value: Uint8Array; +} +export interface CreateSpotMarketOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateSpotMarketOrderAuthzAminoMsg { + type: "exchange/CreateSpotMarketOrderAuthz"; + value: CreateSpotMarketOrderAuthzAmino; +} +export interface BatchCreateSpotLimitOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCreateSpotLimitOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCreateSpotLimitOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCreateSpotLimitOrdersAuthzAminoMsg { + type: "exchange/BatchCreateSpotLimitOrdersAuthz"; + value: BatchCreateSpotLimitOrdersAuthzAmino; +} +export interface CancelSpotOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CancelSpotOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz"; + value: Uint8Array; +} +export interface CancelSpotOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CancelSpotOrderAuthzAminoMsg { + type: "exchange/CancelSpotOrderAuthz"; + value: CancelSpotOrderAuthzAmino; +} +export interface BatchCancelSpotOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCancelSpotOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCancelSpotOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCancelSpotOrdersAuthzAminoMsg { + type: "exchange/BatchCancelSpotOrdersAuthz"; + value: BatchCancelSpotOrdersAuthzAmino; +} +/** derivative authz messages */ +export interface CreateDerivativeLimitOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateDerivativeLimitOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz"; + value: Uint8Array; +} +/** derivative authz messages */ +export interface CreateDerivativeLimitOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateDerivativeLimitOrderAuthzAminoMsg { + type: "exchange/CreateDerivativeLimitOrderAuthz"; + value: CreateDerivativeLimitOrderAuthzAmino; +} +export interface CreateDerivativeMarketOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateDerivativeMarketOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz"; + value: Uint8Array; +} +export interface CreateDerivativeMarketOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateDerivativeMarketOrderAuthzAminoMsg { + type: "exchange/CreateDerivativeMarketOrderAuthz"; + value: CreateDerivativeMarketOrderAuthzAmino; +} +export interface BatchCreateDerivativeLimitOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCreateDerivativeLimitOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCreateDerivativeLimitOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCreateDerivativeLimitOrdersAuthzAminoMsg { + type: "exchange/BatchCreateDerivativeLimitOrdersAuthz"; + value: BatchCreateDerivativeLimitOrdersAuthzAmino; +} +export interface CancelDerivativeOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CancelDerivativeOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz"; + value: Uint8Array; +} +export interface CancelDerivativeOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CancelDerivativeOrderAuthzAminoMsg { + type: "exchange/CancelDerivativeOrderAuthz"; + value: CancelDerivativeOrderAuthzAmino; +} +export interface BatchCancelDerivativeOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCancelDerivativeOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCancelDerivativeOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCancelDerivativeOrdersAuthzAminoMsg { + type: "exchange/BatchCancelDerivativeOrdersAuthz"; + value: BatchCancelDerivativeOrdersAuthzAmino; +} +/** common authz message used in both spot & derivative markets */ +export interface BatchUpdateOrdersAuthz { + subaccountId: string; + spotMarkets: string[]; + derivativeMarkets: string[]; +} +export interface BatchUpdateOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz"; + value: Uint8Array; +} +/** common authz message used in both spot & derivative markets */ +export interface BatchUpdateOrdersAuthzAmino { + subaccount_id: string; + spot_markets: string[]; + derivative_markets: string[]; +} +export interface BatchUpdateOrdersAuthzAminoMsg { + type: "exchange/BatchUpdateOrdersAuthz"; + value: BatchUpdateOrdersAuthzAmino; +} +function createBaseCreateSpotLimitOrderAuthz(): CreateSpotLimitOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateSpotLimitOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz", + aminoType: "exchange/CreateSpotLimitOrderAuthz", + is(o: any): o is CreateSpotLimitOrderAuthz { + return o && (o.$typeUrl === CreateSpotLimitOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateSpotLimitOrderAuthzAmino { + return o && (o.$typeUrl === CreateSpotLimitOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateSpotLimitOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateSpotLimitOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSpotLimitOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateSpotLimitOrderAuthz { + const message = createBaseCreateSpotLimitOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateSpotLimitOrderAuthzAmino): CreateSpotLimitOrderAuthz { + const message = createBaseCreateSpotLimitOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateSpotLimitOrderAuthzAminoMsg): CreateSpotLimitOrderAuthz { + return CreateSpotLimitOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzAminoMsg { + return { + type: "exchange/CreateSpotLimitOrderAuthz", + value: CreateSpotLimitOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateSpotLimitOrderAuthzProtoMsg): CreateSpotLimitOrderAuthz { + return CreateSpotLimitOrderAuthz.decode(message.value); + }, + toProto(message: CreateSpotLimitOrderAuthz): Uint8Array { + return CreateSpotLimitOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz", + value: CreateSpotLimitOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateSpotLimitOrderAuthz.typeUrl, CreateSpotLimitOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateSpotLimitOrderAuthz.aminoType, CreateSpotLimitOrderAuthz.typeUrl); +function createBaseCreateSpotMarketOrderAuthz(): CreateSpotMarketOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateSpotMarketOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz", + aminoType: "exchange/CreateSpotMarketOrderAuthz", + is(o: any): o is CreateSpotMarketOrderAuthz { + return o && (o.$typeUrl === CreateSpotMarketOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateSpotMarketOrderAuthzAmino { + return o && (o.$typeUrl === CreateSpotMarketOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateSpotMarketOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateSpotMarketOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSpotMarketOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateSpotMarketOrderAuthz { + const message = createBaseCreateSpotMarketOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateSpotMarketOrderAuthzAmino): CreateSpotMarketOrderAuthz { + const message = createBaseCreateSpotMarketOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateSpotMarketOrderAuthzAminoMsg): CreateSpotMarketOrderAuthz { + return CreateSpotMarketOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzAminoMsg { + return { + type: "exchange/CreateSpotMarketOrderAuthz", + value: CreateSpotMarketOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateSpotMarketOrderAuthzProtoMsg): CreateSpotMarketOrderAuthz { + return CreateSpotMarketOrderAuthz.decode(message.value); + }, + toProto(message: CreateSpotMarketOrderAuthz): Uint8Array { + return CreateSpotMarketOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz", + value: CreateSpotMarketOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateSpotMarketOrderAuthz.typeUrl, CreateSpotMarketOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateSpotMarketOrderAuthz.aminoType, CreateSpotMarketOrderAuthz.typeUrl); +function createBaseBatchCreateSpotLimitOrdersAuthz(): BatchCreateSpotLimitOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCreateSpotLimitOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz", + aminoType: "exchange/BatchCreateSpotLimitOrdersAuthz", + is(o: any): o is BatchCreateSpotLimitOrdersAuthz { + return o && (o.$typeUrl === BatchCreateSpotLimitOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCreateSpotLimitOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCreateSpotLimitOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCreateSpotLimitOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateSpotLimitOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCreateSpotLimitOrdersAuthz { + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCreateSpotLimitOrdersAuthzAmino): BatchCreateSpotLimitOrdersAuthz { + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCreateSpotLimitOrdersAuthzAminoMsg): BatchCreateSpotLimitOrdersAuthz { + return BatchCreateSpotLimitOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCreateSpotLimitOrdersAuthz", + value: BatchCreateSpotLimitOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCreateSpotLimitOrdersAuthzProtoMsg): BatchCreateSpotLimitOrdersAuthz { + return BatchCreateSpotLimitOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCreateSpotLimitOrdersAuthz): Uint8Array { + return BatchCreateSpotLimitOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz", + value: BatchCreateSpotLimitOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCreateSpotLimitOrdersAuthz.typeUrl, BatchCreateSpotLimitOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCreateSpotLimitOrdersAuthz.aminoType, BatchCreateSpotLimitOrdersAuthz.typeUrl); +function createBaseCancelSpotOrderAuthz(): CancelSpotOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CancelSpotOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz", + aminoType: "exchange/CancelSpotOrderAuthz", + is(o: any): o is CancelSpotOrderAuthz { + return o && (o.$typeUrl === CancelSpotOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CancelSpotOrderAuthzAmino { + return o && (o.$typeUrl === CancelSpotOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CancelSpotOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSpotOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSpotOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelSpotOrderAuthz { + const message = createBaseCancelSpotOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CancelSpotOrderAuthzAmino): CancelSpotOrderAuthz { + const message = createBaseCancelSpotOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CancelSpotOrderAuthzAminoMsg): CancelSpotOrderAuthz { + return CancelSpotOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzAminoMsg { + return { + type: "exchange/CancelSpotOrderAuthz", + value: CancelSpotOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSpotOrderAuthzProtoMsg): CancelSpotOrderAuthz { + return CancelSpotOrderAuthz.decode(message.value); + }, + toProto(message: CancelSpotOrderAuthz): Uint8Array { + return CancelSpotOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz", + value: CancelSpotOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelSpotOrderAuthz.typeUrl, CancelSpotOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelSpotOrderAuthz.aminoType, CancelSpotOrderAuthz.typeUrl); +function createBaseBatchCancelSpotOrdersAuthz(): BatchCancelSpotOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCancelSpotOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz", + aminoType: "exchange/BatchCancelSpotOrdersAuthz", + is(o: any): o is BatchCancelSpotOrdersAuthz { + return o && (o.$typeUrl === BatchCancelSpotOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCancelSpotOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCancelSpotOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCancelSpotOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelSpotOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCancelSpotOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCancelSpotOrdersAuthz { + const message = createBaseBatchCancelSpotOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCancelSpotOrdersAuthzAmino): BatchCancelSpotOrdersAuthz { + const message = createBaseBatchCancelSpotOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCancelSpotOrdersAuthzAminoMsg): BatchCancelSpotOrdersAuthz { + return BatchCancelSpotOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCancelSpotOrdersAuthz", + value: BatchCancelSpotOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCancelSpotOrdersAuthzProtoMsg): BatchCancelSpotOrdersAuthz { + return BatchCancelSpotOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCancelSpotOrdersAuthz): Uint8Array { + return BatchCancelSpotOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz", + value: BatchCancelSpotOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCancelSpotOrdersAuthz.typeUrl, BatchCancelSpotOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCancelSpotOrdersAuthz.aminoType, BatchCancelSpotOrdersAuthz.typeUrl); +function createBaseCreateDerivativeLimitOrderAuthz(): CreateDerivativeLimitOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateDerivativeLimitOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz", + aminoType: "exchange/CreateDerivativeLimitOrderAuthz", + is(o: any): o is CreateDerivativeLimitOrderAuthz { + return o && (o.$typeUrl === CreateDerivativeLimitOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateDerivativeLimitOrderAuthzAmino { + return o && (o.$typeUrl === CreateDerivativeLimitOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateDerivativeLimitOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateDerivativeLimitOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateDerivativeLimitOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateDerivativeLimitOrderAuthz { + const message = createBaseCreateDerivativeLimitOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateDerivativeLimitOrderAuthzAmino): CreateDerivativeLimitOrderAuthz { + const message = createBaseCreateDerivativeLimitOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateDerivativeLimitOrderAuthzAminoMsg): CreateDerivativeLimitOrderAuthz { + return CreateDerivativeLimitOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzAminoMsg { + return { + type: "exchange/CreateDerivativeLimitOrderAuthz", + value: CreateDerivativeLimitOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateDerivativeLimitOrderAuthzProtoMsg): CreateDerivativeLimitOrderAuthz { + return CreateDerivativeLimitOrderAuthz.decode(message.value); + }, + toProto(message: CreateDerivativeLimitOrderAuthz): Uint8Array { + return CreateDerivativeLimitOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz", + value: CreateDerivativeLimitOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateDerivativeLimitOrderAuthz.typeUrl, CreateDerivativeLimitOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateDerivativeLimitOrderAuthz.aminoType, CreateDerivativeLimitOrderAuthz.typeUrl); +function createBaseCreateDerivativeMarketOrderAuthz(): CreateDerivativeMarketOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateDerivativeMarketOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz", + aminoType: "exchange/CreateDerivativeMarketOrderAuthz", + is(o: any): o is CreateDerivativeMarketOrderAuthz { + return o && (o.$typeUrl === CreateDerivativeMarketOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateDerivativeMarketOrderAuthzAmino { + return o && (o.$typeUrl === CreateDerivativeMarketOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateDerivativeMarketOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateDerivativeMarketOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateDerivativeMarketOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateDerivativeMarketOrderAuthz { + const message = createBaseCreateDerivativeMarketOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateDerivativeMarketOrderAuthzAmino): CreateDerivativeMarketOrderAuthz { + const message = createBaseCreateDerivativeMarketOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateDerivativeMarketOrderAuthzAminoMsg): CreateDerivativeMarketOrderAuthz { + return CreateDerivativeMarketOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzAminoMsg { + return { + type: "exchange/CreateDerivativeMarketOrderAuthz", + value: CreateDerivativeMarketOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateDerivativeMarketOrderAuthzProtoMsg): CreateDerivativeMarketOrderAuthz { + return CreateDerivativeMarketOrderAuthz.decode(message.value); + }, + toProto(message: CreateDerivativeMarketOrderAuthz): Uint8Array { + return CreateDerivativeMarketOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz", + value: CreateDerivativeMarketOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateDerivativeMarketOrderAuthz.typeUrl, CreateDerivativeMarketOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateDerivativeMarketOrderAuthz.aminoType, CreateDerivativeMarketOrderAuthz.typeUrl); +function createBaseBatchCreateDerivativeLimitOrdersAuthz(): BatchCreateDerivativeLimitOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCreateDerivativeLimitOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz", + aminoType: "exchange/BatchCreateDerivativeLimitOrdersAuthz", + is(o: any): o is BatchCreateDerivativeLimitOrdersAuthz { + return o && (o.$typeUrl === BatchCreateDerivativeLimitOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCreateDerivativeLimitOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCreateDerivativeLimitOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCreateDerivativeLimitOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateDerivativeLimitOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCreateDerivativeLimitOrdersAuthz { + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCreateDerivativeLimitOrdersAuthzAmino): BatchCreateDerivativeLimitOrdersAuthz { + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCreateDerivativeLimitOrdersAuthzAminoMsg): BatchCreateDerivativeLimitOrdersAuthz { + return BatchCreateDerivativeLimitOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCreateDerivativeLimitOrdersAuthz", + value: BatchCreateDerivativeLimitOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCreateDerivativeLimitOrdersAuthzProtoMsg): BatchCreateDerivativeLimitOrdersAuthz { + return BatchCreateDerivativeLimitOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCreateDerivativeLimitOrdersAuthz): Uint8Array { + return BatchCreateDerivativeLimitOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz", + value: BatchCreateDerivativeLimitOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCreateDerivativeLimitOrdersAuthz.typeUrl, BatchCreateDerivativeLimitOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCreateDerivativeLimitOrdersAuthz.aminoType, BatchCreateDerivativeLimitOrdersAuthz.typeUrl); +function createBaseCancelDerivativeOrderAuthz(): CancelDerivativeOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CancelDerivativeOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz", + aminoType: "exchange/CancelDerivativeOrderAuthz", + is(o: any): o is CancelDerivativeOrderAuthz { + return o && (o.$typeUrl === CancelDerivativeOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CancelDerivativeOrderAuthzAmino { + return o && (o.$typeUrl === CancelDerivativeOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CancelDerivativeOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelDerivativeOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelDerivativeOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelDerivativeOrderAuthz { + const message = createBaseCancelDerivativeOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CancelDerivativeOrderAuthzAmino): CancelDerivativeOrderAuthz { + const message = createBaseCancelDerivativeOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CancelDerivativeOrderAuthzAminoMsg): CancelDerivativeOrderAuthz { + return CancelDerivativeOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzAminoMsg { + return { + type: "exchange/CancelDerivativeOrderAuthz", + value: CancelDerivativeOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CancelDerivativeOrderAuthzProtoMsg): CancelDerivativeOrderAuthz { + return CancelDerivativeOrderAuthz.decode(message.value); + }, + toProto(message: CancelDerivativeOrderAuthz): Uint8Array { + return CancelDerivativeOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz", + value: CancelDerivativeOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelDerivativeOrderAuthz.typeUrl, CancelDerivativeOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelDerivativeOrderAuthz.aminoType, CancelDerivativeOrderAuthz.typeUrl); +function createBaseBatchCancelDerivativeOrdersAuthz(): BatchCancelDerivativeOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCancelDerivativeOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz", + aminoType: "exchange/BatchCancelDerivativeOrdersAuthz", + is(o: any): o is BatchCancelDerivativeOrdersAuthz { + return o && (o.$typeUrl === BatchCancelDerivativeOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCancelDerivativeOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCancelDerivativeOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCancelDerivativeOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelDerivativeOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCancelDerivativeOrdersAuthz { + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCancelDerivativeOrdersAuthzAmino): BatchCancelDerivativeOrdersAuthz { + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCancelDerivativeOrdersAuthzAminoMsg): BatchCancelDerivativeOrdersAuthz { + return BatchCancelDerivativeOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCancelDerivativeOrdersAuthz", + value: BatchCancelDerivativeOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCancelDerivativeOrdersAuthzProtoMsg): BatchCancelDerivativeOrdersAuthz { + return BatchCancelDerivativeOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCancelDerivativeOrdersAuthz): Uint8Array { + return BatchCancelDerivativeOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz", + value: BatchCancelDerivativeOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCancelDerivativeOrdersAuthz.typeUrl, BatchCancelDerivativeOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCancelDerivativeOrdersAuthz.aminoType, BatchCancelDerivativeOrdersAuthz.typeUrl); +function createBaseBatchUpdateOrdersAuthz(): BatchUpdateOrdersAuthz { + return { + subaccountId: "", + spotMarkets: [], + derivativeMarkets: [] + }; +} +export const BatchUpdateOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz", + aminoType: "exchange/BatchUpdateOrdersAuthz", + is(o: any): o is BatchUpdateOrdersAuthz { + return o && (o.$typeUrl === BatchUpdateOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.spotMarkets) && (!o.spotMarkets.length || typeof o.spotMarkets[0] === "string") && Array.isArray(o.derivativeMarkets) && (!o.derivativeMarkets.length || typeof o.derivativeMarkets[0] === "string")); + }, + isAmino(o: any): o is BatchUpdateOrdersAuthzAmino { + return o && (o.$typeUrl === BatchUpdateOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.spot_markets) && (!o.spot_markets.length || typeof o.spot_markets[0] === "string") && Array.isArray(o.derivative_markets) && (!o.derivative_markets.length || typeof o.derivative_markets[0] === "string")); + }, + encode(message: BatchUpdateOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.spotMarkets) { + writer.uint32(18).string(v!); + } + for (const v of message.derivativeMarkets) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchUpdateOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.spotMarkets.push(reader.string()); + break; + case 3: + message.derivativeMarkets.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchUpdateOrdersAuthz { + const message = createBaseBatchUpdateOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.spotMarkets = object.spotMarkets?.map(e => e) || []; + message.derivativeMarkets = object.derivativeMarkets?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchUpdateOrdersAuthzAmino): BatchUpdateOrdersAuthz { + const message = createBaseBatchUpdateOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.spotMarkets = object.spot_markets?.map(e => e) || []; + message.derivativeMarkets = object.derivative_markets?.map(e => e) || []; + return message; + }, + toAmino(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.spotMarkets) { + obj.spot_markets = message.spotMarkets.map(e => e); + } else { + obj.spot_markets = message.spotMarkets; + } + if (message.derivativeMarkets) { + obj.derivative_markets = message.derivativeMarkets.map(e => e); + } else { + obj.derivative_markets = message.derivativeMarkets; + } + return obj; + }, + fromAminoMsg(object: BatchUpdateOrdersAuthzAminoMsg): BatchUpdateOrdersAuthz { + return BatchUpdateOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzAminoMsg { + return { + type: "exchange/BatchUpdateOrdersAuthz", + value: BatchUpdateOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchUpdateOrdersAuthzProtoMsg): BatchUpdateOrdersAuthz { + return BatchUpdateOrdersAuthz.decode(message.value); + }, + toProto(message: BatchUpdateOrdersAuthz): Uint8Array { + return BatchUpdateOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz", + value: BatchUpdateOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchUpdateOrdersAuthz.typeUrl, BatchUpdateOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchUpdateOrdersAuthz.aminoType, BatchUpdateOrdersAuthz.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/events.ts b/libs/injective-query/src/injective/exchange/v1beta1/events.ts new file mode 100644 index 00000000..133514d5 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/events.ts @@ -0,0 +1,4016 @@ +import { ExecutionType, TradeLog, TradeLogAmino, DerivativeTradeLog, DerivativeTradeLogAmino, SubaccountPosition, SubaccountPositionAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, SpotMarket, SpotMarketAmino, DerivativeMarket, DerivativeMarketAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, DepositUpdate, DepositUpdateAmino, DerivativeMarketOrder, DerivativeMarketOrderAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, AccountRewards, AccountRewardsAmino, DerivativeOrder, DerivativeOrderAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino, Level, LevelAmino, GrantAuthorization, GrantAuthorizationAmino } from "./exchange"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventBatchSpotExecution { + marketId: string; + isBuy: boolean; + executionType: ExecutionType; + trades: TradeLog[]; +} +export interface EventBatchSpotExecutionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution"; + value: Uint8Array; +} +export interface EventBatchSpotExecutionAmino { + market_id: string; + is_buy: boolean; + executionType: ExecutionType; + trades: TradeLogAmino[]; +} +export interface EventBatchSpotExecutionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchSpotExecution"; + value: EventBatchSpotExecutionAmino; +} +export interface EventBatchDerivativeExecution { + marketId: string; + isBuy: boolean; + isLiquidation: boolean; + /** nil for time expiry futures */ + cumulativeFunding?: string; + executionType: ExecutionType; + trades: DerivativeTradeLog[]; +} +export interface EventBatchDerivativeExecutionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution"; + value: Uint8Array; +} +export interface EventBatchDerivativeExecutionAmino { + market_id: string; + is_buy: boolean; + is_liquidation: boolean; + /** nil for time expiry futures */ + cumulative_funding?: string; + executionType: ExecutionType; + trades: DerivativeTradeLogAmino[]; +} +export interface EventBatchDerivativeExecutionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDerivativeExecution"; + value: EventBatchDerivativeExecutionAmino; +} +export interface EventLostFundsFromLiquidation { + marketId: string; + subaccountId: Uint8Array; + lostFundsFromAvailableDuringPayout: string; + lostFundsFromOrderCancels: string; +} +export interface EventLostFundsFromLiquidationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation"; + value: Uint8Array; +} +export interface EventLostFundsFromLiquidationAmino { + market_id: string; + subaccount_id: string; + lost_funds_from_available_during_payout: string; + lost_funds_from_order_cancels: string; +} +export interface EventLostFundsFromLiquidationAminoMsg { + type: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation"; + value: EventLostFundsFromLiquidationAmino; +} +export interface EventBatchDerivativePosition { + marketId: string; + positions: SubaccountPosition[]; +} +export interface EventBatchDerivativePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition"; + value: Uint8Array; +} +export interface EventBatchDerivativePositionAmino { + market_id: string; + positions: SubaccountPositionAmino[]; +} +export interface EventBatchDerivativePositionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDerivativePosition"; + value: EventBatchDerivativePositionAmino; +} +export interface EventDerivativeMarketPaused { + marketId: string; + settlePrice: string; + totalMissingFunds: string; + missingFundsRate: string; +} +export interface EventDerivativeMarketPausedProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused"; + value: Uint8Array; +} +export interface EventDerivativeMarketPausedAmino { + market_id: string; + settle_price: string; + total_missing_funds: string; + missing_funds_rate: string; +} +export interface EventDerivativeMarketPausedAminoMsg { + type: "/injective.exchange.v1beta1.EventDerivativeMarketPaused"; + value: EventDerivativeMarketPausedAmino; +} +export interface EventMarketBeyondBankruptcy { + marketId: string; + settlePrice: string; + missingMarketFunds: string; +} +export interface EventMarketBeyondBankruptcyProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy"; + value: Uint8Array; +} +export interface EventMarketBeyondBankruptcyAmino { + market_id: string; + settle_price: string; + missing_market_funds: string; +} +export interface EventMarketBeyondBankruptcyAminoMsg { + type: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy"; + value: EventMarketBeyondBankruptcyAmino; +} +export interface EventAllPositionsHaircut { + marketId: string; + settlePrice: string; + missingFundsRate: string; +} +export interface EventAllPositionsHaircutProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut"; + value: Uint8Array; +} +export interface EventAllPositionsHaircutAmino { + market_id: string; + settle_price: string; + missing_funds_rate: string; +} +export interface EventAllPositionsHaircutAminoMsg { + type: "/injective.exchange.v1beta1.EventAllPositionsHaircut"; + value: EventAllPositionsHaircutAmino; +} +export interface EventBinaryOptionsMarketUpdate { + market: BinaryOptionsMarket; +} +export interface EventBinaryOptionsMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate"; + value: Uint8Array; +} +export interface EventBinaryOptionsMarketUpdateAmino { + market: BinaryOptionsMarketAmino; +} +export interface EventBinaryOptionsMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate"; + value: EventBinaryOptionsMarketUpdateAmino; +} +export interface EventNewSpotOrders { + marketId: string; + buyOrders: SpotLimitOrder[]; + sellOrders: SpotLimitOrder[]; +} +export interface EventNewSpotOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders"; + value: Uint8Array; +} +export interface EventNewSpotOrdersAmino { + market_id: string; + buy_orders: SpotLimitOrderAmino[]; + sell_orders: SpotLimitOrderAmino[]; +} +export interface EventNewSpotOrdersAminoMsg { + type: "/injective.exchange.v1beta1.EventNewSpotOrders"; + value: EventNewSpotOrdersAmino; +} +export interface EventNewDerivativeOrders { + marketId: string; + buyOrders: DerivativeLimitOrder[]; + sellOrders: DerivativeLimitOrder[]; +} +export interface EventNewDerivativeOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders"; + value: Uint8Array; +} +export interface EventNewDerivativeOrdersAmino { + market_id: string; + buy_orders: DerivativeLimitOrderAmino[]; + sell_orders: DerivativeLimitOrderAmino[]; +} +export interface EventNewDerivativeOrdersAminoMsg { + type: "/injective.exchange.v1beta1.EventNewDerivativeOrders"; + value: EventNewDerivativeOrdersAmino; +} +export interface EventCancelSpotOrder { + marketId: string; + order: SpotLimitOrder; +} +export interface EventCancelSpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder"; + value: Uint8Array; +} +export interface EventCancelSpotOrderAmino { + market_id: string; + order: SpotLimitOrderAmino; +} +export interface EventCancelSpotOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelSpotOrder"; + value: EventCancelSpotOrderAmino; +} +export interface EventSpotMarketUpdate { + market: SpotMarket; +} +export interface EventSpotMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate"; + value: Uint8Array; +} +export interface EventSpotMarketUpdateAmino { + market: SpotMarketAmino; +} +export interface EventSpotMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventSpotMarketUpdate"; + value: EventSpotMarketUpdateAmino; +} +export interface EventPerpetualMarketUpdate { + market: DerivativeMarket; + perpetualMarketInfo?: PerpetualMarketInfo; + funding?: PerpetualMarketFunding; +} +export interface EventPerpetualMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate"; + value: Uint8Array; +} +export interface EventPerpetualMarketUpdateAmino { + market: DerivativeMarketAmino; + perpetual_market_info?: PerpetualMarketInfoAmino; + funding?: PerpetualMarketFundingAmino; +} +export interface EventPerpetualMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate"; + value: EventPerpetualMarketUpdateAmino; +} +export interface EventExpiryFuturesMarketUpdate { + market: DerivativeMarket; + expiryFuturesMarketInfo?: ExpiryFuturesMarketInfo; +} +export interface EventExpiryFuturesMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate"; + value: Uint8Array; +} +export interface EventExpiryFuturesMarketUpdateAmino { + market: DerivativeMarketAmino; + expiry_futures_market_info?: ExpiryFuturesMarketInfoAmino; +} +export interface EventExpiryFuturesMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate"; + value: EventExpiryFuturesMarketUpdateAmino; +} +export interface EventPerpetualMarketFundingUpdate { + marketId: string; + funding: PerpetualMarketFunding; + isHourlyFunding: boolean; + fundingRate?: string; + markPrice?: string; +} +export interface EventPerpetualMarketFundingUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate"; + value: Uint8Array; +} +export interface EventPerpetualMarketFundingUpdateAmino { + market_id: string; + funding: PerpetualMarketFundingAmino; + is_hourly_funding: boolean; + funding_rate?: string; + mark_price?: string; +} +export interface EventPerpetualMarketFundingUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate"; + value: EventPerpetualMarketFundingUpdateAmino; +} +export interface EventSubaccountDeposit { + srcAddress: string; + subaccountId: Uint8Array; + amount: Coin; +} +export interface EventSubaccountDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit"; + value: Uint8Array; +} +export interface EventSubaccountDepositAmino { + src_address: string; + subaccount_id: string; + amount: CoinAmino; +} +export interface EventSubaccountDepositAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountDeposit"; + value: EventSubaccountDepositAmino; +} +export interface EventSubaccountWithdraw { + subaccountId: Uint8Array; + dstAddress: string; + amount: Coin; +} +export interface EventSubaccountWithdrawProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw"; + value: Uint8Array; +} +export interface EventSubaccountWithdrawAmino { + subaccount_id: string; + dst_address: string; + amount: CoinAmino; +} +export interface EventSubaccountWithdrawAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountWithdraw"; + value: EventSubaccountWithdrawAmino; +} +export interface EventSubaccountBalanceTransfer { + srcSubaccountId: string; + dstSubaccountId: string; + amount: Coin; +} +export interface EventSubaccountBalanceTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer"; + value: Uint8Array; +} +export interface EventSubaccountBalanceTransferAmino { + src_subaccount_id: string; + dst_subaccount_id: string; + amount: CoinAmino; +} +export interface EventSubaccountBalanceTransferAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer"; + value: EventSubaccountBalanceTransferAmino; +} +export interface EventBatchDepositUpdate { + depositUpdates: DepositUpdate[]; +} +export interface EventBatchDepositUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate"; + value: Uint8Array; +} +export interface EventBatchDepositUpdateAmino { + deposit_updates: DepositUpdateAmino[]; +} +export interface EventBatchDepositUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDepositUpdate"; + value: EventBatchDepositUpdateAmino; +} +export interface DerivativeMarketOrderCancel { + marketOrder?: DerivativeMarketOrder; + cancelQuantity: string; +} +export interface DerivativeMarketOrderCancelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel"; + value: Uint8Array; +} +export interface DerivativeMarketOrderCancelAmino { + market_order?: DerivativeMarketOrderAmino; + cancel_quantity: string; +} +export interface DerivativeMarketOrderCancelAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel"; + value: DerivativeMarketOrderCancelAmino; +} +export interface EventCancelDerivativeOrder { + marketId: string; + isLimitCancel: boolean; + limitOrder?: DerivativeLimitOrder; + marketOrderCancel?: DerivativeMarketOrderCancel; +} +export interface EventCancelDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder"; + value: Uint8Array; +} +export interface EventCancelDerivativeOrderAmino { + market_id: string; + isLimitCancel: boolean; + limit_order?: DerivativeLimitOrderAmino; + market_order_cancel?: DerivativeMarketOrderCancelAmino; +} +export interface EventCancelDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelDerivativeOrder"; + value: EventCancelDerivativeOrderAmino; +} +export interface EventFeeDiscountSchedule { + schedule?: FeeDiscountSchedule; +} +export interface EventFeeDiscountScheduleProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule"; + value: Uint8Array; +} +export interface EventFeeDiscountScheduleAmino { + schedule?: FeeDiscountScheduleAmino; +} +export interface EventFeeDiscountScheduleAminoMsg { + type: "/injective.exchange.v1beta1.EventFeeDiscountSchedule"; + value: EventFeeDiscountScheduleAmino; +} +export interface EventTradingRewardCampaignUpdate { + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPools: CampaignRewardPool[]; +} +export interface EventTradingRewardCampaignUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate"; + value: Uint8Array; +} +export interface EventTradingRewardCampaignUpdateAmino { + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools: CampaignRewardPoolAmino[]; +} +export interface EventTradingRewardCampaignUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate"; + value: EventTradingRewardCampaignUpdateAmino; +} +export interface EventTradingRewardDistribution { + accountRewards: AccountRewards[]; +} +export interface EventTradingRewardDistributionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution"; + value: Uint8Array; +} +export interface EventTradingRewardDistributionAmino { + account_rewards: AccountRewardsAmino[]; +} +export interface EventTradingRewardDistributionAminoMsg { + type: "/injective.exchange.v1beta1.EventTradingRewardDistribution"; + value: EventTradingRewardDistributionAmino; +} +export interface EventNewConditionalDerivativeOrder { + marketId: string; + order?: DerivativeOrder; + hash: Uint8Array; + isMarket: boolean; +} +export interface EventNewConditionalDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder"; + value: Uint8Array; +} +export interface EventNewConditionalDerivativeOrderAmino { + market_id: string; + order?: DerivativeOrderAmino; + hash: string; + is_market: boolean; +} +export interface EventNewConditionalDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder"; + value: EventNewConditionalDerivativeOrderAmino; +} +export interface EventCancelConditionalDerivativeOrder { + marketId: string; + isLimitCancel: boolean; + limitOrder?: DerivativeLimitOrder; + marketOrder?: DerivativeMarketOrder; +} +export interface EventCancelConditionalDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder"; + value: Uint8Array; +} +export interface EventCancelConditionalDerivativeOrderAmino { + market_id: string; + isLimitCancel: boolean; + limit_order?: DerivativeLimitOrderAmino; + market_order?: DerivativeMarketOrderAmino; +} +export interface EventCancelConditionalDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder"; + value: EventCancelConditionalDerivativeOrderAmino; +} +export interface EventConditionalDerivativeOrderTrigger { + marketId: Uint8Array; + isLimitTrigger: boolean; + triggeredOrderHash: Uint8Array; + placedOrderHash: Uint8Array; + triggeredOrderCid: string; +} +export interface EventConditionalDerivativeOrderTriggerProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger"; + value: Uint8Array; +} +export interface EventConditionalDerivativeOrderTriggerAmino { + market_id: string; + isLimitTrigger: boolean; + triggered_order_hash: string; + placed_order_hash: string; + triggered_order_cid: string; +} +export interface EventConditionalDerivativeOrderTriggerAminoMsg { + type: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger"; + value: EventConditionalDerivativeOrderTriggerAmino; +} +export interface EventOrderFail { + account: Uint8Array; + hashes: Uint8Array[]; + flags: number[]; + cids: string[]; +} +export interface EventOrderFailProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail"; + value: Uint8Array; +} +export interface EventOrderFailAmino { + account: string; + hashes: string[]; + flags: number[]; + cids: string[]; +} +export interface EventOrderFailAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderFail"; + value: EventOrderFailAmino; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdated { + marketFeeMultipliers: MarketFeeMultiplier[]; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated"; + value: Uint8Array; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + market_fee_multipliers: MarketFeeMultiplierAmino[]; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedAminoMsg { + type: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated"; + value: EventAtomicMarketOrderFeeMultipliersUpdatedAmino; +} +export interface EventOrderbookUpdate { + spotUpdates: OrderbookUpdate[]; + derivativeUpdates: OrderbookUpdate[]; +} +export interface EventOrderbookUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate"; + value: Uint8Array; +} +export interface EventOrderbookUpdateAmino { + spot_updates: OrderbookUpdateAmino[]; + derivative_updates: OrderbookUpdateAmino[]; +} +export interface EventOrderbookUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderbookUpdate"; + value: EventOrderbookUpdateAmino; +} +export interface OrderbookUpdate { + seq: bigint; + orderbook?: Orderbook; +} +export interface OrderbookUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate"; + value: Uint8Array; +} +export interface OrderbookUpdateAmino { + seq: string; + orderbook?: OrderbookAmino; +} +export interface OrderbookUpdateAminoMsg { + type: "/injective.exchange.v1beta1.OrderbookUpdate"; + value: OrderbookUpdateAmino; +} +export interface Orderbook { + marketId: Uint8Array; + buyLevels: Level[]; + sellLevels: Level[]; +} +export interface OrderbookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Orderbook"; + value: Uint8Array; +} +export interface OrderbookAmino { + market_id: string; + buy_levels: LevelAmino[]; + sell_levels: LevelAmino[]; +} +export interface OrderbookAminoMsg { + type: "/injective.exchange.v1beta1.Orderbook"; + value: OrderbookAmino; +} +export interface EventGrantAuthorizations { + granter: string; + grants: GrantAuthorization[]; +} +export interface EventGrantAuthorizationsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations"; + value: Uint8Array; +} +export interface EventGrantAuthorizationsAmino { + granter: string; + grants: GrantAuthorizationAmino[]; +} +export interface EventGrantAuthorizationsAminoMsg { + type: "/injective.exchange.v1beta1.EventGrantAuthorizations"; + value: EventGrantAuthorizationsAmino; +} +export interface EventGrantActivation { + grantee: string; + granter: string; + amount: string; +} +export interface EventGrantActivationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation"; + value: Uint8Array; +} +export interface EventGrantActivationAmino { + grantee: string; + granter: string; + amount: string; +} +export interface EventGrantActivationAminoMsg { + type: "/injective.exchange.v1beta1.EventGrantActivation"; + value: EventGrantActivationAmino; +} +export interface EventInvalidGrant { + grantee: string; + granter: string; +} +export interface EventInvalidGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant"; + value: Uint8Array; +} +export interface EventInvalidGrantAmino { + grantee: string; + granter: string; +} +export interface EventInvalidGrantAminoMsg { + type: "/injective.exchange.v1beta1.EventInvalidGrant"; + value: EventInvalidGrantAmino; +} +export interface EventOrderCancelFail { + marketId: string; + subaccountId: string; + orderHash: string; + cid: string; + description: string; +} +export interface EventOrderCancelFailProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail"; + value: Uint8Array; +} +export interface EventOrderCancelFailAmino { + market_id: string; + subaccount_id: string; + order_hash: string; + cid: string; + description: string; +} +export interface EventOrderCancelFailAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderCancelFail"; + value: EventOrderCancelFailAmino; +} +function createBaseEventBatchSpotExecution(): EventBatchSpotExecution { + return { + marketId: "", + isBuy: false, + executionType: 0, + trades: [] + }; +} +export const EventBatchSpotExecution = { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution", + is(o: any): o is EventBatchSpotExecution { + return o && (o.$typeUrl === EventBatchSpotExecution.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || TradeLog.is(o.trades[0]))); + }, + isAmino(o: any): o is EventBatchSpotExecutionAmino { + return o && (o.$typeUrl === EventBatchSpotExecution.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || TradeLog.isAmino(o.trades[0]))); + }, + encode(message: EventBatchSpotExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== 0) { + writer.uint32(24).int32(message.executionType); + } + for (const v of message.trades) { + TradeLog.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchSpotExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchSpotExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = (reader.int32() as any); + break; + case 4: + message.trades.push(TradeLog.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchSpotExecution { + const message = createBaseEventBatchSpotExecution(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? 0; + message.trades = object.trades?.map(e => TradeLog.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchSpotExecutionAmino): EventBatchSpotExecution { + const message = createBaseEventBatchSpotExecution(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + message.trades = object.trades?.map(e => TradeLog.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchSpotExecution): EventBatchSpotExecutionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === 0 ? undefined : message.executionType; + if (message.trades) { + obj.trades = message.trades.map(e => e ? TradeLog.toAmino(e) : undefined); + } else { + obj.trades = message.trades; + } + return obj; + }, + fromAminoMsg(object: EventBatchSpotExecutionAminoMsg): EventBatchSpotExecution { + return EventBatchSpotExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchSpotExecutionProtoMsg): EventBatchSpotExecution { + return EventBatchSpotExecution.decode(message.value); + }, + toProto(message: EventBatchSpotExecution): Uint8Array { + return EventBatchSpotExecution.encode(message).finish(); + }, + toProtoMsg(message: EventBatchSpotExecution): EventBatchSpotExecutionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution", + value: EventBatchSpotExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchSpotExecution.typeUrl, EventBatchSpotExecution); +function createBaseEventBatchDerivativeExecution(): EventBatchDerivativeExecution { + return { + marketId: "", + isBuy: false, + isLiquidation: false, + cumulativeFunding: undefined, + executionType: 0, + trades: [] + }; +} +export const EventBatchDerivativeExecution = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution", + is(o: any): o is EventBatchDerivativeExecution { + return o && (o.$typeUrl === EventBatchDerivativeExecution.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.isLiquidation === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || DerivativeTradeLog.is(o.trades[0]))); + }, + isAmino(o: any): o is EventBatchDerivativeExecutionAmino { + return o && (o.$typeUrl === EventBatchDerivativeExecution.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.is_liquidation === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || DerivativeTradeLog.isAmino(o.trades[0]))); + }, + encode(message: EventBatchDerivativeExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.isLiquidation === true) { + writer.uint32(24).bool(message.isLiquidation); + } + if (message.cumulativeFunding !== undefined) { + writer.uint32(34).string(message.cumulativeFunding); + } + if (message.executionType !== 0) { + writer.uint32(40).int32(message.executionType); + } + for (const v of message.trades) { + DerivativeTradeLog.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDerivativeExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDerivativeExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.isLiquidation = reader.bool(); + break; + case 4: + message.cumulativeFunding = reader.string(); + break; + case 5: + message.executionType = (reader.int32() as any); + break; + case 6: + message.trades.push(DerivativeTradeLog.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDerivativeExecution { + const message = createBaseEventBatchDerivativeExecution(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.isLiquidation = object.isLiquidation ?? false; + message.cumulativeFunding = object.cumulativeFunding ?? undefined; + message.executionType = object.executionType ?? 0; + message.trades = object.trades?.map(e => DerivativeTradeLog.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDerivativeExecutionAmino): EventBatchDerivativeExecution { + const message = createBaseEventBatchDerivativeExecution(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.is_liquidation !== undefined && object.is_liquidation !== null) { + message.isLiquidation = object.is_liquidation; + } + if (object.cumulative_funding !== undefined && object.cumulative_funding !== null) { + message.cumulativeFunding = object.cumulative_funding; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + message.trades = object.trades?.map(e => DerivativeTradeLog.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDerivativeExecution): EventBatchDerivativeExecutionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.is_liquidation = message.isLiquidation === false ? undefined : message.isLiquidation; + obj.cumulative_funding = message.cumulativeFunding === null ? undefined : message.cumulativeFunding; + obj.executionType = message.executionType === 0 ? undefined : message.executionType; + if (message.trades) { + obj.trades = message.trades.map(e => e ? DerivativeTradeLog.toAmino(e) : undefined); + } else { + obj.trades = message.trades; + } + return obj; + }, + fromAminoMsg(object: EventBatchDerivativeExecutionAminoMsg): EventBatchDerivativeExecution { + return EventBatchDerivativeExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDerivativeExecutionProtoMsg): EventBatchDerivativeExecution { + return EventBatchDerivativeExecution.decode(message.value); + }, + toProto(message: EventBatchDerivativeExecution): Uint8Array { + return EventBatchDerivativeExecution.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDerivativeExecution): EventBatchDerivativeExecutionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution", + value: EventBatchDerivativeExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDerivativeExecution.typeUrl, EventBatchDerivativeExecution); +function createBaseEventLostFundsFromLiquidation(): EventLostFundsFromLiquidation { + return { + marketId: "", + subaccountId: new Uint8Array(), + lostFundsFromAvailableDuringPayout: "", + lostFundsFromOrderCancels: "" + }; +} +export const EventLostFundsFromLiquidation = { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation", + is(o: any): o is EventLostFundsFromLiquidation { + return o && (o.$typeUrl === EventLostFundsFromLiquidation.typeUrl || typeof o.marketId === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.lostFundsFromAvailableDuringPayout === "string" && typeof o.lostFundsFromOrderCancels === "string"); + }, + isAmino(o: any): o is EventLostFundsFromLiquidationAmino { + return o && (o.$typeUrl === EventLostFundsFromLiquidation.typeUrl || typeof o.market_id === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.lost_funds_from_available_during_payout === "string" && typeof o.lost_funds_from_order_cancels === "string"); + }, + encode(message: EventLostFundsFromLiquidation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + if (message.lostFundsFromAvailableDuringPayout !== "") { + writer.uint32(26).string(message.lostFundsFromAvailableDuringPayout); + } + if (message.lostFundsFromOrderCancels !== "") { + writer.uint32(34).string(message.lostFundsFromOrderCancels); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventLostFundsFromLiquidation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventLostFundsFromLiquidation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + case 3: + message.lostFundsFromAvailableDuringPayout = reader.string(); + break; + case 4: + message.lostFundsFromOrderCancels = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventLostFundsFromLiquidation { + const message = createBaseEventLostFundsFromLiquidation(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.lostFundsFromAvailableDuringPayout = object.lostFundsFromAvailableDuringPayout ?? ""; + message.lostFundsFromOrderCancels = object.lostFundsFromOrderCancels ?? ""; + return message; + }, + fromAmino(object: EventLostFundsFromLiquidationAmino): EventLostFundsFromLiquidation { + const message = createBaseEventLostFundsFromLiquidation(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.lost_funds_from_available_during_payout !== undefined && object.lost_funds_from_available_during_payout !== null) { + message.lostFundsFromAvailableDuringPayout = object.lost_funds_from_available_during_payout; + } + if (object.lost_funds_from_order_cancels !== undefined && object.lost_funds_from_order_cancels !== null) { + message.lostFundsFromOrderCancels = object.lost_funds_from_order_cancels; + } + return message; + }, + toAmino(message: EventLostFundsFromLiquidation): EventLostFundsFromLiquidationAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.lost_funds_from_available_during_payout = message.lostFundsFromAvailableDuringPayout === "" ? undefined : message.lostFundsFromAvailableDuringPayout; + obj.lost_funds_from_order_cancels = message.lostFundsFromOrderCancels === "" ? undefined : message.lostFundsFromOrderCancels; + return obj; + }, + fromAminoMsg(object: EventLostFundsFromLiquidationAminoMsg): EventLostFundsFromLiquidation { + return EventLostFundsFromLiquidation.fromAmino(object.value); + }, + fromProtoMsg(message: EventLostFundsFromLiquidationProtoMsg): EventLostFundsFromLiquidation { + return EventLostFundsFromLiquidation.decode(message.value); + }, + toProto(message: EventLostFundsFromLiquidation): Uint8Array { + return EventLostFundsFromLiquidation.encode(message).finish(); + }, + toProtoMsg(message: EventLostFundsFromLiquidation): EventLostFundsFromLiquidationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation", + value: EventLostFundsFromLiquidation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventLostFundsFromLiquidation.typeUrl, EventLostFundsFromLiquidation); +function createBaseEventBatchDerivativePosition(): EventBatchDerivativePosition { + return { + marketId: "", + positions: [] + }; +} +export const EventBatchDerivativePosition = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition", + is(o: any): o is EventBatchDerivativePosition { + return o && (o.$typeUrl === EventBatchDerivativePosition.typeUrl || typeof o.marketId === "string" && Array.isArray(o.positions) && (!o.positions.length || SubaccountPosition.is(o.positions[0]))); + }, + isAmino(o: any): o is EventBatchDerivativePositionAmino { + return o && (o.$typeUrl === EventBatchDerivativePosition.typeUrl || typeof o.market_id === "string" && Array.isArray(o.positions) && (!o.positions.length || SubaccountPosition.isAmino(o.positions[0]))); + }, + encode(message: EventBatchDerivativePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.positions) { + SubaccountPosition.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDerivativePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDerivativePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.positions.push(SubaccountPosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDerivativePosition { + const message = createBaseEventBatchDerivativePosition(); + message.marketId = object.marketId ?? ""; + message.positions = object.positions?.map(e => SubaccountPosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDerivativePositionAmino): EventBatchDerivativePosition { + const message = createBaseEventBatchDerivativePosition(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.positions = object.positions?.map(e => SubaccountPosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDerivativePosition): EventBatchDerivativePositionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.positions) { + obj.positions = message.positions.map(e => e ? SubaccountPosition.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + return obj; + }, + fromAminoMsg(object: EventBatchDerivativePositionAminoMsg): EventBatchDerivativePosition { + return EventBatchDerivativePosition.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDerivativePositionProtoMsg): EventBatchDerivativePosition { + return EventBatchDerivativePosition.decode(message.value); + }, + toProto(message: EventBatchDerivativePosition): Uint8Array { + return EventBatchDerivativePosition.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDerivativePosition): EventBatchDerivativePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition", + value: EventBatchDerivativePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDerivativePosition.typeUrl, EventBatchDerivativePosition); +function createBaseEventDerivativeMarketPaused(): EventDerivativeMarketPaused { + return { + marketId: "", + settlePrice: "", + totalMissingFunds: "", + missingFundsRate: "" + }; +} +export const EventDerivativeMarketPaused = { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused", + is(o: any): o is EventDerivativeMarketPaused { + return o && (o.$typeUrl === EventDerivativeMarketPaused.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.totalMissingFunds === "string" && typeof o.missingFundsRate === "string"); + }, + isAmino(o: any): o is EventDerivativeMarketPausedAmino { + return o && (o.$typeUrl === EventDerivativeMarketPaused.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.total_missing_funds === "string" && typeof o.missing_funds_rate === "string"); + }, + encode(message: EventDerivativeMarketPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.totalMissingFunds !== "") { + writer.uint32(26).string(message.totalMissingFunds); + } + if (message.missingFundsRate !== "") { + writer.uint32(34).string(message.missingFundsRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventDerivativeMarketPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventDerivativeMarketPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.totalMissingFunds = reader.string(); + break; + case 4: + message.missingFundsRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventDerivativeMarketPaused { + const message = createBaseEventDerivativeMarketPaused(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.totalMissingFunds = object.totalMissingFunds ?? ""; + message.missingFundsRate = object.missingFundsRate ?? ""; + return message; + }, + fromAmino(object: EventDerivativeMarketPausedAmino): EventDerivativeMarketPaused { + const message = createBaseEventDerivativeMarketPaused(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.total_missing_funds !== undefined && object.total_missing_funds !== null) { + message.totalMissingFunds = object.total_missing_funds; + } + if (object.missing_funds_rate !== undefined && object.missing_funds_rate !== null) { + message.missingFundsRate = object.missing_funds_rate; + } + return message; + }, + toAmino(message: EventDerivativeMarketPaused): EventDerivativeMarketPausedAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.total_missing_funds = message.totalMissingFunds === "" ? undefined : message.totalMissingFunds; + obj.missing_funds_rate = message.missingFundsRate === "" ? undefined : message.missingFundsRate; + return obj; + }, + fromAminoMsg(object: EventDerivativeMarketPausedAminoMsg): EventDerivativeMarketPaused { + return EventDerivativeMarketPaused.fromAmino(object.value); + }, + fromProtoMsg(message: EventDerivativeMarketPausedProtoMsg): EventDerivativeMarketPaused { + return EventDerivativeMarketPaused.decode(message.value); + }, + toProto(message: EventDerivativeMarketPaused): Uint8Array { + return EventDerivativeMarketPaused.encode(message).finish(); + }, + toProtoMsg(message: EventDerivativeMarketPaused): EventDerivativeMarketPausedProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused", + value: EventDerivativeMarketPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventDerivativeMarketPaused.typeUrl, EventDerivativeMarketPaused); +function createBaseEventMarketBeyondBankruptcy(): EventMarketBeyondBankruptcy { + return { + marketId: "", + settlePrice: "", + missingMarketFunds: "" + }; +} +export const EventMarketBeyondBankruptcy = { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy", + is(o: any): o is EventMarketBeyondBankruptcy { + return o && (o.$typeUrl === EventMarketBeyondBankruptcy.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.missingMarketFunds === "string"); + }, + isAmino(o: any): o is EventMarketBeyondBankruptcyAmino { + return o && (o.$typeUrl === EventMarketBeyondBankruptcy.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.missing_market_funds === "string"); + }, + encode(message: EventMarketBeyondBankruptcy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.missingMarketFunds !== "") { + writer.uint32(26).string(message.missingMarketFunds); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventMarketBeyondBankruptcy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMarketBeyondBankruptcy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.missingMarketFunds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventMarketBeyondBankruptcy { + const message = createBaseEventMarketBeyondBankruptcy(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.missingMarketFunds = object.missingMarketFunds ?? ""; + return message; + }, + fromAmino(object: EventMarketBeyondBankruptcyAmino): EventMarketBeyondBankruptcy { + const message = createBaseEventMarketBeyondBankruptcy(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.missing_market_funds !== undefined && object.missing_market_funds !== null) { + message.missingMarketFunds = object.missing_market_funds; + } + return message; + }, + toAmino(message: EventMarketBeyondBankruptcy): EventMarketBeyondBankruptcyAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.missing_market_funds = message.missingMarketFunds === "" ? undefined : message.missingMarketFunds; + return obj; + }, + fromAminoMsg(object: EventMarketBeyondBankruptcyAminoMsg): EventMarketBeyondBankruptcy { + return EventMarketBeyondBankruptcy.fromAmino(object.value); + }, + fromProtoMsg(message: EventMarketBeyondBankruptcyProtoMsg): EventMarketBeyondBankruptcy { + return EventMarketBeyondBankruptcy.decode(message.value); + }, + toProto(message: EventMarketBeyondBankruptcy): Uint8Array { + return EventMarketBeyondBankruptcy.encode(message).finish(); + }, + toProtoMsg(message: EventMarketBeyondBankruptcy): EventMarketBeyondBankruptcyProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy", + value: EventMarketBeyondBankruptcy.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventMarketBeyondBankruptcy.typeUrl, EventMarketBeyondBankruptcy); +function createBaseEventAllPositionsHaircut(): EventAllPositionsHaircut { + return { + marketId: "", + settlePrice: "", + missingFundsRate: "" + }; +} +export const EventAllPositionsHaircut = { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut", + is(o: any): o is EventAllPositionsHaircut { + return o && (o.$typeUrl === EventAllPositionsHaircut.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.missingFundsRate === "string"); + }, + isAmino(o: any): o is EventAllPositionsHaircutAmino { + return o && (o.$typeUrl === EventAllPositionsHaircut.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.missing_funds_rate === "string"); + }, + encode(message: EventAllPositionsHaircut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.missingFundsRate !== "") { + writer.uint32(26).string(message.missingFundsRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAllPositionsHaircut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAllPositionsHaircut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.missingFundsRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAllPositionsHaircut { + const message = createBaseEventAllPositionsHaircut(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.missingFundsRate = object.missingFundsRate ?? ""; + return message; + }, + fromAmino(object: EventAllPositionsHaircutAmino): EventAllPositionsHaircut { + const message = createBaseEventAllPositionsHaircut(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.missing_funds_rate !== undefined && object.missing_funds_rate !== null) { + message.missingFundsRate = object.missing_funds_rate; + } + return message; + }, + toAmino(message: EventAllPositionsHaircut): EventAllPositionsHaircutAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.missing_funds_rate = message.missingFundsRate === "" ? undefined : message.missingFundsRate; + return obj; + }, + fromAminoMsg(object: EventAllPositionsHaircutAminoMsg): EventAllPositionsHaircut { + return EventAllPositionsHaircut.fromAmino(object.value); + }, + fromProtoMsg(message: EventAllPositionsHaircutProtoMsg): EventAllPositionsHaircut { + return EventAllPositionsHaircut.decode(message.value); + }, + toProto(message: EventAllPositionsHaircut): Uint8Array { + return EventAllPositionsHaircut.encode(message).finish(); + }, + toProtoMsg(message: EventAllPositionsHaircut): EventAllPositionsHaircutProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut", + value: EventAllPositionsHaircut.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAllPositionsHaircut.typeUrl, EventAllPositionsHaircut); +function createBaseEventBinaryOptionsMarketUpdate(): EventBinaryOptionsMarketUpdate { + return { + market: BinaryOptionsMarket.fromPartial({}) + }; +} +export const EventBinaryOptionsMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate", + is(o: any): o is EventBinaryOptionsMarketUpdate { + return o && (o.$typeUrl === EventBinaryOptionsMarketUpdate.typeUrl || BinaryOptionsMarket.is(o.market)); + }, + isAmino(o: any): o is EventBinaryOptionsMarketUpdateAmino { + return o && (o.$typeUrl === EventBinaryOptionsMarketUpdate.typeUrl || BinaryOptionsMarket.isAmino(o.market)); + }, + encode(message: EventBinaryOptionsMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + BinaryOptionsMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBinaryOptionsMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBinaryOptionsMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = BinaryOptionsMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBinaryOptionsMarketUpdate { + const message = createBaseEventBinaryOptionsMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? BinaryOptionsMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: EventBinaryOptionsMarketUpdateAmino): EventBinaryOptionsMarketUpdate { + const message = createBaseEventBinaryOptionsMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = BinaryOptionsMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: EventBinaryOptionsMarketUpdate): EventBinaryOptionsMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? BinaryOptionsMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: EventBinaryOptionsMarketUpdateAminoMsg): EventBinaryOptionsMarketUpdate { + return EventBinaryOptionsMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventBinaryOptionsMarketUpdateProtoMsg): EventBinaryOptionsMarketUpdate { + return EventBinaryOptionsMarketUpdate.decode(message.value); + }, + toProto(message: EventBinaryOptionsMarketUpdate): Uint8Array { + return EventBinaryOptionsMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventBinaryOptionsMarketUpdate): EventBinaryOptionsMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate", + value: EventBinaryOptionsMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBinaryOptionsMarketUpdate.typeUrl, EventBinaryOptionsMarketUpdate); +function createBaseEventNewSpotOrders(): EventNewSpotOrders { + return { + marketId: "", + buyOrders: [], + sellOrders: [] + }; +} +export const EventNewSpotOrders = { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders", + is(o: any): o is EventNewSpotOrders { + return o && (o.$typeUrl === EventNewSpotOrders.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyOrders) && (!o.buyOrders.length || SpotLimitOrder.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || SpotLimitOrder.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is EventNewSpotOrdersAmino { + return o && (o.$typeUrl === EventNewSpotOrders.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_orders) && (!o.buy_orders.length || SpotLimitOrder.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || SpotLimitOrder.isAmino(o.sell_orders[0]))); + }, + encode(message: EventNewSpotOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyOrders) { + SpotLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellOrders) { + SpotLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewSpotOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewSpotOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyOrders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.sellOrders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewSpotOrders { + const message = createBaseEventNewSpotOrders(); + message.marketId = object.marketId ?? ""; + message.buyOrders = object.buyOrders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventNewSpotOrdersAmino): EventNewSpotOrders { + const message = createBaseEventNewSpotOrders(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyOrders = object.buy_orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventNewSpotOrders): EventNewSpotOrdersAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: EventNewSpotOrdersAminoMsg): EventNewSpotOrders { + return EventNewSpotOrders.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewSpotOrdersProtoMsg): EventNewSpotOrders { + return EventNewSpotOrders.decode(message.value); + }, + toProto(message: EventNewSpotOrders): Uint8Array { + return EventNewSpotOrders.encode(message).finish(); + }, + toProtoMsg(message: EventNewSpotOrders): EventNewSpotOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders", + value: EventNewSpotOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewSpotOrders.typeUrl, EventNewSpotOrders); +function createBaseEventNewDerivativeOrders(): EventNewDerivativeOrders { + return { + marketId: "", + buyOrders: [], + sellOrders: [] + }; +} +export const EventNewDerivativeOrders = { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders", + is(o: any): o is EventNewDerivativeOrders { + return o && (o.$typeUrl === EventNewDerivativeOrders.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyOrders) && (!o.buyOrders.length || DerivativeLimitOrder.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || DerivativeLimitOrder.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is EventNewDerivativeOrdersAmino { + return o && (o.$typeUrl === EventNewDerivativeOrders.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_orders) && (!o.buy_orders.length || DerivativeLimitOrder.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || DerivativeLimitOrder.isAmino(o.sell_orders[0]))); + }, + encode(message: EventNewDerivativeOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewDerivativeOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewDerivativeOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.sellOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewDerivativeOrders { + const message = createBaseEventNewDerivativeOrders(); + message.marketId = object.marketId ?? ""; + message.buyOrders = object.buyOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventNewDerivativeOrdersAmino): EventNewDerivativeOrders { + const message = createBaseEventNewDerivativeOrders(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyOrders = object.buy_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventNewDerivativeOrders): EventNewDerivativeOrdersAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: EventNewDerivativeOrdersAminoMsg): EventNewDerivativeOrders { + return EventNewDerivativeOrders.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewDerivativeOrdersProtoMsg): EventNewDerivativeOrders { + return EventNewDerivativeOrders.decode(message.value); + }, + toProto(message: EventNewDerivativeOrders): Uint8Array { + return EventNewDerivativeOrders.encode(message).finish(); + }, + toProtoMsg(message: EventNewDerivativeOrders): EventNewDerivativeOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders", + value: EventNewDerivativeOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewDerivativeOrders.typeUrl, EventNewDerivativeOrders); +function createBaseEventCancelSpotOrder(): EventCancelSpotOrder { + return { + marketId: "", + order: SpotLimitOrder.fromPartial({}) + }; +} +export const EventCancelSpotOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder", + is(o: any): o is EventCancelSpotOrder { + return o && (o.$typeUrl === EventCancelSpotOrder.typeUrl || typeof o.marketId === "string" && SpotLimitOrder.is(o.order)); + }, + isAmino(o: any): o is EventCancelSpotOrderAmino { + return o && (o.$typeUrl === EventCancelSpotOrder.typeUrl || typeof o.market_id === "string" && SpotLimitOrder.isAmino(o.order)); + }, + encode(message: EventCancelSpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + SpotLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelSpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = SpotLimitOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelSpotOrder { + const message = createBaseEventCancelSpotOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotLimitOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: EventCancelSpotOrderAmino): EventCancelSpotOrder { + const message = createBaseEventCancelSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotLimitOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: EventCancelSpotOrder): EventCancelSpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? SpotLimitOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelSpotOrderAminoMsg): EventCancelSpotOrder { + return EventCancelSpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelSpotOrderProtoMsg): EventCancelSpotOrder { + return EventCancelSpotOrder.decode(message.value); + }, + toProto(message: EventCancelSpotOrder): Uint8Array { + return EventCancelSpotOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelSpotOrder): EventCancelSpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder", + value: EventCancelSpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelSpotOrder.typeUrl, EventCancelSpotOrder); +function createBaseEventSpotMarketUpdate(): EventSpotMarketUpdate { + return { + market: SpotMarket.fromPartial({}) + }; +} +export const EventSpotMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate", + is(o: any): o is EventSpotMarketUpdate { + return o && (o.$typeUrl === EventSpotMarketUpdate.typeUrl || SpotMarket.is(o.market)); + }, + isAmino(o: any): o is EventSpotMarketUpdateAmino { + return o && (o.$typeUrl === EventSpotMarketUpdate.typeUrl || SpotMarket.isAmino(o.market)); + }, + encode(message: EventSpotMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSpotMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSpotMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSpotMarketUpdate { + const message = createBaseEventSpotMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: EventSpotMarketUpdateAmino): EventSpotMarketUpdate { + const message = createBaseEventSpotMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: EventSpotMarketUpdate): EventSpotMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: EventSpotMarketUpdateAminoMsg): EventSpotMarketUpdate { + return EventSpotMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventSpotMarketUpdateProtoMsg): EventSpotMarketUpdate { + return EventSpotMarketUpdate.decode(message.value); + }, + toProto(message: EventSpotMarketUpdate): Uint8Array { + return EventSpotMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventSpotMarketUpdate): EventSpotMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate", + value: EventSpotMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSpotMarketUpdate.typeUrl, EventSpotMarketUpdate); +function createBaseEventPerpetualMarketUpdate(): EventPerpetualMarketUpdate { + return { + market: DerivativeMarket.fromPartial({}), + perpetualMarketInfo: undefined, + funding: undefined + }; +} +export const EventPerpetualMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate", + is(o: any): o is EventPerpetualMarketUpdate { + return o && (o.$typeUrl === EventPerpetualMarketUpdate.typeUrl || DerivativeMarket.is(o.market)); + }, + isAmino(o: any): o is EventPerpetualMarketUpdateAmino { + return o && (o.$typeUrl === EventPerpetualMarketUpdate.typeUrl || DerivativeMarket.isAmino(o.market)); + }, + encode(message: EventPerpetualMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualMarketInfo !== undefined) { + PerpetualMarketInfo.encode(message.perpetualMarketInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventPerpetualMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventPerpetualMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualMarketInfo = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + case 3: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventPerpetualMarketUpdate { + const message = createBaseEventPerpetualMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.perpetualMarketInfo = object.perpetualMarketInfo !== undefined && object.perpetualMarketInfo !== null ? PerpetualMarketInfo.fromPartial(object.perpetualMarketInfo) : undefined; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + return message; + }, + fromAmino(object: EventPerpetualMarketUpdateAmino): EventPerpetualMarketUpdate { + const message = createBaseEventPerpetualMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.perpetual_market_info !== undefined && object.perpetual_market_info !== null) { + message.perpetualMarketInfo = PerpetualMarketInfo.fromAmino(object.perpetual_market_info); + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + return message; + }, + toAmino(message: EventPerpetualMarketUpdate): EventPerpetualMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.perpetual_market_info = message.perpetualMarketInfo ? PerpetualMarketInfo.toAmino(message.perpetualMarketInfo) : undefined; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + return obj; + }, + fromAminoMsg(object: EventPerpetualMarketUpdateAminoMsg): EventPerpetualMarketUpdate { + return EventPerpetualMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventPerpetualMarketUpdateProtoMsg): EventPerpetualMarketUpdate { + return EventPerpetualMarketUpdate.decode(message.value); + }, + toProto(message: EventPerpetualMarketUpdate): Uint8Array { + return EventPerpetualMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventPerpetualMarketUpdate): EventPerpetualMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate", + value: EventPerpetualMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventPerpetualMarketUpdate.typeUrl, EventPerpetualMarketUpdate); +function createBaseEventExpiryFuturesMarketUpdate(): EventExpiryFuturesMarketUpdate { + return { + market: DerivativeMarket.fromPartial({}), + expiryFuturesMarketInfo: undefined + }; +} +export const EventExpiryFuturesMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate", + is(o: any): o is EventExpiryFuturesMarketUpdate { + return o && (o.$typeUrl === EventExpiryFuturesMarketUpdate.typeUrl || DerivativeMarket.is(o.market)); + }, + isAmino(o: any): o is EventExpiryFuturesMarketUpdateAmino { + return o && (o.$typeUrl === EventExpiryFuturesMarketUpdate.typeUrl || DerivativeMarket.isAmino(o.market)); + }, + encode(message: EventExpiryFuturesMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.expiryFuturesMarketInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.expiryFuturesMarketInfo, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventExpiryFuturesMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventExpiryFuturesMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 3: + message.expiryFuturesMarketInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventExpiryFuturesMarketUpdate { + const message = createBaseEventExpiryFuturesMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.expiryFuturesMarketInfo = object.expiryFuturesMarketInfo !== undefined && object.expiryFuturesMarketInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.expiryFuturesMarketInfo) : undefined; + return message; + }, + fromAmino(object: EventExpiryFuturesMarketUpdateAmino): EventExpiryFuturesMarketUpdate { + const message = createBaseEventExpiryFuturesMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.expiry_futures_market_info !== undefined && object.expiry_futures_market_info !== null) { + message.expiryFuturesMarketInfo = ExpiryFuturesMarketInfo.fromAmino(object.expiry_futures_market_info); + } + return message; + }, + toAmino(message: EventExpiryFuturesMarketUpdate): EventExpiryFuturesMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.expiry_futures_market_info = message.expiryFuturesMarketInfo ? ExpiryFuturesMarketInfo.toAmino(message.expiryFuturesMarketInfo) : undefined; + return obj; + }, + fromAminoMsg(object: EventExpiryFuturesMarketUpdateAminoMsg): EventExpiryFuturesMarketUpdate { + return EventExpiryFuturesMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventExpiryFuturesMarketUpdateProtoMsg): EventExpiryFuturesMarketUpdate { + return EventExpiryFuturesMarketUpdate.decode(message.value); + }, + toProto(message: EventExpiryFuturesMarketUpdate): Uint8Array { + return EventExpiryFuturesMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventExpiryFuturesMarketUpdate): EventExpiryFuturesMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate", + value: EventExpiryFuturesMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventExpiryFuturesMarketUpdate.typeUrl, EventExpiryFuturesMarketUpdate); +function createBaseEventPerpetualMarketFundingUpdate(): EventPerpetualMarketFundingUpdate { + return { + marketId: "", + funding: PerpetualMarketFunding.fromPartial({}), + isHourlyFunding: false, + fundingRate: undefined, + markPrice: undefined + }; +} +export const EventPerpetualMarketFundingUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate", + is(o: any): o is EventPerpetualMarketFundingUpdate { + return o && (o.$typeUrl === EventPerpetualMarketFundingUpdate.typeUrl || typeof o.marketId === "string" && PerpetualMarketFunding.is(o.funding) && typeof o.isHourlyFunding === "boolean"); + }, + isAmino(o: any): o is EventPerpetualMarketFundingUpdateAmino { + return o && (o.$typeUrl === EventPerpetualMarketFundingUpdate.typeUrl || typeof o.market_id === "string" && PerpetualMarketFunding.isAmino(o.funding) && typeof o.is_hourly_funding === "boolean"); + }, + encode(message: EventPerpetualMarketFundingUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(18).fork()).ldelim(); + } + if (message.isHourlyFunding === true) { + writer.uint32(24).bool(message.isHourlyFunding); + } + if (message.fundingRate !== undefined) { + writer.uint32(34).string(message.fundingRate); + } + if (message.markPrice !== undefined) { + writer.uint32(42).string(message.markPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventPerpetualMarketFundingUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventPerpetualMarketFundingUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + case 3: + message.isHourlyFunding = reader.bool(); + break; + case 4: + message.fundingRate = reader.string(); + break; + case 5: + message.markPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventPerpetualMarketFundingUpdate { + const message = createBaseEventPerpetualMarketFundingUpdate(); + message.marketId = object.marketId ?? ""; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + message.isHourlyFunding = object.isHourlyFunding ?? false; + message.fundingRate = object.fundingRate ?? undefined; + message.markPrice = object.markPrice ?? undefined; + return message; + }, + fromAmino(object: EventPerpetualMarketFundingUpdateAmino): EventPerpetualMarketFundingUpdate { + const message = createBaseEventPerpetualMarketFundingUpdate(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + if (object.is_hourly_funding !== undefined && object.is_hourly_funding !== null) { + message.isHourlyFunding = object.is_hourly_funding; + } + if (object.funding_rate !== undefined && object.funding_rate !== null) { + message.fundingRate = object.funding_rate; + } + if (object.mark_price !== undefined && object.mark_price !== null) { + message.markPrice = object.mark_price; + } + return message; + }, + toAmino(message: EventPerpetualMarketFundingUpdate): EventPerpetualMarketFundingUpdateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + obj.is_hourly_funding = message.isHourlyFunding === false ? undefined : message.isHourlyFunding; + obj.funding_rate = message.fundingRate === null ? undefined : message.fundingRate; + obj.mark_price = message.markPrice === null ? undefined : message.markPrice; + return obj; + }, + fromAminoMsg(object: EventPerpetualMarketFundingUpdateAminoMsg): EventPerpetualMarketFundingUpdate { + return EventPerpetualMarketFundingUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventPerpetualMarketFundingUpdateProtoMsg): EventPerpetualMarketFundingUpdate { + return EventPerpetualMarketFundingUpdate.decode(message.value); + }, + toProto(message: EventPerpetualMarketFundingUpdate): Uint8Array { + return EventPerpetualMarketFundingUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventPerpetualMarketFundingUpdate): EventPerpetualMarketFundingUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate", + value: EventPerpetualMarketFundingUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventPerpetualMarketFundingUpdate.typeUrl, EventPerpetualMarketFundingUpdate); +function createBaseEventSubaccountDeposit(): EventSubaccountDeposit { + return { + srcAddress: "", + subaccountId: new Uint8Array(), + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountDeposit = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit", + is(o: any): o is EventSubaccountDeposit { + return o && (o.$typeUrl === EventSubaccountDeposit.typeUrl || typeof o.srcAddress === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountDepositAmino { + return o && (o.$typeUrl === EventSubaccountDeposit.typeUrl || typeof o.src_address === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.srcAddress !== "") { + writer.uint32(10).string(message.srcAddress); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.srcAddress = reader.string(); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountDeposit { + const message = createBaseEventSubaccountDeposit(); + message.srcAddress = object.srcAddress ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountDepositAmino): EventSubaccountDeposit { + const message = createBaseEventSubaccountDeposit(); + if (object.src_address !== undefined && object.src_address !== null) { + message.srcAddress = object.src_address; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountDeposit): EventSubaccountDepositAmino { + const obj: any = {}; + obj.src_address = message.srcAddress === "" ? undefined : message.srcAddress; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountDepositAminoMsg): EventSubaccountDeposit { + return EventSubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountDepositProtoMsg): EventSubaccountDeposit { + return EventSubaccountDeposit.decode(message.value); + }, + toProto(message: EventSubaccountDeposit): Uint8Array { + return EventSubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountDeposit): EventSubaccountDepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit", + value: EventSubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountDeposit.typeUrl, EventSubaccountDeposit); +function createBaseEventSubaccountWithdraw(): EventSubaccountWithdraw { + return { + subaccountId: new Uint8Array(), + dstAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountWithdraw = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw", + is(o: any): o is EventSubaccountWithdraw { + return o && (o.$typeUrl === EventSubaccountWithdraw.typeUrl || (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.dstAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountWithdrawAmino { + return o && (o.$typeUrl === EventSubaccountWithdraw.typeUrl || (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.dst_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.dstAddress !== "") { + writer.uint32(18).string(message.dstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.dstAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountWithdraw { + const message = createBaseEventSubaccountWithdraw(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.dstAddress = object.dstAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountWithdrawAmino): EventSubaccountWithdraw { + const message = createBaseEventSubaccountWithdraw(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.dst_address !== undefined && object.dst_address !== null) { + message.dstAddress = object.dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountWithdraw): EventSubaccountWithdrawAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.dst_address = message.dstAddress === "" ? undefined : message.dstAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountWithdrawAminoMsg): EventSubaccountWithdraw { + return EventSubaccountWithdraw.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountWithdrawProtoMsg): EventSubaccountWithdraw { + return EventSubaccountWithdraw.decode(message.value); + }, + toProto(message: EventSubaccountWithdraw): Uint8Array { + return EventSubaccountWithdraw.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountWithdraw): EventSubaccountWithdrawProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw", + value: EventSubaccountWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountWithdraw.typeUrl, EventSubaccountWithdraw); +function createBaseEventSubaccountBalanceTransfer(): EventSubaccountBalanceTransfer { + return { + srcSubaccountId: "", + dstSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountBalanceTransfer = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer", + is(o: any): o is EventSubaccountBalanceTransfer { + return o && (o.$typeUrl === EventSubaccountBalanceTransfer.typeUrl || typeof o.srcSubaccountId === "string" && typeof o.dstSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountBalanceTransferAmino { + return o && (o.$typeUrl === EventSubaccountBalanceTransfer.typeUrl || typeof o.src_subaccount_id === "string" && typeof o.dst_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountBalanceTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.srcSubaccountId !== "") { + writer.uint32(10).string(message.srcSubaccountId); + } + if (message.dstSubaccountId !== "") { + writer.uint32(18).string(message.dstSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountBalanceTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountBalanceTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.srcSubaccountId = reader.string(); + break; + case 2: + message.dstSubaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountBalanceTransfer { + const message = createBaseEventSubaccountBalanceTransfer(); + message.srcSubaccountId = object.srcSubaccountId ?? ""; + message.dstSubaccountId = object.dstSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountBalanceTransferAmino): EventSubaccountBalanceTransfer { + const message = createBaseEventSubaccountBalanceTransfer(); + if (object.src_subaccount_id !== undefined && object.src_subaccount_id !== null) { + message.srcSubaccountId = object.src_subaccount_id; + } + if (object.dst_subaccount_id !== undefined && object.dst_subaccount_id !== null) { + message.dstSubaccountId = object.dst_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountBalanceTransfer): EventSubaccountBalanceTransferAmino { + const obj: any = {}; + obj.src_subaccount_id = message.srcSubaccountId === "" ? undefined : message.srcSubaccountId; + obj.dst_subaccount_id = message.dstSubaccountId === "" ? undefined : message.dstSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountBalanceTransferAminoMsg): EventSubaccountBalanceTransfer { + return EventSubaccountBalanceTransfer.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountBalanceTransferProtoMsg): EventSubaccountBalanceTransfer { + return EventSubaccountBalanceTransfer.decode(message.value); + }, + toProto(message: EventSubaccountBalanceTransfer): Uint8Array { + return EventSubaccountBalanceTransfer.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountBalanceTransfer): EventSubaccountBalanceTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer", + value: EventSubaccountBalanceTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountBalanceTransfer.typeUrl, EventSubaccountBalanceTransfer); +function createBaseEventBatchDepositUpdate(): EventBatchDepositUpdate { + return { + depositUpdates: [] + }; +} +export const EventBatchDepositUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate", + is(o: any): o is EventBatchDepositUpdate { + return o && (o.$typeUrl === EventBatchDepositUpdate.typeUrl || Array.isArray(o.depositUpdates) && (!o.depositUpdates.length || DepositUpdate.is(o.depositUpdates[0]))); + }, + isAmino(o: any): o is EventBatchDepositUpdateAmino { + return o && (o.$typeUrl === EventBatchDepositUpdate.typeUrl || Array.isArray(o.deposit_updates) && (!o.deposit_updates.length || DepositUpdate.isAmino(o.deposit_updates[0]))); + }, + encode(message: EventBatchDepositUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.depositUpdates) { + DepositUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDepositUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDepositUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositUpdates.push(DepositUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDepositUpdate { + const message = createBaseEventBatchDepositUpdate(); + message.depositUpdates = object.depositUpdates?.map(e => DepositUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDepositUpdateAmino): EventBatchDepositUpdate { + const message = createBaseEventBatchDepositUpdate(); + message.depositUpdates = object.deposit_updates?.map(e => DepositUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDepositUpdate): EventBatchDepositUpdateAmino { + const obj: any = {}; + if (message.depositUpdates) { + obj.deposit_updates = message.depositUpdates.map(e => e ? DepositUpdate.toAmino(e) : undefined); + } else { + obj.deposit_updates = message.depositUpdates; + } + return obj; + }, + fromAminoMsg(object: EventBatchDepositUpdateAminoMsg): EventBatchDepositUpdate { + return EventBatchDepositUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDepositUpdateProtoMsg): EventBatchDepositUpdate { + return EventBatchDepositUpdate.decode(message.value); + }, + toProto(message: EventBatchDepositUpdate): Uint8Array { + return EventBatchDepositUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDepositUpdate): EventBatchDepositUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate", + value: EventBatchDepositUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDepositUpdate.typeUrl, EventBatchDepositUpdate); +function createBaseDerivativeMarketOrderCancel(): DerivativeMarketOrderCancel { + return { + marketOrder: undefined, + cancelQuantity: "" + }; +} +export const DerivativeMarketOrderCancel = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel", + is(o: any): o is DerivativeMarketOrderCancel { + return o && (o.$typeUrl === DerivativeMarketOrderCancel.typeUrl || typeof o.cancelQuantity === "string"); + }, + isAmino(o: any): o is DerivativeMarketOrderCancelAmino { + return o && (o.$typeUrl === DerivativeMarketOrderCancel.typeUrl || typeof o.cancel_quantity === "string"); + }, + encode(message: DerivativeMarketOrderCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketOrder !== undefined) { + DerivativeMarketOrder.encode(message.marketOrder, writer.uint32(10).fork()).ldelim(); + } + if (message.cancelQuantity !== "") { + writer.uint32(18).string(message.cancelQuantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrderCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrderCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketOrder = DerivativeMarketOrder.decode(reader, reader.uint32()); + break; + case 2: + message.cancelQuantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrderCancel { + const message = createBaseDerivativeMarketOrderCancel(); + message.marketOrder = object.marketOrder !== undefined && object.marketOrder !== null ? DerivativeMarketOrder.fromPartial(object.marketOrder) : undefined; + message.cancelQuantity = object.cancelQuantity ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketOrderCancelAmino): DerivativeMarketOrderCancel { + const message = createBaseDerivativeMarketOrderCancel(); + if (object.market_order !== undefined && object.market_order !== null) { + message.marketOrder = DerivativeMarketOrder.fromAmino(object.market_order); + } + if (object.cancel_quantity !== undefined && object.cancel_quantity !== null) { + message.cancelQuantity = object.cancel_quantity; + } + return message; + }, + toAmino(message: DerivativeMarketOrderCancel): DerivativeMarketOrderCancelAmino { + const obj: any = {}; + obj.market_order = message.marketOrder ? DerivativeMarketOrder.toAmino(message.marketOrder) : undefined; + obj.cancel_quantity = message.cancelQuantity === "" ? undefined : message.cancelQuantity; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderCancelAminoMsg): DerivativeMarketOrderCancel { + return DerivativeMarketOrderCancel.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderCancelProtoMsg): DerivativeMarketOrderCancel { + return DerivativeMarketOrderCancel.decode(message.value); + }, + toProto(message: DerivativeMarketOrderCancel): Uint8Array { + return DerivativeMarketOrderCancel.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrderCancel): DerivativeMarketOrderCancelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel", + value: DerivativeMarketOrderCancel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrderCancel.typeUrl, DerivativeMarketOrderCancel); +function createBaseEventCancelDerivativeOrder(): EventCancelDerivativeOrder { + return { + marketId: "", + isLimitCancel: false, + limitOrder: undefined, + marketOrderCancel: undefined + }; +} +export const EventCancelDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder", + is(o: any): o is EventCancelDerivativeOrder { + return o && (o.$typeUrl === EventCancelDerivativeOrder.typeUrl || typeof o.marketId === "string" && typeof o.isLimitCancel === "boolean"); + }, + isAmino(o: any): o is EventCancelDerivativeOrderAmino { + return o && (o.$typeUrl === EventCancelDerivativeOrder.typeUrl || typeof o.market_id === "string" && typeof o.isLimitCancel === "boolean"); + }, + encode(message: EventCancelDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isLimitCancel === true) { + writer.uint32(16).bool(message.isLimitCancel); + } + if (message.limitOrder !== undefined) { + DerivativeLimitOrder.encode(message.limitOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.marketOrderCancel !== undefined) { + DerivativeMarketOrderCancel.encode(message.marketOrderCancel, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isLimitCancel = reader.bool(); + break; + case 3: + message.limitOrder = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 4: + message.marketOrderCancel = DerivativeMarketOrderCancel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelDerivativeOrder { + const message = createBaseEventCancelDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.isLimitCancel = object.isLimitCancel ?? false; + message.limitOrder = object.limitOrder !== undefined && object.limitOrder !== null ? DerivativeLimitOrder.fromPartial(object.limitOrder) : undefined; + message.marketOrderCancel = object.marketOrderCancel !== undefined && object.marketOrderCancel !== null ? DerivativeMarketOrderCancel.fromPartial(object.marketOrderCancel) : undefined; + return message; + }, + fromAmino(object: EventCancelDerivativeOrderAmino): EventCancelDerivativeOrder { + const message = createBaseEventCancelDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isLimitCancel !== undefined && object.isLimitCancel !== null) { + message.isLimitCancel = object.isLimitCancel; + } + if (object.limit_order !== undefined && object.limit_order !== null) { + message.limitOrder = DerivativeLimitOrder.fromAmino(object.limit_order); + } + if (object.market_order_cancel !== undefined && object.market_order_cancel !== null) { + message.marketOrderCancel = DerivativeMarketOrderCancel.fromAmino(object.market_order_cancel); + } + return message; + }, + toAmino(message: EventCancelDerivativeOrder): EventCancelDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isLimitCancel = message.isLimitCancel === false ? undefined : message.isLimitCancel; + obj.limit_order = message.limitOrder ? DerivativeLimitOrder.toAmino(message.limitOrder) : undefined; + obj.market_order_cancel = message.marketOrderCancel ? DerivativeMarketOrderCancel.toAmino(message.marketOrderCancel) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelDerivativeOrderAminoMsg): EventCancelDerivativeOrder { + return EventCancelDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelDerivativeOrderProtoMsg): EventCancelDerivativeOrder { + return EventCancelDerivativeOrder.decode(message.value); + }, + toProto(message: EventCancelDerivativeOrder): Uint8Array { + return EventCancelDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelDerivativeOrder): EventCancelDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder", + value: EventCancelDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelDerivativeOrder.typeUrl, EventCancelDerivativeOrder); +function createBaseEventFeeDiscountSchedule(): EventFeeDiscountSchedule { + return { + schedule: undefined + }; +} +export const EventFeeDiscountSchedule = { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule", + is(o: any): o is EventFeeDiscountSchedule { + return o && o.$typeUrl === EventFeeDiscountSchedule.typeUrl; + }, + isAmino(o: any): o is EventFeeDiscountScheduleAmino { + return o && o.$typeUrl === EventFeeDiscountSchedule.typeUrl; + }, + encode(message: EventFeeDiscountSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + FeeDiscountSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventFeeDiscountSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventFeeDiscountSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventFeeDiscountSchedule { + const message = createBaseEventFeeDiscountSchedule(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? FeeDiscountSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: EventFeeDiscountScheduleAmino): EventFeeDiscountSchedule { + const message = createBaseEventFeeDiscountSchedule(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = FeeDiscountSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: EventFeeDiscountSchedule): EventFeeDiscountScheduleAmino { + const obj: any = {}; + obj.schedule = message.schedule ? FeeDiscountSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: EventFeeDiscountScheduleAminoMsg): EventFeeDiscountSchedule { + return EventFeeDiscountSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: EventFeeDiscountScheduleProtoMsg): EventFeeDiscountSchedule { + return EventFeeDiscountSchedule.decode(message.value); + }, + toProto(message: EventFeeDiscountSchedule): Uint8Array { + return EventFeeDiscountSchedule.encode(message).finish(); + }, + toProtoMsg(message: EventFeeDiscountSchedule): EventFeeDiscountScheduleProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule", + value: EventFeeDiscountSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventFeeDiscountSchedule.typeUrl, EventFeeDiscountSchedule); +function createBaseEventTradingRewardCampaignUpdate(): EventTradingRewardCampaignUpdate { + return { + campaignInfo: undefined, + campaignRewardPools: [] + }; +} +export const EventTradingRewardCampaignUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate", + is(o: any): o is EventTradingRewardCampaignUpdate { + return o && (o.$typeUrl === EventTradingRewardCampaignUpdate.typeUrl || Array.isArray(o.campaignRewardPools) && (!o.campaignRewardPools.length || CampaignRewardPool.is(o.campaignRewardPools[0]))); + }, + isAmino(o: any): o is EventTradingRewardCampaignUpdateAmino { + return o && (o.$typeUrl === EventTradingRewardCampaignUpdate.typeUrl || Array.isArray(o.campaign_reward_pools) && (!o.campaign_reward_pools.length || CampaignRewardPool.isAmino(o.campaign_reward_pools[0]))); + }, + encode(message: EventTradingRewardCampaignUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.campaignRewardPools) { + CampaignRewardPool.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTradingRewardCampaignUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTradingRewardCampaignUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 2: + message.campaignRewardPools.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTradingRewardCampaignUpdate { + const message = createBaseEventTradingRewardCampaignUpdate(); + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPools = object.campaignRewardPools?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventTradingRewardCampaignUpdateAmino): EventTradingRewardCampaignUpdate { + const message = createBaseEventTradingRewardCampaignUpdate(); + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPools = object.campaign_reward_pools?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventTradingRewardCampaignUpdate): EventTradingRewardCampaignUpdateAmino { + const obj: any = {}; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPools) { + obj.campaign_reward_pools = message.campaignRewardPools.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools = message.campaignRewardPools; + } + return obj; + }, + fromAminoMsg(object: EventTradingRewardCampaignUpdateAminoMsg): EventTradingRewardCampaignUpdate { + return EventTradingRewardCampaignUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventTradingRewardCampaignUpdateProtoMsg): EventTradingRewardCampaignUpdate { + return EventTradingRewardCampaignUpdate.decode(message.value); + }, + toProto(message: EventTradingRewardCampaignUpdate): Uint8Array { + return EventTradingRewardCampaignUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventTradingRewardCampaignUpdate): EventTradingRewardCampaignUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate", + value: EventTradingRewardCampaignUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTradingRewardCampaignUpdate.typeUrl, EventTradingRewardCampaignUpdate); +function createBaseEventTradingRewardDistribution(): EventTradingRewardDistribution { + return { + accountRewards: [] + }; +} +export const EventTradingRewardDistribution = { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution", + is(o: any): o is EventTradingRewardDistribution { + return o && (o.$typeUrl === EventTradingRewardDistribution.typeUrl || Array.isArray(o.accountRewards) && (!o.accountRewards.length || AccountRewards.is(o.accountRewards[0]))); + }, + isAmino(o: any): o is EventTradingRewardDistributionAmino { + return o && (o.$typeUrl === EventTradingRewardDistribution.typeUrl || Array.isArray(o.account_rewards) && (!o.account_rewards.length || AccountRewards.isAmino(o.account_rewards[0]))); + }, + encode(message: EventTradingRewardDistribution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountRewards) { + AccountRewards.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTradingRewardDistribution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTradingRewardDistribution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountRewards.push(AccountRewards.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTradingRewardDistribution { + const message = createBaseEventTradingRewardDistribution(); + message.accountRewards = object.accountRewards?.map(e => AccountRewards.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventTradingRewardDistributionAmino): EventTradingRewardDistribution { + const message = createBaseEventTradingRewardDistribution(); + message.accountRewards = object.account_rewards?.map(e => AccountRewards.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventTradingRewardDistribution): EventTradingRewardDistributionAmino { + const obj: any = {}; + if (message.accountRewards) { + obj.account_rewards = message.accountRewards.map(e => e ? AccountRewards.toAmino(e) : undefined); + } else { + obj.account_rewards = message.accountRewards; + } + return obj; + }, + fromAminoMsg(object: EventTradingRewardDistributionAminoMsg): EventTradingRewardDistribution { + return EventTradingRewardDistribution.fromAmino(object.value); + }, + fromProtoMsg(message: EventTradingRewardDistributionProtoMsg): EventTradingRewardDistribution { + return EventTradingRewardDistribution.decode(message.value); + }, + toProto(message: EventTradingRewardDistribution): Uint8Array { + return EventTradingRewardDistribution.encode(message).finish(); + }, + toProtoMsg(message: EventTradingRewardDistribution): EventTradingRewardDistributionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution", + value: EventTradingRewardDistribution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTradingRewardDistribution.typeUrl, EventTradingRewardDistribution); +function createBaseEventNewConditionalDerivativeOrder(): EventNewConditionalDerivativeOrder { + return { + marketId: "", + order: undefined, + hash: new Uint8Array(), + isMarket: false + }; +} +export const EventNewConditionalDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder", + is(o: any): o is EventNewConditionalDerivativeOrder { + return o && (o.$typeUrl === EventNewConditionalDerivativeOrder.typeUrl || typeof o.marketId === "string" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.isMarket === "boolean"); + }, + isAmino(o: any): o is EventNewConditionalDerivativeOrderAmino { + return o && (o.$typeUrl === EventNewConditionalDerivativeOrder.typeUrl || typeof o.market_id === "string" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.is_market === "boolean"); + }, + encode(message: EventNewConditionalDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(26).bytes(message.hash); + } + if (message.isMarket === true) { + writer.uint32(32).bool(message.isMarket); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewConditionalDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewConditionalDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + case 3: + message.hash = reader.bytes(); + break; + case 4: + message.isMarket = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewConditionalDerivativeOrder { + const message = createBaseEventNewConditionalDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + message.hash = object.hash ?? new Uint8Array(); + message.isMarket = object.isMarket ?? false; + return message; + }, + fromAmino(object: EventNewConditionalDerivativeOrderAmino): EventNewConditionalDerivativeOrder { + const message = createBaseEventNewConditionalDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.is_market !== undefined && object.is_market !== null) { + message.isMarket = object.is_market; + } + return message; + }, + toAmino(message: EventNewConditionalDerivativeOrder): EventNewConditionalDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.is_market = message.isMarket === false ? undefined : message.isMarket; + return obj; + }, + fromAminoMsg(object: EventNewConditionalDerivativeOrderAminoMsg): EventNewConditionalDerivativeOrder { + return EventNewConditionalDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewConditionalDerivativeOrderProtoMsg): EventNewConditionalDerivativeOrder { + return EventNewConditionalDerivativeOrder.decode(message.value); + }, + toProto(message: EventNewConditionalDerivativeOrder): Uint8Array { + return EventNewConditionalDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventNewConditionalDerivativeOrder): EventNewConditionalDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder", + value: EventNewConditionalDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewConditionalDerivativeOrder.typeUrl, EventNewConditionalDerivativeOrder); +function createBaseEventCancelConditionalDerivativeOrder(): EventCancelConditionalDerivativeOrder { + return { + marketId: "", + isLimitCancel: false, + limitOrder: undefined, + marketOrder: undefined + }; +} +export const EventCancelConditionalDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder", + is(o: any): o is EventCancelConditionalDerivativeOrder { + return o && (o.$typeUrl === EventCancelConditionalDerivativeOrder.typeUrl || typeof o.marketId === "string" && typeof o.isLimitCancel === "boolean"); + }, + isAmino(o: any): o is EventCancelConditionalDerivativeOrderAmino { + return o && (o.$typeUrl === EventCancelConditionalDerivativeOrder.typeUrl || typeof o.market_id === "string" && typeof o.isLimitCancel === "boolean"); + }, + encode(message: EventCancelConditionalDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isLimitCancel === true) { + writer.uint32(16).bool(message.isLimitCancel); + } + if (message.limitOrder !== undefined) { + DerivativeLimitOrder.encode(message.limitOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.marketOrder !== undefined) { + DerivativeMarketOrder.encode(message.marketOrder, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelConditionalDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelConditionalDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isLimitCancel = reader.bool(); + break; + case 3: + message.limitOrder = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 4: + message.marketOrder = DerivativeMarketOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelConditionalDerivativeOrder { + const message = createBaseEventCancelConditionalDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.isLimitCancel = object.isLimitCancel ?? false; + message.limitOrder = object.limitOrder !== undefined && object.limitOrder !== null ? DerivativeLimitOrder.fromPartial(object.limitOrder) : undefined; + message.marketOrder = object.marketOrder !== undefined && object.marketOrder !== null ? DerivativeMarketOrder.fromPartial(object.marketOrder) : undefined; + return message; + }, + fromAmino(object: EventCancelConditionalDerivativeOrderAmino): EventCancelConditionalDerivativeOrder { + const message = createBaseEventCancelConditionalDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isLimitCancel !== undefined && object.isLimitCancel !== null) { + message.isLimitCancel = object.isLimitCancel; + } + if (object.limit_order !== undefined && object.limit_order !== null) { + message.limitOrder = DerivativeLimitOrder.fromAmino(object.limit_order); + } + if (object.market_order !== undefined && object.market_order !== null) { + message.marketOrder = DerivativeMarketOrder.fromAmino(object.market_order); + } + return message; + }, + toAmino(message: EventCancelConditionalDerivativeOrder): EventCancelConditionalDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isLimitCancel = message.isLimitCancel === false ? undefined : message.isLimitCancel; + obj.limit_order = message.limitOrder ? DerivativeLimitOrder.toAmino(message.limitOrder) : undefined; + obj.market_order = message.marketOrder ? DerivativeMarketOrder.toAmino(message.marketOrder) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelConditionalDerivativeOrderAminoMsg): EventCancelConditionalDerivativeOrder { + return EventCancelConditionalDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelConditionalDerivativeOrderProtoMsg): EventCancelConditionalDerivativeOrder { + return EventCancelConditionalDerivativeOrder.decode(message.value); + }, + toProto(message: EventCancelConditionalDerivativeOrder): Uint8Array { + return EventCancelConditionalDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelConditionalDerivativeOrder): EventCancelConditionalDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder", + value: EventCancelConditionalDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelConditionalDerivativeOrder.typeUrl, EventCancelConditionalDerivativeOrder); +function createBaseEventConditionalDerivativeOrderTrigger(): EventConditionalDerivativeOrderTrigger { + return { + marketId: new Uint8Array(), + isLimitTrigger: false, + triggeredOrderHash: new Uint8Array(), + placedOrderHash: new Uint8Array(), + triggeredOrderCid: "" + }; +} +export const EventConditionalDerivativeOrderTrigger = { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger", + is(o: any): o is EventConditionalDerivativeOrderTrigger { + return o && (o.$typeUrl === EventConditionalDerivativeOrderTrigger.typeUrl || (o.marketId instanceof Uint8Array || typeof o.marketId === "string") && typeof o.isLimitTrigger === "boolean" && (o.triggeredOrderHash instanceof Uint8Array || typeof o.triggeredOrderHash === "string") && (o.placedOrderHash instanceof Uint8Array || typeof o.placedOrderHash === "string") && typeof o.triggeredOrderCid === "string"); + }, + isAmino(o: any): o is EventConditionalDerivativeOrderTriggerAmino { + return o && (o.$typeUrl === EventConditionalDerivativeOrderTrigger.typeUrl || (o.market_id instanceof Uint8Array || typeof o.market_id === "string") && typeof o.isLimitTrigger === "boolean" && (o.triggered_order_hash instanceof Uint8Array || typeof o.triggered_order_hash === "string") && (o.placed_order_hash instanceof Uint8Array || typeof o.placed_order_hash === "string") && typeof o.triggered_order_cid === "string"); + }, + encode(message: EventConditionalDerivativeOrderTrigger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId.length !== 0) { + writer.uint32(10).bytes(message.marketId); + } + if (message.isLimitTrigger === true) { + writer.uint32(16).bool(message.isLimitTrigger); + } + if (message.triggeredOrderHash.length !== 0) { + writer.uint32(26).bytes(message.triggeredOrderHash); + } + if (message.placedOrderHash.length !== 0) { + writer.uint32(34).bytes(message.placedOrderHash); + } + if (message.triggeredOrderCid !== "") { + writer.uint32(42).string(message.triggeredOrderCid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConditionalDerivativeOrderTrigger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConditionalDerivativeOrderTrigger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.bytes(); + break; + case 2: + message.isLimitTrigger = reader.bool(); + break; + case 3: + message.triggeredOrderHash = reader.bytes(); + break; + case 4: + message.placedOrderHash = reader.bytes(); + break; + case 5: + message.triggeredOrderCid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConditionalDerivativeOrderTrigger { + const message = createBaseEventConditionalDerivativeOrderTrigger(); + message.marketId = object.marketId ?? new Uint8Array(); + message.isLimitTrigger = object.isLimitTrigger ?? false; + message.triggeredOrderHash = object.triggeredOrderHash ?? new Uint8Array(); + message.placedOrderHash = object.placedOrderHash ?? new Uint8Array(); + message.triggeredOrderCid = object.triggeredOrderCid ?? ""; + return message; + }, + fromAmino(object: EventConditionalDerivativeOrderTriggerAmino): EventConditionalDerivativeOrderTrigger { + const message = createBaseEventConditionalDerivativeOrderTrigger(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = bytesFromBase64(object.market_id); + } + if (object.isLimitTrigger !== undefined && object.isLimitTrigger !== null) { + message.isLimitTrigger = object.isLimitTrigger; + } + if (object.triggered_order_hash !== undefined && object.triggered_order_hash !== null) { + message.triggeredOrderHash = bytesFromBase64(object.triggered_order_hash); + } + if (object.placed_order_hash !== undefined && object.placed_order_hash !== null) { + message.placedOrderHash = bytesFromBase64(object.placed_order_hash); + } + if (object.triggered_order_cid !== undefined && object.triggered_order_cid !== null) { + message.triggeredOrderCid = object.triggered_order_cid; + } + return message; + }, + toAmino(message: EventConditionalDerivativeOrderTrigger): EventConditionalDerivativeOrderTriggerAmino { + const obj: any = {}; + obj.market_id = message.marketId ? base64FromBytes(message.marketId) : undefined; + obj.isLimitTrigger = message.isLimitTrigger === false ? undefined : message.isLimitTrigger; + obj.triggered_order_hash = message.triggeredOrderHash ? base64FromBytes(message.triggeredOrderHash) : undefined; + obj.placed_order_hash = message.placedOrderHash ? base64FromBytes(message.placedOrderHash) : undefined; + obj.triggered_order_cid = message.triggeredOrderCid === "" ? undefined : message.triggeredOrderCid; + return obj; + }, + fromAminoMsg(object: EventConditionalDerivativeOrderTriggerAminoMsg): EventConditionalDerivativeOrderTrigger { + return EventConditionalDerivativeOrderTrigger.fromAmino(object.value); + }, + fromProtoMsg(message: EventConditionalDerivativeOrderTriggerProtoMsg): EventConditionalDerivativeOrderTrigger { + return EventConditionalDerivativeOrderTrigger.decode(message.value); + }, + toProto(message: EventConditionalDerivativeOrderTrigger): Uint8Array { + return EventConditionalDerivativeOrderTrigger.encode(message).finish(); + }, + toProtoMsg(message: EventConditionalDerivativeOrderTrigger): EventConditionalDerivativeOrderTriggerProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger", + value: EventConditionalDerivativeOrderTrigger.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConditionalDerivativeOrderTrigger.typeUrl, EventConditionalDerivativeOrderTrigger); +function createBaseEventOrderFail(): EventOrderFail { + return { + account: new Uint8Array(), + hashes: [], + flags: [], + cids: [] + }; +} +export const EventOrderFail = { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail", + is(o: any): o is EventOrderFail { + return o && (o.$typeUrl === EventOrderFail.typeUrl || (o.account instanceof Uint8Array || typeof o.account === "string") && Array.isArray(o.hashes) && (!o.hashes.length || o.hashes[0] instanceof Uint8Array || typeof o.hashes[0] === "string") && Array.isArray(o.flags) && (!o.flags.length || typeof o.flags[0] === "number") && Array.isArray(o.cids) && (!o.cids.length || typeof o.cids[0] === "string")); + }, + isAmino(o: any): o is EventOrderFailAmino { + return o && (o.$typeUrl === EventOrderFail.typeUrl || (o.account instanceof Uint8Array || typeof o.account === "string") && Array.isArray(o.hashes) && (!o.hashes.length || o.hashes[0] instanceof Uint8Array || typeof o.hashes[0] === "string") && Array.isArray(o.flags) && (!o.flags.length || typeof o.flags[0] === "number") && Array.isArray(o.cids) && (!o.cids.length || typeof o.cids[0] === "string")); + }, + encode(message: EventOrderFail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account.length !== 0) { + writer.uint32(10).bytes(message.account); + } + for (const v of message.hashes) { + writer.uint32(18).bytes(v!); + } + writer.uint32(26).fork(); + for (const v of message.flags) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.cids) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderFail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderFail(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.bytes(); + break; + case 2: + message.hashes.push(reader.bytes()); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.flags.push(reader.uint32()); + } + } else { + message.flags.push(reader.uint32()); + } + break; + case 4: + message.cids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderFail { + const message = createBaseEventOrderFail(); + message.account = object.account ?? new Uint8Array(); + message.hashes = object.hashes?.map(e => e) || []; + message.flags = object.flags?.map(e => e) || []; + message.cids = object.cids?.map(e => e) || []; + return message; + }, + fromAmino(object: EventOrderFailAmino): EventOrderFail { + const message = createBaseEventOrderFail(); + if (object.account !== undefined && object.account !== null) { + message.account = bytesFromBase64(object.account); + } + message.hashes = object.hashes?.map(e => bytesFromBase64(e)) || []; + message.flags = object.flags?.map(e => e) || []; + message.cids = object.cids?.map(e => e) || []; + return message; + }, + toAmino(message: EventOrderFail): EventOrderFailAmino { + const obj: any = {}; + obj.account = message.account ? base64FromBytes(message.account) : undefined; + if (message.hashes) { + obj.hashes = message.hashes.map(e => base64FromBytes(e)); + } else { + obj.hashes = message.hashes; + } + if (message.flags) { + obj.flags = message.flags.map(e => e); + } else { + obj.flags = message.flags; + } + if (message.cids) { + obj.cids = message.cids.map(e => e); + } else { + obj.cids = message.cids; + } + return obj; + }, + fromAminoMsg(object: EventOrderFailAminoMsg): EventOrderFail { + return EventOrderFail.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderFailProtoMsg): EventOrderFail { + return EventOrderFail.decode(message.value); + }, + toProto(message: EventOrderFail): Uint8Array { + return EventOrderFail.encode(message).finish(); + }, + toProtoMsg(message: EventOrderFail): EventOrderFailProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail", + value: EventOrderFail.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderFail.typeUrl, EventOrderFail); +function createBaseEventAtomicMarketOrderFeeMultipliersUpdated(): EventAtomicMarketOrderFeeMultipliersUpdated { + return { + marketFeeMultipliers: [] + }; +} +export const EventAtomicMarketOrderFeeMultipliersUpdated = { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated", + is(o: any): o is EventAtomicMarketOrderFeeMultipliersUpdated { + return o && (o.$typeUrl === EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl || Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0]))); + }, + isAmino(o: any): o is EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + return o && (o.$typeUrl === EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl || Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0]))); + }, + encode(message: EventAtomicMarketOrderFeeMultipliersUpdated, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAtomicMarketOrderFeeMultipliersUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAtomicMarketOrderFeeMultipliersUpdated { + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAtomicMarketOrderFeeMultipliersUpdatedAmino): EventAtomicMarketOrderFeeMultipliersUpdated { + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventAtomicMarketOrderFeeMultipliersUpdated): EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + const obj: any = {}; + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + return obj; + }, + fromAminoMsg(object: EventAtomicMarketOrderFeeMultipliersUpdatedAminoMsg): EventAtomicMarketOrderFeeMultipliersUpdated { + return EventAtomicMarketOrderFeeMultipliersUpdated.fromAmino(object.value); + }, + fromProtoMsg(message: EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg): EventAtomicMarketOrderFeeMultipliersUpdated { + return EventAtomicMarketOrderFeeMultipliersUpdated.decode(message.value); + }, + toProto(message: EventAtomicMarketOrderFeeMultipliersUpdated): Uint8Array { + return EventAtomicMarketOrderFeeMultipliersUpdated.encode(message).finish(); + }, + toProtoMsg(message: EventAtomicMarketOrderFeeMultipliersUpdated): EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated", + value: EventAtomicMarketOrderFeeMultipliersUpdated.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl, EventAtomicMarketOrderFeeMultipliersUpdated); +function createBaseEventOrderbookUpdate(): EventOrderbookUpdate { + return { + spotUpdates: [], + derivativeUpdates: [] + }; +} +export const EventOrderbookUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate", + is(o: any): o is EventOrderbookUpdate { + return o && (o.$typeUrl === EventOrderbookUpdate.typeUrl || Array.isArray(o.spotUpdates) && (!o.spotUpdates.length || OrderbookUpdate.is(o.spotUpdates[0])) && Array.isArray(o.derivativeUpdates) && (!o.derivativeUpdates.length || OrderbookUpdate.is(o.derivativeUpdates[0]))); + }, + isAmino(o: any): o is EventOrderbookUpdateAmino { + return o && (o.$typeUrl === EventOrderbookUpdate.typeUrl || Array.isArray(o.spot_updates) && (!o.spot_updates.length || OrderbookUpdate.isAmino(o.spot_updates[0])) && Array.isArray(o.derivative_updates) && (!o.derivative_updates.length || OrderbookUpdate.isAmino(o.derivative_updates[0]))); + }, + encode(message: EventOrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.spotUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.derivativeUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spotUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.derivativeUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderbookUpdate { + const message = createBaseEventOrderbookUpdate(); + message.spotUpdates = object.spotUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.derivativeUpdates = object.derivativeUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventOrderbookUpdateAmino): EventOrderbookUpdate { + const message = createBaseEventOrderbookUpdate(); + message.spotUpdates = object.spot_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.derivativeUpdates = object.derivative_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventOrderbookUpdate): EventOrderbookUpdateAmino { + const obj: any = {}; + if (message.spotUpdates) { + obj.spot_updates = message.spotUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.spot_updates = message.spotUpdates; + } + if (message.derivativeUpdates) { + obj.derivative_updates = message.derivativeUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.derivative_updates = message.derivativeUpdates; + } + return obj; + }, + fromAminoMsg(object: EventOrderbookUpdateAminoMsg): EventOrderbookUpdate { + return EventOrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderbookUpdateProtoMsg): EventOrderbookUpdate { + return EventOrderbookUpdate.decode(message.value); + }, + toProto(message: EventOrderbookUpdate): Uint8Array { + return EventOrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventOrderbookUpdate): EventOrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate", + value: EventOrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderbookUpdate.typeUrl, EventOrderbookUpdate); +function createBaseOrderbookUpdate(): OrderbookUpdate { + return { + seq: BigInt(0), + orderbook: undefined + }; +} +export const OrderbookUpdate = { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate", + is(o: any): o is OrderbookUpdate { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + isAmino(o: any): o is OrderbookUpdateAmino { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + encode(message: OrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seq !== BigInt(0)) { + writer.uint32(8).uint64(message.seq); + } + if (message.orderbook !== undefined) { + Orderbook.encode(message.orderbook, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seq = reader.uint64(); + break; + case 2: + message.orderbook = Orderbook.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + message.seq = object.seq !== undefined && object.seq !== null ? BigInt(object.seq.toString()) : BigInt(0); + message.orderbook = object.orderbook !== undefined && object.orderbook !== null ? Orderbook.fromPartial(object.orderbook) : undefined; + return message; + }, + fromAmino(object: OrderbookUpdateAmino): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + if (object.seq !== undefined && object.seq !== null) { + message.seq = BigInt(object.seq); + } + if (object.orderbook !== undefined && object.orderbook !== null) { + message.orderbook = Orderbook.fromAmino(object.orderbook); + } + return message; + }, + toAmino(message: OrderbookUpdate): OrderbookUpdateAmino { + const obj: any = {}; + obj.seq = message.seq !== BigInt(0) ? message.seq?.toString() : undefined; + obj.orderbook = message.orderbook ? Orderbook.toAmino(message.orderbook) : undefined; + return obj; + }, + fromAminoMsg(object: OrderbookUpdateAminoMsg): OrderbookUpdate { + return OrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookUpdateProtoMsg): OrderbookUpdate { + return OrderbookUpdate.decode(message.value); + }, + toProto(message: OrderbookUpdate): Uint8Array { + return OrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: OrderbookUpdate): OrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate", + value: OrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookUpdate.typeUrl, OrderbookUpdate); +function createBaseOrderbook(): Orderbook { + return { + marketId: new Uint8Array(), + buyLevels: [], + sellLevels: [] + }; +} +export const Orderbook = { + typeUrl: "/injective.exchange.v1beta1.Orderbook", + is(o: any): o is Orderbook { + return o && (o.$typeUrl === Orderbook.typeUrl || (o.marketId instanceof Uint8Array || typeof o.marketId === "string") && Array.isArray(o.buyLevels) && (!o.buyLevels.length || Level.is(o.buyLevels[0])) && Array.isArray(o.sellLevels) && (!o.sellLevels.length || Level.is(o.sellLevels[0]))); + }, + isAmino(o: any): o is OrderbookAmino { + return o && (o.$typeUrl === Orderbook.typeUrl || (o.market_id instanceof Uint8Array || typeof o.market_id === "string") && Array.isArray(o.buy_levels) && (!o.buy_levels.length || Level.isAmino(o.buy_levels[0])) && Array.isArray(o.sell_levels) && (!o.sell_levels.length || Level.isAmino(o.sell_levels[0]))); + }, + encode(message: Orderbook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId.length !== 0) { + writer.uint32(10).bytes(message.marketId); + } + for (const v of message.buyLevels) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellLevels) { + Level.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Orderbook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.bytes(); + break; + case 2: + message.buyLevels.push(Level.decode(reader, reader.uint32())); + break; + case 3: + message.sellLevels.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Orderbook { + const message = createBaseOrderbook(); + message.marketId = object.marketId ?? new Uint8Array(); + message.buyLevels = object.buyLevels?.map(e => Level.fromPartial(e)) || []; + message.sellLevels = object.sellLevels?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OrderbookAmino): Orderbook { + const message = createBaseOrderbook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = bytesFromBase64(object.market_id); + } + message.buyLevels = object.buy_levels?.map(e => Level.fromAmino(e)) || []; + message.sellLevels = object.sell_levels?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: Orderbook): OrderbookAmino { + const obj: any = {}; + obj.market_id = message.marketId ? base64FromBytes(message.marketId) : undefined; + if (message.buyLevels) { + obj.buy_levels = message.buyLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buy_levels = message.buyLevels; + } + if (message.sellLevels) { + obj.sell_levels = message.sellLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sell_levels = message.sellLevels; + } + return obj; + }, + fromAminoMsg(object: OrderbookAminoMsg): Orderbook { + return Orderbook.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookProtoMsg): Orderbook { + return Orderbook.decode(message.value); + }, + toProto(message: Orderbook): Uint8Array { + return Orderbook.encode(message).finish(); + }, + toProtoMsg(message: Orderbook): OrderbookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Orderbook", + value: Orderbook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Orderbook.typeUrl, Orderbook); +function createBaseEventGrantAuthorizations(): EventGrantAuthorizations { + return { + granter: "", + grants: [] + }; +} +export const EventGrantAuthorizations = { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations", + is(o: any): o is EventGrantAuthorizations { + return o && (o.$typeUrl === EventGrantAuthorizations.typeUrl || typeof o.granter === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is EventGrantAuthorizationsAmino { + return o && (o.$typeUrl === EventGrantAuthorizations.typeUrl || typeof o.granter === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: EventGrantAuthorizations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventGrantAuthorizations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGrantAuthorizations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventGrantAuthorizations { + const message = createBaseEventGrantAuthorizations(); + message.granter = object.granter ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventGrantAuthorizationsAmino): EventGrantAuthorizations { + const message = createBaseEventGrantAuthorizations(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventGrantAuthorizations): EventGrantAuthorizationsAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: EventGrantAuthorizationsAminoMsg): EventGrantAuthorizations { + return EventGrantAuthorizations.fromAmino(object.value); + }, + fromProtoMsg(message: EventGrantAuthorizationsProtoMsg): EventGrantAuthorizations { + return EventGrantAuthorizations.decode(message.value); + }, + toProto(message: EventGrantAuthorizations): Uint8Array { + return EventGrantAuthorizations.encode(message).finish(); + }, + toProtoMsg(message: EventGrantAuthorizations): EventGrantAuthorizationsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations", + value: EventGrantAuthorizations.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventGrantAuthorizations.typeUrl, EventGrantAuthorizations); +function createBaseEventGrantActivation(): EventGrantActivation { + return { + grantee: "", + granter: "", + amount: "" + }; +} +export const EventGrantActivation = { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation", + is(o: any): o is EventGrantActivation { + return o && (o.$typeUrl === EventGrantActivation.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is EventGrantActivationAmino { + return o && (o.$typeUrl === EventGrantActivation.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string" && typeof o.amount === "string"); + }, + encode(message: EventGrantActivation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventGrantActivation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGrantActivation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventGrantActivation { + const message = createBaseEventGrantActivation(); + message.grantee = object.grantee ?? ""; + message.granter = object.granter ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: EventGrantActivationAmino): EventGrantActivation { + const message = createBaseEventGrantActivation(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: EventGrantActivation): EventGrantActivationAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: EventGrantActivationAminoMsg): EventGrantActivation { + return EventGrantActivation.fromAmino(object.value); + }, + fromProtoMsg(message: EventGrantActivationProtoMsg): EventGrantActivation { + return EventGrantActivation.decode(message.value); + }, + toProto(message: EventGrantActivation): Uint8Array { + return EventGrantActivation.encode(message).finish(); + }, + toProtoMsg(message: EventGrantActivation): EventGrantActivationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation", + value: EventGrantActivation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventGrantActivation.typeUrl, EventGrantActivation); +function createBaseEventInvalidGrant(): EventInvalidGrant { + return { + grantee: "", + granter: "" + }; +} +export const EventInvalidGrant = { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant", + is(o: any): o is EventInvalidGrant { + return o && (o.$typeUrl === EventInvalidGrant.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is EventInvalidGrantAmino { + return o && (o.$typeUrl === EventInvalidGrant.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string"); + }, + encode(message: EventInvalidGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInvalidGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInvalidGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInvalidGrant { + const message = createBaseEventInvalidGrant(); + message.grantee = object.grantee ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: EventInvalidGrantAmino): EventInvalidGrant { + const message = createBaseEventInvalidGrant(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: EventInvalidGrant): EventInvalidGrantAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: EventInvalidGrantAminoMsg): EventInvalidGrant { + return EventInvalidGrant.fromAmino(object.value); + }, + fromProtoMsg(message: EventInvalidGrantProtoMsg): EventInvalidGrant { + return EventInvalidGrant.decode(message.value); + }, + toProto(message: EventInvalidGrant): Uint8Array { + return EventInvalidGrant.encode(message).finish(); + }, + toProtoMsg(message: EventInvalidGrant): EventInvalidGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant", + value: EventInvalidGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInvalidGrant.typeUrl, EventInvalidGrant); +function createBaseEventOrderCancelFail(): EventOrderCancelFail { + return { + marketId: "", + subaccountId: "", + orderHash: "", + cid: "", + description: "" + }; +} +export const EventOrderCancelFail = { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail", + is(o: any): o is EventOrderCancelFail { + return o && (o.$typeUrl === EventOrderCancelFail.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.cid === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is EventOrderCancelFailAmino { + return o && (o.$typeUrl === EventOrderCancelFail.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.cid === "string" && typeof o.description === "string"); + }, + encode(message: EventOrderCancelFail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(26).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(34).string(message.cid); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderCancelFail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderCancelFail(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHash = reader.string(); + break; + case 4: + message.cid = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderCancelFail { + const message = createBaseEventOrderCancelFail(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: EventOrderCancelFailAmino): EventOrderCancelFail { + const message = createBaseEventOrderCancelFail(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: EventOrderCancelFail): EventOrderCancelFailAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: EventOrderCancelFailAminoMsg): EventOrderCancelFail { + return EventOrderCancelFail.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderCancelFailProtoMsg): EventOrderCancelFail { + return EventOrderCancelFail.decode(message.value); + }, + toProto(message: EventOrderCancelFail): Uint8Array { + return EventOrderCancelFail.encode(message).finish(); + }, + toProtoMsg(message: EventOrderCancelFail): EventOrderCancelFailProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail", + value: EventOrderCancelFail.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderCancelFail.typeUrl, EventOrderCancelFail); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/exchange.ts b/libs/injective-query/src/injective/exchange/v1beta1/exchange.ts new file mode 100644 index 00000000..a91677d5 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/exchange.ts @@ -0,0 +1,7789 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum AtomicMarketOrderAccessLevel { + Nobody = 0, + /** BeginBlockerSmartContractsOnly - currently unsupported */ + BeginBlockerSmartContractsOnly = 1, + SmartContractsOnly = 2, + Everyone = 3, + UNRECOGNIZED = -1, +} +export const AtomicMarketOrderAccessLevelAmino = AtomicMarketOrderAccessLevel; +export function atomicMarketOrderAccessLevelFromJSON(object: any): AtomicMarketOrderAccessLevel { + switch (object) { + case 0: + case "Nobody": + return AtomicMarketOrderAccessLevel.Nobody; + case 1: + case "BeginBlockerSmartContractsOnly": + return AtomicMarketOrderAccessLevel.BeginBlockerSmartContractsOnly; + case 2: + case "SmartContractsOnly": + return AtomicMarketOrderAccessLevel.SmartContractsOnly; + case 3: + case "Everyone": + return AtomicMarketOrderAccessLevel.Everyone; + case -1: + case "UNRECOGNIZED": + default: + return AtomicMarketOrderAccessLevel.UNRECOGNIZED; + } +} +export function atomicMarketOrderAccessLevelToJSON(object: AtomicMarketOrderAccessLevel): string { + switch (object) { + case AtomicMarketOrderAccessLevel.Nobody: + return "Nobody"; + case AtomicMarketOrderAccessLevel.BeginBlockerSmartContractsOnly: + return "BeginBlockerSmartContractsOnly"; + case AtomicMarketOrderAccessLevel.SmartContractsOnly: + return "SmartContractsOnly"; + case AtomicMarketOrderAccessLevel.Everyone: + return "Everyone"; + case AtomicMarketOrderAccessLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MarketStatus { + Unspecified = 0, + Active = 1, + Paused = 2, + Demolished = 3, + Expired = 4, + UNRECOGNIZED = -1, +} +export const MarketStatusAmino = MarketStatus; +export function marketStatusFromJSON(object: any): MarketStatus { + switch (object) { + case 0: + case "Unspecified": + return MarketStatus.Unspecified; + case 1: + case "Active": + return MarketStatus.Active; + case 2: + case "Paused": + return MarketStatus.Paused; + case 3: + case "Demolished": + return MarketStatus.Demolished; + case 4: + case "Expired": + return MarketStatus.Expired; + case -1: + case "UNRECOGNIZED": + default: + return MarketStatus.UNRECOGNIZED; + } +} +export function marketStatusToJSON(object: MarketStatus): string { + switch (object) { + case MarketStatus.Unspecified: + return "Unspecified"; + case MarketStatus.Active: + return "Active"; + case MarketStatus.Paused: + return "Paused"; + case MarketStatus.Demolished: + return "Demolished"; + case MarketStatus.Expired: + return "Expired"; + case MarketStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum OrderType { + UNSPECIFIED = 0, + BUY = 1, + SELL = 2, + STOP_BUY = 3, + STOP_SELL = 4, + TAKE_BUY = 5, + TAKE_SELL = 6, + BUY_PO = 7, + SELL_PO = 8, + BUY_ATOMIC = 9, + SELL_ATOMIC = 10, + UNRECOGNIZED = -1, +} +export const OrderTypeAmino = OrderType; +export function orderTypeFromJSON(object: any): OrderType { + switch (object) { + case 0: + case "UNSPECIFIED": + return OrderType.UNSPECIFIED; + case 1: + case "BUY": + return OrderType.BUY; + case 2: + case "SELL": + return OrderType.SELL; + case 3: + case "STOP_BUY": + return OrderType.STOP_BUY; + case 4: + case "STOP_SELL": + return OrderType.STOP_SELL; + case 5: + case "TAKE_BUY": + return OrderType.TAKE_BUY; + case 6: + case "TAKE_SELL": + return OrderType.TAKE_SELL; + case 7: + case "BUY_PO": + return OrderType.BUY_PO; + case 8: + case "SELL_PO": + return OrderType.SELL_PO; + case 9: + case "BUY_ATOMIC": + return OrderType.BUY_ATOMIC; + case 10: + case "SELL_ATOMIC": + return OrderType.SELL_ATOMIC; + case -1: + case "UNRECOGNIZED": + default: + return OrderType.UNRECOGNIZED; + } +} +export function orderTypeToJSON(object: OrderType): string { + switch (object) { + case OrderType.UNSPECIFIED: + return "UNSPECIFIED"; + case OrderType.BUY: + return "BUY"; + case OrderType.SELL: + return "SELL"; + case OrderType.STOP_BUY: + return "STOP_BUY"; + case OrderType.STOP_SELL: + return "STOP_SELL"; + case OrderType.TAKE_BUY: + return "TAKE_BUY"; + case OrderType.TAKE_SELL: + return "TAKE_SELL"; + case OrderType.BUY_PO: + return "BUY_PO"; + case OrderType.SELL_PO: + return "SELL_PO"; + case OrderType.BUY_ATOMIC: + return "BUY_ATOMIC"; + case OrderType.SELL_ATOMIC: + return "SELL_ATOMIC"; + case OrderType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ExecutionType { + UnspecifiedExecutionType = 0, + Market = 1, + LimitFill = 2, + LimitMatchRestingOrder = 3, + LimitMatchNewOrder = 4, + MarketLiquidation = 5, + ExpiryMarketSettlement = 6, + UNRECOGNIZED = -1, +} +export const ExecutionTypeAmino = ExecutionType; +export function executionTypeFromJSON(object: any): ExecutionType { + switch (object) { + case 0: + case "UnspecifiedExecutionType": + return ExecutionType.UnspecifiedExecutionType; + case 1: + case "Market": + return ExecutionType.Market; + case 2: + case "LimitFill": + return ExecutionType.LimitFill; + case 3: + case "LimitMatchRestingOrder": + return ExecutionType.LimitMatchRestingOrder; + case 4: + case "LimitMatchNewOrder": + return ExecutionType.LimitMatchNewOrder; + case 5: + case "MarketLiquidation": + return ExecutionType.MarketLiquidation; + case 6: + case "ExpiryMarketSettlement": + return ExecutionType.ExpiryMarketSettlement; + case -1: + case "UNRECOGNIZED": + default: + return ExecutionType.UNRECOGNIZED; + } +} +export function executionTypeToJSON(object: ExecutionType): string { + switch (object) { + case ExecutionType.UnspecifiedExecutionType: + return "UnspecifiedExecutionType"; + case ExecutionType.Market: + return "Market"; + case ExecutionType.LimitFill: + return "LimitFill"; + case ExecutionType.LimitMatchRestingOrder: + return "LimitMatchRestingOrder"; + case ExecutionType.LimitMatchNewOrder: + return "LimitMatchNewOrder"; + case ExecutionType.MarketLiquidation: + return "MarketLiquidation"; + case ExecutionType.ExpiryMarketSettlement: + return "ExpiryMarketSettlement"; + case ExecutionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum OrderMask { + UNUSED = 0, + ANY = 1, + REGULAR = 2, + CONDITIONAL = 4, + DIRECTION_BUY_OR_HIGHER = 8, + DIRECTION_SELL_OR_LOWER = 16, + TYPE_MARKET = 32, + TYPE_LIMIT = 64, + UNRECOGNIZED = -1, +} +export const OrderMaskAmino = OrderMask; +export function orderMaskFromJSON(object: any): OrderMask { + switch (object) { + case 0: + case "UNUSED": + return OrderMask.UNUSED; + case 1: + case "ANY": + return OrderMask.ANY; + case 2: + case "REGULAR": + return OrderMask.REGULAR; + case 4: + case "CONDITIONAL": + return OrderMask.CONDITIONAL; + case 8: + case "DIRECTION_BUY_OR_HIGHER": + return OrderMask.DIRECTION_BUY_OR_HIGHER; + case 16: + case "DIRECTION_SELL_OR_LOWER": + return OrderMask.DIRECTION_SELL_OR_LOWER; + case 32: + case "TYPE_MARKET": + return OrderMask.TYPE_MARKET; + case 64: + case "TYPE_LIMIT": + return OrderMask.TYPE_LIMIT; + case -1: + case "UNRECOGNIZED": + default: + return OrderMask.UNRECOGNIZED; + } +} +export function orderMaskToJSON(object: OrderMask): string { + switch (object) { + case OrderMask.UNUSED: + return "UNUSED"; + case OrderMask.ANY: + return "ANY"; + case OrderMask.REGULAR: + return "REGULAR"; + case OrderMask.CONDITIONAL: + return "CONDITIONAL"; + case OrderMask.DIRECTION_BUY_OR_HIGHER: + return "DIRECTION_BUY_OR_HIGHER"; + case OrderMask.DIRECTION_SELL_OR_LOWER: + return "DIRECTION_SELL_OR_LOWER"; + case OrderMask.TYPE_MARKET: + return "TYPE_MARKET"; + case OrderMask.TYPE_LIMIT: + return "TYPE_LIMIT"; + case OrderMask.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Params { + /** + * spot_market_instant_listing_fee defines the expedited fee in INJ required + * to create a spot market by bypassing governance + */ + spotMarketInstantListingFee: Coin; + /** + * derivative_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + derivativeMarketInstantListingFee: Coin; + /** + * default_spot_maker_fee defines the default exchange trade fee for makers on + * a spot market + */ + defaultSpotMakerFeeRate: string; + /** + * default_spot_taker_fee_rate defines the default exchange trade fee rate for + * takers on a new spot market + */ + defaultSpotTakerFeeRate: string; + /** + * default_derivative_maker_fee defines the default exchange trade fee for + * makers on a new derivative market + */ + defaultDerivativeMakerFeeRate: string; + /** + * default_derivative_taker_fee defines the default exchange trade fee for + * takers on a new derivative market + */ + defaultDerivativeTakerFeeRate: string; + /** + * default_initial_margin_ratio defines the default initial margin ratio on a + * new derivative market + */ + defaultInitialMarginRatio: string; + /** + * default_maintenance_margin_ratio defines the default maintenance margin + * ratio on a new derivative market + */ + defaultMaintenanceMarginRatio: string; + /** + * default_funding_interval defines the default funding interval on a + * derivative market + */ + defaultFundingInterval: bigint; + /** + * funding_multiple defines the timestamp multiple that the funding timestamp + * should be a multiple of + */ + fundingMultiple: bigint; + /** + * relayer_fee_share_rate defines the trade fee share percentage that goes to + * relayers + */ + relayerFeeShareRate: string; + /** + * default_hourly_funding_rate_cap defines the default maximum absolute value + * of the hourly funding rate + */ + defaultHourlyFundingRateCap: string; + /** hourly_interest_rate defines the hourly interest rate */ + defaultHourlyInterestRate: string; + /** + * max_derivative_order_side_count defines the maximum number of derivative + * active orders a subaccount can have for a given orderbook side + */ + maxDerivativeOrderSideCount: number; + /** + * inj_reward_staked_requirement_threshold defines the threshold on INJ + * rewards after which one also needs staked INJ to receive more + */ + injRewardStakedRequirementThreshold: string; + /** + * the trading_rewards_vesting_duration defines the vesting times for trading + * rewards + */ + tradingRewardsVestingDuration: bigint; + /** + * liquidator_reward_share_rate defines the ratio of the split of the surplus + * collateral that goes to the liquidator + */ + liquidatorRewardShareRate: string; + /** + * binary_options_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + binaryOptionsMarketInstantListingFee: Coin; + /** + * atomic_market_order_access_level defines the required access permissions + * for executing atomic market orders + */ + atomicMarketOrderAccessLevel: AtomicMarketOrderAccessLevel; + /** + * spot_atomic_market_order_fee_multiplier defines the default multiplier for + * executing atomic market orders in spot markets + */ + spotAtomicMarketOrderFeeMultiplier: string; + /** + * derivative_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in derivative markets + */ + derivativeAtomicMarketOrderFeeMultiplier: string; + /** + * binary_options_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in binary markets + */ + binaryOptionsAtomicMarketOrderFeeMultiplier: string; + /** minimal_protocol_fee_rate defines the minimal protocol fee rate */ + minimalProtocolFeeRate: string; + /** + * is_instant_derivative_market_launch_enabled defines whether instant + * derivative market launch is enabled + */ + isInstantDerivativeMarketLaunchEnabled: boolean; + postOnlyModeHeightThreshold: bigint; + /** + * Maximum time in seconds since the last mark price update to allow a + * decrease in margin + */ + marginDecreasePriceTimestampThresholdSeconds: bigint; + /** List of addresses that are allowed to perform exchange admin operations */ + exchangeAdmins: string[]; + /** inj_auction_max_cap defines the maximum cap for INJ sent to auction */ + injAuctionMaxCap: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * spot_market_instant_listing_fee defines the expedited fee in INJ required + * to create a spot market by bypassing governance + */ + spot_market_instant_listing_fee: CoinAmino; + /** + * derivative_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + derivative_market_instant_listing_fee: CoinAmino; + /** + * default_spot_maker_fee defines the default exchange trade fee for makers on + * a spot market + */ + default_spot_maker_fee_rate: string; + /** + * default_spot_taker_fee_rate defines the default exchange trade fee rate for + * takers on a new spot market + */ + default_spot_taker_fee_rate: string; + /** + * default_derivative_maker_fee defines the default exchange trade fee for + * makers on a new derivative market + */ + default_derivative_maker_fee_rate: string; + /** + * default_derivative_taker_fee defines the default exchange trade fee for + * takers on a new derivative market + */ + default_derivative_taker_fee_rate: string; + /** + * default_initial_margin_ratio defines the default initial margin ratio on a + * new derivative market + */ + default_initial_margin_ratio: string; + /** + * default_maintenance_margin_ratio defines the default maintenance margin + * ratio on a new derivative market + */ + default_maintenance_margin_ratio: string; + /** + * default_funding_interval defines the default funding interval on a + * derivative market + */ + default_funding_interval: string; + /** + * funding_multiple defines the timestamp multiple that the funding timestamp + * should be a multiple of + */ + funding_multiple: string; + /** + * relayer_fee_share_rate defines the trade fee share percentage that goes to + * relayers + */ + relayer_fee_share_rate: string; + /** + * default_hourly_funding_rate_cap defines the default maximum absolute value + * of the hourly funding rate + */ + default_hourly_funding_rate_cap: string; + /** hourly_interest_rate defines the hourly interest rate */ + default_hourly_interest_rate: string; + /** + * max_derivative_order_side_count defines the maximum number of derivative + * active orders a subaccount can have for a given orderbook side + */ + max_derivative_order_side_count: number; + /** + * inj_reward_staked_requirement_threshold defines the threshold on INJ + * rewards after which one also needs staked INJ to receive more + */ + inj_reward_staked_requirement_threshold: string; + /** + * the trading_rewards_vesting_duration defines the vesting times for trading + * rewards + */ + trading_rewards_vesting_duration: string; + /** + * liquidator_reward_share_rate defines the ratio of the split of the surplus + * collateral that goes to the liquidator + */ + liquidator_reward_share_rate: string; + /** + * binary_options_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + binary_options_market_instant_listing_fee: CoinAmino; + /** + * atomic_market_order_access_level defines the required access permissions + * for executing atomic market orders + */ + atomic_market_order_access_level: AtomicMarketOrderAccessLevel; + /** + * spot_atomic_market_order_fee_multiplier defines the default multiplier for + * executing atomic market orders in spot markets + */ + spot_atomic_market_order_fee_multiplier: string; + /** + * derivative_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in derivative markets + */ + derivative_atomic_market_order_fee_multiplier: string; + /** + * binary_options_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in binary markets + */ + binary_options_atomic_market_order_fee_multiplier: string; + /** minimal_protocol_fee_rate defines the minimal protocol fee rate */ + minimal_protocol_fee_rate: string; + /** + * is_instant_derivative_market_launch_enabled defines whether instant + * derivative market launch is enabled + */ + is_instant_derivative_market_launch_enabled: boolean; + post_only_mode_height_threshold: string; + /** + * Maximum time in seconds since the last mark price update to allow a + * decrease in margin + */ + margin_decrease_price_timestamp_threshold_seconds: string; + /** List of addresses that are allowed to perform exchange admin operations */ + exchange_admins: string[]; + /** inj_auction_max_cap defines the maximum cap for INJ sent to auction */ + inj_auction_max_cap: string; +} +export interface ParamsAminoMsg { + type: "exchange/Params"; + value: ParamsAmino; +} +export interface MarketFeeMultiplier { + marketId: string; + feeMultiplier: string; +} +export interface MarketFeeMultiplierProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier"; + value: Uint8Array; +} +export interface MarketFeeMultiplierAmino { + market_id: string; + fee_multiplier: string; +} +export interface MarketFeeMultiplierAminoMsg { + type: "/injective.exchange.v1beta1.MarketFeeMultiplier"; + value: MarketFeeMultiplierAmino; +} +/** An object describing a derivative market in the Injective Futures Protocol. */ +export interface DerivativeMarket { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Address of the quote currency denomination for the derivative contract */ + quoteDenom: string; + /** Unique market ID. */ + marketId: string; + /** + * initial_margin_ratio defines the initial margin ratio of a derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio of a + * derivative market + */ + maintenanceMarginRatio: string; + /** maker_fee_rate defines the maker fee rate of a derivative market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** + * true if the market is a perpetual market. false if the market is an expiry + * futures market + */ + isPerpetual: boolean; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface DerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket"; + value: Uint8Array; +} +/** An object describing a derivative market in the Injective Futures Protocol. */ +export interface DerivativeMarketAmino { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Address of the quote currency denomination for the derivative contract */ + quote_denom: string; + /** Unique market ID. */ + market_id: string; + /** + * initial_margin_ratio defines the initial margin ratio of a derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio of a + * derivative market + */ + maintenance_margin_ratio: string; + /** maker_fee_rate defines the maker fee rate of a derivative market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** + * true if the market is a perpetual market. false if the market is an expiry + * futures market + */ + isPerpetual: boolean; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface DerivativeMarketAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarket"; + value: DerivativeMarketAmino; +} +/** An object describing a binary options market in Injective Protocol. */ +export interface BinaryOptionsMarket { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** Unique market ID. */ + marketId: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + settlementPrice?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface BinaryOptionsMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket"; + value: Uint8Array; +} +/** An object describing a binary options market in Injective Protocol. */ +export interface BinaryOptionsMarketAmino { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** Unique market ID. */ + market_id: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + settlement_price?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface BinaryOptionsMarketAminoMsg { + type: "/injective.exchange.v1beta1.BinaryOptionsMarket"; + value: BinaryOptionsMarketAmino; +} +export interface ExpiryFuturesMarketInfo { + /** market ID. */ + marketId: string; + /** + * expiration_timestamp defines the expiration time for a time expiry futures + * market. + */ + expirationTimestamp: bigint; + /** + * expiration_twap_start_timestamp defines the start time of the TWAP + * calculation window + */ + twapStartTimestamp: bigint; + /** + * expiration_twap_start_price_cumulative defines the cumulative price for the + * start of the TWAP window + */ + expirationTwapStartPriceCumulative: string; + /** + * settlement_price defines the settlement price for a time expiry futures + * market. + */ + settlementPrice: string; +} +export interface ExpiryFuturesMarketInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo"; + value: Uint8Array; +} +export interface ExpiryFuturesMarketInfoAmino { + /** market ID. */ + market_id: string; + /** + * expiration_timestamp defines the expiration time for a time expiry futures + * market. + */ + expiration_timestamp: string; + /** + * expiration_twap_start_timestamp defines the start time of the TWAP + * calculation window + */ + twap_start_timestamp: string; + /** + * expiration_twap_start_price_cumulative defines the cumulative price for the + * start of the TWAP window + */ + expiration_twap_start_price_cumulative: string; + /** + * settlement_price defines the settlement price for a time expiry futures + * market. + */ + settlement_price: string; +} +export interface ExpiryFuturesMarketInfoAminoMsg { + type: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo"; + value: ExpiryFuturesMarketInfoAmino; +} +export interface PerpetualMarketInfo { + /** market ID. */ + marketId: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourlyFundingRateCap: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourlyInterestRate: string; + /** + * next_funding_timestamp defines the next funding timestamp in seconds of a + * perpetual market + */ + nextFundingTimestamp: bigint; + /** + * funding_interval defines the next funding interval in seconds of a + * perpetual market. + */ + fundingInterval: bigint; +} +export interface PerpetualMarketInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo"; + value: Uint8Array; +} +export interface PerpetualMarketInfoAmino { + /** market ID. */ + market_id: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourly_funding_rate_cap: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourly_interest_rate: string; + /** + * next_funding_timestamp defines the next funding timestamp in seconds of a + * perpetual market + */ + next_funding_timestamp: string; + /** + * funding_interval defines the next funding interval in seconds of a + * perpetual market. + */ + funding_interval: string; +} +export interface PerpetualMarketInfoAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketInfo"; + value: PerpetualMarketInfoAmino; +} +export interface PerpetualMarketFunding { + /** cumulative_funding defines the cumulative funding of a perpetual market. */ + cumulativeFunding: string; + /** + * cumulative_price defines the cumulative price for the current hour up to + * the last timestamp + */ + cumulativePrice: string; + lastTimestamp: bigint; +} +export interface PerpetualMarketFundingProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding"; + value: Uint8Array; +} +export interface PerpetualMarketFundingAmino { + /** cumulative_funding defines the cumulative funding of a perpetual market. */ + cumulative_funding: string; + /** + * cumulative_price defines the cumulative price for the current hour up to + * the last timestamp + */ + cumulative_price: string; + last_timestamp: string; +} +export interface PerpetualMarketFundingAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketFunding"; + value: PerpetualMarketFundingAmino; +} +export interface DerivativeMarketSettlementInfo { + /** market ID. */ + marketId: string; + /** settlement_price defines the settlement price */ + settlementPrice: string; +} +export interface DerivativeMarketSettlementInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo"; + value: Uint8Array; +} +export interface DerivativeMarketSettlementInfoAmino { + /** market ID. */ + market_id: string; + /** settlement_price defines the settlement price */ + settlement_price: string; +} +export interface DerivativeMarketSettlementInfoAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo"; + value: DerivativeMarketSettlementInfoAmino; +} +export interface NextFundingTimestamp { + nextTimestamp: bigint; +} +export interface NextFundingTimestampProtoMsg { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp"; + value: Uint8Array; +} +export interface NextFundingTimestampAmino { + next_timestamp: string; +} +export interface NextFundingTimestampAminoMsg { + type: "/injective.exchange.v1beta1.NextFundingTimestamp"; + value: NextFundingTimestampAmino; +} +export interface MidPriceAndTOB { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface MidPriceAndTOBProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB"; + value: Uint8Array; +} +export interface MidPriceAndTOBAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface MidPriceAndTOBAminoMsg { + type: "/injective.exchange.v1beta1.MidPriceAndTOB"; + value: MidPriceAndTOBAmino; +} +/** An object describing trade pair of two assets. */ +export interface SpotMarket { + /** + * A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote + * asset. + */ + ticker: string; + /** Coin denom used for the base asset */ + baseDenom: string; + /** Coin used for the quote asset */ + quoteDenom: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + makerFeeRate: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** Unique market ID. */ + marketId: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price required + * for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface SpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarket"; + value: Uint8Array; +} +/** An object describing trade pair of two assets. */ +export interface SpotMarketAmino { + /** + * A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote + * asset. + */ + ticker: string; + /** Coin denom used for the base asset */ + base_denom: string; + /** Coin used for the quote asset */ + quote_denom: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + maker_fee_rate: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** Unique market ID. */ + market_id: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price required + * for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface SpotMarketAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarket"; + value: SpotMarketAmino; +} +/** A subaccount's deposit for a given base currency */ +export interface Deposit { + availableBalance: string; + totalBalance: string; +} +export interface DepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Deposit"; + value: Uint8Array; +} +/** A subaccount's deposit for a given base currency */ +export interface DepositAmino { + available_balance: string; + total_balance: string; +} +export interface DepositAminoMsg { + type: "/injective.exchange.v1beta1.Deposit"; + value: DepositAmino; +} +export interface SubaccountTradeNonce { + nonce: number; +} +export interface SubaccountTradeNonceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce"; + value: Uint8Array; +} +export interface SubaccountTradeNonceAmino { + nonce: number; +} +export interface SubaccountTradeNonceAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountTradeNonce"; + value: SubaccountTradeNonceAmino; +} +export interface OrderInfo { + /** bytes32 subaccount ID that created the order */ + subaccountId: string; + /** address fee_recipient address that will receive fees for the order */ + feeRecipient: string; + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + cid: string; +} +export interface OrderInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderInfo"; + value: Uint8Array; +} +export interface OrderInfoAmino { + /** bytes32 subaccount ID that created the order */ + subaccount_id: string; + /** address fee_recipient address that will receive fees for the order */ + fee_recipient: string; + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + cid: string; +} +export interface OrderInfoAminoMsg { + type: "/injective.exchange.v1beta1.OrderInfo"; + value: OrderInfoAmino; +} +export interface SpotOrder { + /** market_id represents the unique ID of the market */ + marketId: string; + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface SpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotOrder"; + value: Uint8Array; +} +export interface SpotOrderAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface SpotOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotOrder"; + value: SpotOrderAmino; +} +/** A valid Spot limit order with Metadata. */ +export interface SpotLimitOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface SpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder"; + value: Uint8Array; +} +/** A valid Spot limit order with Metadata. */ +export interface SpotLimitOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface SpotLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotLimitOrder"; + value: SpotLimitOrderAmino; +} +/** A valid Spot market order with Metadata. */ +export interface SpotMarketOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + balanceHold: string; + orderHash: Uint8Array; + /** order types */ + orderType: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface SpotMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder"; + value: Uint8Array; +} +/** A valid Spot market order with Metadata. */ +export interface SpotMarketOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + balance_hold: string; + order_hash: string; + /** order types */ + order_type: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface SpotMarketOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarketOrder"; + value: SpotMarketOrderAmino; +} +export interface DerivativeOrder { + /** market_id represents the unique ID of the market */ + marketId: string; + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface DerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder"; + value: Uint8Array; +} +export interface DerivativeOrderAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface DerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeOrder"; + value: DerivativeOrderAmino; +} +export interface SubaccountOrderbookMetadata { + vanillaLimitOrderCount: number; + reduceOnlyLimitOrderCount: number; + /** + * AggregateReduceOnlyQuantity is the aggregate fillable quantity of the + * subaccount's reduce-only limit orders in the given direction. + */ + aggregateReduceOnlyQuantity: string; + /** + * AggregateVanillaQuantity is the aggregate fillable quantity of the + * subaccount's vanilla limit orders in the given direction. + */ + aggregateVanillaQuantity: string; + vanillaConditionalOrderCount: number; + reduceOnlyConditionalOrderCount: number; +} +export interface SubaccountOrderbookMetadataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata"; + value: Uint8Array; +} +export interface SubaccountOrderbookMetadataAmino { + vanilla_limit_order_count: number; + reduce_only_limit_order_count: number; + /** + * AggregateReduceOnlyQuantity is the aggregate fillable quantity of the + * subaccount's reduce-only limit orders in the given direction. + */ + aggregate_reduce_only_quantity: string; + /** + * AggregateVanillaQuantity is the aggregate fillable quantity of the + * subaccount's vanilla limit orders in the given direction. + */ + aggregate_vanilla_quantity: string; + vanilla_conditional_order_count: number; + reduce_only_conditional_order_count: number; +} +export interface SubaccountOrderbookMetadataAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata"; + value: SubaccountOrderbookMetadataAmino; +} +export interface SubaccountOrder { + /** price of the order */ + price: string; + /** the amount of the quantity remaining fillable */ + quantity: string; + isReduceOnly: boolean; + cid: string; +} +export interface SubaccountOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder"; + value: Uint8Array; +} +export interface SubaccountOrderAmino { + /** price of the order */ + price: string; + /** the amount of the quantity remaining fillable */ + quantity: string; + isReduceOnly: boolean; + cid: string; +} +export interface SubaccountOrderAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrder"; + value: SubaccountOrderAmino; +} +export interface SubaccountOrderData { + order?: SubaccountOrder; + orderHash: Uint8Array; +} +export interface SubaccountOrderDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData"; + value: Uint8Array; +} +export interface SubaccountOrderDataAmino { + order?: SubaccountOrderAmino; + order_hash: string; +} +export interface SubaccountOrderDataAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderData"; + value: SubaccountOrderDataAmino; +} +/** A valid Derivative limit order with Metadata. */ +export interface DerivativeLimitOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface DerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder"; + value: Uint8Array; +} +/** A valid Derivative limit order with Metadata. */ +export interface DerivativeLimitOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface DerivativeLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeLimitOrder"; + value: DerivativeLimitOrderAmino; +} +/** A valid Derivative market order with Metadata. */ +export interface DerivativeMarketOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + margin: string; + marginHold: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface DerivativeMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder"; + value: Uint8Array; +} +/** A valid Derivative market order with Metadata. */ +export interface DerivativeMarketOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + margin: string; + margin_hold: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface DerivativeMarketOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrder"; + value: DerivativeMarketOrderAmino; +} +export interface Position { + isLong: boolean; + quantity: string; + entryPrice: string; + margin: string; + cumulativeFundingEntry: string; +} +export interface PositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + isLong: boolean; + quantity: string; + entry_price: string; + margin: string; + cumulative_funding_entry: string; +} +export interface PositionAminoMsg { + type: "/injective.exchange.v1beta1.Position"; + value: PositionAmino; +} +export interface MarketOrderIndicator { + /** market_id represents the unique ID of the market */ + marketId: string; + isBuy: boolean; +} +export interface MarketOrderIndicatorProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator"; + value: Uint8Array; +} +export interface MarketOrderIndicatorAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + isBuy: boolean; +} +export interface MarketOrderIndicatorAminoMsg { + type: "/injective.exchange.v1beta1.MarketOrderIndicator"; + value: MarketOrderIndicatorAmino; +} +export interface TradeLog { + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccountId: Uint8Array; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: Uint8Array; + cid: string; +} +export interface TradeLogProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeLog"; + value: Uint8Array; +} +export interface TradeLogAmino { + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccount_id: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; +} +export interface TradeLogAminoMsg { + type: "/injective.exchange.v1beta1.TradeLog"; + value: TradeLogAmino; +} +export interface PositionDelta { + isLong: boolean; + executionQuantity: string; + executionMargin: string; + executionPrice: string; +} +export interface PositionDeltaProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PositionDelta"; + value: Uint8Array; +} +export interface PositionDeltaAmino { + is_long: boolean; + execution_quantity: string; + execution_margin: string; + execution_price: string; +} +export interface PositionDeltaAminoMsg { + type: "/injective.exchange.v1beta1.PositionDelta"; + value: PositionDeltaAmino; +} +export interface DerivativeTradeLog { + subaccountId: Uint8Array; + positionDelta?: PositionDelta; + payout: string; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: Uint8Array; + cid: string; + pnl: string; +} +export interface DerivativeTradeLogProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog"; + value: Uint8Array; +} +export interface DerivativeTradeLogAmino { + subaccount_id: string; + position_delta?: PositionDeltaAmino; + payout: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + pnl: string; +} +export interface DerivativeTradeLogAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeTradeLog"; + value: DerivativeTradeLogAmino; +} +export interface SubaccountPosition { + position?: Position; + subaccountId: Uint8Array; +} +export interface SubaccountPositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition"; + value: Uint8Array; +} +export interface SubaccountPositionAmino { + position?: PositionAmino; + subaccount_id: string; +} +export interface SubaccountPositionAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountPosition"; + value: SubaccountPositionAmino; +} +export interface SubaccountDeposit { + subaccountId: Uint8Array; + deposit?: Deposit; +} +export interface SubaccountDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit"; + value: Uint8Array; +} +export interface SubaccountDepositAmino { + subaccount_id: string; + deposit?: DepositAmino; +} +export interface SubaccountDepositAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountDeposit"; + value: SubaccountDepositAmino; +} +export interface DepositUpdate { + denom: string; + deposits: SubaccountDeposit[]; +} +export interface DepositUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate"; + value: Uint8Array; +} +export interface DepositUpdateAmino { + denom: string; + deposits: SubaccountDepositAmino[]; +} +export interface DepositUpdateAminoMsg { + type: "/injective.exchange.v1beta1.DepositUpdate"; + value: DepositUpdateAmino; +} +export interface PointsMultiplier { + makerPointsMultiplier: string; + takerPointsMultiplier: string; +} +export interface PointsMultiplierProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier"; + value: Uint8Array; +} +export interface PointsMultiplierAmino { + maker_points_multiplier: string; + taker_points_multiplier: string; +} +export interface PointsMultiplierAminoMsg { + type: "/injective.exchange.v1beta1.PointsMultiplier"; + value: PointsMultiplierAmino; +} +export interface TradingRewardCampaignBoostInfo { + boostedSpotMarketIds: string[]; + spotMarketMultipliers: PointsMultiplier[]; + boostedDerivativeMarketIds: string[]; + derivativeMarketMultipliers: PointsMultiplier[]; +} +export interface TradingRewardCampaignBoostInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo"; + value: Uint8Array; +} +export interface TradingRewardCampaignBoostInfoAmino { + boosted_spot_market_ids: string[]; + spot_market_multipliers: PointsMultiplierAmino[]; + boosted_derivative_market_ids: string[]; + derivative_market_multipliers: PointsMultiplierAmino[]; +} +export interface TradingRewardCampaignBoostInfoAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo"; + value: TradingRewardCampaignBoostInfoAmino; +} +export interface CampaignRewardPool { + startTimestamp: bigint; + /** + * max_campaign_rewards are the maximum reward amounts to be disbursed at the + * end of the campaign + */ + maxCampaignRewards: Coin[]; +} +export interface CampaignRewardPoolProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool"; + value: Uint8Array; +} +export interface CampaignRewardPoolAmino { + start_timestamp: string; + /** + * max_campaign_rewards are the maximum reward amounts to be disbursed at the + * end of the campaign + */ + max_campaign_rewards: CoinAmino[]; +} +export interface CampaignRewardPoolAminoMsg { + type: "/injective.exchange.v1beta1.CampaignRewardPool"; + value: CampaignRewardPoolAmino; +} +export interface TradingRewardCampaignInfo { + /** number of seconds of the duration of each campaign */ + campaignDurationSeconds: bigint; + /** the trading fee quote denoms which will be counted for the rewards */ + quoteDenoms: string[]; + /** the optional boost info for markets */ + tradingRewardBoostInfo?: TradingRewardCampaignBoostInfo; + /** the marketIDs which are disqualified from being rewarded */ + disqualifiedMarketIds: string[]; +} +export interface TradingRewardCampaignInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo"; + value: Uint8Array; +} +export interface TradingRewardCampaignInfoAmino { + /** number of seconds of the duration of each campaign */ + campaign_duration_seconds: string; + /** the trading fee quote denoms which will be counted for the rewards */ + quote_denoms: string[]; + /** the optional boost info for markets */ + trading_reward_boost_info?: TradingRewardCampaignBoostInfoAmino; + /** the marketIDs which are disqualified from being rewarded */ + disqualified_market_ids: string[]; +} +export interface TradingRewardCampaignInfoAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignInfo"; + value: TradingRewardCampaignInfoAmino; +} +export interface FeeDiscountTierInfo { + makerDiscountRate: string; + takerDiscountRate: string; + stakedAmount: string; + volume: string; +} +export interface FeeDiscountTierInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo"; + value: Uint8Array; +} +export interface FeeDiscountTierInfoAmino { + maker_discount_rate: string; + taker_discount_rate: string; + staked_amount: string; + volume: string; +} +export interface FeeDiscountTierInfoAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountTierInfo"; + value: FeeDiscountTierInfoAmino; +} +export interface FeeDiscountSchedule { + bucketCount: bigint; + bucketDuration: bigint; + /** + * the trading fee quote denoms which will be counted for the fee paid + * contribution + */ + quoteDenoms: string[]; + /** the fee discount tiers */ + tierInfos: FeeDiscountTierInfo[]; + /** + * the marketIDs which are disqualified from contributing to the fee paid + * amount + */ + disqualifiedMarketIds: string[]; +} +export interface FeeDiscountScheduleProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule"; + value: Uint8Array; +} +export interface FeeDiscountScheduleAmino { + bucket_count: string; + bucket_duration: string; + /** + * the trading fee quote denoms which will be counted for the fee paid + * contribution + */ + quote_denoms: string[]; + /** the fee discount tiers */ + tier_infos: FeeDiscountTierInfoAmino[]; + /** + * the marketIDs which are disqualified from contributing to the fee paid + * amount + */ + disqualified_market_ids: string[]; +} +export interface FeeDiscountScheduleAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountSchedule"; + value: FeeDiscountScheduleAmino; +} +export interface FeeDiscountTierTTL { + tier: bigint; + ttlTimestamp: bigint; +} +export interface FeeDiscountTierTTLProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL"; + value: Uint8Array; +} +export interface FeeDiscountTierTTLAmino { + tier: string; + ttl_timestamp: string; +} +export interface FeeDiscountTierTTLAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountTierTTL"; + value: FeeDiscountTierTTLAmino; +} +export interface VolumeRecord { + makerVolume: string; + takerVolume: string; +} +export interface VolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord"; + value: Uint8Array; +} +export interface VolumeRecordAmino { + maker_volume: string; + taker_volume: string; +} +export interface VolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.VolumeRecord"; + value: VolumeRecordAmino; +} +export interface AccountRewards { + account: string; + rewards: Coin[]; +} +export interface AccountRewardsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AccountRewards"; + value: Uint8Array; +} +export interface AccountRewardsAmino { + account: string; + rewards: CoinAmino[]; +} +export interface AccountRewardsAminoMsg { + type: "/injective.exchange.v1beta1.AccountRewards"; + value: AccountRewardsAmino; +} +export interface TradeRecords { + marketId: string; + latestTradeRecords: TradeRecord[]; +} +export interface TradeRecordsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeRecords"; + value: Uint8Array; +} +export interface TradeRecordsAmino { + market_id: string; + latest_trade_records: TradeRecordAmino[]; +} +export interface TradeRecordsAminoMsg { + type: "/injective.exchange.v1beta1.TradeRecords"; + value: TradeRecordsAmino; +} +export interface SubaccountIDs { + subaccountIds: Uint8Array[]; +} +export interface SubaccountIDsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs"; + value: Uint8Array; +} +export interface SubaccountIDsAmino { + subaccount_ids: string[]; +} +export interface SubaccountIDsAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountIDs"; + value: SubaccountIDsAmino; +} +export interface TradeRecord { + timestamp: bigint; + price: string; + quantity: string; +} +export interface TradeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeRecord"; + value: Uint8Array; +} +export interface TradeRecordAmino { + timestamp: string; + price: string; + quantity: string; +} +export interface TradeRecordAminoMsg { + type: "/injective.exchange.v1beta1.TradeRecord"; + value: TradeRecordAmino; +} +export interface Level { + /** price */ + p: string; + /** quantity */ + q: string; +} +export interface LevelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Level"; + value: Uint8Array; +} +export interface LevelAmino { + /** price */ + p: string; + /** quantity */ + q: string; +} +export interface LevelAminoMsg { + type: "/injective.exchange.v1beta1.Level"; + value: LevelAmino; +} +export interface AggregateSubaccountVolumeRecord { + subaccountId: string; + marketVolumes: MarketVolume[]; +} +export interface AggregateSubaccountVolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord"; + value: Uint8Array; +} +export interface AggregateSubaccountVolumeRecordAmino { + subaccount_id: string; + market_volumes: MarketVolumeAmino[]; +} +export interface AggregateSubaccountVolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord"; + value: AggregateSubaccountVolumeRecordAmino; +} +export interface AggregateAccountVolumeRecord { + account: string; + marketVolumes: MarketVolume[]; +} +export interface AggregateAccountVolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord"; + value: Uint8Array; +} +export interface AggregateAccountVolumeRecordAmino { + account: string; + market_volumes: MarketVolumeAmino[]; +} +export interface AggregateAccountVolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord"; + value: AggregateAccountVolumeRecordAmino; +} +export interface MarketVolume { + marketId: string; + volume: VolumeRecord; +} +export interface MarketVolumeProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketVolume"; + value: Uint8Array; +} +export interface MarketVolumeAmino { + market_id: string; + volume: VolumeRecordAmino; +} +export interface MarketVolumeAminoMsg { + type: "/injective.exchange.v1beta1.MarketVolume"; + value: MarketVolumeAmino; +} +export interface DenomDecimals { + denom: string; + decimals: bigint; +} +export interface DenomDecimalsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals"; + value: Uint8Array; +} +export interface DenomDecimalsAmino { + denom: string; + decimals: string; +} +export interface DenomDecimalsAminoMsg { + type: "/injective.exchange.v1beta1.DenomDecimals"; + value: DenomDecimalsAmino; +} +export interface GrantAuthorization { + grantee: string; + amount: string; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +export interface GrantAuthorizationAmino { + grantee: string; + amount: string; +} +export interface GrantAuthorizationAminoMsg { + type: "/injective.exchange.v1beta1.GrantAuthorization"; + value: GrantAuthorizationAmino; +} +export interface ActiveGrant { + granter: string; + amount: string; +} +export interface ActiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant"; + value: Uint8Array; +} +export interface ActiveGrantAmino { + granter: string; + amount: string; +} +export interface ActiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.ActiveGrant"; + value: ActiveGrantAmino; +} +export interface EffectiveGrant { + granter: string; + netGrantedStake: string; + isValid: boolean; +} +export interface EffectiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant"; + value: Uint8Array; +} +export interface EffectiveGrantAmino { + granter: string; + net_granted_stake: string; + is_valid: boolean; +} +export interface EffectiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.EffectiveGrant"; + value: EffectiveGrantAmino; +} +function createBaseParams(): Params { + return { + spotMarketInstantListingFee: Coin.fromPartial({}), + derivativeMarketInstantListingFee: Coin.fromPartial({}), + defaultSpotMakerFeeRate: "", + defaultSpotTakerFeeRate: "", + defaultDerivativeMakerFeeRate: "", + defaultDerivativeTakerFeeRate: "", + defaultInitialMarginRatio: "", + defaultMaintenanceMarginRatio: "", + defaultFundingInterval: BigInt(0), + fundingMultiple: BigInt(0), + relayerFeeShareRate: "", + defaultHourlyFundingRateCap: "", + defaultHourlyInterestRate: "", + maxDerivativeOrderSideCount: 0, + injRewardStakedRequirementThreshold: "", + tradingRewardsVestingDuration: BigInt(0), + liquidatorRewardShareRate: "", + binaryOptionsMarketInstantListingFee: Coin.fromPartial({}), + atomicMarketOrderAccessLevel: 0, + spotAtomicMarketOrderFeeMultiplier: "", + derivativeAtomicMarketOrderFeeMultiplier: "", + binaryOptionsAtomicMarketOrderFeeMultiplier: "", + minimalProtocolFeeRate: "", + isInstantDerivativeMarketLaunchEnabled: false, + postOnlyModeHeightThreshold: BigInt(0), + marginDecreasePriceTimestampThresholdSeconds: BigInt(0), + exchangeAdmins: [], + injAuctionMaxCap: "" + }; +} +export const Params = { + typeUrl: "/injective.exchange.v1beta1.Params", + aminoType: "exchange/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Coin.is(o.spotMarketInstantListingFee) && Coin.is(o.derivativeMarketInstantListingFee) && typeof o.defaultSpotMakerFeeRate === "string" && typeof o.defaultSpotTakerFeeRate === "string" && typeof o.defaultDerivativeMakerFeeRate === "string" && typeof o.defaultDerivativeTakerFeeRate === "string" && typeof o.defaultInitialMarginRatio === "string" && typeof o.defaultMaintenanceMarginRatio === "string" && typeof o.defaultFundingInterval === "bigint" && typeof o.fundingMultiple === "bigint" && typeof o.relayerFeeShareRate === "string" && typeof o.defaultHourlyFundingRateCap === "string" && typeof o.defaultHourlyInterestRate === "string" && typeof o.maxDerivativeOrderSideCount === "number" && typeof o.injRewardStakedRequirementThreshold === "string" && typeof o.tradingRewardsVestingDuration === "bigint" && typeof o.liquidatorRewardShareRate === "string" && Coin.is(o.binaryOptionsMarketInstantListingFee) && isSet(o.atomicMarketOrderAccessLevel) && typeof o.spotAtomicMarketOrderFeeMultiplier === "string" && typeof o.derivativeAtomicMarketOrderFeeMultiplier === "string" && typeof o.binaryOptionsAtomicMarketOrderFeeMultiplier === "string" && typeof o.minimalProtocolFeeRate === "string" && typeof o.isInstantDerivativeMarketLaunchEnabled === "boolean" && typeof o.postOnlyModeHeightThreshold === "bigint" && typeof o.marginDecreasePriceTimestampThresholdSeconds === "bigint" && Array.isArray(o.exchangeAdmins) && (!o.exchangeAdmins.length || typeof o.exchangeAdmins[0] === "string") && typeof o.injAuctionMaxCap === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Coin.isAmino(o.spot_market_instant_listing_fee) && Coin.isAmino(o.derivative_market_instant_listing_fee) && typeof o.default_spot_maker_fee_rate === "string" && typeof o.default_spot_taker_fee_rate === "string" && typeof o.default_derivative_maker_fee_rate === "string" && typeof o.default_derivative_taker_fee_rate === "string" && typeof o.default_initial_margin_ratio === "string" && typeof o.default_maintenance_margin_ratio === "string" && typeof o.default_funding_interval === "bigint" && typeof o.funding_multiple === "bigint" && typeof o.relayer_fee_share_rate === "string" && typeof o.default_hourly_funding_rate_cap === "string" && typeof o.default_hourly_interest_rate === "string" && typeof o.max_derivative_order_side_count === "number" && typeof o.inj_reward_staked_requirement_threshold === "string" && typeof o.trading_rewards_vesting_duration === "bigint" && typeof o.liquidator_reward_share_rate === "string" && Coin.isAmino(o.binary_options_market_instant_listing_fee) && isSet(o.atomic_market_order_access_level) && typeof o.spot_atomic_market_order_fee_multiplier === "string" && typeof o.derivative_atomic_market_order_fee_multiplier === "string" && typeof o.binary_options_atomic_market_order_fee_multiplier === "string" && typeof o.minimal_protocol_fee_rate === "string" && typeof o.is_instant_derivative_market_launch_enabled === "boolean" && typeof o.post_only_mode_height_threshold === "bigint" && typeof o.margin_decrease_price_timestamp_threshold_seconds === "bigint" && Array.isArray(o.exchange_admins) && (!o.exchange_admins.length || typeof o.exchange_admins[0] === "string") && typeof o.inj_auction_max_cap === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.spotMarketInstantListingFee !== undefined) { + Coin.encode(message.spotMarketInstantListingFee, writer.uint32(10).fork()).ldelim(); + } + if (message.derivativeMarketInstantListingFee !== undefined) { + Coin.encode(message.derivativeMarketInstantListingFee, writer.uint32(18).fork()).ldelim(); + } + if (message.defaultSpotMakerFeeRate !== "") { + writer.uint32(26).string(message.defaultSpotMakerFeeRate); + } + if (message.defaultSpotTakerFeeRate !== "") { + writer.uint32(34).string(message.defaultSpotTakerFeeRate); + } + if (message.defaultDerivativeMakerFeeRate !== "") { + writer.uint32(42).string(message.defaultDerivativeMakerFeeRate); + } + if (message.defaultDerivativeTakerFeeRate !== "") { + writer.uint32(50).string(message.defaultDerivativeTakerFeeRate); + } + if (message.defaultInitialMarginRatio !== "") { + writer.uint32(58).string(message.defaultInitialMarginRatio); + } + if (message.defaultMaintenanceMarginRatio !== "") { + writer.uint32(66).string(message.defaultMaintenanceMarginRatio); + } + if (message.defaultFundingInterval !== BigInt(0)) { + writer.uint32(72).int64(message.defaultFundingInterval); + } + if (message.fundingMultiple !== BigInt(0)) { + writer.uint32(80).int64(message.fundingMultiple); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(90).string(message.relayerFeeShareRate); + } + if (message.defaultHourlyFundingRateCap !== "") { + writer.uint32(98).string(message.defaultHourlyFundingRateCap); + } + if (message.defaultHourlyInterestRate !== "") { + writer.uint32(106).string(message.defaultHourlyInterestRate); + } + if (message.maxDerivativeOrderSideCount !== 0) { + writer.uint32(112).uint32(message.maxDerivativeOrderSideCount); + } + if (message.injRewardStakedRequirementThreshold !== "") { + writer.uint32(122).string(message.injRewardStakedRequirementThreshold); + } + if (message.tradingRewardsVestingDuration !== BigInt(0)) { + writer.uint32(128).int64(message.tradingRewardsVestingDuration); + } + if (message.liquidatorRewardShareRate !== "") { + writer.uint32(138).string(message.liquidatorRewardShareRate); + } + if (message.binaryOptionsMarketInstantListingFee !== undefined) { + Coin.encode(message.binaryOptionsMarketInstantListingFee, writer.uint32(146).fork()).ldelim(); + } + if (message.atomicMarketOrderAccessLevel !== 0) { + writer.uint32(152).int32(message.atomicMarketOrderAccessLevel); + } + if (message.spotAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(162).string(message.spotAtomicMarketOrderFeeMultiplier); + } + if (message.derivativeAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(170).string(message.derivativeAtomicMarketOrderFeeMultiplier); + } + if (message.binaryOptionsAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(178).string(message.binaryOptionsAtomicMarketOrderFeeMultiplier); + } + if (message.minimalProtocolFeeRate !== "") { + writer.uint32(186).string(message.minimalProtocolFeeRate); + } + if (message.isInstantDerivativeMarketLaunchEnabled === true) { + writer.uint32(192).bool(message.isInstantDerivativeMarketLaunchEnabled); + } + if (message.postOnlyModeHeightThreshold !== BigInt(0)) { + writer.uint32(200).int64(message.postOnlyModeHeightThreshold); + } + if (message.marginDecreasePriceTimestampThresholdSeconds !== BigInt(0)) { + writer.uint32(208).int64(message.marginDecreasePriceTimestampThresholdSeconds); + } + for (const v of message.exchangeAdmins) { + writer.uint32(218).string(v!); + } + if (message.injAuctionMaxCap !== "") { + writer.uint32(226).string(message.injAuctionMaxCap); + } + 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.spotMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.derivativeMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.defaultSpotMakerFeeRate = reader.string(); + break; + case 4: + message.defaultSpotTakerFeeRate = reader.string(); + break; + case 5: + message.defaultDerivativeMakerFeeRate = reader.string(); + break; + case 6: + message.defaultDerivativeTakerFeeRate = reader.string(); + break; + case 7: + message.defaultInitialMarginRatio = reader.string(); + break; + case 8: + message.defaultMaintenanceMarginRatio = reader.string(); + break; + case 9: + message.defaultFundingInterval = reader.int64(); + break; + case 10: + message.fundingMultiple = reader.int64(); + break; + case 11: + message.relayerFeeShareRate = reader.string(); + break; + case 12: + message.defaultHourlyFundingRateCap = reader.string(); + break; + case 13: + message.defaultHourlyInterestRate = reader.string(); + break; + case 14: + message.maxDerivativeOrderSideCount = reader.uint32(); + break; + case 15: + message.injRewardStakedRequirementThreshold = reader.string(); + break; + case 16: + message.tradingRewardsVestingDuration = reader.int64(); + break; + case 17: + message.liquidatorRewardShareRate = reader.string(); + break; + case 18: + message.binaryOptionsMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 19: + message.atomicMarketOrderAccessLevel = (reader.int32() as any); + break; + case 20: + message.spotAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 21: + message.derivativeAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 22: + message.binaryOptionsAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 23: + message.minimalProtocolFeeRate = reader.string(); + break; + case 24: + message.isInstantDerivativeMarketLaunchEnabled = reader.bool(); + break; + case 25: + message.postOnlyModeHeightThreshold = reader.int64(); + break; + case 26: + message.marginDecreasePriceTimestampThresholdSeconds = reader.int64(); + break; + case 27: + message.exchangeAdmins.push(reader.string()); + break; + case 28: + message.injAuctionMaxCap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.spotMarketInstantListingFee = object.spotMarketInstantListingFee !== undefined && object.spotMarketInstantListingFee !== null ? Coin.fromPartial(object.spotMarketInstantListingFee) : undefined; + message.derivativeMarketInstantListingFee = object.derivativeMarketInstantListingFee !== undefined && object.derivativeMarketInstantListingFee !== null ? Coin.fromPartial(object.derivativeMarketInstantListingFee) : undefined; + message.defaultSpotMakerFeeRate = object.defaultSpotMakerFeeRate ?? ""; + message.defaultSpotTakerFeeRate = object.defaultSpotTakerFeeRate ?? ""; + message.defaultDerivativeMakerFeeRate = object.defaultDerivativeMakerFeeRate ?? ""; + message.defaultDerivativeTakerFeeRate = object.defaultDerivativeTakerFeeRate ?? ""; + message.defaultInitialMarginRatio = object.defaultInitialMarginRatio ?? ""; + message.defaultMaintenanceMarginRatio = object.defaultMaintenanceMarginRatio ?? ""; + message.defaultFundingInterval = object.defaultFundingInterval !== undefined && object.defaultFundingInterval !== null ? BigInt(object.defaultFundingInterval.toString()) : BigInt(0); + message.fundingMultiple = object.fundingMultiple !== undefined && object.fundingMultiple !== null ? BigInt(object.fundingMultiple.toString()) : BigInt(0); + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.defaultHourlyFundingRateCap = object.defaultHourlyFundingRateCap ?? ""; + message.defaultHourlyInterestRate = object.defaultHourlyInterestRate ?? ""; + message.maxDerivativeOrderSideCount = object.maxDerivativeOrderSideCount ?? 0; + message.injRewardStakedRequirementThreshold = object.injRewardStakedRequirementThreshold ?? ""; + message.tradingRewardsVestingDuration = object.tradingRewardsVestingDuration !== undefined && object.tradingRewardsVestingDuration !== null ? BigInt(object.tradingRewardsVestingDuration.toString()) : BigInt(0); + message.liquidatorRewardShareRate = object.liquidatorRewardShareRate ?? ""; + message.binaryOptionsMarketInstantListingFee = object.binaryOptionsMarketInstantListingFee !== undefined && object.binaryOptionsMarketInstantListingFee !== null ? Coin.fromPartial(object.binaryOptionsMarketInstantListingFee) : undefined; + message.atomicMarketOrderAccessLevel = object.atomicMarketOrderAccessLevel ?? 0; + message.spotAtomicMarketOrderFeeMultiplier = object.spotAtomicMarketOrderFeeMultiplier ?? ""; + message.derivativeAtomicMarketOrderFeeMultiplier = object.derivativeAtomicMarketOrderFeeMultiplier ?? ""; + message.binaryOptionsAtomicMarketOrderFeeMultiplier = object.binaryOptionsAtomicMarketOrderFeeMultiplier ?? ""; + message.minimalProtocolFeeRate = object.minimalProtocolFeeRate ?? ""; + message.isInstantDerivativeMarketLaunchEnabled = object.isInstantDerivativeMarketLaunchEnabled ?? false; + message.postOnlyModeHeightThreshold = object.postOnlyModeHeightThreshold !== undefined && object.postOnlyModeHeightThreshold !== null ? BigInt(object.postOnlyModeHeightThreshold.toString()) : BigInt(0); + message.marginDecreasePriceTimestampThresholdSeconds = object.marginDecreasePriceTimestampThresholdSeconds !== undefined && object.marginDecreasePriceTimestampThresholdSeconds !== null ? BigInt(object.marginDecreasePriceTimestampThresholdSeconds.toString()) : BigInt(0); + message.exchangeAdmins = object.exchangeAdmins?.map(e => e) || []; + message.injAuctionMaxCap = object.injAuctionMaxCap ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.spot_market_instant_listing_fee !== undefined && object.spot_market_instant_listing_fee !== null) { + message.spotMarketInstantListingFee = Coin.fromAmino(object.spot_market_instant_listing_fee); + } + if (object.derivative_market_instant_listing_fee !== undefined && object.derivative_market_instant_listing_fee !== null) { + message.derivativeMarketInstantListingFee = Coin.fromAmino(object.derivative_market_instant_listing_fee); + } + if (object.default_spot_maker_fee_rate !== undefined && object.default_spot_maker_fee_rate !== null) { + message.defaultSpotMakerFeeRate = object.default_spot_maker_fee_rate; + } + if (object.default_spot_taker_fee_rate !== undefined && object.default_spot_taker_fee_rate !== null) { + message.defaultSpotTakerFeeRate = object.default_spot_taker_fee_rate; + } + if (object.default_derivative_maker_fee_rate !== undefined && object.default_derivative_maker_fee_rate !== null) { + message.defaultDerivativeMakerFeeRate = object.default_derivative_maker_fee_rate; + } + if (object.default_derivative_taker_fee_rate !== undefined && object.default_derivative_taker_fee_rate !== null) { + message.defaultDerivativeTakerFeeRate = object.default_derivative_taker_fee_rate; + } + if (object.default_initial_margin_ratio !== undefined && object.default_initial_margin_ratio !== null) { + message.defaultInitialMarginRatio = object.default_initial_margin_ratio; + } + if (object.default_maintenance_margin_ratio !== undefined && object.default_maintenance_margin_ratio !== null) { + message.defaultMaintenanceMarginRatio = object.default_maintenance_margin_ratio; + } + if (object.default_funding_interval !== undefined && object.default_funding_interval !== null) { + message.defaultFundingInterval = BigInt(object.default_funding_interval); + } + if (object.funding_multiple !== undefined && object.funding_multiple !== null) { + message.fundingMultiple = BigInt(object.funding_multiple); + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.default_hourly_funding_rate_cap !== undefined && object.default_hourly_funding_rate_cap !== null) { + message.defaultHourlyFundingRateCap = object.default_hourly_funding_rate_cap; + } + if (object.default_hourly_interest_rate !== undefined && object.default_hourly_interest_rate !== null) { + message.defaultHourlyInterestRate = object.default_hourly_interest_rate; + } + if (object.max_derivative_order_side_count !== undefined && object.max_derivative_order_side_count !== null) { + message.maxDerivativeOrderSideCount = object.max_derivative_order_side_count; + } + if (object.inj_reward_staked_requirement_threshold !== undefined && object.inj_reward_staked_requirement_threshold !== null) { + message.injRewardStakedRequirementThreshold = object.inj_reward_staked_requirement_threshold; + } + if (object.trading_rewards_vesting_duration !== undefined && object.trading_rewards_vesting_duration !== null) { + message.tradingRewardsVestingDuration = BigInt(object.trading_rewards_vesting_duration); + } + if (object.liquidator_reward_share_rate !== undefined && object.liquidator_reward_share_rate !== null) { + message.liquidatorRewardShareRate = object.liquidator_reward_share_rate; + } + if (object.binary_options_market_instant_listing_fee !== undefined && object.binary_options_market_instant_listing_fee !== null) { + message.binaryOptionsMarketInstantListingFee = Coin.fromAmino(object.binary_options_market_instant_listing_fee); + } + if (object.atomic_market_order_access_level !== undefined && object.atomic_market_order_access_level !== null) { + message.atomicMarketOrderAccessLevel = object.atomic_market_order_access_level; + } + if (object.spot_atomic_market_order_fee_multiplier !== undefined && object.spot_atomic_market_order_fee_multiplier !== null) { + message.spotAtomicMarketOrderFeeMultiplier = object.spot_atomic_market_order_fee_multiplier; + } + if (object.derivative_atomic_market_order_fee_multiplier !== undefined && object.derivative_atomic_market_order_fee_multiplier !== null) { + message.derivativeAtomicMarketOrderFeeMultiplier = object.derivative_atomic_market_order_fee_multiplier; + } + if (object.binary_options_atomic_market_order_fee_multiplier !== undefined && object.binary_options_atomic_market_order_fee_multiplier !== null) { + message.binaryOptionsAtomicMarketOrderFeeMultiplier = object.binary_options_atomic_market_order_fee_multiplier; + } + if (object.minimal_protocol_fee_rate !== undefined && object.minimal_protocol_fee_rate !== null) { + message.minimalProtocolFeeRate = object.minimal_protocol_fee_rate; + } + if (object.is_instant_derivative_market_launch_enabled !== undefined && object.is_instant_derivative_market_launch_enabled !== null) { + message.isInstantDerivativeMarketLaunchEnabled = object.is_instant_derivative_market_launch_enabled; + } + if (object.post_only_mode_height_threshold !== undefined && object.post_only_mode_height_threshold !== null) { + message.postOnlyModeHeightThreshold = BigInt(object.post_only_mode_height_threshold); + } + if (object.margin_decrease_price_timestamp_threshold_seconds !== undefined && object.margin_decrease_price_timestamp_threshold_seconds !== null) { + message.marginDecreasePriceTimestampThresholdSeconds = BigInt(object.margin_decrease_price_timestamp_threshold_seconds); + } + message.exchangeAdmins = object.exchange_admins?.map(e => e) || []; + if (object.inj_auction_max_cap !== undefined && object.inj_auction_max_cap !== null) { + message.injAuctionMaxCap = object.inj_auction_max_cap; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.spot_market_instant_listing_fee = message.spotMarketInstantListingFee ? Coin.toAmino(message.spotMarketInstantListingFee) : undefined; + obj.derivative_market_instant_listing_fee = message.derivativeMarketInstantListingFee ? Coin.toAmino(message.derivativeMarketInstantListingFee) : undefined; + obj.default_spot_maker_fee_rate = message.defaultSpotMakerFeeRate === "" ? undefined : message.defaultSpotMakerFeeRate; + obj.default_spot_taker_fee_rate = message.defaultSpotTakerFeeRate === "" ? undefined : message.defaultSpotTakerFeeRate; + obj.default_derivative_maker_fee_rate = message.defaultDerivativeMakerFeeRate === "" ? undefined : message.defaultDerivativeMakerFeeRate; + obj.default_derivative_taker_fee_rate = message.defaultDerivativeTakerFeeRate === "" ? undefined : message.defaultDerivativeTakerFeeRate; + obj.default_initial_margin_ratio = message.defaultInitialMarginRatio === "" ? undefined : message.defaultInitialMarginRatio; + obj.default_maintenance_margin_ratio = message.defaultMaintenanceMarginRatio === "" ? undefined : message.defaultMaintenanceMarginRatio; + obj.default_funding_interval = message.defaultFundingInterval !== BigInt(0) ? message.defaultFundingInterval?.toString() : undefined; + obj.funding_multiple = message.fundingMultiple !== BigInt(0) ? message.fundingMultiple?.toString() : undefined; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.default_hourly_funding_rate_cap = message.defaultHourlyFundingRateCap === "" ? undefined : message.defaultHourlyFundingRateCap; + obj.default_hourly_interest_rate = message.defaultHourlyInterestRate === "" ? undefined : message.defaultHourlyInterestRate; + obj.max_derivative_order_side_count = message.maxDerivativeOrderSideCount === 0 ? undefined : message.maxDerivativeOrderSideCount; + obj.inj_reward_staked_requirement_threshold = message.injRewardStakedRequirementThreshold === "" ? undefined : message.injRewardStakedRequirementThreshold; + obj.trading_rewards_vesting_duration = message.tradingRewardsVestingDuration !== BigInt(0) ? message.tradingRewardsVestingDuration?.toString() : undefined; + obj.liquidator_reward_share_rate = message.liquidatorRewardShareRate === "" ? undefined : message.liquidatorRewardShareRate; + obj.binary_options_market_instant_listing_fee = message.binaryOptionsMarketInstantListingFee ? Coin.toAmino(message.binaryOptionsMarketInstantListingFee) : undefined; + obj.atomic_market_order_access_level = message.atomicMarketOrderAccessLevel === 0 ? undefined : message.atomicMarketOrderAccessLevel; + obj.spot_atomic_market_order_fee_multiplier = message.spotAtomicMarketOrderFeeMultiplier === "" ? undefined : message.spotAtomicMarketOrderFeeMultiplier; + obj.derivative_atomic_market_order_fee_multiplier = message.derivativeAtomicMarketOrderFeeMultiplier === "" ? undefined : message.derivativeAtomicMarketOrderFeeMultiplier; + obj.binary_options_atomic_market_order_fee_multiplier = message.binaryOptionsAtomicMarketOrderFeeMultiplier === "" ? undefined : message.binaryOptionsAtomicMarketOrderFeeMultiplier; + obj.minimal_protocol_fee_rate = message.minimalProtocolFeeRate === "" ? undefined : message.minimalProtocolFeeRate; + obj.is_instant_derivative_market_launch_enabled = message.isInstantDerivativeMarketLaunchEnabled === false ? undefined : message.isInstantDerivativeMarketLaunchEnabled; + obj.post_only_mode_height_threshold = message.postOnlyModeHeightThreshold !== BigInt(0) ? message.postOnlyModeHeightThreshold?.toString() : undefined; + obj.margin_decrease_price_timestamp_threshold_seconds = message.marginDecreasePriceTimestampThresholdSeconds !== BigInt(0) ? message.marginDecreasePriceTimestampThresholdSeconds?.toString() : undefined; + if (message.exchangeAdmins) { + obj.exchange_admins = message.exchangeAdmins.map(e => e); + } else { + obj.exchange_admins = message.exchangeAdmins; + } + obj.inj_auction_max_cap = message.injAuctionMaxCap === "" ? undefined : message.injAuctionMaxCap; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "exchange/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: "/injective.exchange.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseMarketFeeMultiplier(): MarketFeeMultiplier { + return { + marketId: "", + feeMultiplier: "" + }; +} +export const MarketFeeMultiplier = { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier", + is(o: any): o is MarketFeeMultiplier { + return o && (o.$typeUrl === MarketFeeMultiplier.typeUrl || typeof o.marketId === "string" && typeof o.feeMultiplier === "string"); + }, + isAmino(o: any): o is MarketFeeMultiplierAmino { + return o && (o.$typeUrl === MarketFeeMultiplier.typeUrl || typeof o.market_id === "string" && typeof o.fee_multiplier === "string"); + }, + encode(message: MarketFeeMultiplier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.feeMultiplier !== "") { + writer.uint32(18).string(message.feeMultiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketFeeMultiplier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketFeeMultiplier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.feeMultiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketFeeMultiplier { + const message = createBaseMarketFeeMultiplier(); + message.marketId = object.marketId ?? ""; + message.feeMultiplier = object.feeMultiplier ?? ""; + return message; + }, + fromAmino(object: MarketFeeMultiplierAmino): MarketFeeMultiplier { + const message = createBaseMarketFeeMultiplier(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.fee_multiplier !== undefined && object.fee_multiplier !== null) { + message.feeMultiplier = object.fee_multiplier; + } + return message; + }, + toAmino(message: MarketFeeMultiplier): MarketFeeMultiplierAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.fee_multiplier = message.feeMultiplier === "" ? undefined : message.feeMultiplier; + return obj; + }, + fromAminoMsg(object: MarketFeeMultiplierAminoMsg): MarketFeeMultiplier { + return MarketFeeMultiplier.fromAmino(object.value); + }, + fromProtoMsg(message: MarketFeeMultiplierProtoMsg): MarketFeeMultiplier { + return MarketFeeMultiplier.decode(message.value); + }, + toProto(message: MarketFeeMultiplier): Uint8Array { + return MarketFeeMultiplier.encode(message).finish(); + }, + toProtoMsg(message: MarketFeeMultiplier): MarketFeeMultiplierProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier", + value: MarketFeeMultiplier.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketFeeMultiplier.typeUrl, MarketFeeMultiplier); +function createBaseDerivativeMarket(): DerivativeMarket { + return { + ticker: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + oracleScaleFactor: 0, + quoteDenom: "", + marketId: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + isPerpetual: false, + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + admin: "", + adminPermissions: 0 + }; +} +export const DerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket", + is(o: any): o is DerivativeMarket { + return o && (o.$typeUrl === DerivativeMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.quoteDenom === "string" && typeof o.marketId === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && typeof o.isPerpetual === "boolean" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is DerivativeMarketAmino { + return o && (o.$typeUrl === DerivativeMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.quote_denom === "string" && typeof o.market_id === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && typeof o.isPerpetual === "boolean" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: DerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.oracleBase !== "") { + writer.uint32(18).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(26).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(40).uint32(message.oracleScaleFactor); + } + if (message.quoteDenom !== "") { + writer.uint32(50).string(message.quoteDenom); + } + if (message.marketId !== "") { + writer.uint32(58).string(message.marketId); + } + if (message.initialMarginRatio !== "") { + writer.uint32(66).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(74).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(82).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(90).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(98).string(message.relayerFeeShareRate); + } + if (message.isPerpetual === true) { + writer.uint32(104).bool(message.isPerpetual); + } + if (message.status !== 0) { + writer.uint32(112).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(122).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(130).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(138).string(message.minNotional); + } + if (message.admin !== "") { + writer.uint32(146).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(152).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.oracleBase = reader.string(); + break; + case 3: + message.oracleQuote = reader.string(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + case 5: + message.oracleScaleFactor = reader.uint32(); + break; + case 6: + message.quoteDenom = reader.string(); + break; + case 7: + message.marketId = reader.string(); + break; + case 8: + message.initialMarginRatio = reader.string(); + break; + case 9: + message.maintenanceMarginRatio = reader.string(); + break; + case 10: + message.makerFeeRate = reader.string(); + break; + case 11: + message.takerFeeRate = reader.string(); + break; + case 12: + message.relayerFeeShareRate = reader.string(); + break; + case 13: + message.isPerpetual = reader.bool(); + break; + case 14: + message.status = (reader.int32() as any); + break; + case 15: + message.minPriceTickSize = reader.string(); + break; + case 16: + message.minQuantityTickSize = reader.string(); + break; + case 17: + message.minNotional = reader.string(); + break; + case 18: + message.admin = reader.string(); + break; + case 19: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarket { + const message = createBaseDerivativeMarket(); + message.ticker = object.ticker ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.quoteDenom = object.quoteDenom ?? ""; + message.marketId = object.marketId ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.isPerpetual = object.isPerpetual ?? false; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: DerivativeMarketAmino): DerivativeMarket { + const message = createBaseDerivativeMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.isPerpetual !== undefined && object.isPerpetual !== null) { + message.isPerpetual = object.isPerpetual; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: DerivativeMarket): DerivativeMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.isPerpetual = message.isPerpetual === false ? undefined : message.isPerpetual; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: DerivativeMarketAminoMsg): DerivativeMarket { + return DerivativeMarket.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketProtoMsg): DerivativeMarket { + return DerivativeMarket.decode(message.value); + }, + toProto(message: DerivativeMarket): Uint8Array { + return DerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarket): DerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket", + value: DerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarket.typeUrl, DerivativeMarket); +function createBaseBinaryOptionsMarket(): BinaryOptionsMarket { + return { + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + marketId: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + settlementPrice: undefined, + minNotional: "", + adminPermissions: 0 + }; +} +export const BinaryOptionsMarket = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket", + is(o: any): o is BinaryOptionsMarket { + return o && (o.$typeUrl === BinaryOptionsMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.marketId === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is BinaryOptionsMarketAmino { + return o && (o.$typeUrl === BinaryOptionsMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.market_id === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: BinaryOptionsMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(18).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(26).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(40).uint32(message.oracleScaleFactor); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(56).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(66).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(74).string(message.quoteDenom); + } + if (message.marketId !== "") { + writer.uint32(82).string(message.marketId); + } + if (message.makerFeeRate !== "") { + writer.uint32(90).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(98).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(106).string(message.relayerFeeShareRate); + } + if (message.status !== 0) { + writer.uint32(112).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(122).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(130).string(message.minQuantityTickSize); + } + if (message.settlementPrice !== undefined) { + writer.uint32(138).string(message.settlementPrice); + } + if (message.minNotional !== "") { + writer.uint32(146).string(message.minNotional); + } + if (message.adminPermissions !== 0) { + writer.uint32(152).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.oracleSymbol = reader.string(); + break; + case 3: + message.oracleProvider = reader.string(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + case 5: + message.oracleScaleFactor = reader.uint32(); + break; + case 6: + message.expirationTimestamp = reader.int64(); + break; + case 7: + message.settlementTimestamp = reader.int64(); + break; + case 8: + message.admin = reader.string(); + break; + case 9: + message.quoteDenom = reader.string(); + break; + case 10: + message.marketId = reader.string(); + break; + case 11: + message.makerFeeRate = reader.string(); + break; + case 12: + message.takerFeeRate = reader.string(); + break; + case 13: + message.relayerFeeShareRate = reader.string(); + break; + case 14: + message.status = (reader.int32() as any); + break; + case 15: + message.minPriceTickSize = reader.string(); + break; + case 16: + message.minQuantityTickSize = reader.string(); + break; + case 17: + message.settlementPrice = reader.string(); + break; + case 18: + message.minNotional = reader.string(); + break; + case 19: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarket { + const message = createBaseBinaryOptionsMarket(); + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + message.minNotional = object.minNotional ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: BinaryOptionsMarketAmino): BinaryOptionsMarket { + const message = createBaseBinaryOptionsMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: BinaryOptionsMarket): BinaryOptionsMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketAminoMsg): BinaryOptionsMarket { + return BinaryOptionsMarket.fromAmino(object.value); + }, + fromProtoMsg(message: BinaryOptionsMarketProtoMsg): BinaryOptionsMarket { + return BinaryOptionsMarket.decode(message.value); + }, + toProto(message: BinaryOptionsMarket): Uint8Array { + return BinaryOptionsMarket.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarket): BinaryOptionsMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket", + value: BinaryOptionsMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarket.typeUrl, BinaryOptionsMarket); +function createBaseExpiryFuturesMarketInfo(): ExpiryFuturesMarketInfo { + return { + marketId: "", + expirationTimestamp: BigInt(0), + twapStartTimestamp: BigInt(0), + expirationTwapStartPriceCumulative: "", + settlementPrice: "" + }; +} +export const ExpiryFuturesMarketInfo = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo", + is(o: any): o is ExpiryFuturesMarketInfo { + return o && (o.$typeUrl === ExpiryFuturesMarketInfo.typeUrl || typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.twapStartTimestamp === "bigint" && typeof o.expirationTwapStartPriceCumulative === "string" && typeof o.settlementPrice === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketInfoAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketInfo.typeUrl || typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.twap_start_timestamp === "bigint" && typeof o.expiration_twap_start_price_cumulative === "string" && typeof o.settlement_price === "string"); + }, + encode(message: ExpiryFuturesMarketInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.expirationTimestamp); + } + if (message.twapStartTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.twapStartTimestamp); + } + if (message.expirationTwapStartPriceCumulative !== "") { + writer.uint32(34).string(message.expirationTwapStartPriceCumulative); + } + if (message.settlementPrice !== "") { + writer.uint32(42).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.expirationTimestamp = reader.int64(); + break; + case 3: + message.twapStartTimestamp = reader.int64(); + break; + case 4: + message.expirationTwapStartPriceCumulative = reader.string(); + break; + case 5: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketInfo { + const message = createBaseExpiryFuturesMarketInfo(); + message.marketId = object.marketId ?? ""; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.twapStartTimestamp = object.twapStartTimestamp !== undefined && object.twapStartTimestamp !== null ? BigInt(object.twapStartTimestamp.toString()) : BigInt(0); + message.expirationTwapStartPriceCumulative = object.expirationTwapStartPriceCumulative ?? ""; + message.settlementPrice = object.settlementPrice ?? ""; + return message; + }, + fromAmino(object: ExpiryFuturesMarketInfoAmino): ExpiryFuturesMarketInfo { + const message = createBaseExpiryFuturesMarketInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.twap_start_timestamp !== undefined && object.twap_start_timestamp !== null) { + message.twapStartTimestamp = BigInt(object.twap_start_timestamp); + } + if (object.expiration_twap_start_price_cumulative !== undefined && object.expiration_twap_start_price_cumulative !== null) { + message.expirationTwapStartPriceCumulative = object.expiration_twap_start_price_cumulative; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: ExpiryFuturesMarketInfo): ExpiryFuturesMarketInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.twap_start_timestamp = message.twapStartTimestamp !== BigInt(0) ? message.twapStartTimestamp?.toString() : undefined; + obj.expiration_twap_start_price_cumulative = message.expirationTwapStartPriceCumulative === "" ? undefined : message.expirationTwapStartPriceCumulative; + obj.settlement_price = message.settlementPrice === "" ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketInfoAminoMsg): ExpiryFuturesMarketInfo { + return ExpiryFuturesMarketInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExpiryFuturesMarketInfoProtoMsg): ExpiryFuturesMarketInfo { + return ExpiryFuturesMarketInfo.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketInfo): Uint8Array { + return ExpiryFuturesMarketInfo.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketInfo): ExpiryFuturesMarketInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo", + value: ExpiryFuturesMarketInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketInfo.typeUrl, ExpiryFuturesMarketInfo); +function createBasePerpetualMarketInfo(): PerpetualMarketInfo { + return { + marketId: "", + hourlyFundingRateCap: "", + hourlyInterestRate: "", + nextFundingTimestamp: BigInt(0), + fundingInterval: BigInt(0) + }; +} +export const PerpetualMarketInfo = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo", + is(o: any): o is PerpetualMarketInfo { + return o && (o.$typeUrl === PerpetualMarketInfo.typeUrl || typeof o.marketId === "string" && typeof o.hourlyFundingRateCap === "string" && typeof o.hourlyInterestRate === "string" && typeof o.nextFundingTimestamp === "bigint" && typeof o.fundingInterval === "bigint"); + }, + isAmino(o: any): o is PerpetualMarketInfoAmino { + return o && (o.$typeUrl === PerpetualMarketInfo.typeUrl || typeof o.market_id === "string" && typeof o.hourly_funding_rate_cap === "string" && typeof o.hourly_interest_rate === "string" && typeof o.next_funding_timestamp === "bigint" && typeof o.funding_interval === "bigint"); + }, + encode(message: PerpetualMarketInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.hourlyFundingRateCap !== "") { + writer.uint32(18).string(message.hourlyFundingRateCap); + } + if (message.hourlyInterestRate !== "") { + writer.uint32(26).string(message.hourlyInterestRate); + } + if (message.nextFundingTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.nextFundingTimestamp); + } + if (message.fundingInterval !== BigInt(0)) { + writer.uint32(40).int64(message.fundingInterval); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.hourlyFundingRateCap = reader.string(); + break; + case 3: + message.hourlyInterestRate = reader.string(); + break; + case 4: + message.nextFundingTimestamp = reader.int64(); + break; + case 5: + message.fundingInterval = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketInfo { + const message = createBasePerpetualMarketInfo(); + message.marketId = object.marketId ?? ""; + message.hourlyFundingRateCap = object.hourlyFundingRateCap ?? ""; + message.hourlyInterestRate = object.hourlyInterestRate ?? ""; + message.nextFundingTimestamp = object.nextFundingTimestamp !== undefined && object.nextFundingTimestamp !== null ? BigInt(object.nextFundingTimestamp.toString()) : BigInt(0); + message.fundingInterval = object.fundingInterval !== undefined && object.fundingInterval !== null ? BigInt(object.fundingInterval.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PerpetualMarketInfoAmino): PerpetualMarketInfo { + const message = createBasePerpetualMarketInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.hourly_funding_rate_cap !== undefined && object.hourly_funding_rate_cap !== null) { + message.hourlyFundingRateCap = object.hourly_funding_rate_cap; + } + if (object.hourly_interest_rate !== undefined && object.hourly_interest_rate !== null) { + message.hourlyInterestRate = object.hourly_interest_rate; + } + if (object.next_funding_timestamp !== undefined && object.next_funding_timestamp !== null) { + message.nextFundingTimestamp = BigInt(object.next_funding_timestamp); + } + if (object.funding_interval !== undefined && object.funding_interval !== null) { + message.fundingInterval = BigInt(object.funding_interval); + } + return message; + }, + toAmino(message: PerpetualMarketInfo): PerpetualMarketInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.hourly_funding_rate_cap = message.hourlyFundingRateCap === "" ? undefined : message.hourlyFundingRateCap; + obj.hourly_interest_rate = message.hourlyInterestRate === "" ? undefined : message.hourlyInterestRate; + obj.next_funding_timestamp = message.nextFundingTimestamp !== BigInt(0) ? message.nextFundingTimestamp?.toString() : undefined; + obj.funding_interval = message.fundingInterval !== BigInt(0) ? message.fundingInterval?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketInfoAminoMsg): PerpetualMarketInfo { + return PerpetualMarketInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketInfoProtoMsg): PerpetualMarketInfo { + return PerpetualMarketInfo.decode(message.value); + }, + toProto(message: PerpetualMarketInfo): Uint8Array { + return PerpetualMarketInfo.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketInfo): PerpetualMarketInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo", + value: PerpetualMarketInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketInfo.typeUrl, PerpetualMarketInfo); +function createBasePerpetualMarketFunding(): PerpetualMarketFunding { + return { + cumulativeFunding: "", + cumulativePrice: "", + lastTimestamp: BigInt(0) + }; +} +export const PerpetualMarketFunding = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding", + is(o: any): o is PerpetualMarketFunding { + return o && (o.$typeUrl === PerpetualMarketFunding.typeUrl || typeof o.cumulativeFunding === "string" && typeof o.cumulativePrice === "string" && typeof o.lastTimestamp === "bigint"); + }, + isAmino(o: any): o is PerpetualMarketFundingAmino { + return o && (o.$typeUrl === PerpetualMarketFunding.typeUrl || typeof o.cumulative_funding === "string" && typeof o.cumulative_price === "string" && typeof o.last_timestamp === "bigint"); + }, + encode(message: PerpetualMarketFunding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cumulativeFunding !== "") { + writer.uint32(10).string(message.cumulativeFunding); + } + if (message.cumulativePrice !== "") { + writer.uint32(18).string(message.cumulativePrice); + } + if (message.lastTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.lastTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketFunding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketFunding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeFunding = reader.string(); + break; + case 2: + message.cumulativePrice = reader.string(); + break; + case 3: + message.lastTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketFunding { + const message = createBasePerpetualMarketFunding(); + message.cumulativeFunding = object.cumulativeFunding ?? ""; + message.cumulativePrice = object.cumulativePrice ?? ""; + message.lastTimestamp = object.lastTimestamp !== undefined && object.lastTimestamp !== null ? BigInt(object.lastTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PerpetualMarketFundingAmino): PerpetualMarketFunding { + const message = createBasePerpetualMarketFunding(); + if (object.cumulative_funding !== undefined && object.cumulative_funding !== null) { + message.cumulativeFunding = object.cumulative_funding; + } + if (object.cumulative_price !== undefined && object.cumulative_price !== null) { + message.cumulativePrice = object.cumulative_price; + } + if (object.last_timestamp !== undefined && object.last_timestamp !== null) { + message.lastTimestamp = BigInt(object.last_timestamp); + } + return message; + }, + toAmino(message: PerpetualMarketFunding): PerpetualMarketFundingAmino { + const obj: any = {}; + obj.cumulative_funding = message.cumulativeFunding === "" ? undefined : message.cumulativeFunding; + obj.cumulative_price = message.cumulativePrice === "" ? undefined : message.cumulativePrice; + obj.last_timestamp = message.lastTimestamp !== BigInt(0) ? message.lastTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketFundingAminoMsg): PerpetualMarketFunding { + return PerpetualMarketFunding.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketFundingProtoMsg): PerpetualMarketFunding { + return PerpetualMarketFunding.decode(message.value); + }, + toProto(message: PerpetualMarketFunding): Uint8Array { + return PerpetualMarketFunding.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketFunding): PerpetualMarketFundingProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding", + value: PerpetualMarketFunding.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketFunding.typeUrl, PerpetualMarketFunding); +function createBaseDerivativeMarketSettlementInfo(): DerivativeMarketSettlementInfo { + return { + marketId: "", + settlementPrice: "" + }; +} +export const DerivativeMarketSettlementInfo = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo", + is(o: any): o is DerivativeMarketSettlementInfo { + return o && (o.$typeUrl === DerivativeMarketSettlementInfo.typeUrl || typeof o.marketId === "string" && typeof o.settlementPrice === "string"); + }, + isAmino(o: any): o is DerivativeMarketSettlementInfoAmino { + return o && (o.$typeUrl === DerivativeMarketSettlementInfo.typeUrl || typeof o.market_id === "string" && typeof o.settlement_price === "string"); + }, + encode(message: DerivativeMarketSettlementInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlementPrice !== "") { + writer.uint32(18).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketSettlementInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketSettlementInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketSettlementInfo { + const message = createBaseDerivativeMarketSettlementInfo(); + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketSettlementInfoAmino): DerivativeMarketSettlementInfo { + const message = createBaseDerivativeMarketSettlementInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: DerivativeMarketSettlementInfo): DerivativeMarketSettlementInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === "" ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: DerivativeMarketSettlementInfoAminoMsg): DerivativeMarketSettlementInfo { + return DerivativeMarketSettlementInfo.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketSettlementInfoProtoMsg): DerivativeMarketSettlementInfo { + return DerivativeMarketSettlementInfo.decode(message.value); + }, + toProto(message: DerivativeMarketSettlementInfo): Uint8Array { + return DerivativeMarketSettlementInfo.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketSettlementInfo): DerivativeMarketSettlementInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo", + value: DerivativeMarketSettlementInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketSettlementInfo.typeUrl, DerivativeMarketSettlementInfo); +function createBaseNextFundingTimestamp(): NextFundingTimestamp { + return { + nextTimestamp: BigInt(0) + }; +} +export const NextFundingTimestamp = { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp", + is(o: any): o is NextFundingTimestamp { + return o && (o.$typeUrl === NextFundingTimestamp.typeUrl || typeof o.nextTimestamp === "bigint"); + }, + isAmino(o: any): o is NextFundingTimestampAmino { + return o && (o.$typeUrl === NextFundingTimestamp.typeUrl || typeof o.next_timestamp === "bigint"); + }, + encode(message: NextFundingTimestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.nextTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NextFundingTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextFundingTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): NextFundingTimestamp { + const message = createBaseNextFundingTimestamp(); + message.nextTimestamp = object.nextTimestamp !== undefined && object.nextTimestamp !== null ? BigInt(object.nextTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NextFundingTimestampAmino): NextFundingTimestamp { + const message = createBaseNextFundingTimestamp(); + if (object.next_timestamp !== undefined && object.next_timestamp !== null) { + message.nextTimestamp = BigInt(object.next_timestamp); + } + return message; + }, + toAmino(message: NextFundingTimestamp): NextFundingTimestampAmino { + const obj: any = {}; + obj.next_timestamp = message.nextTimestamp !== BigInt(0) ? message.nextTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NextFundingTimestampAminoMsg): NextFundingTimestamp { + return NextFundingTimestamp.fromAmino(object.value); + }, + fromProtoMsg(message: NextFundingTimestampProtoMsg): NextFundingTimestamp { + return NextFundingTimestamp.decode(message.value); + }, + toProto(message: NextFundingTimestamp): Uint8Array { + return NextFundingTimestamp.encode(message).finish(); + }, + toProtoMsg(message: NextFundingTimestamp): NextFundingTimestampProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp", + value: NextFundingTimestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(NextFundingTimestamp.typeUrl, NextFundingTimestamp); +function createBaseMidPriceAndTOB(): MidPriceAndTOB { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const MidPriceAndTOB = { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB", + is(o: any): o is MidPriceAndTOB { + return o && o.$typeUrl === MidPriceAndTOB.typeUrl; + }, + isAmino(o: any): o is MidPriceAndTOBAmino { + return o && o.$typeUrl === MidPriceAndTOB.typeUrl; + }, + encode(message: MidPriceAndTOB, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MidPriceAndTOB { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMidPriceAndTOB(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MidPriceAndTOB { + const message = createBaseMidPriceAndTOB(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: MidPriceAndTOBAmino): MidPriceAndTOB { + const message = createBaseMidPriceAndTOB(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: MidPriceAndTOB): MidPriceAndTOBAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: MidPriceAndTOBAminoMsg): MidPriceAndTOB { + return MidPriceAndTOB.fromAmino(object.value); + }, + fromProtoMsg(message: MidPriceAndTOBProtoMsg): MidPriceAndTOB { + return MidPriceAndTOB.decode(message.value); + }, + toProto(message: MidPriceAndTOB): Uint8Array { + return MidPriceAndTOB.encode(message).finish(); + }, + toProtoMsg(message: MidPriceAndTOB): MidPriceAndTOBProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB", + value: MidPriceAndTOB.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MidPriceAndTOB.typeUrl, MidPriceAndTOB); +function createBaseSpotMarket(): SpotMarket { + return { + ticker: "", + baseDenom: "", + quoteDenom: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + marketId: "", + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + admin: "", + adminPermissions: 0 + }; +} +export const SpotMarket = { + typeUrl: "/injective.exchange.v1beta1.SpotMarket", + is(o: any): o is SpotMarket { + return o && (o.$typeUrl === SpotMarket.typeUrl || typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && typeof o.marketId === "string" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is SpotMarketAmino { + return o && (o.$typeUrl === SpotMarket.typeUrl || typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && typeof o.market_id === "string" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: SpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(18).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.makerFeeRate !== "") { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.marketId !== "") { + writer.uint32(58).string(message.marketId); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(74).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(82).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(90).string(message.minNotional); + } + if (message.admin !== "") { + writer.uint32(98).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(104).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.marketId = reader.string(); + break; + case 8: + message.status = (reader.int32() as any); + break; + case 9: + message.minPriceTickSize = reader.string(); + break; + case 10: + message.minQuantityTickSize = reader.string(); + break; + case 11: + message.minNotional = reader.string(); + break; + case 12: + message.admin = reader.string(); + break; + case 13: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarket { + const message = createBaseSpotMarket(); + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.marketId = object.marketId ?? ""; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: SpotMarketAmino): SpotMarket { + const message = createBaseSpotMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: SpotMarket): SpotMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: SpotMarketAminoMsg): SpotMarket { + return SpotMarket.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketProtoMsg): SpotMarket { + return SpotMarket.decode(message.value); + }, + toProto(message: SpotMarket): Uint8Array { + return SpotMarket.encode(message).finish(); + }, + toProtoMsg(message: SpotMarket): SpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarket", + value: SpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarket.typeUrl, SpotMarket); +function createBaseDeposit(): Deposit { + return { + availableBalance: "", + totalBalance: "" + }; +} +export const Deposit = { + typeUrl: "/injective.exchange.v1beta1.Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.availableBalance === "string" && typeof o.totalBalance === "string"); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.available_balance === "string" && typeof o.total_balance === "string"); + }, + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.availableBalance !== "") { + writer.uint32(10).string(message.availableBalance); + } + if (message.totalBalance !== "") { + writer.uint32(18).string(message.totalBalance); + } + 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.availableBalance = reader.string(); + break; + case 2: + message.totalBalance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Deposit { + const message = createBaseDeposit(); + message.availableBalance = object.availableBalance ?? ""; + message.totalBalance = object.totalBalance ?? ""; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.available_balance !== undefined && object.available_balance !== null) { + message.availableBalance = object.available_balance; + } + if (object.total_balance !== undefined && object.total_balance !== null) { + message.totalBalance = object.total_balance; + } + return message; + }, + toAmino(message: Deposit): DepositAmino { + const obj: any = {}; + obj.available_balance = message.availableBalance === "" ? undefined : message.availableBalance; + obj.total_balance = message.totalBalance === "" ? undefined : message.totalBalance; + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +function createBaseSubaccountTradeNonce(): SubaccountTradeNonce { + return { + nonce: 0 + }; +} +export const SubaccountTradeNonce = { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce", + is(o: any): o is SubaccountTradeNonce { + return o && (o.$typeUrl === SubaccountTradeNonce.typeUrl || typeof o.nonce === "number"); + }, + isAmino(o: any): o is SubaccountTradeNonceAmino { + return o && (o.$typeUrl === SubaccountTradeNonce.typeUrl || typeof o.nonce === "number"); + }, + encode(message: SubaccountTradeNonce, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== 0) { + writer.uint32(8).uint32(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountTradeNonce { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountTradeNonce(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountTradeNonce { + const message = createBaseSubaccountTradeNonce(); + message.nonce = object.nonce ?? 0; + return message; + }, + fromAmino(object: SubaccountTradeNonceAmino): SubaccountTradeNonce { + const message = createBaseSubaccountTradeNonce(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = object.nonce; + } + return message; + }, + toAmino(message: SubaccountTradeNonce): SubaccountTradeNonceAmino { + const obj: any = {}; + obj.nonce = message.nonce === 0 ? undefined : message.nonce; + return obj; + }, + fromAminoMsg(object: SubaccountTradeNonceAminoMsg): SubaccountTradeNonce { + return SubaccountTradeNonce.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountTradeNonceProtoMsg): SubaccountTradeNonce { + return SubaccountTradeNonce.decode(message.value); + }, + toProto(message: SubaccountTradeNonce): Uint8Array { + return SubaccountTradeNonce.encode(message).finish(); + }, + toProtoMsg(message: SubaccountTradeNonce): SubaccountTradeNonceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce", + value: SubaccountTradeNonce.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountTradeNonce.typeUrl, SubaccountTradeNonce); +function createBaseOrderInfo(): OrderInfo { + return { + subaccountId: "", + feeRecipient: "", + price: "", + quantity: "", + cid: "" + }; +} +export const OrderInfo = { + typeUrl: "/injective.exchange.v1beta1.OrderInfo", + is(o: any): o is OrderInfo { + return o && (o.$typeUrl === OrderInfo.typeUrl || typeof o.subaccountId === "string" && typeof o.feeRecipient === "string" && typeof o.price === "string" && typeof o.quantity === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is OrderInfoAmino { + return o && (o.$typeUrl === OrderInfo.typeUrl || typeof o.subaccount_id === "string" && typeof o.fee_recipient === "string" && typeof o.price === "string" && typeof o.quantity === "string" && typeof o.cid === "string"); + }, + encode(message: OrderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.feeRecipient !== "") { + writer.uint32(18).string(message.feeRecipient); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.feeRecipient = reader.string(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderInfo { + const message = createBaseOrderInfo(); + message.subaccountId = object.subaccountId ?? ""; + message.feeRecipient = object.feeRecipient ?? ""; + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: OrderInfoAmino): OrderInfo { + const message = createBaseOrderInfo(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.fee_recipient !== undefined && object.fee_recipient !== null) { + message.feeRecipient = object.fee_recipient; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: OrderInfo): OrderInfoAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.fee_recipient = message.feeRecipient === "" ? undefined : message.feeRecipient; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: OrderInfoAminoMsg): OrderInfo { + return OrderInfo.fromAmino(object.value); + }, + fromProtoMsg(message: OrderInfoProtoMsg): OrderInfo { + return OrderInfo.decode(message.value); + }, + toProto(message: OrderInfo): Uint8Array { + return OrderInfo.encode(message).finish(); + }, + toProtoMsg(message: OrderInfo): OrderInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderInfo", + value: OrderInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderInfo.typeUrl, OrderInfo); +function createBaseSpotOrder(): SpotOrder { + return { + marketId: "", + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + triggerPrice: undefined + }; +} +export const SpotOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotOrder", + is(o: any): o is SpotOrder { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.marketId === "string" && OrderInfo.is(o.orderInfo) && isSet(o.orderType)); + }, + isAmino(o: any): o is SpotOrderAmino { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.market_id === "string" && OrderInfo.isAmino(o.order_info) && isSet(o.order_type)); + }, + encode(message: SpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(24).int32(message.orderType); + } + if (message.triggerPrice !== undefined) { + writer.uint32(34).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 3: + message.orderType = (reader.int32() as any); + break; + case 4: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrder { + const message = createBaseSpotOrder(); + message.marketId = object.marketId ?? ""; + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: SpotOrderAmino): SpotOrder { + const message = createBaseSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: SpotOrder): SpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: SpotOrderAminoMsg): SpotOrder { + return SpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderProtoMsg): SpotOrder { + return SpotOrder.decode(message.value); + }, + toProto(message: SpotOrder): Uint8Array { + return SpotOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotOrder): SpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotOrder", + value: SpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrder.typeUrl, SpotOrder); +function createBaseSpotLimitOrder(): SpotLimitOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + fillable: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const SpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder", + is(o: any): o is SpotLimitOrder { + return o && (o.$typeUrl === SpotLimitOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.fillable === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is SpotLimitOrderAmino { + return o && (o.$typeUrl === SpotLimitOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.fillable === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: SpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.fillable !== "") { + writer.uint32(26).string(message.fillable); + } + if (message.triggerPrice !== undefined) { + writer.uint32(34).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.fillable = reader.string(); + break; + case 4: + message.triggerPrice = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotLimitOrder { + const message = createBaseSpotLimitOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.fillable = object.fillable ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: SpotLimitOrderAmino): SpotLimitOrder { + const message = createBaseSpotLimitOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: SpotLimitOrder): SpotLimitOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: SpotLimitOrderAminoMsg): SpotLimitOrder { + return SpotLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotLimitOrderProtoMsg): SpotLimitOrder { + return SpotLimitOrder.decode(message.value); + }, + toProto(message: SpotLimitOrder): Uint8Array { + return SpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotLimitOrder): SpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder", + value: SpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotLimitOrder.typeUrl, SpotLimitOrder); +function createBaseSpotMarketOrder(): SpotMarketOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + balanceHold: "", + orderHash: new Uint8Array(), + orderType: 0, + triggerPrice: undefined + }; +} +export const SpotMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder", + is(o: any): o is SpotMarketOrder { + return o && (o.$typeUrl === SpotMarketOrder.typeUrl || OrderInfo.is(o.orderInfo) && typeof o.balanceHold === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && isSet(o.orderType)); + }, + isAmino(o: any): o is SpotMarketOrderAmino { + return o && (o.$typeUrl === SpotMarketOrder.typeUrl || OrderInfo.isAmino(o.order_info) && typeof o.balance_hold === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && isSet(o.order_type)); + }, + encode(message: SpotMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.balanceHold !== "") { + writer.uint32(18).string(message.balanceHold); + } + if (message.orderHash.length !== 0) { + writer.uint32(26).bytes(message.orderHash); + } + if (message.orderType !== 0) { + writer.uint32(32).int32(message.orderType); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.balanceHold = reader.string(); + break; + case 3: + message.orderHash = reader.bytes(); + break; + case 4: + message.orderType = (reader.int32() as any); + break; + case 5: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketOrder { + const message = createBaseSpotMarketOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.balanceHold = object.balanceHold ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.orderType = object.orderType ?? 0; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: SpotMarketOrderAmino): SpotMarketOrder { + const message = createBaseSpotMarketOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: SpotMarketOrder): SpotMarketOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: SpotMarketOrderAminoMsg): SpotMarketOrder { + return SpotMarketOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketOrderProtoMsg): SpotMarketOrder { + return SpotMarketOrder.decode(message.value); + }, + toProto(message: SpotMarketOrder): Uint8Array { + return SpotMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketOrder): SpotMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder", + value: SpotMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketOrder.typeUrl, SpotMarketOrder); +function createBaseDerivativeOrder(): DerivativeOrder { + return { + marketId: "", + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + triggerPrice: undefined + }; +} +export const DerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder", + is(o: any): o is DerivativeOrder { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.marketId === "string" && OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string"); + }, + isAmino(o: any): o is DerivativeOrderAmino { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.market_id === "string" && OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string"); + }, + encode(message: DerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(24).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(34).string(message.margin); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 3: + message.orderType = (reader.int32() as any); + break; + case 4: + message.margin = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrder { + const message = createBaseDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: DerivativeOrderAmino): DerivativeOrder { + const message = createBaseDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: DerivativeOrder): DerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: DerivativeOrderAminoMsg): DerivativeOrder { + return DerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderProtoMsg): DerivativeOrder { + return DerivativeOrder.decode(message.value); + }, + toProto(message: DerivativeOrder): Uint8Array { + return DerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrder): DerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder", + value: DerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrder.typeUrl, DerivativeOrder); +function createBaseSubaccountOrderbookMetadata(): SubaccountOrderbookMetadata { + return { + vanillaLimitOrderCount: 0, + reduceOnlyLimitOrderCount: 0, + aggregateReduceOnlyQuantity: "", + aggregateVanillaQuantity: "", + vanillaConditionalOrderCount: 0, + reduceOnlyConditionalOrderCount: 0 + }; +} +export const SubaccountOrderbookMetadata = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata", + is(o: any): o is SubaccountOrderbookMetadata { + return o && (o.$typeUrl === SubaccountOrderbookMetadata.typeUrl || typeof o.vanillaLimitOrderCount === "number" && typeof o.reduceOnlyLimitOrderCount === "number" && typeof o.aggregateReduceOnlyQuantity === "string" && typeof o.aggregateVanillaQuantity === "string" && typeof o.vanillaConditionalOrderCount === "number" && typeof o.reduceOnlyConditionalOrderCount === "number"); + }, + isAmino(o: any): o is SubaccountOrderbookMetadataAmino { + return o && (o.$typeUrl === SubaccountOrderbookMetadata.typeUrl || typeof o.vanilla_limit_order_count === "number" && typeof o.reduce_only_limit_order_count === "number" && typeof o.aggregate_reduce_only_quantity === "string" && typeof o.aggregate_vanilla_quantity === "string" && typeof o.vanilla_conditional_order_count === "number" && typeof o.reduce_only_conditional_order_count === "number"); + }, + encode(message: SubaccountOrderbookMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vanillaLimitOrderCount !== 0) { + writer.uint32(8).uint32(message.vanillaLimitOrderCount); + } + if (message.reduceOnlyLimitOrderCount !== 0) { + writer.uint32(16).uint32(message.reduceOnlyLimitOrderCount); + } + if (message.aggregateReduceOnlyQuantity !== "") { + writer.uint32(26).string(message.aggregateReduceOnlyQuantity); + } + if (message.aggregateVanillaQuantity !== "") { + writer.uint32(34).string(message.aggregateVanillaQuantity); + } + if (message.vanillaConditionalOrderCount !== 0) { + writer.uint32(40).uint32(message.vanillaConditionalOrderCount); + } + if (message.reduceOnlyConditionalOrderCount !== 0) { + writer.uint32(48).uint32(message.reduceOnlyConditionalOrderCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderbookMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderbookMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vanillaLimitOrderCount = reader.uint32(); + break; + case 2: + message.reduceOnlyLimitOrderCount = reader.uint32(); + break; + case 3: + message.aggregateReduceOnlyQuantity = reader.string(); + break; + case 4: + message.aggregateVanillaQuantity = reader.string(); + break; + case 5: + message.vanillaConditionalOrderCount = reader.uint32(); + break; + case 6: + message.reduceOnlyConditionalOrderCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderbookMetadata { + const message = createBaseSubaccountOrderbookMetadata(); + message.vanillaLimitOrderCount = object.vanillaLimitOrderCount ?? 0; + message.reduceOnlyLimitOrderCount = object.reduceOnlyLimitOrderCount ?? 0; + message.aggregateReduceOnlyQuantity = object.aggregateReduceOnlyQuantity ?? ""; + message.aggregateVanillaQuantity = object.aggregateVanillaQuantity ?? ""; + message.vanillaConditionalOrderCount = object.vanillaConditionalOrderCount ?? 0; + message.reduceOnlyConditionalOrderCount = object.reduceOnlyConditionalOrderCount ?? 0; + return message; + }, + fromAmino(object: SubaccountOrderbookMetadataAmino): SubaccountOrderbookMetadata { + const message = createBaseSubaccountOrderbookMetadata(); + if (object.vanilla_limit_order_count !== undefined && object.vanilla_limit_order_count !== null) { + message.vanillaLimitOrderCount = object.vanilla_limit_order_count; + } + if (object.reduce_only_limit_order_count !== undefined && object.reduce_only_limit_order_count !== null) { + message.reduceOnlyLimitOrderCount = object.reduce_only_limit_order_count; + } + if (object.aggregate_reduce_only_quantity !== undefined && object.aggregate_reduce_only_quantity !== null) { + message.aggregateReduceOnlyQuantity = object.aggregate_reduce_only_quantity; + } + if (object.aggregate_vanilla_quantity !== undefined && object.aggregate_vanilla_quantity !== null) { + message.aggregateVanillaQuantity = object.aggregate_vanilla_quantity; + } + if (object.vanilla_conditional_order_count !== undefined && object.vanilla_conditional_order_count !== null) { + message.vanillaConditionalOrderCount = object.vanilla_conditional_order_count; + } + if (object.reduce_only_conditional_order_count !== undefined && object.reduce_only_conditional_order_count !== null) { + message.reduceOnlyConditionalOrderCount = object.reduce_only_conditional_order_count; + } + return message; + }, + toAmino(message: SubaccountOrderbookMetadata): SubaccountOrderbookMetadataAmino { + const obj: any = {}; + obj.vanilla_limit_order_count = message.vanillaLimitOrderCount === 0 ? undefined : message.vanillaLimitOrderCount; + obj.reduce_only_limit_order_count = message.reduceOnlyLimitOrderCount === 0 ? undefined : message.reduceOnlyLimitOrderCount; + obj.aggregate_reduce_only_quantity = message.aggregateReduceOnlyQuantity === "" ? undefined : message.aggregateReduceOnlyQuantity; + obj.aggregate_vanilla_quantity = message.aggregateVanillaQuantity === "" ? undefined : message.aggregateVanillaQuantity; + obj.vanilla_conditional_order_count = message.vanillaConditionalOrderCount === 0 ? undefined : message.vanillaConditionalOrderCount; + obj.reduce_only_conditional_order_count = message.reduceOnlyConditionalOrderCount === 0 ? undefined : message.reduceOnlyConditionalOrderCount; + return obj; + }, + fromAminoMsg(object: SubaccountOrderbookMetadataAminoMsg): SubaccountOrderbookMetadata { + return SubaccountOrderbookMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderbookMetadataProtoMsg): SubaccountOrderbookMetadata { + return SubaccountOrderbookMetadata.decode(message.value); + }, + toProto(message: SubaccountOrderbookMetadata): Uint8Array { + return SubaccountOrderbookMetadata.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderbookMetadata): SubaccountOrderbookMetadataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata", + value: SubaccountOrderbookMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderbookMetadata.typeUrl, SubaccountOrderbookMetadata); +function createBaseSubaccountOrder(): SubaccountOrder { + return { + price: "", + quantity: "", + isReduceOnly: false, + cid: "" + }; +} +export const SubaccountOrder = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder", + is(o: any): o is SubaccountOrder { + return o && (o.$typeUrl === SubaccountOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.isReduceOnly === "boolean" && typeof o.cid === "string"); + }, + isAmino(o: any): o is SubaccountOrderAmino { + return o && (o.$typeUrl === SubaccountOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.isReduceOnly === "boolean" && typeof o.cid === "string"); + }, + encode(message: SubaccountOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.isReduceOnly === true) { + writer.uint32(24).bool(message.isReduceOnly); + } + if (message.cid !== "") { + writer.uint32(34).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.isReduceOnly = reader.bool(); + break; + case 4: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrder { + const message = createBaseSubaccountOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.isReduceOnly = object.isReduceOnly ?? false; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: SubaccountOrderAmino): SubaccountOrder { + const message = createBaseSubaccountOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.isReduceOnly !== undefined && object.isReduceOnly !== null) { + message.isReduceOnly = object.isReduceOnly; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: SubaccountOrder): SubaccountOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.isReduceOnly = message.isReduceOnly === false ? undefined : message.isReduceOnly; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: SubaccountOrderAminoMsg): SubaccountOrder { + return SubaccountOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderProtoMsg): SubaccountOrder { + return SubaccountOrder.decode(message.value); + }, + toProto(message: SubaccountOrder): Uint8Array { + return SubaccountOrder.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrder): SubaccountOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder", + value: SubaccountOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrder.typeUrl, SubaccountOrder); +function createBaseSubaccountOrderData(): SubaccountOrderData { + return { + order: undefined, + orderHash: new Uint8Array() + }; +} +export const SubaccountOrderData = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData", + is(o: any): o is SubaccountOrderData { + return o && (o.$typeUrl === SubaccountOrderData.typeUrl || o.orderHash instanceof Uint8Array || typeof o.orderHash === "string"); + }, + isAmino(o: any): o is SubaccountOrderDataAmino { + return o && (o.$typeUrl === SubaccountOrderData.typeUrl || o.order_hash instanceof Uint8Array || typeof o.order_hash === "string"); + }, + encode(message: SubaccountOrderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + SubaccountOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = SubaccountOrder.decode(reader, reader.uint32()); + break; + case 2: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderData { + const message = createBaseSubaccountOrderData(); + message.order = object.order !== undefined && object.order !== null ? SubaccountOrder.fromPartial(object.order) : undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: SubaccountOrderDataAmino): SubaccountOrderData { + const message = createBaseSubaccountOrderData(); + if (object.order !== undefined && object.order !== null) { + message.order = SubaccountOrder.fromAmino(object.order); + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: SubaccountOrderData): SubaccountOrderDataAmino { + const obj: any = {}; + obj.order = message.order ? SubaccountOrder.toAmino(message.order) : undefined; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountOrderDataAminoMsg): SubaccountOrderData { + return SubaccountOrderData.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderDataProtoMsg): SubaccountOrderData { + return SubaccountOrderData.decode(message.value); + }, + toProto(message: SubaccountOrderData): Uint8Array { + return SubaccountOrderData.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderData): SubaccountOrderDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData", + value: SubaccountOrderData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderData.typeUrl, SubaccountOrderData); +function createBaseDerivativeLimitOrder(): DerivativeLimitOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + fillable: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const DerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder", + is(o: any): o is DerivativeLimitOrder { + return o && (o.$typeUrl === DerivativeLimitOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string" && typeof o.fillable === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is DerivativeLimitOrderAmino { + return o && (o.$typeUrl === DerivativeLimitOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string" && typeof o.fillable === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: DerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.fillable !== "") { + writer.uint32(34).string(message.fillable); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(50).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.fillable = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + case 6: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeLimitOrder { + const message = createBaseDerivativeLimitOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.fillable = object.fillable ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: DerivativeLimitOrderAmino): DerivativeLimitOrder { + const message = createBaseDerivativeLimitOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: DerivativeLimitOrder): DerivativeLimitOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeLimitOrderAminoMsg): DerivativeLimitOrder { + return DerivativeLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeLimitOrderProtoMsg): DerivativeLimitOrder { + return DerivativeLimitOrder.decode(message.value); + }, + toProto(message: DerivativeLimitOrder): Uint8Array { + return DerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeLimitOrder): DerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder", + value: DerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeLimitOrder.typeUrl, DerivativeLimitOrder); +function createBaseDerivativeMarketOrder(): DerivativeMarketOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + marginHold: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const DerivativeMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder", + is(o: any): o is DerivativeMarketOrder { + return o && (o.$typeUrl === DerivativeMarketOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string" && typeof o.marginHold === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is DerivativeMarketOrderAmino { + return o && (o.$typeUrl === DerivativeMarketOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string" && typeof o.margin_hold === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: DerivativeMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.marginHold !== "") { + writer.uint32(34).string(message.marginHold); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(50).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.marginHold = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + case 6: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrder { + const message = createBaseDerivativeMarketOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.marginHold = object.marginHold ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: DerivativeMarketOrderAmino): DerivativeMarketOrder { + const message = createBaseDerivativeMarketOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.margin_hold !== undefined && object.margin_hold !== null) { + message.marginHold = object.margin_hold; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: DerivativeMarketOrder): DerivativeMarketOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.margin_hold = message.marginHold === "" ? undefined : message.marginHold; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderAminoMsg): DerivativeMarketOrder { + return DerivativeMarketOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderProtoMsg): DerivativeMarketOrder { + return DerivativeMarketOrder.decode(message.value); + }, + toProto(message: DerivativeMarketOrder): Uint8Array { + return DerivativeMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrder): DerivativeMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder", + value: DerivativeMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrder.typeUrl, DerivativeMarketOrder); +function createBasePosition(): Position { + return { + isLong: false, + quantity: "", + entryPrice: "", + margin: "", + cumulativeFundingEntry: "" + }; +} +export const Position = { + typeUrl: "/injective.exchange.v1beta1.Position", + is(o: any): o is Position { + return o && (o.$typeUrl === Position.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.margin === "string" && typeof o.cumulativeFundingEntry === "string"); + }, + isAmino(o: any): o is PositionAmino { + return o && (o.$typeUrl === Position.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.margin === "string" && typeof o.cumulative_funding_entry === "string"); + }, + encode(message: Position, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(26).string(message.entryPrice); + } + if (message.margin !== "") { + writer.uint32(34).string(message.margin); + } + if (message.cumulativeFundingEntry !== "") { + writer.uint32(42).string(message.cumulativeFundingEntry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Position { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.entryPrice = reader.string(); + break; + case 4: + message.margin = reader.string(); + break; + case 5: + message.cumulativeFundingEntry = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Position { + const message = createBasePosition(); + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.margin = object.margin ?? ""; + message.cumulativeFundingEntry = object.cumulativeFundingEntry ?? ""; + return message; + }, + fromAmino(object: PositionAmino): Position { + const message = createBasePosition(); + if (object.isLong !== undefined && object.isLong !== null) { + message.isLong = object.isLong; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.cumulative_funding_entry !== undefined && object.cumulative_funding_entry !== null) { + message.cumulativeFundingEntry = object.cumulative_funding_entry; + } + return message; + }, + toAmino(message: Position): PositionAmino { + const obj: any = {}; + obj.isLong = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.cumulative_funding_entry = message.cumulativeFundingEntry === "" ? undefined : message.cumulativeFundingEntry; + return obj; + }, + fromAminoMsg(object: PositionAminoMsg): Position { + return Position.fromAmino(object.value); + }, + fromProtoMsg(message: PositionProtoMsg): Position { + return Position.decode(message.value); + }, + toProto(message: Position): Uint8Array { + return Position.encode(message).finish(); + }, + toProtoMsg(message: Position): PositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Position", + value: Position.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Position.typeUrl, Position); +function createBaseMarketOrderIndicator(): MarketOrderIndicator { + return { + marketId: "", + isBuy: false + }; +} +export const MarketOrderIndicator = { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator", + is(o: any): o is MarketOrderIndicator { + return o && (o.$typeUrl === MarketOrderIndicator.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean"); + }, + isAmino(o: any): o is MarketOrderIndicatorAmino { + return o && (o.$typeUrl === MarketOrderIndicator.typeUrl || typeof o.market_id === "string" && typeof o.isBuy === "boolean"); + }, + encode(message: MarketOrderIndicator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketOrderIndicator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketOrderIndicator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketOrderIndicator { + const message = createBaseMarketOrderIndicator(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + return message; + }, + fromAmino(object: MarketOrderIndicatorAmino): MarketOrderIndicator { + const message = createBaseMarketOrderIndicator(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + return message; + }, + toAmino(message: MarketOrderIndicator): MarketOrderIndicatorAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + return obj; + }, + fromAminoMsg(object: MarketOrderIndicatorAminoMsg): MarketOrderIndicator { + return MarketOrderIndicator.fromAmino(object.value); + }, + fromProtoMsg(message: MarketOrderIndicatorProtoMsg): MarketOrderIndicator { + return MarketOrderIndicator.decode(message.value); + }, + toProto(message: MarketOrderIndicator): Uint8Array { + return MarketOrderIndicator.encode(message).finish(); + }, + toProtoMsg(message: MarketOrderIndicator): MarketOrderIndicatorProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator", + value: MarketOrderIndicator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketOrderIndicator.typeUrl, MarketOrderIndicator); +function createBaseTradeLog(): TradeLog { + return { + quantity: "", + price: "", + subaccountId: new Uint8Array(), + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "" + }; +} +export const TradeLog = { + typeUrl: "/injective.exchange.v1beta1.TradeLog", + is(o: any): o is TradeLog { + return o && (o.$typeUrl === TradeLog.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is TradeLogAmino { + return o && (o.$typeUrl === TradeLog.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: TradeLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.subaccountId.length !== 0) { + writer.uint32(26).bytes(message.subaccountId); + } + if (message.fee !== "") { + writer.uint32(34).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(50).bytes(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.subaccountId = reader.bytes(); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + case 6: + message.feeRecipientAddress = reader.bytes(); + break; + case 7: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeLog { + const message = createBaseTradeLog(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TradeLogAmino): TradeLog { + const message = createBaseTradeLog(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = bytesFromBase64(object.fee_recipient_address); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TradeLog): TradeLogAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress ? base64FromBytes(message.feeRecipientAddress) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TradeLogAminoMsg): TradeLog { + return TradeLog.fromAmino(object.value); + }, + fromProtoMsg(message: TradeLogProtoMsg): TradeLog { + return TradeLog.decode(message.value); + }, + toProto(message: TradeLog): Uint8Array { + return TradeLog.encode(message).finish(); + }, + toProtoMsg(message: TradeLog): TradeLogProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeLog", + value: TradeLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeLog.typeUrl, TradeLog); +function createBasePositionDelta(): PositionDelta { + return { + isLong: false, + executionQuantity: "", + executionMargin: "", + executionPrice: "" + }; +} +export const PositionDelta = { + typeUrl: "/injective.exchange.v1beta1.PositionDelta", + is(o: any): o is PositionDelta { + return o && (o.$typeUrl === PositionDelta.typeUrl || typeof o.isLong === "boolean" && typeof o.executionQuantity === "string" && typeof o.executionMargin === "string" && typeof o.executionPrice === "string"); + }, + isAmino(o: any): o is PositionDeltaAmino { + return o && (o.$typeUrl === PositionDelta.typeUrl || typeof o.is_long === "boolean" && typeof o.execution_quantity === "string" && typeof o.execution_margin === "string" && typeof o.execution_price === "string"); + }, + encode(message: PositionDelta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.executionQuantity !== "") { + writer.uint32(18).string(message.executionQuantity); + } + if (message.executionMargin !== "") { + writer.uint32(26).string(message.executionMargin); + } + if (message.executionPrice !== "") { + writer.uint32(34).string(message.executionPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionDelta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionDelta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.executionQuantity = reader.string(); + break; + case 3: + message.executionMargin = reader.string(); + break; + case 4: + message.executionPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PositionDelta { + const message = createBasePositionDelta(); + message.isLong = object.isLong ?? false; + message.executionQuantity = object.executionQuantity ?? ""; + message.executionMargin = object.executionMargin ?? ""; + message.executionPrice = object.executionPrice ?? ""; + return message; + }, + fromAmino(object: PositionDeltaAmino): PositionDelta { + const message = createBasePositionDelta(); + if (object.is_long !== undefined && object.is_long !== null) { + message.isLong = object.is_long; + } + if (object.execution_quantity !== undefined && object.execution_quantity !== null) { + message.executionQuantity = object.execution_quantity; + } + if (object.execution_margin !== undefined && object.execution_margin !== null) { + message.executionMargin = object.execution_margin; + } + if (object.execution_price !== undefined && object.execution_price !== null) { + message.executionPrice = object.execution_price; + } + return message; + }, + toAmino(message: PositionDelta): PositionDeltaAmino { + const obj: any = {}; + obj.is_long = message.isLong === false ? undefined : message.isLong; + obj.execution_quantity = message.executionQuantity === "" ? undefined : message.executionQuantity; + obj.execution_margin = message.executionMargin === "" ? undefined : message.executionMargin; + obj.execution_price = message.executionPrice === "" ? undefined : message.executionPrice; + return obj; + }, + fromAminoMsg(object: PositionDeltaAminoMsg): PositionDelta { + return PositionDelta.fromAmino(object.value); + }, + fromProtoMsg(message: PositionDeltaProtoMsg): PositionDelta { + return PositionDelta.decode(message.value); + }, + toProto(message: PositionDelta): Uint8Array { + return PositionDelta.encode(message).finish(); + }, + toProtoMsg(message: PositionDelta): PositionDeltaProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PositionDelta", + value: PositionDelta.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PositionDelta.typeUrl, PositionDelta); +function createBaseDerivativeTradeLog(): DerivativeTradeLog { + return { + subaccountId: new Uint8Array(), + positionDelta: undefined, + payout: "", + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "", + pnl: "" + }; +} +export const DerivativeTradeLog = { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog", + is(o: any): o is DerivativeTradeLog { + return o && (o.$typeUrl === DerivativeTradeLog.typeUrl || (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.payout === "string" && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string" && typeof o.pnl === "string"); + }, + isAmino(o: any): o is DerivativeTradeLogAmino { + return o && (o.$typeUrl === DerivativeTradeLog.typeUrl || (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.payout === "string" && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string" && typeof o.pnl === "string"); + }, + encode(message: DerivativeTradeLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(18).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(26).string(message.payout); + } + if (message.fee !== "") { + writer.uint32(34).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(50).bytes(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + if (message.pnl !== "") { + writer.uint32(66).string(message.pnl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeTradeLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeTradeLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 3: + message.payout = reader.string(); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + case 6: + message.feeRecipientAddress = reader.bytes(); + break; + case 7: + message.cid = reader.string(); + break; + case 8: + message.pnl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeTradeLog { + const message = createBaseDerivativeTradeLog(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.pnl = object.pnl ?? ""; + return message; + }, + fromAmino(object: DerivativeTradeLogAmino): DerivativeTradeLog { + const message = createBaseDerivativeTradeLog(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = bytesFromBase64(object.fee_recipient_address); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.pnl !== undefined && object.pnl !== null) { + message.pnl = object.pnl; + } + return message; + }, + toAmino(message: DerivativeTradeLog): DerivativeTradeLogAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress ? base64FromBytes(message.feeRecipientAddress) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.pnl = message.pnl === "" ? undefined : message.pnl; + return obj; + }, + fromAminoMsg(object: DerivativeTradeLogAminoMsg): DerivativeTradeLog { + return DerivativeTradeLog.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeTradeLogProtoMsg): DerivativeTradeLog { + return DerivativeTradeLog.decode(message.value); + }, + toProto(message: DerivativeTradeLog): Uint8Array { + return DerivativeTradeLog.encode(message).finish(); + }, + toProtoMsg(message: DerivativeTradeLog): DerivativeTradeLogProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog", + value: DerivativeTradeLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeTradeLog.typeUrl, DerivativeTradeLog); +function createBaseSubaccountPosition(): SubaccountPosition { + return { + position: undefined, + subaccountId: new Uint8Array() + }; +} +export const SubaccountPosition = { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition", + is(o: any): o is SubaccountPosition { + return o && (o.$typeUrl === SubaccountPosition.typeUrl || o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is SubaccountPositionAmino { + return o && (o.$typeUrl === SubaccountPosition.typeUrl || o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string"); + }, + encode(message: SubaccountPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.position !== undefined) { + Position.encode(message.position, writer.uint32(10).fork()).ldelim(); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.position = Position.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountPosition { + const message = createBaseSubaccountPosition(); + message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + return message; + }, + fromAmino(object: SubaccountPositionAmino): SubaccountPosition { + const message = createBaseSubaccountPosition(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + return message; + }, + toAmino(message: SubaccountPosition): SubaccountPositionAmino { + const obj: any = {}; + obj.position = message.position ? Position.toAmino(message.position) : undefined; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountPositionAminoMsg): SubaccountPosition { + return SubaccountPosition.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountPositionProtoMsg): SubaccountPosition { + return SubaccountPosition.decode(message.value); + }, + toProto(message: SubaccountPosition): Uint8Array { + return SubaccountPosition.encode(message).finish(); + }, + toProtoMsg(message: SubaccountPosition): SubaccountPositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition", + value: SubaccountPosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountPosition.typeUrl, SubaccountPosition); +function createBaseSubaccountDeposit(): SubaccountDeposit { + return { + subaccountId: new Uint8Array(), + deposit: undefined + }; +} +export const SubaccountDeposit = { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit", + is(o: any): o is SubaccountDeposit { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is SubaccountDepositAmino { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string"); + }, + encode(message: SubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: SubaccountDepositAmino): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: SubaccountDeposit): SubaccountDepositAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountDepositAminoMsg): SubaccountDeposit { + return SubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositProtoMsg): SubaccountDeposit { + return SubaccountDeposit.decode(message.value); + }, + toProto(message: SubaccountDeposit): Uint8Array { + return SubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposit): SubaccountDepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit", + value: SubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposit.typeUrl, SubaccountDeposit); +function createBaseDepositUpdate(): DepositUpdate { + return { + denom: "", + deposits: [] + }; +} +export const DepositUpdate = { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate", + is(o: any): o is DepositUpdate { + return o && (o.$typeUrl === DepositUpdate.typeUrl || typeof o.denom === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is DepositUpdateAmino { + return o && (o.$typeUrl === DepositUpdate.typeUrl || typeof o.denom === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.isAmino(o.deposits[0]))); + }, + encode(message: DepositUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.deposits) { + SubaccountDeposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.deposits.push(SubaccountDeposit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DepositUpdate { + const message = createBaseDepositUpdate(); + message.denom = object.denom ?? ""; + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DepositUpdateAmino): DepositUpdate { + const message = createBaseDepositUpdate(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: DepositUpdate): DepositUpdateAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? SubaccountDeposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + return obj; + }, + fromAminoMsg(object: DepositUpdateAminoMsg): DepositUpdate { + return DepositUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: DepositUpdateProtoMsg): DepositUpdate { + return DepositUpdate.decode(message.value); + }, + toProto(message: DepositUpdate): Uint8Array { + return DepositUpdate.encode(message).finish(); + }, + toProtoMsg(message: DepositUpdate): DepositUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate", + value: DepositUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DepositUpdate.typeUrl, DepositUpdate); +function createBasePointsMultiplier(): PointsMultiplier { + return { + makerPointsMultiplier: "", + takerPointsMultiplier: "" + }; +} +export const PointsMultiplier = { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier", + is(o: any): o is PointsMultiplier { + return o && (o.$typeUrl === PointsMultiplier.typeUrl || typeof o.makerPointsMultiplier === "string" && typeof o.takerPointsMultiplier === "string"); + }, + isAmino(o: any): o is PointsMultiplierAmino { + return o && (o.$typeUrl === PointsMultiplier.typeUrl || typeof o.maker_points_multiplier === "string" && typeof o.taker_points_multiplier === "string"); + }, + encode(message: PointsMultiplier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerPointsMultiplier !== "") { + writer.uint32(10).string(message.makerPointsMultiplier); + } + if (message.takerPointsMultiplier !== "") { + writer.uint32(18).string(message.takerPointsMultiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PointsMultiplier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePointsMultiplier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerPointsMultiplier = reader.string(); + break; + case 2: + message.takerPointsMultiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PointsMultiplier { + const message = createBasePointsMultiplier(); + message.makerPointsMultiplier = object.makerPointsMultiplier ?? ""; + message.takerPointsMultiplier = object.takerPointsMultiplier ?? ""; + return message; + }, + fromAmino(object: PointsMultiplierAmino): PointsMultiplier { + const message = createBasePointsMultiplier(); + if (object.maker_points_multiplier !== undefined && object.maker_points_multiplier !== null) { + message.makerPointsMultiplier = object.maker_points_multiplier; + } + if (object.taker_points_multiplier !== undefined && object.taker_points_multiplier !== null) { + message.takerPointsMultiplier = object.taker_points_multiplier; + } + return message; + }, + toAmino(message: PointsMultiplier): PointsMultiplierAmino { + const obj: any = {}; + obj.maker_points_multiplier = message.makerPointsMultiplier === "" ? undefined : message.makerPointsMultiplier; + obj.taker_points_multiplier = message.takerPointsMultiplier === "" ? undefined : message.takerPointsMultiplier; + return obj; + }, + fromAminoMsg(object: PointsMultiplierAminoMsg): PointsMultiplier { + return PointsMultiplier.fromAmino(object.value); + }, + fromProtoMsg(message: PointsMultiplierProtoMsg): PointsMultiplier { + return PointsMultiplier.decode(message.value); + }, + toProto(message: PointsMultiplier): Uint8Array { + return PointsMultiplier.encode(message).finish(); + }, + toProtoMsg(message: PointsMultiplier): PointsMultiplierProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier", + value: PointsMultiplier.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PointsMultiplier.typeUrl, PointsMultiplier); +function createBaseTradingRewardCampaignBoostInfo(): TradingRewardCampaignBoostInfo { + return { + boostedSpotMarketIds: [], + spotMarketMultipliers: [], + boostedDerivativeMarketIds: [], + derivativeMarketMultipliers: [] + }; +} +export const TradingRewardCampaignBoostInfo = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo", + is(o: any): o is TradingRewardCampaignBoostInfo { + return o && (o.$typeUrl === TradingRewardCampaignBoostInfo.typeUrl || Array.isArray(o.boostedSpotMarketIds) && (!o.boostedSpotMarketIds.length || typeof o.boostedSpotMarketIds[0] === "string") && Array.isArray(o.spotMarketMultipliers) && (!o.spotMarketMultipliers.length || PointsMultiplier.is(o.spotMarketMultipliers[0])) && Array.isArray(o.boostedDerivativeMarketIds) && (!o.boostedDerivativeMarketIds.length || typeof o.boostedDerivativeMarketIds[0] === "string") && Array.isArray(o.derivativeMarketMultipliers) && (!o.derivativeMarketMultipliers.length || PointsMultiplier.is(o.derivativeMarketMultipliers[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignBoostInfoAmino { + return o && (o.$typeUrl === TradingRewardCampaignBoostInfo.typeUrl || Array.isArray(o.boosted_spot_market_ids) && (!o.boosted_spot_market_ids.length || typeof o.boosted_spot_market_ids[0] === "string") && Array.isArray(o.spot_market_multipliers) && (!o.spot_market_multipliers.length || PointsMultiplier.isAmino(o.spot_market_multipliers[0])) && Array.isArray(o.boosted_derivative_market_ids) && (!o.boosted_derivative_market_ids.length || typeof o.boosted_derivative_market_ids[0] === "string") && Array.isArray(o.derivative_market_multipliers) && (!o.derivative_market_multipliers.length || PointsMultiplier.isAmino(o.derivative_market_multipliers[0]))); + }, + encode(message: TradingRewardCampaignBoostInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.boostedSpotMarketIds) { + writer.uint32(10).string(v!); + } + for (const v of message.spotMarketMultipliers) { + PointsMultiplier.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.boostedDerivativeMarketIds) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeMarketMultipliers) { + PointsMultiplier.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignBoostInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignBoostInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boostedSpotMarketIds.push(reader.string()); + break; + case 2: + message.spotMarketMultipliers.push(PointsMultiplier.decode(reader, reader.uint32())); + break; + case 3: + message.boostedDerivativeMarketIds.push(reader.string()); + break; + case 4: + message.derivativeMarketMultipliers.push(PointsMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignBoostInfo { + const message = createBaseTradingRewardCampaignBoostInfo(); + message.boostedSpotMarketIds = object.boostedSpotMarketIds?.map(e => e) || []; + message.spotMarketMultipliers = object.spotMarketMultipliers?.map(e => PointsMultiplier.fromPartial(e)) || []; + message.boostedDerivativeMarketIds = object.boostedDerivativeMarketIds?.map(e => e) || []; + message.derivativeMarketMultipliers = object.derivativeMarketMultipliers?.map(e => PointsMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignBoostInfoAmino): TradingRewardCampaignBoostInfo { + const message = createBaseTradingRewardCampaignBoostInfo(); + message.boostedSpotMarketIds = object.boosted_spot_market_ids?.map(e => e) || []; + message.spotMarketMultipliers = object.spot_market_multipliers?.map(e => PointsMultiplier.fromAmino(e)) || []; + message.boostedDerivativeMarketIds = object.boosted_derivative_market_ids?.map(e => e) || []; + message.derivativeMarketMultipliers = object.derivative_market_multipliers?.map(e => PointsMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignBoostInfo): TradingRewardCampaignBoostInfoAmino { + const obj: any = {}; + if (message.boostedSpotMarketIds) { + obj.boosted_spot_market_ids = message.boostedSpotMarketIds.map(e => e); + } else { + obj.boosted_spot_market_ids = message.boostedSpotMarketIds; + } + if (message.spotMarketMultipliers) { + obj.spot_market_multipliers = message.spotMarketMultipliers.map(e => e ? PointsMultiplier.toAmino(e) : undefined); + } else { + obj.spot_market_multipliers = message.spotMarketMultipliers; + } + if (message.boostedDerivativeMarketIds) { + obj.boosted_derivative_market_ids = message.boostedDerivativeMarketIds.map(e => e); + } else { + obj.boosted_derivative_market_ids = message.boostedDerivativeMarketIds; + } + if (message.derivativeMarketMultipliers) { + obj.derivative_market_multipliers = message.derivativeMarketMultipliers.map(e => e ? PointsMultiplier.toAmino(e) : undefined); + } else { + obj.derivative_market_multipliers = message.derivativeMarketMultipliers; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignBoostInfoAminoMsg): TradingRewardCampaignBoostInfo { + return TradingRewardCampaignBoostInfo.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignBoostInfoProtoMsg): TradingRewardCampaignBoostInfo { + return TradingRewardCampaignBoostInfo.decode(message.value); + }, + toProto(message: TradingRewardCampaignBoostInfo): Uint8Array { + return TradingRewardCampaignBoostInfo.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignBoostInfo): TradingRewardCampaignBoostInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo", + value: TradingRewardCampaignBoostInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignBoostInfo.typeUrl, TradingRewardCampaignBoostInfo); +function createBaseCampaignRewardPool(): CampaignRewardPool { + return { + startTimestamp: BigInt(0), + maxCampaignRewards: [] + }; +} +export const CampaignRewardPool = { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool", + is(o: any): o is CampaignRewardPool { + return o && (o.$typeUrl === CampaignRewardPool.typeUrl || typeof o.startTimestamp === "bigint" && Array.isArray(o.maxCampaignRewards) && (!o.maxCampaignRewards.length || Coin.is(o.maxCampaignRewards[0]))); + }, + isAmino(o: any): o is CampaignRewardPoolAmino { + return o && (o.$typeUrl === CampaignRewardPool.typeUrl || typeof o.start_timestamp === "bigint" && Array.isArray(o.max_campaign_rewards) && (!o.max_campaign_rewards.length || Coin.isAmino(o.max_campaign_rewards[0]))); + }, + encode(message: CampaignRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.startTimestamp); + } + for (const v of message.maxCampaignRewards) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CampaignRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCampaignRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimestamp = reader.int64(); + break; + case 2: + message.maxCampaignRewards.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CampaignRewardPool { + const message = createBaseCampaignRewardPool(); + message.startTimestamp = object.startTimestamp !== undefined && object.startTimestamp !== null ? BigInt(object.startTimestamp.toString()) : BigInt(0); + message.maxCampaignRewards = object.maxCampaignRewards?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CampaignRewardPoolAmino): CampaignRewardPool { + const message = createBaseCampaignRewardPool(); + if (object.start_timestamp !== undefined && object.start_timestamp !== null) { + message.startTimestamp = BigInt(object.start_timestamp); + } + message.maxCampaignRewards = object.max_campaign_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CampaignRewardPool): CampaignRewardPoolAmino { + const obj: any = {}; + obj.start_timestamp = message.startTimestamp !== BigInt(0) ? message.startTimestamp?.toString() : undefined; + if (message.maxCampaignRewards) { + obj.max_campaign_rewards = message.maxCampaignRewards.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.max_campaign_rewards = message.maxCampaignRewards; + } + return obj; + }, + fromAminoMsg(object: CampaignRewardPoolAminoMsg): CampaignRewardPool { + return CampaignRewardPool.fromAmino(object.value); + }, + fromProtoMsg(message: CampaignRewardPoolProtoMsg): CampaignRewardPool { + return CampaignRewardPool.decode(message.value); + }, + toProto(message: CampaignRewardPool): Uint8Array { + return CampaignRewardPool.encode(message).finish(); + }, + toProtoMsg(message: CampaignRewardPool): CampaignRewardPoolProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool", + value: CampaignRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CampaignRewardPool.typeUrl, CampaignRewardPool); +function createBaseTradingRewardCampaignInfo(): TradingRewardCampaignInfo { + return { + campaignDurationSeconds: BigInt(0), + quoteDenoms: [], + tradingRewardBoostInfo: undefined, + disqualifiedMarketIds: [] + }; +} +export const TradingRewardCampaignInfo = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo", + is(o: any): o is TradingRewardCampaignInfo { + return o && (o.$typeUrl === TradingRewardCampaignInfo.typeUrl || typeof o.campaignDurationSeconds === "bigint" && Array.isArray(o.quoteDenoms) && (!o.quoteDenoms.length || typeof o.quoteDenoms[0] === "string") && Array.isArray(o.disqualifiedMarketIds) && (!o.disqualifiedMarketIds.length || typeof o.disqualifiedMarketIds[0] === "string")); + }, + isAmino(o: any): o is TradingRewardCampaignInfoAmino { + return o && (o.$typeUrl === TradingRewardCampaignInfo.typeUrl || typeof o.campaign_duration_seconds === "bigint" && Array.isArray(o.quote_denoms) && (!o.quote_denoms.length || typeof o.quote_denoms[0] === "string") && Array.isArray(o.disqualified_market_ids) && (!o.disqualified_market_ids.length || typeof o.disqualified_market_ids[0] === "string")); + }, + encode(message: TradingRewardCampaignInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.campaignDurationSeconds !== BigInt(0)) { + writer.uint32(8).int64(message.campaignDurationSeconds); + } + for (const v of message.quoteDenoms) { + writer.uint32(18).string(v!); + } + if (message.tradingRewardBoostInfo !== undefined) { + TradingRewardCampaignBoostInfo.encode(message.tradingRewardBoostInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.disqualifiedMarketIds) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.campaignDurationSeconds = reader.int64(); + break; + case 2: + message.quoteDenoms.push(reader.string()); + break; + case 3: + message.tradingRewardBoostInfo = TradingRewardCampaignBoostInfo.decode(reader, reader.uint32()); + break; + case 4: + message.disqualifiedMarketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignInfo { + const message = createBaseTradingRewardCampaignInfo(); + message.campaignDurationSeconds = object.campaignDurationSeconds !== undefined && object.campaignDurationSeconds !== null ? BigInt(object.campaignDurationSeconds.toString()) : BigInt(0); + message.quoteDenoms = object.quoteDenoms?.map(e => e) || []; + message.tradingRewardBoostInfo = object.tradingRewardBoostInfo !== undefined && object.tradingRewardBoostInfo !== null ? TradingRewardCampaignBoostInfo.fromPartial(object.tradingRewardBoostInfo) : undefined; + message.disqualifiedMarketIds = object.disqualifiedMarketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignInfoAmino): TradingRewardCampaignInfo { + const message = createBaseTradingRewardCampaignInfo(); + if (object.campaign_duration_seconds !== undefined && object.campaign_duration_seconds !== null) { + message.campaignDurationSeconds = BigInt(object.campaign_duration_seconds); + } + message.quoteDenoms = object.quote_denoms?.map(e => e) || []; + if (object.trading_reward_boost_info !== undefined && object.trading_reward_boost_info !== null) { + message.tradingRewardBoostInfo = TradingRewardCampaignBoostInfo.fromAmino(object.trading_reward_boost_info); + } + message.disqualifiedMarketIds = object.disqualified_market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: TradingRewardCampaignInfo): TradingRewardCampaignInfoAmino { + const obj: any = {}; + obj.campaign_duration_seconds = message.campaignDurationSeconds !== BigInt(0) ? message.campaignDurationSeconds?.toString() : undefined; + if (message.quoteDenoms) { + obj.quote_denoms = message.quoteDenoms.map(e => e); + } else { + obj.quote_denoms = message.quoteDenoms; + } + obj.trading_reward_boost_info = message.tradingRewardBoostInfo ? TradingRewardCampaignBoostInfo.toAmino(message.tradingRewardBoostInfo) : undefined; + if (message.disqualifiedMarketIds) { + obj.disqualified_market_ids = message.disqualifiedMarketIds.map(e => e); + } else { + obj.disqualified_market_ids = message.disqualifiedMarketIds; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignInfoAminoMsg): TradingRewardCampaignInfo { + return TradingRewardCampaignInfo.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignInfoProtoMsg): TradingRewardCampaignInfo { + return TradingRewardCampaignInfo.decode(message.value); + }, + toProto(message: TradingRewardCampaignInfo): Uint8Array { + return TradingRewardCampaignInfo.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignInfo): TradingRewardCampaignInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo", + value: TradingRewardCampaignInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignInfo.typeUrl, TradingRewardCampaignInfo); +function createBaseFeeDiscountTierInfo(): FeeDiscountTierInfo { + return { + makerDiscountRate: "", + takerDiscountRate: "", + stakedAmount: "", + volume: "" + }; +} +export const FeeDiscountTierInfo = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo", + is(o: any): o is FeeDiscountTierInfo { + return o && (o.$typeUrl === FeeDiscountTierInfo.typeUrl || typeof o.makerDiscountRate === "string" && typeof o.takerDiscountRate === "string" && typeof o.stakedAmount === "string" && typeof o.volume === "string"); + }, + isAmino(o: any): o is FeeDiscountTierInfoAmino { + return o && (o.$typeUrl === FeeDiscountTierInfo.typeUrl || typeof o.maker_discount_rate === "string" && typeof o.taker_discount_rate === "string" && typeof o.staked_amount === "string" && typeof o.volume === "string"); + }, + encode(message: FeeDiscountTierInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerDiscountRate !== "") { + writer.uint32(10).string(message.makerDiscountRate); + } + if (message.takerDiscountRate !== "") { + writer.uint32(18).string(message.takerDiscountRate); + } + if (message.stakedAmount !== "") { + writer.uint32(26).string(message.stakedAmount); + } + if (message.volume !== "") { + writer.uint32(34).string(message.volume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountTierInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountTierInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerDiscountRate = reader.string(); + break; + case 2: + message.takerDiscountRate = reader.string(); + break; + case 3: + message.stakedAmount = reader.string(); + break; + case 4: + message.volume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountTierInfo { + const message = createBaseFeeDiscountTierInfo(); + message.makerDiscountRate = object.makerDiscountRate ?? ""; + message.takerDiscountRate = object.takerDiscountRate ?? ""; + message.stakedAmount = object.stakedAmount ?? ""; + message.volume = object.volume ?? ""; + return message; + }, + fromAmino(object: FeeDiscountTierInfoAmino): FeeDiscountTierInfo { + const message = createBaseFeeDiscountTierInfo(); + if (object.maker_discount_rate !== undefined && object.maker_discount_rate !== null) { + message.makerDiscountRate = object.maker_discount_rate; + } + if (object.taker_discount_rate !== undefined && object.taker_discount_rate !== null) { + message.takerDiscountRate = object.taker_discount_rate; + } + if (object.staked_amount !== undefined && object.staked_amount !== null) { + message.stakedAmount = object.staked_amount; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = object.volume; + } + return message; + }, + toAmino(message: FeeDiscountTierInfo): FeeDiscountTierInfoAmino { + const obj: any = {}; + obj.maker_discount_rate = message.makerDiscountRate === "" ? undefined : message.makerDiscountRate; + obj.taker_discount_rate = message.takerDiscountRate === "" ? undefined : message.takerDiscountRate; + obj.staked_amount = message.stakedAmount === "" ? undefined : message.stakedAmount; + obj.volume = message.volume === "" ? undefined : message.volume; + return obj; + }, + fromAminoMsg(object: FeeDiscountTierInfoAminoMsg): FeeDiscountTierInfo { + return FeeDiscountTierInfo.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountTierInfoProtoMsg): FeeDiscountTierInfo { + return FeeDiscountTierInfo.decode(message.value); + }, + toProto(message: FeeDiscountTierInfo): Uint8Array { + return FeeDiscountTierInfo.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountTierInfo): FeeDiscountTierInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo", + value: FeeDiscountTierInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountTierInfo.typeUrl, FeeDiscountTierInfo); +function createBaseFeeDiscountSchedule(): FeeDiscountSchedule { + return { + bucketCount: BigInt(0), + bucketDuration: BigInt(0), + quoteDenoms: [], + tierInfos: [], + disqualifiedMarketIds: [] + }; +} +export const FeeDiscountSchedule = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule", + is(o: any): o is FeeDiscountSchedule { + return o && (o.$typeUrl === FeeDiscountSchedule.typeUrl || typeof o.bucketCount === "bigint" && typeof o.bucketDuration === "bigint" && Array.isArray(o.quoteDenoms) && (!o.quoteDenoms.length || typeof o.quoteDenoms[0] === "string") && Array.isArray(o.tierInfos) && (!o.tierInfos.length || FeeDiscountTierInfo.is(o.tierInfos[0])) && Array.isArray(o.disqualifiedMarketIds) && (!o.disqualifiedMarketIds.length || typeof o.disqualifiedMarketIds[0] === "string")); + }, + isAmino(o: any): o is FeeDiscountScheduleAmino { + return o && (o.$typeUrl === FeeDiscountSchedule.typeUrl || typeof o.bucket_count === "bigint" && typeof o.bucket_duration === "bigint" && Array.isArray(o.quote_denoms) && (!o.quote_denoms.length || typeof o.quote_denoms[0] === "string") && Array.isArray(o.tier_infos) && (!o.tier_infos.length || FeeDiscountTierInfo.isAmino(o.tier_infos[0])) && Array.isArray(o.disqualified_market_ids) && (!o.disqualified_market_ids.length || typeof o.disqualified_market_ids[0] === "string")); + }, + encode(message: FeeDiscountSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bucketCount !== BigInt(0)) { + writer.uint32(8).uint64(message.bucketCount); + } + if (message.bucketDuration !== BigInt(0)) { + writer.uint32(16).int64(message.bucketDuration); + } + for (const v of message.quoteDenoms) { + writer.uint32(26).string(v!); + } + for (const v of message.tierInfos) { + FeeDiscountTierInfo.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.disqualifiedMarketIds) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketCount = reader.uint64(); + break; + case 2: + message.bucketDuration = reader.int64(); + break; + case 3: + message.quoteDenoms.push(reader.string()); + break; + case 4: + message.tierInfos.push(FeeDiscountTierInfo.decode(reader, reader.uint32())); + break; + case 5: + message.disqualifiedMarketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountSchedule { + const message = createBaseFeeDiscountSchedule(); + message.bucketCount = object.bucketCount !== undefined && object.bucketCount !== null ? BigInt(object.bucketCount.toString()) : BigInt(0); + message.bucketDuration = object.bucketDuration !== undefined && object.bucketDuration !== null ? BigInt(object.bucketDuration.toString()) : BigInt(0); + message.quoteDenoms = object.quoteDenoms?.map(e => e) || []; + message.tierInfos = object.tierInfos?.map(e => FeeDiscountTierInfo.fromPartial(e)) || []; + message.disqualifiedMarketIds = object.disqualifiedMarketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: FeeDiscountScheduleAmino): FeeDiscountSchedule { + const message = createBaseFeeDiscountSchedule(); + if (object.bucket_count !== undefined && object.bucket_count !== null) { + message.bucketCount = BigInt(object.bucket_count); + } + if (object.bucket_duration !== undefined && object.bucket_duration !== null) { + message.bucketDuration = BigInt(object.bucket_duration); + } + message.quoteDenoms = object.quote_denoms?.map(e => e) || []; + message.tierInfos = object.tier_infos?.map(e => FeeDiscountTierInfo.fromAmino(e)) || []; + message.disqualifiedMarketIds = object.disqualified_market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: FeeDiscountSchedule): FeeDiscountScheduleAmino { + const obj: any = {}; + obj.bucket_count = message.bucketCount !== BigInt(0) ? message.bucketCount?.toString() : undefined; + obj.bucket_duration = message.bucketDuration !== BigInt(0) ? message.bucketDuration?.toString() : undefined; + if (message.quoteDenoms) { + obj.quote_denoms = message.quoteDenoms.map(e => e); + } else { + obj.quote_denoms = message.quoteDenoms; + } + if (message.tierInfos) { + obj.tier_infos = message.tierInfos.map(e => e ? FeeDiscountTierInfo.toAmino(e) : undefined); + } else { + obj.tier_infos = message.tierInfos; + } + if (message.disqualifiedMarketIds) { + obj.disqualified_market_ids = message.disqualifiedMarketIds.map(e => e); + } else { + obj.disqualified_market_ids = message.disqualifiedMarketIds; + } + return obj; + }, + fromAminoMsg(object: FeeDiscountScheduleAminoMsg): FeeDiscountSchedule { + return FeeDiscountSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountScheduleProtoMsg): FeeDiscountSchedule { + return FeeDiscountSchedule.decode(message.value); + }, + toProto(message: FeeDiscountSchedule): Uint8Array { + return FeeDiscountSchedule.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountSchedule): FeeDiscountScheduleProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule", + value: FeeDiscountSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountSchedule.typeUrl, FeeDiscountSchedule); +function createBaseFeeDiscountTierTTL(): FeeDiscountTierTTL { + return { + tier: BigInt(0), + ttlTimestamp: BigInt(0) + }; +} +export const FeeDiscountTierTTL = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL", + is(o: any): o is FeeDiscountTierTTL { + return o && (o.$typeUrl === FeeDiscountTierTTL.typeUrl || typeof o.tier === "bigint" && typeof o.ttlTimestamp === "bigint"); + }, + isAmino(o: any): o is FeeDiscountTierTTLAmino { + return o && (o.$typeUrl === FeeDiscountTierTTL.typeUrl || typeof o.tier === "bigint" && typeof o.ttl_timestamp === "bigint"); + }, + encode(message: FeeDiscountTierTTL, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tier !== BigInt(0)) { + writer.uint32(8).uint64(message.tier); + } + if (message.ttlTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.ttlTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountTierTTL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountTierTTL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tier = reader.uint64(); + break; + case 2: + message.ttlTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountTierTTL { + const message = createBaseFeeDiscountTierTTL(); + message.tier = object.tier !== undefined && object.tier !== null ? BigInt(object.tier.toString()) : BigInt(0); + message.ttlTimestamp = object.ttlTimestamp !== undefined && object.ttlTimestamp !== null ? BigInt(object.ttlTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeeDiscountTierTTLAmino): FeeDiscountTierTTL { + const message = createBaseFeeDiscountTierTTL(); + if (object.tier !== undefined && object.tier !== null) { + message.tier = BigInt(object.tier); + } + if (object.ttl_timestamp !== undefined && object.ttl_timestamp !== null) { + message.ttlTimestamp = BigInt(object.ttl_timestamp); + } + return message; + }, + toAmino(message: FeeDiscountTierTTL): FeeDiscountTierTTLAmino { + const obj: any = {}; + obj.tier = message.tier !== BigInt(0) ? message.tier?.toString() : undefined; + obj.ttl_timestamp = message.ttlTimestamp !== BigInt(0) ? message.ttlTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountTierTTLAminoMsg): FeeDiscountTierTTL { + return FeeDiscountTierTTL.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountTierTTLProtoMsg): FeeDiscountTierTTL { + return FeeDiscountTierTTL.decode(message.value); + }, + toProto(message: FeeDiscountTierTTL): Uint8Array { + return FeeDiscountTierTTL.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountTierTTL): FeeDiscountTierTTLProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL", + value: FeeDiscountTierTTL.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountTierTTL.typeUrl, FeeDiscountTierTTL); +function createBaseVolumeRecord(): VolumeRecord { + return { + makerVolume: "", + takerVolume: "" + }; +} +export const VolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord", + is(o: any): o is VolumeRecord { + return o && (o.$typeUrl === VolumeRecord.typeUrl || typeof o.makerVolume === "string" && typeof o.takerVolume === "string"); + }, + isAmino(o: any): o is VolumeRecordAmino { + return o && (o.$typeUrl === VolumeRecord.typeUrl || typeof o.maker_volume === "string" && typeof o.taker_volume === "string"); + }, + encode(message: VolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerVolume !== "") { + writer.uint32(10).string(message.makerVolume); + } + if (message.takerVolume !== "") { + writer.uint32(18).string(message.takerVolume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerVolume = reader.string(); + break; + case 2: + message.takerVolume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VolumeRecord { + const message = createBaseVolumeRecord(); + message.makerVolume = object.makerVolume ?? ""; + message.takerVolume = object.takerVolume ?? ""; + return message; + }, + fromAmino(object: VolumeRecordAmino): VolumeRecord { + const message = createBaseVolumeRecord(); + if (object.maker_volume !== undefined && object.maker_volume !== null) { + message.makerVolume = object.maker_volume; + } + if (object.taker_volume !== undefined && object.taker_volume !== null) { + message.takerVolume = object.taker_volume; + } + return message; + }, + toAmino(message: VolumeRecord): VolumeRecordAmino { + const obj: any = {}; + obj.maker_volume = message.makerVolume === "" ? undefined : message.makerVolume; + obj.taker_volume = message.takerVolume === "" ? undefined : message.takerVolume; + return obj; + }, + fromAminoMsg(object: VolumeRecordAminoMsg): VolumeRecord { + return VolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: VolumeRecordProtoMsg): VolumeRecord { + return VolumeRecord.decode(message.value); + }, + toProto(message: VolumeRecord): Uint8Array { + return VolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: VolumeRecord): VolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord", + value: VolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VolumeRecord.typeUrl, VolumeRecord); +function createBaseAccountRewards(): AccountRewards { + return { + account: "", + rewards: [] + }; +} +export const AccountRewards = { + typeUrl: "/injective.exchange.v1beta1.AccountRewards", + is(o: any): o is AccountRewards { + return o && (o.$typeUrl === AccountRewards.typeUrl || typeof o.account === "string" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.is(o.rewards[0]))); + }, + isAmino(o: any): o is AccountRewardsAmino { + return o && (o.$typeUrl === AccountRewards.typeUrl || typeof o.account === "string" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.isAmino(o.rewards[0]))); + }, + encode(message: AccountRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.rewards) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.rewards.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccountRewards { + const message = createBaseAccountRewards(); + message.account = object.account ?? ""; + message.rewards = object.rewards?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AccountRewardsAmino): AccountRewards { + const message = createBaseAccountRewards(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.rewards = object.rewards?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: AccountRewards): AccountRewardsAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: AccountRewardsAminoMsg): AccountRewards { + return AccountRewards.fromAmino(object.value); + }, + fromProtoMsg(message: AccountRewardsProtoMsg): AccountRewards { + return AccountRewards.decode(message.value); + }, + toProto(message: AccountRewards): Uint8Array { + return AccountRewards.encode(message).finish(); + }, + toProtoMsg(message: AccountRewards): AccountRewardsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AccountRewards", + value: AccountRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccountRewards.typeUrl, AccountRewards); +function createBaseTradeRecords(): TradeRecords { + return { + marketId: "", + latestTradeRecords: [] + }; +} +export const TradeRecords = { + typeUrl: "/injective.exchange.v1beta1.TradeRecords", + is(o: any): o is TradeRecords { + return o && (o.$typeUrl === TradeRecords.typeUrl || typeof o.marketId === "string" && Array.isArray(o.latestTradeRecords) && (!o.latestTradeRecords.length || TradeRecord.is(o.latestTradeRecords[0]))); + }, + isAmino(o: any): o is TradeRecordsAmino { + return o && (o.$typeUrl === TradeRecords.typeUrl || typeof o.market_id === "string" && Array.isArray(o.latest_trade_records) && (!o.latest_trade_records.length || TradeRecord.isAmino(o.latest_trade_records[0]))); + }, + encode(message: TradeRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.latestTradeRecords) { + TradeRecord.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeRecords { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeRecords(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.latestTradeRecords.push(TradeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeRecords { + const message = createBaseTradeRecords(); + message.marketId = object.marketId ?? ""; + message.latestTradeRecords = object.latestTradeRecords?.map(e => TradeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradeRecordsAmino): TradeRecords { + const message = createBaseTradeRecords(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.latestTradeRecords = object.latest_trade_records?.map(e => TradeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradeRecords): TradeRecordsAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.latestTradeRecords) { + obj.latest_trade_records = message.latestTradeRecords.map(e => e ? TradeRecord.toAmino(e) : undefined); + } else { + obj.latest_trade_records = message.latestTradeRecords; + } + return obj; + }, + fromAminoMsg(object: TradeRecordsAminoMsg): TradeRecords { + return TradeRecords.fromAmino(object.value); + }, + fromProtoMsg(message: TradeRecordsProtoMsg): TradeRecords { + return TradeRecords.decode(message.value); + }, + toProto(message: TradeRecords): Uint8Array { + return TradeRecords.encode(message).finish(); + }, + toProtoMsg(message: TradeRecords): TradeRecordsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeRecords", + value: TradeRecords.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeRecords.typeUrl, TradeRecords); +function createBaseSubaccountIDs(): SubaccountIDs { + return { + subaccountIds: [] + }; +} +export const SubaccountIDs = { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs", + is(o: any): o is SubaccountIDs { + return o && (o.$typeUrl === SubaccountIDs.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || o.subaccountIds[0] instanceof Uint8Array || typeof o.subaccountIds[0] === "string")); + }, + isAmino(o: any): o is SubaccountIDsAmino { + return o && (o.$typeUrl === SubaccountIDs.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || o.subaccount_ids[0] instanceof Uint8Array || typeof o.subaccount_ids[0] === "string")); + }, + encode(message: SubaccountIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountIDs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountIDs { + const message = createBaseSubaccountIDs(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + return message; + }, + fromAmino(object: SubaccountIDsAmino): SubaccountIDs { + const message = createBaseSubaccountIDs(); + message.subaccountIds = object.subaccount_ids?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: SubaccountIDs): SubaccountIDsAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => base64FromBytes(e)); + } else { + obj.subaccount_ids = message.subaccountIds; + } + return obj; + }, + fromAminoMsg(object: SubaccountIDsAminoMsg): SubaccountIDs { + return SubaccountIDs.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountIDsProtoMsg): SubaccountIDs { + return SubaccountIDs.decode(message.value); + }, + toProto(message: SubaccountIDs): Uint8Array { + return SubaccountIDs.encode(message).finish(); + }, + toProtoMsg(message: SubaccountIDs): SubaccountIDsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs", + value: SubaccountIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountIDs.typeUrl, SubaccountIDs); +function createBaseTradeRecord(): TradeRecord { + return { + timestamp: BigInt(0), + price: "", + quantity: "" + }; +} +export const TradeRecord = { + typeUrl: "/injective.exchange.v1beta1.TradeRecord", + is(o: any): o is TradeRecord { + return o && (o.$typeUrl === TradeRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string" && typeof o.quantity === "string"); + }, + isAmino(o: any): o is TradeRecordAmino { + return o && (o.$typeUrl === TradeRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string" && typeof o.quantity === "string"); + }, + encode(message: TradeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).int64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(26).string(message.quantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.int64(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.quantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeRecord { + const message = createBaseTradeRecord(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + return message; + }, + fromAmino(object: TradeRecordAmino): TradeRecord { + const message = createBaseTradeRecord(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + return message; + }, + toAmino(message: TradeRecord): TradeRecordAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + return obj; + }, + fromAminoMsg(object: TradeRecordAminoMsg): TradeRecord { + return TradeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: TradeRecordProtoMsg): TradeRecord { + return TradeRecord.decode(message.value); + }, + toProto(message: TradeRecord): Uint8Array { + return TradeRecord.encode(message).finish(); + }, + toProtoMsg(message: TradeRecord): TradeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeRecord", + value: TradeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeRecord.typeUrl, TradeRecord); +function createBaseLevel(): Level { + return { + p: "", + q: "" + }; +} +export const Level = { + typeUrl: "/injective.exchange.v1beta1.Level", + is(o: any): o is Level { + return o && (o.$typeUrl === Level.typeUrl || typeof o.p === "string" && typeof o.q === "string"); + }, + isAmino(o: any): o is LevelAmino { + return o && (o.$typeUrl === Level.typeUrl || typeof o.p === "string" && typeof o.q === "string"); + }, + encode(message: Level, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.p !== "") { + writer.uint32(10).string(message.p); + } + if (message.q !== "") { + writer.uint32(18).string(message.q); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Level { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLevel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p = reader.string(); + break; + case 2: + message.q = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Level { + const message = createBaseLevel(); + message.p = object.p ?? ""; + message.q = object.q ?? ""; + return message; + }, + fromAmino(object: LevelAmino): Level { + const message = createBaseLevel(); + if (object.p !== undefined && object.p !== null) { + message.p = object.p; + } + if (object.q !== undefined && object.q !== null) { + message.q = object.q; + } + return message; + }, + toAmino(message: Level): LevelAmino { + const obj: any = {}; + obj.p = message.p === "" ? undefined : message.p; + obj.q = message.q === "" ? undefined : message.q; + return obj; + }, + fromAminoMsg(object: LevelAminoMsg): Level { + return Level.fromAmino(object.value); + }, + fromProtoMsg(message: LevelProtoMsg): Level { + return Level.decode(message.value); + }, + toProto(message: Level): Uint8Array { + return Level.encode(message).finish(); + }, + toProtoMsg(message: Level): LevelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Level", + value: Level.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Level.typeUrl, Level); +function createBaseAggregateSubaccountVolumeRecord(): AggregateSubaccountVolumeRecord { + return { + subaccountId: "", + marketVolumes: [] + }; +} +export const AggregateSubaccountVolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord", + is(o: any): o is AggregateSubaccountVolumeRecord { + return o && (o.$typeUrl === AggregateSubaccountVolumeRecord.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0]))); + }, + isAmino(o: any): o is AggregateSubaccountVolumeRecordAmino { + return o && (o.$typeUrl === AggregateSubaccountVolumeRecord.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0]))); + }, + encode(message: AggregateSubaccountVolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AggregateSubaccountVolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateSubaccountVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AggregateSubaccountVolumeRecord { + const message = createBaseAggregateSubaccountVolumeRecord(); + message.subaccountId = object.subaccountId ?? ""; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AggregateSubaccountVolumeRecordAmino): AggregateSubaccountVolumeRecord { + const message = createBaseAggregateSubaccountVolumeRecord(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: AggregateSubaccountVolumeRecord): AggregateSubaccountVolumeRecordAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + return obj; + }, + fromAminoMsg(object: AggregateSubaccountVolumeRecordAminoMsg): AggregateSubaccountVolumeRecord { + return AggregateSubaccountVolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateSubaccountVolumeRecordProtoMsg): AggregateSubaccountVolumeRecord { + return AggregateSubaccountVolumeRecord.decode(message.value); + }, + toProto(message: AggregateSubaccountVolumeRecord): Uint8Array { + return AggregateSubaccountVolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: AggregateSubaccountVolumeRecord): AggregateSubaccountVolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord", + value: AggregateSubaccountVolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AggregateSubaccountVolumeRecord.typeUrl, AggregateSubaccountVolumeRecord); +function createBaseAggregateAccountVolumeRecord(): AggregateAccountVolumeRecord { + return { + account: "", + marketVolumes: [] + }; +} +export const AggregateAccountVolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord", + is(o: any): o is AggregateAccountVolumeRecord { + return o && (o.$typeUrl === AggregateAccountVolumeRecord.typeUrl || typeof o.account === "string" && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0]))); + }, + isAmino(o: any): o is AggregateAccountVolumeRecordAmino { + return o && (o.$typeUrl === AggregateAccountVolumeRecord.typeUrl || typeof o.account === "string" && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0]))); + }, + encode(message: AggregateAccountVolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AggregateAccountVolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateAccountVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AggregateAccountVolumeRecord { + const message = createBaseAggregateAccountVolumeRecord(); + message.account = object.account ?? ""; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AggregateAccountVolumeRecordAmino): AggregateAccountVolumeRecord { + const message = createBaseAggregateAccountVolumeRecord(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: AggregateAccountVolumeRecord): AggregateAccountVolumeRecordAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + return obj; + }, + fromAminoMsg(object: AggregateAccountVolumeRecordAminoMsg): AggregateAccountVolumeRecord { + return AggregateAccountVolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateAccountVolumeRecordProtoMsg): AggregateAccountVolumeRecord { + return AggregateAccountVolumeRecord.decode(message.value); + }, + toProto(message: AggregateAccountVolumeRecord): Uint8Array { + return AggregateAccountVolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: AggregateAccountVolumeRecord): AggregateAccountVolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord", + value: AggregateAccountVolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AggregateAccountVolumeRecord.typeUrl, AggregateAccountVolumeRecord); +function createBaseMarketVolume(): MarketVolume { + return { + marketId: "", + volume: VolumeRecord.fromPartial({}) + }; +} +export const MarketVolume = { + typeUrl: "/injective.exchange.v1beta1.MarketVolume", + is(o: any): o is MarketVolume { + return o && (o.$typeUrl === MarketVolume.typeUrl || typeof o.marketId === "string" && VolumeRecord.is(o.volume)); + }, + isAmino(o: any): o is MarketVolumeAmino { + return o && (o.$typeUrl === MarketVolume.typeUrl || typeof o.market_id === "string" && VolumeRecord.isAmino(o.volume)); + }, + encode(message: MarketVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.volume !== undefined) { + VolumeRecord.encode(message.volume, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.volume = VolumeRecord.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketVolume { + const message = createBaseMarketVolume(); + message.marketId = object.marketId ?? ""; + message.volume = object.volume !== undefined && object.volume !== null ? VolumeRecord.fromPartial(object.volume) : undefined; + return message; + }, + fromAmino(object: MarketVolumeAmino): MarketVolume { + const message = createBaseMarketVolume(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = VolumeRecord.fromAmino(object.volume); + } + return message; + }, + toAmino(message: MarketVolume): MarketVolumeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.volume = message.volume ? VolumeRecord.toAmino(message.volume) : undefined; + return obj; + }, + fromAminoMsg(object: MarketVolumeAminoMsg): MarketVolume { + return MarketVolume.fromAmino(object.value); + }, + fromProtoMsg(message: MarketVolumeProtoMsg): MarketVolume { + return MarketVolume.decode(message.value); + }, + toProto(message: MarketVolume): Uint8Array { + return MarketVolume.encode(message).finish(); + }, + toProtoMsg(message: MarketVolume): MarketVolumeProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketVolume", + value: MarketVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketVolume.typeUrl, MarketVolume); +function createBaseDenomDecimals(): DenomDecimals { + return { + denom: "", + decimals: BigInt(0) + }; +} +export const DenomDecimals = { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals", + is(o: any): o is DenomDecimals { + return o && (o.$typeUrl === DenomDecimals.typeUrl || typeof o.denom === "string" && typeof o.decimals === "bigint"); + }, + isAmino(o: any): o is DenomDecimalsAmino { + return o && (o.$typeUrl === DenomDecimals.typeUrl || typeof o.denom === "string" && typeof o.decimals === "bigint"); + }, + encode(message: DenomDecimals, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(16).uint64(message.decimals); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomDecimals { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomDecimals(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.decimals = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomDecimals { + const message = createBaseDenomDecimals(); + message.denom = object.denom ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DenomDecimalsAmino): DenomDecimals { + const message = createBaseDenomDecimals(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + return message; + }, + toAmino(message: DenomDecimals): DenomDecimalsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: DenomDecimalsAminoMsg): DenomDecimals { + return DenomDecimals.fromAmino(object.value); + }, + fromProtoMsg(message: DenomDecimalsProtoMsg): DenomDecimals { + return DenomDecimals.decode(message.value); + }, + toProto(message: DenomDecimals): Uint8Array { + return DenomDecimals.encode(message).finish(); + }, + toProtoMsg(message: DenomDecimals): DenomDecimalsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals", + value: DenomDecimals.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomDecimals.typeUrl, DenomDecimals); +function createBaseGrantAuthorization(): GrantAuthorization { + return { + grantee: "", + amount: "" + }; +} +export const GrantAuthorization = { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization", + is(o: any): o is GrantAuthorization { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.grantee === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is GrantAuthorizationAmino { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.grantee === "string" && typeof o.amount === "string"); + }, + encode(message: GrantAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantAuthorization { + const message = createBaseGrantAuthorization(); + message.grantee = object.grantee ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + const message = createBaseGrantAuthorization(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: GrantAuthorization): GrantAuthorizationAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { + return GrantAuthorization.fromAmino(object.value); + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value); + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization", + value: GrantAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantAuthorization.typeUrl, GrantAuthorization); +function createBaseActiveGrant(): ActiveGrant { + return { + granter: "", + amount: "" + }; +} +export const ActiveGrant = { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant", + is(o: any): o is ActiveGrant { + return o && (o.$typeUrl === ActiveGrant.typeUrl || typeof o.granter === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is ActiveGrantAmino { + return o && (o.$typeUrl === ActiveGrant.typeUrl || typeof o.granter === "string" && typeof o.amount === "string"); + }, + encode(message: ActiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ActiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ActiveGrant { + const message = createBaseActiveGrant(); + message.granter = object.granter ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: ActiveGrantAmino): ActiveGrant { + const message = createBaseActiveGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: ActiveGrant): ActiveGrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: ActiveGrantAminoMsg): ActiveGrant { + return ActiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: ActiveGrantProtoMsg): ActiveGrant { + return ActiveGrant.decode(message.value); + }, + toProto(message: ActiveGrant): Uint8Array { + return ActiveGrant.encode(message).finish(); + }, + toProtoMsg(message: ActiveGrant): ActiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant", + value: ActiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ActiveGrant.typeUrl, ActiveGrant); +function createBaseEffectiveGrant(): EffectiveGrant { + return { + granter: "", + netGrantedStake: "", + isValid: false + }; +} +export const EffectiveGrant = { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant", + is(o: any): o is EffectiveGrant { + return o && (o.$typeUrl === EffectiveGrant.typeUrl || typeof o.granter === "string" && typeof o.netGrantedStake === "string" && typeof o.isValid === "boolean"); + }, + isAmino(o: any): o is EffectiveGrantAmino { + return o && (o.$typeUrl === EffectiveGrant.typeUrl || typeof o.granter === "string" && typeof o.net_granted_stake === "string" && typeof o.is_valid === "boolean"); + }, + encode(message: EffectiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.netGrantedStake !== "") { + writer.uint32(18).string(message.netGrantedStake); + } + if (message.isValid === true) { + writer.uint32(24).bool(message.isValid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EffectiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEffectiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.netGrantedStake = reader.string(); + break; + case 3: + message.isValid = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EffectiveGrant { + const message = createBaseEffectiveGrant(); + message.granter = object.granter ?? ""; + message.netGrantedStake = object.netGrantedStake ?? ""; + message.isValid = object.isValid ?? false; + return message; + }, + fromAmino(object: EffectiveGrantAmino): EffectiveGrant { + const message = createBaseEffectiveGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.net_granted_stake !== undefined && object.net_granted_stake !== null) { + message.netGrantedStake = object.net_granted_stake; + } + if (object.is_valid !== undefined && object.is_valid !== null) { + message.isValid = object.is_valid; + } + return message; + }, + toAmino(message: EffectiveGrant): EffectiveGrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.net_granted_stake = message.netGrantedStake === "" ? undefined : message.netGrantedStake; + obj.is_valid = message.isValid === false ? undefined : message.isValid; + return obj; + }, + fromAminoMsg(object: EffectiveGrantAminoMsg): EffectiveGrant { + return EffectiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: EffectiveGrantProtoMsg): EffectiveGrant { + return EffectiveGrant.decode(message.value); + }, + toProto(message: EffectiveGrant): Uint8Array { + return EffectiveGrant.encode(message).finish(); + }, + toProtoMsg(message: EffectiveGrant): EffectiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant", + value: EffectiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EffectiveGrant.typeUrl, EffectiveGrant); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/genesis.ts b/libs/injective-query/src/injective/exchange/v1beta1/genesis.ts new file mode 100644 index 00000000..9e4a2e86 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/genesis.ts @@ -0,0 +1,2460 @@ +import { Params, ParamsAmino, SpotMarket, SpotMarketAmino, DerivativeMarket, DerivativeMarketAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, DerivativeMarketSettlementInfo, DerivativeMarketSettlementInfoAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradeRecords, TradeRecordsAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, DenomDecimals, DenomDecimalsAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino, AggregateSubaccountVolumeRecord, AggregateSubaccountVolumeRecordAmino, MarketVolume, MarketVolumeAmino, FeeDiscountTierTTL, FeeDiscountTierTTLAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, DerivativeMarketOrder, DerivativeMarketOrderAmino, Deposit, DepositAmino, Position, PositionAmino, SubaccountTradeNonce, SubaccountTradeNonceAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, GrantAuthorization, GrantAuthorizationAmino, ActiveGrant, ActiveGrantAmino } from "./exchange"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the exchange module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to exchange. */ + params: Params; + /** spot_markets is an array containing the genesis trade pairs */ + spotMarkets: SpotMarket[]; + /** derivative_markets is an array containing the genesis derivative markets */ + derivativeMarkets: DerivativeMarket[]; + /** spot_orderbook defines the spot exchange limit orderbook active at genesis. */ + spotOrderbook: SpotOrderBook[]; + /** + * derivative_orderbook defines the derivative exchange limit orderbook active + * at genesis. + */ + derivativeOrderbook: DerivativeOrderBook[]; + /** balances defines the exchange users balances active at genesis. */ + balances: Balance[]; + /** positions defines the exchange derivative positions at genesis */ + positions: DerivativePosition[]; + /** + * subaccount_trade_nonces defines the subaccount trade nonces for the + * subaccounts at genesis + */ + subaccountTradeNonces: SubaccountNonce[]; + /** + * expiry_futures_market_info defines the market info for the expiry futures + * markets at genesis + */ + expiryFuturesMarketInfoState: ExpiryFuturesMarketInfoState[]; + /** + * perpetual_market_info defines the market info for the perpetual derivative + * markets at genesis + */ + perpetualMarketInfo: PerpetualMarketInfo[]; + /** + * perpetual_market_funding_state defines the funding state for the perpetual + * derivative markets at genesis + */ + perpetualMarketFundingState: PerpetualMarketFundingState[]; + derivativeMarketSettlementScheduled: DerivativeMarketSettlementInfo[]; + /** sets spot markets as enabled */ + isSpotExchangeEnabled: boolean; + /** sets derivative markets as enabled */ + isDerivativesExchangeEnabled: boolean; + /** the current trading reward campaign info */ + tradingRewardCampaignInfo?: TradingRewardCampaignInfo; + /** the current and upcoming trading reward campaign pools */ + tradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + tradingRewardCampaignAccountPoints: TradingRewardCampaignAccountPoints[]; + /** the fee discount schedule */ + feeDiscountSchedule?: FeeDiscountSchedule; + /** the cached fee discount account tiers with TTL */ + feeDiscountAccountTierTtl: FeeDiscountAccountTierTTL[]; + feeDiscountBucketVolumeAccounts: FeeDiscountBucketVolumeAccounts[]; + /** sets the first fee cycle as finished */ + isFirstFeeCycleFinished: boolean; + pendingTradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + pendingTradingRewardCampaignAccountPoints: TradingRewardCampaignAccountPendingPoints[]; + /** the addresses opting out of trading rewards */ + rewardsOptOutAddresses: string[]; + historicalTradeRecords: TradeRecords[]; + /** + * binary_options_markets is an array containing the genesis binary options + * markets + */ + binaryOptionsMarkets: BinaryOptionsMarket[]; + /** + * binary_options_markets_scheduled_for_settlement contains the marketIDs of + * binary options markets scheduled for next-block settlement + */ + binaryOptionsMarketIdsScheduledForSettlement: string[]; + /** + * spot_market_ids_scheduled_to_force_close defines the scheduled markets for + * forced closings at genesis + */ + spotMarketIdsScheduledToForceClose: string[]; + /** denom_decimals defines the denom decimals for the exchange. */ + denomDecimals: DenomDecimals[]; + conditionalDerivativeOrderbooks: ConditionalDerivativeOrderBook[]; + /** + * market_fee_multipliers contains any non-default atomic order fee + * multipliers + */ + marketFeeMultipliers: MarketFeeMultiplier[]; + orderbookSequences: OrderbookSequence[]; + subaccountVolumes: AggregateSubaccountVolumeRecord[]; + marketVolumes: MarketVolume[]; + grantAuthorizations: FullGrantAuthorizations[]; + activeGrants: FullActiveGrant[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the exchange module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to exchange. */ + params: ParamsAmino; + /** spot_markets is an array containing the genesis trade pairs */ + spot_markets: SpotMarketAmino[]; + /** derivative_markets is an array containing the genesis derivative markets */ + derivative_markets: DerivativeMarketAmino[]; + /** spot_orderbook defines the spot exchange limit orderbook active at genesis. */ + spot_orderbook: SpotOrderBookAmino[]; + /** + * derivative_orderbook defines the derivative exchange limit orderbook active + * at genesis. + */ + derivative_orderbook: DerivativeOrderBookAmino[]; + /** balances defines the exchange users balances active at genesis. */ + balances: BalanceAmino[]; + /** positions defines the exchange derivative positions at genesis */ + positions: DerivativePositionAmino[]; + /** + * subaccount_trade_nonces defines the subaccount trade nonces for the + * subaccounts at genesis + */ + subaccount_trade_nonces: SubaccountNonceAmino[]; + /** + * expiry_futures_market_info defines the market info for the expiry futures + * markets at genesis + */ + expiry_futures_market_info_state: ExpiryFuturesMarketInfoStateAmino[]; + /** + * perpetual_market_info defines the market info for the perpetual derivative + * markets at genesis + */ + perpetual_market_info: PerpetualMarketInfoAmino[]; + /** + * perpetual_market_funding_state defines the funding state for the perpetual + * derivative markets at genesis + */ + perpetual_market_funding_state: PerpetualMarketFundingStateAmino[]; + derivative_market_settlement_scheduled: DerivativeMarketSettlementInfoAmino[]; + /** sets spot markets as enabled */ + is_spot_exchange_enabled: boolean; + /** sets derivative markets as enabled */ + is_derivatives_exchange_enabled: boolean; + /** the current trading reward campaign info */ + trading_reward_campaign_info?: TradingRewardCampaignInfoAmino; + /** the current and upcoming trading reward campaign pools */ + trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + trading_reward_campaign_account_points: TradingRewardCampaignAccountPointsAmino[]; + /** the fee discount schedule */ + fee_discount_schedule?: FeeDiscountScheduleAmino; + /** the cached fee discount account tiers with TTL */ + fee_discount_account_tier_ttl: FeeDiscountAccountTierTTLAmino[]; + fee_discount_bucket_volume_accounts: FeeDiscountBucketVolumeAccountsAmino[]; + /** sets the first fee cycle as finished */ + is_first_fee_cycle_finished: boolean; + pending_trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + pending_trading_reward_campaign_account_points: TradingRewardCampaignAccountPendingPointsAmino[]; + /** the addresses opting out of trading rewards */ + rewards_opt_out_addresses: string[]; + historical_trade_records: TradeRecordsAmino[]; + /** + * binary_options_markets is an array containing the genesis binary options + * markets + */ + binary_options_markets: BinaryOptionsMarketAmino[]; + /** + * binary_options_markets_scheduled_for_settlement contains the marketIDs of + * binary options markets scheduled for next-block settlement + */ + binary_options_market_ids_scheduled_for_settlement: string[]; + /** + * spot_market_ids_scheduled_to_force_close defines the scheduled markets for + * forced closings at genesis + */ + spot_market_ids_scheduled_to_force_close: string[]; + /** denom_decimals defines the denom decimals for the exchange. */ + denom_decimals: DenomDecimalsAmino[]; + conditional_derivative_orderbooks: ConditionalDerivativeOrderBookAmino[]; + /** + * market_fee_multipliers contains any non-default atomic order fee + * multipliers + */ + market_fee_multipliers: MarketFeeMultiplierAmino[]; + orderbook_sequences: OrderbookSequenceAmino[]; + subaccount_volumes: AggregateSubaccountVolumeRecordAmino[]; + market_volumes: MarketVolumeAmino[]; + grant_authorizations: FullGrantAuthorizationsAmino[]; + active_grants: FullActiveGrantAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.exchange.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface OrderbookSequence { + sequence: bigint; + marketId: string; +} +export interface OrderbookSequenceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence"; + value: Uint8Array; +} +export interface OrderbookSequenceAmino { + sequence: string; + market_id: string; +} +export interface OrderbookSequenceAminoMsg { + type: "/injective.exchange.v1beta1.OrderbookSequence"; + value: OrderbookSequenceAmino; +} +export interface FeeDiscountAccountTierTTL { + account: string; + tierTtl?: FeeDiscountTierTTL; +} +export interface FeeDiscountAccountTierTTLProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL"; + value: Uint8Array; +} +export interface FeeDiscountAccountTierTTLAmino { + account: string; + tier_ttl?: FeeDiscountTierTTLAmino; +} +export interface FeeDiscountAccountTierTTLAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL"; + value: FeeDiscountAccountTierTTLAmino; +} +export interface FeeDiscountBucketVolumeAccounts { + bucketStartTimestamp: bigint; + accountVolume: AccountVolume[]; +} +export interface FeeDiscountBucketVolumeAccountsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts"; + value: Uint8Array; +} +export interface FeeDiscountBucketVolumeAccountsAmino { + bucket_start_timestamp: string; + account_volume: AccountVolumeAmino[]; +} +export interface FeeDiscountBucketVolumeAccountsAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts"; + value: FeeDiscountBucketVolumeAccountsAmino; +} +export interface AccountVolume { + account: string; + volume: string; +} +export interface AccountVolumeProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AccountVolume"; + value: Uint8Array; +} +export interface AccountVolumeAmino { + account: string; + volume: string; +} +export interface AccountVolumeAminoMsg { + type: "/injective.exchange.v1beta1.AccountVolume"; + value: AccountVolumeAmino; +} +export interface TradingRewardCampaignAccountPoints { + account: string; + points: string; +} +export interface TradingRewardCampaignAccountPointsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints"; + value: Uint8Array; +} +export interface TradingRewardCampaignAccountPointsAmino { + account: string; + points: string; +} +export interface TradingRewardCampaignAccountPointsAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints"; + value: TradingRewardCampaignAccountPointsAmino; +} +export interface TradingRewardCampaignAccountPendingPoints { + rewardPoolStartTimestamp: bigint; + accountPoints: TradingRewardCampaignAccountPoints[]; +} +export interface TradingRewardCampaignAccountPendingPointsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints"; + value: Uint8Array; +} +export interface TradingRewardCampaignAccountPendingPointsAmino { + reward_pool_start_timestamp: string; + account_points: TradingRewardCampaignAccountPointsAmino[]; +} +export interface TradingRewardCampaignAccountPendingPointsAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints"; + value: TradingRewardCampaignAccountPendingPointsAmino; +} +/** Spot Exchange Limit Orderbook */ +export interface SpotOrderBook { + marketId: string; + isBuySide: boolean; + orders: SpotLimitOrder[]; +} +export interface SpotOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook"; + value: Uint8Array; +} +/** Spot Exchange Limit Orderbook */ +export interface SpotOrderBookAmino { + market_id: string; + isBuySide: boolean; + orders: SpotLimitOrderAmino[]; +} +export interface SpotOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.SpotOrderBook"; + value: SpotOrderBookAmino; +} +/** Derivative Exchange Limit Orderbook */ +export interface DerivativeOrderBook { + marketId: string; + isBuySide: boolean; + orders: DerivativeLimitOrder[]; +} +export interface DerivativeOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook"; + value: Uint8Array; +} +/** Derivative Exchange Limit Orderbook */ +export interface DerivativeOrderBookAmino { + market_id: string; + isBuySide: boolean; + orders: DerivativeLimitOrderAmino[]; +} +export interface DerivativeOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeOrderBook"; + value: DerivativeOrderBookAmino; +} +/** Orderbook containing limit & market conditional orders */ +export interface ConditionalDerivativeOrderBook { + marketId: string; + limitBuyOrders: DerivativeLimitOrder[]; + marketBuyOrders: DerivativeMarketOrder[]; + limitSellOrders: DerivativeLimitOrder[]; + marketSellOrders: DerivativeMarketOrder[]; +} +export interface ConditionalDerivativeOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook"; + value: Uint8Array; +} +/** Orderbook containing limit & market conditional orders */ +export interface ConditionalDerivativeOrderBookAmino { + market_id: string; + limit_buy_orders: DerivativeLimitOrderAmino[]; + market_buy_orders: DerivativeMarketOrderAmino[]; + limit_sell_orders: DerivativeLimitOrderAmino[]; + market_sell_orders: DerivativeMarketOrderAmino[]; +} +export interface ConditionalDerivativeOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook"; + value: ConditionalDerivativeOrderBookAmino; +} +export interface Balance { + subaccountId: string; + denom: string; + deposits?: Deposit; +} +export interface BalanceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Balance"; + value: Uint8Array; +} +export interface BalanceAmino { + subaccount_id: string; + denom: string; + deposits?: DepositAmino; +} +export interface BalanceAminoMsg { + type: "/injective.exchange.v1beta1.Balance"; + value: BalanceAmino; +} +export interface DerivativePosition { + subaccountId: string; + marketId: string; + position?: Position; +} +export interface DerivativePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition"; + value: Uint8Array; +} +export interface DerivativePositionAmino { + subaccount_id: string; + market_id: string; + position?: PositionAmino; +} +export interface DerivativePositionAminoMsg { + type: "/injective.exchange.v1beta1.DerivativePosition"; + value: DerivativePositionAmino; +} +export interface SubaccountNonce { + subaccountId: string; + subaccountTradeNonce: SubaccountTradeNonce; +} +export interface SubaccountNonceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce"; + value: Uint8Array; +} +export interface SubaccountNonceAmino { + subaccount_id: string; + subaccount_trade_nonce: SubaccountTradeNonceAmino; +} +export interface SubaccountNonceAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountNonce"; + value: SubaccountNonceAmino; +} +export interface ExpiryFuturesMarketInfoState { + marketId: string; + marketInfo?: ExpiryFuturesMarketInfo; +} +export interface ExpiryFuturesMarketInfoStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState"; + value: Uint8Array; +} +export interface ExpiryFuturesMarketInfoStateAmino { + market_id: string; + market_info?: ExpiryFuturesMarketInfoAmino; +} +export interface ExpiryFuturesMarketInfoStateAminoMsg { + type: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState"; + value: ExpiryFuturesMarketInfoStateAmino; +} +export interface PerpetualMarketFundingState { + marketId: string; + funding?: PerpetualMarketFunding; +} +export interface PerpetualMarketFundingStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState"; + value: Uint8Array; +} +export interface PerpetualMarketFundingStateAmino { + market_id: string; + funding?: PerpetualMarketFundingAmino; +} +export interface PerpetualMarketFundingStateAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketFundingState"; + value: PerpetualMarketFundingStateAmino; +} +export interface FullGrantAuthorizations { + granter: string; + totalGrantAmount: string; + lastDelegationsCheckedTime: bigint; + grants: GrantAuthorization[]; +} +export interface FullGrantAuthorizationsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations"; + value: Uint8Array; +} +export interface FullGrantAuthorizationsAmino { + granter: string; + total_grant_amount: string; + last_delegations_checked_time: string; + grants: GrantAuthorizationAmino[]; +} +export interface FullGrantAuthorizationsAminoMsg { + type: "/injective.exchange.v1beta1.FullGrantAuthorizations"; + value: FullGrantAuthorizationsAmino; +} +export interface FullActiveGrant { + grantee: string; + activeGrant?: ActiveGrant; +} +export interface FullActiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant"; + value: Uint8Array; +} +export interface FullActiveGrantAmino { + grantee: string; + active_grant?: ActiveGrantAmino; +} +export interface FullActiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.FullActiveGrant"; + value: FullActiveGrantAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + spotMarkets: [], + derivativeMarkets: [], + spotOrderbook: [], + derivativeOrderbook: [], + balances: [], + positions: [], + subaccountTradeNonces: [], + expiryFuturesMarketInfoState: [], + perpetualMarketInfo: [], + perpetualMarketFundingState: [], + derivativeMarketSettlementScheduled: [], + isSpotExchangeEnabled: false, + isDerivativesExchangeEnabled: false, + tradingRewardCampaignInfo: undefined, + tradingRewardPoolCampaignSchedule: [], + tradingRewardCampaignAccountPoints: [], + feeDiscountSchedule: undefined, + feeDiscountAccountTierTtl: [], + feeDiscountBucketVolumeAccounts: [], + isFirstFeeCycleFinished: false, + pendingTradingRewardPoolCampaignSchedule: [], + pendingTradingRewardCampaignAccountPoints: [], + rewardsOptOutAddresses: [], + historicalTradeRecords: [], + binaryOptionsMarkets: [], + binaryOptionsMarketIdsScheduledForSettlement: [], + spotMarketIdsScheduledToForceClose: [], + denomDecimals: [], + conditionalDerivativeOrderbooks: [], + marketFeeMultipliers: [], + orderbookSequences: [], + subaccountVolumes: [], + marketVolumes: [], + grantAuthorizations: [], + activeGrants: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.exchange.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.spotMarkets) && (!o.spotMarkets.length || SpotMarket.is(o.spotMarkets[0])) && Array.isArray(o.derivativeMarkets) && (!o.derivativeMarkets.length || DerivativeMarket.is(o.derivativeMarkets[0])) && Array.isArray(o.spotOrderbook) && (!o.spotOrderbook.length || SpotOrderBook.is(o.spotOrderbook[0])) && Array.isArray(o.derivativeOrderbook) && (!o.derivativeOrderbook.length || DerivativeOrderBook.is(o.derivativeOrderbook[0])) && Array.isArray(o.balances) && (!o.balances.length || Balance.is(o.balances[0])) && Array.isArray(o.positions) && (!o.positions.length || DerivativePosition.is(o.positions[0])) && Array.isArray(o.subaccountTradeNonces) && (!o.subaccountTradeNonces.length || SubaccountNonce.is(o.subaccountTradeNonces[0])) && Array.isArray(o.expiryFuturesMarketInfoState) && (!o.expiryFuturesMarketInfoState.length || ExpiryFuturesMarketInfoState.is(o.expiryFuturesMarketInfoState[0])) && Array.isArray(o.perpetualMarketInfo) && (!o.perpetualMarketInfo.length || PerpetualMarketInfo.is(o.perpetualMarketInfo[0])) && Array.isArray(o.perpetualMarketFundingState) && (!o.perpetualMarketFundingState.length || PerpetualMarketFundingState.is(o.perpetualMarketFundingState[0])) && Array.isArray(o.derivativeMarketSettlementScheduled) && (!o.derivativeMarketSettlementScheduled.length || DerivativeMarketSettlementInfo.is(o.derivativeMarketSettlementScheduled[0])) && typeof o.isSpotExchangeEnabled === "boolean" && typeof o.isDerivativesExchangeEnabled === "boolean" && Array.isArray(o.tradingRewardPoolCampaignSchedule) && (!o.tradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.tradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.tradingRewardCampaignAccountPoints) && (!o.tradingRewardCampaignAccountPoints.length || TradingRewardCampaignAccountPoints.is(o.tradingRewardCampaignAccountPoints[0])) && Array.isArray(o.feeDiscountAccountTierTtl) && (!o.feeDiscountAccountTierTtl.length || FeeDiscountAccountTierTTL.is(o.feeDiscountAccountTierTtl[0])) && Array.isArray(o.feeDiscountBucketVolumeAccounts) && (!o.feeDiscountBucketVolumeAccounts.length || FeeDiscountBucketVolumeAccounts.is(o.feeDiscountBucketVolumeAccounts[0])) && typeof o.isFirstFeeCycleFinished === "boolean" && Array.isArray(o.pendingTradingRewardPoolCampaignSchedule) && (!o.pendingTradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.pendingTradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.pendingTradingRewardCampaignAccountPoints) && (!o.pendingTradingRewardCampaignAccountPoints.length || TradingRewardCampaignAccountPendingPoints.is(o.pendingTradingRewardCampaignAccountPoints[0])) && Array.isArray(o.rewardsOptOutAddresses) && (!o.rewardsOptOutAddresses.length || typeof o.rewardsOptOutAddresses[0] === "string") && Array.isArray(o.historicalTradeRecords) && (!o.historicalTradeRecords.length || TradeRecords.is(o.historicalTradeRecords[0])) && Array.isArray(o.binaryOptionsMarkets) && (!o.binaryOptionsMarkets.length || BinaryOptionsMarket.is(o.binaryOptionsMarkets[0])) && Array.isArray(o.binaryOptionsMarketIdsScheduledForSettlement) && (!o.binaryOptionsMarketIdsScheduledForSettlement.length || typeof o.binaryOptionsMarketIdsScheduledForSettlement[0] === "string") && Array.isArray(o.spotMarketIdsScheduledToForceClose) && (!o.spotMarketIdsScheduledToForceClose.length || typeof o.spotMarketIdsScheduledToForceClose[0] === "string") && Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0])) && Array.isArray(o.conditionalDerivativeOrderbooks) && (!o.conditionalDerivativeOrderbooks.length || ConditionalDerivativeOrderBook.is(o.conditionalDerivativeOrderbooks[0])) && Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0])) && Array.isArray(o.orderbookSequences) && (!o.orderbookSequences.length || OrderbookSequence.is(o.orderbookSequences[0])) && Array.isArray(o.subaccountVolumes) && (!o.subaccountVolumes.length || AggregateSubaccountVolumeRecord.is(o.subaccountVolumes[0])) && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0])) && Array.isArray(o.grantAuthorizations) && (!o.grantAuthorizations.length || FullGrantAuthorizations.is(o.grantAuthorizations[0])) && Array.isArray(o.activeGrants) && (!o.activeGrants.length || FullActiveGrant.is(o.activeGrants[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.spot_markets) && (!o.spot_markets.length || SpotMarket.isAmino(o.spot_markets[0])) && Array.isArray(o.derivative_markets) && (!o.derivative_markets.length || DerivativeMarket.isAmino(o.derivative_markets[0])) && Array.isArray(o.spot_orderbook) && (!o.spot_orderbook.length || SpotOrderBook.isAmino(o.spot_orderbook[0])) && Array.isArray(o.derivative_orderbook) && (!o.derivative_orderbook.length || DerivativeOrderBook.isAmino(o.derivative_orderbook[0])) && Array.isArray(o.balances) && (!o.balances.length || Balance.isAmino(o.balances[0])) && Array.isArray(o.positions) && (!o.positions.length || DerivativePosition.isAmino(o.positions[0])) && Array.isArray(o.subaccount_trade_nonces) && (!o.subaccount_trade_nonces.length || SubaccountNonce.isAmino(o.subaccount_trade_nonces[0])) && Array.isArray(o.expiry_futures_market_info_state) && (!o.expiry_futures_market_info_state.length || ExpiryFuturesMarketInfoState.isAmino(o.expiry_futures_market_info_state[0])) && Array.isArray(o.perpetual_market_info) && (!o.perpetual_market_info.length || PerpetualMarketInfo.isAmino(o.perpetual_market_info[0])) && Array.isArray(o.perpetual_market_funding_state) && (!o.perpetual_market_funding_state.length || PerpetualMarketFundingState.isAmino(o.perpetual_market_funding_state[0])) && Array.isArray(o.derivative_market_settlement_scheduled) && (!o.derivative_market_settlement_scheduled.length || DerivativeMarketSettlementInfo.isAmino(o.derivative_market_settlement_scheduled[0])) && typeof o.is_spot_exchange_enabled === "boolean" && typeof o.is_derivatives_exchange_enabled === "boolean" && Array.isArray(o.trading_reward_pool_campaign_schedule) && (!o.trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.trading_reward_campaign_account_points) && (!o.trading_reward_campaign_account_points.length || TradingRewardCampaignAccountPoints.isAmino(o.trading_reward_campaign_account_points[0])) && Array.isArray(o.fee_discount_account_tier_ttl) && (!o.fee_discount_account_tier_ttl.length || FeeDiscountAccountTierTTL.isAmino(o.fee_discount_account_tier_ttl[0])) && Array.isArray(o.fee_discount_bucket_volume_accounts) && (!o.fee_discount_bucket_volume_accounts.length || FeeDiscountBucketVolumeAccounts.isAmino(o.fee_discount_bucket_volume_accounts[0])) && typeof o.is_first_fee_cycle_finished === "boolean" && Array.isArray(o.pending_trading_reward_pool_campaign_schedule) && (!o.pending_trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.pending_trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.pending_trading_reward_campaign_account_points) && (!o.pending_trading_reward_campaign_account_points.length || TradingRewardCampaignAccountPendingPoints.isAmino(o.pending_trading_reward_campaign_account_points[0])) && Array.isArray(o.rewards_opt_out_addresses) && (!o.rewards_opt_out_addresses.length || typeof o.rewards_opt_out_addresses[0] === "string") && Array.isArray(o.historical_trade_records) && (!o.historical_trade_records.length || TradeRecords.isAmino(o.historical_trade_records[0])) && Array.isArray(o.binary_options_markets) && (!o.binary_options_markets.length || BinaryOptionsMarket.isAmino(o.binary_options_markets[0])) && Array.isArray(o.binary_options_market_ids_scheduled_for_settlement) && (!o.binary_options_market_ids_scheduled_for_settlement.length || typeof o.binary_options_market_ids_scheduled_for_settlement[0] === "string") && Array.isArray(o.spot_market_ids_scheduled_to_force_close) && (!o.spot_market_ids_scheduled_to_force_close.length || typeof o.spot_market_ids_scheduled_to_force_close[0] === "string") && Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0])) && Array.isArray(o.conditional_derivative_orderbooks) && (!o.conditional_derivative_orderbooks.length || ConditionalDerivativeOrderBook.isAmino(o.conditional_derivative_orderbooks[0])) && Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0])) && Array.isArray(o.orderbook_sequences) && (!o.orderbook_sequences.length || OrderbookSequence.isAmino(o.orderbook_sequences[0])) && Array.isArray(o.subaccount_volumes) && (!o.subaccount_volumes.length || AggregateSubaccountVolumeRecord.isAmino(o.subaccount_volumes[0])) && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0])) && Array.isArray(o.grant_authorizations) && (!o.grant_authorizations.length || FullGrantAuthorizations.isAmino(o.grant_authorizations[0])) && Array.isArray(o.active_grants) && (!o.active_grants.length || FullActiveGrant.isAmino(o.active_grants[0]))); + }, + 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.spotMarkets) { + SpotMarket.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.derivativeMarkets) { + DerivativeMarket.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.spotOrderbook) { + SpotOrderBook.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.derivativeOrderbook) { + DerivativeOrderBook.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.positions) { + DerivativePosition.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.subaccountTradeNonces) { + SubaccountNonce.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.expiryFuturesMarketInfoState) { + ExpiryFuturesMarketInfoState.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.perpetualMarketInfo) { + PerpetualMarketInfo.encode(v!, writer.uint32(82).fork()).ldelim(); + } + for (const v of message.perpetualMarketFundingState) { + PerpetualMarketFundingState.encode(v!, writer.uint32(90).fork()).ldelim(); + } + for (const v of message.derivativeMarketSettlementScheduled) { + DerivativeMarketSettlementInfo.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.isSpotExchangeEnabled === true) { + writer.uint32(104).bool(message.isSpotExchangeEnabled); + } + if (message.isDerivativesExchangeEnabled === true) { + writer.uint32(112).bool(message.isDerivativesExchangeEnabled); + } + if (message.tradingRewardCampaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.tradingRewardCampaignInfo, writer.uint32(122).fork()).ldelim(); + } + for (const v of message.tradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(130).fork()).ldelim(); + } + for (const v of message.tradingRewardCampaignAccountPoints) { + TradingRewardCampaignAccountPoints.encode(v!, writer.uint32(138).fork()).ldelim(); + } + if (message.feeDiscountSchedule !== undefined) { + FeeDiscountSchedule.encode(message.feeDiscountSchedule, writer.uint32(146).fork()).ldelim(); + } + for (const v of message.feeDiscountAccountTierTtl) { + FeeDiscountAccountTierTTL.encode(v!, writer.uint32(154).fork()).ldelim(); + } + for (const v of message.feeDiscountBucketVolumeAccounts) { + FeeDiscountBucketVolumeAccounts.encode(v!, writer.uint32(162).fork()).ldelim(); + } + if (message.isFirstFeeCycleFinished === true) { + writer.uint32(168).bool(message.isFirstFeeCycleFinished); + } + for (const v of message.pendingTradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(178).fork()).ldelim(); + } + for (const v of message.pendingTradingRewardCampaignAccountPoints) { + TradingRewardCampaignAccountPendingPoints.encode(v!, writer.uint32(186).fork()).ldelim(); + } + for (const v of message.rewardsOptOutAddresses) { + writer.uint32(194).string(v!); + } + for (const v of message.historicalTradeRecords) { + TradeRecords.encode(v!, writer.uint32(202).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarkets) { + BinaryOptionsMarket.encode(v!, writer.uint32(210).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketIdsScheduledForSettlement) { + writer.uint32(218).string(v!); + } + for (const v of message.spotMarketIdsScheduledToForceClose) { + writer.uint32(226).string(v!); + } + for (const v of message.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(234).fork()).ldelim(); + } + for (const v of message.conditionalDerivativeOrderbooks) { + ConditionalDerivativeOrderBook.encode(v!, writer.uint32(242).fork()).ldelim(); + } + for (const v of message.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(250).fork()).ldelim(); + } + for (const v of message.orderbookSequences) { + OrderbookSequence.encode(v!, writer.uint32(258).fork()).ldelim(); + } + for (const v of message.subaccountVolumes) { + AggregateSubaccountVolumeRecord.encode(v!, writer.uint32(266).fork()).ldelim(); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(274).fork()).ldelim(); + } + for (const v of message.grantAuthorizations) { + FullGrantAuthorizations.encode(v!, writer.uint32(282).fork()).ldelim(); + } + for (const v of message.activeGrants) { + FullActiveGrant.encode(v!, writer.uint32(290).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.spotMarkets.push(SpotMarket.decode(reader, reader.uint32())); + break; + case 3: + message.derivativeMarkets.push(DerivativeMarket.decode(reader, reader.uint32())); + break; + case 4: + message.spotOrderbook.push(SpotOrderBook.decode(reader, reader.uint32())); + break; + case 5: + message.derivativeOrderbook.push(DerivativeOrderBook.decode(reader, reader.uint32())); + break; + case 6: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + case 7: + message.positions.push(DerivativePosition.decode(reader, reader.uint32())); + break; + case 8: + message.subaccountTradeNonces.push(SubaccountNonce.decode(reader, reader.uint32())); + break; + case 9: + message.expiryFuturesMarketInfoState.push(ExpiryFuturesMarketInfoState.decode(reader, reader.uint32())); + break; + case 10: + message.perpetualMarketInfo.push(PerpetualMarketInfo.decode(reader, reader.uint32())); + break; + case 11: + message.perpetualMarketFundingState.push(PerpetualMarketFundingState.decode(reader, reader.uint32())); + break; + case 12: + message.derivativeMarketSettlementScheduled.push(DerivativeMarketSettlementInfo.decode(reader, reader.uint32())); + break; + case 13: + message.isSpotExchangeEnabled = reader.bool(); + break; + case 14: + message.isDerivativesExchangeEnabled = reader.bool(); + break; + case 15: + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 16: + message.tradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 17: + message.tradingRewardCampaignAccountPoints.push(TradingRewardCampaignAccountPoints.decode(reader, reader.uint32())); + break; + case 18: + message.feeDiscountSchedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + case 19: + message.feeDiscountAccountTierTtl.push(FeeDiscountAccountTierTTL.decode(reader, reader.uint32())); + break; + case 20: + message.feeDiscountBucketVolumeAccounts.push(FeeDiscountBucketVolumeAccounts.decode(reader, reader.uint32())); + break; + case 21: + message.isFirstFeeCycleFinished = reader.bool(); + break; + case 22: + message.pendingTradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 23: + message.pendingTradingRewardCampaignAccountPoints.push(TradingRewardCampaignAccountPendingPoints.decode(reader, reader.uint32())); + break; + case 24: + message.rewardsOptOutAddresses.push(reader.string()); + break; + case 25: + message.historicalTradeRecords.push(TradeRecords.decode(reader, reader.uint32())); + break; + case 26: + message.binaryOptionsMarkets.push(BinaryOptionsMarket.decode(reader, reader.uint32())); + break; + case 27: + message.binaryOptionsMarketIdsScheduledForSettlement.push(reader.string()); + break; + case 28: + message.spotMarketIdsScheduledToForceClose.push(reader.string()); + break; + case 29: + message.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + case 30: + message.conditionalDerivativeOrderbooks.push(ConditionalDerivativeOrderBook.decode(reader, reader.uint32())); + break; + case 31: + message.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + case 32: + message.orderbookSequences.push(OrderbookSequence.decode(reader, reader.uint32())); + break; + case 33: + message.subaccountVolumes.push(AggregateSubaccountVolumeRecord.decode(reader, reader.uint32())); + break; + case 34: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + case 35: + message.grantAuthorizations.push(FullGrantAuthorizations.decode(reader, reader.uint32())); + break; + case 36: + message.activeGrants.push(FullActiveGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.spotMarkets = object.spotMarkets?.map(e => SpotMarket.fromPartial(e)) || []; + message.derivativeMarkets = object.derivativeMarkets?.map(e => DerivativeMarket.fromPartial(e)) || []; + message.spotOrderbook = object.spotOrderbook?.map(e => SpotOrderBook.fromPartial(e)) || []; + message.derivativeOrderbook = object.derivativeOrderbook?.map(e => DerivativeOrderBook.fromPartial(e)) || []; + message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; + message.positions = object.positions?.map(e => DerivativePosition.fromPartial(e)) || []; + message.subaccountTradeNonces = object.subaccountTradeNonces?.map(e => SubaccountNonce.fromPartial(e)) || []; + message.expiryFuturesMarketInfoState = object.expiryFuturesMarketInfoState?.map(e => ExpiryFuturesMarketInfoState.fromPartial(e)) || []; + message.perpetualMarketInfo = object.perpetualMarketInfo?.map(e => PerpetualMarketInfo.fromPartial(e)) || []; + message.perpetualMarketFundingState = object.perpetualMarketFundingState?.map(e => PerpetualMarketFundingState.fromPartial(e)) || []; + message.derivativeMarketSettlementScheduled = object.derivativeMarketSettlementScheduled?.map(e => DerivativeMarketSettlementInfo.fromPartial(e)) || []; + message.isSpotExchangeEnabled = object.isSpotExchangeEnabled ?? false; + message.isDerivativesExchangeEnabled = object.isDerivativesExchangeEnabled ?? false; + message.tradingRewardCampaignInfo = object.tradingRewardCampaignInfo !== undefined && object.tradingRewardCampaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.tradingRewardCampaignInfo) : undefined; + message.tradingRewardPoolCampaignSchedule = object.tradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.tradingRewardCampaignAccountPoints = object.tradingRewardCampaignAccountPoints?.map(e => TradingRewardCampaignAccountPoints.fromPartial(e)) || []; + message.feeDiscountSchedule = object.feeDiscountSchedule !== undefined && object.feeDiscountSchedule !== null ? FeeDiscountSchedule.fromPartial(object.feeDiscountSchedule) : undefined; + message.feeDiscountAccountTierTtl = object.feeDiscountAccountTierTtl?.map(e => FeeDiscountAccountTierTTL.fromPartial(e)) || []; + message.feeDiscountBucketVolumeAccounts = object.feeDiscountBucketVolumeAccounts?.map(e => FeeDiscountBucketVolumeAccounts.fromPartial(e)) || []; + message.isFirstFeeCycleFinished = object.isFirstFeeCycleFinished ?? false; + message.pendingTradingRewardPoolCampaignSchedule = object.pendingTradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.pendingTradingRewardCampaignAccountPoints = object.pendingTradingRewardCampaignAccountPoints?.map(e => TradingRewardCampaignAccountPendingPoints.fromPartial(e)) || []; + message.rewardsOptOutAddresses = object.rewardsOptOutAddresses?.map(e => e) || []; + message.historicalTradeRecords = object.historicalTradeRecords?.map(e => TradeRecords.fromPartial(e)) || []; + message.binaryOptionsMarkets = object.binaryOptionsMarkets?.map(e => BinaryOptionsMarket.fromPartial(e)) || []; + message.binaryOptionsMarketIdsScheduledForSettlement = object.binaryOptionsMarketIdsScheduledForSettlement?.map(e => e) || []; + message.spotMarketIdsScheduledToForceClose = object.spotMarketIdsScheduledToForceClose?.map(e => e) || []; + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + message.conditionalDerivativeOrderbooks = object.conditionalDerivativeOrderbooks?.map(e => ConditionalDerivativeOrderBook.fromPartial(e)) || []; + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + message.orderbookSequences = object.orderbookSequences?.map(e => OrderbookSequence.fromPartial(e)) || []; + message.subaccountVolumes = object.subaccountVolumes?.map(e => AggregateSubaccountVolumeRecord.fromPartial(e)) || []; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + message.grantAuthorizations = object.grantAuthorizations?.map(e => FullGrantAuthorizations.fromPartial(e)) || []; + message.activeGrants = object.activeGrants?.map(e => FullActiveGrant.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.spotMarkets = object.spot_markets?.map(e => SpotMarket.fromAmino(e)) || []; + message.derivativeMarkets = object.derivative_markets?.map(e => DerivativeMarket.fromAmino(e)) || []; + message.spotOrderbook = object.spot_orderbook?.map(e => SpotOrderBook.fromAmino(e)) || []; + message.derivativeOrderbook = object.derivative_orderbook?.map(e => DerivativeOrderBook.fromAmino(e)) || []; + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.positions = object.positions?.map(e => DerivativePosition.fromAmino(e)) || []; + message.subaccountTradeNonces = object.subaccount_trade_nonces?.map(e => SubaccountNonce.fromAmino(e)) || []; + message.expiryFuturesMarketInfoState = object.expiry_futures_market_info_state?.map(e => ExpiryFuturesMarketInfoState.fromAmino(e)) || []; + message.perpetualMarketInfo = object.perpetual_market_info?.map(e => PerpetualMarketInfo.fromAmino(e)) || []; + message.perpetualMarketFundingState = object.perpetual_market_funding_state?.map(e => PerpetualMarketFundingState.fromAmino(e)) || []; + message.derivativeMarketSettlementScheduled = object.derivative_market_settlement_scheduled?.map(e => DerivativeMarketSettlementInfo.fromAmino(e)) || []; + if (object.is_spot_exchange_enabled !== undefined && object.is_spot_exchange_enabled !== null) { + message.isSpotExchangeEnabled = object.is_spot_exchange_enabled; + } + if (object.is_derivatives_exchange_enabled !== undefined && object.is_derivatives_exchange_enabled !== null) { + message.isDerivativesExchangeEnabled = object.is_derivatives_exchange_enabled; + } + if (object.trading_reward_campaign_info !== undefined && object.trading_reward_campaign_info !== null) { + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.fromAmino(object.trading_reward_campaign_info); + } + message.tradingRewardPoolCampaignSchedule = object.trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.tradingRewardCampaignAccountPoints = object.trading_reward_campaign_account_points?.map(e => TradingRewardCampaignAccountPoints.fromAmino(e)) || []; + if (object.fee_discount_schedule !== undefined && object.fee_discount_schedule !== null) { + message.feeDiscountSchedule = FeeDiscountSchedule.fromAmino(object.fee_discount_schedule); + } + message.feeDiscountAccountTierTtl = object.fee_discount_account_tier_ttl?.map(e => FeeDiscountAccountTierTTL.fromAmino(e)) || []; + message.feeDiscountBucketVolumeAccounts = object.fee_discount_bucket_volume_accounts?.map(e => FeeDiscountBucketVolumeAccounts.fromAmino(e)) || []; + if (object.is_first_fee_cycle_finished !== undefined && object.is_first_fee_cycle_finished !== null) { + message.isFirstFeeCycleFinished = object.is_first_fee_cycle_finished; + } + message.pendingTradingRewardPoolCampaignSchedule = object.pending_trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.pendingTradingRewardCampaignAccountPoints = object.pending_trading_reward_campaign_account_points?.map(e => TradingRewardCampaignAccountPendingPoints.fromAmino(e)) || []; + message.rewardsOptOutAddresses = object.rewards_opt_out_addresses?.map(e => e) || []; + message.historicalTradeRecords = object.historical_trade_records?.map(e => TradeRecords.fromAmino(e)) || []; + message.binaryOptionsMarkets = object.binary_options_markets?.map(e => BinaryOptionsMarket.fromAmino(e)) || []; + message.binaryOptionsMarketIdsScheduledForSettlement = object.binary_options_market_ids_scheduled_for_settlement?.map(e => e) || []; + message.spotMarketIdsScheduledToForceClose = object.spot_market_ids_scheduled_to_force_close?.map(e => e) || []; + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + message.conditionalDerivativeOrderbooks = object.conditional_derivative_orderbooks?.map(e => ConditionalDerivativeOrderBook.fromAmino(e)) || []; + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + message.orderbookSequences = object.orderbook_sequences?.map(e => OrderbookSequence.fromAmino(e)) || []; + message.subaccountVolumes = object.subaccount_volumes?.map(e => AggregateSubaccountVolumeRecord.fromAmino(e)) || []; + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + message.grantAuthorizations = object.grant_authorizations?.map(e => FullGrantAuthorizations.fromAmino(e)) || []; + message.activeGrants = object.active_grants?.map(e => FullActiveGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.spotMarkets) { + obj.spot_markets = message.spotMarkets.map(e => e ? SpotMarket.toAmino(e) : undefined); + } else { + obj.spot_markets = message.spotMarkets; + } + if (message.derivativeMarkets) { + obj.derivative_markets = message.derivativeMarkets.map(e => e ? DerivativeMarket.toAmino(e) : undefined); + } else { + obj.derivative_markets = message.derivativeMarkets; + } + if (message.spotOrderbook) { + obj.spot_orderbook = message.spotOrderbook.map(e => e ? SpotOrderBook.toAmino(e) : undefined); + } else { + obj.spot_orderbook = message.spotOrderbook; + } + if (message.derivativeOrderbook) { + obj.derivative_orderbook = message.derivativeOrderbook.map(e => e ? DerivativeOrderBook.toAmino(e) : undefined); + } else { + obj.derivative_orderbook = message.derivativeOrderbook; + } + if (message.balances) { + obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + if (message.positions) { + obj.positions = message.positions.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + if (message.subaccountTradeNonces) { + obj.subaccount_trade_nonces = message.subaccountTradeNonces.map(e => e ? SubaccountNonce.toAmino(e) : undefined); + } else { + obj.subaccount_trade_nonces = message.subaccountTradeNonces; + } + if (message.expiryFuturesMarketInfoState) { + obj.expiry_futures_market_info_state = message.expiryFuturesMarketInfoState.map(e => e ? ExpiryFuturesMarketInfoState.toAmino(e) : undefined); + } else { + obj.expiry_futures_market_info_state = message.expiryFuturesMarketInfoState; + } + if (message.perpetualMarketInfo) { + obj.perpetual_market_info = message.perpetualMarketInfo.map(e => e ? PerpetualMarketInfo.toAmino(e) : undefined); + } else { + obj.perpetual_market_info = message.perpetualMarketInfo; + } + if (message.perpetualMarketFundingState) { + obj.perpetual_market_funding_state = message.perpetualMarketFundingState.map(e => e ? PerpetualMarketFundingState.toAmino(e) : undefined); + } else { + obj.perpetual_market_funding_state = message.perpetualMarketFundingState; + } + if (message.derivativeMarketSettlementScheduled) { + obj.derivative_market_settlement_scheduled = message.derivativeMarketSettlementScheduled.map(e => e ? DerivativeMarketSettlementInfo.toAmino(e) : undefined); + } else { + obj.derivative_market_settlement_scheduled = message.derivativeMarketSettlementScheduled; + } + obj.is_spot_exchange_enabled = message.isSpotExchangeEnabled === false ? undefined : message.isSpotExchangeEnabled; + obj.is_derivatives_exchange_enabled = message.isDerivativesExchangeEnabled === false ? undefined : message.isDerivativesExchangeEnabled; + obj.trading_reward_campaign_info = message.tradingRewardCampaignInfo ? TradingRewardCampaignInfo.toAmino(message.tradingRewardCampaignInfo) : undefined; + if (message.tradingRewardPoolCampaignSchedule) { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule; + } + if (message.tradingRewardCampaignAccountPoints) { + obj.trading_reward_campaign_account_points = message.tradingRewardCampaignAccountPoints.map(e => e ? TradingRewardCampaignAccountPoints.toAmino(e) : undefined); + } else { + obj.trading_reward_campaign_account_points = message.tradingRewardCampaignAccountPoints; + } + obj.fee_discount_schedule = message.feeDiscountSchedule ? FeeDiscountSchedule.toAmino(message.feeDiscountSchedule) : undefined; + if (message.feeDiscountAccountTierTtl) { + obj.fee_discount_account_tier_ttl = message.feeDiscountAccountTierTtl.map(e => e ? FeeDiscountAccountTierTTL.toAmino(e) : undefined); + } else { + obj.fee_discount_account_tier_ttl = message.feeDiscountAccountTierTtl; + } + if (message.feeDiscountBucketVolumeAccounts) { + obj.fee_discount_bucket_volume_accounts = message.feeDiscountBucketVolumeAccounts.map(e => e ? FeeDiscountBucketVolumeAccounts.toAmino(e) : undefined); + } else { + obj.fee_discount_bucket_volume_accounts = message.feeDiscountBucketVolumeAccounts; + } + obj.is_first_fee_cycle_finished = message.isFirstFeeCycleFinished === false ? undefined : message.isFirstFeeCycleFinished; + if (message.pendingTradingRewardPoolCampaignSchedule) { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule; + } + if (message.pendingTradingRewardCampaignAccountPoints) { + obj.pending_trading_reward_campaign_account_points = message.pendingTradingRewardCampaignAccountPoints.map(e => e ? TradingRewardCampaignAccountPendingPoints.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_campaign_account_points = message.pendingTradingRewardCampaignAccountPoints; + } + if (message.rewardsOptOutAddresses) { + obj.rewards_opt_out_addresses = message.rewardsOptOutAddresses.map(e => e); + } else { + obj.rewards_opt_out_addresses = message.rewardsOptOutAddresses; + } + if (message.historicalTradeRecords) { + obj.historical_trade_records = message.historicalTradeRecords.map(e => e ? TradeRecords.toAmino(e) : undefined); + } else { + obj.historical_trade_records = message.historicalTradeRecords; + } + if (message.binaryOptionsMarkets) { + obj.binary_options_markets = message.binaryOptionsMarkets.map(e => e ? BinaryOptionsMarket.toAmino(e) : undefined); + } else { + obj.binary_options_markets = message.binaryOptionsMarkets; + } + if (message.binaryOptionsMarketIdsScheduledForSettlement) { + obj.binary_options_market_ids_scheduled_for_settlement = message.binaryOptionsMarketIdsScheduledForSettlement.map(e => e); + } else { + obj.binary_options_market_ids_scheduled_for_settlement = message.binaryOptionsMarketIdsScheduledForSettlement; + } + if (message.spotMarketIdsScheduledToForceClose) { + obj.spot_market_ids_scheduled_to_force_close = message.spotMarketIdsScheduledToForceClose.map(e => e); + } else { + obj.spot_market_ids_scheduled_to_force_close = message.spotMarketIdsScheduledToForceClose; + } + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + if (message.conditionalDerivativeOrderbooks) { + obj.conditional_derivative_orderbooks = message.conditionalDerivativeOrderbooks.map(e => e ? ConditionalDerivativeOrderBook.toAmino(e) : undefined); + } else { + obj.conditional_derivative_orderbooks = message.conditionalDerivativeOrderbooks; + } + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + if (message.orderbookSequences) { + obj.orderbook_sequences = message.orderbookSequences.map(e => e ? OrderbookSequence.toAmino(e) : undefined); + } else { + obj.orderbook_sequences = message.orderbookSequences; + } + if (message.subaccountVolumes) { + obj.subaccount_volumes = message.subaccountVolumes.map(e => e ? AggregateSubaccountVolumeRecord.toAmino(e) : undefined); + } else { + obj.subaccount_volumes = message.subaccountVolumes; + } + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + if (message.grantAuthorizations) { + obj.grant_authorizations = message.grantAuthorizations.map(e => e ? FullGrantAuthorizations.toAmino(e) : undefined); + } else { + obj.grant_authorizations = message.grantAuthorizations; + } + if (message.activeGrants) { + obj.active_grants = message.activeGrants.map(e => e ? FullActiveGrant.toAmino(e) : undefined); + } else { + obj.active_grants = message.activeGrants; + } + 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: "/injective.exchange.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseOrderbookSequence(): OrderbookSequence { + return { + sequence: BigInt(0), + marketId: "" + }; +} +export const OrderbookSequence = { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence", + is(o: any): o is OrderbookSequence { + return o && (o.$typeUrl === OrderbookSequence.typeUrl || typeof o.sequence === "bigint" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is OrderbookSequenceAmino { + return o && (o.$typeUrl === OrderbookSequence.typeUrl || typeof o.sequence === "bigint" && typeof o.market_id === "string"); + }, + encode(message: OrderbookSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookSequence { + const message = createBaseOrderbookSequence(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: OrderbookSequenceAmino): OrderbookSequence { + const message = createBaseOrderbookSequence(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: OrderbookSequence): OrderbookSequenceAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: OrderbookSequenceAminoMsg): OrderbookSequence { + return OrderbookSequence.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookSequenceProtoMsg): OrderbookSequence { + return OrderbookSequence.decode(message.value); + }, + toProto(message: OrderbookSequence): Uint8Array { + return OrderbookSequence.encode(message).finish(); + }, + toProtoMsg(message: OrderbookSequence): OrderbookSequenceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence", + value: OrderbookSequence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookSequence.typeUrl, OrderbookSequence); +function createBaseFeeDiscountAccountTierTTL(): FeeDiscountAccountTierTTL { + return { + account: "", + tierTtl: undefined + }; +} +export const FeeDiscountAccountTierTTL = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL", + is(o: any): o is FeeDiscountAccountTierTTL { + return o && (o.$typeUrl === FeeDiscountAccountTierTTL.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is FeeDiscountAccountTierTTLAmino { + return o && (o.$typeUrl === FeeDiscountAccountTierTTL.typeUrl || typeof o.account === "string"); + }, + encode(message: FeeDiscountAccountTierTTL, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.tierTtl !== undefined) { + FeeDiscountTierTTL.encode(message.tierTtl, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountAccountTierTTL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountAccountTierTTL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.tierTtl = FeeDiscountTierTTL.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountAccountTierTTL { + const message = createBaseFeeDiscountAccountTierTTL(); + message.account = object.account ?? ""; + message.tierTtl = object.tierTtl !== undefined && object.tierTtl !== null ? FeeDiscountTierTTL.fromPartial(object.tierTtl) : undefined; + return message; + }, + fromAmino(object: FeeDiscountAccountTierTTLAmino): FeeDiscountAccountTierTTL { + const message = createBaseFeeDiscountAccountTierTTL(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.tier_ttl !== undefined && object.tier_ttl !== null) { + message.tierTtl = FeeDiscountTierTTL.fromAmino(object.tier_ttl); + } + return message; + }, + toAmino(message: FeeDiscountAccountTierTTL): FeeDiscountAccountTierTTLAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.tier_ttl = message.tierTtl ? FeeDiscountTierTTL.toAmino(message.tierTtl) : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountAccountTierTTLAminoMsg): FeeDiscountAccountTierTTL { + return FeeDiscountAccountTierTTL.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountAccountTierTTLProtoMsg): FeeDiscountAccountTierTTL { + return FeeDiscountAccountTierTTL.decode(message.value); + }, + toProto(message: FeeDiscountAccountTierTTL): Uint8Array { + return FeeDiscountAccountTierTTL.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountAccountTierTTL): FeeDiscountAccountTierTTLProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL", + value: FeeDiscountAccountTierTTL.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountAccountTierTTL.typeUrl, FeeDiscountAccountTierTTL); +function createBaseFeeDiscountBucketVolumeAccounts(): FeeDiscountBucketVolumeAccounts { + return { + bucketStartTimestamp: BigInt(0), + accountVolume: [] + }; +} +export const FeeDiscountBucketVolumeAccounts = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts", + is(o: any): o is FeeDiscountBucketVolumeAccounts { + return o && (o.$typeUrl === FeeDiscountBucketVolumeAccounts.typeUrl || typeof o.bucketStartTimestamp === "bigint" && Array.isArray(o.accountVolume) && (!o.accountVolume.length || AccountVolume.is(o.accountVolume[0]))); + }, + isAmino(o: any): o is FeeDiscountBucketVolumeAccountsAmino { + return o && (o.$typeUrl === FeeDiscountBucketVolumeAccounts.typeUrl || typeof o.bucket_start_timestamp === "bigint" && Array.isArray(o.account_volume) && (!o.account_volume.length || AccountVolume.isAmino(o.account_volume[0]))); + }, + encode(message: FeeDiscountBucketVolumeAccounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bucketStartTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.bucketStartTimestamp); + } + for (const v of message.accountVolume) { + AccountVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountBucketVolumeAccounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountBucketVolumeAccounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketStartTimestamp = reader.int64(); + break; + case 2: + message.accountVolume.push(AccountVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountBucketVolumeAccounts { + const message = createBaseFeeDiscountBucketVolumeAccounts(); + message.bucketStartTimestamp = object.bucketStartTimestamp !== undefined && object.bucketStartTimestamp !== null ? BigInt(object.bucketStartTimestamp.toString()) : BigInt(0); + message.accountVolume = object.accountVolume?.map(e => AccountVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeeDiscountBucketVolumeAccountsAmino): FeeDiscountBucketVolumeAccounts { + const message = createBaseFeeDiscountBucketVolumeAccounts(); + if (object.bucket_start_timestamp !== undefined && object.bucket_start_timestamp !== null) { + message.bucketStartTimestamp = BigInt(object.bucket_start_timestamp); + } + message.accountVolume = object.account_volume?.map(e => AccountVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeeDiscountBucketVolumeAccounts): FeeDiscountBucketVolumeAccountsAmino { + const obj: any = {}; + obj.bucket_start_timestamp = message.bucketStartTimestamp !== BigInt(0) ? message.bucketStartTimestamp?.toString() : undefined; + if (message.accountVolume) { + obj.account_volume = message.accountVolume.map(e => e ? AccountVolume.toAmino(e) : undefined); + } else { + obj.account_volume = message.accountVolume; + } + return obj; + }, + fromAminoMsg(object: FeeDiscountBucketVolumeAccountsAminoMsg): FeeDiscountBucketVolumeAccounts { + return FeeDiscountBucketVolumeAccounts.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountBucketVolumeAccountsProtoMsg): FeeDiscountBucketVolumeAccounts { + return FeeDiscountBucketVolumeAccounts.decode(message.value); + }, + toProto(message: FeeDiscountBucketVolumeAccounts): Uint8Array { + return FeeDiscountBucketVolumeAccounts.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountBucketVolumeAccounts): FeeDiscountBucketVolumeAccountsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts", + value: FeeDiscountBucketVolumeAccounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountBucketVolumeAccounts.typeUrl, FeeDiscountBucketVolumeAccounts); +function createBaseAccountVolume(): AccountVolume { + return { + account: "", + volume: "" + }; +} +export const AccountVolume = { + typeUrl: "/injective.exchange.v1beta1.AccountVolume", + is(o: any): o is AccountVolume { + return o && (o.$typeUrl === AccountVolume.typeUrl || typeof o.account === "string" && typeof o.volume === "string"); + }, + isAmino(o: any): o is AccountVolumeAmino { + return o && (o.$typeUrl === AccountVolume.typeUrl || typeof o.account === "string" && typeof o.volume === "string"); + }, + encode(message: AccountVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.volume !== "") { + writer.uint32(18).string(message.volume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.volume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccountVolume { + const message = createBaseAccountVolume(); + message.account = object.account ?? ""; + message.volume = object.volume ?? ""; + return message; + }, + fromAmino(object: AccountVolumeAmino): AccountVolume { + const message = createBaseAccountVolume(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = object.volume; + } + return message; + }, + toAmino(message: AccountVolume): AccountVolumeAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.volume = message.volume === "" ? undefined : message.volume; + return obj; + }, + fromAminoMsg(object: AccountVolumeAminoMsg): AccountVolume { + return AccountVolume.fromAmino(object.value); + }, + fromProtoMsg(message: AccountVolumeProtoMsg): AccountVolume { + return AccountVolume.decode(message.value); + }, + toProto(message: AccountVolume): Uint8Array { + return AccountVolume.encode(message).finish(); + }, + toProtoMsg(message: AccountVolume): AccountVolumeProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AccountVolume", + value: AccountVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccountVolume.typeUrl, AccountVolume); +function createBaseTradingRewardCampaignAccountPoints(): TradingRewardCampaignAccountPoints { + return { + account: "", + points: "" + }; +} +export const TradingRewardCampaignAccountPoints = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints", + is(o: any): o is TradingRewardCampaignAccountPoints { + return o && (o.$typeUrl === TradingRewardCampaignAccountPoints.typeUrl || typeof o.account === "string" && typeof o.points === "string"); + }, + isAmino(o: any): o is TradingRewardCampaignAccountPointsAmino { + return o && (o.$typeUrl === TradingRewardCampaignAccountPoints.typeUrl || typeof o.account === "string" && typeof o.points === "string"); + }, + encode(message: TradingRewardCampaignAccountPoints, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.points !== "") { + writer.uint32(18).string(message.points); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignAccountPoints { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignAccountPoints(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.points = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignAccountPoints { + const message = createBaseTradingRewardCampaignAccountPoints(); + message.account = object.account ?? ""; + message.points = object.points ?? ""; + return message; + }, + fromAmino(object: TradingRewardCampaignAccountPointsAmino): TradingRewardCampaignAccountPoints { + const message = createBaseTradingRewardCampaignAccountPoints(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.points !== undefined && object.points !== null) { + message.points = object.points; + } + return message; + }, + toAmino(message: TradingRewardCampaignAccountPoints): TradingRewardCampaignAccountPointsAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.points = message.points === "" ? undefined : message.points; + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignAccountPointsAminoMsg): TradingRewardCampaignAccountPoints { + return TradingRewardCampaignAccountPoints.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignAccountPointsProtoMsg): TradingRewardCampaignAccountPoints { + return TradingRewardCampaignAccountPoints.decode(message.value); + }, + toProto(message: TradingRewardCampaignAccountPoints): Uint8Array { + return TradingRewardCampaignAccountPoints.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignAccountPoints): TradingRewardCampaignAccountPointsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints", + value: TradingRewardCampaignAccountPoints.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignAccountPoints.typeUrl, TradingRewardCampaignAccountPoints); +function createBaseTradingRewardCampaignAccountPendingPoints(): TradingRewardCampaignAccountPendingPoints { + return { + rewardPoolStartTimestamp: BigInt(0), + accountPoints: [] + }; +} +export const TradingRewardCampaignAccountPendingPoints = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints", + is(o: any): o is TradingRewardCampaignAccountPendingPoints { + return o && (o.$typeUrl === TradingRewardCampaignAccountPendingPoints.typeUrl || typeof o.rewardPoolStartTimestamp === "bigint" && Array.isArray(o.accountPoints) && (!o.accountPoints.length || TradingRewardCampaignAccountPoints.is(o.accountPoints[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignAccountPendingPointsAmino { + return o && (o.$typeUrl === TradingRewardCampaignAccountPendingPoints.typeUrl || typeof o.reward_pool_start_timestamp === "bigint" && Array.isArray(o.account_points) && (!o.account_points.length || TradingRewardCampaignAccountPoints.isAmino(o.account_points[0]))); + }, + encode(message: TradingRewardCampaignAccountPendingPoints, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardPoolStartTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.rewardPoolStartTimestamp); + } + for (const v of message.accountPoints) { + TradingRewardCampaignAccountPoints.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignAccountPendingPoints { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardPoolStartTimestamp = reader.int64(); + break; + case 2: + message.accountPoints.push(TradingRewardCampaignAccountPoints.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignAccountPendingPoints { + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + message.rewardPoolStartTimestamp = object.rewardPoolStartTimestamp !== undefined && object.rewardPoolStartTimestamp !== null ? BigInt(object.rewardPoolStartTimestamp.toString()) : BigInt(0); + message.accountPoints = object.accountPoints?.map(e => TradingRewardCampaignAccountPoints.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignAccountPendingPointsAmino): TradingRewardCampaignAccountPendingPoints { + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + if (object.reward_pool_start_timestamp !== undefined && object.reward_pool_start_timestamp !== null) { + message.rewardPoolStartTimestamp = BigInt(object.reward_pool_start_timestamp); + } + message.accountPoints = object.account_points?.map(e => TradingRewardCampaignAccountPoints.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignAccountPendingPoints): TradingRewardCampaignAccountPendingPointsAmino { + const obj: any = {}; + obj.reward_pool_start_timestamp = message.rewardPoolStartTimestamp !== BigInt(0) ? message.rewardPoolStartTimestamp?.toString() : undefined; + if (message.accountPoints) { + obj.account_points = message.accountPoints.map(e => e ? TradingRewardCampaignAccountPoints.toAmino(e) : undefined); + } else { + obj.account_points = message.accountPoints; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignAccountPendingPointsAminoMsg): TradingRewardCampaignAccountPendingPoints { + return TradingRewardCampaignAccountPendingPoints.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignAccountPendingPointsProtoMsg): TradingRewardCampaignAccountPendingPoints { + return TradingRewardCampaignAccountPendingPoints.decode(message.value); + }, + toProto(message: TradingRewardCampaignAccountPendingPoints): Uint8Array { + return TradingRewardCampaignAccountPendingPoints.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignAccountPendingPoints): TradingRewardCampaignAccountPendingPointsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints", + value: TradingRewardCampaignAccountPendingPoints.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignAccountPendingPoints.typeUrl, TradingRewardCampaignAccountPendingPoints); +function createBaseSpotOrderBook(): SpotOrderBook { + return { + marketId: "", + isBuySide: false, + orders: [] + }; +} +export const SpotOrderBook = { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook", + is(o: any): o is SpotOrderBook { + return o && (o.$typeUrl === SpotOrderBook.typeUrl || typeof o.marketId === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || SpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is SpotOrderBookAmino { + return o && (o.$typeUrl === SpotOrderBook.typeUrl || typeof o.market_id === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || SpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: SpotOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuySide === true) { + writer.uint32(16).bool(message.isBuySide); + } + for (const v of message.orders) { + SpotLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuySide = reader.bool(); + break; + case 3: + message.orders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrderBook { + const message = createBaseSpotOrderBook(); + message.marketId = object.marketId ?? ""; + message.isBuySide = object.isBuySide ?? false; + message.orders = object.orders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SpotOrderBookAmino): SpotOrderBook { + const message = createBaseSpotOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuySide !== undefined && object.isBuySide !== null) { + message.isBuySide = object.isBuySide; + } + message.orders = object.orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: SpotOrderBook): SpotOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuySide = message.isBuySide === false ? undefined : message.isBuySide; + if (message.orders) { + obj.orders = message.orders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: SpotOrderBookAminoMsg): SpotOrderBook { + return SpotOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderBookProtoMsg): SpotOrderBook { + return SpotOrderBook.decode(message.value); + }, + toProto(message: SpotOrderBook): Uint8Array { + return SpotOrderBook.encode(message).finish(); + }, + toProtoMsg(message: SpotOrderBook): SpotOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook", + value: SpotOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrderBook.typeUrl, SpotOrderBook); +function createBaseDerivativeOrderBook(): DerivativeOrderBook { + return { + marketId: "", + isBuySide: false, + orders: [] + }; +} +export const DerivativeOrderBook = { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook", + is(o: any): o is DerivativeOrderBook { + return o && (o.$typeUrl === DerivativeOrderBook.typeUrl || typeof o.marketId === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || DerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is DerivativeOrderBookAmino { + return o && (o.$typeUrl === DerivativeOrderBook.typeUrl || typeof o.market_id === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || DerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: DerivativeOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuySide === true) { + writer.uint32(16).bool(message.isBuySide); + } + for (const v of message.orders) { + DerivativeLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuySide = reader.bool(); + break; + case 3: + message.orders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrderBook { + const message = createBaseDerivativeOrderBook(); + message.marketId = object.marketId ?? ""; + message.isBuySide = object.isBuySide ?? false; + message.orders = object.orders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DerivativeOrderBookAmino): DerivativeOrderBook { + const message = createBaseDerivativeOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuySide !== undefined && object.isBuySide !== null) { + message.isBuySide = object.isBuySide; + } + message.orders = object.orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: DerivativeOrderBook): DerivativeOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuySide = message.isBuySide === false ? undefined : message.isBuySide; + if (message.orders) { + obj.orders = message.orders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: DerivativeOrderBookAminoMsg): DerivativeOrderBook { + return DerivativeOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderBookProtoMsg): DerivativeOrderBook { + return DerivativeOrderBook.decode(message.value); + }, + toProto(message: DerivativeOrderBook): Uint8Array { + return DerivativeOrderBook.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrderBook): DerivativeOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook", + value: DerivativeOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrderBook.typeUrl, DerivativeOrderBook); +function createBaseConditionalDerivativeOrderBook(): ConditionalDerivativeOrderBook { + return { + marketId: "", + limitBuyOrders: [], + marketBuyOrders: [], + limitSellOrders: [], + marketSellOrders: [] + }; +} +export const ConditionalDerivativeOrderBook = { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook", + is(o: any): o is ConditionalDerivativeOrderBook { + return o && (o.$typeUrl === ConditionalDerivativeOrderBook.typeUrl || typeof o.marketId === "string" && Array.isArray(o.limitBuyOrders) && (!o.limitBuyOrders.length || DerivativeLimitOrder.is(o.limitBuyOrders[0])) && Array.isArray(o.marketBuyOrders) && (!o.marketBuyOrders.length || DerivativeMarketOrder.is(o.marketBuyOrders[0])) && Array.isArray(o.limitSellOrders) && (!o.limitSellOrders.length || DerivativeLimitOrder.is(o.limitSellOrders[0])) && Array.isArray(o.marketSellOrders) && (!o.marketSellOrders.length || DerivativeMarketOrder.is(o.marketSellOrders[0]))); + }, + isAmino(o: any): o is ConditionalDerivativeOrderBookAmino { + return o && (o.$typeUrl === ConditionalDerivativeOrderBook.typeUrl || typeof o.market_id === "string" && Array.isArray(o.limit_buy_orders) && (!o.limit_buy_orders.length || DerivativeLimitOrder.isAmino(o.limit_buy_orders[0])) && Array.isArray(o.market_buy_orders) && (!o.market_buy_orders.length || DerivativeMarketOrder.isAmino(o.market_buy_orders[0])) && Array.isArray(o.limit_sell_orders) && (!o.limit_sell_orders.length || DerivativeLimitOrder.isAmino(o.limit_sell_orders[0])) && Array.isArray(o.market_sell_orders) && (!o.market_sell_orders.length || DerivativeMarketOrder.isAmino(o.market_sell_orders[0]))); + }, + encode(message: ConditionalDerivativeOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.limitBuyOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.marketBuyOrders) { + DerivativeMarketOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.limitSellOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.marketSellOrders) { + DerivativeMarketOrder.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConditionalDerivativeOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConditionalDerivativeOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limitBuyOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.marketBuyOrders.push(DerivativeMarketOrder.decode(reader, reader.uint32())); + break; + case 4: + message.limitSellOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 5: + message.marketSellOrders.push(DerivativeMarketOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConditionalDerivativeOrderBook { + const message = createBaseConditionalDerivativeOrderBook(); + message.marketId = object.marketId ?? ""; + message.limitBuyOrders = object.limitBuyOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.marketBuyOrders = object.marketBuyOrders?.map(e => DerivativeMarketOrder.fromPartial(e)) || []; + message.limitSellOrders = object.limitSellOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.marketSellOrders = object.marketSellOrders?.map(e => DerivativeMarketOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConditionalDerivativeOrderBookAmino): ConditionalDerivativeOrderBook { + const message = createBaseConditionalDerivativeOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.limitBuyOrders = object.limit_buy_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.marketBuyOrders = object.market_buy_orders?.map(e => DerivativeMarketOrder.fromAmino(e)) || []; + message.limitSellOrders = object.limit_sell_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.marketSellOrders = object.market_sell_orders?.map(e => DerivativeMarketOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: ConditionalDerivativeOrderBook): ConditionalDerivativeOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.limitBuyOrders) { + obj.limit_buy_orders = message.limitBuyOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.limit_buy_orders = message.limitBuyOrders; + } + if (message.marketBuyOrders) { + obj.market_buy_orders = message.marketBuyOrders.map(e => e ? DerivativeMarketOrder.toAmino(e) : undefined); + } else { + obj.market_buy_orders = message.marketBuyOrders; + } + if (message.limitSellOrders) { + obj.limit_sell_orders = message.limitSellOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.limit_sell_orders = message.limitSellOrders; + } + if (message.marketSellOrders) { + obj.market_sell_orders = message.marketSellOrders.map(e => e ? DerivativeMarketOrder.toAmino(e) : undefined); + } else { + obj.market_sell_orders = message.marketSellOrders; + } + return obj; + }, + fromAminoMsg(object: ConditionalDerivativeOrderBookAminoMsg): ConditionalDerivativeOrderBook { + return ConditionalDerivativeOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: ConditionalDerivativeOrderBookProtoMsg): ConditionalDerivativeOrderBook { + return ConditionalDerivativeOrderBook.decode(message.value); + }, + toProto(message: ConditionalDerivativeOrderBook): Uint8Array { + return ConditionalDerivativeOrderBook.encode(message).finish(); + }, + toProtoMsg(message: ConditionalDerivativeOrderBook): ConditionalDerivativeOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook", + value: ConditionalDerivativeOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConditionalDerivativeOrderBook.typeUrl, ConditionalDerivativeOrderBook); +function createBaseBalance(): Balance { + return { + subaccountId: "", + denom: "", + deposits: undefined + }; +} +export const Balance = { + typeUrl: "/injective.exchange.v1beta1.Balance", + is(o: any): o is Balance { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is BalanceAmino { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.subaccount_id === "string" && typeof o.denom === "string"); + }, + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.deposits !== undefined) { + Deposit.encode(message.deposits, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.deposits = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Balance { + const message = createBaseBalance(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.deposits = object.deposits !== undefined && object.deposits !== null ? Deposit.fromPartial(object.deposits) : undefined; + return message; + }, + fromAmino(object: BalanceAmino): Balance { + const message = createBaseBalance(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.deposits !== undefined && object.deposits !== null) { + message.deposits = Deposit.fromAmino(object.deposits); + } + return message; + }, + toAmino(message: Balance): BalanceAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.deposits = message.deposits ? Deposit.toAmino(message.deposits) : undefined; + return obj; + }, + fromAminoMsg(object: BalanceAminoMsg): Balance { + return Balance.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceProtoMsg): Balance { + return Balance.decode(message.value); + }, + toProto(message: Balance): Uint8Array { + return Balance.encode(message).finish(); + }, + toProtoMsg(message: Balance): BalanceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Balance", + value: Balance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Balance.typeUrl, Balance); +function createBaseDerivativePosition(): DerivativePosition { + return { + subaccountId: "", + marketId: "", + position: undefined + }; +} +export const DerivativePosition = { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition", + is(o: any): o is DerivativePosition { + return o && (o.$typeUrl === DerivativePosition.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is DerivativePositionAmino { + return o && (o.$typeUrl === DerivativePosition.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: DerivativePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.position !== undefined) { + Position.encode(message.position, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.position = Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativePosition { + const message = createBaseDerivativePosition(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; + return message; + }, + fromAmino(object: DerivativePositionAmino): DerivativePosition { + const message = createBaseDerivativePosition(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + return message; + }, + toAmino(message: DerivativePosition): DerivativePositionAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.position = message.position ? Position.toAmino(message.position) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativePositionAminoMsg): DerivativePosition { + return DerivativePosition.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativePositionProtoMsg): DerivativePosition { + return DerivativePosition.decode(message.value); + }, + toProto(message: DerivativePosition): Uint8Array { + return DerivativePosition.encode(message).finish(); + }, + toProtoMsg(message: DerivativePosition): DerivativePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition", + value: DerivativePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativePosition.typeUrl, DerivativePosition); +function createBaseSubaccountNonce(): SubaccountNonce { + return { + subaccountId: "", + subaccountTradeNonce: SubaccountTradeNonce.fromPartial({}) + }; +} +export const SubaccountNonce = { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce", + is(o: any): o is SubaccountNonce { + return o && (o.$typeUrl === SubaccountNonce.typeUrl || typeof o.subaccountId === "string" && SubaccountTradeNonce.is(o.subaccountTradeNonce)); + }, + isAmino(o: any): o is SubaccountNonceAmino { + return o && (o.$typeUrl === SubaccountNonce.typeUrl || typeof o.subaccount_id === "string" && SubaccountTradeNonce.isAmino(o.subaccount_trade_nonce)); + }, + encode(message: SubaccountNonce, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.subaccountTradeNonce !== undefined) { + SubaccountTradeNonce.encode(message.subaccountTradeNonce, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountNonce { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountNonce(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.subaccountTradeNonce = SubaccountTradeNonce.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountNonce { + const message = createBaseSubaccountNonce(); + message.subaccountId = object.subaccountId ?? ""; + message.subaccountTradeNonce = object.subaccountTradeNonce !== undefined && object.subaccountTradeNonce !== null ? SubaccountTradeNonce.fromPartial(object.subaccountTradeNonce) : undefined; + return message; + }, + fromAmino(object: SubaccountNonceAmino): SubaccountNonce { + const message = createBaseSubaccountNonce(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.subaccount_trade_nonce !== undefined && object.subaccount_trade_nonce !== null) { + message.subaccountTradeNonce = SubaccountTradeNonce.fromAmino(object.subaccount_trade_nonce); + } + return message; + }, + toAmino(message: SubaccountNonce): SubaccountNonceAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.subaccount_trade_nonce = message.subaccountTradeNonce ? SubaccountTradeNonce.toAmino(message.subaccountTradeNonce) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountNonceAminoMsg): SubaccountNonce { + return SubaccountNonce.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountNonceProtoMsg): SubaccountNonce { + return SubaccountNonce.decode(message.value); + }, + toProto(message: SubaccountNonce): Uint8Array { + return SubaccountNonce.encode(message).finish(); + }, + toProtoMsg(message: SubaccountNonce): SubaccountNonceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce", + value: SubaccountNonce.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountNonce.typeUrl, SubaccountNonce); +function createBaseExpiryFuturesMarketInfoState(): ExpiryFuturesMarketInfoState { + return { + marketId: "", + marketInfo: undefined + }; +} +export const ExpiryFuturesMarketInfoState = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState", + is(o: any): o is ExpiryFuturesMarketInfoState { + return o && (o.$typeUrl === ExpiryFuturesMarketInfoState.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketInfoStateAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketInfoState.typeUrl || typeof o.market_id === "string"); + }, + encode(message: ExpiryFuturesMarketInfoState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.marketInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.marketInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketInfoState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketInfoState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.marketInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketInfoState { + const message = createBaseExpiryFuturesMarketInfoState(); + message.marketId = object.marketId ?? ""; + message.marketInfo = object.marketInfo !== undefined && object.marketInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.marketInfo) : undefined; + return message; + }, + fromAmino(object: ExpiryFuturesMarketInfoStateAmino): ExpiryFuturesMarketInfoState { + const message = createBaseExpiryFuturesMarketInfoState(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_info !== undefined && object.market_info !== null) { + message.marketInfo = ExpiryFuturesMarketInfo.fromAmino(object.market_info); + } + return message; + }, + toAmino(message: ExpiryFuturesMarketInfoState): ExpiryFuturesMarketInfoStateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_info = message.marketInfo ? ExpiryFuturesMarketInfo.toAmino(message.marketInfo) : undefined; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketInfoStateAminoMsg): ExpiryFuturesMarketInfoState { + return ExpiryFuturesMarketInfoState.fromAmino(object.value); + }, + fromProtoMsg(message: ExpiryFuturesMarketInfoStateProtoMsg): ExpiryFuturesMarketInfoState { + return ExpiryFuturesMarketInfoState.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketInfoState): Uint8Array { + return ExpiryFuturesMarketInfoState.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketInfoState): ExpiryFuturesMarketInfoStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState", + value: ExpiryFuturesMarketInfoState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketInfoState.typeUrl, ExpiryFuturesMarketInfoState); +function createBasePerpetualMarketFundingState(): PerpetualMarketFundingState { + return { + marketId: "", + funding: undefined + }; +} +export const PerpetualMarketFundingState = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState", + is(o: any): o is PerpetualMarketFundingState { + return o && (o.$typeUrl === PerpetualMarketFundingState.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is PerpetualMarketFundingStateAmino { + return o && (o.$typeUrl === PerpetualMarketFundingState.typeUrl || typeof o.market_id === "string"); + }, + encode(message: PerpetualMarketFundingState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketFundingState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketFundingState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketFundingState { + const message = createBasePerpetualMarketFundingState(); + message.marketId = object.marketId ?? ""; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketFundingStateAmino): PerpetualMarketFundingState { + const message = createBasePerpetualMarketFundingState(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + return message; + }, + toAmino(message: PerpetualMarketFundingState): PerpetualMarketFundingStateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketFundingStateAminoMsg): PerpetualMarketFundingState { + return PerpetualMarketFundingState.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketFundingStateProtoMsg): PerpetualMarketFundingState { + return PerpetualMarketFundingState.decode(message.value); + }, + toProto(message: PerpetualMarketFundingState): Uint8Array { + return PerpetualMarketFundingState.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketFundingState): PerpetualMarketFundingStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState", + value: PerpetualMarketFundingState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketFundingState.typeUrl, PerpetualMarketFundingState); +function createBaseFullGrantAuthorizations(): FullGrantAuthorizations { + return { + granter: "", + totalGrantAmount: "", + lastDelegationsCheckedTime: BigInt(0), + grants: [] + }; +} +export const FullGrantAuthorizations = { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations", + is(o: any): o is FullGrantAuthorizations { + return o && (o.$typeUrl === FullGrantAuthorizations.typeUrl || typeof o.granter === "string" && typeof o.totalGrantAmount === "string" && typeof o.lastDelegationsCheckedTime === "bigint" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is FullGrantAuthorizationsAmino { + return o && (o.$typeUrl === FullGrantAuthorizations.typeUrl || typeof o.granter === "string" && typeof o.total_grant_amount === "string" && typeof o.last_delegations_checked_time === "bigint" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: FullGrantAuthorizations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.totalGrantAmount !== "") { + writer.uint32(18).string(message.totalGrantAmount); + } + if (message.lastDelegationsCheckedTime !== BigInt(0)) { + writer.uint32(24).int64(message.lastDelegationsCheckedTime); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullGrantAuthorizations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullGrantAuthorizations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.totalGrantAmount = reader.string(); + break; + case 3: + message.lastDelegationsCheckedTime = reader.int64(); + break; + case 4: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullGrantAuthorizations { + const message = createBaseFullGrantAuthorizations(); + message.granter = object.granter ?? ""; + message.totalGrantAmount = object.totalGrantAmount ?? ""; + message.lastDelegationsCheckedTime = object.lastDelegationsCheckedTime !== undefined && object.lastDelegationsCheckedTime !== null ? BigInt(object.lastDelegationsCheckedTime.toString()) : BigInt(0); + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FullGrantAuthorizationsAmino): FullGrantAuthorizations { + const message = createBaseFullGrantAuthorizations(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.total_grant_amount !== undefined && object.total_grant_amount !== null) { + message.totalGrantAmount = object.total_grant_amount; + } + if (object.last_delegations_checked_time !== undefined && object.last_delegations_checked_time !== null) { + message.lastDelegationsCheckedTime = BigInt(object.last_delegations_checked_time); + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: FullGrantAuthorizations): FullGrantAuthorizationsAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.total_grant_amount = message.totalGrantAmount === "" ? undefined : message.totalGrantAmount; + obj.last_delegations_checked_time = message.lastDelegationsCheckedTime !== BigInt(0) ? message.lastDelegationsCheckedTime?.toString() : undefined; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: FullGrantAuthorizationsAminoMsg): FullGrantAuthorizations { + return FullGrantAuthorizations.fromAmino(object.value); + }, + fromProtoMsg(message: FullGrantAuthorizationsProtoMsg): FullGrantAuthorizations { + return FullGrantAuthorizations.decode(message.value); + }, + toProto(message: FullGrantAuthorizations): Uint8Array { + return FullGrantAuthorizations.encode(message).finish(); + }, + toProtoMsg(message: FullGrantAuthorizations): FullGrantAuthorizationsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations", + value: FullGrantAuthorizations.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullGrantAuthorizations.typeUrl, FullGrantAuthorizations); +function createBaseFullActiveGrant(): FullActiveGrant { + return { + grantee: "", + activeGrant: undefined + }; +} +export const FullActiveGrant = { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant", + is(o: any): o is FullActiveGrant { + return o && (o.$typeUrl === FullActiveGrant.typeUrl || typeof o.grantee === "string"); + }, + isAmino(o: any): o is FullActiveGrantAmino { + return o && (o.$typeUrl === FullActiveGrant.typeUrl || typeof o.grantee === "string"); + }, + encode(message: FullActiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.activeGrant !== undefined) { + ActiveGrant.encode(message.activeGrant, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullActiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullActiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.activeGrant = ActiveGrant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullActiveGrant { + const message = createBaseFullActiveGrant(); + message.grantee = object.grantee ?? ""; + message.activeGrant = object.activeGrant !== undefined && object.activeGrant !== null ? ActiveGrant.fromPartial(object.activeGrant) : undefined; + return message; + }, + fromAmino(object: FullActiveGrantAmino): FullActiveGrant { + const message = createBaseFullActiveGrant(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.active_grant !== undefined && object.active_grant !== null) { + message.activeGrant = ActiveGrant.fromAmino(object.active_grant); + } + return message; + }, + toAmino(message: FullActiveGrant): FullActiveGrantAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.active_grant = message.activeGrant ? ActiveGrant.toAmino(message.activeGrant) : undefined; + return obj; + }, + fromAminoMsg(object: FullActiveGrantAminoMsg): FullActiveGrant { + return FullActiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: FullActiveGrantProtoMsg): FullActiveGrant { + return FullActiveGrant.decode(message.value); + }, + toProto(message: FullActiveGrant): Uint8Array { + return FullActiveGrant.encode(message).finish(); + }, + toProtoMsg(message: FullActiveGrant): FullActiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant", + value: FullActiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullActiveGrant.typeUrl, FullActiveGrant); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/proposal.ts b/libs/injective-query/src/injective/exchange/v1beta1/proposal.ts new file mode 100644 index 00000000..320d2ad9 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/proposal.ts @@ -0,0 +1,4383 @@ +import { MarketStatus, DenomDecimals, DenomDecimalsAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino } from "./exchange"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalAmino } from "../../../cosmos/distribution/v1beta1/distribution"; +import { isSet, DeepPartial } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum ExchangeType { + EXCHANGE_UNSPECIFIED = 0, + SPOT = 1, + DERIVATIVES = 2, + UNRECOGNIZED = -1, +} +export const ExchangeTypeAmino = ExchangeType; +export function exchangeTypeFromJSON(object: any): ExchangeType { + switch (object) { + case 0: + case "EXCHANGE_UNSPECIFIED": + return ExchangeType.EXCHANGE_UNSPECIFIED; + case 1: + case "SPOT": + return ExchangeType.SPOT; + case 2: + case "DERIVATIVES": + return ExchangeType.DERIVATIVES; + case -1: + case "UNRECOGNIZED": + default: + return ExchangeType.UNRECOGNIZED; + } +} +export function exchangeTypeToJSON(object: ExchangeType): string { + switch (object) { + case ExchangeType.EXCHANGE_UNSPECIFIED: + return "EXCHANGE_UNSPECIFIED"; + case ExchangeType.SPOT: + return "SPOT"; + case ExchangeType.DERIVATIVES: + return "DERIVATIVES"; + case ExchangeType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface SpotMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** maker_fee_rate defines the trade fee rate for makers on the spot market */ + makerFeeRate?: string; + /** taker_fee_rate defines the trade fee rate for takers on the spot market */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the spot + * market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + status: MarketStatus; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; + adminInfo?: AdminInfo; +} +export interface SpotMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface SpotMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** maker_fee_rate defines the trade fee rate for makers on the spot market */ + maker_fee_rate?: string; + /** taker_fee_rate defines the trade fee rate for takers on the spot market */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the spot + * market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + status: MarketStatus; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; + admin_info?: AdminInfoAmino; +} +export interface SpotMarketParamUpdateProposalAminoMsg { + type: "exchange/SpotMarketParamUpdateProposal"; + value: SpotMarketParamUpdateProposalAmino; +} +export interface ExchangeEnableProposal { + title: string; + description: string; + exchangeType: ExchangeType; +} +export interface ExchangeEnableProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal"; + value: Uint8Array; +} +export interface ExchangeEnableProposalAmino { + title: string; + description: string; + exchangeType: ExchangeType; +} +export interface ExchangeEnableProposalAminoMsg { + type: "exchange/ExchangeEnableProposal"; + value: ExchangeEnableProposalAmino; +} +export interface BatchExchangeModificationProposal { + title: string; + description: string; + spotMarketParamUpdateProposals: SpotMarketParamUpdateProposal[]; + derivativeMarketParamUpdateProposals: DerivativeMarketParamUpdateProposal[]; + spotMarketLaunchProposals: SpotMarketLaunchProposal[]; + perpetualMarketLaunchProposals: PerpetualMarketLaunchProposal[]; + expiryFuturesMarketLaunchProposals: ExpiryFuturesMarketLaunchProposal[]; + tradingRewardCampaignUpdateProposal?: TradingRewardCampaignUpdateProposal; + binaryOptionsMarketLaunchProposals: BinaryOptionsMarketLaunchProposal[]; + binaryOptionsParamUpdateProposals: BinaryOptionsMarketParamUpdateProposal[]; + denomDecimalsUpdateProposal?: UpdateDenomDecimalsProposal; + feeDiscountProposal?: FeeDiscountProposal; + marketForcedSettlementProposals: MarketForcedSettlementProposal[]; +} +export interface BatchExchangeModificationProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal"; + value: Uint8Array; +} +export interface BatchExchangeModificationProposalAmino { + title: string; + description: string; + spot_market_param_update_proposals: SpotMarketParamUpdateProposalAmino[]; + derivative_market_param_update_proposals: DerivativeMarketParamUpdateProposalAmino[]; + spot_market_launch_proposals: SpotMarketLaunchProposalAmino[]; + perpetual_market_launch_proposals: PerpetualMarketLaunchProposalAmino[]; + expiry_futures_market_launch_proposals: ExpiryFuturesMarketLaunchProposalAmino[]; + trading_reward_campaign_update_proposal?: TradingRewardCampaignUpdateProposalAmino; + binary_options_market_launch_proposals: BinaryOptionsMarketLaunchProposalAmino[]; + binary_options_param_update_proposals: BinaryOptionsMarketParamUpdateProposalAmino[]; + denom_decimals_update_proposal?: UpdateDenomDecimalsProposalAmino; + fee_discount_proposal?: FeeDiscountProposalAmino; + market_forced_settlement_proposals: MarketForcedSettlementProposalAmino[]; +} +export interface BatchExchangeModificationProposalAminoMsg { + type: "exchange/BatchExchangeModificationProposal"; + value: BatchExchangeModificationProposalAmino; +} +/** + * SpotMarketLaunchProposal defines a SDK message for proposing a new spot + * market through governance + */ +export interface SpotMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + baseDenom: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + makerFeeRate?: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + takerFeeRate?: string; + /** min_notional defines the minimum notional for orders in the market */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface SpotMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal"; + value: Uint8Array; +} +/** + * SpotMarketLaunchProposal defines a SDK message for proposing a new spot + * market through governance + */ +export interface SpotMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + base_denom: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + maker_fee_rate?: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + taker_fee_rate?: string; + /** min_notional defines the minimum notional for orders in the market */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface SpotMarketLaunchProposalAminoMsg { + type: "exchange/SpotMarketLaunchProposal"; + value: SpotMarketLaunchProposalAmino; +} +/** + * PerpetualMarketLaunchProposal defines a SDK message for proposing a new + * perpetual futures market through governance + */ +export interface PerpetualMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface PerpetualMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal"; + value: Uint8Array; +} +/** + * PerpetualMarketLaunchProposal defines a SDK message for proposing a new + * perpetual futures market through governance + */ +export interface PerpetualMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface PerpetualMarketLaunchProposalAminoMsg { + type: "exchange/PerpetualMarketLaunchProposal"; + value: PerpetualMarketLaunchProposalAmino; +} +export interface BinaryOptionsMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminPermissions: number; +} +export interface BinaryOptionsMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal"; + value: Uint8Array; +} +export interface BinaryOptionsMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_permissions: number; +} +export interface BinaryOptionsMarketLaunchProposalAminoMsg { + type: "exchange/BinaryOptionsMarketLaunchProposal"; + value: BinaryOptionsMarketLaunchProposalAmino; +} +/** + * ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new + * expiry futures market through governance + */ +export interface ExpiryFuturesMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** Expiration time of the market */ + expiry: bigint; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface ExpiryFuturesMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal"; + value: Uint8Array; +} +/** + * ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new + * expiry futures market through governance + */ +export interface ExpiryFuturesMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** Expiration time of the market */ + expiry: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface ExpiryFuturesMarketLaunchProposalAminoMsg { + type: "exchange/ExpiryFuturesMarketLaunchProposal"; + value: ExpiryFuturesMarketLaunchProposalAmino; +} +export interface DerivativeMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio?: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio?: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourlyInterestRate?: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourlyFundingRateCap?: string; + status: MarketStatus; + oracleParams?: OracleParams; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; + adminInfo?: AdminInfo; +} +export interface DerivativeMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface DerivativeMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio?: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio?: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + /** hourly_interest_rate defines the hourly interest rate */ + HourlyInterestRate?: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + HourlyFundingRateCap?: string; + status: MarketStatus; + oracle_params?: OracleParamsAmino; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; + admin_info?: AdminInfoAmino; +} +export interface DerivativeMarketParamUpdateProposalAminoMsg { + type: "exchange/DerivativeMarketParamUpdateProposal"; + value: DerivativeMarketParamUpdateProposalAmino; +} +export interface AdminInfo { + admin: string; + adminPermissions: number; +} +export interface AdminInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AdminInfo"; + value: Uint8Array; +} +export interface AdminInfoAmino { + admin: string; + admin_permissions: number; +} +export interface AdminInfoAminoMsg { + type: "/injective.exchange.v1beta1.AdminInfo"; + value: AdminInfoAmino; +} +export interface MarketForcedSettlementProposal { + title: string; + description: string; + marketId: string; + settlementPrice?: string; +} +export interface MarketForcedSettlementProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal"; + value: Uint8Array; +} +export interface MarketForcedSettlementProposalAmino { + title: string; + description: string; + market_id: string; + settlement_price?: string; +} +export interface MarketForcedSettlementProposalAminoMsg { + type: "exchange/MarketForcedSettlementProposal"; + value: MarketForcedSettlementProposalAmino; +} +export interface UpdateDenomDecimalsProposal { + title: string; + description: string; + denomDecimals: DenomDecimals[]; +} +export interface UpdateDenomDecimalsProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal"; + value: Uint8Array; +} +export interface UpdateDenomDecimalsProposalAmino { + title: string; + description: string; + denom_decimals: DenomDecimalsAmino[]; +} +export interface UpdateDenomDecimalsProposalAminoMsg { + type: "exchange/UpdateDenomDecimalsProposal"; + value: UpdateDenomDecimalsProposalAmino; +} +export interface BinaryOptionsMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** new price at which market will be settled */ + settlementPrice?: string; + /** admin of the market */ + admin: string; + status: MarketStatus; + oracleParams?: ProviderOracleParams; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; +} +export interface BinaryOptionsMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface BinaryOptionsMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** new price at which market will be settled */ + settlement_price?: string; + /** admin of the market */ + admin: string; + status: MarketStatus; + oracle_params?: ProviderOracleParamsAmino; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; +} +export interface BinaryOptionsMarketParamUpdateProposalAminoMsg { + type: "exchange/BinaryOptionsMarketParamUpdateProposal"; + value: BinaryOptionsMarketParamUpdateProposalAmino; +} +export interface ProviderOracleParams { + /** Oracle base currency */ + symbol: string; + /** Oracle quote currency */ + provider: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; +} +export interface ProviderOracleParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams"; + value: Uint8Array; +} +export interface ProviderOracleParamsAmino { + /** Oracle base currency */ + symbol: string; + /** Oracle quote currency */ + provider: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; +} +export interface ProviderOracleParamsAminoMsg { + type: "/injective.exchange.v1beta1.ProviderOracleParams"; + value: ProviderOracleParamsAmino; +} +export interface OracleParams { + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; +} +export interface OracleParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OracleParams"; + value: Uint8Array; +} +export interface OracleParamsAmino { + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; +} +export interface OracleParamsAminoMsg { + type: "/injective.exchange.v1beta1.OracleParams"; + value: OracleParamsAmino; +} +export interface TradingRewardCampaignLaunchProposal { + title: string; + description: string; + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPools: CampaignRewardPool[]; +} +export interface TradingRewardCampaignLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal"; + value: Uint8Array; +} +export interface TradingRewardCampaignLaunchProposalAmino { + title: string; + description: string; + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools: CampaignRewardPoolAmino[]; +} +export interface TradingRewardCampaignLaunchProposalAminoMsg { + type: "exchange/TradingRewardCampaignLaunchProposal"; + value: TradingRewardCampaignLaunchProposalAmino; +} +export interface TradingRewardCampaignUpdateProposal { + title: string; + description: string; + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPoolsAdditions: CampaignRewardPool[]; + campaignRewardPoolsUpdates: CampaignRewardPool[]; +} +export interface TradingRewardCampaignUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal"; + value: Uint8Array; +} +export interface TradingRewardCampaignUpdateProposalAmino { + title: string; + description: string; + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools_additions: CampaignRewardPoolAmino[]; + campaign_reward_pools_updates: CampaignRewardPoolAmino[]; +} +export interface TradingRewardCampaignUpdateProposalAminoMsg { + type: "exchange/TradingRewardCampaignUpdateProposal"; + value: TradingRewardCampaignUpdateProposalAmino; +} +export interface RewardPointUpdate { + accountAddress: string; + /** new_points overwrites the current trading reward points for the account */ + newPoints: string; +} +export interface RewardPointUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate"; + value: Uint8Array; +} +export interface RewardPointUpdateAmino { + account_address: string; + /** new_points overwrites the current trading reward points for the account */ + new_points: string; +} +export interface RewardPointUpdateAminoMsg { + type: "/injective.exchange.v1beta1.RewardPointUpdate"; + value: RewardPointUpdateAmino; +} +export interface TradingRewardPendingPointsUpdateProposal { + title: string; + description: string; + pendingPoolTimestamp: bigint; + rewardPointUpdates: RewardPointUpdate[]; +} +export interface TradingRewardPendingPointsUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal"; + value: Uint8Array; +} +export interface TradingRewardPendingPointsUpdateProposalAmino { + title: string; + description: string; + pending_pool_timestamp: string; + reward_point_updates: RewardPointUpdateAmino[]; +} +export interface TradingRewardPendingPointsUpdateProposalAminoMsg { + type: "exchange/TradingRewardPendingPointsUpdateProposal"; + value: TradingRewardPendingPointsUpdateProposalAmino; +} +export interface FeeDiscountProposal { + title: string; + description: string; + schedule?: FeeDiscountSchedule; +} +export interface FeeDiscountProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal"; + value: Uint8Array; +} +export interface FeeDiscountProposalAmino { + title: string; + description: string; + schedule?: FeeDiscountScheduleAmino; +} +export interface FeeDiscountProposalAminoMsg { + type: "exchange/FeeDiscountProposal"; + value: FeeDiscountProposalAmino; +} +export interface BatchCommunityPoolSpendProposal { + title: string; + description: string; + proposals: CommunityPoolSpendProposal[]; +} +export interface BatchCommunityPoolSpendProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal"; + value: Uint8Array; +} +export interface BatchCommunityPoolSpendProposalAmino { + title: string; + description: string; + proposals: CommunityPoolSpendProposalAmino[]; +} +export interface BatchCommunityPoolSpendProposalAminoMsg { + type: "exchange/BatchCommunityPoolSpendProposal"; + value: BatchCommunityPoolSpendProposalAmino; +} +/** + * AtomicMarketOrderFeeMultiplierScheduleProposal defines a SDK message for + * proposing new atomic take fee multipliers for specified markets + */ +export interface AtomicMarketOrderFeeMultiplierScheduleProposal { + title: string; + description: string; + marketFeeMultipliers: MarketFeeMultiplier[]; +} +export interface AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal"; + value: Uint8Array; +} +/** + * AtomicMarketOrderFeeMultiplierScheduleProposal defines a SDK message for + * proposing new atomic take fee multipliers for specified markets + */ +export interface AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + title: string; + description: string; + market_fee_multipliers: MarketFeeMultiplierAmino[]; +} +export interface AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg { + type: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal"; + value: AtomicMarketOrderFeeMultiplierScheduleProposalAmino; +} +function createBaseSpotMarketParamUpdateProposal(): SpotMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + status: 0, + ticker: undefined, + minNotional: undefined, + adminInfo: undefined + }; +} +export const SpotMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal", + aminoType: "exchange/SpotMarketParamUpdateProposal", + is(o: any): o is SpotMarketParamUpdateProposal { + return o && (o.$typeUrl === SpotMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && isSet(o.status)); + }, + isAmino(o: any): o is SpotMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === SpotMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && isSet(o.status)); + }, + encode(message: SpotMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(58).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(66).string(message.minQuantityTickSize); + } + if (message.status !== 0) { + writer.uint32(72).int32(message.status); + } + if (message.ticker !== undefined) { + writer.uint32(82).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(90).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(98).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.minPriceTickSize = reader.string(); + break; + case 8: + message.minQuantityTickSize = reader.string(); + break; + case 9: + message.status = (reader.int32() as any); + break; + case 10: + message.ticker = reader.string(); + break; + case 11: + message.minNotional = reader.string(); + break; + case 12: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketParamUpdateProposal { + const message = createBaseSpotMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.status = object.status ?? 0; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: SpotMarketParamUpdateProposalAmino): SpotMarketParamUpdateProposal { + const message = createBaseSpotMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.status = message.status === 0 ? undefined : message.status; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: SpotMarketParamUpdateProposalAminoMsg): SpotMarketParamUpdateProposal { + return SpotMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/SpotMarketParamUpdateProposal", + value: SpotMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SpotMarketParamUpdateProposalProtoMsg): SpotMarketParamUpdateProposal { + return SpotMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: SpotMarketParamUpdateProposal): Uint8Array { + return SpotMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal", + value: SpotMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketParamUpdateProposal.typeUrl, SpotMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotMarketParamUpdateProposal.aminoType, SpotMarketParamUpdateProposal.typeUrl); +function createBaseExchangeEnableProposal(): ExchangeEnableProposal { + return { + title: "", + description: "", + exchangeType: 0 + }; +} +export const ExchangeEnableProposal = { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal", + aminoType: "exchange/ExchangeEnableProposal", + is(o: any): o is ExchangeEnableProposal { + return o && (o.$typeUrl === ExchangeEnableProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && isSet(o.exchangeType)); + }, + isAmino(o: any): o is ExchangeEnableProposalAmino { + return o && (o.$typeUrl === ExchangeEnableProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && isSet(o.exchangeType)); + }, + encode(message: ExchangeEnableProposal, 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.exchangeType !== 0) { + writer.uint32(24).int32(message.exchangeType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExchangeEnableProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeEnableProposal(); + 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.exchangeType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExchangeEnableProposal { + const message = createBaseExchangeEnableProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.exchangeType = object.exchangeType ?? 0; + return message; + }, + fromAmino(object: ExchangeEnableProposalAmino): ExchangeEnableProposal { + const message = createBaseExchangeEnableProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.exchangeType !== undefined && object.exchangeType !== null) { + message.exchangeType = object.exchangeType; + } + return message; + }, + toAmino(message: ExchangeEnableProposal): ExchangeEnableProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.exchangeType = message.exchangeType === 0 ? undefined : message.exchangeType; + return obj; + }, + fromAminoMsg(object: ExchangeEnableProposalAminoMsg): ExchangeEnableProposal { + return ExchangeEnableProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExchangeEnableProposal): ExchangeEnableProposalAminoMsg { + return { + type: "exchange/ExchangeEnableProposal", + value: ExchangeEnableProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExchangeEnableProposalProtoMsg): ExchangeEnableProposal { + return ExchangeEnableProposal.decode(message.value); + }, + toProto(message: ExchangeEnableProposal): Uint8Array { + return ExchangeEnableProposal.encode(message).finish(); + }, + toProtoMsg(message: ExchangeEnableProposal): ExchangeEnableProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal", + value: ExchangeEnableProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExchangeEnableProposal.typeUrl, ExchangeEnableProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExchangeEnableProposal.aminoType, ExchangeEnableProposal.typeUrl); +function createBaseBatchExchangeModificationProposal(): BatchExchangeModificationProposal { + return { + title: "", + description: "", + spotMarketParamUpdateProposals: [], + derivativeMarketParamUpdateProposals: [], + spotMarketLaunchProposals: [], + perpetualMarketLaunchProposals: [], + expiryFuturesMarketLaunchProposals: [], + tradingRewardCampaignUpdateProposal: undefined, + binaryOptionsMarketLaunchProposals: [], + binaryOptionsParamUpdateProposals: [], + denomDecimalsUpdateProposal: undefined, + feeDiscountProposal: undefined, + marketForcedSettlementProposals: [] + }; +} +export const BatchExchangeModificationProposal = { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal", + aminoType: "exchange/BatchExchangeModificationProposal", + is(o: any): o is BatchExchangeModificationProposal { + return o && (o.$typeUrl === BatchExchangeModificationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.spotMarketParamUpdateProposals) && (!o.spotMarketParamUpdateProposals.length || SpotMarketParamUpdateProposal.is(o.spotMarketParamUpdateProposals[0])) && Array.isArray(o.derivativeMarketParamUpdateProposals) && (!o.derivativeMarketParamUpdateProposals.length || DerivativeMarketParamUpdateProposal.is(o.derivativeMarketParamUpdateProposals[0])) && Array.isArray(o.spotMarketLaunchProposals) && (!o.spotMarketLaunchProposals.length || SpotMarketLaunchProposal.is(o.spotMarketLaunchProposals[0])) && Array.isArray(o.perpetualMarketLaunchProposals) && (!o.perpetualMarketLaunchProposals.length || PerpetualMarketLaunchProposal.is(o.perpetualMarketLaunchProposals[0])) && Array.isArray(o.expiryFuturesMarketLaunchProposals) && (!o.expiryFuturesMarketLaunchProposals.length || ExpiryFuturesMarketLaunchProposal.is(o.expiryFuturesMarketLaunchProposals[0])) && Array.isArray(o.binaryOptionsMarketLaunchProposals) && (!o.binaryOptionsMarketLaunchProposals.length || BinaryOptionsMarketLaunchProposal.is(o.binaryOptionsMarketLaunchProposals[0])) && Array.isArray(o.binaryOptionsParamUpdateProposals) && (!o.binaryOptionsParamUpdateProposals.length || BinaryOptionsMarketParamUpdateProposal.is(o.binaryOptionsParamUpdateProposals[0])) && Array.isArray(o.marketForcedSettlementProposals) && (!o.marketForcedSettlementProposals.length || MarketForcedSettlementProposal.is(o.marketForcedSettlementProposals[0]))); + }, + isAmino(o: any): o is BatchExchangeModificationProposalAmino { + return o && (o.$typeUrl === BatchExchangeModificationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.spot_market_param_update_proposals) && (!o.spot_market_param_update_proposals.length || SpotMarketParamUpdateProposal.isAmino(o.spot_market_param_update_proposals[0])) && Array.isArray(o.derivative_market_param_update_proposals) && (!o.derivative_market_param_update_proposals.length || DerivativeMarketParamUpdateProposal.isAmino(o.derivative_market_param_update_proposals[0])) && Array.isArray(o.spot_market_launch_proposals) && (!o.spot_market_launch_proposals.length || SpotMarketLaunchProposal.isAmino(o.spot_market_launch_proposals[0])) && Array.isArray(o.perpetual_market_launch_proposals) && (!o.perpetual_market_launch_proposals.length || PerpetualMarketLaunchProposal.isAmino(o.perpetual_market_launch_proposals[0])) && Array.isArray(o.expiry_futures_market_launch_proposals) && (!o.expiry_futures_market_launch_proposals.length || ExpiryFuturesMarketLaunchProposal.isAmino(o.expiry_futures_market_launch_proposals[0])) && Array.isArray(o.binary_options_market_launch_proposals) && (!o.binary_options_market_launch_proposals.length || BinaryOptionsMarketLaunchProposal.isAmino(o.binary_options_market_launch_proposals[0])) && Array.isArray(o.binary_options_param_update_proposals) && (!o.binary_options_param_update_proposals.length || BinaryOptionsMarketParamUpdateProposal.isAmino(o.binary_options_param_update_proposals[0])) && Array.isArray(o.market_forced_settlement_proposals) && (!o.market_forced_settlement_proposals.length || MarketForcedSettlementProposal.isAmino(o.market_forced_settlement_proposals[0]))); + }, + encode(message: BatchExchangeModificationProposal, 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.spotMarketParamUpdateProposals) { + SpotMarketParamUpdateProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.derivativeMarketParamUpdateProposals) { + DerivativeMarketParamUpdateProposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.spotMarketLaunchProposals) { + SpotMarketLaunchProposal.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.perpetualMarketLaunchProposals) { + PerpetualMarketLaunchProposal.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.expiryFuturesMarketLaunchProposals) { + ExpiryFuturesMarketLaunchProposal.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.tradingRewardCampaignUpdateProposal !== undefined) { + TradingRewardCampaignUpdateProposal.encode(message.tradingRewardCampaignUpdateProposal, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketLaunchProposals) { + BinaryOptionsMarketLaunchProposal.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.binaryOptionsParamUpdateProposals) { + BinaryOptionsMarketParamUpdateProposal.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.denomDecimalsUpdateProposal !== undefined) { + UpdateDenomDecimalsProposal.encode(message.denomDecimalsUpdateProposal, writer.uint32(90).fork()).ldelim(); + } + if (message.feeDiscountProposal !== undefined) { + FeeDiscountProposal.encode(message.feeDiscountProposal, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.marketForcedSettlementProposals) { + MarketForcedSettlementProposal.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchExchangeModificationProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchExchangeModificationProposal(); + 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.spotMarketParamUpdateProposals.push(SpotMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 4: + message.derivativeMarketParamUpdateProposals.push(DerivativeMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 5: + message.spotMarketLaunchProposals.push(SpotMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 6: + message.perpetualMarketLaunchProposals.push(PerpetualMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 7: + message.expiryFuturesMarketLaunchProposals.push(ExpiryFuturesMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 8: + message.tradingRewardCampaignUpdateProposal = TradingRewardCampaignUpdateProposal.decode(reader, reader.uint32()); + break; + case 9: + message.binaryOptionsMarketLaunchProposals.push(BinaryOptionsMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 10: + message.binaryOptionsParamUpdateProposals.push(BinaryOptionsMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 11: + message.denomDecimalsUpdateProposal = UpdateDenomDecimalsProposal.decode(reader, reader.uint32()); + break; + case 12: + message.feeDiscountProposal = FeeDiscountProposal.decode(reader, reader.uint32()); + break; + case 13: + message.marketForcedSettlementProposals.push(MarketForcedSettlementProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchExchangeModificationProposal { + const message = createBaseBatchExchangeModificationProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.spotMarketParamUpdateProposals = object.spotMarketParamUpdateProposals?.map(e => SpotMarketParamUpdateProposal.fromPartial(e)) || []; + message.derivativeMarketParamUpdateProposals = object.derivativeMarketParamUpdateProposals?.map(e => DerivativeMarketParamUpdateProposal.fromPartial(e)) || []; + message.spotMarketLaunchProposals = object.spotMarketLaunchProposals?.map(e => SpotMarketLaunchProposal.fromPartial(e)) || []; + message.perpetualMarketLaunchProposals = object.perpetualMarketLaunchProposals?.map(e => PerpetualMarketLaunchProposal.fromPartial(e)) || []; + message.expiryFuturesMarketLaunchProposals = object.expiryFuturesMarketLaunchProposals?.map(e => ExpiryFuturesMarketLaunchProposal.fromPartial(e)) || []; + message.tradingRewardCampaignUpdateProposal = object.tradingRewardCampaignUpdateProposal !== undefined && object.tradingRewardCampaignUpdateProposal !== null ? TradingRewardCampaignUpdateProposal.fromPartial(object.tradingRewardCampaignUpdateProposal) : undefined; + message.binaryOptionsMarketLaunchProposals = object.binaryOptionsMarketLaunchProposals?.map(e => BinaryOptionsMarketLaunchProposal.fromPartial(e)) || []; + message.binaryOptionsParamUpdateProposals = object.binaryOptionsParamUpdateProposals?.map(e => BinaryOptionsMarketParamUpdateProposal.fromPartial(e)) || []; + message.denomDecimalsUpdateProposal = object.denomDecimalsUpdateProposal !== undefined && object.denomDecimalsUpdateProposal !== null ? UpdateDenomDecimalsProposal.fromPartial(object.denomDecimalsUpdateProposal) : undefined; + message.feeDiscountProposal = object.feeDiscountProposal !== undefined && object.feeDiscountProposal !== null ? FeeDiscountProposal.fromPartial(object.feeDiscountProposal) : undefined; + message.marketForcedSettlementProposals = object.marketForcedSettlementProposals?.map(e => MarketForcedSettlementProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchExchangeModificationProposalAmino): BatchExchangeModificationProposal { + const message = createBaseBatchExchangeModificationProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.spotMarketParamUpdateProposals = object.spot_market_param_update_proposals?.map(e => SpotMarketParamUpdateProposal.fromAmino(e)) || []; + message.derivativeMarketParamUpdateProposals = object.derivative_market_param_update_proposals?.map(e => DerivativeMarketParamUpdateProposal.fromAmino(e)) || []; + message.spotMarketLaunchProposals = object.spot_market_launch_proposals?.map(e => SpotMarketLaunchProposal.fromAmino(e)) || []; + message.perpetualMarketLaunchProposals = object.perpetual_market_launch_proposals?.map(e => PerpetualMarketLaunchProposal.fromAmino(e)) || []; + message.expiryFuturesMarketLaunchProposals = object.expiry_futures_market_launch_proposals?.map(e => ExpiryFuturesMarketLaunchProposal.fromAmino(e)) || []; + if (object.trading_reward_campaign_update_proposal !== undefined && object.trading_reward_campaign_update_proposal !== null) { + message.tradingRewardCampaignUpdateProposal = TradingRewardCampaignUpdateProposal.fromAmino(object.trading_reward_campaign_update_proposal); + } + message.binaryOptionsMarketLaunchProposals = object.binary_options_market_launch_proposals?.map(e => BinaryOptionsMarketLaunchProposal.fromAmino(e)) || []; + message.binaryOptionsParamUpdateProposals = object.binary_options_param_update_proposals?.map(e => BinaryOptionsMarketParamUpdateProposal.fromAmino(e)) || []; + if (object.denom_decimals_update_proposal !== undefined && object.denom_decimals_update_proposal !== null) { + message.denomDecimalsUpdateProposal = UpdateDenomDecimalsProposal.fromAmino(object.denom_decimals_update_proposal); + } + if (object.fee_discount_proposal !== undefined && object.fee_discount_proposal !== null) { + message.feeDiscountProposal = FeeDiscountProposal.fromAmino(object.fee_discount_proposal); + } + message.marketForcedSettlementProposals = object.market_forced_settlement_proposals?.map(e => MarketForcedSettlementProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.spotMarketParamUpdateProposals) { + obj.spot_market_param_update_proposals = message.spotMarketParamUpdateProposals.map(e => e ? SpotMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.spot_market_param_update_proposals = message.spotMarketParamUpdateProposals; + } + if (message.derivativeMarketParamUpdateProposals) { + obj.derivative_market_param_update_proposals = message.derivativeMarketParamUpdateProposals.map(e => e ? DerivativeMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.derivative_market_param_update_proposals = message.derivativeMarketParamUpdateProposals; + } + if (message.spotMarketLaunchProposals) { + obj.spot_market_launch_proposals = message.spotMarketLaunchProposals.map(e => e ? SpotMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.spot_market_launch_proposals = message.spotMarketLaunchProposals; + } + if (message.perpetualMarketLaunchProposals) { + obj.perpetual_market_launch_proposals = message.perpetualMarketLaunchProposals.map(e => e ? PerpetualMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.perpetual_market_launch_proposals = message.perpetualMarketLaunchProposals; + } + if (message.expiryFuturesMarketLaunchProposals) { + obj.expiry_futures_market_launch_proposals = message.expiryFuturesMarketLaunchProposals.map(e => e ? ExpiryFuturesMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.expiry_futures_market_launch_proposals = message.expiryFuturesMarketLaunchProposals; + } + obj.trading_reward_campaign_update_proposal = message.tradingRewardCampaignUpdateProposal ? TradingRewardCampaignUpdateProposal.toAmino(message.tradingRewardCampaignUpdateProposal) : undefined; + if (message.binaryOptionsMarketLaunchProposals) { + obj.binary_options_market_launch_proposals = message.binaryOptionsMarketLaunchProposals.map(e => e ? BinaryOptionsMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.binary_options_market_launch_proposals = message.binaryOptionsMarketLaunchProposals; + } + if (message.binaryOptionsParamUpdateProposals) { + obj.binary_options_param_update_proposals = message.binaryOptionsParamUpdateProposals.map(e => e ? BinaryOptionsMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.binary_options_param_update_proposals = message.binaryOptionsParamUpdateProposals; + } + obj.denom_decimals_update_proposal = message.denomDecimalsUpdateProposal ? UpdateDenomDecimalsProposal.toAmino(message.denomDecimalsUpdateProposal) : undefined; + obj.fee_discount_proposal = message.feeDiscountProposal ? FeeDiscountProposal.toAmino(message.feeDiscountProposal) : undefined; + if (message.marketForcedSettlementProposals) { + obj.market_forced_settlement_proposals = message.marketForcedSettlementProposals.map(e => e ? MarketForcedSettlementProposal.toAmino(e) : undefined); + } else { + obj.market_forced_settlement_proposals = message.marketForcedSettlementProposals; + } + return obj; + }, + fromAminoMsg(object: BatchExchangeModificationProposalAminoMsg): BatchExchangeModificationProposal { + return BatchExchangeModificationProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalAminoMsg { + return { + type: "exchange/BatchExchangeModificationProposal", + value: BatchExchangeModificationProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchExchangeModificationProposalProtoMsg): BatchExchangeModificationProposal { + return BatchExchangeModificationProposal.decode(message.value); + }, + toProto(message: BatchExchangeModificationProposal): Uint8Array { + return BatchExchangeModificationProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal", + value: BatchExchangeModificationProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchExchangeModificationProposal.typeUrl, BatchExchangeModificationProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchExchangeModificationProposal.aminoType, BatchExchangeModificationProposal.typeUrl); +function createBaseSpotMarketLaunchProposal(): SpotMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + baseDenom: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + minNotional: "", + adminInfo: undefined + }; +} +export const SpotMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal", + aminoType: "exchange/SpotMarketLaunchProposal", + is(o: any): o is SpotMarketLaunchProposal { + return o && (o.$typeUrl === SpotMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is SpotMarketLaunchProposalAmino { + return o && (o.$typeUrl === SpotMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: SpotMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(34).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(42).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(50).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(58).string(message.minQuantityTickSize); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(66).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(74).string(message.takerFeeRate); + } + if (message.minNotional !== "") { + writer.uint32(82).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.baseDenom = reader.string(); + break; + case 5: + message.quoteDenom = reader.string(); + break; + case 6: + message.minPriceTickSize = reader.string(); + break; + case 7: + message.minQuantityTickSize = reader.string(); + break; + case 8: + message.makerFeeRate = reader.string(); + break; + case 9: + message.takerFeeRate = reader.string(); + break; + case 10: + message.minNotional = reader.string(); + break; + case 11: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketLaunchProposal { + const message = createBaseSpotMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: SpotMarketLaunchProposalAmino): SpotMarketLaunchProposal { + const message = createBaseSpotMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: SpotMarketLaunchProposalAminoMsg): SpotMarketLaunchProposal { + return SpotMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalAminoMsg { + return { + type: "exchange/SpotMarketLaunchProposal", + value: SpotMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SpotMarketLaunchProposalProtoMsg): SpotMarketLaunchProposal { + return SpotMarketLaunchProposal.decode(message.value); + }, + toProto(message: SpotMarketLaunchProposal): Uint8Array { + return SpotMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal", + value: SpotMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketLaunchProposal.typeUrl, SpotMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotMarketLaunchProposal.aminoType, SpotMarketLaunchProposal.typeUrl); +function createBasePerpetualMarketLaunchProposal(): PerpetualMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminInfo: undefined + }; +} +export const PerpetualMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal", + aminoType: "exchange/PerpetualMarketLaunchProposal", + is(o: any): o is PerpetualMarketLaunchProposal { + return o && (o.$typeUrl === PerpetualMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is PerpetualMarketLaunchProposalAmino { + return o && (o.$typeUrl === PerpetualMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: PerpetualMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(42).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(50).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(64).int32(message.oracleType); + } + if (message.initialMarginRatio !== "") { + writer.uint32(74).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(82).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(90).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(98).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.oracleBase = reader.string(); + break; + case 6: + message.oracleQuote = reader.string(); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.oracleType = (reader.int32() as any); + break; + case 9: + message.initialMarginRatio = reader.string(); + break; + case 10: + message.maintenanceMarginRatio = reader.string(); + break; + case 11: + message.makerFeeRate = reader.string(); + break; + case 12: + message.takerFeeRate = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + case 16: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketLaunchProposal { + const message = createBasePerpetualMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketLaunchProposalAmino): PerpetualMarketLaunchProposal { + const message = createBasePerpetualMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketLaunchProposalAminoMsg): PerpetualMarketLaunchProposal { + return PerpetualMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalAminoMsg { + return { + type: "exchange/PerpetualMarketLaunchProposal", + value: PerpetualMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: PerpetualMarketLaunchProposalProtoMsg): PerpetualMarketLaunchProposal { + return PerpetualMarketLaunchProposal.decode(message.value); + }, + toProto(message: PerpetualMarketLaunchProposal): Uint8Array { + return PerpetualMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal", + value: PerpetualMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketLaunchProposal.typeUrl, PerpetualMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(PerpetualMarketLaunchProposal.aminoType, PerpetualMarketLaunchProposal.typeUrl); +function createBaseBinaryOptionsMarketLaunchProposal(): BinaryOptionsMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminPermissions: 0 + }; +} +export const BinaryOptionsMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal", + aminoType: "exchange/BinaryOptionsMarketLaunchProposal", + is(o: any): o is BinaryOptionsMarketLaunchProposal { + return o && (o.$typeUrl === BinaryOptionsMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is BinaryOptionsMarketLaunchProposalAmino { + return o && (o.$typeUrl === BinaryOptionsMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: BinaryOptionsMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(34).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(42).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(64).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(82).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(90).string(message.quoteDenom); + } + if (message.makerFeeRate !== "") { + writer.uint32(98).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(106).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(114).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(122).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(130).string(message.minNotional); + } + if (message.adminPermissions !== 0) { + writer.uint32(136).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.oracleSymbol = reader.string(); + break; + case 5: + message.oracleProvider = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.expirationTimestamp = reader.int64(); + break; + case 9: + message.settlementTimestamp = reader.int64(); + break; + case 10: + message.admin = reader.string(); + break; + case 11: + message.quoteDenom = reader.string(); + break; + case 12: + message.makerFeeRate = reader.string(); + break; + case 13: + message.takerFeeRate = reader.string(); + break; + case 14: + message.minPriceTickSize = reader.string(); + break; + case 15: + message.minQuantityTickSize = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarketLaunchProposal { + const message = createBaseBinaryOptionsMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: BinaryOptionsMarketLaunchProposalAmino): BinaryOptionsMarketLaunchProposal { + const message = createBaseBinaryOptionsMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketLaunchProposalAminoMsg): BinaryOptionsMarketLaunchProposal { + return BinaryOptionsMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalAminoMsg { + return { + type: "exchange/BinaryOptionsMarketLaunchProposal", + value: BinaryOptionsMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BinaryOptionsMarketLaunchProposalProtoMsg): BinaryOptionsMarketLaunchProposal { + return BinaryOptionsMarketLaunchProposal.decode(message.value); + }, + toProto(message: BinaryOptionsMarketLaunchProposal): Uint8Array { + return BinaryOptionsMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal", + value: BinaryOptionsMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarketLaunchProposal.typeUrl, BinaryOptionsMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BinaryOptionsMarketLaunchProposal.aminoType, BinaryOptionsMarketLaunchProposal.typeUrl); +function createBaseExpiryFuturesMarketLaunchProposal(): ExpiryFuturesMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + expiry: BigInt(0), + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminInfo: undefined + }; +} +export const ExpiryFuturesMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal", + aminoType: "exchange/ExpiryFuturesMarketLaunchProposal", + is(o: any): o is ExpiryFuturesMarketLaunchProposal { + return o && (o.$typeUrl === ExpiryFuturesMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.expiry === "bigint" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketLaunchProposalAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.expiry === "bigint" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: ExpiryFuturesMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(42).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(50).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(64).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(72).int64(message.expiry); + } + if (message.initialMarginRatio !== "") { + writer.uint32(82).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(90).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(98).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(106).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(114).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(122).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(130).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.oracleBase = reader.string(); + break; + case 6: + message.oracleQuote = reader.string(); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.oracleType = (reader.int32() as any); + break; + case 9: + message.expiry = reader.int64(); + break; + case 10: + message.initialMarginRatio = reader.string(); + break; + case 11: + message.maintenanceMarginRatio = reader.string(); + break; + case 12: + message.makerFeeRate = reader.string(); + break; + case 13: + message.takerFeeRate = reader.string(); + break; + case 14: + message.minPriceTickSize = reader.string(); + break; + case 15: + message.minQuantityTickSize = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketLaunchProposal { + const message = createBaseExpiryFuturesMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: ExpiryFuturesMarketLaunchProposalAmino): ExpiryFuturesMarketLaunchProposal { + const message = createBaseExpiryFuturesMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketLaunchProposalAminoMsg): ExpiryFuturesMarketLaunchProposal { + return ExpiryFuturesMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalAminoMsg { + return { + type: "exchange/ExpiryFuturesMarketLaunchProposal", + value: ExpiryFuturesMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExpiryFuturesMarketLaunchProposalProtoMsg): ExpiryFuturesMarketLaunchProposal { + return ExpiryFuturesMarketLaunchProposal.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketLaunchProposal): Uint8Array { + return ExpiryFuturesMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal", + value: ExpiryFuturesMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketLaunchProposal.typeUrl, ExpiryFuturesMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExpiryFuturesMarketLaunchProposal.aminoType, ExpiryFuturesMarketLaunchProposal.typeUrl); +function createBaseDerivativeMarketParamUpdateProposal(): DerivativeMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + initialMarginRatio: undefined, + maintenanceMarginRatio: undefined, + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + hourlyInterestRate: undefined, + hourlyFundingRateCap: undefined, + status: 0, + oracleParams: undefined, + ticker: undefined, + minNotional: undefined, + adminInfo: undefined + }; +} +export const DerivativeMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal", + aminoType: "exchange/DerivativeMarketParamUpdateProposal", + is(o: any): o is DerivativeMarketParamUpdateProposal { + return o && (o.$typeUrl === DerivativeMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && isSet(o.status)); + }, + isAmino(o: any): o is DerivativeMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === DerivativeMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && isSet(o.status)); + }, + encode(message: DerivativeMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.initialMarginRatio !== undefined) { + writer.uint32(34).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== undefined) { + writer.uint32(42).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(50).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(58).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(66).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(74).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(82).string(message.minQuantityTickSize); + } + if (message.hourlyInterestRate !== undefined) { + writer.uint32(90).string(message.hourlyInterestRate); + } + if (message.hourlyFundingRateCap !== undefined) { + writer.uint32(98).string(message.hourlyFundingRateCap); + } + if (message.status !== 0) { + writer.uint32(104).int32(message.status); + } + if (message.oracleParams !== undefined) { + OracleParams.encode(message.oracleParams, writer.uint32(114).fork()).ldelim(); + } + if (message.ticker !== undefined) { + writer.uint32(122).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(130).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.initialMarginRatio = reader.string(); + break; + case 5: + message.maintenanceMarginRatio = reader.string(); + break; + case 6: + message.makerFeeRate = reader.string(); + break; + case 7: + message.takerFeeRate = reader.string(); + break; + case 8: + message.relayerFeeShareRate = reader.string(); + break; + case 9: + message.minPriceTickSize = reader.string(); + break; + case 10: + message.minQuantityTickSize = reader.string(); + break; + case 11: + message.hourlyInterestRate = reader.string(); + break; + case 12: + message.hourlyFundingRateCap = reader.string(); + break; + case 13: + message.status = (reader.int32() as any); + break; + case 14: + message.oracleParams = OracleParams.decode(reader, reader.uint32()); + break; + case 15: + message.ticker = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketParamUpdateProposal { + const message = createBaseDerivativeMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? undefined; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? undefined; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.hourlyInterestRate = object.hourlyInterestRate ?? undefined; + message.hourlyFundingRateCap = object.hourlyFundingRateCap ?? undefined; + message.status = object.status ?? 0; + message.oracleParams = object.oracleParams !== undefined && object.oracleParams !== null ? OracleParams.fromPartial(object.oracleParams) : undefined; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: DerivativeMarketParamUpdateProposalAmino): DerivativeMarketParamUpdateProposal { + const message = createBaseDerivativeMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.HourlyInterestRate !== undefined && object.HourlyInterestRate !== null) { + message.hourlyInterestRate = object.HourlyInterestRate; + } + if (object.HourlyFundingRateCap !== undefined && object.HourlyFundingRateCap !== null) { + message.hourlyFundingRateCap = object.HourlyFundingRateCap; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.oracle_params !== undefined && object.oracle_params !== null) { + message.oracleParams = OracleParams.fromAmino(object.oracle_params); + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.initial_margin_ratio = message.initialMarginRatio === null ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === null ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.HourlyInterestRate = message.hourlyInterestRate === null ? undefined : message.hourlyInterestRate; + obj.HourlyFundingRateCap = message.hourlyFundingRateCap === null ? undefined : message.hourlyFundingRateCap; + obj.status = message.status === 0 ? undefined : message.status; + obj.oracle_params = message.oracleParams ? OracleParams.toAmino(message.oracleParams) : undefined; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeMarketParamUpdateProposalAminoMsg): DerivativeMarketParamUpdateProposal { + return DerivativeMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/DerivativeMarketParamUpdateProposal", + value: DerivativeMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: DerivativeMarketParamUpdateProposalProtoMsg): DerivativeMarketParamUpdateProposal { + return DerivativeMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: DerivativeMarketParamUpdateProposal): Uint8Array { + return DerivativeMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal", + value: DerivativeMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketParamUpdateProposal.typeUrl, DerivativeMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(DerivativeMarketParamUpdateProposal.aminoType, DerivativeMarketParamUpdateProposal.typeUrl); +function createBaseAdminInfo(): AdminInfo { + return { + admin: "", + adminPermissions: 0 + }; +} +export const AdminInfo = { + typeUrl: "/injective.exchange.v1beta1.AdminInfo", + is(o: any): o is AdminInfo { + return o && (o.$typeUrl === AdminInfo.typeUrl || typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is AdminInfoAmino { + return o && (o.$typeUrl === AdminInfo.typeUrl || typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: AdminInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(16).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AdminInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAdminInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AdminInfo { + const message = createBaseAdminInfo(); + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: AdminInfoAmino): AdminInfo { + const message = createBaseAdminInfo(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: AdminInfo): AdminInfoAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: AdminInfoAminoMsg): AdminInfo { + return AdminInfo.fromAmino(object.value); + }, + fromProtoMsg(message: AdminInfoProtoMsg): AdminInfo { + return AdminInfo.decode(message.value); + }, + toProto(message: AdminInfo): Uint8Array { + return AdminInfo.encode(message).finish(); + }, + toProtoMsg(message: AdminInfo): AdminInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AdminInfo", + value: AdminInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AdminInfo.typeUrl, AdminInfo); +function createBaseMarketForcedSettlementProposal(): MarketForcedSettlementProposal { + return { + title: "", + description: "", + marketId: "", + settlementPrice: undefined + }; +} +export const MarketForcedSettlementProposal = { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal", + aminoType: "exchange/MarketForcedSettlementProposal", + is(o: any): o is MarketForcedSettlementProposal { + return o && (o.$typeUrl === MarketForcedSettlementProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MarketForcedSettlementProposalAmino { + return o && (o.$typeUrl === MarketForcedSettlementProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string"); + }, + encode(message: MarketForcedSettlementProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.settlementPrice !== undefined) { + writer.uint32(34).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketForcedSettlementProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketForcedSettlementProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketForcedSettlementProposal { + const message = createBaseMarketForcedSettlementProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + return message; + }, + fromAmino(object: MarketForcedSettlementProposalAmino): MarketForcedSettlementProposal { + const message = createBaseMarketForcedSettlementProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: MarketForcedSettlementProposalAminoMsg): MarketForcedSettlementProposal { + return MarketForcedSettlementProposal.fromAmino(object.value); + }, + toAminoMsg(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalAminoMsg { + return { + type: "exchange/MarketForcedSettlementProposal", + value: MarketForcedSettlementProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MarketForcedSettlementProposalProtoMsg): MarketForcedSettlementProposal { + return MarketForcedSettlementProposal.decode(message.value); + }, + toProto(message: MarketForcedSettlementProposal): Uint8Array { + return MarketForcedSettlementProposal.encode(message).finish(); + }, + toProtoMsg(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal", + value: MarketForcedSettlementProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketForcedSettlementProposal.typeUrl, MarketForcedSettlementProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MarketForcedSettlementProposal.aminoType, MarketForcedSettlementProposal.typeUrl); +function createBaseUpdateDenomDecimalsProposal(): UpdateDenomDecimalsProposal { + return { + title: "", + description: "", + denomDecimals: [] + }; +} +export const UpdateDenomDecimalsProposal = { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal", + aminoType: "exchange/UpdateDenomDecimalsProposal", + is(o: any): o is UpdateDenomDecimalsProposal { + return o && (o.$typeUrl === UpdateDenomDecimalsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0]))); + }, + isAmino(o: any): o is UpdateDenomDecimalsProposalAmino { + return o && (o.$typeUrl === UpdateDenomDecimalsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0]))); + }, + encode(message: UpdateDenomDecimalsProposal, 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.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateDenomDecimalsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateDenomDecimalsProposal(); + 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.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UpdateDenomDecimalsProposal { + const message = createBaseUpdateDenomDecimalsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateDenomDecimalsProposalAmino): UpdateDenomDecimalsProposal { + const message = createBaseUpdateDenomDecimalsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + return obj; + }, + fromAminoMsg(object: UpdateDenomDecimalsProposalAminoMsg): UpdateDenomDecimalsProposal { + return UpdateDenomDecimalsProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalAminoMsg { + return { + type: "exchange/UpdateDenomDecimalsProposal", + value: UpdateDenomDecimalsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateDenomDecimalsProposalProtoMsg): UpdateDenomDecimalsProposal { + return UpdateDenomDecimalsProposal.decode(message.value); + }, + toProto(message: UpdateDenomDecimalsProposal): Uint8Array { + return UpdateDenomDecimalsProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal", + value: UpdateDenomDecimalsProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UpdateDenomDecimalsProposal.typeUrl, UpdateDenomDecimalsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateDenomDecimalsProposal.aminoType, UpdateDenomDecimalsProposal.typeUrl); +function createBaseBinaryOptionsMarketParamUpdateProposal(): BinaryOptionsMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + settlementPrice: undefined, + admin: "", + status: 0, + oracleParams: undefined, + ticker: undefined, + minNotional: undefined + }; +} +export const BinaryOptionsMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal", + aminoType: "exchange/BinaryOptionsMarketParamUpdateProposal", + is(o: any): o is BinaryOptionsMarketParamUpdateProposal { + return o && (o.$typeUrl === BinaryOptionsMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && isSet(o.status)); + }, + isAmino(o: any): o is BinaryOptionsMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === BinaryOptionsMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && isSet(o.status)); + }, + encode(message: BinaryOptionsMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(58).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(66).string(message.minQuantityTickSize); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(80).int64(message.settlementTimestamp); + } + if (message.settlementPrice !== undefined) { + writer.uint32(90).string(message.settlementPrice); + } + if (message.admin !== "") { + writer.uint32(98).string(message.admin); + } + if (message.status !== 0) { + writer.uint32(104).int32(message.status); + } + if (message.oracleParams !== undefined) { + ProviderOracleParams.encode(message.oracleParams, writer.uint32(114).fork()).ldelim(); + } + if (message.ticker !== undefined) { + writer.uint32(122).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(130).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.minPriceTickSize = reader.string(); + break; + case 8: + message.minQuantityTickSize = reader.string(); + break; + case 9: + message.expirationTimestamp = reader.int64(); + break; + case 10: + message.settlementTimestamp = reader.int64(); + break; + case 11: + message.settlementPrice = reader.string(); + break; + case 12: + message.admin = reader.string(); + break; + case 13: + message.status = (reader.int32() as any); + break; + case 14: + message.oracleParams = ProviderOracleParams.decode(reader, reader.uint32()); + break; + case 15: + message.ticker = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarketParamUpdateProposal { + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.settlementPrice = object.settlementPrice ?? undefined; + message.admin = object.admin ?? ""; + message.status = object.status ?? 0; + message.oracleParams = object.oracleParams !== undefined && object.oracleParams !== null ? ProviderOracleParams.fromPartial(object.oracleParams) : undefined; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + return message; + }, + fromAmino(object: BinaryOptionsMarketParamUpdateProposalAmino): BinaryOptionsMarketParamUpdateProposal { + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.oracle_params !== undefined && object.oracle_params !== null) { + message.oracleParams = ProviderOracleParams.fromAmino(object.oracle_params); + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.status = message.status === 0 ? undefined : message.status; + obj.oracle_params = message.oracleParams ? ProviderOracleParams.toAmino(message.oracleParams) : undefined; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketParamUpdateProposalAminoMsg): BinaryOptionsMarketParamUpdateProposal { + return BinaryOptionsMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/BinaryOptionsMarketParamUpdateProposal", + value: BinaryOptionsMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BinaryOptionsMarketParamUpdateProposalProtoMsg): BinaryOptionsMarketParamUpdateProposal { + return BinaryOptionsMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: BinaryOptionsMarketParamUpdateProposal): Uint8Array { + return BinaryOptionsMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal", + value: BinaryOptionsMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarketParamUpdateProposal.typeUrl, BinaryOptionsMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BinaryOptionsMarketParamUpdateProposal.aminoType, BinaryOptionsMarketParamUpdateProposal.typeUrl); +function createBaseProviderOracleParams(): ProviderOracleParams { + return { + symbol: "", + provider: "", + oracleScaleFactor: 0, + oracleType: 0 + }; +} +export const ProviderOracleParams = { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams", + is(o: any): o is ProviderOracleParams { + return o && (o.$typeUrl === ProviderOracleParams.typeUrl || typeof o.symbol === "string" && typeof o.provider === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType)); + }, + isAmino(o: any): o is ProviderOracleParamsAmino { + return o && (o.$typeUrl === ProviderOracleParams.typeUrl || typeof o.symbol === "string" && typeof o.provider === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type)); + }, + encode(message: ProviderOracleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.provider !== "") { + writer.uint32(18).string(message.provider); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(24).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderOracleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderOracleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.provider = reader.string(); + break; + case 3: + message.oracleScaleFactor = reader.uint32(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderOracleParams { + const message = createBaseProviderOracleParams(); + message.symbol = object.symbol ?? ""; + message.provider = object.provider ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: ProviderOracleParamsAmino): ProviderOracleParams { + const message = createBaseProviderOracleParams(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: ProviderOracleParams): ProviderOracleParamsAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: ProviderOracleParamsAminoMsg): ProviderOracleParams { + return ProviderOracleParams.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderOracleParamsProtoMsg): ProviderOracleParams { + return ProviderOracleParams.decode(message.value); + }, + toProto(message: ProviderOracleParams): Uint8Array { + return ProviderOracleParams.encode(message).finish(); + }, + toProtoMsg(message: ProviderOracleParams): ProviderOracleParamsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams", + value: ProviderOracleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderOracleParams.typeUrl, ProviderOracleParams); +function createBaseOracleParams(): OracleParams { + return { + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0 + }; +} +export const OracleParams = { + typeUrl: "/injective.exchange.v1beta1.OracleParams", + is(o: any): o is OracleParams { + return o && (o.$typeUrl === OracleParams.typeUrl || typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType)); + }, + isAmino(o: any): o is OracleParamsAmino { + return o && (o.$typeUrl === OracleParams.typeUrl || typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type)); + }, + encode(message: OracleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracleBase !== "") { + writer.uint32(10).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(18).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(24).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracleBase = reader.string(); + break; + case 2: + message.oracleQuote = reader.string(); + break; + case 3: + message.oracleScaleFactor = reader.uint32(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleParams { + const message = createBaseOracleParams(); + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: OracleParamsAmino): OracleParams { + const message = createBaseOracleParams(); + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: OracleParams): OracleParamsAmino { + const obj: any = {}; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: OracleParamsAminoMsg): OracleParams { + return OracleParams.fromAmino(object.value); + }, + fromProtoMsg(message: OracleParamsProtoMsg): OracleParams { + return OracleParams.decode(message.value); + }, + toProto(message: OracleParams): Uint8Array { + return OracleParams.encode(message).finish(); + }, + toProtoMsg(message: OracleParams): OracleParamsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OracleParams", + value: OracleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleParams.typeUrl, OracleParams); +function createBaseTradingRewardCampaignLaunchProposal(): TradingRewardCampaignLaunchProposal { + return { + title: "", + description: "", + campaignInfo: undefined, + campaignRewardPools: [] + }; +} +export const TradingRewardCampaignLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal", + aminoType: "exchange/TradingRewardCampaignLaunchProposal", + is(o: any): o is TradingRewardCampaignLaunchProposal { + return o && (o.$typeUrl === TradingRewardCampaignLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaignRewardPools) && (!o.campaignRewardPools.length || CampaignRewardPool.is(o.campaignRewardPools[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignLaunchProposalAmino { + return o && (o.$typeUrl === TradingRewardCampaignLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaign_reward_pools) && (!o.campaign_reward_pools.length || CampaignRewardPool.isAmino(o.campaign_reward_pools[0]))); + }, + encode(message: TradingRewardCampaignLaunchProposal, 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.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.campaignRewardPools) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignLaunchProposal(); + 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.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 4: + message.campaignRewardPools.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignLaunchProposal { + const message = createBaseTradingRewardCampaignLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPools = object.campaignRewardPools?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignLaunchProposalAmino): TradingRewardCampaignLaunchProposal { + const message = createBaseTradingRewardCampaignLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPools = object.campaign_reward_pools?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPools) { + obj.campaign_reward_pools = message.campaignRewardPools.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools = message.campaignRewardPools; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignLaunchProposalAminoMsg): TradingRewardCampaignLaunchProposal { + return TradingRewardCampaignLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalAminoMsg { + return { + type: "exchange/TradingRewardCampaignLaunchProposal", + value: TradingRewardCampaignLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardCampaignLaunchProposalProtoMsg): TradingRewardCampaignLaunchProposal { + return TradingRewardCampaignLaunchProposal.decode(message.value); + }, + toProto(message: TradingRewardCampaignLaunchProposal): Uint8Array { + return TradingRewardCampaignLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal", + value: TradingRewardCampaignLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignLaunchProposal.typeUrl, TradingRewardCampaignLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardCampaignLaunchProposal.aminoType, TradingRewardCampaignLaunchProposal.typeUrl); +function createBaseTradingRewardCampaignUpdateProposal(): TradingRewardCampaignUpdateProposal { + return { + title: "", + description: "", + campaignInfo: undefined, + campaignRewardPoolsAdditions: [], + campaignRewardPoolsUpdates: [] + }; +} +export const TradingRewardCampaignUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal", + aminoType: "exchange/TradingRewardCampaignUpdateProposal", + is(o: any): o is TradingRewardCampaignUpdateProposal { + return o && (o.$typeUrl === TradingRewardCampaignUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaignRewardPoolsAdditions) && (!o.campaignRewardPoolsAdditions.length || CampaignRewardPool.is(o.campaignRewardPoolsAdditions[0])) && Array.isArray(o.campaignRewardPoolsUpdates) && (!o.campaignRewardPoolsUpdates.length || CampaignRewardPool.is(o.campaignRewardPoolsUpdates[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignUpdateProposalAmino { + return o && (o.$typeUrl === TradingRewardCampaignUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaign_reward_pools_additions) && (!o.campaign_reward_pools_additions.length || CampaignRewardPool.isAmino(o.campaign_reward_pools_additions[0])) && Array.isArray(o.campaign_reward_pools_updates) && (!o.campaign_reward_pools_updates.length || CampaignRewardPool.isAmino(o.campaign_reward_pools_updates[0]))); + }, + encode(message: TradingRewardCampaignUpdateProposal, 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.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.campaignRewardPoolsAdditions) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.campaignRewardPoolsUpdates) { + CampaignRewardPool.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignUpdateProposal(); + 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.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 4: + message.campaignRewardPoolsAdditions.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 5: + message.campaignRewardPoolsUpdates.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignUpdateProposal { + const message = createBaseTradingRewardCampaignUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPoolsAdditions = object.campaignRewardPoolsAdditions?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.campaignRewardPoolsUpdates = object.campaignRewardPoolsUpdates?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignUpdateProposalAmino): TradingRewardCampaignUpdateProposal { + const message = createBaseTradingRewardCampaignUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPoolsAdditions = object.campaign_reward_pools_additions?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.campaignRewardPoolsUpdates = object.campaign_reward_pools_updates?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPoolsAdditions) { + obj.campaign_reward_pools_additions = message.campaignRewardPoolsAdditions.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools_additions = message.campaignRewardPoolsAdditions; + } + if (message.campaignRewardPoolsUpdates) { + obj.campaign_reward_pools_updates = message.campaignRewardPoolsUpdates.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools_updates = message.campaignRewardPoolsUpdates; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignUpdateProposalAminoMsg): TradingRewardCampaignUpdateProposal { + return TradingRewardCampaignUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalAminoMsg { + return { + type: "exchange/TradingRewardCampaignUpdateProposal", + value: TradingRewardCampaignUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardCampaignUpdateProposalProtoMsg): TradingRewardCampaignUpdateProposal { + return TradingRewardCampaignUpdateProposal.decode(message.value); + }, + toProto(message: TradingRewardCampaignUpdateProposal): Uint8Array { + return TradingRewardCampaignUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal", + value: TradingRewardCampaignUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignUpdateProposal.typeUrl, TradingRewardCampaignUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardCampaignUpdateProposal.aminoType, TradingRewardCampaignUpdateProposal.typeUrl); +function createBaseRewardPointUpdate(): RewardPointUpdate { + return { + accountAddress: "", + newPoints: "" + }; +} +export const RewardPointUpdate = { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate", + is(o: any): o is RewardPointUpdate { + return o && (o.$typeUrl === RewardPointUpdate.typeUrl || typeof o.accountAddress === "string" && typeof o.newPoints === "string"); + }, + isAmino(o: any): o is RewardPointUpdateAmino { + return o && (o.$typeUrl === RewardPointUpdate.typeUrl || typeof o.account_address === "string" && typeof o.new_points === "string"); + }, + encode(message: RewardPointUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + if (message.newPoints !== "") { + writer.uint32(98).string(message.newPoints); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RewardPointUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardPointUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + case 12: + message.newPoints = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RewardPointUpdate { + const message = createBaseRewardPointUpdate(); + message.accountAddress = object.accountAddress ?? ""; + message.newPoints = object.newPoints ?? ""; + return message; + }, + fromAmino(object: RewardPointUpdateAmino): RewardPointUpdate { + const message = createBaseRewardPointUpdate(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + if (object.new_points !== undefined && object.new_points !== null) { + message.newPoints = object.new_points; + } + return message; + }, + toAmino(message: RewardPointUpdate): RewardPointUpdateAmino { + const obj: any = {}; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + obj.new_points = message.newPoints === "" ? undefined : message.newPoints; + return obj; + }, + fromAminoMsg(object: RewardPointUpdateAminoMsg): RewardPointUpdate { + return RewardPointUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: RewardPointUpdateProtoMsg): RewardPointUpdate { + return RewardPointUpdate.decode(message.value); + }, + toProto(message: RewardPointUpdate): Uint8Array { + return RewardPointUpdate.encode(message).finish(); + }, + toProtoMsg(message: RewardPointUpdate): RewardPointUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate", + value: RewardPointUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RewardPointUpdate.typeUrl, RewardPointUpdate); +function createBaseTradingRewardPendingPointsUpdateProposal(): TradingRewardPendingPointsUpdateProposal { + return { + title: "", + description: "", + pendingPoolTimestamp: BigInt(0), + rewardPointUpdates: [] + }; +} +export const TradingRewardPendingPointsUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal", + aminoType: "exchange/TradingRewardPendingPointsUpdateProposal", + is(o: any): o is TradingRewardPendingPointsUpdateProposal { + return o && (o.$typeUrl === TradingRewardPendingPointsUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pendingPoolTimestamp === "bigint" && Array.isArray(o.rewardPointUpdates) && (!o.rewardPointUpdates.length || RewardPointUpdate.is(o.rewardPointUpdates[0]))); + }, + isAmino(o: any): o is TradingRewardPendingPointsUpdateProposalAmino { + return o && (o.$typeUrl === TradingRewardPendingPointsUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pending_pool_timestamp === "bigint" && Array.isArray(o.reward_point_updates) && (!o.reward_point_updates.length || RewardPointUpdate.isAmino(o.reward_point_updates[0]))); + }, + encode(message: TradingRewardPendingPointsUpdateProposal, 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.pendingPoolTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.pendingPoolTimestamp); + } + for (const v of message.rewardPointUpdates) { + RewardPointUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardPendingPointsUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + 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.pendingPoolTimestamp = reader.int64(); + break; + case 4: + message.rewardPointUpdates.push(RewardPointUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardPendingPointsUpdateProposal { + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.pendingPoolTimestamp = object.pendingPoolTimestamp !== undefined && object.pendingPoolTimestamp !== null ? BigInt(object.pendingPoolTimestamp.toString()) : BigInt(0); + message.rewardPointUpdates = object.rewardPointUpdates?.map(e => RewardPointUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardPendingPointsUpdateProposalAmino): TradingRewardPendingPointsUpdateProposal { + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.pending_pool_timestamp !== undefined && object.pending_pool_timestamp !== null) { + message.pendingPoolTimestamp = BigInt(object.pending_pool_timestamp); + } + message.rewardPointUpdates = object.reward_point_updates?.map(e => RewardPointUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.pending_pool_timestamp = message.pendingPoolTimestamp !== BigInt(0) ? message.pendingPoolTimestamp?.toString() : undefined; + if (message.rewardPointUpdates) { + obj.reward_point_updates = message.rewardPointUpdates.map(e => e ? RewardPointUpdate.toAmino(e) : undefined); + } else { + obj.reward_point_updates = message.rewardPointUpdates; + } + return obj; + }, + fromAminoMsg(object: TradingRewardPendingPointsUpdateProposalAminoMsg): TradingRewardPendingPointsUpdateProposal { + return TradingRewardPendingPointsUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalAminoMsg { + return { + type: "exchange/TradingRewardPendingPointsUpdateProposal", + value: TradingRewardPendingPointsUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardPendingPointsUpdateProposalProtoMsg): TradingRewardPendingPointsUpdateProposal { + return TradingRewardPendingPointsUpdateProposal.decode(message.value); + }, + toProto(message: TradingRewardPendingPointsUpdateProposal): Uint8Array { + return TradingRewardPendingPointsUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal", + value: TradingRewardPendingPointsUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardPendingPointsUpdateProposal.typeUrl, TradingRewardPendingPointsUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardPendingPointsUpdateProposal.aminoType, TradingRewardPendingPointsUpdateProposal.typeUrl); +function createBaseFeeDiscountProposal(): FeeDiscountProposal { + return { + title: "", + description: "", + schedule: undefined + }; +} +export const FeeDiscountProposal = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal", + aminoType: "exchange/FeeDiscountProposal", + is(o: any): o is FeeDiscountProposal { + return o && (o.$typeUrl === FeeDiscountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is FeeDiscountProposalAmino { + return o && (o.$typeUrl === FeeDiscountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: FeeDiscountProposal, 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.schedule !== undefined) { + FeeDiscountSchedule.encode(message.schedule, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountProposal(); + 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.schedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountProposal { + const message = createBaseFeeDiscountProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.schedule = object.schedule !== undefined && object.schedule !== null ? FeeDiscountSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: FeeDiscountProposalAmino): FeeDiscountProposal { + const message = createBaseFeeDiscountProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = FeeDiscountSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: FeeDiscountProposal): FeeDiscountProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.schedule = message.schedule ? FeeDiscountSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountProposalAminoMsg): FeeDiscountProposal { + return FeeDiscountProposal.fromAmino(object.value); + }, + toAminoMsg(message: FeeDiscountProposal): FeeDiscountProposalAminoMsg { + return { + type: "exchange/FeeDiscountProposal", + value: FeeDiscountProposal.toAmino(message) + }; + }, + fromProtoMsg(message: FeeDiscountProposalProtoMsg): FeeDiscountProposal { + return FeeDiscountProposal.decode(message.value); + }, + toProto(message: FeeDiscountProposal): Uint8Array { + return FeeDiscountProposal.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountProposal): FeeDiscountProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal", + value: FeeDiscountProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountProposal.typeUrl, FeeDiscountProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(FeeDiscountProposal.aminoType, FeeDiscountProposal.typeUrl); +function createBaseBatchCommunityPoolSpendProposal(): BatchCommunityPoolSpendProposal { + return { + title: "", + description: "", + proposals: [] + }; +} +export const BatchCommunityPoolSpendProposal = { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal", + aminoType: "exchange/BatchCommunityPoolSpendProposal", + is(o: any): o is BatchCommunityPoolSpendProposal { + return o && (o.$typeUrl === BatchCommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || CommunityPoolSpendProposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is BatchCommunityPoolSpendProposalAmino { + return o && (o.$typeUrl === BatchCommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || CommunityPoolSpendProposal.isAmino(o.proposals[0]))); + }, + encode(message: BatchCommunityPoolSpendProposal, 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.proposals) { + CommunityPoolSpendProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCommunityPoolSpendProposal(); + 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.proposals.push(CommunityPoolSpendProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCommunityPoolSpendProposal { + const message = createBaseBatchCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.proposals = object.proposals?.map(e => CommunityPoolSpendProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchCommunityPoolSpendProposalAmino): BatchCommunityPoolSpendProposal { + const message = createBaseBatchCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.proposals = object.proposals?.map(e => CommunityPoolSpendProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? CommunityPoolSpendProposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + return obj; + }, + fromAminoMsg(object: BatchCommunityPoolSpendProposalAminoMsg): BatchCommunityPoolSpendProposal { + return BatchCommunityPoolSpendProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalAminoMsg { + return { + type: "exchange/BatchCommunityPoolSpendProposal", + value: BatchCommunityPoolSpendProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCommunityPoolSpendProposalProtoMsg): BatchCommunityPoolSpendProposal { + return BatchCommunityPoolSpendProposal.decode(message.value); + }, + toProto(message: BatchCommunityPoolSpendProposal): Uint8Array { + return BatchCommunityPoolSpendProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal", + value: BatchCommunityPoolSpendProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCommunityPoolSpendProposal.typeUrl, BatchCommunityPoolSpendProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCommunityPoolSpendProposal.aminoType, BatchCommunityPoolSpendProposal.typeUrl); +function createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(): AtomicMarketOrderFeeMultiplierScheduleProposal { + return { + title: "", + description: "", + marketFeeMultipliers: [] + }; +} +export const AtomicMarketOrderFeeMultiplierScheduleProposal = { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal", + aminoType: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal", + is(o: any): o is AtomicMarketOrderFeeMultiplierScheduleProposal { + return o && (o.$typeUrl === AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0]))); + }, + isAmino(o: any): o is AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + return o && (o.$typeUrl === AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0]))); + }, + encode(message: AtomicMarketOrderFeeMultiplierScheduleProposal, 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.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AtomicMarketOrderFeeMultiplierScheduleProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + 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.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AtomicMarketOrderFeeMultiplierScheduleProposal { + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AtomicMarketOrderFeeMultiplierScheduleProposalAmino): AtomicMarketOrderFeeMultiplierScheduleProposal { + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + return obj; + }, + fromAminoMsg(object: AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg): AtomicMarketOrderFeeMultiplierScheduleProposal { + return AtomicMarketOrderFeeMultiplierScheduleProposal.fromAmino(object.value); + }, + toAminoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg { + return { + type: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal", + value: AtomicMarketOrderFeeMultiplierScheduleProposal.toAmino(message) + }; + }, + fromProtoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg): AtomicMarketOrderFeeMultiplierScheduleProposal { + return AtomicMarketOrderFeeMultiplierScheduleProposal.decode(message.value); + }, + toProto(message: AtomicMarketOrderFeeMultiplierScheduleProposal): Uint8Array { + return AtomicMarketOrderFeeMultiplierScheduleProposal.encode(message).finish(); + }, + toProtoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal", + value: AtomicMarketOrderFeeMultiplierScheduleProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl, AtomicMarketOrderFeeMultiplierScheduleProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(AtomicMarketOrderFeeMultiplierScheduleProposal.aminoType, AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/exchange/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..f8974bc3 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/query.rpc.func.ts @@ -0,0 +1,663 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; +export const createGetQueryExchangeParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeParamsRequest.encode, + decode: QueryExchangeParamsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryExchangeParams", + clientResolver +}); +export const useGetQueryExchangeParams = buildUseQuery({ + builderQueryFn: createGetQueryExchangeParams, + queryKeyPrefix: "QueryExchangeParamsQuery" +}); +export const createGetSubaccountDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositsRequest.encode, + decode: QuerySubaccountDepositsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposits", + clientResolver +}); +export const useGetSubaccountDeposits = buildUseQuery({ + builderQueryFn: createGetSubaccountDeposits, + queryKeyPrefix: "SubaccountDepositsQuery" +}); +export const createGetSubaccountDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositRequest.encode, + decode: QuerySubaccountDepositResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposit", + clientResolver +}); +export const useGetSubaccountDeposit = buildUseQuery({ + builderQueryFn: createGetSubaccountDeposit, + queryKeyPrefix: "SubaccountDepositQuery" +}); +export const createGetExchangeBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeBalancesRequest.encode, + decode: QueryExchangeBalancesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeBalances", + clientResolver +}); +export const useGetExchangeBalances = buildUseQuery({ + builderQueryFn: createGetExchangeBalances, + queryKeyPrefix: "ExchangeBalancesQuery" +}); +export const createGetAggregateVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumeRequest.encode, + decode: QueryAggregateVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolume", + clientResolver +}); +export const useGetAggregateVolume = buildUseQuery({ + builderQueryFn: createGetAggregateVolume, + queryKeyPrefix: "AggregateVolumeQuery" +}); +export const createGetAggregateVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumesRequest.encode, + decode: QueryAggregateVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolumes", + clientResolver +}); +export const useGetAggregateVolumes = buildUseQuery({ + builderQueryFn: createGetAggregateVolumes, + queryKeyPrefix: "AggregateVolumesQuery" +}); +export const createGetAggregateMarketVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumeRequest.encode, + decode: QueryAggregateMarketVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolume", + clientResolver +}); +export const useGetAggregateMarketVolume = buildUseQuery({ + builderQueryFn: createGetAggregateMarketVolume, + queryKeyPrefix: "AggregateMarketVolumeQuery" +}); +export const createGetAggregateMarketVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumesRequest.encode, + decode: QueryAggregateMarketVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolumes", + clientResolver +}); +export const useGetAggregateMarketVolumes = buildUseQuery({ + builderQueryFn: createGetAggregateMarketVolumes, + queryKeyPrefix: "AggregateMarketVolumesQuery" +}); +export const createGetDenomDecimal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalRequest.encode, + decode: QueryDenomDecimalResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimal", + clientResolver +}); +export const useGetDenomDecimal = buildUseQuery({ + builderQueryFn: createGetDenomDecimal, + queryKeyPrefix: "DenomDecimalQuery" +}); +export const createGetDenomDecimals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalsRequest.encode, + decode: QueryDenomDecimalsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimals", + clientResolver +}); +export const useGetDenomDecimals = buildUseQuery({ + builderQueryFn: createGetDenomDecimals, + queryKeyPrefix: "DenomDecimalsQuery" +}); +export const createGetSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketsRequest.encode, + decode: QuerySpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarkets", + clientResolver +}); +export const useGetSpotMarkets = buildUseQuery({ + builderQueryFn: createGetSpotMarkets, + queryKeyPrefix: "SpotMarketsQuery" +}); +export const createGetSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketRequest.encode, + decode: QuerySpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarket", + clientResolver +}); +export const useGetSpotMarket = buildUseQuery({ + builderQueryFn: createGetSpotMarket, + queryKeyPrefix: "SpotMarketQuery" +}); +export const createGetFullSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketsRequest.encode, + decode: QueryFullSpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarkets", + clientResolver +}); +export const useGetFullSpotMarkets = buildUseQuery({ + builderQueryFn: createGetFullSpotMarkets, + queryKeyPrefix: "FullSpotMarketsQuery" +}); +export const createGetFullSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketRequest.encode, + decode: QueryFullSpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarket", + clientResolver +}); +export const useGetFullSpotMarket = buildUseQuery({ + builderQueryFn: createGetFullSpotMarket, + queryKeyPrefix: "FullSpotMarketQuery" +}); +export const createGetSpotOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrderbookRequest.encode, + decode: QuerySpotOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrderbook", + clientResolver +}); +export const useGetSpotOrderbook = buildUseQuery({ + builderQueryFn: createGetSpotOrderbook, + queryKeyPrefix: "SpotOrderbookQuery" +}); +export const createGetTraderSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotOrders", + clientResolver +}); +export const useGetTraderSpotOrders = buildUseQuery({ + builderQueryFn: createGetTraderSpotOrders, + queryKeyPrefix: "TraderSpotOrdersQuery" +}); +export const createGetAccountAddressSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressSpotOrdersRequest.encode, + decode: QueryAccountAddressSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressSpotOrders", + clientResolver +}); +export const useGetAccountAddressSpotOrders = buildUseQuery({ + builderQueryFn: createGetAccountAddressSpotOrders, + queryKeyPrefix: "AccountAddressSpotOrdersQuery" +}); +export const createGetSpotOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrdersByHashesRequest.encode, + decode: QuerySpotOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrdersByHashes", + clientResolver +}); +export const useGetSpotOrdersByHashes = buildUseQuery({ + builderQueryFn: createGetSpotOrdersByHashes, + queryKeyPrefix: "SpotOrdersByHashesQuery" +}); +export const createGetSubaccountOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrdersRequest.encode, + decode: QuerySubaccountOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrders", + clientResolver +}); +export const useGetSubaccountOrders = buildUseQuery({ + builderQueryFn: createGetSubaccountOrders, + queryKeyPrefix: "SubaccountOrdersQuery" +}); +export const createGetTraderSpotTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotTransientOrders", + clientResolver +}); +export const useGetTraderSpotTransientOrders = buildUseQuery({ + builderQueryFn: createGetTraderSpotTransientOrders, + queryKeyPrefix: "TraderSpotTransientOrdersQuery" +}); +export const createGetSpotMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMidPriceAndTOBRequest.encode, + decode: QuerySpotMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMidPriceAndTOB", + clientResolver +}); +export const useGetSpotMidPriceAndTOB = buildUseQuery({ + builderQueryFn: createGetSpotMidPriceAndTOB, + queryKeyPrefix: "SpotMidPriceAndTOBQuery" +}); +export const createGetDerivativeMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMidPriceAndTOBRequest.encode, + decode: QueryDerivativeMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMidPriceAndTOB", + clientResolver +}); +export const useGetDerivativeMidPriceAndTOB = buildUseQuery({ + builderQueryFn: createGetDerivativeMidPriceAndTOB, + queryKeyPrefix: "DerivativeMidPriceAndTOBQuery" +}); +export const createGetDerivativeOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrderbookRequest.encode, + decode: QueryDerivativeOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrderbook", + clientResolver +}); +export const useGetDerivativeOrderbook = buildUseQuery({ + builderQueryFn: createGetDerivativeOrderbook, + queryKeyPrefix: "DerivativeOrderbookQuery" +}); +export const createGetTraderDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeOrders", + clientResolver +}); +export const useGetTraderDerivativeOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeOrders, + queryKeyPrefix: "TraderDerivativeOrdersQuery" +}); +export const createGetAccountAddressDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressDerivativeOrdersRequest.encode, + decode: QueryAccountAddressDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressDerivativeOrders", + clientResolver +}); +export const useGetAccountAddressDerivativeOrders = buildUseQuery({ + builderQueryFn: createGetAccountAddressDerivativeOrders, + queryKeyPrefix: "AccountAddressDerivativeOrdersQuery" +}); +export const createGetDerivativeOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrdersByHashesRequest.encode, + decode: QueryDerivativeOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrdersByHashes", + clientResolver +}); +export const useGetDerivativeOrdersByHashes = buildUseQuery({ + builderQueryFn: createGetDerivativeOrdersByHashes, + queryKeyPrefix: "DerivativeOrdersByHashesQuery" +}); +export const createGetTraderDerivativeTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeTransientOrders", + clientResolver +}); +export const useGetTraderDerivativeTransientOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeTransientOrders, + queryKeyPrefix: "TraderDerivativeTransientOrdersQuery" +}); +export const createGetDerivativeMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketsRequest.encode, + decode: QueryDerivativeMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarkets", + clientResolver +}); +export const useGetDerivativeMarkets = buildUseQuery({ + builderQueryFn: createGetDerivativeMarkets, + queryKeyPrefix: "DerivativeMarketsQuery" +}); +export const createGetDerivativeMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketRequest.encode, + decode: QueryDerivativeMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarket", + clientResolver +}); +export const useGetDerivativeMarket = buildUseQuery({ + builderQueryFn: createGetDerivativeMarket, + queryKeyPrefix: "DerivativeMarketQuery" +}); +export const createGetDerivativeMarketAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketAddressRequest.encode, + decode: QueryDerivativeMarketAddressResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarketAddress", + clientResolver +}); +export const useGetDerivativeMarketAddress = buildUseQuery({ + builderQueryFn: createGetDerivativeMarketAddress, + queryKeyPrefix: "DerivativeMarketAddressQuery" +}); +export const createGetSubaccountTradeNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountTradeNonceRequest.encode, + decode: QuerySubaccountTradeNonceResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountTradeNonce", + clientResolver +}); +export const useGetSubaccountTradeNonce = buildUseQuery({ + builderQueryFn: createGetSubaccountTradeNonce, + queryKeyPrefix: "SubaccountTradeNonceQuery" +}); +export const createGetExchangeModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeModuleState", + clientResolver +}); +export const useGetExchangeModuleState = buildUseQuery({ + builderQueryFn: createGetExchangeModuleState, + queryKeyPrefix: "ExchangeModuleStateQuery" +}); +export const createGetPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPositionsRequest.encode, + decode: QueryPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "Positions", + clientResolver +}); +export const useGetPositions = buildUseQuery({ + builderQueryFn: createGetPositions, + queryKeyPrefix: "PositionsQuery" +}); +export const createGetSubaccountPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionsRequest.encode, + decode: QuerySubaccountPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositions", + clientResolver +}); +export const useGetSubaccountPositions = buildUseQuery({ + builderQueryFn: createGetSubaccountPositions, + queryKeyPrefix: "SubaccountPositionsQuery" +}); +export const createGetSubaccountPositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionInMarketRequest.encode, + decode: QuerySubaccountPositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositionInMarket", + clientResolver +}); +export const useGetSubaccountPositionInMarket = buildUseQuery({ + builderQueryFn: createGetSubaccountPositionInMarket, + queryKeyPrefix: "SubaccountPositionInMarketQuery" +}); +export const createGetSubaccountEffectivePositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountEffectivePositionInMarketRequest.encode, + decode: QuerySubaccountEffectivePositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountEffectivePositionInMarket", + clientResolver +}); +export const useGetSubaccountEffectivePositionInMarket = buildUseQuery({ + builderQueryFn: createGetSubaccountEffectivePositionInMarket, + queryKeyPrefix: "SubaccountEffectivePositionInMarketQuery" +}); +export const createGetPerpetualMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketInfoRequest.encode, + decode: QueryPerpetualMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketInfo", + clientResolver +}); +export const useGetPerpetualMarketInfo = buildUseQuery({ + builderQueryFn: createGetPerpetualMarketInfo, + queryKeyPrefix: "PerpetualMarketInfoQuery" +}); +export const createGetExpiryFuturesMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExpiryFuturesMarketInfoRequest.encode, + decode: QueryExpiryFuturesMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExpiryFuturesMarketInfo", + clientResolver +}); +export const useGetExpiryFuturesMarketInfo = buildUseQuery({ + builderQueryFn: createGetExpiryFuturesMarketInfo, + queryKeyPrefix: "ExpiryFuturesMarketInfoQuery" +}); +export const createGetPerpetualMarketFunding = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketFundingRequest.encode, + decode: QueryPerpetualMarketFundingResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketFunding", + clientResolver +}); +export const useGetPerpetualMarketFunding = buildUseQuery({ + builderQueryFn: createGetPerpetualMarketFunding, + queryKeyPrefix: "PerpetualMarketFundingQuery" +}); +export const createGetSubaccountOrderMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrderMetadataRequest.encode, + decode: QuerySubaccountOrderMetadataResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrderMetadata", + clientResolver +}); +export const useGetSubaccountOrderMetadata = buildUseQuery({ + builderQueryFn: createGetSubaccountOrderMetadata, + queryKeyPrefix: "SubaccountOrderMetadataQuery" +}); +export const createGetTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardPoints", + clientResolver +}); +export const useGetTradeRewardPoints = buildUseQuery({ + builderQueryFn: createGetTradeRewardPoints, + queryKeyPrefix: "TradeRewardPointsQuery" +}); +export const createGetPendingTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PendingTradeRewardPoints", + clientResolver +}); +export const useGetPendingTradeRewardPoints = buildUseQuery({ + builderQueryFn: createGetPendingTradeRewardPoints, + queryKeyPrefix: "PendingTradeRewardPointsQuery" +}); +export const createGetTradeRewardCampaign = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardCampaignRequest.encode, + decode: QueryTradeRewardCampaignResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardCampaign", + clientResolver +}); +export const useGetTradeRewardCampaign = buildUseQuery({ + builderQueryFn: createGetTradeRewardCampaign, + queryKeyPrefix: "TradeRewardCampaignQuery" +}); +export const createGetFeeDiscountAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountAccountInfoRequest.encode, + decode: QueryFeeDiscountAccountInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountAccountInfo", + clientResolver +}); +export const useGetFeeDiscountAccountInfo = buildUseQuery({ + builderQueryFn: createGetFeeDiscountAccountInfo, + queryKeyPrefix: "FeeDiscountAccountInfoQuery" +}); +export const createGetFeeDiscountSchedule = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountScheduleRequest.encode, + decode: QueryFeeDiscountScheduleResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountSchedule", + clientResolver +}); +export const useGetFeeDiscountSchedule = buildUseQuery({ + builderQueryFn: createGetFeeDiscountSchedule, + queryKeyPrefix: "FeeDiscountScheduleQuery" +}); +export const createGetBalanceMismatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceMismatchesRequest.encode, + decode: QueryBalanceMismatchesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceMismatches", + clientResolver +}); +export const useGetBalanceMismatches = buildUseQuery({ + builderQueryFn: createGetBalanceMismatches, + queryKeyPrefix: "BalanceMismatchesQuery" +}); +export const createGetBalanceWithBalanceHolds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceWithBalanceHoldsRequest.encode, + decode: QueryBalanceWithBalanceHoldsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceWithBalanceHolds", + clientResolver +}); +export const useGetBalanceWithBalanceHolds = buildUseQuery({ + builderQueryFn: createGetBalanceWithBalanceHolds, + queryKeyPrefix: "BalanceWithBalanceHoldsQuery" +}); +export const createGetFeeDiscountTierStatistics = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountTierStatisticsRequest.encode, + decode: QueryFeeDiscountTierStatisticsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountTierStatistics", + clientResolver +}); +export const useGetFeeDiscountTierStatistics = buildUseQuery({ + builderQueryFn: createGetFeeDiscountTierStatistics, + queryKeyPrefix: "FeeDiscountTierStatisticsQuery" +}); +export const createGetMitoVaultInfos = (clientResolver?: RpcResolver) => buildQuery({ + encode: MitoVaultInfosRequest.encode, + decode: MitoVaultInfosResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MitoVaultInfos", + clientResolver +}); +export const useGetMitoVaultInfos = buildUseQuery({ + builderQueryFn: createGetMitoVaultInfos, + queryKeyPrefix: "MitoVaultInfosQuery" +}); +export const createGetQueryMarketIDFromVault = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketIDFromVaultRequest.encode, + decode: QueryMarketIDFromVaultResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryMarketIDFromVault", + clientResolver +}); +export const useGetQueryMarketIDFromVault = buildUseQuery({ + builderQueryFn: createGetQueryMarketIDFromVault, + queryKeyPrefix: "QueryMarketIDFromVaultQuery" +}); +export const createGetHistoricalTradeRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalTradeRecordsRequest.encode, + decode: QueryHistoricalTradeRecordsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "HistoricalTradeRecords", + clientResolver +}); +export const useGetHistoricalTradeRecords = buildUseQuery({ + builderQueryFn: createGetHistoricalTradeRecords, + queryKeyPrefix: "HistoricalTradeRecordsQuery" +}); +export const createGetIsOptedOutOfRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryIsOptedOutOfRewardsRequest.encode, + decode: QueryIsOptedOutOfRewardsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "IsOptedOutOfRewards", + clientResolver +}); +export const useGetIsOptedOutOfRewards = buildUseQuery({ + builderQueryFn: createGetIsOptedOutOfRewards, + queryKeyPrefix: "IsOptedOutOfRewardsQuery" +}); +export const createGetOptedOutOfRewardsAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOptedOutOfRewardsAccountsRequest.encode, + decode: QueryOptedOutOfRewardsAccountsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "OptedOutOfRewardsAccounts", + clientResolver +}); +export const useGetOptedOutOfRewardsAccounts = buildUseQuery({ + builderQueryFn: createGetOptedOutOfRewardsAccounts, + queryKeyPrefix: "OptedOutOfRewardsAccountsQuery" +}); +export const createGetMarketVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketVolatilityRequest.encode, + decode: QueryMarketVolatilityResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketVolatility", + clientResolver +}); +export const useGetMarketVolatility = buildUseQuery({ + builderQueryFn: createGetMarketVolatility, + queryKeyPrefix: "MarketVolatilityQuery" +}); +export const createGetBinaryOptionsMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBinaryMarketsRequest.encode, + decode: QueryBinaryMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BinaryOptionsMarkets", + clientResolver +}); +export const useGetBinaryOptionsMarkets = buildUseQuery({ + builderQueryFn: createGetBinaryOptionsMarkets, + queryKeyPrefix: "BinaryOptionsMarketsQuery" +}); +export const createGetTraderDerivativeConditionalOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeConditionalOrdersRequest.encode, + decode: QueryTraderDerivativeConditionalOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeConditionalOrders", + clientResolver +}); +export const useGetTraderDerivativeConditionalOrders = buildUseQuery({ + builderQueryFn: createGetTraderDerivativeConditionalOrders, + queryKeyPrefix: "TraderDerivativeConditionalOrdersQuery" +}); +export const createGetMarketAtomicExecutionFeeMultiplier = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketAtomicExecutionFeeMultiplierRequest.encode, + decode: QueryMarketAtomicExecutionFeeMultiplierResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketAtomicExecutionFeeMultiplier", + clientResolver +}); +export const useGetMarketAtomicExecutionFeeMultiplier = buildUseQuery({ + builderQueryFn: createGetMarketAtomicExecutionFeeMultiplier, + queryKeyPrefix: "MarketAtomicExecutionFeeMultiplierQuery" +}); +export const createGetActiveStakeGrant = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryActiveStakeGrantRequest.encode, + decode: QueryActiveStakeGrantResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ActiveStakeGrant", + clientResolver +}); +export const useGetActiveStakeGrant = buildUseQuery({ + builderQueryFn: createGetActiveStakeGrant, + queryKeyPrefix: "ActiveStakeGrantQuery" +}); +export const createGetGrantAuthorization = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationRequest.encode, + decode: QueryGrantAuthorizationResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorization", + clientResolver +}); +export const useGetGrantAuthorization = buildUseQuery({ + builderQueryFn: createGetGrantAuthorization, + queryKeyPrefix: "GrantAuthorizationQuery" +}); +export const createGetGrantAuthorizations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationsRequest.encode, + decode: QueryGrantAuthorizationsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorizations", + clientResolver +}); +export const useGetGrantAuthorizations = buildUseQuery({ + builderQueryFn: createGetGrantAuthorizations, + queryKeyPrefix: "GrantAuthorizationsQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/query.ts b/libs/injective-query/src/injective/exchange/v1beta1/query.ts new file mode 100644 index 00000000..a03e3cd0 --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/query.ts @@ -0,0 +1,13590 @@ +import { SubaccountOrderData, SubaccountOrderDataAmino, SubaccountOrderbookMetadata, SubaccountOrderbookMetadataAmino, Params, ParamsAmino, Deposit, DepositAmino, MarketVolume, MarketVolumeAmino, AggregateAccountVolumeRecord, AggregateAccountVolumeRecordAmino, VolumeRecord, VolumeRecordAmino, DenomDecimals, DenomDecimalsAmino, SpotMarket, SpotMarketAmino, Level, LevelAmino, MidPriceAndTOB, MidPriceAndTOBAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, DerivativeMarket, DerivativeMarketAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, Position, PositionAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountTierInfo, FeeDiscountTierInfoAmino, FeeDiscountTierTTL, FeeDiscountTierTTLAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradeRecords, TradeRecordsAmino, TradeRecord, TradeRecordAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, ActiveGrant, ActiveGrantAmino, EffectiveGrant, EffectiveGrantAmino, GrantAuthorization, GrantAuthorizationAmino } from "./exchange"; +import { Balance, BalanceAmino, DerivativePosition, DerivativePositionAmino, GenesisState, GenesisStateAmino } from "./genesis"; +import { MetadataStatistics, MetadataStatisticsAmino } from "../../oracle/v1beta1/oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OrderSide { + /** Side_Unspecified - will return both */ + Side_Unspecified = 0, + Buy = 1, + Sell = 2, + UNRECOGNIZED = -1, +} +export const OrderSideAmino = OrderSide; +export function orderSideFromJSON(object: any): OrderSide { + switch (object) { + case 0: + case "Side_Unspecified": + return OrderSide.Side_Unspecified; + case 1: + case "Buy": + return OrderSide.Buy; + case 2: + case "Sell": + return OrderSide.Sell; + case -1: + case "UNRECOGNIZED": + default: + return OrderSide.UNRECOGNIZED; + } +} +export function orderSideToJSON(object: OrderSide): string { + switch (object) { + case OrderSide.Side_Unspecified: + return "Side_Unspecified"; + case OrderSide.Buy: + return "Buy"; + case OrderSide.Sell: + return "Sell"; + case OrderSide.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** CancellationStrategy is the list of cancellation strategies. */ +export enum CancellationStrategy { + /** UnspecifiedOrder - just cancelling in random order in most efficient way */ + UnspecifiedOrder = 0, + /** FromWorstToBest - e.g. for buy orders from lowest to highest price */ + FromWorstToBest = 1, + /** FromBestToWorst - e.g. for buy orders from higest to lowest price */ + FromBestToWorst = 2, + UNRECOGNIZED = -1, +} +export const CancellationStrategyAmino = CancellationStrategy; +export function cancellationStrategyFromJSON(object: any): CancellationStrategy { + switch (object) { + case 0: + case "UnspecifiedOrder": + return CancellationStrategy.UnspecifiedOrder; + case 1: + case "FromWorstToBest": + return CancellationStrategy.FromWorstToBest; + case 2: + case "FromBestToWorst": + return CancellationStrategy.FromBestToWorst; + case -1: + case "UNRECOGNIZED": + default: + return CancellationStrategy.UNRECOGNIZED; + } +} +export function cancellationStrategyToJSON(object: CancellationStrategy): string { + switch (object) { + case CancellationStrategy.UnspecifiedOrder: + return "UnspecifiedOrder"; + case CancellationStrategy.FromWorstToBest: + return "FromWorstToBest"; + case CancellationStrategy.FromBestToWorst: + return "FromBestToWorst"; + case CancellationStrategy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Subaccount { + trader: string; + subaccountNonce: number; +} +export interface SubaccountProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Subaccount"; + value: Uint8Array; +} +export interface SubaccountAmino { + trader: string; + subaccount_nonce: number; +} +export interface SubaccountAminoMsg { + type: "/injective.exchange.v1beta1.Subaccount"; + value: SubaccountAmino; +} +export interface QuerySubaccountOrdersRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest"; + value: Uint8Array; +} +export interface QuerySubaccountOrdersRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest"; + value: QuerySubaccountOrdersRequestAmino; +} +export interface QuerySubaccountOrdersResponse { + buyOrders: SubaccountOrderData[]; + sellOrders: SubaccountOrderData[]; +} +export interface QuerySubaccountOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse"; + value: Uint8Array; +} +export interface QuerySubaccountOrdersResponseAmino { + buy_orders: SubaccountOrderDataAmino[]; + sell_orders: SubaccountOrderDataAmino[]; +} +export interface QuerySubaccountOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse"; + value: QuerySubaccountOrdersResponseAmino; +} +export interface SubaccountOrderbookMetadataWithMarket { + metadata?: SubaccountOrderbookMetadata; + marketId: string; + isBuy: boolean; +} +export interface SubaccountOrderbookMetadataWithMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket"; + value: Uint8Array; +} +export interface SubaccountOrderbookMetadataWithMarketAmino { + metadata?: SubaccountOrderbookMetadataAmino; + market_id: string; + isBuy: boolean; +} +export interface SubaccountOrderbookMetadataWithMarketAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket"; + value: SubaccountOrderbookMetadataWithMarketAmino; +} +/** + * QueryExchangeParamsRequest is the request type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsRequest {} +export interface QueryExchangeParamsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest"; + value: Uint8Array; +} +/** + * QueryExchangeParamsRequest is the request type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsRequestAmino {} +export interface QueryExchangeParamsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeParamsRequest"; + value: QueryExchangeParamsRequestAmino; +} +/** + * QueryExchangeParamsRequest is the response type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsResponse { + params: Params; +} +export interface QueryExchangeParamsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse"; + value: Uint8Array; +} +/** + * QueryExchangeParamsRequest is the response type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryExchangeParamsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeParamsResponse"; + value: QueryExchangeParamsResponseAmino; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsRequest { + subaccountId: string; + subaccount?: Subaccount; +} +export interface QuerySubaccountDepositsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsRequestAmino { + subaccount_id: string; + subaccount?: SubaccountAmino; +} +export interface QuerySubaccountDepositsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest"; + value: QuerySubaccountDepositsRequestAmino; +} +export interface QuerySubaccountDepositsResponse_DepositsEntry { + key: string; + value?: Deposit; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryAmino { + key: string; + value?: DepositAmino; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryAminoMsg { + type: string; + value: QuerySubaccountDepositsResponse_DepositsEntryAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsResponse { + deposits: { + [key: string]: Deposit; + }; +} +export interface QuerySubaccountDepositsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsResponseAmino { + deposits: { + [key: string]: DepositAmino; + }; +} +export interface QuerySubaccountDepositsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse"; + value: QuerySubaccountDepositsResponseAmino; +} +/** + * QueryExchangeBalancesRequest is the request type for the + * Query/ExchangeBalances RPC method. + */ +export interface QueryExchangeBalancesRequest {} +export interface QueryExchangeBalancesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest"; + value: Uint8Array; +} +/** + * QueryExchangeBalancesRequest is the request type for the + * Query/ExchangeBalances RPC method. + */ +export interface QueryExchangeBalancesRequestAmino {} +export interface QueryExchangeBalancesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest"; + value: QueryExchangeBalancesRequestAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QueryExchangeBalancesResponse { + balances: Balance[]; +} +export interface QueryExchangeBalancesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QueryExchangeBalancesResponseAmino { + balances: BalanceAmino[]; +} +export interface QueryExchangeBalancesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse"; + value: QueryExchangeBalancesResponseAmino; +} +/** + * QueryAggregateVolumeRequest is the request type for the Query/AggregateVolume + * RPC method. + */ +export interface QueryAggregateVolumeRequest { + /** can either be an address or a subaccount */ + account: string; +} +export interface QueryAggregateVolumeRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest"; + value: Uint8Array; +} +/** + * QueryAggregateVolumeRequest is the request type for the Query/AggregateVolume + * RPC method. + */ +export interface QueryAggregateVolumeRequestAmino { + /** can either be an address or a subaccount */ + account: string; +} +export interface QueryAggregateVolumeRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest"; + value: QueryAggregateVolumeRequestAmino; +} +/** + * QueryAggregateVolumeResponse is the response type for the + * Query/AggregateVolume RPC method. + */ +export interface QueryAggregateVolumeResponse { + /** + * if an address is specified, then the aggregate_volumes will aggregate the + * volumes across all subaccounts for the address + */ + aggregateVolumes: MarketVolume[]; +} +export interface QueryAggregateVolumeResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVolumeResponse is the response type for the + * Query/AggregateVolume RPC method. + */ +export interface QueryAggregateVolumeResponseAmino { + /** + * if an address is specified, then the aggregate_volumes will aggregate the + * volumes across all subaccounts for the address + */ + aggregate_volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateVolumeResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse"; + value: QueryAggregateVolumeResponseAmino; +} +/** + * QueryAggregateVolumesRequest is the request type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesRequest { + accounts: string[]; + marketIds: string[]; +} +export interface QueryAggregateVolumesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest"; + value: Uint8Array; +} +/** + * QueryAggregateVolumesRequest is the request type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesRequestAmino { + accounts: string[]; + market_ids: string[]; +} +export interface QueryAggregateVolumesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest"; + value: QueryAggregateVolumesRequestAmino; +} +/** + * QueryAggregateVolumesResponse is the response type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesResponse { + /** the aggregate volume records for the accounts specified */ + aggregateAccountVolumes: AggregateAccountVolumeRecord[]; + /** the aggregate volumes for the markets specified */ + aggregateMarketVolumes: MarketVolume[]; +} +export interface QueryAggregateVolumesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVolumesResponse is the response type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesResponseAmino { + /** the aggregate volume records for the accounts specified */ + aggregate_account_volumes: AggregateAccountVolumeRecordAmino[]; + /** the aggregate volumes for the markets specified */ + aggregate_market_volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateVolumesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse"; + value: QueryAggregateVolumesResponseAmino; +} +/** + * QueryAggregateMarketVolumeRequest is the request type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeRequest { + marketId: string; +} +export interface QueryAggregateMarketVolumeRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumeRequest is the request type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeRequestAmino { + market_id: string; +} +export interface QueryAggregateMarketVolumeRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest"; + value: QueryAggregateMarketVolumeRequestAmino; +} +/** + * QueryAggregateMarketVolumeResponse is the response type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeResponse { + volume: VolumeRecord; +} +export interface QueryAggregateMarketVolumeResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumeResponse is the response type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeResponseAmino { + volume: VolumeRecordAmino; +} +export interface QueryAggregateMarketVolumeResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse"; + value: QueryAggregateMarketVolumeResponseAmino; +} +/** + * QueryDenomDecimalRequest is the request type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalRequest { + denom: string; +} +export interface QueryDenomDecimalRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest"; + value: Uint8Array; +} +/** + * QueryDenomDecimalRequest is the request type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalRequestAmino { + denom: string; +} +export interface QueryDenomDecimalRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalRequest"; + value: QueryDenomDecimalRequestAmino; +} +/** + * QueryDenomDecimalResponse is the response type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalResponse { + decimal: bigint; +} +export interface QueryDenomDecimalResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse"; + value: Uint8Array; +} +/** + * QueryDenomDecimalResponse is the response type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalResponseAmino { + decimal: string; +} +export interface QueryDenomDecimalResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalResponse"; + value: QueryDenomDecimalResponseAmino; +} +/** + * QueryDenomDecimalsRequest is the request type for the Query/DenomDecimals RPC + * method. + */ +export interface QueryDenomDecimalsRequest { + /** denoms can be empty to query all denom decimals */ + denoms: string[]; +} +export interface QueryDenomDecimalsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest"; + value: Uint8Array; +} +/** + * QueryDenomDecimalsRequest is the request type for the Query/DenomDecimals RPC + * method. + */ +export interface QueryDenomDecimalsRequestAmino { + /** denoms can be empty to query all denom decimals */ + denoms: string[]; +} +export interface QueryDenomDecimalsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest"; + value: QueryDenomDecimalsRequestAmino; +} +/** + * QueryDenomDecimalsRequest is the response type for the Query/DenomDecimals + * RPC method. + */ +export interface QueryDenomDecimalsResponse { + denomDecimals: DenomDecimals[]; +} +export interface QueryDenomDecimalsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse"; + value: Uint8Array; +} +/** + * QueryDenomDecimalsRequest is the response type for the Query/DenomDecimals + * RPC method. + */ +export interface QueryDenomDecimalsResponseAmino { + denom_decimals: DenomDecimalsAmino[]; +} +export interface QueryDenomDecimalsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse"; + value: QueryDenomDecimalsResponseAmino; +} +/** + * QueryAggregateMarketVolumesRequest is the request type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesRequest { + marketIds: string[]; +} +export interface QueryAggregateMarketVolumesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumesRequest is the request type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesRequestAmino { + market_ids: string[]; +} +export interface QueryAggregateMarketVolumesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest"; + value: QueryAggregateMarketVolumesRequestAmino; +} +/** + * QueryAggregateMarketVolumesResponse is the response type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesResponse { + /** the aggregate volumes for the entire market */ + volumes: MarketVolume[]; +} +export interface QueryAggregateMarketVolumesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumesResponse is the response type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesResponseAmino { + /** the aggregate volumes for the entire market */ + volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateMarketVolumesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse"; + value: QueryAggregateMarketVolumesResponseAmino; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositRequest { + subaccountId: string; + denom: string; +} +export interface QuerySubaccountDepositRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositRequestAmino { + subaccount_id: string; + denom: string; +} +export interface QuerySubaccountDepositRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest"; + value: QuerySubaccountDepositRequestAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositResponse { + deposits?: Deposit; +} +export interface QuerySubaccountDepositResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositResponseAmino { + deposits?: DepositAmino; +} +export interface QuerySubaccountDepositResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse"; + value: QuerySubaccountDepositResponseAmino; +} +/** + * QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; +} +export interface QuerySpotMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; +} +export interface QuerySpotMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketsRequest"; + value: QuerySpotMarketsRequestAmino; +} +/** + * QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsResponse { + markets: SpotMarket[]; +} +export interface QuerySpotMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsResponseAmino { + markets: SpotMarketAmino[]; +} +export interface QuerySpotMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketsResponse"; + value: QuerySpotMarketsResponseAmino; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QuerySpotMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QuerySpotMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketRequest"; + value: QuerySpotMarketRequestAmino; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketResponse { + market?: SpotMarket; +} +export interface QuerySpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketResponseAmino { + market?: SpotMarketAmino; +} +export interface QuerySpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketResponse"; + value: QuerySpotMarketResponseAmino; +} +/** + * QuerySpotOrderbookRequest is the request type for the Query/SpotOrderbook RPC + * method. + */ +export interface QuerySpotOrderbookRequest { + /** Market ID for the market */ + marketId: string; + limit: bigint; + orderSide: OrderSide; + limitCumulativeNotional?: string; + limitCumulativeQuantity?: string; +} +export interface QuerySpotOrderbookRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest"; + value: Uint8Array; +} +/** + * QuerySpotOrderbookRequest is the request type for the Query/SpotOrderbook RPC + * method. + */ +export interface QuerySpotOrderbookRequestAmino { + /** Market ID for the market */ + market_id: string; + limit: string; + order_side: OrderSide; + limit_cumulative_notional?: string; + limit_cumulative_quantity?: string; +} +export interface QuerySpotOrderbookRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest"; + value: QuerySpotOrderbookRequestAmino; +} +/** + * QuerySpotOrderbookResponse is the response type for the Query/SpotOrderbook + * RPC method. + */ +export interface QuerySpotOrderbookResponse { + buysPriceLevel: Level[]; + sellsPriceLevel: Level[]; +} +export interface QuerySpotOrderbookResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse"; + value: Uint8Array; +} +/** + * QuerySpotOrderbookResponse is the response type for the Query/SpotOrderbook + * RPC method. + */ +export interface QuerySpotOrderbookResponseAmino { + buys_price_level: LevelAmino[]; + sells_price_level: LevelAmino[]; +} +export interface QuerySpotOrderbookResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse"; + value: QuerySpotOrderbookResponseAmino; +} +export interface FullSpotMarket { + market?: SpotMarket; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + midPriceAndTob?: MidPriceAndTOB; +} +export interface FullSpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket"; + value: Uint8Array; +} +export interface FullSpotMarketAmino { + market?: SpotMarketAmino; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + mid_price_and_tob?: MidPriceAndTOBAmino; +} +export interface FullSpotMarketAminoMsg { + type: "/injective.exchange.v1beta1.FullSpotMarket"; + value: FullSpotMarketAmino; +} +/** + * QueryFullSpotMarketsRequest is the request type for the Query/FullSpotMarkets + * RPC method. + */ +export interface QueryFullSpotMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryFullSpotMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest"; + value: Uint8Array; +} +/** + * QueryFullSpotMarketsRequest is the request type for the Query/FullSpotMarkets + * RPC method. + */ +export interface QueryFullSpotMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryFullSpotMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest"; + value: QueryFullSpotMarketsRequestAmino; +} +/** + * QueryFullSpotMarketsResponse is the response type for the + * Query/FullSpotMarkets RPC method. + */ +export interface QueryFullSpotMarketsResponse { + markets: FullSpotMarket[]; +} +export interface QueryFullSpotMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse"; + value: Uint8Array; +} +/** + * QueryFullSpotMarketsResponse is the response type for the + * Query/FullSpotMarkets RPC method. + */ +export interface QueryFullSpotMarketsResponseAmino { + markets: FullSpotMarketAmino[]; +} +export interface QueryFullSpotMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse"; + value: QueryFullSpotMarketsResponseAmino; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketRequest { + /** Market ID for the market */ + marketId: string; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryFullSpotMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketRequestAmino { + /** Market ID for the market */ + market_id: string; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryFullSpotMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest"; + value: QueryFullSpotMarketRequestAmino; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketResponse { + market?: FullSpotMarket; +} +export interface QueryFullSpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketResponseAmino { + market?: FullSpotMarketAmino; +} +export interface QueryFullSpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse"; + value: QueryFullSpotMarketResponseAmino; +} +/** + * QuerySpotOrdersByHashesRequest is the request type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the order hashes */ + orderHashes: string[]; +} +export interface QuerySpotOrdersByHashesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest"; + value: Uint8Array; +} +/** + * QuerySpotOrdersByHashesRequest is the request type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the order hashes */ + order_hashes: string[]; +} +export interface QuerySpotOrdersByHashesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest"; + value: QuerySpotOrdersByHashesRequestAmino; +} +/** + * QuerySpotOrdersByHashesResponse is the response type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QuerySpotOrdersByHashesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse"; + value: Uint8Array; +} +/** + * QuerySpotOrdersByHashesResponse is the response type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QuerySpotOrdersByHashesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse"; + value: QuerySpotOrdersByHashesResponseAmino; +} +/** + * QueryTraderSpotOrdersRequest is the request type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; +} +export interface QueryTraderSpotOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersRequest is the request type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; +} +export interface QueryTraderSpotOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest"; + value: QueryTraderSpotOrdersRequestAmino; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** Account address of the trader */ + accountAddress: string; +} +export interface QueryAccountAddressSpotOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** Account address of the trader */ + account_address: string; +} +export interface QueryAccountAddressSpotOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest"; + value: QueryAccountAddressSpotOrdersRequestAmino; +} +export interface TrimmedSpotLimitOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedSpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder"; + value: Uint8Array; +} +export interface TrimmedSpotLimitOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedSpotLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder"; + value: TrimmedSpotLimitOrderAmino; +} +/** + * QueryTraderSpotOrdersResponse is the response type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QueryTraderSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersResponse is the response type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QueryTraderSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse"; + value: QueryTraderSpotOrdersResponseAmino; +} +/** + * QueryAccountAddressSpotOrdersResponse is the response type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QueryAccountAddressSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersResponse is the response type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QueryAccountAddressSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse"; + value: QueryAccountAddressSpotOrdersResponseAmino; +} +/** + * QuerySpotMidPriceAndTOBRequest is the request type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QuerySpotMidPriceAndTOBRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest"; + value: Uint8Array; +} +/** + * QuerySpotMidPriceAndTOBRequest is the request type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QuerySpotMidPriceAndTOBRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest"; + value: QuerySpotMidPriceAndTOBRequestAmino; +} +/** + * QuerySpotMidPriceAndTOBResponse is the response type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBResponse { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface QuerySpotMidPriceAndTOBResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse"; + value: Uint8Array; +} +/** + * QuerySpotMidPriceAndTOBResponse is the response type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBResponseAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface QuerySpotMidPriceAndTOBResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse"; + value: QuerySpotMidPriceAndTOBResponseAmino; +} +/** + * QueryDerivativeMidPriceAndTOBRequest is the request type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMidPriceAndTOBRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMidPriceAndTOBRequest is the request type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMidPriceAndTOBRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest"; + value: QueryDerivativeMidPriceAndTOBRequestAmino; +} +/** + * QueryDerivativeMidPriceAndTOBResponse is the response type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBResponse { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface QueryDerivativeMidPriceAndTOBResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMidPriceAndTOBResponse is the response type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBResponseAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface QueryDerivativeMidPriceAndTOBResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse"; + value: QueryDerivativeMidPriceAndTOBResponseAmino; +} +/** + * QueryDerivativeOrderbookRequest is the request type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookRequest { + /** Market ID for the market */ + marketId: string; + limit: bigint; + limitCumulativeNotional?: string; +} +export interface QueryDerivativeOrderbookRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeOrderbookRequest is the request type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookRequestAmino { + /** Market ID for the market */ + market_id: string; + limit: string; + limit_cumulative_notional?: string; +} +export interface QueryDerivativeOrderbookRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest"; + value: QueryDerivativeOrderbookRequestAmino; +} +/** + * QueryDerivativeOrderbookResponse is the response type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookResponse { + buysPriceLevel: Level[]; + sellsPriceLevel: Level[]; +} +export interface QueryDerivativeOrderbookResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeOrderbookResponse is the response type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookResponseAmino { + buys_price_level: LevelAmino[]; + sells_price_level: LevelAmino[]; +} +export interface QueryDerivativeOrderbookResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse"; + value: QueryDerivativeOrderbookResponseAmino; +} +/** + * QueryTraderSpotOrdersToCancelUpToAmountRequest is the request type for the + * Query/TraderSpotOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderSpotOrdersToCancelUpToAmountRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the base amount to cancel (free up) */ + baseAmount: string; + /** the quote amount to cancel (free up) */ + quoteAmount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + referencePrice?: string; +} +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersToCancelUpToAmountRequest is the request type for the + * Query/TraderSpotOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the base amount to cancel (free up) */ + base_amount: string; + /** the quote amount to cancel (free up) */ + quote_amount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + reference_price?: string; +} +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest"; + value: QueryTraderSpotOrdersToCancelUpToAmountRequestAmino; +} +/** + * QueryTraderDerivativeOrdersToCancelUpToAmountRequest is the request type for + * the Query/TraderDerivativeOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the quote amount to cancel (free up) */ + quoteAmount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + referencePrice?: string; +} +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersToCancelUpToAmountRequest is the request type for + * the Query/TraderDerivativeOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the quote amount to cancel (free up) */ + quote_amount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + reference_price?: string; +} +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest"; + value: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; +} +export interface QueryTraderDerivativeOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; +} +export interface QueryTraderDerivativeOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest"; + value: QueryTraderDerivativeOrdersRequestAmino; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** Account address of the trader */ + accountAddress: string; +} +export interface QueryAccountAddressDerivativeOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** Account address of the trader */ + account_address: string; +} +export interface QueryAccountAddressDerivativeOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest"; + value: QueryAccountAddressDerivativeOrdersRequestAmino; +} +export interface TrimmedDerivativeLimitOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedDerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder"; + value: Uint8Array; +} +export interface TrimmedDerivativeLimitOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedDerivativeLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder"; + value: TrimmedDerivativeLimitOrderAmino; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryTraderDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryTraderDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse"; + value: QueryTraderDerivativeOrdersResponseAmino; +} +/** + * QueryAccountAddressDerivativeOrdersResponse is the response type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryAccountAddressDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressDerivativeOrdersResponse is the response type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryAccountAddressDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse"; + value: QueryAccountAddressDerivativeOrdersResponseAmino; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryDerivativeOrdersByHashesRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the order hashes */ + orderHashes: string[]; +} +export interface QueryDerivativeOrdersByHashesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryDerivativeOrdersByHashesRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the order hashes */ + order_hashes: string[]; +} +export interface QueryDerivativeOrdersByHashesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest"; + value: QueryDerivativeOrdersByHashesRequestAmino; +} +/** + * QueryDerivativeOrdersByHashesResponse is the response type for the + * Query/DerivativeOrdersByHashes RPC method. + */ +export interface QueryDerivativeOrdersByHashesResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryDerivativeOrdersByHashesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeOrdersByHashesResponse is the response type for the + * Query/DerivativeOrdersByHashes RPC method. + */ +export interface QueryDerivativeOrdersByHashesResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryDerivativeOrdersByHashesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse"; + value: QueryDerivativeOrdersByHashesResponseAmino; +} +/** + * QueryDerivativeMarketsRequest is the request type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryDerivativeMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketsRequest is the request type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryDerivativeMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest"; + value: QueryDerivativeMarketsRequestAmino; +} +export interface PriceLevel { + price: string; + /** quantity */ + quantity: string; +} +export interface PriceLevelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PriceLevel"; + value: Uint8Array; +} +export interface PriceLevelAmino { + price: string; + /** quantity */ + quantity: string; +} +export interface PriceLevelAminoMsg { + type: "/injective.exchange.v1beta1.PriceLevel"; + value: PriceLevelAmino; +} +export interface PerpetualMarketState { + marketInfo?: PerpetualMarketInfo; + fundingInfo?: PerpetualMarketFunding; +} +export interface PerpetualMarketStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState"; + value: Uint8Array; +} +export interface PerpetualMarketStateAmino { + market_info?: PerpetualMarketInfoAmino; + funding_info?: PerpetualMarketFundingAmino; +} +export interface PerpetualMarketStateAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketState"; + value: PerpetualMarketStateAmino; +} +export interface FullDerivativeMarket { + market?: DerivativeMarket; + perpetualInfo?: PerpetualMarketState; + futuresInfo?: ExpiryFuturesMarketInfo; + markPrice: string; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + midPriceAndTob?: MidPriceAndTOB; +} +export interface FullDerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket"; + value: Uint8Array; +} +export interface FullDerivativeMarketAmino { + market?: DerivativeMarketAmino; + perpetual_info?: PerpetualMarketStateAmino; + futures_info?: ExpiryFuturesMarketInfoAmino; + mark_price: string; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + mid_price_and_tob?: MidPriceAndTOBAmino; +} +export interface FullDerivativeMarketAminoMsg { + type: "/injective.exchange.v1beta1.FullDerivativeMarket"; + value: FullDerivativeMarketAmino; +} +/** + * QueryDerivativeMarketsResponse is the response type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsResponse { + markets: FullDerivativeMarket[]; +} +export interface QueryDerivativeMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketsResponse is the response type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsResponseAmino { + markets: FullDerivativeMarketAmino[]; +} +export interface QueryDerivativeMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse"; + value: QueryDerivativeMarketsResponseAmino; +} +/** + * QueryDerivativeMarketRequest is the request type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketRequest is the request type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest"; + value: QueryDerivativeMarketRequestAmino; +} +/** + * QueryDerivativeMarketResponse is the response type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketResponse { + market?: FullDerivativeMarket; +} +export interface QueryDerivativeMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketResponse is the response type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketResponseAmino { + market?: FullDerivativeMarketAmino; +} +export interface QueryDerivativeMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse"; + value: QueryDerivativeMarketResponseAmino; +} +/** + * QueryDerivativeMarketAddressRequest is the request type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMarketAddressRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketAddressRequest is the request type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMarketAddressRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest"; + value: QueryDerivativeMarketAddressRequestAmino; +} +/** + * QueryDerivativeMarketAddressResponse is the response type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressResponse { + /** address for the market */ + address: string; + /** subaccountID for the market */ + subaccountId: string; +} +export interface QueryDerivativeMarketAddressResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketAddressResponse is the response type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressResponseAmino { + /** address for the market */ + address: string; + /** subaccountID for the market */ + subaccount_id: string; +} +export interface QueryDerivativeMarketAddressResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse"; + value: QueryDerivativeMarketAddressResponseAmino; +} +/** + * QuerySubaccountTradeNonceRequest is the request type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceRequest { + subaccountId: string; +} +export interface QuerySubaccountTradeNonceRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountTradeNonceRequest is the request type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountTradeNonceRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest"; + value: QuerySubaccountTradeNonceRequestAmino; +} +/** + * QuerySubaccountPositionsRequest is the request type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsRequest { + subaccountId: string; +} +export interface QuerySubaccountPositionsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionsRequest is the request type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountPositionsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest"; + value: QuerySubaccountPositionsRequestAmino; +} +/** + * QuerySubaccountPositionInMarketRequest is the request type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountPositionInMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionInMarketRequest is the request type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountPositionInMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest"; + value: QuerySubaccountPositionInMarketRequestAmino; +} +/** + * QuerySubaccountEffectivePositionInMarketRequest is the request type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountEffectivePositionInMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountEffectivePositionInMarketRequest is the request type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountEffectivePositionInMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest"; + value: QuerySubaccountEffectivePositionInMarketRequestAmino; +} +/** + * QuerySubaccountOrderMetadataRequest is the request type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataRequest { + subaccountId: string; +} +export interface QuerySubaccountOrderMetadataRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountOrderMetadataRequest is the request type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountOrderMetadataRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest"; + value: QuerySubaccountOrderMetadataRequestAmino; +} +/** + * QuerySubaccountPositionsResponse is the response type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsResponse { + state: DerivativePosition[]; +} +export interface QuerySubaccountPositionsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionsResponse is the response type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsResponseAmino { + state: DerivativePositionAmino[]; +} +export interface QuerySubaccountPositionsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse"; + value: QuerySubaccountPositionsResponseAmino; +} +/** + * QuerySubaccountPositionInMarketResponse is the response type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketResponse { + state?: Position; +} +export interface QuerySubaccountPositionInMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionInMarketResponse is the response type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketResponseAmino { + state?: PositionAmino; +} +export interface QuerySubaccountPositionInMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse"; + value: QuerySubaccountPositionInMarketResponseAmino; +} +export interface EffectivePosition { + isLong: boolean; + quantity: string; + entryPrice: string; + effectiveMargin: string; +} +export interface EffectivePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition"; + value: Uint8Array; +} +export interface EffectivePositionAmino { + is_long: boolean; + quantity: string; + entry_price: string; + effective_margin: string; +} +export interface EffectivePositionAminoMsg { + type: "/injective.exchange.v1beta1.EffectivePosition"; + value: EffectivePositionAmino; +} +/** + * QuerySubaccountEffectivePositionInMarketResponse is the response type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketResponse { + state?: EffectivePosition; +} +export interface QuerySubaccountEffectivePositionInMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountEffectivePositionInMarketResponse is the response type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketResponseAmino { + state?: EffectivePositionAmino; +} +export interface QuerySubaccountEffectivePositionInMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse"; + value: QuerySubaccountEffectivePositionInMarketResponseAmino; +} +/** + * QueryPerpetualMarketInfoRequest is the request type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoRequest { + marketId: string; +} +export interface QueryPerpetualMarketInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketInfoRequest is the request type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoRequestAmino { + market_id: string; +} +export interface QueryPerpetualMarketInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest"; + value: QueryPerpetualMarketInfoRequestAmino; +} +/** + * QueryPerpetualMarketInfoResponse is the response type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoResponse { + info: PerpetualMarketInfo; +} +export interface QueryPerpetualMarketInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketInfoResponse is the response type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoResponseAmino { + info: PerpetualMarketInfoAmino; +} +export interface QueryPerpetualMarketInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse"; + value: QueryPerpetualMarketInfoResponseAmino; +} +/** + * QueryExpiryFuturesMarketInfoRequest is the request type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoRequest { + marketId: string; +} +export interface QueryExpiryFuturesMarketInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest"; + value: Uint8Array; +} +/** + * QueryExpiryFuturesMarketInfoRequest is the request type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoRequestAmino { + market_id: string; +} +export interface QueryExpiryFuturesMarketInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest"; + value: QueryExpiryFuturesMarketInfoRequestAmino; +} +/** + * QueryExpiryFuturesMarketInfoResponse is the response type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoResponse { + info: ExpiryFuturesMarketInfo; +} +export interface QueryExpiryFuturesMarketInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse"; + value: Uint8Array; +} +/** + * QueryExpiryFuturesMarketInfoResponse is the response type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoResponseAmino { + info: ExpiryFuturesMarketInfoAmino; +} +export interface QueryExpiryFuturesMarketInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse"; + value: QueryExpiryFuturesMarketInfoResponseAmino; +} +/** + * QueryPerpetualMarketFundingRequest is the request type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingRequest { + marketId: string; +} +export interface QueryPerpetualMarketFundingRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketFundingRequest is the request type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingRequestAmino { + market_id: string; +} +export interface QueryPerpetualMarketFundingRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest"; + value: QueryPerpetualMarketFundingRequestAmino; +} +/** + * QueryPerpetualMarketFundingResponse is the response type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingResponse { + state: PerpetualMarketFunding; +} +export interface QueryPerpetualMarketFundingResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketFundingResponse is the response type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingResponseAmino { + state: PerpetualMarketFundingAmino; +} +export interface QueryPerpetualMarketFundingResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse"; + value: QueryPerpetualMarketFundingResponseAmino; +} +/** + * QuerySubaccountOrderMetadataResponse is the response type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataResponse { + metadata: SubaccountOrderbookMetadataWithMarket[]; +} +export interface QuerySubaccountOrderMetadataResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountOrderMetadataResponse is the response type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataResponseAmino { + metadata: SubaccountOrderbookMetadataWithMarketAmino[]; +} +export interface QuerySubaccountOrderMetadataResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse"; + value: QuerySubaccountOrderMetadataResponseAmino; +} +/** + * QuerySubaccountTradeNonceResponse is the response type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceResponse { + nonce: number; +} +export interface QuerySubaccountTradeNonceResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountTradeNonceResponse is the response type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceResponseAmino { + nonce: number; +} +export interface QuerySubaccountTradeNonceResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse"; + value: QuerySubaccountTradeNonceResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/ExchangeModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/ExchangeModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/ExchangeModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/ExchangeModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +/** QueryPositionsRequest is the request type for the Query/Positions RPC method. */ +export interface QueryPositionsRequest {} +export interface QueryPositionsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest"; + value: Uint8Array; +} +/** QueryPositionsRequest is the request type for the Query/Positions RPC method. */ +export interface QueryPositionsRequestAmino {} +export interface QueryPositionsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPositionsRequest"; + value: QueryPositionsRequestAmino; +} +/** + * QueryPositionsResponse is the response type for the Query/Positions RPC + * method. + */ +export interface QueryPositionsResponse { + state: DerivativePosition[]; +} +export interface QueryPositionsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse"; + value: Uint8Array; +} +/** + * QueryPositionsResponse is the response type for the Query/Positions RPC + * method. + */ +export interface QueryPositionsResponseAmino { + state: DerivativePositionAmino[]; +} +export interface QueryPositionsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPositionsResponse"; + value: QueryPositionsResponseAmino; +} +/** + * QueryTradeRewardPointsRequest is the request type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsRequest { + accounts: string[]; + pendingPoolTimestamp: bigint; +} +export interface QueryTradeRewardPointsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest"; + value: Uint8Array; +} +/** + * QueryTradeRewardPointsRequest is the request type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsRequestAmino { + accounts: string[]; + pending_pool_timestamp: string; +} +export interface QueryTradeRewardPointsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest"; + value: QueryTradeRewardPointsRequestAmino; +} +/** + * QueryTradeRewardPointsResponse is the response type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsResponse { + accountTradeRewardPoints: string[]; +} +export interface QueryTradeRewardPointsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse"; + value: Uint8Array; +} +/** + * QueryTradeRewardPointsResponse is the response type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsResponseAmino { + account_trade_reward_points: string[]; +} +export interface QueryTradeRewardPointsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse"; + value: QueryTradeRewardPointsResponseAmino; +} +/** + * QueryTradeRewardCampaignRequest is the request type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignRequest {} +export interface QueryTradeRewardCampaignRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest"; + value: Uint8Array; +} +/** + * QueryTradeRewardCampaignRequest is the request type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignRequestAmino {} +export interface QueryTradeRewardCampaignRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest"; + value: QueryTradeRewardCampaignRequestAmino; +} +/** + * QueryTradeRewardCampaignResponse is the response type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignResponse { + tradingRewardCampaignInfo?: TradingRewardCampaignInfo; + tradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + totalTradeRewardPoints: string; + pendingTradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + pendingTotalTradeRewardPoints: string[]; +} +export interface QueryTradeRewardCampaignResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse"; + value: Uint8Array; +} +/** + * QueryTradeRewardCampaignResponse is the response type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignResponseAmino { + trading_reward_campaign_info?: TradingRewardCampaignInfoAmino; + trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + total_trade_reward_points: string; + pending_trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + pending_total_trade_reward_points: string[]; +} +export interface QueryTradeRewardCampaignResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse"; + value: QueryTradeRewardCampaignResponseAmino; +} +/** + * QueryIsRegisteredDMMRequest is the request type for the Query/IsRegisteredDMM + * RPC method. + */ +export interface QueryIsOptedOutOfRewardsRequest { + account: string; +} +export interface QueryIsOptedOutOfRewardsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest"; + value: Uint8Array; +} +/** + * QueryIsRegisteredDMMRequest is the request type for the Query/IsRegisteredDMM + * RPC method. + */ +export interface QueryIsOptedOutOfRewardsRequestAmino { + account: string; +} +export interface QueryIsOptedOutOfRewardsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest"; + value: QueryIsOptedOutOfRewardsRequestAmino; +} +/** + * QueryIsRegisteredDMMResponse is the response type for the + * Query/IsRegisteredDMM RPC method. + */ +export interface QueryIsOptedOutOfRewardsResponse { + isOptedOut: boolean; +} +export interface QueryIsOptedOutOfRewardsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse"; + value: Uint8Array; +} +/** + * QueryIsRegisteredDMMResponse is the response type for the + * Query/IsRegisteredDMM RPC method. + */ +export interface QueryIsOptedOutOfRewardsResponseAmino { + is_opted_out: boolean; +} +export interface QueryIsOptedOutOfRewardsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse"; + value: QueryIsOptedOutOfRewardsResponseAmino; +} +/** + * QueryRegisteredDMMsRequest is the request type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsRequest {} +export interface QueryOptedOutOfRewardsAccountsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest"; + value: Uint8Array; +} +/** + * QueryRegisteredDMMsRequest is the request type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsRequestAmino {} +export interface QueryOptedOutOfRewardsAccountsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest"; + value: QueryOptedOutOfRewardsAccountsRequestAmino; +} +/** + * QueryRegisteredDMMsResponse is the response type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsResponse { + accounts: string[]; +} +export interface QueryOptedOutOfRewardsAccountsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse"; + value: Uint8Array; +} +/** + * QueryRegisteredDMMsResponse is the response type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsResponseAmino { + accounts: string[]; +} +export interface QueryOptedOutOfRewardsAccountsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse"; + value: QueryOptedOutOfRewardsAccountsResponseAmino; +} +/** + * QueryFeeDiscountAccountInfoRequest is the request type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoRequest { + account: string; +} +export interface QueryFeeDiscountAccountInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountAccountInfoRequest is the request type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoRequestAmino { + account: string; +} +export interface QueryFeeDiscountAccountInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest"; + value: QueryFeeDiscountAccountInfoRequestAmino; +} +/** + * QueryFeeDiscountAccountInfoResponse is the response type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoResponse { + tierLevel: bigint; + accountInfo?: FeeDiscountTierInfo; + accountTtl?: FeeDiscountTierTTL; +} +export interface QueryFeeDiscountAccountInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountAccountInfoResponse is the response type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoResponseAmino { + tier_level: string; + account_info?: FeeDiscountTierInfoAmino; + account_ttl?: FeeDiscountTierTTLAmino; +} +export interface QueryFeeDiscountAccountInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse"; + value: QueryFeeDiscountAccountInfoResponseAmino; +} +/** + * QueryFeeDiscountScheduleRequest is the request type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleRequest {} +export interface QueryFeeDiscountScheduleRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountScheduleRequest is the request type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleRequestAmino {} +export interface QueryFeeDiscountScheduleRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest"; + value: QueryFeeDiscountScheduleRequestAmino; +} +/** + * QueryFeeDiscountScheduleResponse is the response type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleResponse { + feeDiscountSchedule?: FeeDiscountSchedule; +} +export interface QueryFeeDiscountScheduleResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountScheduleResponse is the response type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleResponseAmino { + fee_discount_schedule?: FeeDiscountScheduleAmino; +} +export interface QueryFeeDiscountScheduleResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse"; + value: QueryFeeDiscountScheduleResponseAmino; +} +/** + * QueryBalanceMismatchesRequest is the request type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesRequest { + dustFactor: bigint; +} +export interface QueryBalanceMismatchesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest"; + value: Uint8Array; +} +/** + * QueryBalanceMismatchesRequest is the request type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesRequestAmino { + dust_factor: string; +} +export interface QueryBalanceMismatchesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest"; + value: QueryBalanceMismatchesRequestAmino; +} +export interface BalanceMismatch { + subaccountId: string; + denom: string; + available: string; + total: string; + balanceHold: string; + expectedTotal: string; + difference: string; +} +export interface BalanceMismatchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch"; + value: Uint8Array; +} +export interface BalanceMismatchAmino { + subaccountId: string; + denom: string; + available: string; + total: string; + balance_hold: string; + expected_total: string; + difference: string; +} +export interface BalanceMismatchAminoMsg { + type: "/injective.exchange.v1beta1.BalanceMismatch"; + value: BalanceMismatchAmino; +} +/** + * QueryBalanceMismatchesResponse is the response type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesResponse { + balanceMismatches: BalanceMismatch[]; +} +export interface QueryBalanceMismatchesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse"; + value: Uint8Array; +} +/** + * QueryBalanceMismatchesResponse is the response type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesResponseAmino { + balance_mismatches: BalanceMismatchAmino[]; +} +export interface QueryBalanceMismatchesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse"; + value: QueryBalanceMismatchesResponseAmino; +} +/** + * QueryBalanceWithBalanceHoldsRequest is the request type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsRequest {} +export interface QueryBalanceWithBalanceHoldsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest"; + value: Uint8Array; +} +/** + * QueryBalanceWithBalanceHoldsRequest is the request type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsRequestAmino {} +export interface QueryBalanceWithBalanceHoldsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest"; + value: QueryBalanceWithBalanceHoldsRequestAmino; +} +export interface BalanceWithMarginHold { + subaccountId: string; + denom: string; + available: string; + total: string; + balanceHold: string; +} +export interface BalanceWithMarginHoldProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold"; + value: Uint8Array; +} +export interface BalanceWithMarginHoldAmino { + subaccountId: string; + denom: string; + available: string; + total: string; + balance_hold: string; +} +export interface BalanceWithMarginHoldAminoMsg { + type: "/injective.exchange.v1beta1.BalanceWithMarginHold"; + value: BalanceWithMarginHoldAmino; +} +/** + * QueryBalanceWithBalanceHoldsResponse is the response type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsResponse { + balanceWithBalanceHolds: BalanceWithMarginHold[]; +} +export interface QueryBalanceWithBalanceHoldsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse"; + value: Uint8Array; +} +/** + * QueryBalanceWithBalanceHoldsResponse is the response type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsResponseAmino { + balance_with_balance_holds: BalanceWithMarginHoldAmino[]; +} +export interface QueryBalanceWithBalanceHoldsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse"; + value: QueryBalanceWithBalanceHoldsResponseAmino; +} +/** + * QueryFeeDiscountTierStatisticsRequest is the request type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsRequest {} +export interface QueryFeeDiscountTierStatisticsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountTierStatisticsRequest is the request type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsRequestAmino {} +export interface QueryFeeDiscountTierStatisticsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest"; + value: QueryFeeDiscountTierStatisticsRequestAmino; +} +export interface TierStatistic { + tier: bigint; + count: bigint; +} +export interface TierStatisticProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TierStatistic"; + value: Uint8Array; +} +export interface TierStatisticAmino { + tier: string; + count: string; +} +export interface TierStatisticAminoMsg { + type: "/injective.exchange.v1beta1.TierStatistic"; + value: TierStatisticAmino; +} +/** + * QueryFeeDiscountTierStatisticsResponse is the response type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsResponse { + statistics: TierStatistic[]; +} +export interface QueryFeeDiscountTierStatisticsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountTierStatisticsResponse is the response type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsResponseAmino { + statistics: TierStatisticAmino[]; +} +export interface QueryFeeDiscountTierStatisticsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse"; + value: QueryFeeDiscountTierStatisticsResponseAmino; +} +/** + * MitoVaultInfosRequest is the request type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosRequest {} +export interface MitoVaultInfosRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest"; + value: Uint8Array; +} +/** + * MitoVaultInfosRequest is the request type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosRequestAmino {} +export interface MitoVaultInfosRequestAminoMsg { + type: "/injective.exchange.v1beta1.MitoVaultInfosRequest"; + value: MitoVaultInfosRequestAmino; +} +/** + * MitoVaultInfosResponse is the response type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosResponse { + masterAddresses: string[]; + derivativeAddresses: string[]; + spotAddresses: string[]; + cw20Addresses: string[]; +} +export interface MitoVaultInfosResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse"; + value: Uint8Array; +} +/** + * MitoVaultInfosResponse is the response type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosResponseAmino { + master_addresses: string[]; + derivative_addresses: string[]; + spot_addresses: string[]; + cw20_addresses: string[]; +} +export interface MitoVaultInfosResponseAminoMsg { + type: "/injective.exchange.v1beta1.MitoVaultInfosResponse"; + value: MitoVaultInfosResponseAmino; +} +/** + * QueryMarketIDFromVaultRequest is the request type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultRequest { + vaultAddress: string; +} +export interface QueryMarketIDFromVaultRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest"; + value: Uint8Array; +} +/** + * QueryMarketIDFromVaultRequest is the request type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultRequestAmino { + vault_address: string; +} +export interface QueryMarketIDFromVaultRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest"; + value: QueryMarketIDFromVaultRequestAmino; +} +/** + * QueryMarketIDFromVaultResponse is the response type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultResponse { + marketId: string; +} +export interface QueryMarketIDFromVaultResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse"; + value: Uint8Array; +} +/** + * QueryMarketIDFromVaultResponse is the response type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultResponseAmino { + market_id: string; +} +export interface QueryMarketIDFromVaultResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse"; + value: QueryMarketIDFromVaultResponseAmino; +} +export interface QueryHistoricalTradeRecordsRequest { + marketId: string; +} +export interface QueryHistoricalTradeRecordsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest"; + value: Uint8Array; +} +export interface QueryHistoricalTradeRecordsRequestAmino { + market_id: string; +} +export interface QueryHistoricalTradeRecordsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest"; + value: QueryHistoricalTradeRecordsRequestAmino; +} +export interface QueryHistoricalTradeRecordsResponse { + tradeRecords: TradeRecords[]; +} +export interface QueryHistoricalTradeRecordsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse"; + value: Uint8Array; +} +export interface QueryHistoricalTradeRecordsResponseAmino { + trade_records: TradeRecordsAmino[]; +} +export interface QueryHistoricalTradeRecordsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse"; + value: QueryHistoricalTradeRecordsResponseAmino; +} +/** + * TradeHistoryOptions are the optional params for Query/MarketVolatility RPC + * method. + */ +export interface TradeHistoryOptions { + /** TradeGroupingSec of 0 means use the chain's default grouping */ + tradeGroupingSec: bigint; + /** + * MaxAge restricts the trade records oldest age in seconds from the current + * block time to consider. A value of 0 means use all the records present on + * the chain. + */ + maxAge: bigint; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + includeRawHistory: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + includeMetadata: boolean; +} +export interface TradeHistoryOptionsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions"; + value: Uint8Array; +} +/** + * TradeHistoryOptions are the optional params for Query/MarketVolatility RPC + * method. + */ +export interface TradeHistoryOptionsAmino { + /** TradeGroupingSec of 0 means use the chain's default grouping */ + trade_grouping_sec: string; + /** + * MaxAge restricts the trade records oldest age in seconds from the current + * block time to consider. A value of 0 means use all the records present on + * the chain. + */ + max_age: string; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + include_raw_history: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + include_metadata: boolean; +} +export interface TradeHistoryOptionsAminoMsg { + type: "/injective.exchange.v1beta1.TradeHistoryOptions"; + value: TradeHistoryOptionsAmino; +} +/** + * QueryMarketVolatilityRequest are the request params for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityRequest { + marketId: string; + tradeHistoryOptions?: TradeHistoryOptions; +} +export interface QueryMarketVolatilityRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest"; + value: Uint8Array; +} +/** + * QueryMarketVolatilityRequest are the request params for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityRequestAmino { + market_id: string; + trade_history_options?: TradeHistoryOptionsAmino; +} +export interface QueryMarketVolatilityRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest"; + value: QueryMarketVolatilityRequestAmino; +} +/** + * QueryMarketVolatilityResponse is the response type for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityResponse { + volatility: string; + historyMetadata?: MetadataStatistics; + rawHistory: TradeRecord[]; +} +export interface QueryMarketVolatilityResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse"; + value: Uint8Array; +} +/** + * QueryMarketVolatilityResponse is the response type for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityResponseAmino { + volatility: string; + history_metadata?: MetadataStatisticsAmino; + raw_history: TradeRecordAmino[]; +} +export interface QueryMarketVolatilityResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse"; + value: QueryMarketVolatilityResponseAmino; +} +/** + * QuerBinaryMarketsRequest is the request type for the Query/BinaryMarkets RPC + * method. + */ +export interface QueryBinaryMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; +} +export interface QueryBinaryMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest"; + value: Uint8Array; +} +/** + * QuerBinaryMarketsRequest is the request type for the Query/BinaryMarkets RPC + * method. + */ +export interface QueryBinaryMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; +} +export interface QueryBinaryMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest"; + value: QueryBinaryMarketsRequestAmino; +} +/** + * QueryBinaryMarketsResponse is the response type for the Query/BinaryMarkets + * RPC method. + */ +export interface QueryBinaryMarketsResponse { + markets: BinaryOptionsMarket[]; +} +export interface QueryBinaryMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse"; + value: Uint8Array; +} +/** + * QueryBinaryMarketsResponse is the response type for the Query/BinaryMarkets + * RPC method. + */ +export interface QueryBinaryMarketsResponseAmino { + markets: BinaryOptionsMarketAmino[]; +} +export interface QueryBinaryMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse"; + value: QueryBinaryMarketsResponseAmino; +} +/** + * QueryConditionalOrdersRequest is the request type for the + * Query/ConditionalOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersRequest { + subaccountId: string; + marketId: string; +} +export interface QueryTraderDerivativeConditionalOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest"; + value: Uint8Array; +} +/** + * QueryConditionalOrdersRequest is the request type for the + * Query/ConditionalOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QueryTraderDerivativeConditionalOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest"; + value: QueryTraderDerivativeConditionalOrdersRequestAmino; +} +export interface TrimmedDerivativeConditionalOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** price to trigger the order */ + triggerPrice: string; + /** true if the order is a buy */ + isBuy: boolean; + isLimit: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedDerivativeConditionalOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder"; + value: Uint8Array; +} +export interface TrimmedDerivativeConditionalOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** price to trigger the order */ + triggerPrice: string; + /** true if the order is a buy */ + isBuy: boolean; + isLimit: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedDerivativeConditionalOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder"; + value: TrimmedDerivativeConditionalOrderAmino; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersResponse { + orders: TrimmedDerivativeConditionalOrder[]; +} +export interface QueryTraderDerivativeConditionalOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersResponseAmino { + orders: TrimmedDerivativeConditionalOrderAmino[]; +} +export interface QueryTraderDerivativeConditionalOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse"; + value: QueryTraderDerivativeConditionalOrdersResponseAmino; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequest { + marketId: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest"; + value: Uint8Array; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + market_id: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest"; + value: QueryMarketAtomicExecutionFeeMultiplierRequestAmino; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponse { + multiplier: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse"; + value: Uint8Array; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + multiplier: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse"; + value: QueryMarketAtomicExecutionFeeMultiplierResponseAmino; +} +export interface QueryActiveStakeGrantRequest { + grantee: string; +} +export interface QueryActiveStakeGrantRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest"; + value: Uint8Array; +} +export interface QueryActiveStakeGrantRequestAmino { + grantee: string; +} +export interface QueryActiveStakeGrantRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest"; + value: QueryActiveStakeGrantRequestAmino; +} +export interface QueryActiveStakeGrantResponse { + grant?: ActiveGrant; + effectiveGrant?: EffectiveGrant; +} +export interface QueryActiveStakeGrantResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse"; + value: Uint8Array; +} +export interface QueryActiveStakeGrantResponseAmino { + grant?: ActiveGrantAmino; + effective_grant?: EffectiveGrantAmino; +} +export interface QueryActiveStakeGrantResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse"; + value: QueryActiveStakeGrantResponseAmino; +} +export interface QueryGrantAuthorizationRequest { + granter: string; + grantee: string; +} +export interface QueryGrantAuthorizationRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationRequestAmino { + granter: string; + grantee: string; +} +export interface QueryGrantAuthorizationRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest"; + value: QueryGrantAuthorizationRequestAmino; +} +export interface QueryGrantAuthorizationResponse { + amount: string; +} +export interface QueryGrantAuthorizationResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationResponseAmino { + amount: string; +} +export interface QueryGrantAuthorizationResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse"; + value: QueryGrantAuthorizationResponseAmino; +} +export interface QueryGrantAuthorizationsRequest { + granter: string; +} +export interface QueryGrantAuthorizationsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationsRequestAmino { + granter: string; +} +export interface QueryGrantAuthorizationsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest"; + value: QueryGrantAuthorizationsRequestAmino; +} +export interface QueryGrantAuthorizationsResponse { + totalGrantAmount: string; + grants: GrantAuthorization[]; +} +export interface QueryGrantAuthorizationsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationsResponseAmino { + total_grant_amount: string; + grants: GrantAuthorizationAmino[]; +} +export interface QueryGrantAuthorizationsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse"; + value: QueryGrantAuthorizationsResponseAmino; +} +function createBaseSubaccount(): Subaccount { + return { + trader: "", + subaccountNonce: 0 + }; +} +export const Subaccount = { + typeUrl: "/injective.exchange.v1beta1.Subaccount", + is(o: any): o is Subaccount { + return o && (o.$typeUrl === Subaccount.typeUrl || typeof o.trader === "string" && typeof o.subaccountNonce === "number"); + }, + isAmino(o: any): o is SubaccountAmino { + return o && (o.$typeUrl === Subaccount.typeUrl || typeof o.trader === "string" && typeof o.subaccount_nonce === "number"); + }, + encode(message: Subaccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.trader !== "") { + writer.uint32(10).string(message.trader); + } + if (message.subaccountNonce !== 0) { + writer.uint32(16).uint32(message.subaccountNonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subaccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trader = reader.string(); + break; + case 2: + message.subaccountNonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Subaccount { + const message = createBaseSubaccount(); + message.trader = object.trader ?? ""; + message.subaccountNonce = object.subaccountNonce ?? 0; + return message; + }, + fromAmino(object: SubaccountAmino): Subaccount { + const message = createBaseSubaccount(); + if (object.trader !== undefined && object.trader !== null) { + message.trader = object.trader; + } + if (object.subaccount_nonce !== undefined && object.subaccount_nonce !== null) { + message.subaccountNonce = object.subaccount_nonce; + } + return message; + }, + toAmino(message: Subaccount): SubaccountAmino { + const obj: any = {}; + obj.trader = message.trader === "" ? undefined : message.trader; + obj.subaccount_nonce = message.subaccountNonce === 0 ? undefined : message.subaccountNonce; + return obj; + }, + fromAminoMsg(object: SubaccountAminoMsg): Subaccount { + return Subaccount.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountProtoMsg): Subaccount { + return Subaccount.decode(message.value); + }, + toProto(message: Subaccount): Uint8Array { + return Subaccount.encode(message).finish(); + }, + toProtoMsg(message: Subaccount): SubaccountProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Subaccount", + value: Subaccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Subaccount.typeUrl, Subaccount); +function createBaseQuerySubaccountOrdersRequest(): QuerySubaccountOrdersRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest", + is(o: any): o is QuerySubaccountOrdersRequest { + return o && (o.$typeUrl === QuerySubaccountOrdersRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountOrdersRequestAmino { + return o && (o.$typeUrl === QuerySubaccountOrdersRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrdersRequest { + const message = createBaseQuerySubaccountOrdersRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountOrdersRequestAmino): QuerySubaccountOrdersRequest { + const message = createBaseQuerySubaccountOrdersRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountOrdersRequest): QuerySubaccountOrdersRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrdersRequestAminoMsg): QuerySubaccountOrdersRequest { + return QuerySubaccountOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrdersRequestProtoMsg): QuerySubaccountOrdersRequest { + return QuerySubaccountOrdersRequest.decode(message.value); + }, + toProto(message: QuerySubaccountOrdersRequest): Uint8Array { + return QuerySubaccountOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrdersRequest): QuerySubaccountOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest", + value: QuerySubaccountOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrdersRequest.typeUrl, QuerySubaccountOrdersRequest); +function createBaseQuerySubaccountOrdersResponse(): QuerySubaccountOrdersResponse { + return { + buyOrders: [], + sellOrders: [] + }; +} +export const QuerySubaccountOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse", + is(o: any): o is QuerySubaccountOrdersResponse { + return o && (o.$typeUrl === QuerySubaccountOrdersResponse.typeUrl || Array.isArray(o.buyOrders) && (!o.buyOrders.length || SubaccountOrderData.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || SubaccountOrderData.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is QuerySubaccountOrdersResponseAmino { + return o && (o.$typeUrl === QuerySubaccountOrdersResponse.typeUrl || Array.isArray(o.buy_orders) && (!o.buy_orders.length || SubaccountOrderData.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || SubaccountOrderData.isAmino(o.sell_orders[0]))); + }, + encode(message: QuerySubaccountOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buyOrders) { + SubaccountOrderData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellOrders) { + SubaccountOrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buyOrders.push(SubaccountOrderData.decode(reader, reader.uint32())); + break; + case 2: + message.sellOrders.push(SubaccountOrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrdersResponse { + const message = createBaseQuerySubaccountOrdersResponse(); + message.buyOrders = object.buyOrders?.map(e => SubaccountOrderData.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => SubaccountOrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountOrdersResponseAmino): QuerySubaccountOrdersResponse { + const message = createBaseQuerySubaccountOrdersResponse(); + message.buyOrders = object.buy_orders?.map(e => SubaccountOrderData.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => SubaccountOrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountOrdersResponse): QuerySubaccountOrdersResponseAmino { + const obj: any = {}; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? SubaccountOrderData.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? SubaccountOrderData.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrdersResponseAminoMsg): QuerySubaccountOrdersResponse { + return QuerySubaccountOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrdersResponseProtoMsg): QuerySubaccountOrdersResponse { + return QuerySubaccountOrdersResponse.decode(message.value); + }, + toProto(message: QuerySubaccountOrdersResponse): Uint8Array { + return QuerySubaccountOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrdersResponse): QuerySubaccountOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse", + value: QuerySubaccountOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrdersResponse.typeUrl, QuerySubaccountOrdersResponse); +function createBaseSubaccountOrderbookMetadataWithMarket(): SubaccountOrderbookMetadataWithMarket { + return { + metadata: undefined, + marketId: "", + isBuy: false + }; +} +export const SubaccountOrderbookMetadataWithMarket = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket", + is(o: any): o is SubaccountOrderbookMetadataWithMarket { + return o && (o.$typeUrl === SubaccountOrderbookMetadataWithMarket.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean"); + }, + isAmino(o: any): o is SubaccountOrderbookMetadataWithMarketAmino { + return o && (o.$typeUrl === SubaccountOrderbookMetadataWithMarket.typeUrl || typeof o.market_id === "string" && typeof o.isBuy === "boolean"); + }, + encode(message: SubaccountOrderbookMetadataWithMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.metadata !== undefined) { + SubaccountOrderbookMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(24).bool(message.isBuy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderbookMetadataWithMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = SubaccountOrderbookMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.isBuy = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderbookMetadataWithMarket { + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? SubaccountOrderbookMetadata.fromPartial(object.metadata) : undefined; + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + return message; + }, + fromAmino(object: SubaccountOrderbookMetadataWithMarketAmino): SubaccountOrderbookMetadataWithMarket { + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = SubaccountOrderbookMetadata.fromAmino(object.metadata); + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + return message; + }, + toAmino(message: SubaccountOrderbookMetadataWithMarket): SubaccountOrderbookMetadataWithMarketAmino { + const obj: any = {}; + obj.metadata = message.metadata ? SubaccountOrderbookMetadata.toAmino(message.metadata) : undefined; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + return obj; + }, + fromAminoMsg(object: SubaccountOrderbookMetadataWithMarketAminoMsg): SubaccountOrderbookMetadataWithMarket { + return SubaccountOrderbookMetadataWithMarket.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderbookMetadataWithMarketProtoMsg): SubaccountOrderbookMetadataWithMarket { + return SubaccountOrderbookMetadataWithMarket.decode(message.value); + }, + toProto(message: SubaccountOrderbookMetadataWithMarket): Uint8Array { + return SubaccountOrderbookMetadataWithMarket.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderbookMetadataWithMarket): SubaccountOrderbookMetadataWithMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket", + value: SubaccountOrderbookMetadataWithMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderbookMetadataWithMarket.typeUrl, SubaccountOrderbookMetadataWithMarket); +function createBaseQueryExchangeParamsRequest(): QueryExchangeParamsRequest { + return {}; +} +export const QueryExchangeParamsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest", + is(o: any): o is QueryExchangeParamsRequest { + return o && o.$typeUrl === QueryExchangeParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryExchangeParamsRequestAmino { + return o && o.$typeUrl === QueryExchangeParamsRequest.typeUrl; + }, + encode(_: QueryExchangeParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryExchangeParamsRequest { + const message = createBaseQueryExchangeParamsRequest(); + return message; + }, + fromAmino(_: QueryExchangeParamsRequestAmino): QueryExchangeParamsRequest { + const message = createBaseQueryExchangeParamsRequest(); + return message; + }, + toAmino(_: QueryExchangeParamsRequest): QueryExchangeParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryExchangeParamsRequestAminoMsg): QueryExchangeParamsRequest { + return QueryExchangeParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeParamsRequestProtoMsg): QueryExchangeParamsRequest { + return QueryExchangeParamsRequest.decode(message.value); + }, + toProto(message: QueryExchangeParamsRequest): Uint8Array { + return QueryExchangeParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeParamsRequest): QueryExchangeParamsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest", + value: QueryExchangeParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeParamsRequest.typeUrl, QueryExchangeParamsRequest); +function createBaseQueryExchangeParamsResponse(): QueryExchangeParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryExchangeParamsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse", + is(o: any): o is QueryExchangeParamsResponse { + return o && (o.$typeUrl === QueryExchangeParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryExchangeParamsResponseAmino { + return o && (o.$typeUrl === QueryExchangeParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryExchangeParamsResponse, 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): QueryExchangeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeParamsResponse(); + 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: DeepPartial): QueryExchangeParamsResponse { + const message = createBaseQueryExchangeParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryExchangeParamsResponseAmino): QueryExchangeParamsResponse { + const message = createBaseQueryExchangeParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryExchangeParamsResponse): QueryExchangeParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryExchangeParamsResponseAminoMsg): QueryExchangeParamsResponse { + return QueryExchangeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeParamsResponseProtoMsg): QueryExchangeParamsResponse { + return QueryExchangeParamsResponse.decode(message.value); + }, + toProto(message: QueryExchangeParamsResponse): Uint8Array { + return QueryExchangeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeParamsResponse): QueryExchangeParamsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse", + value: QueryExchangeParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeParamsResponse.typeUrl, QueryExchangeParamsResponse); +function createBaseQuerySubaccountDepositsRequest(): QuerySubaccountDepositsRequest { + return { + subaccountId: "", + subaccount: undefined + }; +} +export const QuerySubaccountDepositsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest", + is(o: any): o is QuerySubaccountDepositsRequest { + return o && (o.$typeUrl === QuerySubaccountDepositsRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountDepositsRequestAmino { + return o && (o.$typeUrl === QuerySubaccountDepositsRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.subaccount !== undefined) { + Subaccount.encode(message.subaccount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.subaccount = Subaccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsRequest { + const message = createBaseQuerySubaccountDepositsRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.subaccount = object.subaccount !== undefined && object.subaccount !== null ? Subaccount.fromPartial(object.subaccount) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositsRequestAmino): QuerySubaccountDepositsRequest { + const message = createBaseQuerySubaccountDepositsRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.subaccount !== undefined && object.subaccount !== null) { + message.subaccount = Subaccount.fromAmino(object.subaccount); + } + return message; + }, + toAmino(message: QuerySubaccountDepositsRequest): QuerySubaccountDepositsRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.subaccount = message.subaccount ? Subaccount.toAmino(message.subaccount) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsRequestAminoMsg): QuerySubaccountDepositsRequest { + return QuerySubaccountDepositsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsRequestProtoMsg): QuerySubaccountDepositsRequest { + return QuerySubaccountDepositsRequest.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsRequest): Uint8Array { + return QuerySubaccountDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositsRequest): QuerySubaccountDepositsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest", + value: QuerySubaccountDepositsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositsRequest.typeUrl, QuerySubaccountDepositsRequest); +function createBaseQuerySubaccountDepositsResponse_DepositsEntry(): QuerySubaccountDepositsResponse_DepositsEntry { + return { + key: "", + value: undefined + }; +} +export const QuerySubaccountDepositsResponse_DepositsEntry = { + encode(message: QuerySubaccountDepositsResponse_DepositsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Deposit.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsResponse_DepositsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsResponse_DepositsEntry { + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? Deposit.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositsResponse_DepositsEntryAmino): QuerySubaccountDepositsResponse_DepositsEntry { + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = Deposit.fromAmino(object.value); + } + return message; + }, + toAmino(message: QuerySubaccountDepositsResponse_DepositsEntry): QuerySubaccountDepositsResponse_DepositsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? Deposit.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsResponse_DepositsEntryAminoMsg): QuerySubaccountDepositsResponse_DepositsEntry { + return QuerySubaccountDepositsResponse_DepositsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsResponse_DepositsEntryProtoMsg): QuerySubaccountDepositsResponse_DepositsEntry { + return QuerySubaccountDepositsResponse_DepositsEntry.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsResponse_DepositsEntry): Uint8Array { + return QuerySubaccountDepositsResponse_DepositsEntry.encode(message).finish(); + } +}; +function createBaseQuerySubaccountDepositsResponse(): QuerySubaccountDepositsResponse { + return { + deposits: {} + }; +} +export const QuerySubaccountDepositsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse", + is(o: any): o is QuerySubaccountDepositsResponse { + return o && (o.$typeUrl === QuerySubaccountDepositsResponse.typeUrl || isSet(o.deposits)); + }, + isAmino(o: any): o is QuerySubaccountDepositsResponseAmino { + return o && (o.$typeUrl === QuerySubaccountDepositsResponse.typeUrl || isSet(o.deposits)); + }, + encode(message: QuerySubaccountDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.deposits).forEach(([key, value]) => { + QuerySubaccountDepositsResponse_DepositsEntry.encode({ + key: (key as any), + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = QuerySubaccountDepositsResponse_DepositsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.deposits[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsResponse { + const message = createBaseQuerySubaccountDepositsResponse(); + message.deposits = Object.entries(object.deposits ?? {}).reduce<{ + [key: string]: Deposit; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Deposit.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: QuerySubaccountDepositsResponseAmino): QuerySubaccountDepositsResponse { + const message = createBaseQuerySubaccountDepositsResponse(); + message.deposits = Object.entries(object.deposits ?? {}).reduce<{ + [key: string]: Deposit; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Deposit.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: QuerySubaccountDepositsResponse): QuerySubaccountDepositsResponseAmino { + const obj: any = {}; + obj.deposits = {}; + if (message.deposits) { + Object.entries(message.deposits).forEach(([k, v]) => { + obj.deposits[k] = Deposit.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsResponseAminoMsg): QuerySubaccountDepositsResponse { + return QuerySubaccountDepositsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsResponseProtoMsg): QuerySubaccountDepositsResponse { + return QuerySubaccountDepositsResponse.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsResponse): Uint8Array { + return QuerySubaccountDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositsResponse): QuerySubaccountDepositsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse", + value: QuerySubaccountDepositsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositsResponse.typeUrl, QuerySubaccountDepositsResponse); +function createBaseQueryExchangeBalancesRequest(): QueryExchangeBalancesRequest { + return {}; +} +export const QueryExchangeBalancesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest", + is(o: any): o is QueryExchangeBalancesRequest { + return o && o.$typeUrl === QueryExchangeBalancesRequest.typeUrl; + }, + isAmino(o: any): o is QueryExchangeBalancesRequestAmino { + return o && o.$typeUrl === QueryExchangeBalancesRequest.typeUrl; + }, + encode(_: QueryExchangeBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeBalancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryExchangeBalancesRequest { + const message = createBaseQueryExchangeBalancesRequest(); + return message; + }, + fromAmino(_: QueryExchangeBalancesRequestAmino): QueryExchangeBalancesRequest { + const message = createBaseQueryExchangeBalancesRequest(); + return message; + }, + toAmino(_: QueryExchangeBalancesRequest): QueryExchangeBalancesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryExchangeBalancesRequestAminoMsg): QueryExchangeBalancesRequest { + return QueryExchangeBalancesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeBalancesRequestProtoMsg): QueryExchangeBalancesRequest { + return QueryExchangeBalancesRequest.decode(message.value); + }, + toProto(message: QueryExchangeBalancesRequest): Uint8Array { + return QueryExchangeBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeBalancesRequest): QueryExchangeBalancesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest", + value: QueryExchangeBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeBalancesRequest.typeUrl, QueryExchangeBalancesRequest); +function createBaseQueryExchangeBalancesResponse(): QueryExchangeBalancesResponse { + return { + balances: [] + }; +} +export const QueryExchangeBalancesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse", + is(o: any): o is QueryExchangeBalancesResponse { + return o && (o.$typeUrl === QueryExchangeBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Balance.is(o.balances[0]))); + }, + isAmino(o: any): o is QueryExchangeBalancesResponseAmino { + return o && (o.$typeUrl === QueryExchangeBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Balance.isAmino(o.balances[0]))); + }, + encode(message: QueryExchangeBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExchangeBalancesResponse { + const message = createBaseQueryExchangeBalancesResponse(); + message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryExchangeBalancesResponseAmino): QueryExchangeBalancesResponse { + const message = createBaseQueryExchangeBalancesResponse(); + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryExchangeBalancesResponse): QueryExchangeBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + return obj; + }, + fromAminoMsg(object: QueryExchangeBalancesResponseAminoMsg): QueryExchangeBalancesResponse { + return QueryExchangeBalancesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeBalancesResponseProtoMsg): QueryExchangeBalancesResponse { + return QueryExchangeBalancesResponse.decode(message.value); + }, + toProto(message: QueryExchangeBalancesResponse): Uint8Array { + return QueryExchangeBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeBalancesResponse): QueryExchangeBalancesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse", + value: QueryExchangeBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeBalancesResponse.typeUrl, QueryExchangeBalancesResponse); +function createBaseQueryAggregateVolumeRequest(): QueryAggregateVolumeRequest { + return { + account: "" + }; +} +export const QueryAggregateVolumeRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest", + is(o: any): o is QueryAggregateVolumeRequest { + return o && (o.$typeUrl === QueryAggregateVolumeRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryAggregateVolumeRequestAmino { + return o && (o.$typeUrl === QueryAggregateVolumeRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryAggregateVolumeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumeRequest { + const message = createBaseQueryAggregateVolumeRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryAggregateVolumeRequestAmino): QueryAggregateVolumeRequest { + const message = createBaseQueryAggregateVolumeRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryAggregateVolumeRequest): QueryAggregateVolumeRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumeRequestAminoMsg): QueryAggregateVolumeRequest { + return QueryAggregateVolumeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumeRequestProtoMsg): QueryAggregateVolumeRequest { + return QueryAggregateVolumeRequest.decode(message.value); + }, + toProto(message: QueryAggregateVolumeRequest): Uint8Array { + return QueryAggregateVolumeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumeRequest): QueryAggregateVolumeRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest", + value: QueryAggregateVolumeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumeRequest.typeUrl, QueryAggregateVolumeRequest); +function createBaseQueryAggregateVolumeResponse(): QueryAggregateVolumeResponse { + return { + aggregateVolumes: [] + }; +} +export const QueryAggregateVolumeResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse", + is(o: any): o is QueryAggregateVolumeResponse { + return o && (o.$typeUrl === QueryAggregateVolumeResponse.typeUrl || Array.isArray(o.aggregateVolumes) && (!o.aggregateVolumes.length || MarketVolume.is(o.aggregateVolumes[0]))); + }, + isAmino(o: any): o is QueryAggregateVolumeResponseAmino { + return o && (o.$typeUrl === QueryAggregateVolumeResponse.typeUrl || Array.isArray(o.aggregate_volumes) && (!o.aggregate_volumes.length || MarketVolume.isAmino(o.aggregate_volumes[0]))); + }, + encode(message: QueryAggregateVolumeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregateVolumes) { + MarketVolume.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumeResponse { + const message = createBaseQueryAggregateVolumeResponse(); + message.aggregateVolumes = object.aggregateVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumeResponseAmino): QueryAggregateVolumeResponse { + const message = createBaseQueryAggregateVolumeResponse(); + message.aggregateVolumes = object.aggregate_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateVolumeResponse): QueryAggregateVolumeResponseAmino { + const obj: any = {}; + if (message.aggregateVolumes) { + obj.aggregate_volumes = message.aggregateVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.aggregate_volumes = message.aggregateVolumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumeResponseAminoMsg): QueryAggregateVolumeResponse { + return QueryAggregateVolumeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumeResponseProtoMsg): QueryAggregateVolumeResponse { + return QueryAggregateVolumeResponse.decode(message.value); + }, + toProto(message: QueryAggregateVolumeResponse): Uint8Array { + return QueryAggregateVolumeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumeResponse): QueryAggregateVolumeResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse", + value: QueryAggregateVolumeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumeResponse.typeUrl, QueryAggregateVolumeResponse); +function createBaseQueryAggregateVolumesRequest(): QueryAggregateVolumesRequest { + return { + accounts: [], + marketIds: [] + }; +} +export const QueryAggregateVolumesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest", + is(o: any): o is QueryAggregateVolumesRequest { + return o && (o.$typeUrl === QueryAggregateVolumesRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QueryAggregateVolumesRequestAmino { + return o && (o.$typeUrl === QueryAggregateVolumesRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QueryAggregateVolumesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumesRequest { + const message = createBaseQueryAggregateVolumesRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumesRequestAmino): QueryAggregateVolumesRequest { + const message = createBaseQueryAggregateVolumesRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAggregateVolumesRequest): QueryAggregateVolumesRequestAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumesRequestAminoMsg): QueryAggregateVolumesRequest { + return QueryAggregateVolumesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumesRequestProtoMsg): QueryAggregateVolumesRequest { + return QueryAggregateVolumesRequest.decode(message.value); + }, + toProto(message: QueryAggregateVolumesRequest): Uint8Array { + return QueryAggregateVolumesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumesRequest): QueryAggregateVolumesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest", + value: QueryAggregateVolumesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumesRequest.typeUrl, QueryAggregateVolumesRequest); +function createBaseQueryAggregateVolumesResponse(): QueryAggregateVolumesResponse { + return { + aggregateAccountVolumes: [], + aggregateMarketVolumes: [] + }; +} +export const QueryAggregateVolumesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse", + is(o: any): o is QueryAggregateVolumesResponse { + return o && (o.$typeUrl === QueryAggregateVolumesResponse.typeUrl || Array.isArray(o.aggregateAccountVolumes) && (!o.aggregateAccountVolumes.length || AggregateAccountVolumeRecord.is(o.aggregateAccountVolumes[0])) && Array.isArray(o.aggregateMarketVolumes) && (!o.aggregateMarketVolumes.length || MarketVolume.is(o.aggregateMarketVolumes[0]))); + }, + isAmino(o: any): o is QueryAggregateVolumesResponseAmino { + return o && (o.$typeUrl === QueryAggregateVolumesResponse.typeUrl || Array.isArray(o.aggregate_account_volumes) && (!o.aggregate_account_volumes.length || AggregateAccountVolumeRecord.isAmino(o.aggregate_account_volumes[0])) && Array.isArray(o.aggregate_market_volumes) && (!o.aggregate_market_volumes.length || MarketVolume.isAmino(o.aggregate_market_volumes[0]))); + }, + encode(message: QueryAggregateVolumesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregateAccountVolumes) { + AggregateAccountVolumeRecord.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.aggregateMarketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateAccountVolumes.push(AggregateAccountVolumeRecord.decode(reader, reader.uint32())); + break; + case 2: + message.aggregateMarketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumesResponse { + const message = createBaseQueryAggregateVolumesResponse(); + message.aggregateAccountVolumes = object.aggregateAccountVolumes?.map(e => AggregateAccountVolumeRecord.fromPartial(e)) || []; + message.aggregateMarketVolumes = object.aggregateMarketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumesResponseAmino): QueryAggregateVolumesResponse { + const message = createBaseQueryAggregateVolumesResponse(); + message.aggregateAccountVolumes = object.aggregate_account_volumes?.map(e => AggregateAccountVolumeRecord.fromAmino(e)) || []; + message.aggregateMarketVolumes = object.aggregate_market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateVolumesResponse): QueryAggregateVolumesResponseAmino { + const obj: any = {}; + if (message.aggregateAccountVolumes) { + obj.aggregate_account_volumes = message.aggregateAccountVolumes.map(e => e ? AggregateAccountVolumeRecord.toAmino(e) : undefined); + } else { + obj.aggregate_account_volumes = message.aggregateAccountVolumes; + } + if (message.aggregateMarketVolumes) { + obj.aggregate_market_volumes = message.aggregateMarketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.aggregate_market_volumes = message.aggregateMarketVolumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumesResponseAminoMsg): QueryAggregateVolumesResponse { + return QueryAggregateVolumesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumesResponseProtoMsg): QueryAggregateVolumesResponse { + return QueryAggregateVolumesResponse.decode(message.value); + }, + toProto(message: QueryAggregateVolumesResponse): Uint8Array { + return QueryAggregateVolumesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumesResponse): QueryAggregateVolumesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse", + value: QueryAggregateVolumesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumesResponse.typeUrl, QueryAggregateVolumesResponse); +function createBaseQueryAggregateMarketVolumeRequest(): QueryAggregateMarketVolumeRequest { + return { + marketId: "" + }; +} +export const QueryAggregateMarketVolumeRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest", + is(o: any): o is QueryAggregateMarketVolumeRequest { + return o && (o.$typeUrl === QueryAggregateMarketVolumeRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryAggregateMarketVolumeRequestAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumeRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryAggregateMarketVolumeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumeRequest { + const message = createBaseQueryAggregateMarketVolumeRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumeRequestAmino): QueryAggregateMarketVolumeRequest { + const message = createBaseQueryAggregateMarketVolumeRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryAggregateMarketVolumeRequest): QueryAggregateMarketVolumeRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumeRequestAminoMsg): QueryAggregateMarketVolumeRequest { + return QueryAggregateMarketVolumeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumeRequestProtoMsg): QueryAggregateMarketVolumeRequest { + return QueryAggregateMarketVolumeRequest.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumeRequest): Uint8Array { + return QueryAggregateMarketVolumeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumeRequest): QueryAggregateMarketVolumeRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest", + value: QueryAggregateMarketVolumeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumeRequest.typeUrl, QueryAggregateMarketVolumeRequest); +function createBaseQueryAggregateMarketVolumeResponse(): QueryAggregateMarketVolumeResponse { + return { + volume: VolumeRecord.fromPartial({}) + }; +} +export const QueryAggregateMarketVolumeResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse", + is(o: any): o is QueryAggregateMarketVolumeResponse { + return o && (o.$typeUrl === QueryAggregateMarketVolumeResponse.typeUrl || VolumeRecord.is(o.volume)); + }, + isAmino(o: any): o is QueryAggregateMarketVolumeResponseAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumeResponse.typeUrl || VolumeRecord.isAmino(o.volume)); + }, + encode(message: QueryAggregateMarketVolumeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volume !== undefined) { + VolumeRecord.encode(message.volume, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volume = VolumeRecord.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumeResponse { + const message = createBaseQueryAggregateMarketVolumeResponse(); + message.volume = object.volume !== undefined && object.volume !== null ? VolumeRecord.fromPartial(object.volume) : undefined; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumeResponseAmino): QueryAggregateMarketVolumeResponse { + const message = createBaseQueryAggregateMarketVolumeResponse(); + if (object.volume !== undefined && object.volume !== null) { + message.volume = VolumeRecord.fromAmino(object.volume); + } + return message; + }, + toAmino(message: QueryAggregateMarketVolumeResponse): QueryAggregateMarketVolumeResponseAmino { + const obj: any = {}; + obj.volume = message.volume ? VolumeRecord.toAmino(message.volume) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumeResponseAminoMsg): QueryAggregateMarketVolumeResponse { + return QueryAggregateMarketVolumeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumeResponseProtoMsg): QueryAggregateMarketVolumeResponse { + return QueryAggregateMarketVolumeResponse.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumeResponse): Uint8Array { + return QueryAggregateMarketVolumeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumeResponse): QueryAggregateMarketVolumeResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse", + value: QueryAggregateMarketVolumeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumeResponse.typeUrl, QueryAggregateMarketVolumeResponse); +function createBaseQueryDenomDecimalRequest(): QueryDenomDecimalRequest { + return { + denom: "" + }; +} +export const QueryDenomDecimalRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest", + is(o: any): o is QueryDenomDecimalRequest { + return o && (o.$typeUrl === QueryDenomDecimalRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomDecimalRequestAmino { + return o && (o.$typeUrl === QueryDenomDecimalRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomDecimalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalRequest(); + 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: DeepPartial): QueryDenomDecimalRequest { + const message = createBaseQueryDenomDecimalRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomDecimalRequestAmino): QueryDenomDecimalRequest { + const message = createBaseQueryDenomDecimalRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomDecimalRequest): QueryDenomDecimalRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalRequestAminoMsg): QueryDenomDecimalRequest { + return QueryDenomDecimalRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalRequestProtoMsg): QueryDenomDecimalRequest { + return QueryDenomDecimalRequest.decode(message.value); + }, + toProto(message: QueryDenomDecimalRequest): Uint8Array { + return QueryDenomDecimalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalRequest): QueryDenomDecimalRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest", + value: QueryDenomDecimalRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalRequest.typeUrl, QueryDenomDecimalRequest); +function createBaseQueryDenomDecimalResponse(): QueryDenomDecimalResponse { + return { + decimal: BigInt(0) + }; +} +export const QueryDenomDecimalResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse", + is(o: any): o is QueryDenomDecimalResponse { + return o && (o.$typeUrl === QueryDenomDecimalResponse.typeUrl || typeof o.decimal === "bigint"); + }, + isAmino(o: any): o is QueryDenomDecimalResponseAmino { + return o && (o.$typeUrl === QueryDenomDecimalResponse.typeUrl || typeof o.decimal === "bigint"); + }, + encode(message: QueryDenomDecimalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.decimal !== BigInt(0)) { + writer.uint32(8).uint64(message.decimal); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.decimal = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomDecimalResponse { + const message = createBaseQueryDenomDecimalResponse(); + message.decimal = object.decimal !== undefined && object.decimal !== null ? BigInt(object.decimal.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryDenomDecimalResponseAmino): QueryDenomDecimalResponse { + const message = createBaseQueryDenomDecimalResponse(); + if (object.decimal !== undefined && object.decimal !== null) { + message.decimal = BigInt(object.decimal); + } + return message; + }, + toAmino(message: QueryDenomDecimalResponse): QueryDenomDecimalResponseAmino { + const obj: any = {}; + obj.decimal = message.decimal !== BigInt(0) ? message.decimal?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalResponseAminoMsg): QueryDenomDecimalResponse { + return QueryDenomDecimalResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalResponseProtoMsg): QueryDenomDecimalResponse { + return QueryDenomDecimalResponse.decode(message.value); + }, + toProto(message: QueryDenomDecimalResponse): Uint8Array { + return QueryDenomDecimalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalResponse): QueryDenomDecimalResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse", + value: QueryDenomDecimalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalResponse.typeUrl, QueryDenomDecimalResponse); +function createBaseQueryDenomDecimalsRequest(): QueryDenomDecimalsRequest { + return { + denoms: [] + }; +} +export const QueryDenomDecimalsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest", + is(o: any): o is QueryDenomDecimalsRequest { + return o && (o.$typeUrl === QueryDenomDecimalsRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QueryDenomDecimalsRequestAmino { + return o && (o.$typeUrl === QueryDenomDecimalsRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + encode(message: QueryDenomDecimalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalsRequest(); + 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: DeepPartial): QueryDenomDecimalsRequest { + const message = createBaseQueryDenomDecimalsRequest(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDenomDecimalsRequestAmino): QueryDenomDecimalsRequest { + const message = createBaseQueryDenomDecimalsRequest(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDenomDecimalsRequest): QueryDenomDecimalsRequestAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = message.denoms; + } + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalsRequestAminoMsg): QueryDenomDecimalsRequest { + return QueryDenomDecimalsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalsRequestProtoMsg): QueryDenomDecimalsRequest { + return QueryDenomDecimalsRequest.decode(message.value); + }, + toProto(message: QueryDenomDecimalsRequest): Uint8Array { + return QueryDenomDecimalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalsRequest): QueryDenomDecimalsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest", + value: QueryDenomDecimalsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalsRequest.typeUrl, QueryDenomDecimalsRequest); +function createBaseQueryDenomDecimalsResponse(): QueryDenomDecimalsResponse { + return { + denomDecimals: [] + }; +} +export const QueryDenomDecimalsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse", + is(o: any): o is QueryDenomDecimalsResponse { + return o && (o.$typeUrl === QueryDenomDecimalsResponse.typeUrl || Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0]))); + }, + isAmino(o: any): o is QueryDenomDecimalsResponseAmino { + return o && (o.$typeUrl === QueryDenomDecimalsResponse.typeUrl || Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0]))); + }, + encode(message: QueryDenomDecimalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomDecimalsResponse { + const message = createBaseQueryDenomDecimalsResponse(); + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDenomDecimalsResponseAmino): QueryDenomDecimalsResponse { + const message = createBaseQueryDenomDecimalsResponse(); + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDenomDecimalsResponse): QueryDenomDecimalsResponseAmino { + const obj: any = {}; + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalsResponseAminoMsg): QueryDenomDecimalsResponse { + return QueryDenomDecimalsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalsResponseProtoMsg): QueryDenomDecimalsResponse { + return QueryDenomDecimalsResponse.decode(message.value); + }, + toProto(message: QueryDenomDecimalsResponse): Uint8Array { + return QueryDenomDecimalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalsResponse): QueryDenomDecimalsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse", + value: QueryDenomDecimalsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalsResponse.typeUrl, QueryDenomDecimalsResponse); +function createBaseQueryAggregateMarketVolumesRequest(): QueryAggregateMarketVolumesRequest { + return { + marketIds: [] + }; +} +export const QueryAggregateMarketVolumesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest", + is(o: any): o is QueryAggregateMarketVolumesRequest { + return o && (o.$typeUrl === QueryAggregateMarketVolumesRequest.typeUrl || Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QueryAggregateMarketVolumesRequestAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumesRequest.typeUrl || Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QueryAggregateMarketVolumesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumesRequest { + const message = createBaseQueryAggregateMarketVolumesRequest(); + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumesRequestAmino): QueryAggregateMarketVolumesRequest { + const message = createBaseQueryAggregateMarketVolumesRequest(); + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAggregateMarketVolumesRequest): QueryAggregateMarketVolumesRequestAmino { + const obj: any = {}; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumesRequestAminoMsg): QueryAggregateMarketVolumesRequest { + return QueryAggregateMarketVolumesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumesRequestProtoMsg): QueryAggregateMarketVolumesRequest { + return QueryAggregateMarketVolumesRequest.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumesRequest): Uint8Array { + return QueryAggregateMarketVolumesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumesRequest): QueryAggregateMarketVolumesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest", + value: QueryAggregateMarketVolumesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumesRequest.typeUrl, QueryAggregateMarketVolumesRequest); +function createBaseQueryAggregateMarketVolumesResponse(): QueryAggregateMarketVolumesResponse { + return { + volumes: [] + }; +} +export const QueryAggregateMarketVolumesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse", + is(o: any): o is QueryAggregateMarketVolumesResponse { + return o && (o.$typeUrl === QueryAggregateMarketVolumesResponse.typeUrl || Array.isArray(o.volumes) && (!o.volumes.length || MarketVolume.is(o.volumes[0]))); + }, + isAmino(o: any): o is QueryAggregateMarketVolumesResponseAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumesResponse.typeUrl || Array.isArray(o.volumes) && (!o.volumes.length || MarketVolume.isAmino(o.volumes[0]))); + }, + encode(message: QueryAggregateMarketVolumesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.volumes) { + MarketVolume.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumesResponse { + const message = createBaseQueryAggregateMarketVolumesResponse(); + message.volumes = object.volumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumesResponseAmino): QueryAggregateMarketVolumesResponse { + const message = createBaseQueryAggregateMarketVolumesResponse(); + message.volumes = object.volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateMarketVolumesResponse): QueryAggregateMarketVolumesResponseAmino { + const obj: any = {}; + if (message.volumes) { + obj.volumes = message.volumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.volumes = message.volumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumesResponseAminoMsg): QueryAggregateMarketVolumesResponse { + return QueryAggregateMarketVolumesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumesResponseProtoMsg): QueryAggregateMarketVolumesResponse { + return QueryAggregateMarketVolumesResponse.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumesResponse): Uint8Array { + return QueryAggregateMarketVolumesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumesResponse): QueryAggregateMarketVolumesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse", + value: QueryAggregateMarketVolumesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumesResponse.typeUrl, QueryAggregateMarketVolumesResponse); +function createBaseQuerySubaccountDepositRequest(): QuerySubaccountDepositRequest { + return { + subaccountId: "", + denom: "" + }; +} +export const QuerySubaccountDepositRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest", + is(o: any): o is QuerySubaccountDepositRequest { + return o && (o.$typeUrl === QuerySubaccountDepositRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySubaccountDepositRequestAmino { + return o && (o.$typeUrl === QuerySubaccountDepositRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.denom === "string"); + }, + encode(message: QuerySubaccountDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositRequest { + const message = createBaseQuerySubaccountDepositRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountDepositRequestAmino): QuerySubaccountDepositRequest { + const message = createBaseQuerySubaccountDepositRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySubaccountDepositRequest): QuerySubaccountDepositRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositRequestAminoMsg): QuerySubaccountDepositRequest { + return QuerySubaccountDepositRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositRequestProtoMsg): QuerySubaccountDepositRequest { + return QuerySubaccountDepositRequest.decode(message.value); + }, + toProto(message: QuerySubaccountDepositRequest): Uint8Array { + return QuerySubaccountDepositRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositRequest): QuerySubaccountDepositRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest", + value: QuerySubaccountDepositRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositRequest.typeUrl, QuerySubaccountDepositRequest); +function createBaseQuerySubaccountDepositResponse(): QuerySubaccountDepositResponse { + return { + deposits: undefined + }; +} +export const QuerySubaccountDepositResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse", + is(o: any): o is QuerySubaccountDepositResponse { + return o && o.$typeUrl === QuerySubaccountDepositResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountDepositResponseAmino { + return o && o.$typeUrl === QuerySubaccountDepositResponse.typeUrl; + }, + encode(message: QuerySubaccountDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deposits !== undefined) { + Deposit.encode(message.deposits, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositResponse { + const message = createBaseQuerySubaccountDepositResponse(); + message.deposits = object.deposits !== undefined && object.deposits !== null ? Deposit.fromPartial(object.deposits) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositResponseAmino): QuerySubaccountDepositResponse { + const message = createBaseQuerySubaccountDepositResponse(); + if (object.deposits !== undefined && object.deposits !== null) { + message.deposits = Deposit.fromAmino(object.deposits); + } + return message; + }, + toAmino(message: QuerySubaccountDepositResponse): QuerySubaccountDepositResponseAmino { + const obj: any = {}; + obj.deposits = message.deposits ? Deposit.toAmino(message.deposits) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositResponseAminoMsg): QuerySubaccountDepositResponse { + return QuerySubaccountDepositResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositResponseProtoMsg): QuerySubaccountDepositResponse { + return QuerySubaccountDepositResponse.decode(message.value); + }, + toProto(message: QuerySubaccountDepositResponse): Uint8Array { + return QuerySubaccountDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositResponse): QuerySubaccountDepositResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse", + value: QuerySubaccountDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositResponse.typeUrl, QuerySubaccountDepositResponse); +function createBaseQuerySpotMarketsRequest(): QuerySpotMarketsRequest { + return { + status: "", + marketIds: [] + }; +} +export const QuerySpotMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest", + is(o: any): o is QuerySpotMarketsRequest { + return o && (o.$typeUrl === QuerySpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QuerySpotMarketsRequestAmino { + return o && (o.$typeUrl === QuerySpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QuerySpotMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketsRequest { + const message = createBaseQuerySpotMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QuerySpotMarketsRequestAmino): QuerySpotMarketsRequest { + const message = createBaseQuerySpotMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QuerySpotMarketsRequest): QuerySpotMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QuerySpotMarketsRequestAminoMsg): QuerySpotMarketsRequest { + return QuerySpotMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketsRequestProtoMsg): QuerySpotMarketsRequest { + return QuerySpotMarketsRequest.decode(message.value); + }, + toProto(message: QuerySpotMarketsRequest): Uint8Array { + return QuerySpotMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketsRequest): QuerySpotMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest", + value: QuerySpotMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketsRequest.typeUrl, QuerySpotMarketsRequest); +function createBaseQuerySpotMarketsResponse(): QuerySpotMarketsResponse { + return { + markets: [] + }; +} +export const QuerySpotMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse", + is(o: any): o is QuerySpotMarketsResponse { + return o && (o.$typeUrl === QuerySpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || SpotMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QuerySpotMarketsResponseAmino { + return o && (o.$typeUrl === QuerySpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || SpotMarket.isAmino(o.markets[0]))); + }, + encode(message: QuerySpotMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + SpotMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(SpotMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketsResponse { + const message = createBaseQuerySpotMarketsResponse(); + message.markets = object.markets?.map(e => SpotMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotMarketsResponseAmino): QuerySpotMarketsResponse { + const message = createBaseQuerySpotMarketsResponse(); + message.markets = object.markets?.map(e => SpotMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotMarketsResponse): QuerySpotMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? SpotMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QuerySpotMarketsResponseAminoMsg): QuerySpotMarketsResponse { + return QuerySpotMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketsResponseProtoMsg): QuerySpotMarketsResponse { + return QuerySpotMarketsResponse.decode(message.value); + }, + toProto(message: QuerySpotMarketsResponse): Uint8Array { + return QuerySpotMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketsResponse): QuerySpotMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse", + value: QuerySpotMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketsResponse.typeUrl, QuerySpotMarketsResponse); +function createBaseQuerySpotMarketRequest(): QuerySpotMarketRequest { + return { + marketId: "" + }; +} +export const QuerySpotMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest", + is(o: any): o is QuerySpotMarketRequest { + return o && (o.$typeUrl === QuerySpotMarketRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySpotMarketRequestAmino { + return o && (o.$typeUrl === QuerySpotMarketRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QuerySpotMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketRequest { + const message = createBaseQuerySpotMarketRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySpotMarketRequestAmino): QuerySpotMarketRequest { + const message = createBaseQuerySpotMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySpotMarketRequest): QuerySpotMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySpotMarketRequestAminoMsg): QuerySpotMarketRequest { + return QuerySpotMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketRequestProtoMsg): QuerySpotMarketRequest { + return QuerySpotMarketRequest.decode(message.value); + }, + toProto(message: QuerySpotMarketRequest): Uint8Array { + return QuerySpotMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketRequest): QuerySpotMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest", + value: QuerySpotMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketRequest.typeUrl, QuerySpotMarketRequest); +function createBaseQuerySpotMarketResponse(): QuerySpotMarketResponse { + return { + market: undefined + }; +} +export const QuerySpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse", + is(o: any): o is QuerySpotMarketResponse { + return o && o.$typeUrl === QuerySpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpotMarketResponseAmino { + return o && o.$typeUrl === QuerySpotMarketResponse.typeUrl; + }, + encode(message: QuerySpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketResponse { + const message = createBaseQuerySpotMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QuerySpotMarketResponseAmino): QuerySpotMarketResponse { + const message = createBaseQuerySpotMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QuerySpotMarketResponse): QuerySpotMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpotMarketResponseAminoMsg): QuerySpotMarketResponse { + return QuerySpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketResponseProtoMsg): QuerySpotMarketResponse { + return QuerySpotMarketResponse.decode(message.value); + }, + toProto(message: QuerySpotMarketResponse): Uint8Array { + return QuerySpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketResponse): QuerySpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse", + value: QuerySpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketResponse.typeUrl, QuerySpotMarketResponse); +function createBaseQuerySpotOrderbookRequest(): QuerySpotOrderbookRequest { + return { + marketId: "", + limit: BigInt(0), + orderSide: 0, + limitCumulativeNotional: undefined, + limitCumulativeQuantity: undefined + }; +} +export const QuerySpotOrderbookRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest", + is(o: any): o is QuerySpotOrderbookRequest { + return o && (o.$typeUrl === QuerySpotOrderbookRequest.typeUrl || typeof o.marketId === "string" && typeof o.limit === "bigint" && isSet(o.orderSide)); + }, + isAmino(o: any): o is QuerySpotOrderbookRequestAmino { + return o && (o.$typeUrl === QuerySpotOrderbookRequest.typeUrl || typeof o.market_id === "string" && typeof o.limit === "bigint" && isSet(o.order_side)); + }, + encode(message: QuerySpotOrderbookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(16).uint64(message.limit); + } + if (message.orderSide !== 0) { + writer.uint32(24).int32(message.orderSide); + } + if (message.limitCumulativeNotional !== undefined) { + writer.uint32(34).string(message.limitCumulativeNotional); + } + if (message.limitCumulativeQuantity !== undefined) { + writer.uint32(42).string(message.limitCumulativeQuantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrderbookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrderbookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limit = reader.uint64(); + break; + case 3: + message.orderSide = (reader.int32() as any); + break; + case 4: + message.limitCumulativeNotional = reader.string(); + break; + case 5: + message.limitCumulativeQuantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrderbookRequest { + const message = createBaseQuerySpotOrderbookRequest(); + message.marketId = object.marketId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.orderSide = object.orderSide ?? 0; + message.limitCumulativeNotional = object.limitCumulativeNotional ?? undefined; + message.limitCumulativeQuantity = object.limitCumulativeQuantity ?? undefined; + return message; + }, + fromAmino(object: QuerySpotOrderbookRequestAmino): QuerySpotOrderbookRequest { + const message = createBaseQuerySpotOrderbookRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.order_side !== undefined && object.order_side !== null) { + message.orderSide = object.order_side; + } + if (object.limit_cumulative_notional !== undefined && object.limit_cumulative_notional !== null) { + message.limitCumulativeNotional = object.limit_cumulative_notional; + } + if (object.limit_cumulative_quantity !== undefined && object.limit_cumulative_quantity !== null) { + message.limitCumulativeQuantity = object.limit_cumulative_quantity; + } + return message; + }, + toAmino(message: QuerySpotOrderbookRequest): QuerySpotOrderbookRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.order_side = message.orderSide === 0 ? undefined : message.orderSide; + obj.limit_cumulative_notional = message.limitCumulativeNotional === null ? undefined : message.limitCumulativeNotional; + obj.limit_cumulative_quantity = message.limitCumulativeQuantity === null ? undefined : message.limitCumulativeQuantity; + return obj; + }, + fromAminoMsg(object: QuerySpotOrderbookRequestAminoMsg): QuerySpotOrderbookRequest { + return QuerySpotOrderbookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrderbookRequestProtoMsg): QuerySpotOrderbookRequest { + return QuerySpotOrderbookRequest.decode(message.value); + }, + toProto(message: QuerySpotOrderbookRequest): Uint8Array { + return QuerySpotOrderbookRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrderbookRequest): QuerySpotOrderbookRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest", + value: QuerySpotOrderbookRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrderbookRequest.typeUrl, QuerySpotOrderbookRequest); +function createBaseQuerySpotOrderbookResponse(): QuerySpotOrderbookResponse { + return { + buysPriceLevel: [], + sellsPriceLevel: [] + }; +} +export const QuerySpotOrderbookResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse", + is(o: any): o is QuerySpotOrderbookResponse { + return o && (o.$typeUrl === QuerySpotOrderbookResponse.typeUrl || Array.isArray(o.buysPriceLevel) && (!o.buysPriceLevel.length || Level.is(o.buysPriceLevel[0])) && Array.isArray(o.sellsPriceLevel) && (!o.sellsPriceLevel.length || Level.is(o.sellsPriceLevel[0]))); + }, + isAmino(o: any): o is QuerySpotOrderbookResponseAmino { + return o && (o.$typeUrl === QuerySpotOrderbookResponse.typeUrl || Array.isArray(o.buys_price_level) && (!o.buys_price_level.length || Level.isAmino(o.buys_price_level[0])) && Array.isArray(o.sells_price_level) && (!o.sells_price_level.length || Level.isAmino(o.sells_price_level[0]))); + }, + encode(message: QuerySpotOrderbookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buysPriceLevel) { + Level.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellsPriceLevel) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrderbookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrderbookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buysPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + case 2: + message.sellsPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrderbookResponse { + const message = createBaseQuerySpotOrderbookResponse(); + message.buysPriceLevel = object.buysPriceLevel?.map(e => Level.fromPartial(e)) || []; + message.sellsPriceLevel = object.sellsPriceLevel?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotOrderbookResponseAmino): QuerySpotOrderbookResponse { + const message = createBaseQuerySpotOrderbookResponse(); + message.buysPriceLevel = object.buys_price_level?.map(e => Level.fromAmino(e)) || []; + message.sellsPriceLevel = object.sells_price_level?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotOrderbookResponse): QuerySpotOrderbookResponseAmino { + const obj: any = {}; + if (message.buysPriceLevel) { + obj.buys_price_level = message.buysPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buys_price_level = message.buysPriceLevel; + } + if (message.sellsPriceLevel) { + obj.sells_price_level = message.sellsPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sells_price_level = message.sellsPriceLevel; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrderbookResponseAminoMsg): QuerySpotOrderbookResponse { + return QuerySpotOrderbookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrderbookResponseProtoMsg): QuerySpotOrderbookResponse { + return QuerySpotOrderbookResponse.decode(message.value); + }, + toProto(message: QuerySpotOrderbookResponse): Uint8Array { + return QuerySpotOrderbookResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrderbookResponse): QuerySpotOrderbookResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse", + value: QuerySpotOrderbookResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrderbookResponse.typeUrl, QuerySpotOrderbookResponse); +function createBaseFullSpotMarket(): FullSpotMarket { + return { + market: undefined, + midPriceAndTob: undefined + }; +} +export const FullSpotMarket = { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket", + is(o: any): o is FullSpotMarket { + return o && o.$typeUrl === FullSpotMarket.typeUrl; + }, + isAmino(o: any): o is FullSpotMarketAmino { + return o && o.$typeUrl === FullSpotMarket.typeUrl; + }, + encode(message: FullSpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.midPriceAndTob !== undefined) { + MidPriceAndTOB.encode(message.midPriceAndTob, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullSpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + case 2: + message.midPriceAndTob = MidPriceAndTOB.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullSpotMarket { + const message = createBaseFullSpotMarket(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + message.midPriceAndTob = object.midPriceAndTob !== undefined && object.midPriceAndTob !== null ? MidPriceAndTOB.fromPartial(object.midPriceAndTob) : undefined; + return message; + }, + fromAmino(object: FullSpotMarketAmino): FullSpotMarket { + const message = createBaseFullSpotMarket(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + if (object.mid_price_and_tob !== undefined && object.mid_price_and_tob !== null) { + message.midPriceAndTob = MidPriceAndTOB.fromAmino(object.mid_price_and_tob); + } + return message; + }, + toAmino(message: FullSpotMarket): FullSpotMarketAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + obj.mid_price_and_tob = message.midPriceAndTob ? MidPriceAndTOB.toAmino(message.midPriceAndTob) : undefined; + return obj; + }, + fromAminoMsg(object: FullSpotMarketAminoMsg): FullSpotMarket { + return FullSpotMarket.fromAmino(object.value); + }, + fromProtoMsg(message: FullSpotMarketProtoMsg): FullSpotMarket { + return FullSpotMarket.decode(message.value); + }, + toProto(message: FullSpotMarket): Uint8Array { + return FullSpotMarket.encode(message).finish(); + }, + toProtoMsg(message: FullSpotMarket): FullSpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket", + value: FullSpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullSpotMarket.typeUrl, FullSpotMarket); +function createBaseQueryFullSpotMarketsRequest(): QueryFullSpotMarketsRequest { + return { + status: "", + marketIds: [], + withMidPriceAndTob: false + }; +} +export const QueryFullSpotMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest", + is(o: any): o is QueryFullSpotMarketsRequest { + return o && (o.$typeUrl === QueryFullSpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string") && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryFullSpotMarketsRequestAmino { + return o && (o.$typeUrl === QueryFullSpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string") && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryFullSpotMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(24).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + case 3: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketsRequest { + const message = createBaseQueryFullSpotMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryFullSpotMarketsRequestAmino): QueryFullSpotMarketsRequest { + const message = createBaseQueryFullSpotMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryFullSpotMarketsRequest): QueryFullSpotMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketsRequestAminoMsg): QueryFullSpotMarketsRequest { + return QueryFullSpotMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketsRequestProtoMsg): QueryFullSpotMarketsRequest { + return QueryFullSpotMarketsRequest.decode(message.value); + }, + toProto(message: QueryFullSpotMarketsRequest): Uint8Array { + return QueryFullSpotMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketsRequest): QueryFullSpotMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest", + value: QueryFullSpotMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketsRequest.typeUrl, QueryFullSpotMarketsRequest); +function createBaseQueryFullSpotMarketsResponse(): QueryFullSpotMarketsResponse { + return { + markets: [] + }; +} +export const QueryFullSpotMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse", + is(o: any): o is QueryFullSpotMarketsResponse { + return o && (o.$typeUrl === QueryFullSpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullSpotMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryFullSpotMarketsResponseAmino { + return o && (o.$typeUrl === QueryFullSpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullSpotMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryFullSpotMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + FullSpotMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(FullSpotMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketsResponse { + const message = createBaseQueryFullSpotMarketsResponse(); + message.markets = object.markets?.map(e => FullSpotMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFullSpotMarketsResponseAmino): QueryFullSpotMarketsResponse { + const message = createBaseQueryFullSpotMarketsResponse(); + message.markets = object.markets?.map(e => FullSpotMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFullSpotMarketsResponse): QueryFullSpotMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? FullSpotMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketsResponseAminoMsg): QueryFullSpotMarketsResponse { + return QueryFullSpotMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketsResponseProtoMsg): QueryFullSpotMarketsResponse { + return QueryFullSpotMarketsResponse.decode(message.value); + }, + toProto(message: QueryFullSpotMarketsResponse): Uint8Array { + return QueryFullSpotMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketsResponse): QueryFullSpotMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse", + value: QueryFullSpotMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketsResponse.typeUrl, QueryFullSpotMarketsResponse); +function createBaseQueryFullSpotMarketRequest(): QueryFullSpotMarketRequest { + return { + marketId: "", + withMidPriceAndTob: false + }; +} +export const QueryFullSpotMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest", + is(o: any): o is QueryFullSpotMarketRequest { + return o && (o.$typeUrl === QueryFullSpotMarketRequest.typeUrl || typeof o.marketId === "string" && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryFullSpotMarketRequestAmino { + return o && (o.$typeUrl === QueryFullSpotMarketRequest.typeUrl || typeof o.market_id === "string" && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryFullSpotMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(16).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketRequest { + const message = createBaseQueryFullSpotMarketRequest(); + message.marketId = object.marketId ?? ""; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryFullSpotMarketRequestAmino): QueryFullSpotMarketRequest { + const message = createBaseQueryFullSpotMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryFullSpotMarketRequest): QueryFullSpotMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketRequestAminoMsg): QueryFullSpotMarketRequest { + return QueryFullSpotMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketRequestProtoMsg): QueryFullSpotMarketRequest { + return QueryFullSpotMarketRequest.decode(message.value); + }, + toProto(message: QueryFullSpotMarketRequest): Uint8Array { + return QueryFullSpotMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketRequest): QueryFullSpotMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest", + value: QueryFullSpotMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketRequest.typeUrl, QueryFullSpotMarketRequest); +function createBaseQueryFullSpotMarketResponse(): QueryFullSpotMarketResponse { + return { + market: undefined + }; +} +export const QueryFullSpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse", + is(o: any): o is QueryFullSpotMarketResponse { + return o && o.$typeUrl === QueryFullSpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is QueryFullSpotMarketResponseAmino { + return o && o.$typeUrl === QueryFullSpotMarketResponse.typeUrl; + }, + encode(message: QueryFullSpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + FullSpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = FullSpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketResponse { + const message = createBaseQueryFullSpotMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? FullSpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QueryFullSpotMarketResponseAmino): QueryFullSpotMarketResponse { + const message = createBaseQueryFullSpotMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = FullSpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QueryFullSpotMarketResponse): QueryFullSpotMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? FullSpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketResponseAminoMsg): QueryFullSpotMarketResponse { + return QueryFullSpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketResponseProtoMsg): QueryFullSpotMarketResponse { + return QueryFullSpotMarketResponse.decode(message.value); + }, + toProto(message: QueryFullSpotMarketResponse): Uint8Array { + return QueryFullSpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketResponse): QueryFullSpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse", + value: QueryFullSpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketResponse.typeUrl, QueryFullSpotMarketResponse); +function createBaseQuerySpotOrdersByHashesRequest(): QuerySpotOrdersByHashesRequest { + return { + marketId: "", + subaccountId: "", + orderHashes: [] + }; +} +export const QuerySpotOrdersByHashesRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest", + is(o: any): o is QuerySpotOrdersByHashesRequest { + return o && (o.$typeUrl === QuerySpotOrdersByHashesRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string")); + }, + isAmino(o: any): o is QuerySpotOrdersByHashesRequestAmino { + return o && (o.$typeUrl === QuerySpotOrdersByHashesRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string")); + }, + encode(message: QuerySpotOrdersByHashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.orderHashes) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrdersByHashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrdersByHashesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHashes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrdersByHashesRequest { + const message = createBaseQuerySpotOrdersByHashesRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHashes = object.orderHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: QuerySpotOrdersByHashesRequestAmino): QuerySpotOrdersByHashesRequest { + const message = createBaseQuerySpotOrdersByHashesRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.orderHashes = object.order_hashes?.map(e => e) || []; + return message; + }, + toAmino(message: QuerySpotOrdersByHashesRequest): QuerySpotOrdersByHashesRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrdersByHashesRequestAminoMsg): QuerySpotOrdersByHashesRequest { + return QuerySpotOrdersByHashesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrdersByHashesRequestProtoMsg): QuerySpotOrdersByHashesRequest { + return QuerySpotOrdersByHashesRequest.decode(message.value); + }, + toProto(message: QuerySpotOrdersByHashesRequest): Uint8Array { + return QuerySpotOrdersByHashesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrdersByHashesRequest): QuerySpotOrdersByHashesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest", + value: QuerySpotOrdersByHashesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrdersByHashesRequest.typeUrl, QuerySpotOrdersByHashesRequest); +function createBaseQuerySpotOrdersByHashesResponse(): QuerySpotOrdersByHashesResponse { + return { + orders: [] + }; +} +export const QuerySpotOrdersByHashesResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse", + is(o: any): o is QuerySpotOrdersByHashesResponse { + return o && (o.$typeUrl === QuerySpotOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QuerySpotOrdersByHashesResponseAmino { + return o && (o.$typeUrl === QuerySpotOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QuerySpotOrdersByHashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrdersByHashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrdersByHashesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrdersByHashesResponse { + const message = createBaseQuerySpotOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotOrdersByHashesResponseAmino): QuerySpotOrdersByHashesResponse { + const message = createBaseQuerySpotOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotOrdersByHashesResponse): QuerySpotOrdersByHashesResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrdersByHashesResponseAminoMsg): QuerySpotOrdersByHashesResponse { + return QuerySpotOrdersByHashesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrdersByHashesResponseProtoMsg): QuerySpotOrdersByHashesResponse { + return QuerySpotOrdersByHashesResponse.decode(message.value); + }, + toProto(message: QuerySpotOrdersByHashesResponse): Uint8Array { + return QuerySpotOrdersByHashesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrdersByHashesResponse): QuerySpotOrdersByHashesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse", + value: QuerySpotOrdersByHashesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrdersByHashesResponse.typeUrl, QuerySpotOrdersByHashesResponse); +function createBaseQueryTraderSpotOrdersRequest(): QueryTraderSpotOrdersRequest { + return { + marketId: "", + subaccountId: "" + }; +} +export const QueryTraderSpotOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest", + is(o: any): o is QueryTraderSpotOrdersRequest { + return o && (o.$typeUrl === QueryTraderSpotOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryTraderSpotOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryTraderSpotOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersRequest { + const message = createBaseQueryTraderSpotOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersRequestAmino): QueryTraderSpotOrdersRequest { + const message = createBaseQueryTraderSpotOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryTraderSpotOrdersRequest): QueryTraderSpotOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersRequestAminoMsg): QueryTraderSpotOrdersRequest { + return QueryTraderSpotOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersRequestProtoMsg): QueryTraderSpotOrdersRequest { + return QueryTraderSpotOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersRequest): Uint8Array { + return QueryTraderSpotOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersRequest): QueryTraderSpotOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest", + value: QueryTraderSpotOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersRequest.typeUrl, QueryTraderSpotOrdersRequest); +function createBaseQueryAccountAddressSpotOrdersRequest(): QueryAccountAddressSpotOrdersRequest { + return { + marketId: "", + accountAddress: "" + }; +} +export const QueryAccountAddressSpotOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest", + is(o: any): o is QueryAccountAddressSpotOrdersRequest { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressSpotOrdersRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.account_address === "string"); + }, + encode(message: QueryAccountAddressSpotOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.accountAddress !== "") { + writer.uint32(18).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressSpotOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressSpotOrdersRequest { + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressSpotOrdersRequestAmino): QueryAccountAddressSpotOrdersRequest { + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressSpotOrdersRequest): QueryAccountAddressSpotOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressSpotOrdersRequestAminoMsg): QueryAccountAddressSpotOrdersRequest { + return QueryAccountAddressSpotOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressSpotOrdersRequestProtoMsg): QueryAccountAddressSpotOrdersRequest { + return QueryAccountAddressSpotOrdersRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressSpotOrdersRequest): Uint8Array { + return QueryAccountAddressSpotOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressSpotOrdersRequest): QueryAccountAddressSpotOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest", + value: QueryAccountAddressSpotOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressSpotOrdersRequest.typeUrl, QueryAccountAddressSpotOrdersRequest); +function createBaseTrimmedSpotLimitOrder(): TrimmedSpotLimitOrder { + return { + price: "", + quantity: "", + fillable: "", + isBuy: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedSpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder", + is(o: any): o is TrimmedSpotLimitOrder { + return o && (o.$typeUrl === TrimmedSpotLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedSpotLimitOrderAmino { + return o && (o.$typeUrl === TrimmedSpotLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedSpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.fillable !== "") { + writer.uint32(26).string(message.fillable); + } + if (message.isBuy === true) { + writer.uint32(32).bool(message.isBuy); + } + if (message.orderHash !== "") { + writer.uint32(42).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedSpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.fillable = reader.string(); + break; + case 4: + message.isBuy = reader.bool(); + break; + case 5: + message.orderHash = reader.string(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedSpotLimitOrder { + const message = createBaseTrimmedSpotLimitOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.fillable = object.fillable ?? ""; + message.isBuy = object.isBuy ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedSpotLimitOrderAmino): TrimmedSpotLimitOrder { + const message = createBaseTrimmedSpotLimitOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedSpotLimitOrder): TrimmedSpotLimitOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedSpotLimitOrderAminoMsg): TrimmedSpotLimitOrder { + return TrimmedSpotLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedSpotLimitOrderProtoMsg): TrimmedSpotLimitOrder { + return TrimmedSpotLimitOrder.decode(message.value); + }, + toProto(message: TrimmedSpotLimitOrder): Uint8Array { + return TrimmedSpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedSpotLimitOrder): TrimmedSpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder", + value: TrimmedSpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedSpotLimitOrder.typeUrl, TrimmedSpotLimitOrder); +function createBaseQueryTraderSpotOrdersResponse(): QueryTraderSpotOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse", + is(o: any): o is QueryTraderSpotOrdersResponse { + return o && (o.$typeUrl === QueryTraderSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderSpotOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersResponse { + const message = createBaseQueryTraderSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersResponseAmino): QueryTraderSpotOrdersResponse { + const message = createBaseQueryTraderSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderSpotOrdersResponse): QueryTraderSpotOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersResponseAminoMsg): QueryTraderSpotOrdersResponse { + return QueryTraderSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersResponseProtoMsg): QueryTraderSpotOrdersResponse { + return QueryTraderSpotOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersResponse): Uint8Array { + return QueryTraderSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersResponse): QueryTraderSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse", + value: QueryTraderSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersResponse.typeUrl, QueryTraderSpotOrdersResponse); +function createBaseQueryAccountAddressSpotOrdersResponse(): QueryAccountAddressSpotOrdersResponse { + return { + orders: [] + }; +} +export const QueryAccountAddressSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse", + is(o: any): o is QueryAccountAddressSpotOrdersResponse { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryAccountAddressSpotOrdersResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryAccountAddressSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressSpotOrdersResponse { + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAccountAddressSpotOrdersResponseAmino): QueryAccountAddressSpotOrdersResponse { + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAccountAddressSpotOrdersResponse): QueryAccountAddressSpotOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryAccountAddressSpotOrdersResponseAminoMsg): QueryAccountAddressSpotOrdersResponse { + return QueryAccountAddressSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressSpotOrdersResponseProtoMsg): QueryAccountAddressSpotOrdersResponse { + return QueryAccountAddressSpotOrdersResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressSpotOrdersResponse): Uint8Array { + return QueryAccountAddressSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressSpotOrdersResponse): QueryAccountAddressSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse", + value: QueryAccountAddressSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressSpotOrdersResponse.typeUrl, QueryAccountAddressSpotOrdersResponse); +function createBaseQuerySpotMidPriceAndTOBRequest(): QuerySpotMidPriceAndTOBRequest { + return { + marketId: "" + }; +} +export const QuerySpotMidPriceAndTOBRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest", + is(o: any): o is QuerySpotMidPriceAndTOBRequest { + return o && (o.$typeUrl === QuerySpotMidPriceAndTOBRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySpotMidPriceAndTOBRequestAmino { + return o && (o.$typeUrl === QuerySpotMidPriceAndTOBRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QuerySpotMidPriceAndTOBRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMidPriceAndTOBRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMidPriceAndTOBRequest { + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySpotMidPriceAndTOBRequestAmino): QuerySpotMidPriceAndTOBRequest { + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySpotMidPriceAndTOBRequest): QuerySpotMidPriceAndTOBRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySpotMidPriceAndTOBRequestAminoMsg): QuerySpotMidPriceAndTOBRequest { + return QuerySpotMidPriceAndTOBRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMidPriceAndTOBRequestProtoMsg): QuerySpotMidPriceAndTOBRequest { + return QuerySpotMidPriceAndTOBRequest.decode(message.value); + }, + toProto(message: QuerySpotMidPriceAndTOBRequest): Uint8Array { + return QuerySpotMidPriceAndTOBRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMidPriceAndTOBRequest): QuerySpotMidPriceAndTOBRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest", + value: QuerySpotMidPriceAndTOBRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMidPriceAndTOBRequest.typeUrl, QuerySpotMidPriceAndTOBRequest); +function createBaseQuerySpotMidPriceAndTOBResponse(): QuerySpotMidPriceAndTOBResponse { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const QuerySpotMidPriceAndTOBResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse", + is(o: any): o is QuerySpotMidPriceAndTOBResponse { + return o && o.$typeUrl === QuerySpotMidPriceAndTOBResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpotMidPriceAndTOBResponseAmino { + return o && o.$typeUrl === QuerySpotMidPriceAndTOBResponse.typeUrl; + }, + encode(message: QuerySpotMidPriceAndTOBResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMidPriceAndTOBResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMidPriceAndTOBResponse { + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: QuerySpotMidPriceAndTOBResponseAmino): QuerySpotMidPriceAndTOBResponse { + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: QuerySpotMidPriceAndTOBResponse): QuerySpotMidPriceAndTOBResponseAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: QuerySpotMidPriceAndTOBResponseAminoMsg): QuerySpotMidPriceAndTOBResponse { + return QuerySpotMidPriceAndTOBResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMidPriceAndTOBResponseProtoMsg): QuerySpotMidPriceAndTOBResponse { + return QuerySpotMidPriceAndTOBResponse.decode(message.value); + }, + toProto(message: QuerySpotMidPriceAndTOBResponse): Uint8Array { + return QuerySpotMidPriceAndTOBResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMidPriceAndTOBResponse): QuerySpotMidPriceAndTOBResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse", + value: QuerySpotMidPriceAndTOBResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMidPriceAndTOBResponse.typeUrl, QuerySpotMidPriceAndTOBResponse); +function createBaseQueryDerivativeMidPriceAndTOBRequest(): QueryDerivativeMidPriceAndTOBRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMidPriceAndTOBRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest", + is(o: any): o is QueryDerivativeMidPriceAndTOBRequest { + return o && (o.$typeUrl === QueryDerivativeMidPriceAndTOBRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMidPriceAndTOBRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMidPriceAndTOBRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMidPriceAndTOBRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMidPriceAndTOBRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMidPriceAndTOBRequest { + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMidPriceAndTOBRequestAmino): QueryDerivativeMidPriceAndTOBRequest { + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMidPriceAndTOBRequest): QueryDerivativeMidPriceAndTOBRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMidPriceAndTOBRequestAminoMsg): QueryDerivativeMidPriceAndTOBRequest { + return QueryDerivativeMidPriceAndTOBRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMidPriceAndTOBRequestProtoMsg): QueryDerivativeMidPriceAndTOBRequest { + return QueryDerivativeMidPriceAndTOBRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMidPriceAndTOBRequest): Uint8Array { + return QueryDerivativeMidPriceAndTOBRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMidPriceAndTOBRequest): QueryDerivativeMidPriceAndTOBRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest", + value: QueryDerivativeMidPriceAndTOBRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMidPriceAndTOBRequest.typeUrl, QueryDerivativeMidPriceAndTOBRequest); +function createBaseQueryDerivativeMidPriceAndTOBResponse(): QueryDerivativeMidPriceAndTOBResponse { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const QueryDerivativeMidPriceAndTOBResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse", + is(o: any): o is QueryDerivativeMidPriceAndTOBResponse { + return o && o.$typeUrl === QueryDerivativeMidPriceAndTOBResponse.typeUrl; + }, + isAmino(o: any): o is QueryDerivativeMidPriceAndTOBResponseAmino { + return o && o.$typeUrl === QueryDerivativeMidPriceAndTOBResponse.typeUrl; + }, + encode(message: QueryDerivativeMidPriceAndTOBResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMidPriceAndTOBResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMidPriceAndTOBResponse { + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: QueryDerivativeMidPriceAndTOBResponseAmino): QueryDerivativeMidPriceAndTOBResponse { + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: QueryDerivativeMidPriceAndTOBResponse): QueryDerivativeMidPriceAndTOBResponseAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMidPriceAndTOBResponseAminoMsg): QueryDerivativeMidPriceAndTOBResponse { + return QueryDerivativeMidPriceAndTOBResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMidPriceAndTOBResponseProtoMsg): QueryDerivativeMidPriceAndTOBResponse { + return QueryDerivativeMidPriceAndTOBResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMidPriceAndTOBResponse): Uint8Array { + return QueryDerivativeMidPriceAndTOBResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMidPriceAndTOBResponse): QueryDerivativeMidPriceAndTOBResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse", + value: QueryDerivativeMidPriceAndTOBResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMidPriceAndTOBResponse.typeUrl, QueryDerivativeMidPriceAndTOBResponse); +function createBaseQueryDerivativeOrderbookRequest(): QueryDerivativeOrderbookRequest { + return { + marketId: "", + limit: BigInt(0), + limitCumulativeNotional: undefined + }; +} +export const QueryDerivativeOrderbookRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest", + is(o: any): o is QueryDerivativeOrderbookRequest { + return o && (o.$typeUrl === QueryDerivativeOrderbookRequest.typeUrl || typeof o.marketId === "string" && typeof o.limit === "bigint"); + }, + isAmino(o: any): o is QueryDerivativeOrderbookRequestAmino { + return o && (o.$typeUrl === QueryDerivativeOrderbookRequest.typeUrl || typeof o.market_id === "string" && typeof o.limit === "bigint"); + }, + encode(message: QueryDerivativeOrderbookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(16).uint64(message.limit); + } + if (message.limitCumulativeNotional !== undefined) { + writer.uint32(26).string(message.limitCumulativeNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrderbookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrderbookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limit = reader.uint64(); + break; + case 3: + message.limitCumulativeNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrderbookRequest { + const message = createBaseQueryDerivativeOrderbookRequest(); + message.marketId = object.marketId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.limitCumulativeNotional = object.limitCumulativeNotional ?? undefined; + return message; + }, + fromAmino(object: QueryDerivativeOrderbookRequestAmino): QueryDerivativeOrderbookRequest { + const message = createBaseQueryDerivativeOrderbookRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.limit_cumulative_notional !== undefined && object.limit_cumulative_notional !== null) { + message.limitCumulativeNotional = object.limit_cumulative_notional; + } + return message; + }, + toAmino(message: QueryDerivativeOrderbookRequest): QueryDerivativeOrderbookRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.limit_cumulative_notional = message.limitCumulativeNotional === null ? undefined : message.limitCumulativeNotional; + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrderbookRequestAminoMsg): QueryDerivativeOrderbookRequest { + return QueryDerivativeOrderbookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrderbookRequestProtoMsg): QueryDerivativeOrderbookRequest { + return QueryDerivativeOrderbookRequest.decode(message.value); + }, + toProto(message: QueryDerivativeOrderbookRequest): Uint8Array { + return QueryDerivativeOrderbookRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrderbookRequest): QueryDerivativeOrderbookRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest", + value: QueryDerivativeOrderbookRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrderbookRequest.typeUrl, QueryDerivativeOrderbookRequest); +function createBaseQueryDerivativeOrderbookResponse(): QueryDerivativeOrderbookResponse { + return { + buysPriceLevel: [], + sellsPriceLevel: [] + }; +} +export const QueryDerivativeOrderbookResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse", + is(o: any): o is QueryDerivativeOrderbookResponse { + return o && (o.$typeUrl === QueryDerivativeOrderbookResponse.typeUrl || Array.isArray(o.buysPriceLevel) && (!o.buysPriceLevel.length || Level.is(o.buysPriceLevel[0])) && Array.isArray(o.sellsPriceLevel) && (!o.sellsPriceLevel.length || Level.is(o.sellsPriceLevel[0]))); + }, + isAmino(o: any): o is QueryDerivativeOrderbookResponseAmino { + return o && (o.$typeUrl === QueryDerivativeOrderbookResponse.typeUrl || Array.isArray(o.buys_price_level) && (!o.buys_price_level.length || Level.isAmino(o.buys_price_level[0])) && Array.isArray(o.sells_price_level) && (!o.sells_price_level.length || Level.isAmino(o.sells_price_level[0]))); + }, + encode(message: QueryDerivativeOrderbookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buysPriceLevel) { + Level.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellsPriceLevel) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrderbookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrderbookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buysPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + case 2: + message.sellsPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrderbookResponse { + const message = createBaseQueryDerivativeOrderbookResponse(); + message.buysPriceLevel = object.buysPriceLevel?.map(e => Level.fromPartial(e)) || []; + message.sellsPriceLevel = object.sellsPriceLevel?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrderbookResponseAmino): QueryDerivativeOrderbookResponse { + const message = createBaseQueryDerivativeOrderbookResponse(); + message.buysPriceLevel = object.buys_price_level?.map(e => Level.fromAmino(e)) || []; + message.sellsPriceLevel = object.sells_price_level?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeOrderbookResponse): QueryDerivativeOrderbookResponseAmino { + const obj: any = {}; + if (message.buysPriceLevel) { + obj.buys_price_level = message.buysPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buys_price_level = message.buysPriceLevel; + } + if (message.sellsPriceLevel) { + obj.sells_price_level = message.sellsPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sells_price_level = message.sellsPriceLevel; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrderbookResponseAminoMsg): QueryDerivativeOrderbookResponse { + return QueryDerivativeOrderbookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrderbookResponseProtoMsg): QueryDerivativeOrderbookResponse { + return QueryDerivativeOrderbookResponse.decode(message.value); + }, + toProto(message: QueryDerivativeOrderbookResponse): Uint8Array { + return QueryDerivativeOrderbookResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrderbookResponse): QueryDerivativeOrderbookResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse", + value: QueryDerivativeOrderbookResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrderbookResponse.typeUrl, QueryDerivativeOrderbookResponse); +function createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return { + marketId: "", + subaccountId: "", + baseAmount: "", + quoteAmount: "", + strategy: 0, + referencePrice: undefined + }; +} +export const QueryTraderSpotOrdersToCancelUpToAmountRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest", + is(o: any): o is QueryTraderSpotOrdersToCancelUpToAmountRequest { + return o && (o.$typeUrl === QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.baseAmount === "string" && typeof o.quoteAmount === "string" && isSet(o.strategy)); + }, + isAmino(o: any): o is QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.base_amount === "string" && typeof o.quote_amount === "string" && isSet(o.strategy)); + }, + encode(message: QueryTraderSpotOrdersToCancelUpToAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.baseAmount !== "") { + writer.uint32(26).string(message.baseAmount); + } + if (message.quoteAmount !== "") { + writer.uint32(34).string(message.quoteAmount); + } + if (message.strategy !== 0) { + writer.uint32(40).int32(message.strategy); + } + if (message.referencePrice !== undefined) { + writer.uint32(50).string(message.referencePrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.baseAmount = reader.string(); + break; + case 4: + message.quoteAmount = reader.string(); + break; + case 5: + message.strategy = (reader.int32() as any); + break; + case 6: + message.referencePrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.baseAmount = object.baseAmount ?? ""; + message.quoteAmount = object.quoteAmount ?? ""; + message.strategy = object.strategy ?? 0; + message.referencePrice = object.referencePrice ?? undefined; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersToCancelUpToAmountRequestAmino): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.base_amount !== undefined && object.base_amount !== null) { + message.baseAmount = object.base_amount; + } + if (object.quote_amount !== undefined && object.quote_amount !== null) { + message.quoteAmount = object.quote_amount; + } + if (object.strategy !== undefined && object.strategy !== null) { + message.strategy = object.strategy; + } + if (object.reference_price !== undefined && object.reference_price !== null) { + message.referencePrice = object.reference_price; + } + return message; + }, + toAmino(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.base_amount = message.baseAmount === "" ? undefined : message.baseAmount; + obj.quote_amount = message.quoteAmount === "" ? undefined : message.quoteAmount; + obj.strategy = message.strategy === 0 ? undefined : message.strategy; + obj.reference_price = message.referencePrice === null ? undefined : message.referencePrice; + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersToCancelUpToAmountRequestAminoMsg): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): Uint8Array { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest", + value: QueryTraderSpotOrdersToCancelUpToAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl, QueryTraderSpotOrdersToCancelUpToAmountRequest); +function createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return { + marketId: "", + subaccountId: "", + quoteAmount: "", + strategy: 0, + referencePrice: undefined + }; +} +export const QueryTraderDerivativeOrdersToCancelUpToAmountRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest", + is(o: any): o is QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.quoteAmount === "string" && isSet(o.strategy)); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.quote_amount === "string" && isSet(o.strategy)); + }, + encode(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.quoteAmount !== "") { + writer.uint32(26).string(message.quoteAmount); + } + if (message.strategy !== 0) { + writer.uint32(32).int32(message.strategy); + } + if (message.referencePrice !== undefined) { + writer.uint32(42).string(message.referencePrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.quoteAmount = reader.string(); + break; + case 4: + message.strategy = (reader.int32() as any); + break; + case 5: + message.referencePrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.quoteAmount = object.quoteAmount ?? ""; + message.strategy = object.strategy ?? 0; + message.referencePrice = object.referencePrice ?? undefined; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.quote_amount !== undefined && object.quote_amount !== null) { + message.quoteAmount = object.quote_amount; + } + if (object.strategy !== undefined && object.strategy !== null) { + message.strategy = object.strategy; + } + if (object.reference_price !== undefined && object.reference_price !== null) { + message.referencePrice = object.reference_price; + } + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.quote_amount = message.quoteAmount === "" ? undefined : message.quoteAmount; + obj.strategy = message.strategy === 0 ? undefined : message.strategy; + obj.reference_price = message.referencePrice === null ? undefined : message.referencePrice; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAminoMsg): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): Uint8Array { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest", + value: QueryTraderDerivativeOrdersToCancelUpToAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl, QueryTraderDerivativeOrdersToCancelUpToAmountRequest); +function createBaseQueryTraderDerivativeOrdersRequest(): QueryTraderDerivativeOrdersRequest { + return { + marketId: "", + subaccountId: "" + }; +} +export const QueryTraderDerivativeOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest", + is(o: any): o is QueryTraderDerivativeOrdersRequest { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryTraderDerivativeOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersRequest { + const message = createBaseQueryTraderDerivativeOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersRequestAmino): QueryTraderDerivativeOrdersRequest { + const message = createBaseQueryTraderDerivativeOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersRequest): QueryTraderDerivativeOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersRequestAminoMsg): QueryTraderDerivativeOrdersRequest { + return QueryTraderDerivativeOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersRequestProtoMsg): QueryTraderDerivativeOrdersRequest { + return QueryTraderDerivativeOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersRequest): Uint8Array { + return QueryTraderDerivativeOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersRequest): QueryTraderDerivativeOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest", + value: QueryTraderDerivativeOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersRequest.typeUrl, QueryTraderDerivativeOrdersRequest); +function createBaseQueryAccountAddressDerivativeOrdersRequest(): QueryAccountAddressDerivativeOrdersRequest { + return { + marketId: "", + accountAddress: "" + }; +} +export const QueryAccountAddressDerivativeOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest", + is(o: any): o is QueryAccountAddressDerivativeOrdersRequest { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressDerivativeOrdersRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.account_address === "string"); + }, + encode(message: QueryAccountAddressDerivativeOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.accountAddress !== "") { + writer.uint32(18).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressDerivativeOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressDerivativeOrdersRequest { + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressDerivativeOrdersRequestAmino): QueryAccountAddressDerivativeOrdersRequest { + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressDerivativeOrdersRequest): QueryAccountAddressDerivativeOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressDerivativeOrdersRequestAminoMsg): QueryAccountAddressDerivativeOrdersRequest { + return QueryAccountAddressDerivativeOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressDerivativeOrdersRequestProtoMsg): QueryAccountAddressDerivativeOrdersRequest { + return QueryAccountAddressDerivativeOrdersRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressDerivativeOrdersRequest): Uint8Array { + return QueryAccountAddressDerivativeOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressDerivativeOrdersRequest): QueryAccountAddressDerivativeOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest", + value: QueryAccountAddressDerivativeOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressDerivativeOrdersRequest.typeUrl, QueryAccountAddressDerivativeOrdersRequest); +function createBaseTrimmedDerivativeLimitOrder(): TrimmedDerivativeLimitOrder { + return { + price: "", + quantity: "", + margin: "", + fillable: "", + isBuy: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedDerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder", + is(o: any): o is TrimmedDerivativeLimitOrder { + return o && (o.$typeUrl === TrimmedDerivativeLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedDerivativeLimitOrderAmino { + return o && (o.$typeUrl === TrimmedDerivativeLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedDerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.fillable !== "") { + writer.uint32(34).string(message.fillable); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + if (message.orderHash !== "") { + writer.uint32(50).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedDerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.fillable = reader.string(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.orderHash = reader.string(); + break; + case 7: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedDerivativeLimitOrder { + const message = createBaseTrimmedDerivativeLimitOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.margin = object.margin ?? ""; + message.fillable = object.fillable ?? ""; + message.isBuy = object.isBuy ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedDerivativeLimitOrderAmino): TrimmedDerivativeLimitOrder { + const message = createBaseTrimmedDerivativeLimitOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedDerivativeLimitOrder): TrimmedDerivativeLimitOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.isBuy = message.isBuy ?? false; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedDerivativeLimitOrderAminoMsg): TrimmedDerivativeLimitOrder { + return TrimmedDerivativeLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedDerivativeLimitOrderProtoMsg): TrimmedDerivativeLimitOrder { + return TrimmedDerivativeLimitOrder.decode(message.value); + }, + toProto(message: TrimmedDerivativeLimitOrder): Uint8Array { + return TrimmedDerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedDerivativeLimitOrder): TrimmedDerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder", + value: TrimmedDerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedDerivativeLimitOrder.typeUrl, TrimmedDerivativeLimitOrder); +function createBaseQueryTraderDerivativeOrdersResponse(): QueryTraderDerivativeOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse", + is(o: any): o is QueryTraderDerivativeOrdersResponse { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersResponse { + const message = createBaseQueryTraderDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersResponseAmino): QueryTraderDerivativeOrdersResponse { + const message = createBaseQueryTraderDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersResponse): QueryTraderDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersResponseAminoMsg): QueryTraderDerivativeOrdersResponse { + return QueryTraderDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersResponseProtoMsg): QueryTraderDerivativeOrdersResponse { + return QueryTraderDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersResponse): Uint8Array { + return QueryTraderDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersResponse): QueryTraderDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse", + value: QueryTraderDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersResponse.typeUrl, QueryTraderDerivativeOrdersResponse); +function createBaseQueryAccountAddressDerivativeOrdersResponse(): QueryAccountAddressDerivativeOrdersResponse { + return { + orders: [] + }; +} +export const QueryAccountAddressDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse", + is(o: any): o is QueryAccountAddressDerivativeOrdersResponse { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryAccountAddressDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryAccountAddressDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressDerivativeOrdersResponse { + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAccountAddressDerivativeOrdersResponseAmino): QueryAccountAddressDerivativeOrdersResponse { + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAccountAddressDerivativeOrdersResponse): QueryAccountAddressDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryAccountAddressDerivativeOrdersResponseAminoMsg): QueryAccountAddressDerivativeOrdersResponse { + return QueryAccountAddressDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressDerivativeOrdersResponseProtoMsg): QueryAccountAddressDerivativeOrdersResponse { + return QueryAccountAddressDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressDerivativeOrdersResponse): Uint8Array { + return QueryAccountAddressDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressDerivativeOrdersResponse): QueryAccountAddressDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse", + value: QueryAccountAddressDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressDerivativeOrdersResponse.typeUrl, QueryAccountAddressDerivativeOrdersResponse); +function createBaseQueryDerivativeOrdersByHashesRequest(): QueryDerivativeOrdersByHashesRequest { + return { + marketId: "", + subaccountId: "", + orderHashes: [] + }; +} +export const QueryDerivativeOrdersByHashesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest", + is(o: any): o is QueryDerivativeOrdersByHashesRequest { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string")); + }, + isAmino(o: any): o is QueryDerivativeOrdersByHashesRequestAmino { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string")); + }, + encode(message: QueryDerivativeOrdersByHashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.orderHashes) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrdersByHashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHashes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrdersByHashesRequest { + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHashes = object.orderHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrdersByHashesRequestAmino): QueryDerivativeOrdersByHashesRequest { + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.orderHashes = object.order_hashes?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDerivativeOrdersByHashesRequest): QueryDerivativeOrdersByHashesRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrdersByHashesRequestAminoMsg): QueryDerivativeOrdersByHashesRequest { + return QueryDerivativeOrdersByHashesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrdersByHashesRequestProtoMsg): QueryDerivativeOrdersByHashesRequest { + return QueryDerivativeOrdersByHashesRequest.decode(message.value); + }, + toProto(message: QueryDerivativeOrdersByHashesRequest): Uint8Array { + return QueryDerivativeOrdersByHashesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrdersByHashesRequest): QueryDerivativeOrdersByHashesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest", + value: QueryDerivativeOrdersByHashesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrdersByHashesRequest.typeUrl, QueryDerivativeOrdersByHashesRequest); +function createBaseQueryDerivativeOrdersByHashesResponse(): QueryDerivativeOrdersByHashesResponse { + return { + orders: [] + }; +} +export const QueryDerivativeOrdersByHashesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse", + is(o: any): o is QueryDerivativeOrdersByHashesResponse { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryDerivativeOrdersByHashesResponseAmino { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryDerivativeOrdersByHashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrdersByHashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrdersByHashesResponse { + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrdersByHashesResponseAmino): QueryDerivativeOrdersByHashesResponse { + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeOrdersByHashesResponse): QueryDerivativeOrdersByHashesResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrdersByHashesResponseAminoMsg): QueryDerivativeOrdersByHashesResponse { + return QueryDerivativeOrdersByHashesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrdersByHashesResponseProtoMsg): QueryDerivativeOrdersByHashesResponse { + return QueryDerivativeOrdersByHashesResponse.decode(message.value); + }, + toProto(message: QueryDerivativeOrdersByHashesResponse): Uint8Array { + return QueryDerivativeOrdersByHashesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrdersByHashesResponse): QueryDerivativeOrdersByHashesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse", + value: QueryDerivativeOrdersByHashesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrdersByHashesResponse.typeUrl, QueryDerivativeOrdersByHashesResponse); +function createBaseQueryDerivativeMarketsRequest(): QueryDerivativeMarketsRequest { + return { + status: "", + marketIds: [], + withMidPriceAndTob: false + }; +} +export const QueryDerivativeMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest", + is(o: any): o is QueryDerivativeMarketsRequest { + return o && (o.$typeUrl === QueryDerivativeMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string") && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryDerivativeMarketsRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string") && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryDerivativeMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(24).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + case 3: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketsRequest { + const message = createBaseQueryDerivativeMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryDerivativeMarketsRequestAmino): QueryDerivativeMarketsRequest { + const message = createBaseQueryDerivativeMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryDerivativeMarketsRequest): QueryDerivativeMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketsRequestAminoMsg): QueryDerivativeMarketsRequest { + return QueryDerivativeMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketsRequestProtoMsg): QueryDerivativeMarketsRequest { + return QueryDerivativeMarketsRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketsRequest): Uint8Array { + return QueryDerivativeMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketsRequest): QueryDerivativeMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest", + value: QueryDerivativeMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketsRequest.typeUrl, QueryDerivativeMarketsRequest); +function createBasePriceLevel(): PriceLevel { + return { + price: "", + quantity: "" + }; +} +export const PriceLevel = { + typeUrl: "/injective.exchange.v1beta1.PriceLevel", + is(o: any): o is PriceLevel { + return o && (o.$typeUrl === PriceLevel.typeUrl || typeof o.price === "string" && typeof o.quantity === "string"); + }, + isAmino(o: any): o is PriceLevelAmino { + return o && (o.$typeUrl === PriceLevel.typeUrl || typeof o.price === "string" && typeof o.quantity === "string"); + }, + encode(message: PriceLevel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceLevel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceLevel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceLevel { + const message = createBasePriceLevel(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + return message; + }, + fromAmino(object: PriceLevelAmino): PriceLevel { + const message = createBasePriceLevel(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + return message; + }, + toAmino(message: PriceLevel): PriceLevelAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + return obj; + }, + fromAminoMsg(object: PriceLevelAminoMsg): PriceLevel { + return PriceLevel.fromAmino(object.value); + }, + fromProtoMsg(message: PriceLevelProtoMsg): PriceLevel { + return PriceLevel.decode(message.value); + }, + toProto(message: PriceLevel): Uint8Array { + return PriceLevel.encode(message).finish(); + }, + toProtoMsg(message: PriceLevel): PriceLevelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PriceLevel", + value: PriceLevel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceLevel.typeUrl, PriceLevel); +function createBasePerpetualMarketState(): PerpetualMarketState { + return { + marketInfo: undefined, + fundingInfo: undefined + }; +} +export const PerpetualMarketState = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState", + is(o: any): o is PerpetualMarketState { + return o && o.$typeUrl === PerpetualMarketState.typeUrl; + }, + isAmino(o: any): o is PerpetualMarketStateAmino { + return o && o.$typeUrl === PerpetualMarketState.typeUrl; + }, + encode(message: PerpetualMarketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketInfo !== undefined) { + PerpetualMarketInfo.encode(message.marketInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.fundingInfo !== undefined) { + PerpetualMarketFunding.encode(message.fundingInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketInfo = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + case 2: + message.fundingInfo = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketState { + const message = createBasePerpetualMarketState(); + message.marketInfo = object.marketInfo !== undefined && object.marketInfo !== null ? PerpetualMarketInfo.fromPartial(object.marketInfo) : undefined; + message.fundingInfo = object.fundingInfo !== undefined && object.fundingInfo !== null ? PerpetualMarketFunding.fromPartial(object.fundingInfo) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketStateAmino): PerpetualMarketState { + const message = createBasePerpetualMarketState(); + if (object.market_info !== undefined && object.market_info !== null) { + message.marketInfo = PerpetualMarketInfo.fromAmino(object.market_info); + } + if (object.funding_info !== undefined && object.funding_info !== null) { + message.fundingInfo = PerpetualMarketFunding.fromAmino(object.funding_info); + } + return message; + }, + toAmino(message: PerpetualMarketState): PerpetualMarketStateAmino { + const obj: any = {}; + obj.market_info = message.marketInfo ? PerpetualMarketInfo.toAmino(message.marketInfo) : undefined; + obj.funding_info = message.fundingInfo ? PerpetualMarketFunding.toAmino(message.fundingInfo) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketStateAminoMsg): PerpetualMarketState { + return PerpetualMarketState.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketStateProtoMsg): PerpetualMarketState { + return PerpetualMarketState.decode(message.value); + }, + toProto(message: PerpetualMarketState): Uint8Array { + return PerpetualMarketState.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketState): PerpetualMarketStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState", + value: PerpetualMarketState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketState.typeUrl, PerpetualMarketState); +function createBaseFullDerivativeMarket(): FullDerivativeMarket { + return { + market: undefined, + perpetualInfo: undefined, + futuresInfo: undefined, + markPrice: "", + midPriceAndTob: undefined + }; +} +export const FullDerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket", + is(o: any): o is FullDerivativeMarket { + return o && (o.$typeUrl === FullDerivativeMarket.typeUrl || typeof o.markPrice === "string"); + }, + isAmino(o: any): o is FullDerivativeMarketAmino { + return o && (o.$typeUrl === FullDerivativeMarket.typeUrl || typeof o.mark_price === "string"); + }, + encode(message: FullDerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualInfo !== undefined) { + PerpetualMarketState.encode(message.perpetualInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.futuresInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.futuresInfo, writer.uint32(26).fork()).ldelim(); + } + if (message.markPrice !== "") { + writer.uint32(34).string(message.markPrice); + } + if (message.midPriceAndTob !== undefined) { + MidPriceAndTOB.encode(message.midPriceAndTob, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullDerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualInfo = PerpetualMarketState.decode(reader, reader.uint32()); + break; + case 3: + message.futuresInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + case 4: + message.markPrice = reader.string(); + break; + case 5: + message.midPriceAndTob = MidPriceAndTOB.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullDerivativeMarket { + const message = createBaseFullDerivativeMarket(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.perpetualInfo = object.perpetualInfo !== undefined && object.perpetualInfo !== null ? PerpetualMarketState.fromPartial(object.perpetualInfo) : undefined; + message.futuresInfo = object.futuresInfo !== undefined && object.futuresInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.futuresInfo) : undefined; + message.markPrice = object.markPrice ?? ""; + message.midPriceAndTob = object.midPriceAndTob !== undefined && object.midPriceAndTob !== null ? MidPriceAndTOB.fromPartial(object.midPriceAndTob) : undefined; + return message; + }, + fromAmino(object: FullDerivativeMarketAmino): FullDerivativeMarket { + const message = createBaseFullDerivativeMarket(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.perpetual_info !== undefined && object.perpetual_info !== null) { + message.perpetualInfo = PerpetualMarketState.fromAmino(object.perpetual_info); + } + if (object.futures_info !== undefined && object.futures_info !== null) { + message.futuresInfo = ExpiryFuturesMarketInfo.fromAmino(object.futures_info); + } + if (object.mark_price !== undefined && object.mark_price !== null) { + message.markPrice = object.mark_price; + } + if (object.mid_price_and_tob !== undefined && object.mid_price_and_tob !== null) { + message.midPriceAndTob = MidPriceAndTOB.fromAmino(object.mid_price_and_tob); + } + return message; + }, + toAmino(message: FullDerivativeMarket): FullDerivativeMarketAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.perpetual_info = message.perpetualInfo ? PerpetualMarketState.toAmino(message.perpetualInfo) : undefined; + obj.futures_info = message.futuresInfo ? ExpiryFuturesMarketInfo.toAmino(message.futuresInfo) : undefined; + obj.mark_price = message.markPrice === "" ? undefined : message.markPrice; + obj.mid_price_and_tob = message.midPriceAndTob ? MidPriceAndTOB.toAmino(message.midPriceAndTob) : undefined; + return obj; + }, + fromAminoMsg(object: FullDerivativeMarketAminoMsg): FullDerivativeMarket { + return FullDerivativeMarket.fromAmino(object.value); + }, + fromProtoMsg(message: FullDerivativeMarketProtoMsg): FullDerivativeMarket { + return FullDerivativeMarket.decode(message.value); + }, + toProto(message: FullDerivativeMarket): Uint8Array { + return FullDerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: FullDerivativeMarket): FullDerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket", + value: FullDerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullDerivativeMarket.typeUrl, FullDerivativeMarket); +function createBaseQueryDerivativeMarketsResponse(): QueryDerivativeMarketsResponse { + return { + markets: [] + }; +} +export const QueryDerivativeMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse", + is(o: any): o is QueryDerivativeMarketsResponse { + return o && (o.$typeUrl === QueryDerivativeMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullDerivativeMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryDerivativeMarketsResponseAmino { + return o && (o.$typeUrl === QueryDerivativeMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullDerivativeMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryDerivativeMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + FullDerivativeMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(FullDerivativeMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketsResponse { + const message = createBaseQueryDerivativeMarketsResponse(); + message.markets = object.markets?.map(e => FullDerivativeMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeMarketsResponseAmino): QueryDerivativeMarketsResponse { + const message = createBaseQueryDerivativeMarketsResponse(); + message.markets = object.markets?.map(e => FullDerivativeMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeMarketsResponse): QueryDerivativeMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? FullDerivativeMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketsResponseAminoMsg): QueryDerivativeMarketsResponse { + return QueryDerivativeMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketsResponseProtoMsg): QueryDerivativeMarketsResponse { + return QueryDerivativeMarketsResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketsResponse): Uint8Array { + return QueryDerivativeMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketsResponse): QueryDerivativeMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse", + value: QueryDerivativeMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketsResponse.typeUrl, QueryDerivativeMarketsResponse); +function createBaseQueryDerivativeMarketRequest(): QueryDerivativeMarketRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest", + is(o: any): o is QueryDerivativeMarketRequest { + return o && (o.$typeUrl === QueryDerivativeMarketRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketRequest { + const message = createBaseQueryDerivativeMarketRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketRequestAmino): QueryDerivativeMarketRequest { + const message = createBaseQueryDerivativeMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketRequest): QueryDerivativeMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketRequestAminoMsg): QueryDerivativeMarketRequest { + return QueryDerivativeMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketRequestProtoMsg): QueryDerivativeMarketRequest { + return QueryDerivativeMarketRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketRequest): Uint8Array { + return QueryDerivativeMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketRequest): QueryDerivativeMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest", + value: QueryDerivativeMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketRequest.typeUrl, QueryDerivativeMarketRequest); +function createBaseQueryDerivativeMarketResponse(): QueryDerivativeMarketResponse { + return { + market: undefined + }; +} +export const QueryDerivativeMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse", + is(o: any): o is QueryDerivativeMarketResponse { + return o && o.$typeUrl === QueryDerivativeMarketResponse.typeUrl; + }, + isAmino(o: any): o is QueryDerivativeMarketResponseAmino { + return o && o.$typeUrl === QueryDerivativeMarketResponse.typeUrl; + }, + encode(message: QueryDerivativeMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + FullDerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = FullDerivativeMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketResponse { + const message = createBaseQueryDerivativeMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? FullDerivativeMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QueryDerivativeMarketResponseAmino): QueryDerivativeMarketResponse { + const message = createBaseQueryDerivativeMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = FullDerivativeMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QueryDerivativeMarketResponse): QueryDerivativeMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? FullDerivativeMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketResponseAminoMsg): QueryDerivativeMarketResponse { + return QueryDerivativeMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketResponseProtoMsg): QueryDerivativeMarketResponse { + return QueryDerivativeMarketResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketResponse): Uint8Array { + return QueryDerivativeMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketResponse): QueryDerivativeMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse", + value: QueryDerivativeMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketResponse.typeUrl, QueryDerivativeMarketResponse); +function createBaseQueryDerivativeMarketAddressRequest(): QueryDerivativeMarketAddressRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMarketAddressRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest", + is(o: any): o is QueryDerivativeMarketAddressRequest { + return o && (o.$typeUrl === QueryDerivativeMarketAddressRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketAddressRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketAddressRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMarketAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketAddressRequest { + const message = createBaseQueryDerivativeMarketAddressRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketAddressRequestAmino): QueryDerivativeMarketAddressRequest { + const message = createBaseQueryDerivativeMarketAddressRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketAddressRequest): QueryDerivativeMarketAddressRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketAddressRequestAminoMsg): QueryDerivativeMarketAddressRequest { + return QueryDerivativeMarketAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketAddressRequestProtoMsg): QueryDerivativeMarketAddressRequest { + return QueryDerivativeMarketAddressRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketAddressRequest): Uint8Array { + return QueryDerivativeMarketAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketAddressRequest): QueryDerivativeMarketAddressRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest", + value: QueryDerivativeMarketAddressRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketAddressRequest.typeUrl, QueryDerivativeMarketAddressRequest); +function createBaseQueryDerivativeMarketAddressResponse(): QueryDerivativeMarketAddressResponse { + return { + address: "", + subaccountId: "" + }; +} +export const QueryDerivativeMarketAddressResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse", + is(o: any): o is QueryDerivativeMarketAddressResponse { + return o && (o.$typeUrl === QueryDerivativeMarketAddressResponse.typeUrl || typeof o.address === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketAddressResponseAmino { + return o && (o.$typeUrl === QueryDerivativeMarketAddressResponse.typeUrl || typeof o.address === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryDerivativeMarketAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketAddressResponse { + const message = createBaseQueryDerivativeMarketAddressResponse(); + message.address = object.address ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketAddressResponseAmino): QueryDerivativeMarketAddressResponse { + const message = createBaseQueryDerivativeMarketAddressResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketAddressResponse): QueryDerivativeMarketAddressResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketAddressResponseAminoMsg): QueryDerivativeMarketAddressResponse { + return QueryDerivativeMarketAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketAddressResponseProtoMsg): QueryDerivativeMarketAddressResponse { + return QueryDerivativeMarketAddressResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketAddressResponse): Uint8Array { + return QueryDerivativeMarketAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketAddressResponse): QueryDerivativeMarketAddressResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse", + value: QueryDerivativeMarketAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketAddressResponse.typeUrl, QueryDerivativeMarketAddressResponse); +function createBaseQuerySubaccountTradeNonceRequest(): QuerySubaccountTradeNonceRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountTradeNonceRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest", + is(o: any): o is QuerySubaccountTradeNonceRequest { + return o && (o.$typeUrl === QuerySubaccountTradeNonceRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountTradeNonceRequestAmino { + return o && (o.$typeUrl === QuerySubaccountTradeNonceRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountTradeNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountTradeNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountTradeNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountTradeNonceRequest { + const message = createBaseQuerySubaccountTradeNonceRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountTradeNonceRequestAmino): QuerySubaccountTradeNonceRequest { + const message = createBaseQuerySubaccountTradeNonceRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountTradeNonceRequest): QuerySubaccountTradeNonceRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountTradeNonceRequestAminoMsg): QuerySubaccountTradeNonceRequest { + return QuerySubaccountTradeNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountTradeNonceRequestProtoMsg): QuerySubaccountTradeNonceRequest { + return QuerySubaccountTradeNonceRequest.decode(message.value); + }, + toProto(message: QuerySubaccountTradeNonceRequest): Uint8Array { + return QuerySubaccountTradeNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountTradeNonceRequest): QuerySubaccountTradeNonceRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest", + value: QuerySubaccountTradeNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountTradeNonceRequest.typeUrl, QuerySubaccountTradeNonceRequest); +function createBaseQuerySubaccountPositionsRequest(): QuerySubaccountPositionsRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountPositionsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest", + is(o: any): o is QuerySubaccountPositionsRequest { + return o && (o.$typeUrl === QuerySubaccountPositionsRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountPositionsRequestAmino { + return o && (o.$typeUrl === QuerySubaccountPositionsRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionsRequest { + const message = createBaseQuerySubaccountPositionsRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountPositionsRequestAmino): QuerySubaccountPositionsRequest { + const message = createBaseQuerySubaccountPositionsRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountPositionsRequest): QuerySubaccountPositionsRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionsRequestAminoMsg): QuerySubaccountPositionsRequest { + return QuerySubaccountPositionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionsRequestProtoMsg): QuerySubaccountPositionsRequest { + return QuerySubaccountPositionsRequest.decode(message.value); + }, + toProto(message: QuerySubaccountPositionsRequest): Uint8Array { + return QuerySubaccountPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionsRequest): QuerySubaccountPositionsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest", + value: QuerySubaccountPositionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionsRequest.typeUrl, QuerySubaccountPositionsRequest); +function createBaseQuerySubaccountPositionInMarketRequest(): QuerySubaccountPositionInMarketRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountPositionInMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest", + is(o: any): o is QuerySubaccountPositionInMarketRequest { + return o && (o.$typeUrl === QuerySubaccountPositionInMarketRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountPositionInMarketRequestAmino { + return o && (o.$typeUrl === QuerySubaccountPositionInMarketRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountPositionInMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionInMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionInMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionInMarketRequest { + const message = createBaseQuerySubaccountPositionInMarketRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountPositionInMarketRequestAmino): QuerySubaccountPositionInMarketRequest { + const message = createBaseQuerySubaccountPositionInMarketRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountPositionInMarketRequest): QuerySubaccountPositionInMarketRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionInMarketRequestAminoMsg): QuerySubaccountPositionInMarketRequest { + return QuerySubaccountPositionInMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionInMarketRequestProtoMsg): QuerySubaccountPositionInMarketRequest { + return QuerySubaccountPositionInMarketRequest.decode(message.value); + }, + toProto(message: QuerySubaccountPositionInMarketRequest): Uint8Array { + return QuerySubaccountPositionInMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionInMarketRequest): QuerySubaccountPositionInMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest", + value: QuerySubaccountPositionInMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionInMarketRequest.typeUrl, QuerySubaccountPositionInMarketRequest); +function createBaseQuerySubaccountEffectivePositionInMarketRequest(): QuerySubaccountEffectivePositionInMarketRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountEffectivePositionInMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest", + is(o: any): o is QuerySubaccountEffectivePositionInMarketRequest { + return o && (o.$typeUrl === QuerySubaccountEffectivePositionInMarketRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountEffectivePositionInMarketRequestAmino { + return o && (o.$typeUrl === QuerySubaccountEffectivePositionInMarketRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountEffectivePositionInMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountEffectivePositionInMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountEffectivePositionInMarketRequest { + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountEffectivePositionInMarketRequestAmino): QuerySubaccountEffectivePositionInMarketRequest { + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountEffectivePositionInMarketRequest): QuerySubaccountEffectivePositionInMarketRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountEffectivePositionInMarketRequestAminoMsg): QuerySubaccountEffectivePositionInMarketRequest { + return QuerySubaccountEffectivePositionInMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountEffectivePositionInMarketRequestProtoMsg): QuerySubaccountEffectivePositionInMarketRequest { + return QuerySubaccountEffectivePositionInMarketRequest.decode(message.value); + }, + toProto(message: QuerySubaccountEffectivePositionInMarketRequest): Uint8Array { + return QuerySubaccountEffectivePositionInMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountEffectivePositionInMarketRequest): QuerySubaccountEffectivePositionInMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest", + value: QuerySubaccountEffectivePositionInMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountEffectivePositionInMarketRequest.typeUrl, QuerySubaccountEffectivePositionInMarketRequest); +function createBaseQuerySubaccountOrderMetadataRequest(): QuerySubaccountOrderMetadataRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountOrderMetadataRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest", + is(o: any): o is QuerySubaccountOrderMetadataRequest { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountOrderMetadataRequestAmino { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountOrderMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrderMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrderMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrderMetadataRequest { + const message = createBaseQuerySubaccountOrderMetadataRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountOrderMetadataRequestAmino): QuerySubaccountOrderMetadataRequest { + const message = createBaseQuerySubaccountOrderMetadataRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountOrderMetadataRequest): QuerySubaccountOrderMetadataRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrderMetadataRequestAminoMsg): QuerySubaccountOrderMetadataRequest { + return QuerySubaccountOrderMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrderMetadataRequestProtoMsg): QuerySubaccountOrderMetadataRequest { + return QuerySubaccountOrderMetadataRequest.decode(message.value); + }, + toProto(message: QuerySubaccountOrderMetadataRequest): Uint8Array { + return QuerySubaccountOrderMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrderMetadataRequest): QuerySubaccountOrderMetadataRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest", + value: QuerySubaccountOrderMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrderMetadataRequest.typeUrl, QuerySubaccountOrderMetadataRequest); +function createBaseQuerySubaccountPositionsResponse(): QuerySubaccountPositionsResponse { + return { + state: [] + }; +} +export const QuerySubaccountPositionsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse", + is(o: any): o is QuerySubaccountPositionsResponse { + return o && (o.$typeUrl === QuerySubaccountPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.is(o.state[0]))); + }, + isAmino(o: any): o is QuerySubaccountPositionsResponseAmino { + return o && (o.$typeUrl === QuerySubaccountPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.isAmino(o.state[0]))); + }, + encode(message: QuerySubaccountPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.state) { + DerivativePosition.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state.push(DerivativePosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionsResponse { + const message = createBaseQuerySubaccountPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountPositionsResponseAmino): QuerySubaccountPositionsResponse { + const message = createBaseQuerySubaccountPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountPositionsResponse): QuerySubaccountPositionsResponseAmino { + const obj: any = {}; + if (message.state) { + obj.state = message.state.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.state = message.state; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionsResponseAminoMsg): QuerySubaccountPositionsResponse { + return QuerySubaccountPositionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionsResponseProtoMsg): QuerySubaccountPositionsResponse { + return QuerySubaccountPositionsResponse.decode(message.value); + }, + toProto(message: QuerySubaccountPositionsResponse): Uint8Array { + return QuerySubaccountPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionsResponse): QuerySubaccountPositionsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse", + value: QuerySubaccountPositionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionsResponse.typeUrl, QuerySubaccountPositionsResponse); +function createBaseQuerySubaccountPositionInMarketResponse(): QuerySubaccountPositionInMarketResponse { + return { + state: undefined + }; +} +export const QuerySubaccountPositionInMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse", + is(o: any): o is QuerySubaccountPositionInMarketResponse { + return o && o.$typeUrl === QuerySubaccountPositionInMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountPositionInMarketResponseAmino { + return o && o.$typeUrl === QuerySubaccountPositionInMarketResponse.typeUrl; + }, + encode(message: QuerySubaccountPositionInMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + Position.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionInMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionInMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionInMarketResponse { + const message = createBaseQuerySubaccountPositionInMarketResponse(); + message.state = object.state !== undefined && object.state !== null ? Position.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountPositionInMarketResponseAmino): QuerySubaccountPositionInMarketResponse { + const message = createBaseQuerySubaccountPositionInMarketResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = Position.fromAmino(object.state); + } + return message; + }, + toAmino(message: QuerySubaccountPositionInMarketResponse): QuerySubaccountPositionInMarketResponseAmino { + const obj: any = {}; + obj.state = message.state ? Position.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionInMarketResponseAminoMsg): QuerySubaccountPositionInMarketResponse { + return QuerySubaccountPositionInMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionInMarketResponseProtoMsg): QuerySubaccountPositionInMarketResponse { + return QuerySubaccountPositionInMarketResponse.decode(message.value); + }, + toProto(message: QuerySubaccountPositionInMarketResponse): Uint8Array { + return QuerySubaccountPositionInMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionInMarketResponse): QuerySubaccountPositionInMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse", + value: QuerySubaccountPositionInMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionInMarketResponse.typeUrl, QuerySubaccountPositionInMarketResponse); +function createBaseEffectivePosition(): EffectivePosition { + return { + isLong: false, + quantity: "", + entryPrice: "", + effectiveMargin: "" + }; +} +export const EffectivePosition = { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition", + is(o: any): o is EffectivePosition { + return o && (o.$typeUrl === EffectivePosition.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.effectiveMargin === "string"); + }, + isAmino(o: any): o is EffectivePositionAmino { + return o && (o.$typeUrl === EffectivePosition.typeUrl || typeof o.is_long === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.effective_margin === "string"); + }, + encode(message: EffectivePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(26).string(message.entryPrice); + } + if (message.effectiveMargin !== "") { + writer.uint32(34).string(message.effectiveMargin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EffectivePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEffectivePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.entryPrice = reader.string(); + break; + case 4: + message.effectiveMargin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EffectivePosition { + const message = createBaseEffectivePosition(); + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.effectiveMargin = object.effectiveMargin ?? ""; + return message; + }, + fromAmino(object: EffectivePositionAmino): EffectivePosition { + const message = createBaseEffectivePosition(); + if (object.is_long !== undefined && object.is_long !== null) { + message.isLong = object.is_long; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.effective_margin !== undefined && object.effective_margin !== null) { + message.effectiveMargin = object.effective_margin; + } + return message; + }, + toAmino(message: EffectivePosition): EffectivePositionAmino { + const obj: any = {}; + obj.is_long = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.effective_margin = message.effectiveMargin === "" ? undefined : message.effectiveMargin; + return obj; + }, + fromAminoMsg(object: EffectivePositionAminoMsg): EffectivePosition { + return EffectivePosition.fromAmino(object.value); + }, + fromProtoMsg(message: EffectivePositionProtoMsg): EffectivePosition { + return EffectivePosition.decode(message.value); + }, + toProto(message: EffectivePosition): Uint8Array { + return EffectivePosition.encode(message).finish(); + }, + toProtoMsg(message: EffectivePosition): EffectivePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition", + value: EffectivePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EffectivePosition.typeUrl, EffectivePosition); +function createBaseQuerySubaccountEffectivePositionInMarketResponse(): QuerySubaccountEffectivePositionInMarketResponse { + return { + state: undefined + }; +} +export const QuerySubaccountEffectivePositionInMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse", + is(o: any): o is QuerySubaccountEffectivePositionInMarketResponse { + return o && o.$typeUrl === QuerySubaccountEffectivePositionInMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountEffectivePositionInMarketResponseAmino { + return o && o.$typeUrl === QuerySubaccountEffectivePositionInMarketResponse.typeUrl; + }, + encode(message: QuerySubaccountEffectivePositionInMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + EffectivePosition.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountEffectivePositionInMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = EffectivePosition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountEffectivePositionInMarketResponse { + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + message.state = object.state !== undefined && object.state !== null ? EffectivePosition.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountEffectivePositionInMarketResponseAmino): QuerySubaccountEffectivePositionInMarketResponse { + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = EffectivePosition.fromAmino(object.state); + } + return message; + }, + toAmino(message: QuerySubaccountEffectivePositionInMarketResponse): QuerySubaccountEffectivePositionInMarketResponseAmino { + const obj: any = {}; + obj.state = message.state ? EffectivePosition.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountEffectivePositionInMarketResponseAminoMsg): QuerySubaccountEffectivePositionInMarketResponse { + return QuerySubaccountEffectivePositionInMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountEffectivePositionInMarketResponseProtoMsg): QuerySubaccountEffectivePositionInMarketResponse { + return QuerySubaccountEffectivePositionInMarketResponse.decode(message.value); + }, + toProto(message: QuerySubaccountEffectivePositionInMarketResponse): Uint8Array { + return QuerySubaccountEffectivePositionInMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountEffectivePositionInMarketResponse): QuerySubaccountEffectivePositionInMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse", + value: QuerySubaccountEffectivePositionInMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountEffectivePositionInMarketResponse.typeUrl, QuerySubaccountEffectivePositionInMarketResponse); +function createBaseQueryPerpetualMarketInfoRequest(): QueryPerpetualMarketInfoRequest { + return { + marketId: "" + }; +} +export const QueryPerpetualMarketInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest", + is(o: any): o is QueryPerpetualMarketInfoRequest { + return o && (o.$typeUrl === QueryPerpetualMarketInfoRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryPerpetualMarketInfoRequestAmino { + return o && (o.$typeUrl === QueryPerpetualMarketInfoRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryPerpetualMarketInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketInfoRequest { + const message = createBaseQueryPerpetualMarketInfoRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryPerpetualMarketInfoRequestAmino): QueryPerpetualMarketInfoRequest { + const message = createBaseQueryPerpetualMarketInfoRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryPerpetualMarketInfoRequest): QueryPerpetualMarketInfoRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketInfoRequestAminoMsg): QueryPerpetualMarketInfoRequest { + return QueryPerpetualMarketInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketInfoRequestProtoMsg): QueryPerpetualMarketInfoRequest { + return QueryPerpetualMarketInfoRequest.decode(message.value); + }, + toProto(message: QueryPerpetualMarketInfoRequest): Uint8Array { + return QueryPerpetualMarketInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketInfoRequest): QueryPerpetualMarketInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest", + value: QueryPerpetualMarketInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketInfoRequest.typeUrl, QueryPerpetualMarketInfoRequest); +function createBaseQueryPerpetualMarketInfoResponse(): QueryPerpetualMarketInfoResponse { + return { + info: PerpetualMarketInfo.fromPartial({}) + }; +} +export const QueryPerpetualMarketInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse", + is(o: any): o is QueryPerpetualMarketInfoResponse { + return o && (o.$typeUrl === QueryPerpetualMarketInfoResponse.typeUrl || PerpetualMarketInfo.is(o.info)); + }, + isAmino(o: any): o is QueryPerpetualMarketInfoResponseAmino { + return o && (o.$typeUrl === QueryPerpetualMarketInfoResponse.typeUrl || PerpetualMarketInfo.isAmino(o.info)); + }, + encode(message: QueryPerpetualMarketInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + PerpetualMarketInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketInfoResponse { + const message = createBaseQueryPerpetualMarketInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? PerpetualMarketInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualMarketInfoResponseAmino): QueryPerpetualMarketInfoResponse { + const message = createBaseQueryPerpetualMarketInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = PerpetualMarketInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryPerpetualMarketInfoResponse): QueryPerpetualMarketInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? PerpetualMarketInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketInfoResponseAminoMsg): QueryPerpetualMarketInfoResponse { + return QueryPerpetualMarketInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketInfoResponseProtoMsg): QueryPerpetualMarketInfoResponse { + return QueryPerpetualMarketInfoResponse.decode(message.value); + }, + toProto(message: QueryPerpetualMarketInfoResponse): Uint8Array { + return QueryPerpetualMarketInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketInfoResponse): QueryPerpetualMarketInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse", + value: QueryPerpetualMarketInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketInfoResponse.typeUrl, QueryPerpetualMarketInfoResponse); +function createBaseQueryExpiryFuturesMarketInfoRequest(): QueryExpiryFuturesMarketInfoRequest { + return { + marketId: "" + }; +} +export const QueryExpiryFuturesMarketInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest", + is(o: any): o is QueryExpiryFuturesMarketInfoRequest { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryExpiryFuturesMarketInfoRequestAmino { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryExpiryFuturesMarketInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExpiryFuturesMarketInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExpiryFuturesMarketInfoRequest { + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryExpiryFuturesMarketInfoRequestAmino): QueryExpiryFuturesMarketInfoRequest { + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryExpiryFuturesMarketInfoRequest): QueryExpiryFuturesMarketInfoRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryExpiryFuturesMarketInfoRequestAminoMsg): QueryExpiryFuturesMarketInfoRequest { + return QueryExpiryFuturesMarketInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExpiryFuturesMarketInfoRequestProtoMsg): QueryExpiryFuturesMarketInfoRequest { + return QueryExpiryFuturesMarketInfoRequest.decode(message.value); + }, + toProto(message: QueryExpiryFuturesMarketInfoRequest): Uint8Array { + return QueryExpiryFuturesMarketInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExpiryFuturesMarketInfoRequest): QueryExpiryFuturesMarketInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest", + value: QueryExpiryFuturesMarketInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExpiryFuturesMarketInfoRequest.typeUrl, QueryExpiryFuturesMarketInfoRequest); +function createBaseQueryExpiryFuturesMarketInfoResponse(): QueryExpiryFuturesMarketInfoResponse { + return { + info: ExpiryFuturesMarketInfo.fromPartial({}) + }; +} +export const QueryExpiryFuturesMarketInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse", + is(o: any): o is QueryExpiryFuturesMarketInfoResponse { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoResponse.typeUrl || ExpiryFuturesMarketInfo.is(o.info)); + }, + isAmino(o: any): o is QueryExpiryFuturesMarketInfoResponseAmino { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoResponse.typeUrl || ExpiryFuturesMarketInfo.isAmino(o.info)); + }, + encode(message: QueryExpiryFuturesMarketInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + ExpiryFuturesMarketInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExpiryFuturesMarketInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExpiryFuturesMarketInfoResponse { + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? ExpiryFuturesMarketInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryExpiryFuturesMarketInfoResponseAmino): QueryExpiryFuturesMarketInfoResponse { + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = ExpiryFuturesMarketInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryExpiryFuturesMarketInfoResponse): QueryExpiryFuturesMarketInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? ExpiryFuturesMarketInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryExpiryFuturesMarketInfoResponseAminoMsg): QueryExpiryFuturesMarketInfoResponse { + return QueryExpiryFuturesMarketInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExpiryFuturesMarketInfoResponseProtoMsg): QueryExpiryFuturesMarketInfoResponse { + return QueryExpiryFuturesMarketInfoResponse.decode(message.value); + }, + toProto(message: QueryExpiryFuturesMarketInfoResponse): Uint8Array { + return QueryExpiryFuturesMarketInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExpiryFuturesMarketInfoResponse): QueryExpiryFuturesMarketInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse", + value: QueryExpiryFuturesMarketInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExpiryFuturesMarketInfoResponse.typeUrl, QueryExpiryFuturesMarketInfoResponse); +function createBaseQueryPerpetualMarketFundingRequest(): QueryPerpetualMarketFundingRequest { + return { + marketId: "" + }; +} +export const QueryPerpetualMarketFundingRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest", + is(o: any): o is QueryPerpetualMarketFundingRequest { + return o && (o.$typeUrl === QueryPerpetualMarketFundingRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryPerpetualMarketFundingRequestAmino { + return o && (o.$typeUrl === QueryPerpetualMarketFundingRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryPerpetualMarketFundingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketFundingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketFundingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketFundingRequest { + const message = createBaseQueryPerpetualMarketFundingRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryPerpetualMarketFundingRequestAmino): QueryPerpetualMarketFundingRequest { + const message = createBaseQueryPerpetualMarketFundingRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryPerpetualMarketFundingRequest): QueryPerpetualMarketFundingRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketFundingRequestAminoMsg): QueryPerpetualMarketFundingRequest { + return QueryPerpetualMarketFundingRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketFundingRequestProtoMsg): QueryPerpetualMarketFundingRequest { + return QueryPerpetualMarketFundingRequest.decode(message.value); + }, + toProto(message: QueryPerpetualMarketFundingRequest): Uint8Array { + return QueryPerpetualMarketFundingRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketFundingRequest): QueryPerpetualMarketFundingRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest", + value: QueryPerpetualMarketFundingRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketFundingRequest.typeUrl, QueryPerpetualMarketFundingRequest); +function createBaseQueryPerpetualMarketFundingResponse(): QueryPerpetualMarketFundingResponse { + return { + state: PerpetualMarketFunding.fromPartial({}) + }; +} +export const QueryPerpetualMarketFundingResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse", + is(o: any): o is QueryPerpetualMarketFundingResponse { + return o && (o.$typeUrl === QueryPerpetualMarketFundingResponse.typeUrl || PerpetualMarketFunding.is(o.state)); + }, + isAmino(o: any): o is QueryPerpetualMarketFundingResponseAmino { + return o && (o.$typeUrl === QueryPerpetualMarketFundingResponse.typeUrl || PerpetualMarketFunding.isAmino(o.state)); + }, + encode(message: QueryPerpetualMarketFundingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + PerpetualMarketFunding.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketFundingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketFundingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketFundingResponse { + const message = createBaseQueryPerpetualMarketFundingResponse(); + message.state = object.state !== undefined && object.state !== null ? PerpetualMarketFunding.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualMarketFundingResponseAmino): QueryPerpetualMarketFundingResponse { + const message = createBaseQueryPerpetualMarketFundingResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = PerpetualMarketFunding.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryPerpetualMarketFundingResponse): QueryPerpetualMarketFundingResponseAmino { + const obj: any = {}; + obj.state = message.state ? PerpetualMarketFunding.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketFundingResponseAminoMsg): QueryPerpetualMarketFundingResponse { + return QueryPerpetualMarketFundingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketFundingResponseProtoMsg): QueryPerpetualMarketFundingResponse { + return QueryPerpetualMarketFundingResponse.decode(message.value); + }, + toProto(message: QueryPerpetualMarketFundingResponse): Uint8Array { + return QueryPerpetualMarketFundingResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketFundingResponse): QueryPerpetualMarketFundingResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse", + value: QueryPerpetualMarketFundingResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketFundingResponse.typeUrl, QueryPerpetualMarketFundingResponse); +function createBaseQuerySubaccountOrderMetadataResponse(): QuerySubaccountOrderMetadataResponse { + return { + metadata: [] + }; +} +export const QuerySubaccountOrderMetadataResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse", + is(o: any): o is QuerySubaccountOrderMetadataResponse { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataResponse.typeUrl || Array.isArray(o.metadata) && (!o.metadata.length || SubaccountOrderbookMetadataWithMarket.is(o.metadata[0]))); + }, + isAmino(o: any): o is QuerySubaccountOrderMetadataResponseAmino { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataResponse.typeUrl || Array.isArray(o.metadata) && (!o.metadata.length || SubaccountOrderbookMetadataWithMarket.isAmino(o.metadata[0]))); + }, + encode(message: QuerySubaccountOrderMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.metadata) { + SubaccountOrderbookMetadataWithMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrderMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrderMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata.push(SubaccountOrderbookMetadataWithMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrderMetadataResponse { + const message = createBaseQuerySubaccountOrderMetadataResponse(); + message.metadata = object.metadata?.map(e => SubaccountOrderbookMetadataWithMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountOrderMetadataResponseAmino): QuerySubaccountOrderMetadataResponse { + const message = createBaseQuerySubaccountOrderMetadataResponse(); + message.metadata = object.metadata?.map(e => SubaccountOrderbookMetadataWithMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountOrderMetadataResponse): QuerySubaccountOrderMetadataResponseAmino { + const obj: any = {}; + if (message.metadata) { + obj.metadata = message.metadata.map(e => e ? SubaccountOrderbookMetadataWithMarket.toAmino(e) : undefined); + } else { + obj.metadata = message.metadata; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrderMetadataResponseAminoMsg): QuerySubaccountOrderMetadataResponse { + return QuerySubaccountOrderMetadataResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrderMetadataResponseProtoMsg): QuerySubaccountOrderMetadataResponse { + return QuerySubaccountOrderMetadataResponse.decode(message.value); + }, + toProto(message: QuerySubaccountOrderMetadataResponse): Uint8Array { + return QuerySubaccountOrderMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrderMetadataResponse): QuerySubaccountOrderMetadataResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse", + value: QuerySubaccountOrderMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrderMetadataResponse.typeUrl, QuerySubaccountOrderMetadataResponse); +function createBaseQuerySubaccountTradeNonceResponse(): QuerySubaccountTradeNonceResponse { + return { + nonce: 0 + }; +} +export const QuerySubaccountTradeNonceResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse", + is(o: any): o is QuerySubaccountTradeNonceResponse { + return o && (o.$typeUrl === QuerySubaccountTradeNonceResponse.typeUrl || typeof o.nonce === "number"); + }, + isAmino(o: any): o is QuerySubaccountTradeNonceResponseAmino { + return o && (o.$typeUrl === QuerySubaccountTradeNonceResponse.typeUrl || typeof o.nonce === "number"); + }, + encode(message: QuerySubaccountTradeNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== 0) { + writer.uint32(8).uint32(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountTradeNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountTradeNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountTradeNonceResponse { + const message = createBaseQuerySubaccountTradeNonceResponse(); + message.nonce = object.nonce ?? 0; + return message; + }, + fromAmino(object: QuerySubaccountTradeNonceResponseAmino): QuerySubaccountTradeNonceResponse { + const message = createBaseQuerySubaccountTradeNonceResponse(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = object.nonce; + } + return message; + }, + toAmino(message: QuerySubaccountTradeNonceResponse): QuerySubaccountTradeNonceResponseAmino { + const obj: any = {}; + obj.nonce = message.nonce === 0 ? undefined : message.nonce; + return obj; + }, + fromAminoMsg(object: QuerySubaccountTradeNonceResponseAminoMsg): QuerySubaccountTradeNonceResponse { + return QuerySubaccountTradeNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountTradeNonceResponseProtoMsg): QuerySubaccountTradeNonceResponse { + return QuerySubaccountTradeNonceResponse.decode(message.value); + }, + toProto(message: QuerySubaccountTradeNonceResponse): Uint8Array { + return QuerySubaccountTradeNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountTradeNonceResponse): QuerySubaccountTradeNonceResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse", + value: QuerySubaccountTradeNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountTradeNonceResponse.typeUrl, QuerySubaccountTradeNonceResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryPositionsRequest(): QueryPositionsRequest { + return {}; +} +export const QueryPositionsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest", + is(o: any): o is QueryPositionsRequest { + return o && o.$typeUrl === QueryPositionsRequest.typeUrl; + }, + isAmino(o: any): o is QueryPositionsRequestAmino { + return o && o.$typeUrl === QueryPositionsRequest.typeUrl; + }, + encode(_: QueryPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPositionsRequest { + const message = createBaseQueryPositionsRequest(); + return message; + }, + fromAmino(_: QueryPositionsRequestAmino): QueryPositionsRequest { + const message = createBaseQueryPositionsRequest(); + return message; + }, + toAmino(_: QueryPositionsRequest): QueryPositionsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPositionsRequestAminoMsg): QueryPositionsRequest { + return QueryPositionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPositionsRequestProtoMsg): QueryPositionsRequest { + return QueryPositionsRequest.decode(message.value); + }, + toProto(message: QueryPositionsRequest): Uint8Array { + return QueryPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionsRequest): QueryPositionsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest", + value: QueryPositionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPositionsRequest.typeUrl, QueryPositionsRequest); +function createBaseQueryPositionsResponse(): QueryPositionsResponse { + return { + state: [] + }; +} +export const QueryPositionsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse", + is(o: any): o is QueryPositionsResponse { + return o && (o.$typeUrl === QueryPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.is(o.state[0]))); + }, + isAmino(o: any): o is QueryPositionsResponseAmino { + return o && (o.$typeUrl === QueryPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.isAmino(o.state[0]))); + }, + encode(message: QueryPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.state) { + DerivativePosition.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state.push(DerivativePosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPositionsResponse { + const message = createBaseQueryPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPositionsResponseAmino): QueryPositionsResponse { + const message = createBaseQueryPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPositionsResponse): QueryPositionsResponseAmino { + const obj: any = {}; + if (message.state) { + obj.state = message.state.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.state = message.state; + } + return obj; + }, + fromAminoMsg(object: QueryPositionsResponseAminoMsg): QueryPositionsResponse { + return QueryPositionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPositionsResponseProtoMsg): QueryPositionsResponse { + return QueryPositionsResponse.decode(message.value); + }, + toProto(message: QueryPositionsResponse): Uint8Array { + return QueryPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionsResponse): QueryPositionsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse", + value: QueryPositionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPositionsResponse.typeUrl, QueryPositionsResponse); +function createBaseQueryTradeRewardPointsRequest(): QueryTradeRewardPointsRequest { + return { + accounts: [], + pendingPoolTimestamp: BigInt(0) + }; +} +export const QueryTradeRewardPointsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest", + is(o: any): o is QueryTradeRewardPointsRequest { + return o && (o.$typeUrl === QueryTradeRewardPointsRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && typeof o.pendingPoolTimestamp === "bigint"); + }, + isAmino(o: any): o is QueryTradeRewardPointsRequestAmino { + return o && (o.$typeUrl === QueryTradeRewardPointsRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && typeof o.pending_pool_timestamp === "bigint"); + }, + encode(message: QueryTradeRewardPointsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + if (message.pendingPoolTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.pendingPoolTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardPointsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardPointsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + case 2: + message.pendingPoolTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardPointsRequest { + const message = createBaseQueryTradeRewardPointsRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.pendingPoolTimestamp = object.pendingPoolTimestamp !== undefined && object.pendingPoolTimestamp !== null ? BigInt(object.pendingPoolTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTradeRewardPointsRequestAmino): QueryTradeRewardPointsRequest { + const message = createBaseQueryTradeRewardPointsRequest(); + message.accounts = object.accounts?.map(e => e) || []; + if (object.pending_pool_timestamp !== undefined && object.pending_pool_timestamp !== null) { + message.pendingPoolTimestamp = BigInt(object.pending_pool_timestamp); + } + return message; + }, + toAmino(message: QueryTradeRewardPointsRequest): QueryTradeRewardPointsRequestAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + obj.pending_pool_timestamp = message.pendingPoolTimestamp !== BigInt(0) ? message.pendingPoolTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTradeRewardPointsRequestAminoMsg): QueryTradeRewardPointsRequest { + return QueryTradeRewardPointsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardPointsRequestProtoMsg): QueryTradeRewardPointsRequest { + return QueryTradeRewardPointsRequest.decode(message.value); + }, + toProto(message: QueryTradeRewardPointsRequest): Uint8Array { + return QueryTradeRewardPointsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardPointsRequest): QueryTradeRewardPointsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest", + value: QueryTradeRewardPointsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardPointsRequest.typeUrl, QueryTradeRewardPointsRequest); +function createBaseQueryTradeRewardPointsResponse(): QueryTradeRewardPointsResponse { + return { + accountTradeRewardPoints: [] + }; +} +export const QueryTradeRewardPointsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse", + is(o: any): o is QueryTradeRewardPointsResponse { + return o && (o.$typeUrl === QueryTradeRewardPointsResponse.typeUrl || Array.isArray(o.accountTradeRewardPoints) && (!o.accountTradeRewardPoints.length || typeof o.accountTradeRewardPoints[0] === "string")); + }, + isAmino(o: any): o is QueryTradeRewardPointsResponseAmino { + return o && (o.$typeUrl === QueryTradeRewardPointsResponse.typeUrl || Array.isArray(o.account_trade_reward_points) && (!o.account_trade_reward_points.length || typeof o.account_trade_reward_points[0] === "string")); + }, + encode(message: QueryTradeRewardPointsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountTradeRewardPoints) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardPointsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardPointsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountTradeRewardPoints.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardPointsResponse { + const message = createBaseQueryTradeRewardPointsResponse(); + message.accountTradeRewardPoints = object.accountTradeRewardPoints?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryTradeRewardPointsResponseAmino): QueryTradeRewardPointsResponse { + const message = createBaseQueryTradeRewardPointsResponse(); + message.accountTradeRewardPoints = object.account_trade_reward_points?.map(e => e) || []; + return message; + }, + toAmino(message: QueryTradeRewardPointsResponse): QueryTradeRewardPointsResponseAmino { + const obj: any = {}; + if (message.accountTradeRewardPoints) { + obj.account_trade_reward_points = message.accountTradeRewardPoints.map(e => e); + } else { + obj.account_trade_reward_points = message.accountTradeRewardPoints; + } + return obj; + }, + fromAminoMsg(object: QueryTradeRewardPointsResponseAminoMsg): QueryTradeRewardPointsResponse { + return QueryTradeRewardPointsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardPointsResponseProtoMsg): QueryTradeRewardPointsResponse { + return QueryTradeRewardPointsResponse.decode(message.value); + }, + toProto(message: QueryTradeRewardPointsResponse): Uint8Array { + return QueryTradeRewardPointsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardPointsResponse): QueryTradeRewardPointsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse", + value: QueryTradeRewardPointsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardPointsResponse.typeUrl, QueryTradeRewardPointsResponse); +function createBaseQueryTradeRewardCampaignRequest(): QueryTradeRewardCampaignRequest { + return {}; +} +export const QueryTradeRewardCampaignRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest", + is(o: any): o is QueryTradeRewardCampaignRequest { + return o && o.$typeUrl === QueryTradeRewardCampaignRequest.typeUrl; + }, + isAmino(o: any): o is QueryTradeRewardCampaignRequestAmino { + return o && o.$typeUrl === QueryTradeRewardCampaignRequest.typeUrl; + }, + encode(_: QueryTradeRewardCampaignRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardCampaignRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardCampaignRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryTradeRewardCampaignRequest { + const message = createBaseQueryTradeRewardCampaignRequest(); + return message; + }, + fromAmino(_: QueryTradeRewardCampaignRequestAmino): QueryTradeRewardCampaignRequest { + const message = createBaseQueryTradeRewardCampaignRequest(); + return message; + }, + toAmino(_: QueryTradeRewardCampaignRequest): QueryTradeRewardCampaignRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryTradeRewardCampaignRequestAminoMsg): QueryTradeRewardCampaignRequest { + return QueryTradeRewardCampaignRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardCampaignRequestProtoMsg): QueryTradeRewardCampaignRequest { + return QueryTradeRewardCampaignRequest.decode(message.value); + }, + toProto(message: QueryTradeRewardCampaignRequest): Uint8Array { + return QueryTradeRewardCampaignRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardCampaignRequest): QueryTradeRewardCampaignRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest", + value: QueryTradeRewardCampaignRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardCampaignRequest.typeUrl, QueryTradeRewardCampaignRequest); +function createBaseQueryTradeRewardCampaignResponse(): QueryTradeRewardCampaignResponse { + return { + tradingRewardCampaignInfo: undefined, + tradingRewardPoolCampaignSchedule: [], + totalTradeRewardPoints: "", + pendingTradingRewardPoolCampaignSchedule: [], + pendingTotalTradeRewardPoints: [] + }; +} +export const QueryTradeRewardCampaignResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse", + is(o: any): o is QueryTradeRewardCampaignResponse { + return o && (o.$typeUrl === QueryTradeRewardCampaignResponse.typeUrl || Array.isArray(o.tradingRewardPoolCampaignSchedule) && (!o.tradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.tradingRewardPoolCampaignSchedule[0])) && typeof o.totalTradeRewardPoints === "string" && Array.isArray(o.pendingTradingRewardPoolCampaignSchedule) && (!o.pendingTradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.pendingTradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.pendingTotalTradeRewardPoints) && (!o.pendingTotalTradeRewardPoints.length || typeof o.pendingTotalTradeRewardPoints[0] === "string")); + }, + isAmino(o: any): o is QueryTradeRewardCampaignResponseAmino { + return o && (o.$typeUrl === QueryTradeRewardCampaignResponse.typeUrl || Array.isArray(o.trading_reward_pool_campaign_schedule) && (!o.trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.trading_reward_pool_campaign_schedule[0])) && typeof o.total_trade_reward_points === "string" && Array.isArray(o.pending_trading_reward_pool_campaign_schedule) && (!o.pending_trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.pending_trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.pending_total_trade_reward_points) && (!o.pending_total_trade_reward_points.length || typeof o.pending_total_trade_reward_points[0] === "string")); + }, + encode(message: QueryTradeRewardCampaignResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tradingRewardCampaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.tradingRewardCampaignInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.tradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.totalTradeRewardPoints !== "") { + writer.uint32(26).string(message.totalTradeRewardPoints); + } + for (const v of message.pendingTradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.pendingTotalTradeRewardPoints) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardCampaignResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardCampaignResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 2: + message.tradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 3: + message.totalTradeRewardPoints = reader.string(); + break; + case 4: + message.pendingTradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 5: + message.pendingTotalTradeRewardPoints.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardCampaignResponse { + const message = createBaseQueryTradeRewardCampaignResponse(); + message.tradingRewardCampaignInfo = object.tradingRewardCampaignInfo !== undefined && object.tradingRewardCampaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.tradingRewardCampaignInfo) : undefined; + message.tradingRewardPoolCampaignSchedule = object.tradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.totalTradeRewardPoints = object.totalTradeRewardPoints ?? ""; + message.pendingTradingRewardPoolCampaignSchedule = object.pendingTradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.pendingTotalTradeRewardPoints = object.pendingTotalTradeRewardPoints?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryTradeRewardCampaignResponseAmino): QueryTradeRewardCampaignResponse { + const message = createBaseQueryTradeRewardCampaignResponse(); + if (object.trading_reward_campaign_info !== undefined && object.trading_reward_campaign_info !== null) { + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.fromAmino(object.trading_reward_campaign_info); + } + message.tradingRewardPoolCampaignSchedule = object.trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + if (object.total_trade_reward_points !== undefined && object.total_trade_reward_points !== null) { + message.totalTradeRewardPoints = object.total_trade_reward_points; + } + message.pendingTradingRewardPoolCampaignSchedule = object.pending_trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.pendingTotalTradeRewardPoints = object.pending_total_trade_reward_points?.map(e => e) || []; + return message; + }, + toAmino(message: QueryTradeRewardCampaignResponse): QueryTradeRewardCampaignResponseAmino { + const obj: any = {}; + obj.trading_reward_campaign_info = message.tradingRewardCampaignInfo ? TradingRewardCampaignInfo.toAmino(message.tradingRewardCampaignInfo) : undefined; + if (message.tradingRewardPoolCampaignSchedule) { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule; + } + obj.total_trade_reward_points = message.totalTradeRewardPoints === "" ? undefined : message.totalTradeRewardPoints; + if (message.pendingTradingRewardPoolCampaignSchedule) { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule; + } + if (message.pendingTotalTradeRewardPoints) { + obj.pending_total_trade_reward_points = message.pendingTotalTradeRewardPoints.map(e => e); + } else { + obj.pending_total_trade_reward_points = message.pendingTotalTradeRewardPoints; + } + return obj; + }, + fromAminoMsg(object: QueryTradeRewardCampaignResponseAminoMsg): QueryTradeRewardCampaignResponse { + return QueryTradeRewardCampaignResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardCampaignResponseProtoMsg): QueryTradeRewardCampaignResponse { + return QueryTradeRewardCampaignResponse.decode(message.value); + }, + toProto(message: QueryTradeRewardCampaignResponse): Uint8Array { + return QueryTradeRewardCampaignResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardCampaignResponse): QueryTradeRewardCampaignResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse", + value: QueryTradeRewardCampaignResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardCampaignResponse.typeUrl, QueryTradeRewardCampaignResponse); +function createBaseQueryIsOptedOutOfRewardsRequest(): QueryIsOptedOutOfRewardsRequest { + return { + account: "" + }; +} +export const QueryIsOptedOutOfRewardsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest", + is(o: any): o is QueryIsOptedOutOfRewardsRequest { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryIsOptedOutOfRewardsRequestAmino { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryIsOptedOutOfRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsOptedOutOfRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryIsOptedOutOfRewardsRequest { + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryIsOptedOutOfRewardsRequestAmino): QueryIsOptedOutOfRewardsRequest { + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryIsOptedOutOfRewardsRequest): QueryIsOptedOutOfRewardsRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryIsOptedOutOfRewardsRequestAminoMsg): QueryIsOptedOutOfRewardsRequest { + return QueryIsOptedOutOfRewardsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsOptedOutOfRewardsRequestProtoMsg): QueryIsOptedOutOfRewardsRequest { + return QueryIsOptedOutOfRewardsRequest.decode(message.value); + }, + toProto(message: QueryIsOptedOutOfRewardsRequest): Uint8Array { + return QueryIsOptedOutOfRewardsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIsOptedOutOfRewardsRequest): QueryIsOptedOutOfRewardsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest", + value: QueryIsOptedOutOfRewardsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryIsOptedOutOfRewardsRequest.typeUrl, QueryIsOptedOutOfRewardsRequest); +function createBaseQueryIsOptedOutOfRewardsResponse(): QueryIsOptedOutOfRewardsResponse { + return { + isOptedOut: false + }; +} +export const QueryIsOptedOutOfRewardsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse", + is(o: any): o is QueryIsOptedOutOfRewardsResponse { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsResponse.typeUrl || typeof o.isOptedOut === "boolean"); + }, + isAmino(o: any): o is QueryIsOptedOutOfRewardsResponseAmino { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsResponse.typeUrl || typeof o.is_opted_out === "boolean"); + }, + encode(message: QueryIsOptedOutOfRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isOptedOut === true) { + writer.uint32(8).bool(message.isOptedOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsOptedOutOfRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isOptedOut = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryIsOptedOutOfRewardsResponse { + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + message.isOptedOut = object.isOptedOut ?? false; + return message; + }, + fromAmino(object: QueryIsOptedOutOfRewardsResponseAmino): QueryIsOptedOutOfRewardsResponse { + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + if (object.is_opted_out !== undefined && object.is_opted_out !== null) { + message.isOptedOut = object.is_opted_out; + } + return message; + }, + toAmino(message: QueryIsOptedOutOfRewardsResponse): QueryIsOptedOutOfRewardsResponseAmino { + const obj: any = {}; + obj.is_opted_out = message.isOptedOut === false ? undefined : message.isOptedOut; + return obj; + }, + fromAminoMsg(object: QueryIsOptedOutOfRewardsResponseAminoMsg): QueryIsOptedOutOfRewardsResponse { + return QueryIsOptedOutOfRewardsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsOptedOutOfRewardsResponseProtoMsg): QueryIsOptedOutOfRewardsResponse { + return QueryIsOptedOutOfRewardsResponse.decode(message.value); + }, + toProto(message: QueryIsOptedOutOfRewardsResponse): Uint8Array { + return QueryIsOptedOutOfRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryIsOptedOutOfRewardsResponse): QueryIsOptedOutOfRewardsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse", + value: QueryIsOptedOutOfRewardsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryIsOptedOutOfRewardsResponse.typeUrl, QueryIsOptedOutOfRewardsResponse); +function createBaseQueryOptedOutOfRewardsAccountsRequest(): QueryOptedOutOfRewardsAccountsRequest { + return {}; +} +export const QueryOptedOutOfRewardsAccountsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest", + is(o: any): o is QueryOptedOutOfRewardsAccountsRequest { + return o && o.$typeUrl === QueryOptedOutOfRewardsAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryOptedOutOfRewardsAccountsRequestAmino { + return o && o.$typeUrl === QueryOptedOutOfRewardsAccountsRequest.typeUrl; + }, + encode(_: QueryOptedOutOfRewardsAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOptedOutOfRewardsAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOptedOutOfRewardsAccountsRequest { + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + return message; + }, + fromAmino(_: QueryOptedOutOfRewardsAccountsRequestAmino): QueryOptedOutOfRewardsAccountsRequest { + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + return message; + }, + toAmino(_: QueryOptedOutOfRewardsAccountsRequest): QueryOptedOutOfRewardsAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOptedOutOfRewardsAccountsRequestAminoMsg): QueryOptedOutOfRewardsAccountsRequest { + return QueryOptedOutOfRewardsAccountsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOptedOutOfRewardsAccountsRequestProtoMsg): QueryOptedOutOfRewardsAccountsRequest { + return QueryOptedOutOfRewardsAccountsRequest.decode(message.value); + }, + toProto(message: QueryOptedOutOfRewardsAccountsRequest): Uint8Array { + return QueryOptedOutOfRewardsAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOptedOutOfRewardsAccountsRequest): QueryOptedOutOfRewardsAccountsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest", + value: QueryOptedOutOfRewardsAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOptedOutOfRewardsAccountsRequest.typeUrl, QueryOptedOutOfRewardsAccountsRequest); +function createBaseQueryOptedOutOfRewardsAccountsResponse(): QueryOptedOutOfRewardsAccountsResponse { + return { + accounts: [] + }; +} +export const QueryOptedOutOfRewardsAccountsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse", + is(o: any): o is QueryOptedOutOfRewardsAccountsResponse { + return o && (o.$typeUrl === QueryOptedOutOfRewardsAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + isAmino(o: any): o is QueryOptedOutOfRewardsAccountsResponseAmino { + return o && (o.$typeUrl === QueryOptedOutOfRewardsAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + encode(message: QueryOptedOutOfRewardsAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOptedOutOfRewardsAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOptedOutOfRewardsAccountsResponse { + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryOptedOutOfRewardsAccountsResponseAmino): QueryOptedOutOfRewardsAccountsResponse { + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + toAmino(message: QueryOptedOutOfRewardsAccountsResponse): QueryOptedOutOfRewardsAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: QueryOptedOutOfRewardsAccountsResponseAminoMsg): QueryOptedOutOfRewardsAccountsResponse { + return QueryOptedOutOfRewardsAccountsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOptedOutOfRewardsAccountsResponseProtoMsg): QueryOptedOutOfRewardsAccountsResponse { + return QueryOptedOutOfRewardsAccountsResponse.decode(message.value); + }, + toProto(message: QueryOptedOutOfRewardsAccountsResponse): Uint8Array { + return QueryOptedOutOfRewardsAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOptedOutOfRewardsAccountsResponse): QueryOptedOutOfRewardsAccountsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse", + value: QueryOptedOutOfRewardsAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOptedOutOfRewardsAccountsResponse.typeUrl, QueryOptedOutOfRewardsAccountsResponse); +function createBaseQueryFeeDiscountAccountInfoRequest(): QueryFeeDiscountAccountInfoRequest { + return { + account: "" + }; +} +export const QueryFeeDiscountAccountInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest", + is(o: any): o is QueryFeeDiscountAccountInfoRequest { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryFeeDiscountAccountInfoRequestAmino { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryFeeDiscountAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountAccountInfoRequest { + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryFeeDiscountAccountInfoRequestAmino): QueryFeeDiscountAccountInfoRequest { + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryFeeDiscountAccountInfoRequest): QueryFeeDiscountAccountInfoRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountAccountInfoRequestAminoMsg): QueryFeeDiscountAccountInfoRequest { + return QueryFeeDiscountAccountInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountAccountInfoRequestProtoMsg): QueryFeeDiscountAccountInfoRequest { + return QueryFeeDiscountAccountInfoRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountAccountInfoRequest): Uint8Array { + return QueryFeeDiscountAccountInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountAccountInfoRequest): QueryFeeDiscountAccountInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest", + value: QueryFeeDiscountAccountInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountAccountInfoRequest.typeUrl, QueryFeeDiscountAccountInfoRequest); +function createBaseQueryFeeDiscountAccountInfoResponse(): QueryFeeDiscountAccountInfoResponse { + return { + tierLevel: BigInt(0), + accountInfo: undefined, + accountTtl: undefined + }; +} +export const QueryFeeDiscountAccountInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse", + is(o: any): o is QueryFeeDiscountAccountInfoResponse { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoResponse.typeUrl || typeof o.tierLevel === "bigint"); + }, + isAmino(o: any): o is QueryFeeDiscountAccountInfoResponseAmino { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoResponse.typeUrl || typeof o.tier_level === "bigint"); + }, + encode(message: QueryFeeDiscountAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tierLevel !== BigInt(0)) { + writer.uint32(8).uint64(message.tierLevel); + } + if (message.accountInfo !== undefined) { + FeeDiscountTierInfo.encode(message.accountInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.accountTtl !== undefined) { + FeeDiscountTierTTL.encode(message.accountTtl, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tierLevel = reader.uint64(); + break; + case 2: + message.accountInfo = FeeDiscountTierInfo.decode(reader, reader.uint32()); + break; + case 3: + message.accountTtl = FeeDiscountTierTTL.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountAccountInfoResponse { + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + message.tierLevel = object.tierLevel !== undefined && object.tierLevel !== null ? BigInt(object.tierLevel.toString()) : BigInt(0); + message.accountInfo = object.accountInfo !== undefined && object.accountInfo !== null ? FeeDiscountTierInfo.fromPartial(object.accountInfo) : undefined; + message.accountTtl = object.accountTtl !== undefined && object.accountTtl !== null ? FeeDiscountTierTTL.fromPartial(object.accountTtl) : undefined; + return message; + }, + fromAmino(object: QueryFeeDiscountAccountInfoResponseAmino): QueryFeeDiscountAccountInfoResponse { + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + if (object.tier_level !== undefined && object.tier_level !== null) { + message.tierLevel = BigInt(object.tier_level); + } + if (object.account_info !== undefined && object.account_info !== null) { + message.accountInfo = FeeDiscountTierInfo.fromAmino(object.account_info); + } + if (object.account_ttl !== undefined && object.account_ttl !== null) { + message.accountTtl = FeeDiscountTierTTL.fromAmino(object.account_ttl); + } + return message; + }, + toAmino(message: QueryFeeDiscountAccountInfoResponse): QueryFeeDiscountAccountInfoResponseAmino { + const obj: any = {}; + obj.tier_level = message.tierLevel !== BigInt(0) ? message.tierLevel?.toString() : undefined; + obj.account_info = message.accountInfo ? FeeDiscountTierInfo.toAmino(message.accountInfo) : undefined; + obj.account_ttl = message.accountTtl ? FeeDiscountTierTTL.toAmino(message.accountTtl) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountAccountInfoResponseAminoMsg): QueryFeeDiscountAccountInfoResponse { + return QueryFeeDiscountAccountInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountAccountInfoResponseProtoMsg): QueryFeeDiscountAccountInfoResponse { + return QueryFeeDiscountAccountInfoResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountAccountInfoResponse): Uint8Array { + return QueryFeeDiscountAccountInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountAccountInfoResponse): QueryFeeDiscountAccountInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse", + value: QueryFeeDiscountAccountInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountAccountInfoResponse.typeUrl, QueryFeeDiscountAccountInfoResponse); +function createBaseQueryFeeDiscountScheduleRequest(): QueryFeeDiscountScheduleRequest { + return {}; +} +export const QueryFeeDiscountScheduleRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest", + is(o: any): o is QueryFeeDiscountScheduleRequest { + return o && o.$typeUrl === QueryFeeDiscountScheduleRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountScheduleRequestAmino { + return o && o.$typeUrl === QueryFeeDiscountScheduleRequest.typeUrl; + }, + encode(_: QueryFeeDiscountScheduleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountScheduleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountScheduleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryFeeDiscountScheduleRequest { + const message = createBaseQueryFeeDiscountScheduleRequest(); + return message; + }, + fromAmino(_: QueryFeeDiscountScheduleRequestAmino): QueryFeeDiscountScheduleRequest { + const message = createBaseQueryFeeDiscountScheduleRequest(); + return message; + }, + toAmino(_: QueryFeeDiscountScheduleRequest): QueryFeeDiscountScheduleRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountScheduleRequestAminoMsg): QueryFeeDiscountScheduleRequest { + return QueryFeeDiscountScheduleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountScheduleRequestProtoMsg): QueryFeeDiscountScheduleRequest { + return QueryFeeDiscountScheduleRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountScheduleRequest): Uint8Array { + return QueryFeeDiscountScheduleRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountScheduleRequest): QueryFeeDiscountScheduleRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest", + value: QueryFeeDiscountScheduleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountScheduleRequest.typeUrl, QueryFeeDiscountScheduleRequest); +function createBaseQueryFeeDiscountScheduleResponse(): QueryFeeDiscountScheduleResponse { + return { + feeDiscountSchedule: undefined + }; +} +export const QueryFeeDiscountScheduleResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse", + is(o: any): o is QueryFeeDiscountScheduleResponse { + return o && o.$typeUrl === QueryFeeDiscountScheduleResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountScheduleResponseAmino { + return o && o.$typeUrl === QueryFeeDiscountScheduleResponse.typeUrl; + }, + encode(message: QueryFeeDiscountScheduleResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feeDiscountSchedule !== undefined) { + FeeDiscountSchedule.encode(message.feeDiscountSchedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountScheduleResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountScheduleResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feeDiscountSchedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountScheduleResponse { + const message = createBaseQueryFeeDiscountScheduleResponse(); + message.feeDiscountSchedule = object.feeDiscountSchedule !== undefined && object.feeDiscountSchedule !== null ? FeeDiscountSchedule.fromPartial(object.feeDiscountSchedule) : undefined; + return message; + }, + fromAmino(object: QueryFeeDiscountScheduleResponseAmino): QueryFeeDiscountScheduleResponse { + const message = createBaseQueryFeeDiscountScheduleResponse(); + if (object.fee_discount_schedule !== undefined && object.fee_discount_schedule !== null) { + message.feeDiscountSchedule = FeeDiscountSchedule.fromAmino(object.fee_discount_schedule); + } + return message; + }, + toAmino(message: QueryFeeDiscountScheduleResponse): QueryFeeDiscountScheduleResponseAmino { + const obj: any = {}; + obj.fee_discount_schedule = message.feeDiscountSchedule ? FeeDiscountSchedule.toAmino(message.feeDiscountSchedule) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountScheduleResponseAminoMsg): QueryFeeDiscountScheduleResponse { + return QueryFeeDiscountScheduleResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountScheduleResponseProtoMsg): QueryFeeDiscountScheduleResponse { + return QueryFeeDiscountScheduleResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountScheduleResponse): Uint8Array { + return QueryFeeDiscountScheduleResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountScheduleResponse): QueryFeeDiscountScheduleResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse", + value: QueryFeeDiscountScheduleResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountScheduleResponse.typeUrl, QueryFeeDiscountScheduleResponse); +function createBaseQueryBalanceMismatchesRequest(): QueryBalanceMismatchesRequest { + return { + dustFactor: BigInt(0) + }; +} +export const QueryBalanceMismatchesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest", + is(o: any): o is QueryBalanceMismatchesRequest { + return o && (o.$typeUrl === QueryBalanceMismatchesRequest.typeUrl || typeof o.dustFactor === "bigint"); + }, + isAmino(o: any): o is QueryBalanceMismatchesRequestAmino { + return o && (o.$typeUrl === QueryBalanceMismatchesRequest.typeUrl || typeof o.dust_factor === "bigint"); + }, + encode(message: QueryBalanceMismatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.dustFactor !== BigInt(0)) { + writer.uint32(8).int64(message.dustFactor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceMismatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceMismatchesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dustFactor = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceMismatchesRequest { + const message = createBaseQueryBalanceMismatchesRequest(); + message.dustFactor = object.dustFactor !== undefined && object.dustFactor !== null ? BigInt(object.dustFactor.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryBalanceMismatchesRequestAmino): QueryBalanceMismatchesRequest { + const message = createBaseQueryBalanceMismatchesRequest(); + if (object.dust_factor !== undefined && object.dust_factor !== null) { + message.dustFactor = BigInt(object.dust_factor); + } + return message; + }, + toAmino(message: QueryBalanceMismatchesRequest): QueryBalanceMismatchesRequestAmino { + const obj: any = {}; + obj.dust_factor = message.dustFactor !== BigInt(0) ? message.dustFactor?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryBalanceMismatchesRequestAminoMsg): QueryBalanceMismatchesRequest { + return QueryBalanceMismatchesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceMismatchesRequestProtoMsg): QueryBalanceMismatchesRequest { + return QueryBalanceMismatchesRequest.decode(message.value); + }, + toProto(message: QueryBalanceMismatchesRequest): Uint8Array { + return QueryBalanceMismatchesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceMismatchesRequest): QueryBalanceMismatchesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest", + value: QueryBalanceMismatchesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceMismatchesRequest.typeUrl, QueryBalanceMismatchesRequest); +function createBaseBalanceMismatch(): BalanceMismatch { + return { + subaccountId: "", + denom: "", + available: "", + total: "", + balanceHold: "", + expectedTotal: "", + difference: "" + }; +} +export const BalanceMismatch = { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch", + is(o: any): o is BalanceMismatch { + return o && (o.$typeUrl === BalanceMismatch.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balanceHold === "string" && typeof o.expectedTotal === "string" && typeof o.difference === "string"); + }, + isAmino(o: any): o is BalanceMismatchAmino { + return o && (o.$typeUrl === BalanceMismatch.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balance_hold === "string" && typeof o.expected_total === "string" && typeof o.difference === "string"); + }, + encode(message: BalanceMismatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.available !== "") { + writer.uint32(26).string(message.available); + } + if (message.total !== "") { + writer.uint32(34).string(message.total); + } + if (message.balanceHold !== "") { + writer.uint32(42).string(message.balanceHold); + } + if (message.expectedTotal !== "") { + writer.uint32(50).string(message.expectedTotal); + } + if (message.difference !== "") { + writer.uint32(58).string(message.difference); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalanceMismatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalanceMismatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.available = reader.string(); + break; + case 4: + message.total = reader.string(); + break; + case 5: + message.balanceHold = reader.string(); + break; + case 6: + message.expectedTotal = reader.string(); + break; + case 7: + message.difference = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BalanceMismatch { + const message = createBaseBalanceMismatch(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.available = object.available ?? ""; + message.total = object.total ?? ""; + message.balanceHold = object.balanceHold ?? ""; + message.expectedTotal = object.expectedTotal ?? ""; + message.difference = object.difference ?? ""; + return message; + }, + fromAmino(object: BalanceMismatchAmino): BalanceMismatch { + const message = createBaseBalanceMismatch(); + if (object.subaccountId !== undefined && object.subaccountId !== null) { + message.subaccountId = object.subaccountId; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.available !== undefined && object.available !== null) { + message.available = object.available; + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + if (object.expected_total !== undefined && object.expected_total !== null) { + message.expectedTotal = object.expected_total; + } + if (object.difference !== undefined && object.difference !== null) { + message.difference = object.difference; + } + return message; + }, + toAmino(message: BalanceMismatch): BalanceMismatchAmino { + const obj: any = {}; + obj.subaccountId = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.available = message.available === "" ? undefined : message.available; + obj.total = message.total === "" ? undefined : message.total; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + obj.expected_total = message.expectedTotal === "" ? undefined : message.expectedTotal; + obj.difference = message.difference === "" ? undefined : message.difference; + return obj; + }, + fromAminoMsg(object: BalanceMismatchAminoMsg): BalanceMismatch { + return BalanceMismatch.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceMismatchProtoMsg): BalanceMismatch { + return BalanceMismatch.decode(message.value); + }, + toProto(message: BalanceMismatch): Uint8Array { + return BalanceMismatch.encode(message).finish(); + }, + toProtoMsg(message: BalanceMismatch): BalanceMismatchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch", + value: BalanceMismatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BalanceMismatch.typeUrl, BalanceMismatch); +function createBaseQueryBalanceMismatchesResponse(): QueryBalanceMismatchesResponse { + return { + balanceMismatches: [] + }; +} +export const QueryBalanceMismatchesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse", + is(o: any): o is QueryBalanceMismatchesResponse { + return o && (o.$typeUrl === QueryBalanceMismatchesResponse.typeUrl || Array.isArray(o.balanceMismatches) && (!o.balanceMismatches.length || BalanceMismatch.is(o.balanceMismatches[0]))); + }, + isAmino(o: any): o is QueryBalanceMismatchesResponseAmino { + return o && (o.$typeUrl === QueryBalanceMismatchesResponse.typeUrl || Array.isArray(o.balance_mismatches) && (!o.balance_mismatches.length || BalanceMismatch.isAmino(o.balance_mismatches[0]))); + }, + encode(message: QueryBalanceMismatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balanceMismatches) { + BalanceMismatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceMismatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceMismatchesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceMismatches.push(BalanceMismatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceMismatchesResponse { + const message = createBaseQueryBalanceMismatchesResponse(); + message.balanceMismatches = object.balanceMismatches?.map(e => BalanceMismatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBalanceMismatchesResponseAmino): QueryBalanceMismatchesResponse { + const message = createBaseQueryBalanceMismatchesResponse(); + message.balanceMismatches = object.balance_mismatches?.map(e => BalanceMismatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBalanceMismatchesResponse): QueryBalanceMismatchesResponseAmino { + const obj: any = {}; + if (message.balanceMismatches) { + obj.balance_mismatches = message.balanceMismatches.map(e => e ? BalanceMismatch.toAmino(e) : undefined); + } else { + obj.balance_mismatches = message.balanceMismatches; + } + return obj; + }, + fromAminoMsg(object: QueryBalanceMismatchesResponseAminoMsg): QueryBalanceMismatchesResponse { + return QueryBalanceMismatchesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceMismatchesResponseProtoMsg): QueryBalanceMismatchesResponse { + return QueryBalanceMismatchesResponse.decode(message.value); + }, + toProto(message: QueryBalanceMismatchesResponse): Uint8Array { + return QueryBalanceMismatchesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceMismatchesResponse): QueryBalanceMismatchesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse", + value: QueryBalanceMismatchesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceMismatchesResponse.typeUrl, QueryBalanceMismatchesResponse); +function createBaseQueryBalanceWithBalanceHoldsRequest(): QueryBalanceWithBalanceHoldsRequest { + return {}; +} +export const QueryBalanceWithBalanceHoldsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest", + is(o: any): o is QueryBalanceWithBalanceHoldsRequest { + return o && o.$typeUrl === QueryBalanceWithBalanceHoldsRequest.typeUrl; + }, + isAmino(o: any): o is QueryBalanceWithBalanceHoldsRequestAmino { + return o && o.$typeUrl === QueryBalanceWithBalanceHoldsRequest.typeUrl; + }, + encode(_: QueryBalanceWithBalanceHoldsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceWithBalanceHoldsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBalanceWithBalanceHoldsRequest { + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + return message; + }, + fromAmino(_: QueryBalanceWithBalanceHoldsRequestAmino): QueryBalanceWithBalanceHoldsRequest { + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + return message; + }, + toAmino(_: QueryBalanceWithBalanceHoldsRequest): QueryBalanceWithBalanceHoldsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBalanceWithBalanceHoldsRequestAminoMsg): QueryBalanceWithBalanceHoldsRequest { + return QueryBalanceWithBalanceHoldsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceWithBalanceHoldsRequestProtoMsg): QueryBalanceWithBalanceHoldsRequest { + return QueryBalanceWithBalanceHoldsRequest.decode(message.value); + }, + toProto(message: QueryBalanceWithBalanceHoldsRequest): Uint8Array { + return QueryBalanceWithBalanceHoldsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceWithBalanceHoldsRequest): QueryBalanceWithBalanceHoldsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest", + value: QueryBalanceWithBalanceHoldsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceWithBalanceHoldsRequest.typeUrl, QueryBalanceWithBalanceHoldsRequest); +function createBaseBalanceWithMarginHold(): BalanceWithMarginHold { + return { + subaccountId: "", + denom: "", + available: "", + total: "", + balanceHold: "" + }; +} +export const BalanceWithMarginHold = { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold", + is(o: any): o is BalanceWithMarginHold { + return o && (o.$typeUrl === BalanceWithMarginHold.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balanceHold === "string"); + }, + isAmino(o: any): o is BalanceWithMarginHoldAmino { + return o && (o.$typeUrl === BalanceWithMarginHold.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balance_hold === "string"); + }, + encode(message: BalanceWithMarginHold, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.available !== "") { + writer.uint32(26).string(message.available); + } + if (message.total !== "") { + writer.uint32(34).string(message.total); + } + if (message.balanceHold !== "") { + writer.uint32(42).string(message.balanceHold); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalanceWithMarginHold { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalanceWithMarginHold(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.available = reader.string(); + break; + case 4: + message.total = reader.string(); + break; + case 5: + message.balanceHold = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BalanceWithMarginHold { + const message = createBaseBalanceWithMarginHold(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.available = object.available ?? ""; + message.total = object.total ?? ""; + message.balanceHold = object.balanceHold ?? ""; + return message; + }, + fromAmino(object: BalanceWithMarginHoldAmino): BalanceWithMarginHold { + const message = createBaseBalanceWithMarginHold(); + if (object.subaccountId !== undefined && object.subaccountId !== null) { + message.subaccountId = object.subaccountId; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.available !== undefined && object.available !== null) { + message.available = object.available; + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + return message; + }, + toAmino(message: BalanceWithMarginHold): BalanceWithMarginHoldAmino { + const obj: any = {}; + obj.subaccountId = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.available = message.available === "" ? undefined : message.available; + obj.total = message.total === "" ? undefined : message.total; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + return obj; + }, + fromAminoMsg(object: BalanceWithMarginHoldAminoMsg): BalanceWithMarginHold { + return BalanceWithMarginHold.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceWithMarginHoldProtoMsg): BalanceWithMarginHold { + return BalanceWithMarginHold.decode(message.value); + }, + toProto(message: BalanceWithMarginHold): Uint8Array { + return BalanceWithMarginHold.encode(message).finish(); + }, + toProtoMsg(message: BalanceWithMarginHold): BalanceWithMarginHoldProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold", + value: BalanceWithMarginHold.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BalanceWithMarginHold.typeUrl, BalanceWithMarginHold); +function createBaseQueryBalanceWithBalanceHoldsResponse(): QueryBalanceWithBalanceHoldsResponse { + return { + balanceWithBalanceHolds: [] + }; +} +export const QueryBalanceWithBalanceHoldsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse", + is(o: any): o is QueryBalanceWithBalanceHoldsResponse { + return o && (o.$typeUrl === QueryBalanceWithBalanceHoldsResponse.typeUrl || Array.isArray(o.balanceWithBalanceHolds) && (!o.balanceWithBalanceHolds.length || BalanceWithMarginHold.is(o.balanceWithBalanceHolds[0]))); + }, + isAmino(o: any): o is QueryBalanceWithBalanceHoldsResponseAmino { + return o && (o.$typeUrl === QueryBalanceWithBalanceHoldsResponse.typeUrl || Array.isArray(o.balance_with_balance_holds) && (!o.balance_with_balance_holds.length || BalanceWithMarginHold.isAmino(o.balance_with_balance_holds[0]))); + }, + encode(message: QueryBalanceWithBalanceHoldsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balanceWithBalanceHolds) { + BalanceWithMarginHold.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceWithBalanceHoldsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceWithBalanceHolds.push(BalanceWithMarginHold.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceWithBalanceHoldsResponse { + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + message.balanceWithBalanceHolds = object.balanceWithBalanceHolds?.map(e => BalanceWithMarginHold.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBalanceWithBalanceHoldsResponseAmino): QueryBalanceWithBalanceHoldsResponse { + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + message.balanceWithBalanceHolds = object.balance_with_balance_holds?.map(e => BalanceWithMarginHold.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBalanceWithBalanceHoldsResponse): QueryBalanceWithBalanceHoldsResponseAmino { + const obj: any = {}; + if (message.balanceWithBalanceHolds) { + obj.balance_with_balance_holds = message.balanceWithBalanceHolds.map(e => e ? BalanceWithMarginHold.toAmino(e) : undefined); + } else { + obj.balance_with_balance_holds = message.balanceWithBalanceHolds; + } + return obj; + }, + fromAminoMsg(object: QueryBalanceWithBalanceHoldsResponseAminoMsg): QueryBalanceWithBalanceHoldsResponse { + return QueryBalanceWithBalanceHoldsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceWithBalanceHoldsResponseProtoMsg): QueryBalanceWithBalanceHoldsResponse { + return QueryBalanceWithBalanceHoldsResponse.decode(message.value); + }, + toProto(message: QueryBalanceWithBalanceHoldsResponse): Uint8Array { + return QueryBalanceWithBalanceHoldsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceWithBalanceHoldsResponse): QueryBalanceWithBalanceHoldsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse", + value: QueryBalanceWithBalanceHoldsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceWithBalanceHoldsResponse.typeUrl, QueryBalanceWithBalanceHoldsResponse); +function createBaseQueryFeeDiscountTierStatisticsRequest(): QueryFeeDiscountTierStatisticsRequest { + return {}; +} +export const QueryFeeDiscountTierStatisticsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest", + is(o: any): o is QueryFeeDiscountTierStatisticsRequest { + return o && o.$typeUrl === QueryFeeDiscountTierStatisticsRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountTierStatisticsRequestAmino { + return o && o.$typeUrl === QueryFeeDiscountTierStatisticsRequest.typeUrl; + }, + encode(_: QueryFeeDiscountTierStatisticsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountTierStatisticsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryFeeDiscountTierStatisticsRequest { + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + return message; + }, + fromAmino(_: QueryFeeDiscountTierStatisticsRequestAmino): QueryFeeDiscountTierStatisticsRequest { + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + return message; + }, + toAmino(_: QueryFeeDiscountTierStatisticsRequest): QueryFeeDiscountTierStatisticsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountTierStatisticsRequestAminoMsg): QueryFeeDiscountTierStatisticsRequest { + return QueryFeeDiscountTierStatisticsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountTierStatisticsRequestProtoMsg): QueryFeeDiscountTierStatisticsRequest { + return QueryFeeDiscountTierStatisticsRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountTierStatisticsRequest): Uint8Array { + return QueryFeeDiscountTierStatisticsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountTierStatisticsRequest): QueryFeeDiscountTierStatisticsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest", + value: QueryFeeDiscountTierStatisticsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountTierStatisticsRequest.typeUrl, QueryFeeDiscountTierStatisticsRequest); +function createBaseTierStatistic(): TierStatistic { + return { + tier: BigInt(0), + count: BigInt(0) + }; +} +export const TierStatistic = { + typeUrl: "/injective.exchange.v1beta1.TierStatistic", + is(o: any): o is TierStatistic { + return o && (o.$typeUrl === TierStatistic.typeUrl || typeof o.tier === "bigint" && typeof o.count === "bigint"); + }, + isAmino(o: any): o is TierStatisticAmino { + return o && (o.$typeUrl === TierStatistic.typeUrl || typeof o.tier === "bigint" && typeof o.count === "bigint"); + }, + encode(message: TierStatistic, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tier !== BigInt(0)) { + writer.uint32(8).uint64(message.tier); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TierStatistic { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTierStatistic(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tier = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TierStatistic { + const message = createBaseTierStatistic(); + message.tier = object.tier !== undefined && object.tier !== null ? BigInt(object.tier.toString()) : BigInt(0); + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TierStatisticAmino): TierStatistic { + const message = createBaseTierStatistic(); + if (object.tier !== undefined && object.tier !== null) { + message.tier = BigInt(object.tier); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + return message; + }, + toAmino(message: TierStatistic): TierStatisticAmino { + const obj: any = {}; + obj.tier = message.tier !== BigInt(0) ? message.tier?.toString() : undefined; + obj.count = message.count !== BigInt(0) ? message.count?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TierStatisticAminoMsg): TierStatistic { + return TierStatistic.fromAmino(object.value); + }, + fromProtoMsg(message: TierStatisticProtoMsg): TierStatistic { + return TierStatistic.decode(message.value); + }, + toProto(message: TierStatistic): Uint8Array { + return TierStatistic.encode(message).finish(); + }, + toProtoMsg(message: TierStatistic): TierStatisticProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TierStatistic", + value: TierStatistic.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TierStatistic.typeUrl, TierStatistic); +function createBaseQueryFeeDiscountTierStatisticsResponse(): QueryFeeDiscountTierStatisticsResponse { + return { + statistics: [] + }; +} +export const QueryFeeDiscountTierStatisticsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse", + is(o: any): o is QueryFeeDiscountTierStatisticsResponse { + return o && (o.$typeUrl === QueryFeeDiscountTierStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || TierStatistic.is(o.statistics[0]))); + }, + isAmino(o: any): o is QueryFeeDiscountTierStatisticsResponseAmino { + return o && (o.$typeUrl === QueryFeeDiscountTierStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || TierStatistic.isAmino(o.statistics[0]))); + }, + encode(message: QueryFeeDiscountTierStatisticsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.statistics) { + TierStatistic.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountTierStatisticsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statistics.push(TierStatistic.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountTierStatisticsResponse { + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + message.statistics = object.statistics?.map(e => TierStatistic.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFeeDiscountTierStatisticsResponseAmino): QueryFeeDiscountTierStatisticsResponse { + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + message.statistics = object.statistics?.map(e => TierStatistic.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFeeDiscountTierStatisticsResponse): QueryFeeDiscountTierStatisticsResponseAmino { + const obj: any = {}; + if (message.statistics) { + obj.statistics = message.statistics.map(e => e ? TierStatistic.toAmino(e) : undefined); + } else { + obj.statistics = message.statistics; + } + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountTierStatisticsResponseAminoMsg): QueryFeeDiscountTierStatisticsResponse { + return QueryFeeDiscountTierStatisticsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountTierStatisticsResponseProtoMsg): QueryFeeDiscountTierStatisticsResponse { + return QueryFeeDiscountTierStatisticsResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountTierStatisticsResponse): Uint8Array { + return QueryFeeDiscountTierStatisticsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountTierStatisticsResponse): QueryFeeDiscountTierStatisticsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse", + value: QueryFeeDiscountTierStatisticsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountTierStatisticsResponse.typeUrl, QueryFeeDiscountTierStatisticsResponse); +function createBaseMitoVaultInfosRequest(): MitoVaultInfosRequest { + return {}; +} +export const MitoVaultInfosRequest = { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest", + is(o: any): o is MitoVaultInfosRequest { + return o && o.$typeUrl === MitoVaultInfosRequest.typeUrl; + }, + isAmino(o: any): o is MitoVaultInfosRequestAmino { + return o && o.$typeUrl === MitoVaultInfosRequest.typeUrl; + }, + encode(_: MitoVaultInfosRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MitoVaultInfosRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMitoVaultInfosRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MitoVaultInfosRequest { + const message = createBaseMitoVaultInfosRequest(); + return message; + }, + fromAmino(_: MitoVaultInfosRequestAmino): MitoVaultInfosRequest { + const message = createBaseMitoVaultInfosRequest(); + return message; + }, + toAmino(_: MitoVaultInfosRequest): MitoVaultInfosRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MitoVaultInfosRequestAminoMsg): MitoVaultInfosRequest { + return MitoVaultInfosRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MitoVaultInfosRequestProtoMsg): MitoVaultInfosRequest { + return MitoVaultInfosRequest.decode(message.value); + }, + toProto(message: MitoVaultInfosRequest): Uint8Array { + return MitoVaultInfosRequest.encode(message).finish(); + }, + toProtoMsg(message: MitoVaultInfosRequest): MitoVaultInfosRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest", + value: MitoVaultInfosRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MitoVaultInfosRequest.typeUrl, MitoVaultInfosRequest); +function createBaseMitoVaultInfosResponse(): MitoVaultInfosResponse { + return { + masterAddresses: [], + derivativeAddresses: [], + spotAddresses: [], + cw20Addresses: [] + }; +} +export const MitoVaultInfosResponse = { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse", + is(o: any): o is MitoVaultInfosResponse { + return o && (o.$typeUrl === MitoVaultInfosResponse.typeUrl || Array.isArray(o.masterAddresses) && (!o.masterAddresses.length || typeof o.masterAddresses[0] === "string") && Array.isArray(o.derivativeAddresses) && (!o.derivativeAddresses.length || typeof o.derivativeAddresses[0] === "string") && Array.isArray(o.spotAddresses) && (!o.spotAddresses.length || typeof o.spotAddresses[0] === "string") && Array.isArray(o.cw20Addresses) && (!o.cw20Addresses.length || typeof o.cw20Addresses[0] === "string")); + }, + isAmino(o: any): o is MitoVaultInfosResponseAmino { + return o && (o.$typeUrl === MitoVaultInfosResponse.typeUrl || Array.isArray(o.master_addresses) && (!o.master_addresses.length || typeof o.master_addresses[0] === "string") && Array.isArray(o.derivative_addresses) && (!o.derivative_addresses.length || typeof o.derivative_addresses[0] === "string") && Array.isArray(o.spot_addresses) && (!o.spot_addresses.length || typeof o.spot_addresses[0] === "string") && Array.isArray(o.cw20_addresses) && (!o.cw20_addresses.length || typeof o.cw20_addresses[0] === "string")); + }, + encode(message: MitoVaultInfosResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.masterAddresses) { + writer.uint32(10).string(v!); + } + for (const v of message.derivativeAddresses) { + writer.uint32(18).string(v!); + } + for (const v of message.spotAddresses) { + writer.uint32(26).string(v!); + } + for (const v of message.cw20Addresses) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MitoVaultInfosResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMitoVaultInfosResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.masterAddresses.push(reader.string()); + break; + case 2: + message.derivativeAddresses.push(reader.string()); + break; + case 3: + message.spotAddresses.push(reader.string()); + break; + case 4: + message.cw20Addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MitoVaultInfosResponse { + const message = createBaseMitoVaultInfosResponse(); + message.masterAddresses = object.masterAddresses?.map(e => e) || []; + message.derivativeAddresses = object.derivativeAddresses?.map(e => e) || []; + message.spotAddresses = object.spotAddresses?.map(e => e) || []; + message.cw20Addresses = object.cw20Addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MitoVaultInfosResponseAmino): MitoVaultInfosResponse { + const message = createBaseMitoVaultInfosResponse(); + message.masterAddresses = object.master_addresses?.map(e => e) || []; + message.derivativeAddresses = object.derivative_addresses?.map(e => e) || []; + message.spotAddresses = object.spot_addresses?.map(e => e) || []; + message.cw20Addresses = object.cw20_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MitoVaultInfosResponse): MitoVaultInfosResponseAmino { + const obj: any = {}; + if (message.masterAddresses) { + obj.master_addresses = message.masterAddresses.map(e => e); + } else { + obj.master_addresses = message.masterAddresses; + } + if (message.derivativeAddresses) { + obj.derivative_addresses = message.derivativeAddresses.map(e => e); + } else { + obj.derivative_addresses = message.derivativeAddresses; + } + if (message.spotAddresses) { + obj.spot_addresses = message.spotAddresses.map(e => e); + } else { + obj.spot_addresses = message.spotAddresses; + } + if (message.cw20Addresses) { + obj.cw20_addresses = message.cw20Addresses.map(e => e); + } else { + obj.cw20_addresses = message.cw20Addresses; + } + return obj; + }, + fromAminoMsg(object: MitoVaultInfosResponseAminoMsg): MitoVaultInfosResponse { + return MitoVaultInfosResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MitoVaultInfosResponseProtoMsg): MitoVaultInfosResponse { + return MitoVaultInfosResponse.decode(message.value); + }, + toProto(message: MitoVaultInfosResponse): Uint8Array { + return MitoVaultInfosResponse.encode(message).finish(); + }, + toProtoMsg(message: MitoVaultInfosResponse): MitoVaultInfosResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse", + value: MitoVaultInfosResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MitoVaultInfosResponse.typeUrl, MitoVaultInfosResponse); +function createBaseQueryMarketIDFromVaultRequest(): QueryMarketIDFromVaultRequest { + return { + vaultAddress: "" + }; +} +export const QueryMarketIDFromVaultRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest", + is(o: any): o is QueryMarketIDFromVaultRequest { + return o && (o.$typeUrl === QueryMarketIDFromVaultRequest.typeUrl || typeof o.vaultAddress === "string"); + }, + isAmino(o: any): o is QueryMarketIDFromVaultRequestAmino { + return o && (o.$typeUrl === QueryMarketIDFromVaultRequest.typeUrl || typeof o.vault_address === "string"); + }, + encode(message: QueryMarketIDFromVaultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vaultAddress !== "") { + writer.uint32(10).string(message.vaultAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketIDFromVaultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketIDFromVaultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaultAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketIDFromVaultRequest { + const message = createBaseQueryMarketIDFromVaultRequest(); + message.vaultAddress = object.vaultAddress ?? ""; + return message; + }, + fromAmino(object: QueryMarketIDFromVaultRequestAmino): QueryMarketIDFromVaultRequest { + const message = createBaseQueryMarketIDFromVaultRequest(); + if (object.vault_address !== undefined && object.vault_address !== null) { + message.vaultAddress = object.vault_address; + } + return message; + }, + toAmino(message: QueryMarketIDFromVaultRequest): QueryMarketIDFromVaultRequestAmino { + const obj: any = {}; + obj.vault_address = message.vaultAddress === "" ? undefined : message.vaultAddress; + return obj; + }, + fromAminoMsg(object: QueryMarketIDFromVaultRequestAminoMsg): QueryMarketIDFromVaultRequest { + return QueryMarketIDFromVaultRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketIDFromVaultRequestProtoMsg): QueryMarketIDFromVaultRequest { + return QueryMarketIDFromVaultRequest.decode(message.value); + }, + toProto(message: QueryMarketIDFromVaultRequest): Uint8Array { + return QueryMarketIDFromVaultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketIDFromVaultRequest): QueryMarketIDFromVaultRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest", + value: QueryMarketIDFromVaultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketIDFromVaultRequest.typeUrl, QueryMarketIDFromVaultRequest); +function createBaseQueryMarketIDFromVaultResponse(): QueryMarketIDFromVaultResponse { + return { + marketId: "" + }; +} +export const QueryMarketIDFromVaultResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse", + is(o: any): o is QueryMarketIDFromVaultResponse { + return o && (o.$typeUrl === QueryMarketIDFromVaultResponse.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketIDFromVaultResponseAmino { + return o && (o.$typeUrl === QueryMarketIDFromVaultResponse.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketIDFromVaultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketIDFromVaultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketIDFromVaultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketIDFromVaultResponse { + const message = createBaseQueryMarketIDFromVaultResponse(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryMarketIDFromVaultResponseAmino): QueryMarketIDFromVaultResponse { + const message = createBaseQueryMarketIDFromVaultResponse(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryMarketIDFromVaultResponse): QueryMarketIDFromVaultResponseAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryMarketIDFromVaultResponseAminoMsg): QueryMarketIDFromVaultResponse { + return QueryMarketIDFromVaultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketIDFromVaultResponseProtoMsg): QueryMarketIDFromVaultResponse { + return QueryMarketIDFromVaultResponse.decode(message.value); + }, + toProto(message: QueryMarketIDFromVaultResponse): Uint8Array { + return QueryMarketIDFromVaultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketIDFromVaultResponse): QueryMarketIDFromVaultResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse", + value: QueryMarketIDFromVaultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketIDFromVaultResponse.typeUrl, QueryMarketIDFromVaultResponse); +function createBaseQueryHistoricalTradeRecordsRequest(): QueryHistoricalTradeRecordsRequest { + return { + marketId: "" + }; +} +export const QueryHistoricalTradeRecordsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest", + is(o: any): o is QueryHistoricalTradeRecordsRequest { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryHistoricalTradeRecordsRequestAmino { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryHistoricalTradeRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalTradeRecordsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalTradeRecordsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalTradeRecordsRequest { + const message = createBaseQueryHistoricalTradeRecordsRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryHistoricalTradeRecordsRequestAmino): QueryHistoricalTradeRecordsRequest { + const message = createBaseQueryHistoricalTradeRecordsRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryHistoricalTradeRecordsRequest): QueryHistoricalTradeRecordsRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryHistoricalTradeRecordsRequestAminoMsg): QueryHistoricalTradeRecordsRequest { + return QueryHistoricalTradeRecordsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalTradeRecordsRequestProtoMsg): QueryHistoricalTradeRecordsRequest { + return QueryHistoricalTradeRecordsRequest.decode(message.value); + }, + toProto(message: QueryHistoricalTradeRecordsRequest): Uint8Array { + return QueryHistoricalTradeRecordsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalTradeRecordsRequest): QueryHistoricalTradeRecordsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest", + value: QueryHistoricalTradeRecordsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalTradeRecordsRequest.typeUrl, QueryHistoricalTradeRecordsRequest); +function createBaseQueryHistoricalTradeRecordsResponse(): QueryHistoricalTradeRecordsResponse { + return { + tradeRecords: [] + }; +} +export const QueryHistoricalTradeRecordsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse", + is(o: any): o is QueryHistoricalTradeRecordsResponse { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsResponse.typeUrl || Array.isArray(o.tradeRecords) && (!o.tradeRecords.length || TradeRecords.is(o.tradeRecords[0]))); + }, + isAmino(o: any): o is QueryHistoricalTradeRecordsResponseAmino { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsResponse.typeUrl || Array.isArray(o.trade_records) && (!o.trade_records.length || TradeRecords.isAmino(o.trade_records[0]))); + }, + encode(message: QueryHistoricalTradeRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.tradeRecords) { + TradeRecords.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalTradeRecordsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalTradeRecordsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradeRecords.push(TradeRecords.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalTradeRecordsResponse { + const message = createBaseQueryHistoricalTradeRecordsResponse(); + message.tradeRecords = object.tradeRecords?.map(e => TradeRecords.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryHistoricalTradeRecordsResponseAmino): QueryHistoricalTradeRecordsResponse { + const message = createBaseQueryHistoricalTradeRecordsResponse(); + message.tradeRecords = object.trade_records?.map(e => TradeRecords.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryHistoricalTradeRecordsResponse): QueryHistoricalTradeRecordsResponseAmino { + const obj: any = {}; + if (message.tradeRecords) { + obj.trade_records = message.tradeRecords.map(e => e ? TradeRecords.toAmino(e) : undefined); + } else { + obj.trade_records = message.tradeRecords; + } + return obj; + }, + fromAminoMsg(object: QueryHistoricalTradeRecordsResponseAminoMsg): QueryHistoricalTradeRecordsResponse { + return QueryHistoricalTradeRecordsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalTradeRecordsResponseProtoMsg): QueryHistoricalTradeRecordsResponse { + return QueryHistoricalTradeRecordsResponse.decode(message.value); + }, + toProto(message: QueryHistoricalTradeRecordsResponse): Uint8Array { + return QueryHistoricalTradeRecordsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalTradeRecordsResponse): QueryHistoricalTradeRecordsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse", + value: QueryHistoricalTradeRecordsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalTradeRecordsResponse.typeUrl, QueryHistoricalTradeRecordsResponse); +function createBaseTradeHistoryOptions(): TradeHistoryOptions { + return { + tradeGroupingSec: BigInt(0), + maxAge: BigInt(0), + includeRawHistory: false, + includeMetadata: false + }; +} +export const TradeHistoryOptions = { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions", + is(o: any): o is TradeHistoryOptions { + return o && (o.$typeUrl === TradeHistoryOptions.typeUrl || typeof o.tradeGroupingSec === "bigint" && typeof o.maxAge === "bigint" && typeof o.includeRawHistory === "boolean" && typeof o.includeMetadata === "boolean"); + }, + isAmino(o: any): o is TradeHistoryOptionsAmino { + return o && (o.$typeUrl === TradeHistoryOptions.typeUrl || typeof o.trade_grouping_sec === "bigint" && typeof o.max_age === "bigint" && typeof o.include_raw_history === "boolean" && typeof o.include_metadata === "boolean"); + }, + encode(message: TradeHistoryOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tradeGroupingSec !== BigInt(0)) { + writer.uint32(8).uint64(message.tradeGroupingSec); + } + if (message.maxAge !== BigInt(0)) { + writer.uint32(16).uint64(message.maxAge); + } + if (message.includeRawHistory === true) { + writer.uint32(32).bool(message.includeRawHistory); + } + if (message.includeMetadata === true) { + writer.uint32(40).bool(message.includeMetadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeHistoryOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeHistoryOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradeGroupingSec = reader.uint64(); + break; + case 2: + message.maxAge = reader.uint64(); + break; + case 4: + message.includeRawHistory = reader.bool(); + break; + case 5: + message.includeMetadata = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeHistoryOptions { + const message = createBaseTradeHistoryOptions(); + message.tradeGroupingSec = object.tradeGroupingSec !== undefined && object.tradeGroupingSec !== null ? BigInt(object.tradeGroupingSec.toString()) : BigInt(0); + message.maxAge = object.maxAge !== undefined && object.maxAge !== null ? BigInt(object.maxAge.toString()) : BigInt(0); + message.includeRawHistory = object.includeRawHistory ?? false; + message.includeMetadata = object.includeMetadata ?? false; + return message; + }, + fromAmino(object: TradeHistoryOptionsAmino): TradeHistoryOptions { + const message = createBaseTradeHistoryOptions(); + if (object.trade_grouping_sec !== undefined && object.trade_grouping_sec !== null) { + message.tradeGroupingSec = BigInt(object.trade_grouping_sec); + } + if (object.max_age !== undefined && object.max_age !== null) { + message.maxAge = BigInt(object.max_age); + } + if (object.include_raw_history !== undefined && object.include_raw_history !== null) { + message.includeRawHistory = object.include_raw_history; + } + if (object.include_metadata !== undefined && object.include_metadata !== null) { + message.includeMetadata = object.include_metadata; + } + return message; + }, + toAmino(message: TradeHistoryOptions): TradeHistoryOptionsAmino { + const obj: any = {}; + obj.trade_grouping_sec = message.tradeGroupingSec !== BigInt(0) ? message.tradeGroupingSec?.toString() : undefined; + obj.max_age = message.maxAge !== BigInt(0) ? message.maxAge?.toString() : undefined; + obj.include_raw_history = message.includeRawHistory === false ? undefined : message.includeRawHistory; + obj.include_metadata = message.includeMetadata === false ? undefined : message.includeMetadata; + return obj; + }, + fromAminoMsg(object: TradeHistoryOptionsAminoMsg): TradeHistoryOptions { + return TradeHistoryOptions.fromAmino(object.value); + }, + fromProtoMsg(message: TradeHistoryOptionsProtoMsg): TradeHistoryOptions { + return TradeHistoryOptions.decode(message.value); + }, + toProto(message: TradeHistoryOptions): Uint8Array { + return TradeHistoryOptions.encode(message).finish(); + }, + toProtoMsg(message: TradeHistoryOptions): TradeHistoryOptionsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions", + value: TradeHistoryOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeHistoryOptions.typeUrl, TradeHistoryOptions); +function createBaseQueryMarketVolatilityRequest(): QueryMarketVolatilityRequest { + return { + marketId: "", + tradeHistoryOptions: undefined + }; +} +export const QueryMarketVolatilityRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest", + is(o: any): o is QueryMarketVolatilityRequest { + return o && (o.$typeUrl === QueryMarketVolatilityRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketVolatilityRequestAmino { + return o && (o.$typeUrl === QueryMarketVolatilityRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketVolatilityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.tradeHistoryOptions !== undefined) { + TradeHistoryOptions.encode(message.tradeHistoryOptions, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketVolatilityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketVolatilityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.tradeHistoryOptions = TradeHistoryOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketVolatilityRequest { + const message = createBaseQueryMarketVolatilityRequest(); + message.marketId = object.marketId ?? ""; + message.tradeHistoryOptions = object.tradeHistoryOptions !== undefined && object.tradeHistoryOptions !== null ? TradeHistoryOptions.fromPartial(object.tradeHistoryOptions) : undefined; + return message; + }, + fromAmino(object: QueryMarketVolatilityRequestAmino): QueryMarketVolatilityRequest { + const message = createBaseQueryMarketVolatilityRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.trade_history_options !== undefined && object.trade_history_options !== null) { + message.tradeHistoryOptions = TradeHistoryOptions.fromAmino(object.trade_history_options); + } + return message; + }, + toAmino(message: QueryMarketVolatilityRequest): QueryMarketVolatilityRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.trade_history_options = message.tradeHistoryOptions ? TradeHistoryOptions.toAmino(message.tradeHistoryOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketVolatilityRequestAminoMsg): QueryMarketVolatilityRequest { + return QueryMarketVolatilityRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketVolatilityRequestProtoMsg): QueryMarketVolatilityRequest { + return QueryMarketVolatilityRequest.decode(message.value); + }, + toProto(message: QueryMarketVolatilityRequest): Uint8Array { + return QueryMarketVolatilityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketVolatilityRequest): QueryMarketVolatilityRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest", + value: QueryMarketVolatilityRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketVolatilityRequest.typeUrl, QueryMarketVolatilityRequest); +function createBaseQueryMarketVolatilityResponse(): QueryMarketVolatilityResponse { + return { + volatility: "", + historyMetadata: undefined, + rawHistory: [] + }; +} +export const QueryMarketVolatilityResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse", + is(o: any): o is QueryMarketVolatilityResponse { + return o && (o.$typeUrl === QueryMarketVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.rawHistory) && (!o.rawHistory.length || TradeRecord.is(o.rawHistory[0]))); + }, + isAmino(o: any): o is QueryMarketVolatilityResponseAmino { + return o && (o.$typeUrl === QueryMarketVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.raw_history) && (!o.raw_history.length || TradeRecord.isAmino(o.raw_history[0]))); + }, + encode(message: QueryMarketVolatilityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volatility !== "") { + writer.uint32(10).string(message.volatility); + } + if (message.historyMetadata !== undefined) { + MetadataStatistics.encode(message.historyMetadata, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.rawHistory) { + TradeRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketVolatilityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketVolatilityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volatility = reader.string(); + break; + case 2: + message.historyMetadata = MetadataStatistics.decode(reader, reader.uint32()); + break; + case 3: + message.rawHistory.push(TradeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketVolatilityResponse { + const message = createBaseQueryMarketVolatilityResponse(); + message.volatility = object.volatility ?? ""; + message.historyMetadata = object.historyMetadata !== undefined && object.historyMetadata !== null ? MetadataStatistics.fromPartial(object.historyMetadata) : undefined; + message.rawHistory = object.rawHistory?.map(e => TradeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryMarketVolatilityResponseAmino): QueryMarketVolatilityResponse { + const message = createBaseQueryMarketVolatilityResponse(); + if (object.volatility !== undefined && object.volatility !== null) { + message.volatility = object.volatility; + } + if (object.history_metadata !== undefined && object.history_metadata !== null) { + message.historyMetadata = MetadataStatistics.fromAmino(object.history_metadata); + } + message.rawHistory = object.raw_history?.map(e => TradeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryMarketVolatilityResponse): QueryMarketVolatilityResponseAmino { + const obj: any = {}; + obj.volatility = message.volatility === "" ? undefined : message.volatility; + obj.history_metadata = message.historyMetadata ? MetadataStatistics.toAmino(message.historyMetadata) : undefined; + if (message.rawHistory) { + obj.raw_history = message.rawHistory.map(e => e ? TradeRecord.toAmino(e) : undefined); + } else { + obj.raw_history = message.rawHistory; + } + return obj; + }, + fromAminoMsg(object: QueryMarketVolatilityResponseAminoMsg): QueryMarketVolatilityResponse { + return QueryMarketVolatilityResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketVolatilityResponseProtoMsg): QueryMarketVolatilityResponse { + return QueryMarketVolatilityResponse.decode(message.value); + }, + toProto(message: QueryMarketVolatilityResponse): Uint8Array { + return QueryMarketVolatilityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketVolatilityResponse): QueryMarketVolatilityResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse", + value: QueryMarketVolatilityResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketVolatilityResponse.typeUrl, QueryMarketVolatilityResponse); +function createBaseQueryBinaryMarketsRequest(): QueryBinaryMarketsRequest { + return { + status: "" + }; +} +export const QueryBinaryMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest", + is(o: any): o is QueryBinaryMarketsRequest { + return o && (o.$typeUrl === QueryBinaryMarketsRequest.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryBinaryMarketsRequestAmino { + return o && (o.$typeUrl === QueryBinaryMarketsRequest.typeUrl || typeof o.status === "string"); + }, + encode(message: QueryBinaryMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBinaryMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBinaryMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBinaryMarketsRequest { + const message = createBaseQueryBinaryMarketsRequest(); + message.status = object.status ?? ""; + return message; + }, + fromAmino(object: QueryBinaryMarketsRequestAmino): QueryBinaryMarketsRequest { + const message = createBaseQueryBinaryMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: QueryBinaryMarketsRequest): QueryBinaryMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: QueryBinaryMarketsRequestAminoMsg): QueryBinaryMarketsRequest { + return QueryBinaryMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBinaryMarketsRequestProtoMsg): QueryBinaryMarketsRequest { + return QueryBinaryMarketsRequest.decode(message.value); + }, + toProto(message: QueryBinaryMarketsRequest): Uint8Array { + return QueryBinaryMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBinaryMarketsRequest): QueryBinaryMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest", + value: QueryBinaryMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBinaryMarketsRequest.typeUrl, QueryBinaryMarketsRequest); +function createBaseQueryBinaryMarketsResponse(): QueryBinaryMarketsResponse { + return { + markets: [] + }; +} +export const QueryBinaryMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse", + is(o: any): o is QueryBinaryMarketsResponse { + return o && (o.$typeUrl === QueryBinaryMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || BinaryOptionsMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryBinaryMarketsResponseAmino { + return o && (o.$typeUrl === QueryBinaryMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || BinaryOptionsMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryBinaryMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + BinaryOptionsMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBinaryMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBinaryMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(BinaryOptionsMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBinaryMarketsResponse { + const message = createBaseQueryBinaryMarketsResponse(); + message.markets = object.markets?.map(e => BinaryOptionsMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBinaryMarketsResponseAmino): QueryBinaryMarketsResponse { + const message = createBaseQueryBinaryMarketsResponse(); + message.markets = object.markets?.map(e => BinaryOptionsMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBinaryMarketsResponse): QueryBinaryMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? BinaryOptionsMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryBinaryMarketsResponseAminoMsg): QueryBinaryMarketsResponse { + return QueryBinaryMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBinaryMarketsResponseProtoMsg): QueryBinaryMarketsResponse { + return QueryBinaryMarketsResponse.decode(message.value); + }, + toProto(message: QueryBinaryMarketsResponse): Uint8Array { + return QueryBinaryMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBinaryMarketsResponse): QueryBinaryMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse", + value: QueryBinaryMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBinaryMarketsResponse.typeUrl, QueryBinaryMarketsResponse); +function createBaseQueryTraderDerivativeConditionalOrdersRequest(): QueryTraderDerivativeConditionalOrdersRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QueryTraderDerivativeConditionalOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest", + is(o: any): o is QueryTraderDerivativeConditionalOrdersRequest { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryTraderDerivativeConditionalOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QueryTraderDerivativeConditionalOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeConditionalOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeConditionalOrdersRequest { + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryTraderDerivativeConditionalOrdersRequestAmino): QueryTraderDerivativeConditionalOrdersRequest { + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryTraderDerivativeConditionalOrdersRequest): QueryTraderDerivativeConditionalOrdersRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeConditionalOrdersRequestAminoMsg): QueryTraderDerivativeConditionalOrdersRequest { + return QueryTraderDerivativeConditionalOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeConditionalOrdersRequestProtoMsg): QueryTraderDerivativeConditionalOrdersRequest { + return QueryTraderDerivativeConditionalOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeConditionalOrdersRequest): Uint8Array { + return QueryTraderDerivativeConditionalOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeConditionalOrdersRequest): QueryTraderDerivativeConditionalOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest", + value: QueryTraderDerivativeConditionalOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeConditionalOrdersRequest.typeUrl, QueryTraderDerivativeConditionalOrdersRequest); +function createBaseTrimmedDerivativeConditionalOrder(): TrimmedDerivativeConditionalOrder { + return { + price: "", + quantity: "", + margin: "", + triggerPrice: "", + isBuy: false, + isLimit: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedDerivativeConditionalOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder", + is(o: any): o is TrimmedDerivativeConditionalOrder { + return o && (o.$typeUrl === TrimmedDerivativeConditionalOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.triggerPrice === "string" && typeof o.isBuy === "boolean" && typeof o.isLimit === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedDerivativeConditionalOrderAmino { + return o && (o.$typeUrl === TrimmedDerivativeConditionalOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.triggerPrice === "string" && typeof o.isBuy === "boolean" && typeof o.isLimit === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedDerivativeConditionalOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.triggerPrice !== "") { + writer.uint32(34).string(message.triggerPrice); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + if (message.isLimit === true) { + writer.uint32(48).bool(message.isLimit); + } + if (message.orderHash !== "") { + writer.uint32(58).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(66).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedDerivativeConditionalOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedDerivativeConditionalOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.triggerPrice = reader.string(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.isLimit = reader.bool(); + break; + case 7: + message.orderHash = reader.string(); + break; + case 8: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedDerivativeConditionalOrder { + const message = createBaseTrimmedDerivativeConditionalOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.margin = object.margin ?? ""; + message.triggerPrice = object.triggerPrice ?? ""; + message.isBuy = object.isBuy ?? false; + message.isLimit = object.isLimit ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedDerivativeConditionalOrderAmino): TrimmedDerivativeConditionalOrder { + const message = createBaseTrimmedDerivativeConditionalOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.triggerPrice !== undefined && object.triggerPrice !== null) { + message.triggerPrice = object.triggerPrice; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.isLimit !== undefined && object.isLimit !== null) { + message.isLimit = object.isLimit; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedDerivativeConditionalOrder): TrimmedDerivativeConditionalOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.triggerPrice = message.triggerPrice === "" ? undefined : message.triggerPrice; + obj.isBuy = message.isBuy ?? false; + obj.isLimit = message.isLimit ?? false; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedDerivativeConditionalOrderAminoMsg): TrimmedDerivativeConditionalOrder { + return TrimmedDerivativeConditionalOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedDerivativeConditionalOrderProtoMsg): TrimmedDerivativeConditionalOrder { + return TrimmedDerivativeConditionalOrder.decode(message.value); + }, + toProto(message: TrimmedDerivativeConditionalOrder): Uint8Array { + return TrimmedDerivativeConditionalOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedDerivativeConditionalOrder): TrimmedDerivativeConditionalOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder", + value: TrimmedDerivativeConditionalOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedDerivativeConditionalOrder.typeUrl, TrimmedDerivativeConditionalOrder); +function createBaseQueryTraderDerivativeConditionalOrdersResponse(): QueryTraderDerivativeConditionalOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderDerivativeConditionalOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse", + is(o: any): o is QueryTraderDerivativeConditionalOrdersResponse { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeConditionalOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderDerivativeConditionalOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeConditionalOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderDerivativeConditionalOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeConditionalOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeConditionalOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeConditionalOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeConditionalOrdersResponse { + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeConditionalOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderDerivativeConditionalOrdersResponseAmino): QueryTraderDerivativeConditionalOrdersResponse { + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeConditionalOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderDerivativeConditionalOrdersResponse): QueryTraderDerivativeConditionalOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeConditionalOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeConditionalOrdersResponseAminoMsg): QueryTraderDerivativeConditionalOrdersResponse { + return QueryTraderDerivativeConditionalOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeConditionalOrdersResponseProtoMsg): QueryTraderDerivativeConditionalOrdersResponse { + return QueryTraderDerivativeConditionalOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderDerivativeConditionalOrdersResponse): Uint8Array { + return QueryTraderDerivativeConditionalOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeConditionalOrdersResponse): QueryTraderDerivativeConditionalOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse", + value: QueryTraderDerivativeConditionalOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeConditionalOrdersResponse.typeUrl, QueryTraderDerivativeConditionalOrdersResponse); +function createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(): QueryMarketAtomicExecutionFeeMultiplierRequest { + return { + marketId: "" + }; +} +export const QueryMarketAtomicExecutionFeeMultiplierRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest", + is(o: any): o is QueryMarketAtomicExecutionFeeMultiplierRequest { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketAtomicExecutionFeeMultiplierRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketAtomicExecutionFeeMultiplierRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketAtomicExecutionFeeMultiplierRequest { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryMarketAtomicExecutionFeeMultiplierRequestAmino): QueryMarketAtomicExecutionFeeMultiplierRequest { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryMarketAtomicExecutionFeeMultiplierRequest): QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryMarketAtomicExecutionFeeMultiplierRequestAminoMsg): QueryMarketAtomicExecutionFeeMultiplierRequest { + return QueryMarketAtomicExecutionFeeMultiplierRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg): QueryMarketAtomicExecutionFeeMultiplierRequest { + return QueryMarketAtomicExecutionFeeMultiplierRequest.decode(message.value); + }, + toProto(message: QueryMarketAtomicExecutionFeeMultiplierRequest): Uint8Array { + return QueryMarketAtomicExecutionFeeMultiplierRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierRequest): QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest", + value: QueryMarketAtomicExecutionFeeMultiplierRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl, QueryMarketAtomicExecutionFeeMultiplierRequest); +function createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(): QueryMarketAtomicExecutionFeeMultiplierResponse { + return { + multiplier: "" + }; +} +export const QueryMarketAtomicExecutionFeeMultiplierResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse", + is(o: any): o is QueryMarketAtomicExecutionFeeMultiplierResponse { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl || typeof o.multiplier === "string"); + }, + isAmino(o: any): o is QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl || typeof o.multiplier === "string"); + }, + encode(message: QueryMarketAtomicExecutionFeeMultiplierResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.multiplier !== "") { + writer.uint32(10).string(message.multiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketAtomicExecutionFeeMultiplierResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.multiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketAtomicExecutionFeeMultiplierResponse { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + message.multiplier = object.multiplier ?? ""; + return message; + }, + fromAmino(object: QueryMarketAtomicExecutionFeeMultiplierResponseAmino): QueryMarketAtomicExecutionFeeMultiplierResponse { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + if (object.multiplier !== undefined && object.multiplier !== null) { + message.multiplier = object.multiplier; + } + return message; + }, + toAmino(message: QueryMarketAtomicExecutionFeeMultiplierResponse): QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + const obj: any = {}; + obj.multiplier = message.multiplier === "" ? undefined : message.multiplier; + return obj; + }, + fromAminoMsg(object: QueryMarketAtomicExecutionFeeMultiplierResponseAminoMsg): QueryMarketAtomicExecutionFeeMultiplierResponse { + return QueryMarketAtomicExecutionFeeMultiplierResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg): QueryMarketAtomicExecutionFeeMultiplierResponse { + return QueryMarketAtomicExecutionFeeMultiplierResponse.decode(message.value); + }, + toProto(message: QueryMarketAtomicExecutionFeeMultiplierResponse): Uint8Array { + return QueryMarketAtomicExecutionFeeMultiplierResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierResponse): QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse", + value: QueryMarketAtomicExecutionFeeMultiplierResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl, QueryMarketAtomicExecutionFeeMultiplierResponse); +function createBaseQueryActiveStakeGrantRequest(): QueryActiveStakeGrantRequest { + return { + grantee: "" + }; +} +export const QueryActiveStakeGrantRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest", + is(o: any): o is QueryActiveStakeGrantRequest { + return o && (o.$typeUrl === QueryActiveStakeGrantRequest.typeUrl || typeof o.grantee === "string"); + }, + isAmino(o: any): o is QueryActiveStakeGrantRequestAmino { + return o && (o.$typeUrl === QueryActiveStakeGrantRequest.typeUrl || typeof o.grantee === "string"); + }, + encode(message: QueryActiveStakeGrantRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryActiveStakeGrantRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActiveStakeGrantRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryActiveStakeGrantRequest { + const message = createBaseQueryActiveStakeGrantRequest(); + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryActiveStakeGrantRequestAmino): QueryActiveStakeGrantRequest { + const message = createBaseQueryActiveStakeGrantRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryActiveStakeGrantRequest): QueryActiveStakeGrantRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryActiveStakeGrantRequestAminoMsg): QueryActiveStakeGrantRequest { + return QueryActiveStakeGrantRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActiveStakeGrantRequestProtoMsg): QueryActiveStakeGrantRequest { + return QueryActiveStakeGrantRequest.decode(message.value); + }, + toProto(message: QueryActiveStakeGrantRequest): Uint8Array { + return QueryActiveStakeGrantRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryActiveStakeGrantRequest): QueryActiveStakeGrantRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest", + value: QueryActiveStakeGrantRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryActiveStakeGrantRequest.typeUrl, QueryActiveStakeGrantRequest); +function createBaseQueryActiveStakeGrantResponse(): QueryActiveStakeGrantResponse { + return { + grant: undefined, + effectiveGrant: undefined + }; +} +export const QueryActiveStakeGrantResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse", + is(o: any): o is QueryActiveStakeGrantResponse { + return o && o.$typeUrl === QueryActiveStakeGrantResponse.typeUrl; + }, + isAmino(o: any): o is QueryActiveStakeGrantResponseAmino { + return o && o.$typeUrl === QueryActiveStakeGrantResponse.typeUrl; + }, + encode(message: QueryActiveStakeGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grant !== undefined) { + ActiveGrant.encode(message.grant, writer.uint32(10).fork()).ldelim(); + } + if (message.effectiveGrant !== undefined) { + EffectiveGrant.encode(message.effectiveGrant, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryActiveStakeGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActiveStakeGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grant = ActiveGrant.decode(reader, reader.uint32()); + break; + case 2: + message.effectiveGrant = EffectiveGrant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryActiveStakeGrantResponse { + const message = createBaseQueryActiveStakeGrantResponse(); + message.grant = object.grant !== undefined && object.grant !== null ? ActiveGrant.fromPartial(object.grant) : undefined; + message.effectiveGrant = object.effectiveGrant !== undefined && object.effectiveGrant !== null ? EffectiveGrant.fromPartial(object.effectiveGrant) : undefined; + return message; + }, + fromAmino(object: QueryActiveStakeGrantResponseAmino): QueryActiveStakeGrantResponse { + const message = createBaseQueryActiveStakeGrantResponse(); + if (object.grant !== undefined && object.grant !== null) { + message.grant = ActiveGrant.fromAmino(object.grant); + } + if (object.effective_grant !== undefined && object.effective_grant !== null) { + message.effectiveGrant = EffectiveGrant.fromAmino(object.effective_grant); + } + return message; + }, + toAmino(message: QueryActiveStakeGrantResponse): QueryActiveStakeGrantResponseAmino { + const obj: any = {}; + obj.grant = message.grant ? ActiveGrant.toAmino(message.grant) : undefined; + obj.effective_grant = message.effectiveGrant ? EffectiveGrant.toAmino(message.effectiveGrant) : undefined; + return obj; + }, + fromAminoMsg(object: QueryActiveStakeGrantResponseAminoMsg): QueryActiveStakeGrantResponse { + return QueryActiveStakeGrantResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActiveStakeGrantResponseProtoMsg): QueryActiveStakeGrantResponse { + return QueryActiveStakeGrantResponse.decode(message.value); + }, + toProto(message: QueryActiveStakeGrantResponse): Uint8Array { + return QueryActiveStakeGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryActiveStakeGrantResponse): QueryActiveStakeGrantResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse", + value: QueryActiveStakeGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryActiveStakeGrantResponse.typeUrl, QueryActiveStakeGrantResponse); +function createBaseQueryGrantAuthorizationRequest(): QueryGrantAuthorizationRequest { + return { + granter: "", + grantee: "" + }; +} +export const QueryGrantAuthorizationRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest", + is(o: any): o is QueryGrantAuthorizationRequest { + return o && (o.$typeUrl === QueryGrantAuthorizationRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationRequestAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: QueryGrantAuthorizationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationRequest(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationRequest { + const message = createBaseQueryGrantAuthorizationRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationRequestAmino): QueryGrantAuthorizationRequest { + const message = createBaseQueryGrantAuthorizationRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationRequest): QueryGrantAuthorizationRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationRequestAminoMsg): QueryGrantAuthorizationRequest { + return QueryGrantAuthorizationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationRequestProtoMsg): QueryGrantAuthorizationRequest { + return QueryGrantAuthorizationRequest.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationRequest): Uint8Array { + return QueryGrantAuthorizationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationRequest): QueryGrantAuthorizationRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest", + value: QueryGrantAuthorizationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationRequest.typeUrl, QueryGrantAuthorizationRequest); +function createBaseQueryGrantAuthorizationResponse(): QueryGrantAuthorizationResponse { + return { + amount: "" + }; +} +export const QueryGrantAuthorizationResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse", + is(o: any): o is QueryGrantAuthorizationResponse { + return o && (o.$typeUrl === QueryGrantAuthorizationResponse.typeUrl || typeof o.amount === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationResponseAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationResponse.typeUrl || typeof o.amount === "string"); + }, + encode(message: QueryGrantAuthorizationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== "") { + writer.uint32(10).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationResponse { + const message = createBaseQueryGrantAuthorizationResponse(); + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationResponseAmino): QueryGrantAuthorizationResponse { + const message = createBaseQueryGrantAuthorizationResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationResponse): QueryGrantAuthorizationResponseAmino { + const obj: any = {}; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationResponseAminoMsg): QueryGrantAuthorizationResponse { + return QueryGrantAuthorizationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationResponseProtoMsg): QueryGrantAuthorizationResponse { + return QueryGrantAuthorizationResponse.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationResponse): Uint8Array { + return QueryGrantAuthorizationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationResponse): QueryGrantAuthorizationResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse", + value: QueryGrantAuthorizationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationResponse.typeUrl, QueryGrantAuthorizationResponse); +function createBaseQueryGrantAuthorizationsRequest(): QueryGrantAuthorizationsRequest { + return { + granter: "" + }; +} +export const QueryGrantAuthorizationsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest", + is(o: any): o is QueryGrantAuthorizationsRequest { + return o && (o.$typeUrl === QueryGrantAuthorizationsRequest.typeUrl || typeof o.granter === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationsRequestAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationsRequest.typeUrl || typeof o.granter === "string"); + }, + encode(message: QueryGrantAuthorizationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationsRequest { + const message = createBaseQueryGrantAuthorizationsRequest(); + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationsRequestAmino): QueryGrantAuthorizationsRequest { + const message = createBaseQueryGrantAuthorizationsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationsRequest): QueryGrantAuthorizationsRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationsRequestAminoMsg): QueryGrantAuthorizationsRequest { + return QueryGrantAuthorizationsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationsRequestProtoMsg): QueryGrantAuthorizationsRequest { + return QueryGrantAuthorizationsRequest.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationsRequest): Uint8Array { + return QueryGrantAuthorizationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationsRequest): QueryGrantAuthorizationsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest", + value: QueryGrantAuthorizationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationsRequest.typeUrl, QueryGrantAuthorizationsRequest); +function createBaseQueryGrantAuthorizationsResponse(): QueryGrantAuthorizationsResponse { + return { + totalGrantAmount: "", + grants: [] + }; +} +export const QueryGrantAuthorizationsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse", + is(o: any): o is QueryGrantAuthorizationsResponse { + return o && (o.$typeUrl === QueryGrantAuthorizationsResponse.typeUrl || typeof o.totalGrantAmount === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is QueryGrantAuthorizationsResponseAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationsResponse.typeUrl || typeof o.total_grant_amount === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: QueryGrantAuthorizationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalGrantAmount !== "") { + writer.uint32(10).string(message.totalGrantAmount); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalGrantAmount = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationsResponse { + const message = createBaseQueryGrantAuthorizationsResponse(); + message.totalGrantAmount = object.totalGrantAmount ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryGrantAuthorizationsResponseAmino): QueryGrantAuthorizationsResponse { + const message = createBaseQueryGrantAuthorizationsResponse(); + if (object.total_grant_amount !== undefined && object.total_grant_amount !== null) { + message.totalGrantAmount = object.total_grant_amount; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryGrantAuthorizationsResponse): QueryGrantAuthorizationsResponseAmino { + const obj: any = {}; + obj.total_grant_amount = message.totalGrantAmount === "" ? undefined : message.totalGrantAmount; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationsResponseAminoMsg): QueryGrantAuthorizationsResponse { + return QueryGrantAuthorizationsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationsResponseProtoMsg): QueryGrantAuthorizationsResponse { + return QueryGrantAuthorizationsResponse.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationsResponse): Uint8Array { + return QueryGrantAuthorizationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationsResponse): QueryGrantAuthorizationsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse", + value: QueryGrantAuthorizationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationsResponse.typeUrl, QueryGrantAuthorizationsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/exchange/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..9bbb917c --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/tx.rpc.func.ts @@ -0,0 +1,319 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const useDeposit = buildUseMutation({ + builderMutationFn: createDeposit +}); +export const createWithdraw = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdraw.typeUrl, + encoders: toEncoders(MsgWithdraw), + converters: toConverters(MsgWithdraw) +}); +export const useWithdraw = buildUseMutation({ + builderMutationFn: createWithdraw +}); +export const createInstantSpotMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantSpotMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantSpotMarketLaunch), + converters: toConverters(MsgInstantSpotMarketLaunch) +}); +export const useInstantSpotMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantSpotMarketLaunch +}); +export const createInstantPerpetualMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantPerpetualMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantPerpetualMarketLaunch), + converters: toConverters(MsgInstantPerpetualMarketLaunch) +}); +export const useInstantPerpetualMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantPerpetualMarketLaunch +}); +export const createInstantExpiryFuturesMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantExpiryFuturesMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantExpiryFuturesMarketLaunch), + converters: toConverters(MsgInstantExpiryFuturesMarketLaunch) +}); +export const useInstantExpiryFuturesMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantExpiryFuturesMarketLaunch +}); +export const createCreateSpotLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotLimitOrder), + converters: toConverters(MsgCreateSpotLimitOrder) +}); +export const useCreateSpotLimitOrder = buildUseMutation({ + builderMutationFn: createCreateSpotLimitOrder +}); +export const createBatchCreateSpotLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateSpotLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateSpotLimitOrders), + converters: toConverters(MsgBatchCreateSpotLimitOrders) +}); +export const useBatchCreateSpotLimitOrders = buildUseMutation({ + builderMutationFn: createBatchCreateSpotLimitOrders +}); +export const createCreateSpotMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotMarketOrder), + converters: toConverters(MsgCreateSpotMarketOrder) +}); +export const useCreateSpotMarketOrder = buildUseMutation({ + builderMutationFn: createCreateSpotMarketOrder +}); +export const createCancelSpotOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSpotOrder.typeUrl, + encoders: toEncoders(MsgCancelSpotOrder), + converters: toConverters(MsgCancelSpotOrder) +}); +export const useCancelSpotOrder = buildUseMutation({ + builderMutationFn: createCancelSpotOrder +}); +export const createBatchCancelSpotOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelSpotOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelSpotOrders), + converters: toConverters(MsgBatchCancelSpotOrders) +}); +export const useBatchCancelSpotOrders = buildUseMutation({ + builderMutationFn: createBatchCancelSpotOrders +}); +export const createBatchUpdateOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchUpdateOrders.typeUrl, + encoders: toEncoders(MsgBatchUpdateOrders), + converters: toConverters(MsgBatchUpdateOrders) +}); +export const useBatchUpdateOrders = buildUseMutation({ + builderMutationFn: createBatchUpdateOrders +}); +export const createPrivilegedExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPrivilegedExecuteContract.typeUrl, + encoders: toEncoders(MsgPrivilegedExecuteContract), + converters: toConverters(MsgPrivilegedExecuteContract) +}); +export const usePrivilegedExecuteContract = buildUseMutation({ + builderMutationFn: createPrivilegedExecuteContract +}); +export const createCreateDerivativeLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeLimitOrder), + converters: toConverters(MsgCreateDerivativeLimitOrder) +}); +export const useCreateDerivativeLimitOrder = buildUseMutation({ + builderMutationFn: createCreateDerivativeLimitOrder +}); +export const createBatchCreateDerivativeLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateDerivativeLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateDerivativeLimitOrders), + converters: toConverters(MsgBatchCreateDerivativeLimitOrders) +}); +export const useBatchCreateDerivativeLimitOrders = buildUseMutation({ + builderMutationFn: createBatchCreateDerivativeLimitOrders +}); +export const createCreateDerivativeMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeMarketOrder), + converters: toConverters(MsgCreateDerivativeMarketOrder) +}); +export const useCreateDerivativeMarketOrder = buildUseMutation({ + builderMutationFn: createCreateDerivativeMarketOrder +}); +export const createCancelDerivativeOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelDerivativeOrder.typeUrl, + encoders: toEncoders(MsgCancelDerivativeOrder), + converters: toConverters(MsgCancelDerivativeOrder) +}); +export const useCancelDerivativeOrder = buildUseMutation({ + builderMutationFn: createCancelDerivativeOrder +}); +export const createBatchCancelDerivativeOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelDerivativeOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelDerivativeOrders), + converters: toConverters(MsgBatchCancelDerivativeOrders) +}); +export const useBatchCancelDerivativeOrders = buildUseMutation({ + builderMutationFn: createBatchCancelDerivativeOrders +}); +export const createInstantBinaryOptionsMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantBinaryOptionsMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantBinaryOptionsMarketLaunch), + converters: toConverters(MsgInstantBinaryOptionsMarketLaunch) +}); +export const useInstantBinaryOptionsMarketLaunch = buildUseMutation({ + builderMutationFn: createInstantBinaryOptionsMarketLaunch +}); +export const createCreateBinaryOptionsLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsLimitOrder), + converters: toConverters(MsgCreateBinaryOptionsLimitOrder) +}); +export const useCreateBinaryOptionsLimitOrder = buildUseMutation({ + builderMutationFn: createCreateBinaryOptionsLimitOrder +}); +export const createCreateBinaryOptionsMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsMarketOrder), + converters: toConverters(MsgCreateBinaryOptionsMarketOrder) +}); +export const useCreateBinaryOptionsMarketOrder = buildUseMutation({ + builderMutationFn: createCreateBinaryOptionsMarketOrder +}); +export const createCancelBinaryOptionsOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelBinaryOptionsOrder.typeUrl, + encoders: toEncoders(MsgCancelBinaryOptionsOrder), + converters: toConverters(MsgCancelBinaryOptionsOrder) +}); +export const useCancelBinaryOptionsOrder = buildUseMutation({ + builderMutationFn: createCancelBinaryOptionsOrder +}); +export const createBatchCancelBinaryOptionsOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelBinaryOptionsOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelBinaryOptionsOrders), + converters: toConverters(MsgBatchCancelBinaryOptionsOrders) +}); +export const useBatchCancelBinaryOptionsOrders = buildUseMutation({ + builderMutationFn: createBatchCancelBinaryOptionsOrders +}); +export const createSubaccountTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubaccountTransfer.typeUrl, + encoders: toEncoders(MsgSubaccountTransfer), + converters: toConverters(MsgSubaccountTransfer) +}); +export const useSubaccountTransfer = buildUseMutation({ + builderMutationFn: createSubaccountTransfer +}); +export const createExternalTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExternalTransfer.typeUrl, + encoders: toEncoders(MsgExternalTransfer), + converters: toConverters(MsgExternalTransfer) +}); +export const useExternalTransfer = buildUseMutation({ + builderMutationFn: createExternalTransfer +}); +export const createLiquidatePosition = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLiquidatePosition.typeUrl, + encoders: toEncoders(MsgLiquidatePosition), + converters: toConverters(MsgLiquidatePosition) +}); +export const useLiquidatePosition = buildUseMutation({ + builderMutationFn: createLiquidatePosition +}); +export const createEmergencySettleMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEmergencySettleMarket.typeUrl, + encoders: toEncoders(MsgEmergencySettleMarket), + converters: toConverters(MsgEmergencySettleMarket) +}); +export const useEmergencySettleMarket = buildUseMutation({ + builderMutationFn: createEmergencySettleMarket +}); +export const createIncreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIncreasePositionMargin.typeUrl, + encoders: toEncoders(MsgIncreasePositionMargin), + converters: toConverters(MsgIncreasePositionMargin) +}); +export const useIncreasePositionMargin = buildUseMutation({ + builderMutationFn: createIncreasePositionMargin +}); +export const createDecreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDecreasePositionMargin.typeUrl, + encoders: toEncoders(MsgDecreasePositionMargin), + converters: toConverters(MsgDecreasePositionMargin) +}); +export const useDecreasePositionMargin = buildUseMutation({ + builderMutationFn: createDecreasePositionMargin +}); +export const createRewardsOptOut = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRewardsOptOut.typeUrl, + encoders: toEncoders(MsgRewardsOptOut), + converters: toConverters(MsgRewardsOptOut) +}); +export const useRewardsOptOut = buildUseMutation({ + builderMutationFn: createRewardsOptOut +}); +export const createAdminUpdateBinaryOptionsMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAdminUpdateBinaryOptionsMarket.typeUrl, + encoders: toEncoders(MsgAdminUpdateBinaryOptionsMarket), + converters: toConverters(MsgAdminUpdateBinaryOptionsMarket) +}); +export const useAdminUpdateBinaryOptionsMarket = buildUseMutation({ + builderMutationFn: createAdminUpdateBinaryOptionsMarket +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createUpdateSpotMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateSpotMarket.typeUrl, + encoders: toEncoders(MsgUpdateSpotMarket), + converters: toConverters(MsgUpdateSpotMarket) +}); +export const useUpdateSpotMarket = buildUseMutation({ + builderMutationFn: createUpdateSpotMarket +}); +export const createUpdateDerivativeMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateDerivativeMarket.typeUrl, + encoders: toEncoders(MsgUpdateDerivativeMarket), + converters: toConverters(MsgUpdateDerivativeMarket) +}); +export const useUpdateDerivativeMarket = buildUseMutation({ + builderMutationFn: createUpdateDerivativeMarket +}); +export const createAuthorizeStakeGrants = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAuthorizeStakeGrants.typeUrl, + encoders: toEncoders(MsgAuthorizeStakeGrants), + converters: toConverters(MsgAuthorizeStakeGrants) +}); +export const useAuthorizeStakeGrants = buildUseMutation({ + builderMutationFn: createAuthorizeStakeGrants +}); +export const createActivateStakeGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateStakeGrant.typeUrl, + encoders: toEncoders(MsgActivateStakeGrant), + converters: toConverters(MsgActivateStakeGrant) +}); +export const useActivateStakeGrant = buildUseMutation({ + builderMutationFn: createActivateStakeGrant +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/exchange/v1beta1/tx.ts b/libs/injective-query/src/injective/exchange/v1beta1/tx.ts new file mode 100644 index 00000000..5508578a --- /dev/null +++ b/libs/injective-query/src/injective/exchange/v1beta1/tx.ts @@ -0,0 +1,9492 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { SpotOrder, SpotOrderAmino, DerivativeOrder, DerivativeOrderAmino, MarketStatus, GrantAuthorization, GrantAuthorizationAmino, PositionDelta, PositionDeltaAmino } from "./exchange"; +import { Params, ParamsAmino } from "../../../cosmos/distribution/v1beta1/distribution"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgUpdateSpotMarket { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + marketId: string; + /** (optional) updated ticker value */ + newTicker: string; + /** (optional) updated min price tick size value */ + newMinPriceTickSize: string; + /** (optional) updated min quantity tick size value */ + newMinQuantityTickSize: string; + /** (optional) updated min notional */ + newMinNotional: string; +} +export interface MsgUpdateSpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket"; + value: Uint8Array; +} +export interface MsgUpdateSpotMarketAmino { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + market_id: string; + /** (optional) updated ticker value */ + new_ticker: string; + /** (optional) updated min price tick size value */ + new_min_price_tick_size: string; + /** (optional) updated min quantity tick size value */ + new_min_quantity_tick_size: string; + /** (optional) updated min notional */ + new_min_notional: string; +} +export interface MsgUpdateSpotMarketAminoMsg { + type: "exchange/MsgUpdateSpotMarket"; + value: MsgUpdateSpotMarketAmino; +} +export interface MsgUpdateSpotMarketResponse {} +export interface MsgUpdateSpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse"; + value: Uint8Array; +} +export interface MsgUpdateSpotMarketResponseAmino {} +export interface MsgUpdateSpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse"; + value: MsgUpdateSpotMarketResponseAmino; +} +export interface MsgUpdateDerivativeMarket { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + marketId: string; + /** (optional) updated value for ticker */ + newTicker: string; + /** (optional) updated value for min_price_tick_size */ + newMinPriceTickSize: string; + /** (optional) updated value min_quantity_tick_size */ + newMinQuantityTickSize: string; + /** (optional) updated min notional */ + newMinNotional: string; + /** (optional) updated value for initial_margin_ratio */ + newInitialMarginRatio: string; + /** (optional) updated value for maintenance_margin_ratio */ + newMaintenanceMarginRatio: string; +} +export interface MsgUpdateDerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket"; + value: Uint8Array; +} +export interface MsgUpdateDerivativeMarketAmino { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + market_id: string; + /** (optional) updated value for ticker */ + new_ticker: string; + /** (optional) updated value for min_price_tick_size */ + new_min_price_tick_size: string; + /** (optional) updated value min_quantity_tick_size */ + new_min_quantity_tick_size: string; + /** (optional) updated min notional */ + new_min_notional: string; + /** (optional) updated value for initial_margin_ratio */ + new_initial_margin_ratio: string; + /** (optional) updated value for maintenance_margin_ratio */ + new_maintenance_margin_ratio: string; +} +export interface MsgUpdateDerivativeMarketAminoMsg { + type: "exchange/MsgUpdateDerivativeMarket"; + value: MsgUpdateDerivativeMarketAmino; +} +export interface MsgUpdateDerivativeMarketResponse {} +export interface MsgUpdateDerivativeMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse"; + value: Uint8Array; +} +export interface MsgUpdateDerivativeMarketResponseAmino {} +export interface MsgUpdateDerivativeMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse"; + value: MsgUpdateDerivativeMarketResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the exchange parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the exchange parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "exchange/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgDeposit defines a SDK message for transferring coins from the sender's + * bank balance into the subaccount's exchange deposits + */ +export interface MsgDeposit { + sender: string; + /** + * (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin + * will be deposited to the sender's default subaccount address. + */ + subaccountId: string; + amount: Coin; +} +export interface MsgDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDeposit"; + value: Uint8Array; +} +/** + * MsgDeposit defines a SDK message for transferring coins from the sender's + * bank balance into the subaccount's exchange deposits + */ +export interface MsgDepositAmino { + sender: string; + /** + * (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin + * will be deposited to the sender's default subaccount address. + */ + subaccount_id: string; + amount: CoinAmino; +} +export interface MsgDepositAminoMsg { + type: "exchange/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** + * MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's + * deposits to the user's bank balance + */ +export interface MsgWithdraw { + sender: string; + /** bytes32 subaccount ID to withdraw funds from */ + subaccountId: string; + amount: Coin; +} +export interface MsgWithdrawProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw"; + value: Uint8Array; +} +/** + * MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's + * deposits to the user's bank balance + */ +export interface MsgWithdrawAmino { + sender: string; + /** bytes32 subaccount ID to withdraw funds from */ + subaccount_id: string; + amount: CoinAmino; +} +export interface MsgWithdrawAminoMsg { + type: "exchange/MsgWithdraw"; + value: MsgWithdrawAmino; +} +/** MsgWithdraw defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponse {} +export interface MsgWithdrawResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse"; + value: Uint8Array; +} +/** MsgWithdraw defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponseAmino {} +export interface MsgWithdrawResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgWithdrawResponse"; + value: MsgWithdrawResponseAmino; +} +/** + * MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit + * order. + */ +export interface MsgCreateSpotLimitOrder { + sender: string; + order: SpotOrder; +} +export interface MsgCreateSpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder"; + value: Uint8Array; +} +/** + * MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit + * order. + */ +export interface MsgCreateSpotLimitOrderAmino { + sender: string; + order: SpotOrderAmino; +} +export interface MsgCreateSpotLimitOrderAminoMsg { + type: "exchange/MsgCreateSpotLimitOrder"; + value: MsgCreateSpotLimitOrderAmino; +} +/** + * MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response + * type. + */ +export interface MsgCreateSpotLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateSpotLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response + * type. + */ +export interface MsgCreateSpotLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateSpotLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse"; + value: MsgCreateSpotLimitOrderResponseAmino; +} +/** + * MsgBatchCreateSpotLimitOrders defines a SDK message for creating a new batch + * of spot limit orders. + */ +export interface MsgBatchCreateSpotLimitOrders { + sender: string; + orders: SpotOrder[]; +} +export interface MsgBatchCreateSpotLimitOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders"; + value: Uint8Array; +} +/** + * MsgBatchCreateSpotLimitOrders defines a SDK message for creating a new batch + * of spot limit orders. + */ +export interface MsgBatchCreateSpotLimitOrdersAmino { + sender: string; + orders: SpotOrderAmino[]; +} +export interface MsgBatchCreateSpotLimitOrdersAminoMsg { + type: "exchange/MsgBatchCreateSpotLimitOrders"; + value: MsgBatchCreateSpotLimitOrdersAmino; +} +/** + * MsgBatchCreateSpotLimitOrdersResponse defines the + * Msg/BatchCreateSpotLimitOrders response type. + */ +export interface MsgBatchCreateSpotLimitOrdersResponse { + orderHashes: string[]; + createdOrdersCids: string[]; + failedOrdersCids: string[]; +} +export interface MsgBatchCreateSpotLimitOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCreateSpotLimitOrdersResponse defines the + * Msg/BatchCreateSpotLimitOrders response type. + */ +export interface MsgBatchCreateSpotLimitOrdersResponseAmino { + order_hashes: string[]; + created_orders_cids: string[]; + failed_orders_cids: string[]; +} +export interface MsgBatchCreateSpotLimitOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse"; + value: MsgBatchCreateSpotLimitOrdersResponseAmino; +} +/** + * MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot + * market by paying listing fee without governance + */ +export interface MsgInstantSpotMarketLaunch { + sender: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + baseDenom: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantSpotMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot + * market by paying listing fee without governance + */ +export interface MsgInstantSpotMarketLaunchAmino { + sender: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + base_denom: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantSpotMarketLaunchAminoMsg { + type: "exchange/MsgInstantSpotMarketLaunch"; + value: MsgInstantSpotMarketLaunchAmino; +} +/** + * MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch + * response type. + */ +export interface MsgInstantSpotMarketLaunchResponse {} +export interface MsgInstantSpotMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch + * response type. + */ +export interface MsgInstantSpotMarketLaunchResponseAmino {} +export interface MsgInstantSpotMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse"; + value: MsgInstantSpotMarketLaunchResponseAmino; +} +/** + * MsgInstantPerpetualMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantPerpetualMarketLaunch { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + takerFeeRate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the perpetual + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * perpetual market + */ + maintenanceMarginRatio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantPerpetualMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantPerpetualMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantPerpetualMarketLaunchAmino { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + taker_fee_rate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the perpetual + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * perpetual market + */ + maintenance_margin_ratio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantPerpetualMarketLaunchAminoMsg { + type: "exchange/MsgInstantPerpetualMarketLaunch"; + value: MsgInstantPerpetualMarketLaunchAmino; +} +/** + * MsgInstantPerpetualMarketLaunchResponse defines the + * Msg/InstantPerpetualMarketLaunchResponse response type. + */ +export interface MsgInstantPerpetualMarketLaunchResponse {} +export interface MsgInstantPerpetualMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantPerpetualMarketLaunchResponse defines the + * Msg/InstantPerpetualMarketLaunchResponse response type. + */ +export interface MsgInstantPerpetualMarketLaunchResponseAmino {} +export interface MsgInstantPerpetualMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse"; + value: MsgInstantPerpetualMarketLaunchResponseAmino; +} +/** + * MsgInstantBinaryOptionsMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantBinaryOptionsMarketLaunch { + sender: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + takerFeeRate: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantBinaryOptionsMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantBinaryOptionsMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantBinaryOptionsMarketLaunchAmino { + sender: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + taker_fee_rate: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantBinaryOptionsMarketLaunchAminoMsg { + type: "exchange/MsgInstantBinaryOptionsMarketLaunch"; + value: MsgInstantBinaryOptionsMarketLaunchAmino; +} +/** + * MsgInstantBinaryOptionsMarketLaunchResponse defines the + * Msg/InstantBinaryOptionsMarketLaunchResponse response type. + */ +export interface MsgInstantBinaryOptionsMarketLaunchResponse {} +export interface MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantBinaryOptionsMarketLaunchResponse defines the + * Msg/InstantBinaryOptionsMarketLaunchResponse response type. + */ +export interface MsgInstantBinaryOptionsMarketLaunchResponseAmino {} +export interface MsgInstantBinaryOptionsMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse"; + value: MsgInstantBinaryOptionsMarketLaunchResponseAmino; +} +/** + * MsgInstantExpiryFuturesMarketLaunch defines a SDK message for creating a new + * expiry futures market by paying listing fee without governance + */ +export interface MsgInstantExpiryFuturesMarketLaunch { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Expiration time of the market */ + expiry: bigint; + /** + * maker_fee_rate defines the trade fee rate for makers on the expiry futures + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the expiry futures + * market + */ + takerFeeRate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantExpiryFuturesMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantExpiryFuturesMarketLaunch defines a SDK message for creating a new + * expiry futures market by paying listing fee without governance + */ +export interface MsgInstantExpiryFuturesMarketLaunchAmino { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Expiration time of the market */ + expiry: string; + /** + * maker_fee_rate defines the trade fee rate for makers on the expiry futures + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the expiry futures + * market + */ + taker_fee_rate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantExpiryFuturesMarketLaunchAminoMsg { + type: "exchange/MsgInstantExpiryFuturesMarketLaunch"; + value: MsgInstantExpiryFuturesMarketLaunchAmino; +} +/** + * MsgInstantExpiryFuturesMarketLaunchResponse defines the + * Msg/InstantExpiryFuturesMarketLaunch response type. + */ +export interface MsgInstantExpiryFuturesMarketLaunchResponse {} +export interface MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantExpiryFuturesMarketLaunchResponse defines the + * Msg/InstantExpiryFuturesMarketLaunch response type. + */ +export interface MsgInstantExpiryFuturesMarketLaunchResponseAmino {} +export interface MsgInstantExpiryFuturesMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse"; + value: MsgInstantExpiryFuturesMarketLaunchResponseAmino; +} +/** + * MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market + * order. + */ +export interface MsgCreateSpotMarketOrder { + sender: string; + order: SpotOrder; +} +export interface MsgCreateSpotMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder"; + value: Uint8Array; +} +/** + * MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market + * order. + */ +export interface MsgCreateSpotMarketOrderAmino { + sender: string; + order: SpotOrderAmino; +} +export interface MsgCreateSpotMarketOrderAminoMsg { + type: "exchange/MsgCreateSpotMarketOrder"; + value: MsgCreateSpotMarketOrderAmino; +} +/** + * MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder + * response type. + */ +export interface MsgCreateSpotMarketOrderResponse { + orderHash: string; + results?: SpotMarketOrderResults; + cid: string; +} +export interface MsgCreateSpotMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder + * response type. + */ +export interface MsgCreateSpotMarketOrderResponseAmino { + order_hash: string; + results?: SpotMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateSpotMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse"; + value: MsgCreateSpotMarketOrderResponseAmino; +} +export interface SpotMarketOrderResults { + quantity: string; + price: string; + fee: string; +} +export interface SpotMarketOrderResultsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults"; + value: Uint8Array; +} +export interface SpotMarketOrderResultsAmino { + quantity: string; + price: string; + fee: string; +} +export interface SpotMarketOrderResultsAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarketOrderResults"; + value: SpotMarketOrderResultsAmino; +} +/** A Cosmos-SDK MsgCreateDerivativeLimitOrder */ +export interface MsgCreateDerivativeLimitOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateDerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateDerivativeLimitOrder */ +export interface MsgCreateDerivativeLimitOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateDerivativeLimitOrderAminoMsg { + type: "exchange/MsgCreateDerivativeLimitOrder"; + value: MsgCreateDerivativeLimitOrderAmino; +} +/** + * MsgCreateDerivativeLimitOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateDerivativeLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateDerivativeLimitOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateDerivativeLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse"; + value: MsgCreateDerivativeLimitOrderResponseAmino; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsLimitOrder */ +export interface MsgCreateBinaryOptionsLimitOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateBinaryOptionsLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsLimitOrder */ +export interface MsgCreateBinaryOptionsLimitOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateBinaryOptionsLimitOrderAminoMsg { + type: "exchange/MsgCreateBinaryOptionsLimitOrder"; + value: MsgCreateBinaryOptionsLimitOrderAmino; +} +/** + * MsgCreateBinaryOptionsLimitOrderResponse defines the + * Msg/CreateBinaryOptionsLimitOrder response type. + */ +export interface MsgCreateBinaryOptionsLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateBinaryOptionsLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateBinaryOptionsLimitOrderResponse defines the + * Msg/CreateBinaryOptionsLimitOrder response type. + */ +export interface MsgCreateBinaryOptionsLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateBinaryOptionsLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse"; + value: MsgCreateBinaryOptionsLimitOrderResponseAmino; +} +/** A Cosmos-SDK MsgBatchCreateDerivativeLimitOrders */ +export interface MsgBatchCreateDerivativeLimitOrders { + sender: string; + orders: DerivativeOrder[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgBatchCreateDerivativeLimitOrders */ +export interface MsgBatchCreateDerivativeLimitOrdersAmino { + sender: string; + orders: DerivativeOrderAmino[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersAminoMsg { + type: "exchange/MsgBatchCreateDerivativeLimitOrders"; + value: MsgBatchCreateDerivativeLimitOrdersAmino; +} +/** + * MsgBatchCreateDerivativeLimitOrdersResponse defines the + * Msg/BatchCreateDerivativeLimitOrders response type. + */ +export interface MsgBatchCreateDerivativeLimitOrdersResponse { + orderHashes: string[]; + createdOrdersCids: string[]; + failedOrdersCids: string[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCreateDerivativeLimitOrdersResponse defines the + * Msg/BatchCreateDerivativeLimitOrders response type. + */ +export interface MsgBatchCreateDerivativeLimitOrdersResponseAmino { + order_hashes: string[]; + created_orders_cids: string[]; + failed_orders_cids: string[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse"; + value: MsgBatchCreateDerivativeLimitOrdersResponseAmino; +} +/** MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + cid: string; +} +export interface MsgCancelSpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder"; + value: Uint8Array; +} +/** MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + cid: string; +} +export interface MsgCancelSpotOrderAminoMsg { + type: "exchange/MsgCancelSpotOrder"; + value: MsgCancelSpotOrderAmino; +} +/** MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderResponse {} +export interface MsgCancelSpotOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse"; + value: Uint8Array; +} +/** MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderResponseAmino {} +export interface MsgCancelSpotOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse"; + value: MsgCancelSpotOrderResponseAmino; +} +/** MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type. */ +export interface MsgBatchCancelSpotOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelSpotOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders"; + value: Uint8Array; +} +/** MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type. */ +export interface MsgBatchCancelSpotOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelSpotOrdersAminoMsg { + type: "exchange/MsgBatchCancelSpotOrders"; + value: MsgBatchCancelSpotOrdersAmino; +} +/** + * MsgBatchCancelSpotOrdersResponse defines the Msg/BatchCancelSpotOrders + * response type. + */ +export interface MsgBatchCancelSpotOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCancelSpotOrdersResponse defines the Msg/BatchCancelSpotOrders + * response type. + */ +export interface MsgBatchCancelSpotOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse"; + value: MsgBatchCancelSpotOrdersResponseAmino; +} +/** + * MsgBatchCancelBinaryOptionsOrders defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders"; + value: Uint8Array; +} +/** + * MsgBatchCancelBinaryOptionsOrders defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersAminoMsg { + type: "exchange/MsgBatchCancelBinaryOptionsOrders"; + value: MsgBatchCancelBinaryOptionsOrdersAmino; +} +/** + * BatchCancelBinaryOptionsOrdersResponse defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse"; + value: Uint8Array; +} +/** + * BatchCancelBinaryOptionsOrdersResponse defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse"; + value: MsgBatchCancelBinaryOptionsOrdersResponseAmino; +} +/** MsgBatchUpdateOrders defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrders { + sender: string; + /** + * subaccount_id only used for the spot_market_ids_to_cancel_all and + * derivative_market_ids_to_cancel_all. + */ + subaccountId: string; + spotMarketIdsToCancelAll: string[]; + derivativeMarketIdsToCancelAll: string[]; + spotOrdersToCancel?: OrderData[]; + derivativeOrdersToCancel?: OrderData[]; + spotOrdersToCreate?: SpotOrder[]; + derivativeOrdersToCreate?: DerivativeOrder[]; + binaryOptionsOrdersToCancel?: OrderData[]; + binaryOptionsMarketIdsToCancelAll: string[]; + binaryOptionsOrdersToCreate?: DerivativeOrder[]; +} +export interface MsgBatchUpdateOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders"; + value: Uint8Array; +} +/** MsgBatchUpdateOrders defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersAmino { + sender: string; + /** + * subaccount_id only used for the spot_market_ids_to_cancel_all and + * derivative_market_ids_to_cancel_all. + */ + subaccount_id: string; + spot_market_ids_to_cancel_all: string[]; + derivative_market_ids_to_cancel_all: string[]; + spot_orders_to_cancel?: OrderDataAmino[]; + derivative_orders_to_cancel?: OrderDataAmino[]; + spot_orders_to_create?: SpotOrderAmino[]; + derivative_orders_to_create?: DerivativeOrderAmino[]; + binary_options_orders_to_cancel?: OrderDataAmino[]; + binary_options_market_ids_to_cancel_all: string[]; + binary_options_orders_to_create?: DerivativeOrderAmino[]; +} +export interface MsgBatchUpdateOrdersAminoMsg { + type: "exchange/MsgBatchUpdateOrders"; + value: MsgBatchUpdateOrdersAmino; +} +/** MsgBatchUpdateOrdersResponse defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersResponse { + spotCancelSuccess: boolean[]; + derivativeCancelSuccess: boolean[]; + spotOrderHashes: string[]; + derivativeOrderHashes: string[]; + binaryOptionsCancelSuccess: boolean[]; + binaryOptionsOrderHashes: string[]; + createdSpotOrdersCids: string[]; + failedSpotOrdersCids: string[]; + createdDerivativeOrdersCids: string[]; + failedDerivativeOrdersCids: string[]; + createdBinaryOptionsOrdersCids: string[]; + failedBinaryOptionsOrdersCids: string[]; +} +export interface MsgBatchUpdateOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse"; + value: Uint8Array; +} +/** MsgBatchUpdateOrdersResponse defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersResponseAmino { + spot_cancel_success: boolean[]; + derivative_cancel_success: boolean[]; + spot_order_hashes: string[]; + derivative_order_hashes: string[]; + binary_options_cancel_success: boolean[]; + binary_options_order_hashes: string[]; + created_spot_orders_cids: string[]; + failed_spot_orders_cids: string[]; + created_derivative_orders_cids: string[]; + failed_derivative_orders_cids: string[]; + created_binary_options_orders_cids: string[]; + failed_binary_options_orders_cids: string[]; +} +export interface MsgBatchUpdateOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse"; + value: MsgBatchUpdateOrdersResponseAmino; +} +/** A Cosmos-SDK MsgCreateDerivativeMarketOrder */ +export interface MsgCreateDerivativeMarketOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateDerivativeMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateDerivativeMarketOrder */ +export interface MsgCreateDerivativeMarketOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateDerivativeMarketOrderAminoMsg { + type: "exchange/MsgCreateDerivativeMarketOrder"; + value: MsgCreateDerivativeMarketOrderAmino; +} +/** + * MsgCreateDerivativeMarketOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeMarketOrderResponse { + orderHash: string; + results?: DerivativeMarketOrderResults; + cid: string; +} +export interface MsgCreateDerivativeMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateDerivativeMarketOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeMarketOrderResponseAmino { + order_hash: string; + results?: DerivativeMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateDerivativeMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse"; + value: MsgCreateDerivativeMarketOrderResponseAmino; +} +export interface DerivativeMarketOrderResults { + quantity: string; + price: string; + fee: string; + positionDelta: PositionDelta; + payout: string; +} +export interface DerivativeMarketOrderResultsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults"; + value: Uint8Array; +} +export interface DerivativeMarketOrderResultsAmino { + quantity: string; + price: string; + fee: string; + position_delta: PositionDeltaAmino; + payout: string; +} +export interface DerivativeMarketOrderResultsAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrderResults"; + value: DerivativeMarketOrderResultsAmino; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsMarketOrder */ +export interface MsgCreateBinaryOptionsMarketOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateBinaryOptionsMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsMarketOrder */ +export interface MsgCreateBinaryOptionsMarketOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateBinaryOptionsMarketOrderAminoMsg { + type: "exchange/MsgCreateBinaryOptionsMarketOrder"; + value: MsgCreateBinaryOptionsMarketOrderAmino; +} +/** + * MsgCreateBinaryOptionsMarketOrderResponse defines the + * Msg/CreateBinaryOptionsMarketOrder response type. + */ +export interface MsgCreateBinaryOptionsMarketOrderResponse { + orderHash: string; + results?: DerivativeMarketOrderResults; + cid: string; +} +export interface MsgCreateBinaryOptionsMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateBinaryOptionsMarketOrderResponse defines the + * Msg/CreateBinaryOptionsMarketOrder response type. + */ +export interface MsgCreateBinaryOptionsMarketOrderResponseAmino { + order_hash: string; + results?: DerivativeMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateBinaryOptionsMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse"; + value: MsgCreateBinaryOptionsMarketOrderResponseAmino; +} +/** MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. */ +export interface MsgCancelDerivativeOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface MsgCancelDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder"; + value: Uint8Array; +} +/** MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. */ +export interface MsgCancelDerivativeOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface MsgCancelDerivativeOrderAminoMsg { + type: "exchange/MsgCancelDerivativeOrder"; + value: MsgCancelDerivativeOrderAmino; +} +/** + * MsgCancelDerivativeOrderResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgCancelDerivativeOrderResponse {} +export interface MsgCancelDerivativeOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse"; + value: Uint8Array; +} +/** + * MsgCancelDerivativeOrderResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgCancelDerivativeOrderResponseAmino {} +export interface MsgCancelDerivativeOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse"; + value: MsgCancelDerivativeOrderResponseAmino; +} +/** + * MsgCancelBinaryOptionsOrder defines the Msg/CancelBinaryOptionsOrder response + * type. + */ +export interface MsgCancelBinaryOptionsOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface MsgCancelBinaryOptionsOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder"; + value: Uint8Array; +} +/** + * MsgCancelBinaryOptionsOrder defines the Msg/CancelBinaryOptionsOrder response + * type. + */ +export interface MsgCancelBinaryOptionsOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface MsgCancelBinaryOptionsOrderAminoMsg { + type: "exchange/MsgCancelBinaryOptionsOrder"; + value: MsgCancelBinaryOptionsOrderAmino; +} +/** + * MsgCancelBinaryOptionsOrderResponse defines the + * Msg/CancelBinaryOptionsOrderResponse response type. + */ +export interface MsgCancelBinaryOptionsOrderResponse {} +export interface MsgCancelBinaryOptionsOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse"; + value: Uint8Array; +} +/** + * MsgCancelBinaryOptionsOrderResponse defines the + * Msg/CancelBinaryOptionsOrderResponse response type. + */ +export interface MsgCancelBinaryOptionsOrderResponseAmino {} +export interface MsgCancelBinaryOptionsOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse"; + value: MsgCancelBinaryOptionsOrderResponseAmino; +} +export interface OrderData { + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface OrderDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderData"; + value: Uint8Array; +} +export interface OrderDataAmino { + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface OrderDataAminoMsg { + type: "/injective.exchange.v1beta1.OrderData"; + value: OrderDataAmino; +} +/** + * MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders + * response type. + */ +export interface MsgBatchCancelDerivativeOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelDerivativeOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders"; + value: Uint8Array; +} +/** + * MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders + * response type. + */ +export interface MsgBatchCancelDerivativeOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelDerivativeOrdersAminoMsg { + type: "exchange/MsgBatchCancelDerivativeOrders"; + value: MsgBatchCancelDerivativeOrdersAmino; +} +/** + * MsgBatchCancelDerivativeOrdersResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgBatchCancelDerivativeOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCancelDerivativeOrdersResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgBatchCancelDerivativeOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse"; + value: MsgBatchCancelDerivativeOrdersResponseAmino; +} +/** A Cosmos-SDK MsgSubaccountTransfer */ +export interface MsgSubaccountTransfer { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + amount: Coin; +} +export interface MsgSubaccountTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgSubaccountTransfer */ +export interface MsgSubaccountTransferAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + amount: CoinAmino; +} +export interface MsgSubaccountTransferAminoMsg { + type: "exchange/MsgSubaccountTransfer"; + value: MsgSubaccountTransferAmino; +} +/** + * MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response + * type. + */ +export interface MsgSubaccountTransferResponse {} +export interface MsgSubaccountTransferResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse"; + value: Uint8Array; +} +/** + * MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response + * type. + */ +export interface MsgSubaccountTransferResponseAmino {} +export interface MsgSubaccountTransferResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse"; + value: MsgSubaccountTransferResponseAmino; +} +/** A Cosmos-SDK MsgExternalTransfer */ +export interface MsgExternalTransfer { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + amount: Coin; +} +export interface MsgExternalTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgExternalTransfer */ +export interface MsgExternalTransferAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + amount: CoinAmino; +} +export interface MsgExternalTransferAminoMsg { + type: "exchange/MsgExternalTransfer"; + value: MsgExternalTransferAmino; +} +/** MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. */ +export interface MsgExternalTransferResponse {} +export interface MsgExternalTransferResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse"; + value: Uint8Array; +} +/** MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. */ +export interface MsgExternalTransferResponseAmino {} +export interface MsgExternalTransferResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgExternalTransferResponse"; + value: MsgExternalTransferResponseAmino; +} +/** A Cosmos-SDK MsgLiquidatePosition */ +export interface MsgLiquidatePosition { + sender: string; + subaccountId: string; + marketId: string; + /** optional order to provide for liquidation */ + order?: DerivativeOrder; +} +export interface MsgLiquidatePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgLiquidatePosition */ +export interface MsgLiquidatePositionAmino { + sender: string; + subaccount_id: string; + market_id: string; + /** optional order to provide for liquidation */ + order?: DerivativeOrderAmino; +} +export interface MsgLiquidatePositionAminoMsg { + type: "exchange/MsgLiquidatePosition"; + value: MsgLiquidatePositionAmino; +} +/** MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. */ +export interface MsgLiquidatePositionResponse {} +export interface MsgLiquidatePositionResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse"; + value: Uint8Array; +} +/** MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. */ +export interface MsgLiquidatePositionResponseAmino {} +export interface MsgLiquidatePositionResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse"; + value: MsgLiquidatePositionResponseAmino; +} +/** A Cosmos-SDK MsgEmergencySettleMarket */ +export interface MsgEmergencySettleMarket { + sender: string; + subaccountId: string; + marketId: string; +} +export interface MsgEmergencySettleMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgEmergencySettleMarket */ +export interface MsgEmergencySettleMarketAmino { + sender: string; + subaccount_id: string; + market_id: string; +} +export interface MsgEmergencySettleMarketAminoMsg { + type: "exchange/MsgEmergencySettleMarket"; + value: MsgEmergencySettleMarketAmino; +} +/** + * MsgEmergencySettleMarketResponse defines the Msg/EmergencySettleMarket + * response type. + */ +export interface MsgEmergencySettleMarketResponse {} +export interface MsgEmergencySettleMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse"; + value: Uint8Array; +} +/** + * MsgEmergencySettleMarketResponse defines the Msg/EmergencySettleMarket + * response type. + */ +export interface MsgEmergencySettleMarketResponseAmino {} +export interface MsgEmergencySettleMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse"; + value: MsgEmergencySettleMarketResponseAmino; +} +/** A Cosmos-SDK MsgIncreasePositionMargin */ +export interface MsgIncreasePositionMargin { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + marketId: string; + /** amount defines the amount of margin to add to the position */ + amount: string; +} +export interface MsgIncreasePositionMarginProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgIncreasePositionMargin */ +export interface MsgIncreasePositionMarginAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + market_id: string; + /** amount defines the amount of margin to add to the position */ + amount: string; +} +export interface MsgIncreasePositionMarginAminoMsg { + type: "exchange/MsgIncreasePositionMargin"; + value: MsgIncreasePositionMarginAmino; +} +/** + * MsgIncreasePositionMarginResponse defines the Msg/IncreasePositionMargin + * response type. + */ +export interface MsgIncreasePositionMarginResponse {} +export interface MsgIncreasePositionMarginResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse"; + value: Uint8Array; +} +/** + * MsgIncreasePositionMarginResponse defines the Msg/IncreasePositionMargin + * response type. + */ +export interface MsgIncreasePositionMarginResponseAmino {} +export interface MsgIncreasePositionMarginResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse"; + value: MsgIncreasePositionMarginResponseAmino; +} +/** A Cosmos-SDK MsgDecreasePositionMargin */ +export interface MsgDecreasePositionMargin { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + marketId: string; + /** amount defines the amount of margin to withdraw from the position */ + amount: string; +} +export interface MsgDecreasePositionMarginProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgDecreasePositionMargin */ +export interface MsgDecreasePositionMarginAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + market_id: string; + /** amount defines the amount of margin to withdraw from the position */ + amount: string; +} +export interface MsgDecreasePositionMarginAminoMsg { + type: "exchange/MsgDecreasePositionMargin"; + value: MsgDecreasePositionMarginAmino; +} +/** + * MsgDecreasePositionMarginResponse defines the Msg/MsgDecreasePositionMargin + * response type. + */ +export interface MsgDecreasePositionMarginResponse {} +export interface MsgDecreasePositionMarginResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse"; + value: Uint8Array; +} +/** + * MsgDecreasePositionMarginResponse defines the Msg/MsgDecreasePositionMargin + * response type. + */ +export interface MsgDecreasePositionMarginResponseAmino {} +export interface MsgDecreasePositionMarginResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse"; + value: MsgDecreasePositionMarginResponseAmino; +} +/** MsgPrivilegedExecuteContract defines the Msg/Exec message type */ +export interface MsgPrivilegedExecuteContract { + sender: string; + /** + * funds defines the user's bank coins used to fund the execution (e.g. + * 100inj). + */ + funds: string; + /** contract_address defines the contract address to execute */ + contractAddress: string; + /** data defines the call data used when executing the contract */ + data: string; +} +export interface MsgPrivilegedExecuteContractProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract"; + value: Uint8Array; +} +/** MsgPrivilegedExecuteContract defines the Msg/Exec message type */ +export interface MsgPrivilegedExecuteContractAmino { + sender: string; + /** + * funds defines the user's bank coins used to fund the execution (e.g. + * 100inj). + */ + funds: string; + /** contract_address defines the contract address to execute */ + contract_address: string; + /** data defines the call data used when executing the contract */ + data: string; +} +export interface MsgPrivilegedExecuteContractAminoMsg { + type: "exchange/MsgPrivilegedExecuteContract"; + value: MsgPrivilegedExecuteContractAmino; +} +/** MsgPrivilegedExecuteContractResponse defines the Msg/Exec response type. */ +export interface MsgPrivilegedExecuteContractResponse { + fundsDiff: Coin[]; +} +export interface MsgPrivilegedExecuteContractResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse"; + value: Uint8Array; +} +/** MsgPrivilegedExecuteContractResponse defines the Msg/Exec response type. */ +export interface MsgPrivilegedExecuteContractResponseAmino { + funds_diff: CoinAmino[]; +} +export interface MsgPrivilegedExecuteContractResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse"; + value: MsgPrivilegedExecuteContractResponseAmino; +} +/** A Cosmos-SDK MsgRewardsOptOut */ +export interface MsgRewardsOptOut { + sender: string; +} +export interface MsgRewardsOptOutProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgRewardsOptOut */ +export interface MsgRewardsOptOutAmino { + sender: string; +} +export interface MsgRewardsOptOutAminoMsg { + type: "exchange/MsgRewardsOptOut"; + value: MsgRewardsOptOutAmino; +} +/** MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. */ +export interface MsgRewardsOptOutResponse {} +export interface MsgRewardsOptOutResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse"; + value: Uint8Array; +} +/** MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. */ +export interface MsgRewardsOptOutResponseAmino {} +export interface MsgRewardsOptOutResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse"; + value: MsgRewardsOptOutResponseAmino; +} +/** A Cosmos-SDK MsgReclaimLockedFunds */ +export interface MsgReclaimLockedFunds { + sender: string; + lockedAccountPubKey: Uint8Array; + signature: Uint8Array; +} +export interface MsgReclaimLockedFundsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgReclaimLockedFunds */ +export interface MsgReclaimLockedFundsAmino { + sender: string; + lockedAccountPubKey: string; + signature: string; +} +export interface MsgReclaimLockedFundsAminoMsg { + type: "exchange/MsgReclaimLockedFunds"; + value: MsgReclaimLockedFundsAmino; +} +/** + * MsgReclaimLockedFundsResponse defines the Msg/ReclaimLockedFunds response + * type. + */ +export interface MsgReclaimLockedFundsResponse {} +export interface MsgReclaimLockedFundsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse"; + value: Uint8Array; +} +/** + * MsgReclaimLockedFundsResponse defines the Msg/ReclaimLockedFunds response + * type. + */ +export interface MsgReclaimLockedFundsResponseAmino {} +export interface MsgReclaimLockedFundsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse"; + value: MsgReclaimLockedFundsResponseAmino; +} +/** MsgSignData defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignData { + /** Signer is the sdk.AccAddress of the message signer */ + signer: Uint8Array; + /** + * Data represents the raw bytes of the content that is signed (text, json, + * etc) + */ + data: Uint8Array; +} +export interface MsgSignDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSignData"; + value: Uint8Array; +} +/** MsgSignData defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDataAmino { + /** Signer is the sdk.AccAddress of the message signer */ + Signer: string; + /** + * Data represents the raw bytes of the content that is signed (text, json, + * etc) + */ + Data: string; +} +export interface MsgSignDataAminoMsg { + type: "/injective.exchange.v1beta1.MsgSignData"; + value: MsgSignDataAmino; +} +/** MsgSignDoc defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDoc { + signType: string; + value: MsgSignData; +} +export interface MsgSignDocProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc"; + value: Uint8Array; +} +/** MsgSignDoc defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDocAmino { + sign_type: string; + value: MsgSignDataAmino; +} +export interface MsgSignDocAminoMsg { + type: "/injective.exchange.v1beta1.MsgSignDoc"; + value: MsgSignDocAmino; +} +/** + * MsgAdminUpdateBinaryOptionsMarket is used by the market Admin to operate the + * market + */ +export interface MsgAdminUpdateBinaryOptionsMarket { + sender: string; + marketId: string; + /** new price at which market will be settled */ + settlementPrice?: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** Status of the market */ + status: MarketStatus; +} +export interface MsgAdminUpdateBinaryOptionsMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket"; + value: Uint8Array; +} +/** + * MsgAdminUpdateBinaryOptionsMarket is used by the market Admin to operate the + * market + */ +export interface MsgAdminUpdateBinaryOptionsMarketAmino { + sender: string; + market_id: string; + /** new price at which market will be settled */ + settlement_price?: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** Status of the market */ + status: MarketStatus; +} +export interface MsgAdminUpdateBinaryOptionsMarketAminoMsg { + type: "exchange/MsgAdminUpdateBinaryOptionsMarket"; + value: MsgAdminUpdateBinaryOptionsMarketAmino; +} +/** + * MsgAdminUpdateBinaryOptionsMarketResponse is the response for + * AdminUpdateBinaryOptionsMarket rpc method + */ +export interface MsgAdminUpdateBinaryOptionsMarketResponse {} +export interface MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse"; + value: Uint8Array; +} +/** + * MsgAdminUpdateBinaryOptionsMarketResponse is the response for + * AdminUpdateBinaryOptionsMarket rpc method + */ +export interface MsgAdminUpdateBinaryOptionsMarketResponseAmino {} +export interface MsgAdminUpdateBinaryOptionsMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse"; + value: MsgAdminUpdateBinaryOptionsMarketResponseAmino; +} +/** MsgAuthorizeStakeGrants grants stakes to grantees. */ +export interface MsgAuthorizeStakeGrants { + sender: string; + grants: GrantAuthorization[]; +} +export interface MsgAuthorizeStakeGrantsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants"; + value: Uint8Array; +} +/** MsgAuthorizeStakeGrants grants stakes to grantees. */ +export interface MsgAuthorizeStakeGrantsAmino { + sender: string; + grants: GrantAuthorizationAmino[]; +} +export interface MsgAuthorizeStakeGrantsAminoMsg { + type: "exchange/MsgAuthorizeStakeGrants"; + value: MsgAuthorizeStakeGrantsAmino; +} +export interface MsgAuthorizeStakeGrantsResponse {} +export interface MsgAuthorizeStakeGrantsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse"; + value: Uint8Array; +} +export interface MsgAuthorizeStakeGrantsResponseAmino {} +export interface MsgAuthorizeStakeGrantsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse"; + value: MsgAuthorizeStakeGrantsResponseAmino; +} +/** MsgActivateStakeGrant allows a grantee to activate a stake grant. */ +export interface MsgActivateStakeGrant { + sender: string; + granter: string; +} +export interface MsgActivateStakeGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant"; + value: Uint8Array; +} +/** MsgActivateStakeGrant allows a grantee to activate a stake grant. */ +export interface MsgActivateStakeGrantAmino { + sender: string; + granter: string; +} +export interface MsgActivateStakeGrantAminoMsg { + type: "exchange/MsgActivateStakeGrant"; + value: MsgActivateStakeGrantAmino; +} +export interface MsgActivateStakeGrantResponse {} +export interface MsgActivateStakeGrantResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse"; + value: Uint8Array; +} +export interface MsgActivateStakeGrantResponseAmino {} +export interface MsgActivateStakeGrantResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse"; + value: MsgActivateStakeGrantResponseAmino; +} +function createBaseMsgUpdateSpotMarket(): MsgUpdateSpotMarket { + return { + admin: "", + marketId: "", + newTicker: "", + newMinPriceTickSize: "", + newMinQuantityTickSize: "", + newMinNotional: "" + }; +} +export const MsgUpdateSpotMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket", + aminoType: "exchange/MsgUpdateSpotMarket", + is(o: any): o is MsgUpdateSpotMarket { + return o && (o.$typeUrl === MsgUpdateSpotMarket.typeUrl || typeof o.admin === "string" && typeof o.marketId === "string" && typeof o.newTicker === "string" && typeof o.newMinPriceTickSize === "string" && typeof o.newMinQuantityTickSize === "string" && typeof o.newMinNotional === "string"); + }, + isAmino(o: any): o is MsgUpdateSpotMarketAmino { + return o && (o.$typeUrl === MsgUpdateSpotMarket.typeUrl || typeof o.admin === "string" && typeof o.market_id === "string" && typeof o.new_ticker === "string" && typeof o.new_min_price_tick_size === "string" && typeof o.new_min_quantity_tick_size === "string" && typeof o.new_min_notional === "string"); + }, + encode(message: MsgUpdateSpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.newTicker !== "") { + writer.uint32(26).string(message.newTicker); + } + if (message.newMinPriceTickSize !== "") { + writer.uint32(34).string(message.newMinPriceTickSize); + } + if (message.newMinQuantityTickSize !== "") { + writer.uint32(42).string(message.newMinQuantityTickSize); + } + if (message.newMinNotional !== "") { + writer.uint32(50).string(message.newMinNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.newTicker = reader.string(); + break; + case 4: + message.newMinPriceTickSize = reader.string(); + break; + case 5: + message.newMinQuantityTickSize = reader.string(); + break; + case 6: + message.newMinNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateSpotMarket { + const message = createBaseMsgUpdateSpotMarket(); + message.admin = object.admin ?? ""; + message.marketId = object.marketId ?? ""; + message.newTicker = object.newTicker ?? ""; + message.newMinPriceTickSize = object.newMinPriceTickSize ?? ""; + message.newMinQuantityTickSize = object.newMinQuantityTickSize ?? ""; + message.newMinNotional = object.newMinNotional ?? ""; + return message; + }, + fromAmino(object: MsgUpdateSpotMarketAmino): MsgUpdateSpotMarket { + const message = createBaseMsgUpdateSpotMarket(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.new_ticker !== undefined && object.new_ticker !== null) { + message.newTicker = object.new_ticker; + } + if (object.new_min_price_tick_size !== undefined && object.new_min_price_tick_size !== null) { + message.newMinPriceTickSize = object.new_min_price_tick_size; + } + if (object.new_min_quantity_tick_size !== undefined && object.new_min_quantity_tick_size !== null) { + message.newMinQuantityTickSize = object.new_min_quantity_tick_size; + } + if (object.new_min_notional !== undefined && object.new_min_notional !== null) { + message.newMinNotional = object.new_min_notional; + } + return message; + }, + toAmino(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.new_ticker = message.newTicker === "" ? undefined : message.newTicker; + obj.new_min_price_tick_size = message.newMinPriceTickSize === "" ? undefined : message.newMinPriceTickSize; + obj.new_min_quantity_tick_size = message.newMinQuantityTickSize === "" ? undefined : message.newMinQuantityTickSize; + obj.new_min_notional = message.newMinNotional === "" ? undefined : message.newMinNotional; + return obj; + }, + fromAminoMsg(object: MsgUpdateSpotMarketAminoMsg): MsgUpdateSpotMarket { + return MsgUpdateSpotMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketAminoMsg { + return { + type: "exchange/MsgUpdateSpotMarket", + value: MsgUpdateSpotMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateSpotMarketProtoMsg): MsgUpdateSpotMarket { + return MsgUpdateSpotMarket.decode(message.value); + }, + toProto(message: MsgUpdateSpotMarket): Uint8Array { + return MsgUpdateSpotMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket", + value: MsgUpdateSpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateSpotMarket.typeUrl, MsgUpdateSpotMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateSpotMarket.aminoType, MsgUpdateSpotMarket.typeUrl); +function createBaseMsgUpdateSpotMarketResponse(): MsgUpdateSpotMarketResponse { + return {}; +} +export const MsgUpdateSpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse", + is(o: any): o is MsgUpdateSpotMarketResponse { + return o && o.$typeUrl === MsgUpdateSpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateSpotMarketResponseAmino { + return o && o.$typeUrl === MsgUpdateSpotMarketResponse.typeUrl; + }, + encode(_: MsgUpdateSpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateSpotMarketResponse { + const message = createBaseMsgUpdateSpotMarketResponse(); + return message; + }, + fromAmino(_: MsgUpdateSpotMarketResponseAmino): MsgUpdateSpotMarketResponse { + const message = createBaseMsgUpdateSpotMarketResponse(); + return message; + }, + toAmino(_: MsgUpdateSpotMarketResponse): MsgUpdateSpotMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateSpotMarketResponseAminoMsg): MsgUpdateSpotMarketResponse { + return MsgUpdateSpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateSpotMarketResponseProtoMsg): MsgUpdateSpotMarketResponse { + return MsgUpdateSpotMarketResponse.decode(message.value); + }, + toProto(message: MsgUpdateSpotMarketResponse): Uint8Array { + return MsgUpdateSpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSpotMarketResponse): MsgUpdateSpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse", + value: MsgUpdateSpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateSpotMarketResponse.typeUrl, MsgUpdateSpotMarketResponse); +function createBaseMsgUpdateDerivativeMarket(): MsgUpdateDerivativeMarket { + return { + admin: "", + marketId: "", + newTicker: "", + newMinPriceTickSize: "", + newMinQuantityTickSize: "", + newMinNotional: "", + newInitialMarginRatio: "", + newMaintenanceMarginRatio: "" + }; +} +export const MsgUpdateDerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket", + aminoType: "exchange/MsgUpdateDerivativeMarket", + is(o: any): o is MsgUpdateDerivativeMarket { + return o && (o.$typeUrl === MsgUpdateDerivativeMarket.typeUrl || typeof o.admin === "string" && typeof o.marketId === "string" && typeof o.newTicker === "string" && typeof o.newMinPriceTickSize === "string" && typeof o.newMinQuantityTickSize === "string" && typeof o.newMinNotional === "string" && typeof o.newInitialMarginRatio === "string" && typeof o.newMaintenanceMarginRatio === "string"); + }, + isAmino(o: any): o is MsgUpdateDerivativeMarketAmino { + return o && (o.$typeUrl === MsgUpdateDerivativeMarket.typeUrl || typeof o.admin === "string" && typeof o.market_id === "string" && typeof o.new_ticker === "string" && typeof o.new_min_price_tick_size === "string" && typeof o.new_min_quantity_tick_size === "string" && typeof o.new_min_notional === "string" && typeof o.new_initial_margin_ratio === "string" && typeof o.new_maintenance_margin_ratio === "string"); + }, + encode(message: MsgUpdateDerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.newTicker !== "") { + writer.uint32(26).string(message.newTicker); + } + if (message.newMinPriceTickSize !== "") { + writer.uint32(34).string(message.newMinPriceTickSize); + } + if (message.newMinQuantityTickSize !== "") { + writer.uint32(42).string(message.newMinQuantityTickSize); + } + if (message.newMinNotional !== "") { + writer.uint32(50).string(message.newMinNotional); + } + if (message.newInitialMarginRatio !== "") { + writer.uint32(58).string(message.newInitialMarginRatio); + } + if (message.newMaintenanceMarginRatio !== "") { + writer.uint32(66).string(message.newMaintenanceMarginRatio); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.newTicker = reader.string(); + break; + case 4: + message.newMinPriceTickSize = reader.string(); + break; + case 5: + message.newMinQuantityTickSize = reader.string(); + break; + case 6: + message.newMinNotional = reader.string(); + break; + case 7: + message.newInitialMarginRatio = reader.string(); + break; + case 8: + message.newMaintenanceMarginRatio = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateDerivativeMarket { + const message = createBaseMsgUpdateDerivativeMarket(); + message.admin = object.admin ?? ""; + message.marketId = object.marketId ?? ""; + message.newTicker = object.newTicker ?? ""; + message.newMinPriceTickSize = object.newMinPriceTickSize ?? ""; + message.newMinQuantityTickSize = object.newMinQuantityTickSize ?? ""; + message.newMinNotional = object.newMinNotional ?? ""; + message.newInitialMarginRatio = object.newInitialMarginRatio ?? ""; + message.newMaintenanceMarginRatio = object.newMaintenanceMarginRatio ?? ""; + return message; + }, + fromAmino(object: MsgUpdateDerivativeMarketAmino): MsgUpdateDerivativeMarket { + const message = createBaseMsgUpdateDerivativeMarket(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.new_ticker !== undefined && object.new_ticker !== null) { + message.newTicker = object.new_ticker; + } + if (object.new_min_price_tick_size !== undefined && object.new_min_price_tick_size !== null) { + message.newMinPriceTickSize = object.new_min_price_tick_size; + } + if (object.new_min_quantity_tick_size !== undefined && object.new_min_quantity_tick_size !== null) { + message.newMinQuantityTickSize = object.new_min_quantity_tick_size; + } + if (object.new_min_notional !== undefined && object.new_min_notional !== null) { + message.newMinNotional = object.new_min_notional; + } + if (object.new_initial_margin_ratio !== undefined && object.new_initial_margin_ratio !== null) { + message.newInitialMarginRatio = object.new_initial_margin_ratio; + } + if (object.new_maintenance_margin_ratio !== undefined && object.new_maintenance_margin_ratio !== null) { + message.newMaintenanceMarginRatio = object.new_maintenance_margin_ratio; + } + return message; + }, + toAmino(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.new_ticker = message.newTicker === "" ? undefined : message.newTicker; + obj.new_min_price_tick_size = message.newMinPriceTickSize === "" ? undefined : message.newMinPriceTickSize; + obj.new_min_quantity_tick_size = message.newMinQuantityTickSize === "" ? undefined : message.newMinQuantityTickSize; + obj.new_min_notional = message.newMinNotional === "" ? undefined : message.newMinNotional; + obj.new_initial_margin_ratio = message.newInitialMarginRatio === "" ? undefined : message.newInitialMarginRatio; + obj.new_maintenance_margin_ratio = message.newMaintenanceMarginRatio === "" ? undefined : message.newMaintenanceMarginRatio; + return obj; + }, + fromAminoMsg(object: MsgUpdateDerivativeMarketAminoMsg): MsgUpdateDerivativeMarket { + return MsgUpdateDerivativeMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketAminoMsg { + return { + type: "exchange/MsgUpdateDerivativeMarket", + value: MsgUpdateDerivativeMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateDerivativeMarketProtoMsg): MsgUpdateDerivativeMarket { + return MsgUpdateDerivativeMarket.decode(message.value); + }, + toProto(message: MsgUpdateDerivativeMarket): Uint8Array { + return MsgUpdateDerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket", + value: MsgUpdateDerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateDerivativeMarket.typeUrl, MsgUpdateDerivativeMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateDerivativeMarket.aminoType, MsgUpdateDerivativeMarket.typeUrl); +function createBaseMsgUpdateDerivativeMarketResponse(): MsgUpdateDerivativeMarketResponse { + return {}; +} +export const MsgUpdateDerivativeMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse", + is(o: any): o is MsgUpdateDerivativeMarketResponse { + return o && o.$typeUrl === MsgUpdateDerivativeMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateDerivativeMarketResponseAmino { + return o && o.$typeUrl === MsgUpdateDerivativeMarketResponse.typeUrl; + }, + encode(_: MsgUpdateDerivativeMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDerivativeMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDerivativeMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateDerivativeMarketResponse { + const message = createBaseMsgUpdateDerivativeMarketResponse(); + return message; + }, + fromAmino(_: MsgUpdateDerivativeMarketResponseAmino): MsgUpdateDerivativeMarketResponse { + const message = createBaseMsgUpdateDerivativeMarketResponse(); + return message; + }, + toAmino(_: MsgUpdateDerivativeMarketResponse): MsgUpdateDerivativeMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateDerivativeMarketResponseAminoMsg): MsgUpdateDerivativeMarketResponse { + return MsgUpdateDerivativeMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDerivativeMarketResponseProtoMsg): MsgUpdateDerivativeMarketResponse { + return MsgUpdateDerivativeMarketResponse.decode(message.value); + }, + toProto(message: MsgUpdateDerivativeMarketResponse): Uint8Array { + return MsgUpdateDerivativeMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDerivativeMarketResponse): MsgUpdateDerivativeMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse", + value: MsgUpdateDerivativeMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateDerivativeMarketResponse.typeUrl, MsgUpdateDerivativeMarketResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParams", + aminoType: "exchange/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "exchange/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: "/injective.exchange.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgDeposit(): MsgDeposit { + return { + sender: "", + subaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgDeposit = { + typeUrl: "/injective.exchange.v1beta1.MsgDeposit", + aminoType: "exchange/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, 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.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeposit { + const message = createBaseMsgDeposit(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgDeposit): MsgDepositAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: "exchange/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: "/injective.exchange.v1beta1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value); + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +function createBaseMsgWithdraw(): MsgWithdraw { + return { + sender: "", + subaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgWithdraw = { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw", + aminoType: "exchange/MsgWithdraw", + is(o: any): o is MsgWithdraw { + return o && (o.$typeUrl === MsgWithdraw.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgWithdrawAmino { + return o && (o.$typeUrl === MsgWithdraw.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdraw { + const message = createBaseMsgWithdraw(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgWithdrawAmino): MsgWithdraw { + const message = createBaseMsgWithdraw(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgWithdraw): MsgWithdrawAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgWithdrawAminoMsg): MsgWithdraw { + return MsgWithdraw.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdraw): MsgWithdrawAminoMsg { + return { + type: "exchange/MsgWithdraw", + value: MsgWithdraw.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProtoMsg): MsgWithdraw { + return MsgWithdraw.decode(message.value); + }, + toProto(message: MsgWithdraw): Uint8Array { + return MsgWithdraw.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdraw): MsgWithdrawProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw", + value: MsgWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdraw.typeUrl, MsgWithdraw); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdraw.aminoType, MsgWithdraw.typeUrl); +function createBaseMsgWithdrawResponse(): MsgWithdrawResponse { + return {}; +} +export const MsgWithdrawResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse", + is(o: any): o is MsgWithdrawResponse { + return o && o.$typeUrl === MsgWithdrawResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawResponseAmino { + return o && o.$typeUrl === MsgWithdrawResponse.typeUrl; + }, + encode(_: MsgWithdrawResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawResponse { + const message = createBaseMsgWithdrawResponse(); + return message; + }, + fromAmino(_: MsgWithdrawResponseAmino): MsgWithdrawResponse { + const message = createBaseMsgWithdrawResponse(); + return message; + }, + toAmino(_: MsgWithdrawResponse): MsgWithdrawResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawResponseAminoMsg): MsgWithdrawResponse { + return MsgWithdrawResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawResponseProtoMsg): MsgWithdrawResponse { + return MsgWithdrawResponse.decode(message.value); + }, + toProto(message: MsgWithdrawResponse): Uint8Array { + return MsgWithdrawResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawResponse): MsgWithdrawResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse", + value: MsgWithdrawResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawResponse.typeUrl, MsgWithdrawResponse); +function createBaseMsgCreateSpotLimitOrder(): MsgCreateSpotLimitOrder { + return { + sender: "", + order: SpotOrder.fromPartial({}) + }; +} +export const MsgCreateSpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder", + aminoType: "exchange/MsgCreateSpotLimitOrder", + is(o: any): o is MsgCreateSpotLimitOrder { + return o && (o.$typeUrl === MsgCreateSpotLimitOrder.typeUrl || typeof o.sender === "string" && SpotOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateSpotLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateSpotLimitOrder.typeUrl || typeof o.sender === "string" && SpotOrder.isAmino(o.order)); + }, + encode(message: MsgCreateSpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotLimitOrder { + const message = createBaseMsgCreateSpotLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateSpotLimitOrderAmino): MsgCreateSpotLimitOrder { + const message = createBaseMsgCreateSpotLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotLimitOrderAminoMsg): MsgCreateSpotLimitOrder { + return MsgCreateSpotLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateSpotLimitOrder", + value: MsgCreateSpotLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateSpotLimitOrderProtoMsg): MsgCreateSpotLimitOrder { + return MsgCreateSpotLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateSpotLimitOrder): Uint8Array { + return MsgCreateSpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder", + value: MsgCreateSpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotLimitOrder.typeUrl, MsgCreateSpotLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateSpotLimitOrder.aminoType, MsgCreateSpotLimitOrder.typeUrl); +function createBaseMsgCreateSpotLimitOrderResponse(): MsgCreateSpotLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateSpotLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse", + is(o: any): o is MsgCreateSpotLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateSpotLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateSpotLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateSpotLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateSpotLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotLimitOrderResponse { + const message = createBaseMsgCreateSpotLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateSpotLimitOrderResponseAmino): MsgCreateSpotLimitOrderResponse { + const message = createBaseMsgCreateSpotLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateSpotLimitOrderResponse): MsgCreateSpotLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotLimitOrderResponseAminoMsg): MsgCreateSpotLimitOrderResponse { + return MsgCreateSpotLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateSpotLimitOrderResponseProtoMsg): MsgCreateSpotLimitOrderResponse { + return MsgCreateSpotLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateSpotLimitOrderResponse): Uint8Array { + return MsgCreateSpotLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotLimitOrderResponse): MsgCreateSpotLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse", + value: MsgCreateSpotLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotLimitOrderResponse.typeUrl, MsgCreateSpotLimitOrderResponse); +function createBaseMsgBatchCreateSpotLimitOrders(): MsgBatchCreateSpotLimitOrders { + return { + sender: "", + orders: [] + }; +} +export const MsgBatchCreateSpotLimitOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders", + aminoType: "exchange/MsgBatchCreateSpotLimitOrders", + is(o: any): o is MsgBatchCreateSpotLimitOrders { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || SpotOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is MsgBatchCreateSpotLimitOrdersAmino { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || SpotOrder.isAmino(o.orders[0]))); + }, + encode(message: MsgBatchCreateSpotLimitOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.orders) { + SpotOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateSpotLimitOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateSpotLimitOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orders.push(SpotOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateSpotLimitOrders { + const message = createBaseMsgBatchCreateSpotLimitOrders(); + message.sender = object.sender ?? ""; + message.orders = object.orders?.map(e => SpotOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCreateSpotLimitOrdersAmino): MsgBatchCreateSpotLimitOrders { + const message = createBaseMsgBatchCreateSpotLimitOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.orders = object.orders?.map(e => SpotOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.orders) { + obj.orders = message.orders.map(e => e ? SpotOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateSpotLimitOrdersAminoMsg): MsgBatchCreateSpotLimitOrders { + return MsgBatchCreateSpotLimitOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersAminoMsg { + return { + type: "exchange/MsgBatchCreateSpotLimitOrders", + value: MsgBatchCreateSpotLimitOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCreateSpotLimitOrdersProtoMsg): MsgBatchCreateSpotLimitOrders { + return MsgBatchCreateSpotLimitOrders.decode(message.value); + }, + toProto(message: MsgBatchCreateSpotLimitOrders): Uint8Array { + return MsgBatchCreateSpotLimitOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders", + value: MsgBatchCreateSpotLimitOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateSpotLimitOrders.typeUrl, MsgBatchCreateSpotLimitOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCreateSpotLimitOrders.aminoType, MsgBatchCreateSpotLimitOrders.typeUrl); +function createBaseMsgBatchCreateSpotLimitOrdersResponse(): MsgBatchCreateSpotLimitOrdersResponse { + return { + orderHashes: [], + createdOrdersCids: [], + failedOrdersCids: [] + }; +} +export const MsgBatchCreateSpotLimitOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse", + is(o: any): o is MsgBatchCreateSpotLimitOrdersResponse { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrdersResponse.typeUrl || Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string") && Array.isArray(o.createdOrdersCids) && (!o.createdOrdersCids.length || typeof o.createdOrdersCids[0] === "string") && Array.isArray(o.failedOrdersCids) && (!o.failedOrdersCids.length || typeof o.failedOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchCreateSpotLimitOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrdersResponse.typeUrl || Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string") && Array.isArray(o.created_orders_cids) && (!o.created_orders_cids.length || typeof o.created_orders_cids[0] === "string") && Array.isArray(o.failed_orders_cids) && (!o.failed_orders_cids.length || typeof o.failed_orders_cids[0] === "string")); + }, + encode(message: MsgBatchCreateSpotLimitOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderHashes) { + writer.uint32(10).string(v!); + } + for (const v of message.createdOrdersCids) { + writer.uint32(18).string(v!); + } + for (const v of message.failedOrdersCids) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateSpotLimitOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHashes.push(reader.string()); + break; + case 2: + message.createdOrdersCids.push(reader.string()); + break; + case 3: + message.failedOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateSpotLimitOrdersResponse { + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + message.orderHashes = object.orderHashes?.map(e => e) || []; + message.createdOrdersCids = object.createdOrdersCids?.map(e => e) || []; + message.failedOrdersCids = object.failedOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCreateSpotLimitOrdersResponseAmino): MsgBatchCreateSpotLimitOrdersResponse { + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + message.orderHashes = object.order_hashes?.map(e => e) || []; + message.createdOrdersCids = object.created_orders_cids?.map(e => e) || []; + message.failedOrdersCids = object.failed_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCreateSpotLimitOrdersResponse): MsgBatchCreateSpotLimitOrdersResponseAmino { + const obj: any = {}; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + if (message.createdOrdersCids) { + obj.created_orders_cids = message.createdOrdersCids.map(e => e); + } else { + obj.created_orders_cids = message.createdOrdersCids; + } + if (message.failedOrdersCids) { + obj.failed_orders_cids = message.failedOrdersCids.map(e => e); + } else { + obj.failed_orders_cids = message.failedOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateSpotLimitOrdersResponseAminoMsg): MsgBatchCreateSpotLimitOrdersResponse { + return MsgBatchCreateSpotLimitOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCreateSpotLimitOrdersResponseProtoMsg): MsgBatchCreateSpotLimitOrdersResponse { + return MsgBatchCreateSpotLimitOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCreateSpotLimitOrdersResponse): Uint8Array { + return MsgBatchCreateSpotLimitOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateSpotLimitOrdersResponse): MsgBatchCreateSpotLimitOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse", + value: MsgBatchCreateSpotLimitOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateSpotLimitOrdersResponse.typeUrl, MsgBatchCreateSpotLimitOrdersResponse); +function createBaseMsgInstantSpotMarketLaunch(): MsgInstantSpotMarketLaunch { + return { + sender: "", + ticker: "", + baseDenom: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantSpotMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch", + aminoType: "exchange/MsgInstantSpotMarketLaunch", + is(o: any): o is MsgInstantSpotMarketLaunch { + return o && (o.$typeUrl === MsgInstantSpotMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantSpotMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantSpotMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantSpotMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(26).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(42).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(50).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(58).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantSpotMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantSpotMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.baseDenom = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.minPriceTickSize = reader.string(); + break; + case 6: + message.minQuantityTickSize = reader.string(); + break; + case 7: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantSpotMarketLaunch { + const message = createBaseMsgInstantSpotMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantSpotMarketLaunchAmino): MsgInstantSpotMarketLaunch { + const message = createBaseMsgInstantSpotMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantSpotMarketLaunchAminoMsg): MsgInstantSpotMarketLaunch { + return MsgInstantSpotMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantSpotMarketLaunch", + value: MsgInstantSpotMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantSpotMarketLaunchProtoMsg): MsgInstantSpotMarketLaunch { + return MsgInstantSpotMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantSpotMarketLaunch): Uint8Array { + return MsgInstantSpotMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch", + value: MsgInstantSpotMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantSpotMarketLaunch.typeUrl, MsgInstantSpotMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantSpotMarketLaunch.aminoType, MsgInstantSpotMarketLaunch.typeUrl); +function createBaseMsgInstantSpotMarketLaunchResponse(): MsgInstantSpotMarketLaunchResponse { + return {}; +} +export const MsgInstantSpotMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse", + is(o: any): o is MsgInstantSpotMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantSpotMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantSpotMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantSpotMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantSpotMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantSpotMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantSpotMarketLaunchResponse { + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantSpotMarketLaunchResponseAmino): MsgInstantSpotMarketLaunchResponse { + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantSpotMarketLaunchResponse): MsgInstantSpotMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantSpotMarketLaunchResponseAminoMsg): MsgInstantSpotMarketLaunchResponse { + return MsgInstantSpotMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantSpotMarketLaunchResponseProtoMsg): MsgInstantSpotMarketLaunchResponse { + return MsgInstantSpotMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantSpotMarketLaunchResponse): Uint8Array { + return MsgInstantSpotMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantSpotMarketLaunchResponse): MsgInstantSpotMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse", + value: MsgInstantSpotMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantSpotMarketLaunchResponse.typeUrl, MsgInstantSpotMarketLaunchResponse); +function createBaseMsgInstantPerpetualMarketLaunch(): MsgInstantPerpetualMarketLaunch { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + makerFeeRate: "", + takerFeeRate: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantPerpetualMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch", + aminoType: "exchange/MsgInstantPerpetualMarketLaunch", + is(o: any): o is MsgInstantPerpetualMarketLaunch { + return o && (o.$typeUrl === MsgInstantPerpetualMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantPerpetualMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantPerpetualMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantPerpetualMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(48).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(56).int32(message.oracleType); + } + if (message.makerFeeRate !== "") { + writer.uint32(66).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(74).string(message.takerFeeRate); + } + if (message.initialMarginRatio !== "") { + writer.uint32(82).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(90).string(message.maintenanceMarginRatio); + } + if (message.minPriceTickSize !== "") { + writer.uint32(98).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(106).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(114).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantPerpetualMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantPerpetualMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleScaleFactor = reader.uint32(); + break; + case 7: + message.oracleType = (reader.int32() as any); + break; + case 8: + message.makerFeeRate = reader.string(); + break; + case 9: + message.takerFeeRate = reader.string(); + break; + case 10: + message.initialMarginRatio = reader.string(); + break; + case 11: + message.maintenanceMarginRatio = reader.string(); + break; + case 12: + message.minPriceTickSize = reader.string(); + break; + case 13: + message.minQuantityTickSize = reader.string(); + break; + case 14: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantPerpetualMarketLaunch { + const message = createBaseMsgInstantPerpetualMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantPerpetualMarketLaunchAmino): MsgInstantPerpetualMarketLaunch { + const message = createBaseMsgInstantPerpetualMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantPerpetualMarketLaunchAminoMsg): MsgInstantPerpetualMarketLaunch { + return MsgInstantPerpetualMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantPerpetualMarketLaunch", + value: MsgInstantPerpetualMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantPerpetualMarketLaunchProtoMsg): MsgInstantPerpetualMarketLaunch { + return MsgInstantPerpetualMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantPerpetualMarketLaunch): Uint8Array { + return MsgInstantPerpetualMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch", + value: MsgInstantPerpetualMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantPerpetualMarketLaunch.typeUrl, MsgInstantPerpetualMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantPerpetualMarketLaunch.aminoType, MsgInstantPerpetualMarketLaunch.typeUrl); +function createBaseMsgInstantPerpetualMarketLaunchResponse(): MsgInstantPerpetualMarketLaunchResponse { + return {}; +} +export const MsgInstantPerpetualMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse", + is(o: any): o is MsgInstantPerpetualMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantPerpetualMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantPerpetualMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantPerpetualMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantPerpetualMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantPerpetualMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantPerpetualMarketLaunchResponse { + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantPerpetualMarketLaunchResponseAmino): MsgInstantPerpetualMarketLaunchResponse { + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantPerpetualMarketLaunchResponse): MsgInstantPerpetualMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantPerpetualMarketLaunchResponseAminoMsg): MsgInstantPerpetualMarketLaunchResponse { + return MsgInstantPerpetualMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantPerpetualMarketLaunchResponseProtoMsg): MsgInstantPerpetualMarketLaunchResponse { + return MsgInstantPerpetualMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantPerpetualMarketLaunchResponse): Uint8Array { + return MsgInstantPerpetualMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantPerpetualMarketLaunchResponse): MsgInstantPerpetualMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse", + value: MsgInstantPerpetualMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantPerpetualMarketLaunchResponse.typeUrl, MsgInstantPerpetualMarketLaunchResponse); +function createBaseMsgInstantBinaryOptionsMarketLaunch(): MsgInstantBinaryOptionsMarketLaunch { + return { + sender: "", + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + makerFeeRate: "", + takerFeeRate: "", + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantBinaryOptionsMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch", + aminoType: "exchange/MsgInstantBinaryOptionsMarketLaunch", + is(o: any): o is MsgInstantBinaryOptionsMarketLaunch { + return o && (o.$typeUrl === MsgInstantBinaryOptionsMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantBinaryOptionsMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantBinaryOptionsMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantBinaryOptionsMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(26).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(34).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(40).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(48).uint32(message.oracleScaleFactor); + } + if (message.makerFeeRate !== "") { + writer.uint32(58).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(66).string(message.takerFeeRate); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(80).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(90).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(98).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantBinaryOptionsMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.oracleSymbol = reader.string(); + break; + case 4: + message.oracleProvider = reader.string(); + break; + case 5: + message.oracleType = (reader.int32() as any); + break; + case 6: + message.oracleScaleFactor = reader.uint32(); + break; + case 7: + message.makerFeeRate = reader.string(); + break; + case 8: + message.takerFeeRate = reader.string(); + break; + case 9: + message.expirationTimestamp = reader.int64(); + break; + case 10: + message.settlementTimestamp = reader.int64(); + break; + case 11: + message.admin = reader.string(); + break; + case 12: + message.quoteDenom = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantBinaryOptionsMarketLaunch { + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantBinaryOptionsMarketLaunchAmino): MsgInstantBinaryOptionsMarketLaunch { + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantBinaryOptionsMarketLaunchAminoMsg): MsgInstantBinaryOptionsMarketLaunch { + return MsgInstantBinaryOptionsMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantBinaryOptionsMarketLaunch", + value: MsgInstantBinaryOptionsMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchProtoMsg): MsgInstantBinaryOptionsMarketLaunch { + return MsgInstantBinaryOptionsMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantBinaryOptionsMarketLaunch): Uint8Array { + return MsgInstantBinaryOptionsMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch", + value: MsgInstantBinaryOptionsMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantBinaryOptionsMarketLaunch.typeUrl, MsgInstantBinaryOptionsMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantBinaryOptionsMarketLaunch.aminoType, MsgInstantBinaryOptionsMarketLaunch.typeUrl); +function createBaseMsgInstantBinaryOptionsMarketLaunchResponse(): MsgInstantBinaryOptionsMarketLaunchResponse { + return {}; +} +export const MsgInstantBinaryOptionsMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse", + is(o: any): o is MsgInstantBinaryOptionsMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantBinaryOptionsMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantBinaryOptionsMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantBinaryOptionsMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantBinaryOptionsMarketLaunchResponse { + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantBinaryOptionsMarketLaunchResponseAmino): MsgInstantBinaryOptionsMarketLaunchResponse { + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantBinaryOptionsMarketLaunchResponse): MsgInstantBinaryOptionsMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantBinaryOptionsMarketLaunchResponseAminoMsg): MsgInstantBinaryOptionsMarketLaunchResponse { + return MsgInstantBinaryOptionsMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg): MsgInstantBinaryOptionsMarketLaunchResponse { + return MsgInstantBinaryOptionsMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantBinaryOptionsMarketLaunchResponse): Uint8Array { + return MsgInstantBinaryOptionsMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchResponse): MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse", + value: MsgInstantBinaryOptionsMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl, MsgInstantBinaryOptionsMarketLaunchResponse); +function createBaseMsgInstantExpiryFuturesMarketLaunch(): MsgInstantExpiryFuturesMarketLaunch { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + oracleScaleFactor: 0, + expiry: BigInt(0), + makerFeeRate: "", + takerFeeRate: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantExpiryFuturesMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch", + aminoType: "exchange/MsgInstantExpiryFuturesMarketLaunch", + is(o: any): o is MsgInstantExpiryFuturesMarketLaunch { + return o && (o.$typeUrl === MsgInstantExpiryFuturesMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expiry === "bigint" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantExpiryFuturesMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantExpiryFuturesMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiry === "bigint" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantExpiryFuturesMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(64).int64(message.expiry); + } + if (message.makerFeeRate !== "") { + writer.uint32(74).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(82).string(message.takerFeeRate); + } + if (message.initialMarginRatio !== "") { + writer.uint32(90).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(98).string(message.maintenanceMarginRatio); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantExpiryFuturesMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.expiry = reader.int64(); + break; + case 9: + message.makerFeeRate = reader.string(); + break; + case 10: + message.takerFeeRate = reader.string(); + break; + case 11: + message.initialMarginRatio = reader.string(); + break; + case 12: + message.maintenanceMarginRatio = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantExpiryFuturesMarketLaunch { + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantExpiryFuturesMarketLaunchAmino): MsgInstantExpiryFuturesMarketLaunch { + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantExpiryFuturesMarketLaunchAminoMsg): MsgInstantExpiryFuturesMarketLaunch { + return MsgInstantExpiryFuturesMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantExpiryFuturesMarketLaunch", + value: MsgInstantExpiryFuturesMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchProtoMsg): MsgInstantExpiryFuturesMarketLaunch { + return MsgInstantExpiryFuturesMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantExpiryFuturesMarketLaunch): Uint8Array { + return MsgInstantExpiryFuturesMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch", + value: MsgInstantExpiryFuturesMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantExpiryFuturesMarketLaunch.typeUrl, MsgInstantExpiryFuturesMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantExpiryFuturesMarketLaunch.aminoType, MsgInstantExpiryFuturesMarketLaunch.typeUrl); +function createBaseMsgInstantExpiryFuturesMarketLaunchResponse(): MsgInstantExpiryFuturesMarketLaunchResponse { + return {}; +} +export const MsgInstantExpiryFuturesMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse", + is(o: any): o is MsgInstantExpiryFuturesMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantExpiryFuturesMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantExpiryFuturesMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantExpiryFuturesMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantExpiryFuturesMarketLaunchResponse { + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantExpiryFuturesMarketLaunchResponseAmino): MsgInstantExpiryFuturesMarketLaunchResponse { + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantExpiryFuturesMarketLaunchResponse): MsgInstantExpiryFuturesMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantExpiryFuturesMarketLaunchResponseAminoMsg): MsgInstantExpiryFuturesMarketLaunchResponse { + return MsgInstantExpiryFuturesMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg): MsgInstantExpiryFuturesMarketLaunchResponse { + return MsgInstantExpiryFuturesMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantExpiryFuturesMarketLaunchResponse): Uint8Array { + return MsgInstantExpiryFuturesMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchResponse): MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse", + value: MsgInstantExpiryFuturesMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl, MsgInstantExpiryFuturesMarketLaunchResponse); +function createBaseMsgCreateSpotMarketOrder(): MsgCreateSpotMarketOrder { + return { + sender: "", + order: SpotOrder.fromPartial({}) + }; +} +export const MsgCreateSpotMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder", + aminoType: "exchange/MsgCreateSpotMarketOrder", + is(o: any): o is MsgCreateSpotMarketOrder { + return o && (o.$typeUrl === MsgCreateSpotMarketOrder.typeUrl || typeof o.sender === "string" && SpotOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateSpotMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateSpotMarketOrder.typeUrl || typeof o.sender === "string" && SpotOrder.isAmino(o.order)); + }, + encode(message: MsgCreateSpotMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotMarketOrder { + const message = createBaseMsgCreateSpotMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateSpotMarketOrderAmino): MsgCreateSpotMarketOrder { + const message = createBaseMsgCreateSpotMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotMarketOrderAminoMsg): MsgCreateSpotMarketOrder { + return MsgCreateSpotMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateSpotMarketOrder", + value: MsgCreateSpotMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateSpotMarketOrderProtoMsg): MsgCreateSpotMarketOrder { + return MsgCreateSpotMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateSpotMarketOrder): Uint8Array { + return MsgCreateSpotMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder", + value: MsgCreateSpotMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotMarketOrder.typeUrl, MsgCreateSpotMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateSpotMarketOrder.aminoType, MsgCreateSpotMarketOrder.typeUrl); +function createBaseMsgCreateSpotMarketOrderResponse(): MsgCreateSpotMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateSpotMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse", + is(o: any): o is MsgCreateSpotMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateSpotMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateSpotMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateSpotMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateSpotMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + SpotMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = SpotMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotMarketOrderResponse { + const message = createBaseMsgCreateSpotMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? SpotMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateSpotMarketOrderResponseAmino): MsgCreateSpotMarketOrderResponse { + const message = createBaseMsgCreateSpotMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = SpotMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateSpotMarketOrderResponse): MsgCreateSpotMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? SpotMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotMarketOrderResponseAminoMsg): MsgCreateSpotMarketOrderResponse { + return MsgCreateSpotMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateSpotMarketOrderResponseProtoMsg): MsgCreateSpotMarketOrderResponse { + return MsgCreateSpotMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateSpotMarketOrderResponse): Uint8Array { + return MsgCreateSpotMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotMarketOrderResponse): MsgCreateSpotMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse", + value: MsgCreateSpotMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotMarketOrderResponse.typeUrl, MsgCreateSpotMarketOrderResponse); +function createBaseSpotMarketOrderResults(): SpotMarketOrderResults { + return { + quantity: "", + price: "", + fee: "" + }; +} +export const SpotMarketOrderResults = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults", + is(o: any): o is SpotMarketOrderResults { + return o && (o.$typeUrl === SpotMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string"); + }, + isAmino(o: any): o is SpotMarketOrderResultsAmino { + return o && (o.$typeUrl === SpotMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string"); + }, + encode(message: SpotMarketOrderResults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.fee !== "") { + writer.uint32(26).string(message.fee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketOrderResults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketOrderResults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.fee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketOrderResults { + const message = createBaseSpotMarketOrderResults(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.fee = object.fee ?? ""; + return message; + }, + fromAmino(object: SpotMarketOrderResultsAmino): SpotMarketOrderResults { + const message = createBaseSpotMarketOrderResults(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + return message; + }, + toAmino(message: SpotMarketOrderResults): SpotMarketOrderResultsAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.fee = message.fee === "" ? undefined : message.fee; + return obj; + }, + fromAminoMsg(object: SpotMarketOrderResultsAminoMsg): SpotMarketOrderResults { + return SpotMarketOrderResults.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketOrderResultsProtoMsg): SpotMarketOrderResults { + return SpotMarketOrderResults.decode(message.value); + }, + toProto(message: SpotMarketOrderResults): Uint8Array { + return SpotMarketOrderResults.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketOrderResults): SpotMarketOrderResultsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults", + value: SpotMarketOrderResults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketOrderResults.typeUrl, SpotMarketOrderResults); +function createBaseMsgCreateDerivativeLimitOrder(): MsgCreateDerivativeLimitOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateDerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder", + aminoType: "exchange/MsgCreateDerivativeLimitOrder", + is(o: any): o is MsgCreateDerivativeLimitOrder { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateDerivativeLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateDerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeLimitOrder { + const message = createBaseMsgCreateDerivativeLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateDerivativeLimitOrderAmino): MsgCreateDerivativeLimitOrder { + const message = createBaseMsgCreateDerivativeLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeLimitOrderAminoMsg): MsgCreateDerivativeLimitOrder { + return MsgCreateDerivativeLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateDerivativeLimitOrder", + value: MsgCreateDerivativeLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDerivativeLimitOrderProtoMsg): MsgCreateDerivativeLimitOrder { + return MsgCreateDerivativeLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateDerivativeLimitOrder): Uint8Array { + return MsgCreateDerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder", + value: MsgCreateDerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeLimitOrder.typeUrl, MsgCreateDerivativeLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDerivativeLimitOrder.aminoType, MsgCreateDerivativeLimitOrder.typeUrl); +function createBaseMsgCreateDerivativeLimitOrderResponse(): MsgCreateDerivativeLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateDerivativeLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse", + is(o: any): o is MsgCreateDerivativeLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateDerivativeLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateDerivativeLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeLimitOrderResponse { + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateDerivativeLimitOrderResponseAmino): MsgCreateDerivativeLimitOrderResponse { + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateDerivativeLimitOrderResponse): MsgCreateDerivativeLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeLimitOrderResponseAminoMsg): MsgCreateDerivativeLimitOrderResponse { + return MsgCreateDerivativeLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDerivativeLimitOrderResponseProtoMsg): MsgCreateDerivativeLimitOrderResponse { + return MsgCreateDerivativeLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateDerivativeLimitOrderResponse): Uint8Array { + return MsgCreateDerivativeLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeLimitOrderResponse): MsgCreateDerivativeLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse", + value: MsgCreateDerivativeLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeLimitOrderResponse.typeUrl, MsgCreateDerivativeLimitOrderResponse); +function createBaseMsgCreateBinaryOptionsLimitOrder(): MsgCreateBinaryOptionsLimitOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateBinaryOptionsLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder", + aminoType: "exchange/MsgCreateBinaryOptionsLimitOrder", + is(o: any): o is MsgCreateBinaryOptionsLimitOrder { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateBinaryOptionsLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsLimitOrder { + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsLimitOrderAmino): MsgCreateBinaryOptionsLimitOrder { + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsLimitOrderAminoMsg): MsgCreateBinaryOptionsLimitOrder { + return MsgCreateBinaryOptionsLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateBinaryOptionsLimitOrder", + value: MsgCreateBinaryOptionsLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateBinaryOptionsLimitOrderProtoMsg): MsgCreateBinaryOptionsLimitOrder { + return MsgCreateBinaryOptionsLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsLimitOrder): Uint8Array { + return MsgCreateBinaryOptionsLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder", + value: MsgCreateBinaryOptionsLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsLimitOrder.typeUrl, MsgCreateBinaryOptionsLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBinaryOptionsLimitOrder.aminoType, MsgCreateBinaryOptionsLimitOrder.typeUrl); +function createBaseMsgCreateBinaryOptionsLimitOrderResponse(): MsgCreateBinaryOptionsLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateBinaryOptionsLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse", + is(o: any): o is MsgCreateBinaryOptionsLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateBinaryOptionsLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsLimitOrderResponse { + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsLimitOrderResponseAmino): MsgCreateBinaryOptionsLimitOrderResponse { + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsLimitOrderResponse): MsgCreateBinaryOptionsLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsLimitOrderResponseAminoMsg): MsgCreateBinaryOptionsLimitOrderResponse { + return MsgCreateBinaryOptionsLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateBinaryOptionsLimitOrderResponseProtoMsg): MsgCreateBinaryOptionsLimitOrderResponse { + return MsgCreateBinaryOptionsLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsLimitOrderResponse): Uint8Array { + return MsgCreateBinaryOptionsLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsLimitOrderResponse): MsgCreateBinaryOptionsLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse", + value: MsgCreateBinaryOptionsLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsLimitOrderResponse.typeUrl, MsgCreateBinaryOptionsLimitOrderResponse); +function createBaseMsgBatchCreateDerivativeLimitOrders(): MsgBatchCreateDerivativeLimitOrders { + return { + sender: "", + orders: [] + }; +} +export const MsgBatchCreateDerivativeLimitOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders", + aminoType: "exchange/MsgBatchCreateDerivativeLimitOrders", + is(o: any): o is MsgBatchCreateDerivativeLimitOrders { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || DerivativeOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is MsgBatchCreateDerivativeLimitOrdersAmino { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || DerivativeOrder.isAmino(o.orders[0]))); + }, + encode(message: MsgBatchCreateDerivativeLimitOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.orders) { + DerivativeOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateDerivativeLimitOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orders.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateDerivativeLimitOrders { + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + message.sender = object.sender ?? ""; + message.orders = object.orders?.map(e => DerivativeOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCreateDerivativeLimitOrdersAmino): MsgBatchCreateDerivativeLimitOrders { + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.orders = object.orders?.map(e => DerivativeOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.orders) { + obj.orders = message.orders.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateDerivativeLimitOrdersAminoMsg): MsgBatchCreateDerivativeLimitOrders { + return MsgBatchCreateDerivativeLimitOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersAminoMsg { + return { + type: "exchange/MsgBatchCreateDerivativeLimitOrders", + value: MsgBatchCreateDerivativeLimitOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersProtoMsg): MsgBatchCreateDerivativeLimitOrders { + return MsgBatchCreateDerivativeLimitOrders.decode(message.value); + }, + toProto(message: MsgBatchCreateDerivativeLimitOrders): Uint8Array { + return MsgBatchCreateDerivativeLimitOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders", + value: MsgBatchCreateDerivativeLimitOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateDerivativeLimitOrders.typeUrl, MsgBatchCreateDerivativeLimitOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCreateDerivativeLimitOrders.aminoType, MsgBatchCreateDerivativeLimitOrders.typeUrl); +function createBaseMsgBatchCreateDerivativeLimitOrdersResponse(): MsgBatchCreateDerivativeLimitOrdersResponse { + return { + orderHashes: [], + createdOrdersCids: [], + failedOrdersCids: [] + }; +} +export const MsgBatchCreateDerivativeLimitOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse", + is(o: any): o is MsgBatchCreateDerivativeLimitOrdersResponse { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl || Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string") && Array.isArray(o.createdOrdersCids) && (!o.createdOrdersCids.length || typeof o.createdOrdersCids[0] === "string") && Array.isArray(o.failedOrdersCids) && (!o.failedOrdersCids.length || typeof o.failedOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchCreateDerivativeLimitOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl || Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string") && Array.isArray(o.created_orders_cids) && (!o.created_orders_cids.length || typeof o.created_orders_cids[0] === "string") && Array.isArray(o.failed_orders_cids) && (!o.failed_orders_cids.length || typeof o.failed_orders_cids[0] === "string")); + }, + encode(message: MsgBatchCreateDerivativeLimitOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderHashes) { + writer.uint32(10).string(v!); + } + for (const v of message.createdOrdersCids) { + writer.uint32(18).string(v!); + } + for (const v of message.failedOrdersCids) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateDerivativeLimitOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHashes.push(reader.string()); + break; + case 2: + message.createdOrdersCids.push(reader.string()); + break; + case 3: + message.failedOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateDerivativeLimitOrdersResponse { + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + message.orderHashes = object.orderHashes?.map(e => e) || []; + message.createdOrdersCids = object.createdOrdersCids?.map(e => e) || []; + message.failedOrdersCids = object.failedOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCreateDerivativeLimitOrdersResponseAmino): MsgBatchCreateDerivativeLimitOrdersResponse { + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + message.orderHashes = object.order_hashes?.map(e => e) || []; + message.createdOrdersCids = object.created_orders_cids?.map(e => e) || []; + message.failedOrdersCids = object.failed_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCreateDerivativeLimitOrdersResponse): MsgBatchCreateDerivativeLimitOrdersResponseAmino { + const obj: any = {}; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + if (message.createdOrdersCids) { + obj.created_orders_cids = message.createdOrdersCids.map(e => e); + } else { + obj.created_orders_cids = message.createdOrdersCids; + } + if (message.failedOrdersCids) { + obj.failed_orders_cids = message.failedOrdersCids.map(e => e); + } else { + obj.failed_orders_cids = message.failedOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateDerivativeLimitOrdersResponseAminoMsg): MsgBatchCreateDerivativeLimitOrdersResponse { + return MsgBatchCreateDerivativeLimitOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg): MsgBatchCreateDerivativeLimitOrdersResponse { + return MsgBatchCreateDerivativeLimitOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCreateDerivativeLimitOrdersResponse): Uint8Array { + return MsgBatchCreateDerivativeLimitOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersResponse): MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse", + value: MsgBatchCreateDerivativeLimitOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl, MsgBatchCreateDerivativeLimitOrdersResponse); +function createBaseMsgCancelSpotOrder(): MsgCancelSpotOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + cid: "" + }; +} +export const MsgCancelSpotOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder", + aminoType: "exchange/MsgCancelSpotOrder", + is(o: any): o is MsgCancelSpotOrder { + return o && (o.$typeUrl === MsgCancelSpotOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelSpotOrderAmino { + return o && (o.$typeUrl === MsgCancelSpotOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCancelSpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelSpotOrder { + const message = createBaseMsgCancelSpotOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelSpotOrderAmino): MsgCancelSpotOrder { + const message = createBaseMsgCancelSpotOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelSpotOrder): MsgCancelSpotOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelSpotOrderAminoMsg): MsgCancelSpotOrder { + return MsgCancelSpotOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelSpotOrder): MsgCancelSpotOrderAminoMsg { + return { + type: "exchange/MsgCancelSpotOrder", + value: MsgCancelSpotOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelSpotOrderProtoMsg): MsgCancelSpotOrder { + return MsgCancelSpotOrder.decode(message.value); + }, + toProto(message: MsgCancelSpotOrder): Uint8Array { + return MsgCancelSpotOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSpotOrder): MsgCancelSpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder", + value: MsgCancelSpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSpotOrder.typeUrl, MsgCancelSpotOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelSpotOrder.aminoType, MsgCancelSpotOrder.typeUrl); +function createBaseMsgCancelSpotOrderResponse(): MsgCancelSpotOrderResponse { + return {}; +} +export const MsgCancelSpotOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse", + is(o: any): o is MsgCancelSpotOrderResponse { + return o && o.$typeUrl === MsgCancelSpotOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelSpotOrderResponseAmino { + return o && o.$typeUrl === MsgCancelSpotOrderResponse.typeUrl; + }, + encode(_: MsgCancelSpotOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSpotOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSpotOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelSpotOrderResponse { + const message = createBaseMsgCancelSpotOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelSpotOrderResponseAmino): MsgCancelSpotOrderResponse { + const message = createBaseMsgCancelSpotOrderResponse(); + return message; + }, + toAmino(_: MsgCancelSpotOrderResponse): MsgCancelSpotOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelSpotOrderResponseAminoMsg): MsgCancelSpotOrderResponse { + return MsgCancelSpotOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelSpotOrderResponseProtoMsg): MsgCancelSpotOrderResponse { + return MsgCancelSpotOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelSpotOrderResponse): Uint8Array { + return MsgCancelSpotOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSpotOrderResponse): MsgCancelSpotOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse", + value: MsgCancelSpotOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSpotOrderResponse.typeUrl, MsgCancelSpotOrderResponse); +function createBaseMsgBatchCancelSpotOrders(): MsgBatchCancelSpotOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelSpotOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders", + aminoType: "exchange/MsgBatchCancelSpotOrders", + is(o: any): o is MsgBatchCancelSpotOrders { + return o && (o.$typeUrl === MsgBatchCancelSpotOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelSpotOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelSpotOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelSpotOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelSpotOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelSpotOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelSpotOrders { + const message = createBaseMsgBatchCancelSpotOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelSpotOrdersAmino): MsgBatchCancelSpotOrders { + const message = createBaseMsgBatchCancelSpotOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelSpotOrdersAminoMsg): MsgBatchCancelSpotOrders { + return MsgBatchCancelSpotOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelSpotOrders", + value: MsgBatchCancelSpotOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelSpotOrdersProtoMsg): MsgBatchCancelSpotOrders { + return MsgBatchCancelSpotOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelSpotOrders): Uint8Array { + return MsgBatchCancelSpotOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders", + value: MsgBatchCancelSpotOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelSpotOrders.typeUrl, MsgBatchCancelSpotOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelSpotOrders.aminoType, MsgBatchCancelSpotOrders.typeUrl); +function createBaseMsgBatchCancelSpotOrdersResponse(): MsgBatchCancelSpotOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse", + is(o: any): o is MsgBatchCancelSpotOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelSpotOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelSpotOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelSpotOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelSpotOrdersResponse { + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelSpotOrdersResponseAmino): MsgBatchCancelSpotOrdersResponse { + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelSpotOrdersResponse): MsgBatchCancelSpotOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelSpotOrdersResponseAminoMsg): MsgBatchCancelSpotOrdersResponse { + return MsgBatchCancelSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelSpotOrdersResponseProtoMsg): MsgBatchCancelSpotOrdersResponse { + return MsgBatchCancelSpotOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelSpotOrdersResponse): Uint8Array { + return MsgBatchCancelSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelSpotOrdersResponse): MsgBatchCancelSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse", + value: MsgBatchCancelSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelSpotOrdersResponse.typeUrl, MsgBatchCancelSpotOrdersResponse); +function createBaseMsgBatchCancelBinaryOptionsOrders(): MsgBatchCancelBinaryOptionsOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelBinaryOptionsOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders", + aminoType: "exchange/MsgBatchCancelBinaryOptionsOrders", + is(o: any): o is MsgBatchCancelBinaryOptionsOrders { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelBinaryOptionsOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelBinaryOptionsOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelBinaryOptionsOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelBinaryOptionsOrders { + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelBinaryOptionsOrdersAmino): MsgBatchCancelBinaryOptionsOrders { + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelBinaryOptionsOrdersAminoMsg): MsgBatchCancelBinaryOptionsOrders { + return MsgBatchCancelBinaryOptionsOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelBinaryOptionsOrders", + value: MsgBatchCancelBinaryOptionsOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersProtoMsg): MsgBatchCancelBinaryOptionsOrders { + return MsgBatchCancelBinaryOptionsOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelBinaryOptionsOrders): Uint8Array { + return MsgBatchCancelBinaryOptionsOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders", + value: MsgBatchCancelBinaryOptionsOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelBinaryOptionsOrders.typeUrl, MsgBatchCancelBinaryOptionsOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelBinaryOptionsOrders.aminoType, MsgBatchCancelBinaryOptionsOrders.typeUrl); +function createBaseMsgBatchCancelBinaryOptionsOrdersResponse(): MsgBatchCancelBinaryOptionsOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelBinaryOptionsOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse", + is(o: any): o is MsgBatchCancelBinaryOptionsOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelBinaryOptionsOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelBinaryOptionsOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelBinaryOptionsOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelBinaryOptionsOrdersResponse { + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelBinaryOptionsOrdersResponseAmino): MsgBatchCancelBinaryOptionsOrdersResponse { + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelBinaryOptionsOrdersResponse): MsgBatchCancelBinaryOptionsOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelBinaryOptionsOrdersResponseAminoMsg): MsgBatchCancelBinaryOptionsOrdersResponse { + return MsgBatchCancelBinaryOptionsOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg): MsgBatchCancelBinaryOptionsOrdersResponse { + return MsgBatchCancelBinaryOptionsOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelBinaryOptionsOrdersResponse): Uint8Array { + return MsgBatchCancelBinaryOptionsOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersResponse): MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse", + value: MsgBatchCancelBinaryOptionsOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl, MsgBatchCancelBinaryOptionsOrdersResponse); +function createBaseMsgBatchUpdateOrders(): MsgBatchUpdateOrders { + return { + sender: "", + subaccountId: "", + spotMarketIdsToCancelAll: [], + derivativeMarketIdsToCancelAll: [], + spotOrdersToCancel: [], + derivativeOrdersToCancel: [], + spotOrdersToCreate: [], + derivativeOrdersToCreate: [], + binaryOptionsOrdersToCancel: [], + binaryOptionsMarketIdsToCancelAll: [], + binaryOptionsOrdersToCreate: [] + }; +} +export const MsgBatchUpdateOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders", + aminoType: "exchange/MsgBatchUpdateOrders", + is(o: any): o is MsgBatchUpdateOrders { + return o && (o.$typeUrl === MsgBatchUpdateOrders.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Array.isArray(o.spotMarketIdsToCancelAll) && (!o.spotMarketIdsToCancelAll.length || typeof o.spotMarketIdsToCancelAll[0] === "string") && Array.isArray(o.derivativeMarketIdsToCancelAll) && (!o.derivativeMarketIdsToCancelAll.length || typeof o.derivativeMarketIdsToCancelAll[0] === "string") && Array.isArray(o.binaryOptionsMarketIdsToCancelAll) && (!o.binaryOptionsMarketIdsToCancelAll.length || typeof o.binaryOptionsMarketIdsToCancelAll[0] === "string")); + }, + isAmino(o: any): o is MsgBatchUpdateOrdersAmino { + return o && (o.$typeUrl === MsgBatchUpdateOrders.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.spot_market_ids_to_cancel_all) && (!o.spot_market_ids_to_cancel_all.length || typeof o.spot_market_ids_to_cancel_all[0] === "string") && Array.isArray(o.derivative_market_ids_to_cancel_all) && (!o.derivative_market_ids_to_cancel_all.length || typeof o.derivative_market_ids_to_cancel_all[0] === "string") && Array.isArray(o.binary_options_market_ids_to_cancel_all) && (!o.binary_options_market_ids_to_cancel_all.length || typeof o.binary_options_market_ids_to_cancel_all[0] === "string")); + }, + encode(message: MsgBatchUpdateOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.spotMarketIdsToCancelAll) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeMarketIdsToCancelAll) { + writer.uint32(34).string(v!); + } + for (const v of message.spotOrdersToCancel) { + OrderData.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.derivativeOrdersToCancel) { + OrderData.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.spotOrdersToCreate) { + SpotOrder.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.derivativeOrdersToCreate) { + DerivativeOrder.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.binaryOptionsOrdersToCancel) { + OrderData.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketIdsToCancelAll) { + writer.uint32(82).string(v!); + } + for (const v of message.binaryOptionsOrdersToCreate) { + DerivativeOrder.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchUpdateOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchUpdateOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.spotMarketIdsToCancelAll.push(reader.string()); + break; + case 4: + message.derivativeMarketIdsToCancelAll.push(reader.string()); + break; + case 5: + message.spotOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 6: + message.derivativeOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 7: + message.spotOrdersToCreate.push(SpotOrder.decode(reader, reader.uint32())); + break; + case 8: + message.derivativeOrdersToCreate.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + case 9: + message.binaryOptionsOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 10: + message.binaryOptionsMarketIdsToCancelAll.push(reader.string()); + break; + case 11: + message.binaryOptionsOrdersToCreate.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchUpdateOrders { + const message = createBaseMsgBatchUpdateOrders(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.spotMarketIdsToCancelAll = object.spotMarketIdsToCancelAll?.map(e => e) || []; + message.derivativeMarketIdsToCancelAll = object.derivativeMarketIdsToCancelAll?.map(e => e) || []; + message.spotOrdersToCancel = object.spotOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.derivativeOrdersToCancel = object.derivativeOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.spotOrdersToCreate = object.spotOrdersToCreate?.map(e => SpotOrder.fromPartial(e)) || []; + message.derivativeOrdersToCreate = object.derivativeOrdersToCreate?.map(e => DerivativeOrder.fromPartial(e)) || []; + message.binaryOptionsOrdersToCancel = object.binaryOptionsOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.binaryOptionsMarketIdsToCancelAll = object.binaryOptionsMarketIdsToCancelAll?.map(e => e) || []; + message.binaryOptionsOrdersToCreate = object.binaryOptionsOrdersToCreate?.map(e => DerivativeOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchUpdateOrdersAmino): MsgBatchUpdateOrders { + const message = createBaseMsgBatchUpdateOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.spotMarketIdsToCancelAll = object.spot_market_ids_to_cancel_all?.map(e => e) || []; + message.derivativeMarketIdsToCancelAll = object.derivative_market_ids_to_cancel_all?.map(e => e) || []; + message.spotOrdersToCancel = object.spot_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.derivativeOrdersToCancel = object.derivative_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.spotOrdersToCreate = object.spot_orders_to_create?.map(e => SpotOrder.fromAmino(e)) || []; + message.derivativeOrdersToCreate = object.derivative_orders_to_create?.map(e => DerivativeOrder.fromAmino(e)) || []; + message.binaryOptionsOrdersToCancel = object.binary_options_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.binaryOptionsMarketIdsToCancelAll = object.binary_options_market_ids_to_cancel_all?.map(e => e) || []; + message.binaryOptionsOrdersToCreate = object.binary_options_orders_to_create?.map(e => DerivativeOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.spotMarketIdsToCancelAll) { + obj.spot_market_ids_to_cancel_all = message.spotMarketIdsToCancelAll.map(e => e); + } else { + obj.spot_market_ids_to_cancel_all = message.spotMarketIdsToCancelAll; + } + if (message.derivativeMarketIdsToCancelAll) { + obj.derivative_market_ids_to_cancel_all = message.derivativeMarketIdsToCancelAll.map(e => e); + } else { + obj.derivative_market_ids_to_cancel_all = message.derivativeMarketIdsToCancelAll; + } + if (message.spotOrdersToCancel) { + obj.spot_orders_to_cancel = message.spotOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.spot_orders_to_cancel = message.spotOrdersToCancel; + } + if (message.derivativeOrdersToCancel) { + obj.derivative_orders_to_cancel = message.derivativeOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.derivative_orders_to_cancel = message.derivativeOrdersToCancel; + } + if (message.spotOrdersToCreate) { + obj.spot_orders_to_create = message.spotOrdersToCreate.map(e => e ? SpotOrder.toAmino(e) : undefined); + } else { + obj.spot_orders_to_create = message.spotOrdersToCreate; + } + if (message.derivativeOrdersToCreate) { + obj.derivative_orders_to_create = message.derivativeOrdersToCreate.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.derivative_orders_to_create = message.derivativeOrdersToCreate; + } + if (message.binaryOptionsOrdersToCancel) { + obj.binary_options_orders_to_cancel = message.binaryOptionsOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.binary_options_orders_to_cancel = message.binaryOptionsOrdersToCancel; + } + if (message.binaryOptionsMarketIdsToCancelAll) { + obj.binary_options_market_ids_to_cancel_all = message.binaryOptionsMarketIdsToCancelAll.map(e => e); + } else { + obj.binary_options_market_ids_to_cancel_all = message.binaryOptionsMarketIdsToCancelAll; + } + if (message.binaryOptionsOrdersToCreate) { + obj.binary_options_orders_to_create = message.binaryOptionsOrdersToCreate.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.binary_options_orders_to_create = message.binaryOptionsOrdersToCreate; + } + return obj; + }, + fromAminoMsg(object: MsgBatchUpdateOrdersAminoMsg): MsgBatchUpdateOrders { + return MsgBatchUpdateOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersAminoMsg { + return { + type: "exchange/MsgBatchUpdateOrders", + value: MsgBatchUpdateOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchUpdateOrdersProtoMsg): MsgBatchUpdateOrders { + return MsgBatchUpdateOrders.decode(message.value); + }, + toProto(message: MsgBatchUpdateOrders): Uint8Array { + return MsgBatchUpdateOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders", + value: MsgBatchUpdateOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchUpdateOrders.typeUrl, MsgBatchUpdateOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchUpdateOrders.aminoType, MsgBatchUpdateOrders.typeUrl); +function createBaseMsgBatchUpdateOrdersResponse(): MsgBatchUpdateOrdersResponse { + return { + spotCancelSuccess: [], + derivativeCancelSuccess: [], + spotOrderHashes: [], + derivativeOrderHashes: [], + binaryOptionsCancelSuccess: [], + binaryOptionsOrderHashes: [], + createdSpotOrdersCids: [], + failedSpotOrdersCids: [], + createdDerivativeOrdersCids: [], + failedDerivativeOrdersCids: [], + createdBinaryOptionsOrdersCids: [], + failedBinaryOptionsOrdersCids: [] + }; +} +export const MsgBatchUpdateOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse", + is(o: any): o is MsgBatchUpdateOrdersResponse { + return o && (o.$typeUrl === MsgBatchUpdateOrdersResponse.typeUrl || Array.isArray(o.spotCancelSuccess) && (!o.spotCancelSuccess.length || typeof o.spotCancelSuccess[0] === "boolean") && Array.isArray(o.derivativeCancelSuccess) && (!o.derivativeCancelSuccess.length || typeof o.derivativeCancelSuccess[0] === "boolean") && Array.isArray(o.spotOrderHashes) && (!o.spotOrderHashes.length || typeof o.spotOrderHashes[0] === "string") && Array.isArray(o.derivativeOrderHashes) && (!o.derivativeOrderHashes.length || typeof o.derivativeOrderHashes[0] === "string") && Array.isArray(o.binaryOptionsCancelSuccess) && (!o.binaryOptionsCancelSuccess.length || typeof o.binaryOptionsCancelSuccess[0] === "boolean") && Array.isArray(o.binaryOptionsOrderHashes) && (!o.binaryOptionsOrderHashes.length || typeof o.binaryOptionsOrderHashes[0] === "string") && Array.isArray(o.createdSpotOrdersCids) && (!o.createdSpotOrdersCids.length || typeof o.createdSpotOrdersCids[0] === "string") && Array.isArray(o.failedSpotOrdersCids) && (!o.failedSpotOrdersCids.length || typeof o.failedSpotOrdersCids[0] === "string") && Array.isArray(o.createdDerivativeOrdersCids) && (!o.createdDerivativeOrdersCids.length || typeof o.createdDerivativeOrdersCids[0] === "string") && Array.isArray(o.failedDerivativeOrdersCids) && (!o.failedDerivativeOrdersCids.length || typeof o.failedDerivativeOrdersCids[0] === "string") && Array.isArray(o.createdBinaryOptionsOrdersCids) && (!o.createdBinaryOptionsOrdersCids.length || typeof o.createdBinaryOptionsOrdersCids[0] === "string") && Array.isArray(o.failedBinaryOptionsOrdersCids) && (!o.failedBinaryOptionsOrdersCids.length || typeof o.failedBinaryOptionsOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchUpdateOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchUpdateOrdersResponse.typeUrl || Array.isArray(o.spot_cancel_success) && (!o.spot_cancel_success.length || typeof o.spot_cancel_success[0] === "boolean") && Array.isArray(o.derivative_cancel_success) && (!o.derivative_cancel_success.length || typeof o.derivative_cancel_success[0] === "boolean") && Array.isArray(o.spot_order_hashes) && (!o.spot_order_hashes.length || typeof o.spot_order_hashes[0] === "string") && Array.isArray(o.derivative_order_hashes) && (!o.derivative_order_hashes.length || typeof o.derivative_order_hashes[0] === "string") && Array.isArray(o.binary_options_cancel_success) && (!o.binary_options_cancel_success.length || typeof o.binary_options_cancel_success[0] === "boolean") && Array.isArray(o.binary_options_order_hashes) && (!o.binary_options_order_hashes.length || typeof o.binary_options_order_hashes[0] === "string") && Array.isArray(o.created_spot_orders_cids) && (!o.created_spot_orders_cids.length || typeof o.created_spot_orders_cids[0] === "string") && Array.isArray(o.failed_spot_orders_cids) && (!o.failed_spot_orders_cids.length || typeof o.failed_spot_orders_cids[0] === "string") && Array.isArray(o.created_derivative_orders_cids) && (!o.created_derivative_orders_cids.length || typeof o.created_derivative_orders_cids[0] === "string") && Array.isArray(o.failed_derivative_orders_cids) && (!o.failed_derivative_orders_cids.length || typeof o.failed_derivative_orders_cids[0] === "string") && Array.isArray(o.created_binary_options_orders_cids) && (!o.created_binary_options_orders_cids.length || typeof o.created_binary_options_orders_cids[0] === "string") && Array.isArray(o.failed_binary_options_orders_cids) && (!o.failed_binary_options_orders_cids.length || typeof o.failed_binary_options_orders_cids[0] === "string")); + }, + encode(message: MsgBatchUpdateOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.spotCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.derivativeCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + for (const v of message.spotOrderHashes) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeOrderHashes) { + writer.uint32(34).string(v!); + } + writer.uint32(42).fork(); + for (const v of message.binaryOptionsCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + for (const v of message.binaryOptionsOrderHashes) { + writer.uint32(50).string(v!); + } + for (const v of message.createdSpotOrdersCids) { + writer.uint32(58).string(v!); + } + for (const v of message.failedSpotOrdersCids) { + writer.uint32(66).string(v!); + } + for (const v of message.createdDerivativeOrdersCids) { + writer.uint32(74).string(v!); + } + for (const v of message.failedDerivativeOrdersCids) { + writer.uint32(82).string(v!); + } + for (const v of message.createdBinaryOptionsOrdersCids) { + writer.uint32(90).string(v!); + } + for (const v of message.failedBinaryOptionsOrdersCids) { + writer.uint32(98).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchUpdateOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchUpdateOrdersResponse(); + 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.spotCancelSuccess.push(reader.bool()); + } + } else { + message.spotCancelSuccess.push(reader.bool()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.derivativeCancelSuccess.push(reader.bool()); + } + } else { + message.derivativeCancelSuccess.push(reader.bool()); + } + break; + case 3: + message.spotOrderHashes.push(reader.string()); + break; + case 4: + message.derivativeOrderHashes.push(reader.string()); + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.binaryOptionsCancelSuccess.push(reader.bool()); + } + } else { + message.binaryOptionsCancelSuccess.push(reader.bool()); + } + break; + case 6: + message.binaryOptionsOrderHashes.push(reader.string()); + break; + case 7: + message.createdSpotOrdersCids.push(reader.string()); + break; + case 8: + message.failedSpotOrdersCids.push(reader.string()); + break; + case 9: + message.createdDerivativeOrdersCids.push(reader.string()); + break; + case 10: + message.failedDerivativeOrdersCids.push(reader.string()); + break; + case 11: + message.createdBinaryOptionsOrdersCids.push(reader.string()); + break; + case 12: + message.failedBinaryOptionsOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchUpdateOrdersResponse { + const message = createBaseMsgBatchUpdateOrdersResponse(); + message.spotCancelSuccess = object.spotCancelSuccess?.map(e => e) || []; + message.derivativeCancelSuccess = object.derivativeCancelSuccess?.map(e => e) || []; + message.spotOrderHashes = object.spotOrderHashes?.map(e => e) || []; + message.derivativeOrderHashes = object.derivativeOrderHashes?.map(e => e) || []; + message.binaryOptionsCancelSuccess = object.binaryOptionsCancelSuccess?.map(e => e) || []; + message.binaryOptionsOrderHashes = object.binaryOptionsOrderHashes?.map(e => e) || []; + message.createdSpotOrdersCids = object.createdSpotOrdersCids?.map(e => e) || []; + message.failedSpotOrdersCids = object.failedSpotOrdersCids?.map(e => e) || []; + message.createdDerivativeOrdersCids = object.createdDerivativeOrdersCids?.map(e => e) || []; + message.failedDerivativeOrdersCids = object.failedDerivativeOrdersCids?.map(e => e) || []; + message.createdBinaryOptionsOrdersCids = object.createdBinaryOptionsOrdersCids?.map(e => e) || []; + message.failedBinaryOptionsOrdersCids = object.failedBinaryOptionsOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchUpdateOrdersResponseAmino): MsgBatchUpdateOrdersResponse { + const message = createBaseMsgBatchUpdateOrdersResponse(); + message.spotCancelSuccess = object.spot_cancel_success?.map(e => e) || []; + message.derivativeCancelSuccess = object.derivative_cancel_success?.map(e => e) || []; + message.spotOrderHashes = object.spot_order_hashes?.map(e => e) || []; + message.derivativeOrderHashes = object.derivative_order_hashes?.map(e => e) || []; + message.binaryOptionsCancelSuccess = object.binary_options_cancel_success?.map(e => e) || []; + message.binaryOptionsOrderHashes = object.binary_options_order_hashes?.map(e => e) || []; + message.createdSpotOrdersCids = object.created_spot_orders_cids?.map(e => e) || []; + message.failedSpotOrdersCids = object.failed_spot_orders_cids?.map(e => e) || []; + message.createdDerivativeOrdersCids = object.created_derivative_orders_cids?.map(e => e) || []; + message.failedDerivativeOrdersCids = object.failed_derivative_orders_cids?.map(e => e) || []; + message.createdBinaryOptionsOrdersCids = object.created_binary_options_orders_cids?.map(e => e) || []; + message.failedBinaryOptionsOrdersCids = object.failed_binary_options_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchUpdateOrdersResponse): MsgBatchUpdateOrdersResponseAmino { + const obj: any = {}; + if (message.spotCancelSuccess) { + obj.spot_cancel_success = message.spotCancelSuccess.map(e => e); + } else { + obj.spot_cancel_success = message.spotCancelSuccess; + } + if (message.derivativeCancelSuccess) { + obj.derivative_cancel_success = message.derivativeCancelSuccess.map(e => e); + } else { + obj.derivative_cancel_success = message.derivativeCancelSuccess; + } + if (message.spotOrderHashes) { + obj.spot_order_hashes = message.spotOrderHashes.map(e => e); + } else { + obj.spot_order_hashes = message.spotOrderHashes; + } + if (message.derivativeOrderHashes) { + obj.derivative_order_hashes = message.derivativeOrderHashes.map(e => e); + } else { + obj.derivative_order_hashes = message.derivativeOrderHashes; + } + if (message.binaryOptionsCancelSuccess) { + obj.binary_options_cancel_success = message.binaryOptionsCancelSuccess.map(e => e); + } else { + obj.binary_options_cancel_success = message.binaryOptionsCancelSuccess; + } + if (message.binaryOptionsOrderHashes) { + obj.binary_options_order_hashes = message.binaryOptionsOrderHashes.map(e => e); + } else { + obj.binary_options_order_hashes = message.binaryOptionsOrderHashes; + } + if (message.createdSpotOrdersCids) { + obj.created_spot_orders_cids = message.createdSpotOrdersCids.map(e => e); + } else { + obj.created_spot_orders_cids = message.createdSpotOrdersCids; + } + if (message.failedSpotOrdersCids) { + obj.failed_spot_orders_cids = message.failedSpotOrdersCids.map(e => e); + } else { + obj.failed_spot_orders_cids = message.failedSpotOrdersCids; + } + if (message.createdDerivativeOrdersCids) { + obj.created_derivative_orders_cids = message.createdDerivativeOrdersCids.map(e => e); + } else { + obj.created_derivative_orders_cids = message.createdDerivativeOrdersCids; + } + if (message.failedDerivativeOrdersCids) { + obj.failed_derivative_orders_cids = message.failedDerivativeOrdersCids.map(e => e); + } else { + obj.failed_derivative_orders_cids = message.failedDerivativeOrdersCids; + } + if (message.createdBinaryOptionsOrdersCids) { + obj.created_binary_options_orders_cids = message.createdBinaryOptionsOrdersCids.map(e => e); + } else { + obj.created_binary_options_orders_cids = message.createdBinaryOptionsOrdersCids; + } + if (message.failedBinaryOptionsOrdersCids) { + obj.failed_binary_options_orders_cids = message.failedBinaryOptionsOrdersCids.map(e => e); + } else { + obj.failed_binary_options_orders_cids = message.failedBinaryOptionsOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchUpdateOrdersResponseAminoMsg): MsgBatchUpdateOrdersResponse { + return MsgBatchUpdateOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchUpdateOrdersResponseProtoMsg): MsgBatchUpdateOrdersResponse { + return MsgBatchUpdateOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchUpdateOrdersResponse): Uint8Array { + return MsgBatchUpdateOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchUpdateOrdersResponse): MsgBatchUpdateOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse", + value: MsgBatchUpdateOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchUpdateOrdersResponse.typeUrl, MsgBatchUpdateOrdersResponse); +function createBaseMsgCreateDerivativeMarketOrder(): MsgCreateDerivativeMarketOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateDerivativeMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder", + aminoType: "exchange/MsgCreateDerivativeMarketOrder", + is(o: any): o is MsgCreateDerivativeMarketOrder { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateDerivativeMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateDerivativeMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeMarketOrder { + const message = createBaseMsgCreateDerivativeMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateDerivativeMarketOrderAmino): MsgCreateDerivativeMarketOrder { + const message = createBaseMsgCreateDerivativeMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeMarketOrderAminoMsg): MsgCreateDerivativeMarketOrder { + return MsgCreateDerivativeMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateDerivativeMarketOrder", + value: MsgCreateDerivativeMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDerivativeMarketOrderProtoMsg): MsgCreateDerivativeMarketOrder { + return MsgCreateDerivativeMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateDerivativeMarketOrder): Uint8Array { + return MsgCreateDerivativeMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder", + value: MsgCreateDerivativeMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeMarketOrder.typeUrl, MsgCreateDerivativeMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDerivativeMarketOrder.aminoType, MsgCreateDerivativeMarketOrder.typeUrl); +function createBaseMsgCreateDerivativeMarketOrderResponse(): MsgCreateDerivativeMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateDerivativeMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse", + is(o: any): o is MsgCreateDerivativeMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateDerivativeMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateDerivativeMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + DerivativeMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = DerivativeMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeMarketOrderResponse { + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? DerivativeMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateDerivativeMarketOrderResponseAmino): MsgCreateDerivativeMarketOrderResponse { + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = DerivativeMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateDerivativeMarketOrderResponse): MsgCreateDerivativeMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? DerivativeMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeMarketOrderResponseAminoMsg): MsgCreateDerivativeMarketOrderResponse { + return MsgCreateDerivativeMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDerivativeMarketOrderResponseProtoMsg): MsgCreateDerivativeMarketOrderResponse { + return MsgCreateDerivativeMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateDerivativeMarketOrderResponse): Uint8Array { + return MsgCreateDerivativeMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeMarketOrderResponse): MsgCreateDerivativeMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse", + value: MsgCreateDerivativeMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeMarketOrderResponse.typeUrl, MsgCreateDerivativeMarketOrderResponse); +function createBaseDerivativeMarketOrderResults(): DerivativeMarketOrderResults { + return { + quantity: "", + price: "", + fee: "", + positionDelta: PositionDelta.fromPartial({}), + payout: "" + }; +} +export const DerivativeMarketOrderResults = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults", + is(o: any): o is DerivativeMarketOrderResults { + return o && (o.$typeUrl === DerivativeMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string" && PositionDelta.is(o.positionDelta) && typeof o.payout === "string"); + }, + isAmino(o: any): o is DerivativeMarketOrderResultsAmino { + return o && (o.$typeUrl === DerivativeMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string" && PositionDelta.isAmino(o.position_delta) && typeof o.payout === "string"); + }, + encode(message: DerivativeMarketOrderResults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.fee !== "") { + writer.uint32(26).string(message.fee); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(34).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(42).string(message.payout); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrderResults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrderResults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.fee = reader.string(); + break; + case 4: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 5: + message.payout = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrderResults { + const message = createBaseDerivativeMarketOrderResults(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.fee = object.fee ?? ""; + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketOrderResultsAmino): DerivativeMarketOrderResults { + const message = createBaseDerivativeMarketOrderResults(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + return message; + }, + toAmino(message: DerivativeMarketOrderResults): DerivativeMarketOrderResultsAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderResultsAminoMsg): DerivativeMarketOrderResults { + return DerivativeMarketOrderResults.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderResultsProtoMsg): DerivativeMarketOrderResults { + return DerivativeMarketOrderResults.decode(message.value); + }, + toProto(message: DerivativeMarketOrderResults): Uint8Array { + return DerivativeMarketOrderResults.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrderResults): DerivativeMarketOrderResultsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults", + value: DerivativeMarketOrderResults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrderResults.typeUrl, DerivativeMarketOrderResults); +function createBaseMsgCreateBinaryOptionsMarketOrder(): MsgCreateBinaryOptionsMarketOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateBinaryOptionsMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder", + aminoType: "exchange/MsgCreateBinaryOptionsMarketOrder", + is(o: any): o is MsgCreateBinaryOptionsMarketOrder { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateBinaryOptionsMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsMarketOrder { + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsMarketOrderAmino): MsgCreateBinaryOptionsMarketOrder { + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsMarketOrderAminoMsg): MsgCreateBinaryOptionsMarketOrder { + return MsgCreateBinaryOptionsMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateBinaryOptionsMarketOrder", + value: MsgCreateBinaryOptionsMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateBinaryOptionsMarketOrderProtoMsg): MsgCreateBinaryOptionsMarketOrder { + return MsgCreateBinaryOptionsMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsMarketOrder): Uint8Array { + return MsgCreateBinaryOptionsMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder", + value: MsgCreateBinaryOptionsMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsMarketOrder.typeUrl, MsgCreateBinaryOptionsMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBinaryOptionsMarketOrder.aminoType, MsgCreateBinaryOptionsMarketOrder.typeUrl); +function createBaseMsgCreateBinaryOptionsMarketOrderResponse(): MsgCreateBinaryOptionsMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateBinaryOptionsMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse", + is(o: any): o is MsgCreateBinaryOptionsMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateBinaryOptionsMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + DerivativeMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = DerivativeMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsMarketOrderResponse { + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? DerivativeMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsMarketOrderResponseAmino): MsgCreateBinaryOptionsMarketOrderResponse { + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = DerivativeMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsMarketOrderResponse): MsgCreateBinaryOptionsMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? DerivativeMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsMarketOrderResponseAminoMsg): MsgCreateBinaryOptionsMarketOrderResponse { + return MsgCreateBinaryOptionsMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateBinaryOptionsMarketOrderResponseProtoMsg): MsgCreateBinaryOptionsMarketOrderResponse { + return MsgCreateBinaryOptionsMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsMarketOrderResponse): Uint8Array { + return MsgCreateBinaryOptionsMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsMarketOrderResponse): MsgCreateBinaryOptionsMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse", + value: MsgCreateBinaryOptionsMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsMarketOrderResponse.typeUrl, MsgCreateBinaryOptionsMarketOrderResponse); +function createBaseMsgCancelDerivativeOrder(): MsgCancelDerivativeOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const MsgCancelDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder", + aminoType: "exchange/MsgCancelDerivativeOrder", + is(o: any): o is MsgCancelDerivativeOrder { + return o && (o.$typeUrl === MsgCancelDerivativeOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelDerivativeOrderAmino { + return o && (o.$typeUrl === MsgCancelDerivativeOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: MsgCancelDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(40).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.orderMask = reader.int32(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelDerivativeOrder { + const message = createBaseMsgCancelDerivativeOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelDerivativeOrderAmino): MsgCancelDerivativeOrder { + const message = createBaseMsgCancelDerivativeOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelDerivativeOrderAminoMsg): MsgCancelDerivativeOrder { + return MsgCancelDerivativeOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderAminoMsg { + return { + type: "exchange/MsgCancelDerivativeOrder", + value: MsgCancelDerivativeOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelDerivativeOrderProtoMsg): MsgCancelDerivativeOrder { + return MsgCancelDerivativeOrder.decode(message.value); + }, + toProto(message: MsgCancelDerivativeOrder): Uint8Array { + return MsgCancelDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder", + value: MsgCancelDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelDerivativeOrder.typeUrl, MsgCancelDerivativeOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelDerivativeOrder.aminoType, MsgCancelDerivativeOrder.typeUrl); +function createBaseMsgCancelDerivativeOrderResponse(): MsgCancelDerivativeOrderResponse { + return {}; +} +export const MsgCancelDerivativeOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse", + is(o: any): o is MsgCancelDerivativeOrderResponse { + return o && o.$typeUrl === MsgCancelDerivativeOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelDerivativeOrderResponseAmino { + return o && o.$typeUrl === MsgCancelDerivativeOrderResponse.typeUrl; + }, + encode(_: MsgCancelDerivativeOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelDerivativeOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelDerivativeOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelDerivativeOrderResponse { + const message = createBaseMsgCancelDerivativeOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelDerivativeOrderResponseAmino): MsgCancelDerivativeOrderResponse { + const message = createBaseMsgCancelDerivativeOrderResponse(); + return message; + }, + toAmino(_: MsgCancelDerivativeOrderResponse): MsgCancelDerivativeOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelDerivativeOrderResponseAminoMsg): MsgCancelDerivativeOrderResponse { + return MsgCancelDerivativeOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelDerivativeOrderResponseProtoMsg): MsgCancelDerivativeOrderResponse { + return MsgCancelDerivativeOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelDerivativeOrderResponse): Uint8Array { + return MsgCancelDerivativeOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelDerivativeOrderResponse): MsgCancelDerivativeOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse", + value: MsgCancelDerivativeOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelDerivativeOrderResponse.typeUrl, MsgCancelDerivativeOrderResponse); +function createBaseMsgCancelBinaryOptionsOrder(): MsgCancelBinaryOptionsOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const MsgCancelBinaryOptionsOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder", + aminoType: "exchange/MsgCancelBinaryOptionsOrder", + is(o: any): o is MsgCancelBinaryOptionsOrder { + return o && (o.$typeUrl === MsgCancelBinaryOptionsOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelBinaryOptionsOrderAmino { + return o && (o.$typeUrl === MsgCancelBinaryOptionsOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: MsgCancelBinaryOptionsOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(40).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelBinaryOptionsOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelBinaryOptionsOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.orderMask = reader.int32(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelBinaryOptionsOrder { + const message = createBaseMsgCancelBinaryOptionsOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelBinaryOptionsOrderAmino): MsgCancelBinaryOptionsOrder { + const message = createBaseMsgCancelBinaryOptionsOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelBinaryOptionsOrderAminoMsg): MsgCancelBinaryOptionsOrder { + return MsgCancelBinaryOptionsOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderAminoMsg { + return { + type: "exchange/MsgCancelBinaryOptionsOrder", + value: MsgCancelBinaryOptionsOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelBinaryOptionsOrderProtoMsg): MsgCancelBinaryOptionsOrder { + return MsgCancelBinaryOptionsOrder.decode(message.value); + }, + toProto(message: MsgCancelBinaryOptionsOrder): Uint8Array { + return MsgCancelBinaryOptionsOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder", + value: MsgCancelBinaryOptionsOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelBinaryOptionsOrder.typeUrl, MsgCancelBinaryOptionsOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelBinaryOptionsOrder.aminoType, MsgCancelBinaryOptionsOrder.typeUrl); +function createBaseMsgCancelBinaryOptionsOrderResponse(): MsgCancelBinaryOptionsOrderResponse { + return {}; +} +export const MsgCancelBinaryOptionsOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse", + is(o: any): o is MsgCancelBinaryOptionsOrderResponse { + return o && o.$typeUrl === MsgCancelBinaryOptionsOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelBinaryOptionsOrderResponseAmino { + return o && o.$typeUrl === MsgCancelBinaryOptionsOrderResponse.typeUrl; + }, + encode(_: MsgCancelBinaryOptionsOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelBinaryOptionsOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelBinaryOptionsOrderResponse { + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelBinaryOptionsOrderResponseAmino): MsgCancelBinaryOptionsOrderResponse { + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + return message; + }, + toAmino(_: MsgCancelBinaryOptionsOrderResponse): MsgCancelBinaryOptionsOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelBinaryOptionsOrderResponseAminoMsg): MsgCancelBinaryOptionsOrderResponse { + return MsgCancelBinaryOptionsOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelBinaryOptionsOrderResponseProtoMsg): MsgCancelBinaryOptionsOrderResponse { + return MsgCancelBinaryOptionsOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelBinaryOptionsOrderResponse): Uint8Array { + return MsgCancelBinaryOptionsOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelBinaryOptionsOrderResponse): MsgCancelBinaryOptionsOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse", + value: MsgCancelBinaryOptionsOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelBinaryOptionsOrderResponse.typeUrl, MsgCancelBinaryOptionsOrderResponse); +function createBaseOrderData(): OrderData { + return { + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const OrderData = { + typeUrl: "/injective.exchange.v1beta1.OrderData", + is(o: any): o is OrderData { + return o && (o.$typeUrl === OrderData.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is OrderDataAmino { + return o && (o.$typeUrl === OrderData.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: OrderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(26).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(32).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHash = reader.string(); + break; + case 4: + message.orderMask = reader.int32(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderData { + const message = createBaseOrderData(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: OrderDataAmino): OrderData { + const message = createBaseOrderData(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: OrderData): OrderDataAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: OrderDataAminoMsg): OrderData { + return OrderData.fromAmino(object.value); + }, + fromProtoMsg(message: OrderDataProtoMsg): OrderData { + return OrderData.decode(message.value); + }, + toProto(message: OrderData): Uint8Array { + return OrderData.encode(message).finish(); + }, + toProtoMsg(message: OrderData): OrderDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderData", + value: OrderData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderData.typeUrl, OrderData); +function createBaseMsgBatchCancelDerivativeOrders(): MsgBatchCancelDerivativeOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelDerivativeOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders", + aminoType: "exchange/MsgBatchCancelDerivativeOrders", + is(o: any): o is MsgBatchCancelDerivativeOrders { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelDerivativeOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelDerivativeOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelDerivativeOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelDerivativeOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelDerivativeOrders { + const message = createBaseMsgBatchCancelDerivativeOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelDerivativeOrdersAmino): MsgBatchCancelDerivativeOrders { + const message = createBaseMsgBatchCancelDerivativeOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelDerivativeOrdersAminoMsg): MsgBatchCancelDerivativeOrders { + return MsgBatchCancelDerivativeOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelDerivativeOrders", + value: MsgBatchCancelDerivativeOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelDerivativeOrdersProtoMsg): MsgBatchCancelDerivativeOrders { + return MsgBatchCancelDerivativeOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelDerivativeOrders): Uint8Array { + return MsgBatchCancelDerivativeOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders", + value: MsgBatchCancelDerivativeOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelDerivativeOrders.typeUrl, MsgBatchCancelDerivativeOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelDerivativeOrders.aminoType, MsgBatchCancelDerivativeOrders.typeUrl); +function createBaseMsgBatchCancelDerivativeOrdersResponse(): MsgBatchCancelDerivativeOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse", + is(o: any): o is MsgBatchCancelDerivativeOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelDerivativeOrdersResponse { + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelDerivativeOrdersResponseAmino): MsgBatchCancelDerivativeOrdersResponse { + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelDerivativeOrdersResponse): MsgBatchCancelDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelDerivativeOrdersResponseAminoMsg): MsgBatchCancelDerivativeOrdersResponse { + return MsgBatchCancelDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelDerivativeOrdersResponseProtoMsg): MsgBatchCancelDerivativeOrdersResponse { + return MsgBatchCancelDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelDerivativeOrdersResponse): Uint8Array { + return MsgBatchCancelDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelDerivativeOrdersResponse): MsgBatchCancelDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse", + value: MsgBatchCancelDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelDerivativeOrdersResponse.typeUrl, MsgBatchCancelDerivativeOrdersResponse); +function createBaseMsgSubaccountTransfer(): MsgSubaccountTransfer { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgSubaccountTransfer = { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer", + aminoType: "exchange/MsgSubaccountTransfer", + is(o: any): o is MsgSubaccountTransfer { + return o && (o.$typeUrl === MsgSubaccountTransfer.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgSubaccountTransferAmino { + return o && (o.$typeUrl === MsgSubaccountTransfer.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgSubaccountTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubaccountTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubaccountTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubaccountTransfer { + const message = createBaseMsgSubaccountTransfer(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgSubaccountTransferAmino): MsgSubaccountTransfer { + const message = createBaseMsgSubaccountTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgSubaccountTransfer): MsgSubaccountTransferAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubaccountTransferAminoMsg): MsgSubaccountTransfer { + return MsgSubaccountTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubaccountTransfer): MsgSubaccountTransferAminoMsg { + return { + type: "exchange/MsgSubaccountTransfer", + value: MsgSubaccountTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubaccountTransferProtoMsg): MsgSubaccountTransfer { + return MsgSubaccountTransfer.decode(message.value); + }, + toProto(message: MsgSubaccountTransfer): Uint8Array { + return MsgSubaccountTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgSubaccountTransfer): MsgSubaccountTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer", + value: MsgSubaccountTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubaccountTransfer.typeUrl, MsgSubaccountTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubaccountTransfer.aminoType, MsgSubaccountTransfer.typeUrl); +function createBaseMsgSubaccountTransferResponse(): MsgSubaccountTransferResponse { + return {}; +} +export const MsgSubaccountTransferResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse", + is(o: any): o is MsgSubaccountTransferResponse { + return o && o.$typeUrl === MsgSubaccountTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubaccountTransferResponseAmino { + return o && o.$typeUrl === MsgSubaccountTransferResponse.typeUrl; + }, + encode(_: MsgSubaccountTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubaccountTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubaccountTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubaccountTransferResponse { + const message = createBaseMsgSubaccountTransferResponse(); + return message; + }, + fromAmino(_: MsgSubaccountTransferResponseAmino): MsgSubaccountTransferResponse { + const message = createBaseMsgSubaccountTransferResponse(); + return message; + }, + toAmino(_: MsgSubaccountTransferResponse): MsgSubaccountTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubaccountTransferResponseAminoMsg): MsgSubaccountTransferResponse { + return MsgSubaccountTransferResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubaccountTransferResponseProtoMsg): MsgSubaccountTransferResponse { + return MsgSubaccountTransferResponse.decode(message.value); + }, + toProto(message: MsgSubaccountTransferResponse): Uint8Array { + return MsgSubaccountTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubaccountTransferResponse): MsgSubaccountTransferResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse", + value: MsgSubaccountTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubaccountTransferResponse.typeUrl, MsgSubaccountTransferResponse); +function createBaseMsgExternalTransfer(): MsgExternalTransfer { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgExternalTransfer = { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer", + aminoType: "exchange/MsgExternalTransfer", + is(o: any): o is MsgExternalTransfer { + return o && (o.$typeUrl === MsgExternalTransfer.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgExternalTransferAmino { + return o && (o.$typeUrl === MsgExternalTransfer.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgExternalTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExternalTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExternalTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExternalTransfer { + const message = createBaseMsgExternalTransfer(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgExternalTransferAmino): MsgExternalTransfer { + const message = createBaseMsgExternalTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgExternalTransfer): MsgExternalTransferAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExternalTransferAminoMsg): MsgExternalTransfer { + return MsgExternalTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgExternalTransfer): MsgExternalTransferAminoMsg { + return { + type: "exchange/MsgExternalTransfer", + value: MsgExternalTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExternalTransferProtoMsg): MsgExternalTransfer { + return MsgExternalTransfer.decode(message.value); + }, + toProto(message: MsgExternalTransfer): Uint8Array { + return MsgExternalTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgExternalTransfer): MsgExternalTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer", + value: MsgExternalTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExternalTransfer.typeUrl, MsgExternalTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExternalTransfer.aminoType, MsgExternalTransfer.typeUrl); +function createBaseMsgExternalTransferResponse(): MsgExternalTransferResponse { + return {}; +} +export const MsgExternalTransferResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse", + is(o: any): o is MsgExternalTransferResponse { + return o && o.$typeUrl === MsgExternalTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgExternalTransferResponseAmino { + return o && o.$typeUrl === MsgExternalTransferResponse.typeUrl; + }, + encode(_: MsgExternalTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExternalTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExternalTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgExternalTransferResponse { + const message = createBaseMsgExternalTransferResponse(); + return message; + }, + fromAmino(_: MsgExternalTransferResponseAmino): MsgExternalTransferResponse { + const message = createBaseMsgExternalTransferResponse(); + return message; + }, + toAmino(_: MsgExternalTransferResponse): MsgExternalTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExternalTransferResponseAminoMsg): MsgExternalTransferResponse { + return MsgExternalTransferResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExternalTransferResponseProtoMsg): MsgExternalTransferResponse { + return MsgExternalTransferResponse.decode(message.value); + }, + toProto(message: MsgExternalTransferResponse): Uint8Array { + return MsgExternalTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExternalTransferResponse): MsgExternalTransferResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse", + value: MsgExternalTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExternalTransferResponse.typeUrl, MsgExternalTransferResponse); +function createBaseMsgLiquidatePosition(): MsgLiquidatePosition { + return { + sender: "", + subaccountId: "", + marketId: "", + order: undefined + }; +} +export const MsgLiquidatePosition = { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition", + aminoType: "exchange/MsgLiquidatePosition", + is(o: any): o is MsgLiquidatePosition { + return o && (o.$typeUrl === MsgLiquidatePosition.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MsgLiquidatePositionAmino { + return o && (o.$typeUrl === MsgLiquidatePosition.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: MsgLiquidatePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidatePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidatePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.marketId = reader.string(); + break; + case 4: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgLiquidatePosition { + const message = createBaseMsgLiquidatePosition(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgLiquidatePositionAmino): MsgLiquidatePosition { + const message = createBaseMsgLiquidatePosition(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgLiquidatePosition): MsgLiquidatePositionAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidatePositionAminoMsg): MsgLiquidatePosition { + return MsgLiquidatePosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidatePosition): MsgLiquidatePositionAminoMsg { + return { + type: "exchange/MsgLiquidatePosition", + value: MsgLiquidatePosition.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLiquidatePositionProtoMsg): MsgLiquidatePosition { + return MsgLiquidatePosition.decode(message.value); + }, + toProto(message: MsgLiquidatePosition): Uint8Array { + return MsgLiquidatePosition.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidatePosition): MsgLiquidatePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition", + value: MsgLiquidatePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgLiquidatePosition.typeUrl, MsgLiquidatePosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLiquidatePosition.aminoType, MsgLiquidatePosition.typeUrl); +function createBaseMsgLiquidatePositionResponse(): MsgLiquidatePositionResponse { + return {}; +} +export const MsgLiquidatePositionResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse", + is(o: any): o is MsgLiquidatePositionResponse { + return o && o.$typeUrl === MsgLiquidatePositionResponse.typeUrl; + }, + isAmino(o: any): o is MsgLiquidatePositionResponseAmino { + return o && o.$typeUrl === MsgLiquidatePositionResponse.typeUrl; + }, + encode(_: MsgLiquidatePositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidatePositionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidatePositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgLiquidatePositionResponse { + const message = createBaseMsgLiquidatePositionResponse(); + return message; + }, + fromAmino(_: MsgLiquidatePositionResponseAmino): MsgLiquidatePositionResponse { + const message = createBaseMsgLiquidatePositionResponse(); + return message; + }, + toAmino(_: MsgLiquidatePositionResponse): MsgLiquidatePositionResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidatePositionResponseAminoMsg): MsgLiquidatePositionResponse { + return MsgLiquidatePositionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidatePositionResponseProtoMsg): MsgLiquidatePositionResponse { + return MsgLiquidatePositionResponse.decode(message.value); + }, + toProto(message: MsgLiquidatePositionResponse): Uint8Array { + return MsgLiquidatePositionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidatePositionResponse): MsgLiquidatePositionResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse", + value: MsgLiquidatePositionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgLiquidatePositionResponse.typeUrl, MsgLiquidatePositionResponse); +function createBaseMsgEmergencySettleMarket(): MsgEmergencySettleMarket { + return { + sender: "", + subaccountId: "", + marketId: "" + }; +} +export const MsgEmergencySettleMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket", + aminoType: "exchange/MsgEmergencySettleMarket", + is(o: any): o is MsgEmergencySettleMarket { + return o && (o.$typeUrl === MsgEmergencySettleMarket.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MsgEmergencySettleMarketAmino { + return o && (o.$typeUrl === MsgEmergencySettleMarket.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: MsgEmergencySettleMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmergencySettleMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmergencySettleMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgEmergencySettleMarket { + const message = createBaseMsgEmergencySettleMarket(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: MsgEmergencySettleMarketAmino): MsgEmergencySettleMarket { + const message = createBaseMsgEmergencySettleMarket(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: MsgEmergencySettleMarketAminoMsg): MsgEmergencySettleMarket { + return MsgEmergencySettleMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketAminoMsg { + return { + type: "exchange/MsgEmergencySettleMarket", + value: MsgEmergencySettleMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmergencySettleMarketProtoMsg): MsgEmergencySettleMarket { + return MsgEmergencySettleMarket.decode(message.value); + }, + toProto(message: MsgEmergencySettleMarket): Uint8Array { + return MsgEmergencySettleMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket", + value: MsgEmergencySettleMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmergencySettleMarket.typeUrl, MsgEmergencySettleMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEmergencySettleMarket.aminoType, MsgEmergencySettleMarket.typeUrl); +function createBaseMsgEmergencySettleMarketResponse(): MsgEmergencySettleMarketResponse { + return {}; +} +export const MsgEmergencySettleMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse", + is(o: any): o is MsgEmergencySettleMarketResponse { + return o && o.$typeUrl === MsgEmergencySettleMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgEmergencySettleMarketResponseAmino { + return o && o.$typeUrl === MsgEmergencySettleMarketResponse.typeUrl; + }, + encode(_: MsgEmergencySettleMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmergencySettleMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmergencySettleMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgEmergencySettleMarketResponse { + const message = createBaseMsgEmergencySettleMarketResponse(); + return message; + }, + fromAmino(_: MsgEmergencySettleMarketResponseAmino): MsgEmergencySettleMarketResponse { + const message = createBaseMsgEmergencySettleMarketResponse(); + return message; + }, + toAmino(_: MsgEmergencySettleMarketResponse): MsgEmergencySettleMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgEmergencySettleMarketResponseAminoMsg): MsgEmergencySettleMarketResponse { + return MsgEmergencySettleMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgEmergencySettleMarketResponseProtoMsg): MsgEmergencySettleMarketResponse { + return MsgEmergencySettleMarketResponse.decode(message.value); + }, + toProto(message: MsgEmergencySettleMarketResponse): Uint8Array { + return MsgEmergencySettleMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEmergencySettleMarketResponse): MsgEmergencySettleMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse", + value: MsgEmergencySettleMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmergencySettleMarketResponse.typeUrl, MsgEmergencySettleMarketResponse); +function createBaseMsgIncreasePositionMargin(): MsgIncreasePositionMargin { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + marketId: "", + amount: "" + }; +} +export const MsgIncreasePositionMargin = { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin", + aminoType: "exchange/MsgIncreasePositionMargin", + is(o: any): o is MsgIncreasePositionMargin { + return o && (o.$typeUrl === MsgIncreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && typeof o.marketId === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is MsgIncreasePositionMarginAmino { + return o && (o.$typeUrl === MsgIncreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && typeof o.market_id === "string" && typeof o.amount === "string"); + }, + encode(message: MsgIncreasePositionMargin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.marketId !== "") { + writer.uint32(34).string(message.marketId); + } + if (message.amount !== "") { + writer.uint32(42).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIncreasePositionMargin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIncreasePositionMargin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.marketId = reader.string(); + break; + case 5: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgIncreasePositionMargin { + const message = createBaseMsgIncreasePositionMargin(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgIncreasePositionMarginAmino): MsgIncreasePositionMargin { + const message = createBaseMsgIncreasePositionMargin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgIncreasePositionMarginAminoMsg): MsgIncreasePositionMargin { + return MsgIncreasePositionMargin.fromAmino(object.value); + }, + toAminoMsg(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginAminoMsg { + return { + type: "exchange/MsgIncreasePositionMargin", + value: MsgIncreasePositionMargin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIncreasePositionMarginProtoMsg): MsgIncreasePositionMargin { + return MsgIncreasePositionMargin.decode(message.value); + }, + toProto(message: MsgIncreasePositionMargin): Uint8Array { + return MsgIncreasePositionMargin.encode(message).finish(); + }, + toProtoMsg(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin", + value: MsgIncreasePositionMargin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIncreasePositionMargin.typeUrl, MsgIncreasePositionMargin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIncreasePositionMargin.aminoType, MsgIncreasePositionMargin.typeUrl); +function createBaseMsgIncreasePositionMarginResponse(): MsgIncreasePositionMarginResponse { + return {}; +} +export const MsgIncreasePositionMarginResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse", + is(o: any): o is MsgIncreasePositionMarginResponse { + return o && o.$typeUrl === MsgIncreasePositionMarginResponse.typeUrl; + }, + isAmino(o: any): o is MsgIncreasePositionMarginResponseAmino { + return o && o.$typeUrl === MsgIncreasePositionMarginResponse.typeUrl; + }, + encode(_: MsgIncreasePositionMarginResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIncreasePositionMarginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIncreasePositionMarginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgIncreasePositionMarginResponse { + const message = createBaseMsgIncreasePositionMarginResponse(); + return message; + }, + fromAmino(_: MsgIncreasePositionMarginResponseAmino): MsgIncreasePositionMarginResponse { + const message = createBaseMsgIncreasePositionMarginResponse(); + return message; + }, + toAmino(_: MsgIncreasePositionMarginResponse): MsgIncreasePositionMarginResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIncreasePositionMarginResponseAminoMsg): MsgIncreasePositionMarginResponse { + return MsgIncreasePositionMarginResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgIncreasePositionMarginResponseProtoMsg): MsgIncreasePositionMarginResponse { + return MsgIncreasePositionMarginResponse.decode(message.value); + }, + toProto(message: MsgIncreasePositionMarginResponse): Uint8Array { + return MsgIncreasePositionMarginResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIncreasePositionMarginResponse): MsgIncreasePositionMarginResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse", + value: MsgIncreasePositionMarginResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIncreasePositionMarginResponse.typeUrl, MsgIncreasePositionMarginResponse); +function createBaseMsgDecreasePositionMargin(): MsgDecreasePositionMargin { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + marketId: "", + amount: "" + }; +} +export const MsgDecreasePositionMargin = { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin", + aminoType: "exchange/MsgDecreasePositionMargin", + is(o: any): o is MsgDecreasePositionMargin { + return o && (o.$typeUrl === MsgDecreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && typeof o.marketId === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is MsgDecreasePositionMarginAmino { + return o && (o.$typeUrl === MsgDecreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && typeof o.market_id === "string" && typeof o.amount === "string"); + }, + encode(message: MsgDecreasePositionMargin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.marketId !== "") { + writer.uint32(34).string(message.marketId); + } + if (message.amount !== "") { + writer.uint32(42).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDecreasePositionMargin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDecreasePositionMargin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.marketId = reader.string(); + break; + case 5: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDecreasePositionMargin { + const message = createBaseMsgDecreasePositionMargin(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgDecreasePositionMarginAmino): MsgDecreasePositionMargin { + const message = createBaseMsgDecreasePositionMargin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgDecreasePositionMarginAminoMsg): MsgDecreasePositionMargin { + return MsgDecreasePositionMargin.fromAmino(object.value); + }, + toAminoMsg(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginAminoMsg { + return { + type: "exchange/MsgDecreasePositionMargin", + value: MsgDecreasePositionMargin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDecreasePositionMarginProtoMsg): MsgDecreasePositionMargin { + return MsgDecreasePositionMargin.decode(message.value); + }, + toProto(message: MsgDecreasePositionMargin): Uint8Array { + return MsgDecreasePositionMargin.encode(message).finish(); + }, + toProtoMsg(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin", + value: MsgDecreasePositionMargin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDecreasePositionMargin.typeUrl, MsgDecreasePositionMargin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDecreasePositionMargin.aminoType, MsgDecreasePositionMargin.typeUrl); +function createBaseMsgDecreasePositionMarginResponse(): MsgDecreasePositionMarginResponse { + return {}; +} +export const MsgDecreasePositionMarginResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse", + is(o: any): o is MsgDecreasePositionMarginResponse { + return o && o.$typeUrl === MsgDecreasePositionMarginResponse.typeUrl; + }, + isAmino(o: any): o is MsgDecreasePositionMarginResponseAmino { + return o && o.$typeUrl === MsgDecreasePositionMarginResponse.typeUrl; + }, + encode(_: MsgDecreasePositionMarginResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDecreasePositionMarginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDecreasePositionMarginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDecreasePositionMarginResponse { + const message = createBaseMsgDecreasePositionMarginResponse(); + return message; + }, + fromAmino(_: MsgDecreasePositionMarginResponseAmino): MsgDecreasePositionMarginResponse { + const message = createBaseMsgDecreasePositionMarginResponse(); + return message; + }, + toAmino(_: MsgDecreasePositionMarginResponse): MsgDecreasePositionMarginResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDecreasePositionMarginResponseAminoMsg): MsgDecreasePositionMarginResponse { + return MsgDecreasePositionMarginResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDecreasePositionMarginResponseProtoMsg): MsgDecreasePositionMarginResponse { + return MsgDecreasePositionMarginResponse.decode(message.value); + }, + toProto(message: MsgDecreasePositionMarginResponse): Uint8Array { + return MsgDecreasePositionMarginResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDecreasePositionMarginResponse): MsgDecreasePositionMarginResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse", + value: MsgDecreasePositionMarginResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDecreasePositionMarginResponse.typeUrl, MsgDecreasePositionMarginResponse); +function createBaseMsgPrivilegedExecuteContract(): MsgPrivilegedExecuteContract { + return { + sender: "", + funds: "", + contractAddress: "", + data: "" + }; +} +export const MsgPrivilegedExecuteContract = { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract", + aminoType: "exchange/MsgPrivilegedExecuteContract", + is(o: any): o is MsgPrivilegedExecuteContract { + return o && (o.$typeUrl === MsgPrivilegedExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.funds === "string" && typeof o.contractAddress === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is MsgPrivilegedExecuteContractAmino { + return o && (o.$typeUrl === MsgPrivilegedExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.funds === "string" && typeof o.contract_address === "string" && typeof o.data === "string"); + }, + encode(message: MsgPrivilegedExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.funds !== "") { + writer.uint32(18).string(message.funds); + } + if (message.contractAddress !== "") { + writer.uint32(26).string(message.contractAddress); + } + if (message.data !== "") { + writer.uint32(34).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPrivilegedExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPrivilegedExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.funds = reader.string(); + break; + case 3: + message.contractAddress = reader.string(); + break; + case 4: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgPrivilegedExecuteContract { + const message = createBaseMsgPrivilegedExecuteContract(); + message.sender = object.sender ?? ""; + message.funds = object.funds ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: MsgPrivilegedExecuteContractAmino): MsgPrivilegedExecuteContract { + const message = createBaseMsgPrivilegedExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.funds !== undefined && object.funds !== null) { + message.funds = object.funds; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.funds = message.funds === "" ? undefined : message.funds; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: MsgPrivilegedExecuteContractAminoMsg): MsgPrivilegedExecuteContract { + return MsgPrivilegedExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractAminoMsg { + return { + type: "exchange/MsgPrivilegedExecuteContract", + value: MsgPrivilegedExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPrivilegedExecuteContractProtoMsg): MsgPrivilegedExecuteContract { + return MsgPrivilegedExecuteContract.decode(message.value); + }, + toProto(message: MsgPrivilegedExecuteContract): Uint8Array { + return MsgPrivilegedExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract", + value: MsgPrivilegedExecuteContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPrivilegedExecuteContract.typeUrl, MsgPrivilegedExecuteContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPrivilegedExecuteContract.aminoType, MsgPrivilegedExecuteContract.typeUrl); +function createBaseMsgPrivilegedExecuteContractResponse(): MsgPrivilegedExecuteContractResponse { + return { + fundsDiff: [] + }; +} +export const MsgPrivilegedExecuteContractResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse", + is(o: any): o is MsgPrivilegedExecuteContractResponse { + return o && (o.$typeUrl === MsgPrivilegedExecuteContractResponse.typeUrl || Array.isArray(o.fundsDiff) && (!o.fundsDiff.length || Coin.is(o.fundsDiff[0]))); + }, + isAmino(o: any): o is MsgPrivilegedExecuteContractResponseAmino { + return o && (o.$typeUrl === MsgPrivilegedExecuteContractResponse.typeUrl || Array.isArray(o.funds_diff) && (!o.funds_diff.length || Coin.isAmino(o.funds_diff[0]))); + }, + encode(message: MsgPrivilegedExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.fundsDiff) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPrivilegedExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPrivilegedExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fundsDiff.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgPrivilegedExecuteContractResponse { + const message = createBaseMsgPrivilegedExecuteContractResponse(); + message.fundsDiff = object.fundsDiff?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgPrivilegedExecuteContractResponseAmino): MsgPrivilegedExecuteContractResponse { + const message = createBaseMsgPrivilegedExecuteContractResponse(); + message.fundsDiff = object.funds_diff?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgPrivilegedExecuteContractResponse): MsgPrivilegedExecuteContractResponseAmino { + const obj: any = {}; + if (message.fundsDiff) { + obj.funds_diff = message.fundsDiff.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds_diff = message.fundsDiff; + } + return obj; + }, + fromAminoMsg(object: MsgPrivilegedExecuteContractResponseAminoMsg): MsgPrivilegedExecuteContractResponse { + return MsgPrivilegedExecuteContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPrivilegedExecuteContractResponseProtoMsg): MsgPrivilegedExecuteContractResponse { + return MsgPrivilegedExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgPrivilegedExecuteContractResponse): Uint8Array { + return MsgPrivilegedExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPrivilegedExecuteContractResponse): MsgPrivilegedExecuteContractResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse", + value: MsgPrivilegedExecuteContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPrivilegedExecuteContractResponse.typeUrl, MsgPrivilegedExecuteContractResponse); +function createBaseMsgRewardsOptOut(): MsgRewardsOptOut { + return { + sender: "" + }; +} +export const MsgRewardsOptOut = { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut", + aminoType: "exchange/MsgRewardsOptOut", + is(o: any): o is MsgRewardsOptOut { + return o && (o.$typeUrl === MsgRewardsOptOut.typeUrl || typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgRewardsOptOutAmino { + return o && (o.$typeUrl === MsgRewardsOptOut.typeUrl || typeof o.sender === "string"); + }, + encode(message: MsgRewardsOptOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRewardsOptOut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRewardsOptOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRewardsOptOut { + const message = createBaseMsgRewardsOptOut(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgRewardsOptOutAmino): MsgRewardsOptOut { + const message = createBaseMsgRewardsOptOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgRewardsOptOut): MsgRewardsOptOutAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgRewardsOptOutAminoMsg): MsgRewardsOptOut { + return MsgRewardsOptOut.fromAmino(object.value); + }, + toAminoMsg(message: MsgRewardsOptOut): MsgRewardsOptOutAminoMsg { + return { + type: "exchange/MsgRewardsOptOut", + value: MsgRewardsOptOut.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRewardsOptOutProtoMsg): MsgRewardsOptOut { + return MsgRewardsOptOut.decode(message.value); + }, + toProto(message: MsgRewardsOptOut): Uint8Array { + return MsgRewardsOptOut.encode(message).finish(); + }, + toProtoMsg(message: MsgRewardsOptOut): MsgRewardsOptOutProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut", + value: MsgRewardsOptOut.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRewardsOptOut.typeUrl, MsgRewardsOptOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRewardsOptOut.aminoType, MsgRewardsOptOut.typeUrl); +function createBaseMsgRewardsOptOutResponse(): MsgRewardsOptOutResponse { + return {}; +} +export const MsgRewardsOptOutResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse", + is(o: any): o is MsgRewardsOptOutResponse { + return o && o.$typeUrl === MsgRewardsOptOutResponse.typeUrl; + }, + isAmino(o: any): o is MsgRewardsOptOutResponseAmino { + return o && o.$typeUrl === MsgRewardsOptOutResponse.typeUrl; + }, + encode(_: MsgRewardsOptOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRewardsOptOutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRewardsOptOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRewardsOptOutResponse { + const message = createBaseMsgRewardsOptOutResponse(); + return message; + }, + fromAmino(_: MsgRewardsOptOutResponseAmino): MsgRewardsOptOutResponse { + const message = createBaseMsgRewardsOptOutResponse(); + return message; + }, + toAmino(_: MsgRewardsOptOutResponse): MsgRewardsOptOutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRewardsOptOutResponseAminoMsg): MsgRewardsOptOutResponse { + return MsgRewardsOptOutResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRewardsOptOutResponseProtoMsg): MsgRewardsOptOutResponse { + return MsgRewardsOptOutResponse.decode(message.value); + }, + toProto(message: MsgRewardsOptOutResponse): Uint8Array { + return MsgRewardsOptOutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRewardsOptOutResponse): MsgRewardsOptOutResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse", + value: MsgRewardsOptOutResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRewardsOptOutResponse.typeUrl, MsgRewardsOptOutResponse); +function createBaseMsgReclaimLockedFunds(): MsgReclaimLockedFunds { + return { + sender: "", + lockedAccountPubKey: new Uint8Array(), + signature: new Uint8Array() + }; +} +export const MsgReclaimLockedFunds = { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds", + aminoType: "exchange/MsgReclaimLockedFunds", + is(o: any): o is MsgReclaimLockedFunds { + return o && (o.$typeUrl === MsgReclaimLockedFunds.typeUrl || typeof o.sender === "string" && (o.lockedAccountPubKey instanceof Uint8Array || typeof o.lockedAccountPubKey === "string") && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is MsgReclaimLockedFundsAmino { + return o && (o.$typeUrl === MsgReclaimLockedFunds.typeUrl || typeof o.sender === "string" && (o.lockedAccountPubKey instanceof Uint8Array || typeof o.lockedAccountPubKey === "string") && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: MsgReclaimLockedFunds, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.lockedAccountPubKey.length !== 0) { + writer.uint32(18).bytes(message.lockedAccountPubKey); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgReclaimLockedFunds { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReclaimLockedFunds(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockedAccountPubKey = reader.bytes(); + break; + case 3: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgReclaimLockedFunds { + const message = createBaseMsgReclaimLockedFunds(); + message.sender = object.sender ?? ""; + message.lockedAccountPubKey = object.lockedAccountPubKey ?? new Uint8Array(); + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgReclaimLockedFundsAmino): MsgReclaimLockedFunds { + const message = createBaseMsgReclaimLockedFunds(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lockedAccountPubKey !== undefined && object.lockedAccountPubKey !== null) { + message.lockedAccountPubKey = bytesFromBase64(object.lockedAccountPubKey); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.lockedAccountPubKey = message.lockedAccountPubKey ? base64FromBytes(message.lockedAccountPubKey) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: MsgReclaimLockedFundsAminoMsg): MsgReclaimLockedFunds { + return MsgReclaimLockedFunds.fromAmino(object.value); + }, + toAminoMsg(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsAminoMsg { + return { + type: "exchange/MsgReclaimLockedFunds", + value: MsgReclaimLockedFunds.toAmino(message) + }; + }, + fromProtoMsg(message: MsgReclaimLockedFundsProtoMsg): MsgReclaimLockedFunds { + return MsgReclaimLockedFunds.decode(message.value); + }, + toProto(message: MsgReclaimLockedFunds): Uint8Array { + return MsgReclaimLockedFunds.encode(message).finish(); + }, + toProtoMsg(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds", + value: MsgReclaimLockedFunds.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgReclaimLockedFunds.typeUrl, MsgReclaimLockedFunds); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgReclaimLockedFunds.aminoType, MsgReclaimLockedFunds.typeUrl); +function createBaseMsgReclaimLockedFundsResponse(): MsgReclaimLockedFundsResponse { + return {}; +} +export const MsgReclaimLockedFundsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse", + is(o: any): o is MsgReclaimLockedFundsResponse { + return o && o.$typeUrl === MsgReclaimLockedFundsResponse.typeUrl; + }, + isAmino(o: any): o is MsgReclaimLockedFundsResponseAmino { + return o && o.$typeUrl === MsgReclaimLockedFundsResponse.typeUrl; + }, + encode(_: MsgReclaimLockedFundsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgReclaimLockedFundsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReclaimLockedFundsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgReclaimLockedFundsResponse { + const message = createBaseMsgReclaimLockedFundsResponse(); + return message; + }, + fromAmino(_: MsgReclaimLockedFundsResponseAmino): MsgReclaimLockedFundsResponse { + const message = createBaseMsgReclaimLockedFundsResponse(); + return message; + }, + toAmino(_: MsgReclaimLockedFundsResponse): MsgReclaimLockedFundsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgReclaimLockedFundsResponseAminoMsg): MsgReclaimLockedFundsResponse { + return MsgReclaimLockedFundsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgReclaimLockedFundsResponseProtoMsg): MsgReclaimLockedFundsResponse { + return MsgReclaimLockedFundsResponse.decode(message.value); + }, + toProto(message: MsgReclaimLockedFundsResponse): Uint8Array { + return MsgReclaimLockedFundsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgReclaimLockedFundsResponse): MsgReclaimLockedFundsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse", + value: MsgReclaimLockedFundsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgReclaimLockedFundsResponse.typeUrl, MsgReclaimLockedFundsResponse); +function createBaseMsgSignData(): MsgSignData { + return { + signer: new Uint8Array(), + data: new Uint8Array() + }; +} +export const MsgSignData = { + typeUrl: "/injective.exchange.v1beta1.MsgSignData", + is(o: any): o is MsgSignData { + return o && (o.$typeUrl === MsgSignData.typeUrl || (o.signer instanceof Uint8Array || typeof o.signer === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgSignDataAmino { + return o && (o.$typeUrl === MsgSignData.typeUrl || (o.Signer instanceof Uint8Array || typeof o.Signer === "string") && (o.Data instanceof Uint8Array || typeof o.Data === "string")); + }, + encode(message: MsgSignData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer.length !== 0) { + writer.uint32(10).bytes(message.signer); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSignData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSignData { + const message = createBaseMsgSignData(); + message.signer = object.signer ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSignDataAmino): MsgSignData { + const message = createBaseMsgSignData(); + if (object.Signer !== undefined && object.Signer !== null) { + message.signer = bytesFromBase64(object.Signer); + } + if (object.Data !== undefined && object.Data !== null) { + message.data = bytesFromBase64(object.Data); + } + return message; + }, + toAmino(message: MsgSignData): MsgSignDataAmino { + const obj: any = {}; + obj.Signer = message.signer ? base64FromBytes(message.signer) : ""; + obj.Data = message.data ? base64FromBytes(message.data) : ""; + return obj; + }, + fromAminoMsg(object: MsgSignDataAminoMsg): MsgSignData { + return MsgSignData.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSignDataProtoMsg): MsgSignData { + return MsgSignData.decode(message.value); + }, + toProto(message: MsgSignData): Uint8Array { + return MsgSignData.encode(message).finish(); + }, + toProtoMsg(message: MsgSignData): MsgSignDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSignData", + value: MsgSignData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSignData.typeUrl, MsgSignData); +function createBaseMsgSignDoc(): MsgSignDoc { + return { + signType: "", + value: MsgSignData.fromPartial({}) + }; +} +export const MsgSignDoc = { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc", + is(o: any): o is MsgSignDoc { + return o && (o.$typeUrl === MsgSignDoc.typeUrl || typeof o.signType === "string" && MsgSignData.is(o.value)); + }, + isAmino(o: any): o is MsgSignDocAmino { + return o && (o.$typeUrl === MsgSignDoc.typeUrl || typeof o.sign_type === "string" && MsgSignData.isAmino(o.value)); + }, + encode(message: MsgSignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signType !== "") { + writer.uint32(10).string(message.signType); + } + if (message.value !== undefined) { + MsgSignData.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignDoc(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signType = reader.string(); + break; + case 2: + message.value = MsgSignData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSignDoc { + const message = createBaseMsgSignDoc(); + message.signType = object.signType ?? ""; + message.value = object.value !== undefined && object.value !== null ? MsgSignData.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MsgSignDocAmino): MsgSignDoc { + const message = createBaseMsgSignDoc(); + if (object.sign_type !== undefined && object.sign_type !== null) { + message.signType = object.sign_type; + } + if (object.value !== undefined && object.value !== null) { + message.value = MsgSignData.fromAmino(object.value); + } + return message; + }, + toAmino(message: MsgSignDoc): MsgSignDocAmino { + const obj: any = {}; + obj.sign_type = message.signType ?? ""; + obj.value = message.value ? MsgSignData.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSignDocAminoMsg): MsgSignDoc { + return MsgSignDoc.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSignDocProtoMsg): MsgSignDoc { + return MsgSignDoc.decode(message.value); + }, + toProto(message: MsgSignDoc): Uint8Array { + return MsgSignDoc.encode(message).finish(); + }, + toProtoMsg(message: MsgSignDoc): MsgSignDocProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc", + value: MsgSignDoc.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSignDoc.typeUrl, MsgSignDoc); +function createBaseMsgAdminUpdateBinaryOptionsMarket(): MsgAdminUpdateBinaryOptionsMarket { + return { + sender: "", + marketId: "", + settlementPrice: undefined, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + status: 0 + }; +} +export const MsgAdminUpdateBinaryOptionsMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket", + aminoType: "exchange/MsgAdminUpdateBinaryOptionsMarket", + is(o: any): o is MsgAdminUpdateBinaryOptionsMarket { + return o && (o.$typeUrl === MsgAdminUpdateBinaryOptionsMarket.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && isSet(o.status)); + }, + isAmino(o: any): o is MsgAdminUpdateBinaryOptionsMarketAmino { + return o && (o.$typeUrl === MsgAdminUpdateBinaryOptionsMarket.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && isSet(o.status)); + }, + encode(message: MsgAdminUpdateBinaryOptionsMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.settlementPrice !== undefined) { + writer.uint32(26).string(message.settlementPrice); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.settlementTimestamp); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAdminUpdateBinaryOptionsMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.settlementPrice = reader.string(); + break; + case 4: + message.expirationTimestamp = reader.int64(); + break; + case 5: + message.settlementTimestamp = reader.int64(); + break; + case 6: + message.status = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAdminUpdateBinaryOptionsMarket { + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: MsgAdminUpdateBinaryOptionsMarketAmino): MsgAdminUpdateBinaryOptionsMarket { + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: MsgAdminUpdateBinaryOptionsMarketAminoMsg): MsgAdminUpdateBinaryOptionsMarket { + return MsgAdminUpdateBinaryOptionsMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketAminoMsg { + return { + type: "exchange/MsgAdminUpdateBinaryOptionsMarket", + value: MsgAdminUpdateBinaryOptionsMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketProtoMsg): MsgAdminUpdateBinaryOptionsMarket { + return MsgAdminUpdateBinaryOptionsMarket.decode(message.value); + }, + toProto(message: MsgAdminUpdateBinaryOptionsMarket): Uint8Array { + return MsgAdminUpdateBinaryOptionsMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket", + value: MsgAdminUpdateBinaryOptionsMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAdminUpdateBinaryOptionsMarket.typeUrl, MsgAdminUpdateBinaryOptionsMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAdminUpdateBinaryOptionsMarket.aminoType, MsgAdminUpdateBinaryOptionsMarket.typeUrl); +function createBaseMsgAdminUpdateBinaryOptionsMarketResponse(): MsgAdminUpdateBinaryOptionsMarketResponse { + return {}; +} +export const MsgAdminUpdateBinaryOptionsMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse", + is(o: any): o is MsgAdminUpdateBinaryOptionsMarketResponse { + return o && o.$typeUrl === MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgAdminUpdateBinaryOptionsMarketResponseAmino { + return o && o.$typeUrl === MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl; + }, + encode(_: MsgAdminUpdateBinaryOptionsMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAdminUpdateBinaryOptionsMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAdminUpdateBinaryOptionsMarketResponse { + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + return message; + }, + fromAmino(_: MsgAdminUpdateBinaryOptionsMarketResponseAmino): MsgAdminUpdateBinaryOptionsMarketResponse { + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + return message; + }, + toAmino(_: MsgAdminUpdateBinaryOptionsMarketResponse): MsgAdminUpdateBinaryOptionsMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAdminUpdateBinaryOptionsMarketResponseAminoMsg): MsgAdminUpdateBinaryOptionsMarketResponse { + return MsgAdminUpdateBinaryOptionsMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg): MsgAdminUpdateBinaryOptionsMarketResponse { + return MsgAdminUpdateBinaryOptionsMarketResponse.decode(message.value); + }, + toProto(message: MsgAdminUpdateBinaryOptionsMarketResponse): Uint8Array { + return MsgAdminUpdateBinaryOptionsMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketResponse): MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse", + value: MsgAdminUpdateBinaryOptionsMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl, MsgAdminUpdateBinaryOptionsMarketResponse); +function createBaseMsgAuthorizeStakeGrants(): MsgAuthorizeStakeGrants { + return { + sender: "", + grants: [] + }; +} +export const MsgAuthorizeStakeGrants = { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants", + aminoType: "exchange/MsgAuthorizeStakeGrants", + is(o: any): o is MsgAuthorizeStakeGrants { + return o && (o.$typeUrl === MsgAuthorizeStakeGrants.typeUrl || typeof o.sender === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is MsgAuthorizeStakeGrantsAmino { + return o && (o.$typeUrl === MsgAuthorizeStakeGrants.typeUrl || typeof o.sender === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: MsgAuthorizeStakeGrants, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeStakeGrants { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeStakeGrants(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAuthorizeStakeGrants { + const message = createBaseMsgAuthorizeStakeGrants(); + message.sender = object.sender ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAuthorizeStakeGrantsAmino): MsgAuthorizeStakeGrants { + const message = createBaseMsgAuthorizeStakeGrants(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: MsgAuthorizeStakeGrantsAminoMsg): MsgAuthorizeStakeGrants { + return MsgAuthorizeStakeGrants.fromAmino(object.value); + }, + toAminoMsg(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsAminoMsg { + return { + type: "exchange/MsgAuthorizeStakeGrants", + value: MsgAuthorizeStakeGrants.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAuthorizeStakeGrantsProtoMsg): MsgAuthorizeStakeGrants { + return MsgAuthorizeStakeGrants.decode(message.value); + }, + toProto(message: MsgAuthorizeStakeGrants): Uint8Array { + return MsgAuthorizeStakeGrants.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants", + value: MsgAuthorizeStakeGrants.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAuthorizeStakeGrants.typeUrl, MsgAuthorizeStakeGrants); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAuthorizeStakeGrants.aminoType, MsgAuthorizeStakeGrants.typeUrl); +function createBaseMsgAuthorizeStakeGrantsResponse(): MsgAuthorizeStakeGrantsResponse { + return {}; +} +export const MsgAuthorizeStakeGrantsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse", + is(o: any): o is MsgAuthorizeStakeGrantsResponse { + return o && o.$typeUrl === MsgAuthorizeStakeGrantsResponse.typeUrl; + }, + isAmino(o: any): o is MsgAuthorizeStakeGrantsResponseAmino { + return o && o.$typeUrl === MsgAuthorizeStakeGrantsResponse.typeUrl; + }, + encode(_: MsgAuthorizeStakeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeStakeGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAuthorizeStakeGrantsResponse { + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + return message; + }, + fromAmino(_: MsgAuthorizeStakeGrantsResponseAmino): MsgAuthorizeStakeGrantsResponse { + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + return message; + }, + toAmino(_: MsgAuthorizeStakeGrantsResponse): MsgAuthorizeStakeGrantsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAuthorizeStakeGrantsResponseAminoMsg): MsgAuthorizeStakeGrantsResponse { + return MsgAuthorizeStakeGrantsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAuthorizeStakeGrantsResponseProtoMsg): MsgAuthorizeStakeGrantsResponse { + return MsgAuthorizeStakeGrantsResponse.decode(message.value); + }, + toProto(message: MsgAuthorizeStakeGrantsResponse): Uint8Array { + return MsgAuthorizeStakeGrantsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeStakeGrantsResponse): MsgAuthorizeStakeGrantsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse", + value: MsgAuthorizeStakeGrantsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAuthorizeStakeGrantsResponse.typeUrl, MsgAuthorizeStakeGrantsResponse); +function createBaseMsgActivateStakeGrant(): MsgActivateStakeGrant { + return { + sender: "", + granter: "" + }; +} +export const MsgActivateStakeGrant = { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant", + aminoType: "exchange/MsgActivateStakeGrant", + is(o: any): o is MsgActivateStakeGrant { + return o && (o.$typeUrl === MsgActivateStakeGrant.typeUrl || typeof o.sender === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is MsgActivateStakeGrantAmino { + return o && (o.$typeUrl === MsgActivateStakeGrant.typeUrl || typeof o.sender === "string" && typeof o.granter === "string"); + }, + encode(message: MsgActivateStakeGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateStakeGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateStakeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgActivateStakeGrant { + const message = createBaseMsgActivateStakeGrant(); + message.sender = object.sender ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: MsgActivateStakeGrantAmino): MsgActivateStakeGrant { + const message = createBaseMsgActivateStakeGrant(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: MsgActivateStakeGrant): MsgActivateStakeGrantAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: MsgActivateStakeGrantAminoMsg): MsgActivateStakeGrant { + return MsgActivateStakeGrant.fromAmino(object.value); + }, + toAminoMsg(message: MsgActivateStakeGrant): MsgActivateStakeGrantAminoMsg { + return { + type: "exchange/MsgActivateStakeGrant", + value: MsgActivateStakeGrant.toAmino(message) + }; + }, + fromProtoMsg(message: MsgActivateStakeGrantProtoMsg): MsgActivateStakeGrant { + return MsgActivateStakeGrant.decode(message.value); + }, + toProto(message: MsgActivateStakeGrant): Uint8Array { + return MsgActivateStakeGrant.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateStakeGrant): MsgActivateStakeGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant", + value: MsgActivateStakeGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateStakeGrant.typeUrl, MsgActivateStakeGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgActivateStakeGrant.aminoType, MsgActivateStakeGrant.typeUrl); +function createBaseMsgActivateStakeGrantResponse(): MsgActivateStakeGrantResponse { + return {}; +} +export const MsgActivateStakeGrantResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse", + is(o: any): o is MsgActivateStakeGrantResponse { + return o && o.$typeUrl === MsgActivateStakeGrantResponse.typeUrl; + }, + isAmino(o: any): o is MsgActivateStakeGrantResponseAmino { + return o && o.$typeUrl === MsgActivateStakeGrantResponse.typeUrl; + }, + encode(_: MsgActivateStakeGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateStakeGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateStakeGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgActivateStakeGrantResponse { + const message = createBaseMsgActivateStakeGrantResponse(); + return message; + }, + fromAmino(_: MsgActivateStakeGrantResponseAmino): MsgActivateStakeGrantResponse { + const message = createBaseMsgActivateStakeGrantResponse(); + return message; + }, + toAmino(_: MsgActivateStakeGrantResponse): MsgActivateStakeGrantResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgActivateStakeGrantResponseAminoMsg): MsgActivateStakeGrantResponse { + return MsgActivateStakeGrantResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgActivateStakeGrantResponseProtoMsg): MsgActivateStakeGrantResponse { + return MsgActivateStakeGrantResponse.decode(message.value); + }, + toProto(message: MsgActivateStakeGrantResponse): Uint8Array { + return MsgActivateStakeGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateStakeGrantResponse): MsgActivateStakeGrantResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse", + value: MsgActivateStakeGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateStakeGrantResponse.typeUrl, MsgActivateStakeGrantResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/events.ts b/libs/injective-query/src/injective/insurance/v1beta1/events.ts new file mode 100644 index 00000000..b4bca225 --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/events.ts @@ -0,0 +1,521 @@ +import { InsuranceFund, InsuranceFundAmino, RedemptionSchedule, RedemptionScheduleAmino } from "./insurance"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventInsuranceFundUpdate { + fund?: InsuranceFund; +} +export interface EventInsuranceFundUpdateProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate"; + value: Uint8Array; +} +export interface EventInsuranceFundUpdateAmino { + fund?: InsuranceFundAmino; +} +export interface EventInsuranceFundUpdateAminoMsg { + type: "/injective.insurance.v1beta1.EventInsuranceFundUpdate"; + value: EventInsuranceFundUpdateAmino; +} +export interface EventRequestRedemption { + schedule?: RedemptionSchedule; +} +export interface EventRequestRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption"; + value: Uint8Array; +} +export interface EventRequestRedemptionAmino { + schedule?: RedemptionScheduleAmino; +} +export interface EventRequestRedemptionAminoMsg { + type: "/injective.insurance.v1beta1.EventRequestRedemption"; + value: EventRequestRedemptionAmino; +} +export interface EventWithdrawRedemption { + /** redemption schedule triggered withdraw */ + schedule?: RedemptionSchedule; + /** redeem coin amount in base_currency */ + redeemCoin: Coin; +} +export interface EventWithdrawRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption"; + value: Uint8Array; +} +export interface EventWithdrawRedemptionAmino { + /** redemption schedule triggered withdraw */ + schedule?: RedemptionScheduleAmino; + /** redeem coin amount in base_currency */ + redeem_coin: CoinAmino; +} +export interface EventWithdrawRedemptionAminoMsg { + type: "/injective.insurance.v1beta1.EventWithdrawRedemption"; + value: EventWithdrawRedemptionAmino; +} +export interface EventUnderwrite { + /** address of the underwriter */ + underwriter: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** deposit coin amount */ + deposit: Coin; + /** share coin amount */ + shares: Coin; +} +export interface EventUnderwriteProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite"; + value: Uint8Array; +} +export interface EventUnderwriteAmino { + /** address of the underwriter */ + underwriter: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** deposit coin amount */ + deposit: CoinAmino; + /** share coin amount */ + shares: CoinAmino; +} +export interface EventUnderwriteAminoMsg { + type: "/injective.insurance.v1beta1.EventUnderwrite"; + value: EventUnderwriteAmino; +} +export interface EventInsuranceWithdraw { + marketId: string; + marketTicker: string; + withdrawal: Coin; +} +export interface EventInsuranceWithdrawProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw"; + value: Uint8Array; +} +export interface EventInsuranceWithdrawAmino { + market_id: string; + market_ticker: string; + withdrawal: CoinAmino; +} +export interface EventInsuranceWithdrawAminoMsg { + type: "/injective.insurance.v1beta1.EventInsuranceWithdraw"; + value: EventInsuranceWithdrawAmino; +} +function createBaseEventInsuranceFundUpdate(): EventInsuranceFundUpdate { + return { + fund: undefined + }; +} +export const EventInsuranceFundUpdate = { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate", + is(o: any): o is EventInsuranceFundUpdate { + return o && o.$typeUrl === EventInsuranceFundUpdate.typeUrl; + }, + isAmino(o: any): o is EventInsuranceFundUpdateAmino { + return o && o.$typeUrl === EventInsuranceFundUpdate.typeUrl; + }, + encode(message: EventInsuranceFundUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fund !== undefined) { + InsuranceFund.encode(message.fund, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInsuranceFundUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInsuranceFundUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fund = InsuranceFund.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInsuranceFundUpdate { + const message = createBaseEventInsuranceFundUpdate(); + message.fund = object.fund !== undefined && object.fund !== null ? InsuranceFund.fromPartial(object.fund) : undefined; + return message; + }, + fromAmino(object: EventInsuranceFundUpdateAmino): EventInsuranceFundUpdate { + const message = createBaseEventInsuranceFundUpdate(); + if (object.fund !== undefined && object.fund !== null) { + message.fund = InsuranceFund.fromAmino(object.fund); + } + return message; + }, + toAmino(message: EventInsuranceFundUpdate): EventInsuranceFundUpdateAmino { + const obj: any = {}; + obj.fund = message.fund ? InsuranceFund.toAmino(message.fund) : undefined; + return obj; + }, + fromAminoMsg(object: EventInsuranceFundUpdateAminoMsg): EventInsuranceFundUpdate { + return EventInsuranceFundUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventInsuranceFundUpdateProtoMsg): EventInsuranceFundUpdate { + return EventInsuranceFundUpdate.decode(message.value); + }, + toProto(message: EventInsuranceFundUpdate): Uint8Array { + return EventInsuranceFundUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventInsuranceFundUpdate): EventInsuranceFundUpdateProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate", + value: EventInsuranceFundUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInsuranceFundUpdate.typeUrl, EventInsuranceFundUpdate); +function createBaseEventRequestRedemption(): EventRequestRedemption { + return { + schedule: undefined + }; +} +export const EventRequestRedemption = { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption", + is(o: any): o is EventRequestRedemption { + return o && o.$typeUrl === EventRequestRedemption.typeUrl; + }, + isAmino(o: any): o is EventRequestRedemptionAmino { + return o && o.$typeUrl === EventRequestRedemption.typeUrl; + }, + encode(message: EventRequestRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + RedemptionSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventRequestRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventRequestRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = RedemptionSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventRequestRedemption { + const message = createBaseEventRequestRedemption(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? RedemptionSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: EventRequestRedemptionAmino): EventRequestRedemption { + const message = createBaseEventRequestRedemption(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = RedemptionSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: EventRequestRedemption): EventRequestRedemptionAmino { + const obj: any = {}; + obj.schedule = message.schedule ? RedemptionSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: EventRequestRedemptionAminoMsg): EventRequestRedemption { + return EventRequestRedemption.fromAmino(object.value); + }, + fromProtoMsg(message: EventRequestRedemptionProtoMsg): EventRequestRedemption { + return EventRequestRedemption.decode(message.value); + }, + toProto(message: EventRequestRedemption): Uint8Array { + return EventRequestRedemption.encode(message).finish(); + }, + toProtoMsg(message: EventRequestRedemption): EventRequestRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption", + value: EventRequestRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventRequestRedemption.typeUrl, EventRequestRedemption); +function createBaseEventWithdrawRedemption(): EventWithdrawRedemption { + return { + schedule: undefined, + redeemCoin: Coin.fromPartial({}) + }; +} +export const EventWithdrawRedemption = { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption", + is(o: any): o is EventWithdrawRedemption { + return o && (o.$typeUrl === EventWithdrawRedemption.typeUrl || Coin.is(o.redeemCoin)); + }, + isAmino(o: any): o is EventWithdrawRedemptionAmino { + return o && (o.$typeUrl === EventWithdrawRedemption.typeUrl || Coin.isAmino(o.redeem_coin)); + }, + encode(message: EventWithdrawRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + RedemptionSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + if (message.redeemCoin !== undefined) { + Coin.encode(message.redeemCoin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = RedemptionSchedule.decode(reader, reader.uint32()); + break; + case 2: + message.redeemCoin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventWithdrawRedemption { + const message = createBaseEventWithdrawRedemption(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? RedemptionSchedule.fromPartial(object.schedule) : undefined; + message.redeemCoin = object.redeemCoin !== undefined && object.redeemCoin !== null ? Coin.fromPartial(object.redeemCoin) : undefined; + return message; + }, + fromAmino(object: EventWithdrawRedemptionAmino): EventWithdrawRedemption { + const message = createBaseEventWithdrawRedemption(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = RedemptionSchedule.fromAmino(object.schedule); + } + if (object.redeem_coin !== undefined && object.redeem_coin !== null) { + message.redeemCoin = Coin.fromAmino(object.redeem_coin); + } + return message; + }, + toAmino(message: EventWithdrawRedemption): EventWithdrawRedemptionAmino { + const obj: any = {}; + obj.schedule = message.schedule ? RedemptionSchedule.toAmino(message.schedule) : undefined; + obj.redeem_coin = message.redeemCoin ? Coin.toAmino(message.redeemCoin) : undefined; + return obj; + }, + fromAminoMsg(object: EventWithdrawRedemptionAminoMsg): EventWithdrawRedemption { + return EventWithdrawRedemption.fromAmino(object.value); + }, + fromProtoMsg(message: EventWithdrawRedemptionProtoMsg): EventWithdrawRedemption { + return EventWithdrawRedemption.decode(message.value); + }, + toProto(message: EventWithdrawRedemption): Uint8Array { + return EventWithdrawRedemption.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawRedemption): EventWithdrawRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption", + value: EventWithdrawRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventWithdrawRedemption.typeUrl, EventWithdrawRedemption); +function createBaseEventUnderwrite(): EventUnderwrite { + return { + underwriter: "", + marketId: "", + deposit: Coin.fromPartial({}), + shares: Coin.fromPartial({}) + }; +} +export const EventUnderwrite = { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite", + is(o: any): o is EventUnderwrite { + return o && (o.$typeUrl === EventUnderwrite.typeUrl || typeof o.underwriter === "string" && typeof o.marketId === "string" && Coin.is(o.deposit) && Coin.is(o.shares)); + }, + isAmino(o: any): o is EventUnderwriteAmino { + return o && (o.$typeUrl === EventUnderwrite.typeUrl || typeof o.underwriter === "string" && typeof o.marketId === "string" && Coin.isAmino(o.deposit) && Coin.isAmino(o.shares)); + }, + encode(message: EventUnderwrite, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.underwriter !== "") { + writer.uint32(10).string(message.underwriter); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(26).fork()).ldelim(); + } + if (message.shares !== undefined) { + Coin.encode(message.shares, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUnderwrite { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUnderwrite(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.underwriter = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.deposit = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.shares = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventUnderwrite { + const message = createBaseEventUnderwrite(); + message.underwriter = object.underwriter ?? ""; + message.marketId = object.marketId ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Coin.fromPartial(object.deposit) : undefined; + message.shares = object.shares !== undefined && object.shares !== null ? Coin.fromPartial(object.shares) : undefined; + return message; + }, + fromAmino(object: EventUnderwriteAmino): EventUnderwrite { + const message = createBaseEventUnderwrite(); + if (object.underwriter !== undefined && object.underwriter !== null) { + message.underwriter = object.underwriter; + } + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Coin.fromAmino(object.deposit); + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = Coin.fromAmino(object.shares); + } + return message; + }, + toAmino(message: EventUnderwrite): EventUnderwriteAmino { + const obj: any = {}; + obj.underwriter = message.underwriter === "" ? undefined : message.underwriter; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.deposit = message.deposit ? Coin.toAmino(message.deposit) : undefined; + obj.shares = message.shares ? Coin.toAmino(message.shares) : undefined; + return obj; + }, + fromAminoMsg(object: EventUnderwriteAminoMsg): EventUnderwrite { + return EventUnderwrite.fromAmino(object.value); + }, + fromProtoMsg(message: EventUnderwriteProtoMsg): EventUnderwrite { + return EventUnderwrite.decode(message.value); + }, + toProto(message: EventUnderwrite): Uint8Array { + return EventUnderwrite.encode(message).finish(); + }, + toProtoMsg(message: EventUnderwrite): EventUnderwriteProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite", + value: EventUnderwrite.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventUnderwrite.typeUrl, EventUnderwrite); +function createBaseEventInsuranceWithdraw(): EventInsuranceWithdraw { + return { + marketId: "", + marketTicker: "", + withdrawal: Coin.fromPartial({}) + }; +} +export const EventInsuranceWithdraw = { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw", + is(o: any): o is EventInsuranceWithdraw { + return o && (o.$typeUrl === EventInsuranceWithdraw.typeUrl || typeof o.marketId === "string" && typeof o.marketTicker === "string" && Coin.is(o.withdrawal)); + }, + isAmino(o: any): o is EventInsuranceWithdrawAmino { + return o && (o.$typeUrl === EventInsuranceWithdraw.typeUrl || typeof o.market_id === "string" && typeof o.market_ticker === "string" && Coin.isAmino(o.withdrawal)); + }, + encode(message: EventInsuranceWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.marketTicker !== "") { + writer.uint32(18).string(message.marketTicker); + } + if (message.withdrawal !== undefined) { + Coin.encode(message.withdrawal, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInsuranceWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInsuranceWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.marketTicker = reader.string(); + break; + case 3: + message.withdrawal = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInsuranceWithdraw { + const message = createBaseEventInsuranceWithdraw(); + message.marketId = object.marketId ?? ""; + message.marketTicker = object.marketTicker ?? ""; + message.withdrawal = object.withdrawal !== undefined && object.withdrawal !== null ? Coin.fromPartial(object.withdrawal) : undefined; + return message; + }, + fromAmino(object: EventInsuranceWithdrawAmino): EventInsuranceWithdraw { + const message = createBaseEventInsuranceWithdraw(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_ticker !== undefined && object.market_ticker !== null) { + message.marketTicker = object.market_ticker; + } + if (object.withdrawal !== undefined && object.withdrawal !== null) { + message.withdrawal = Coin.fromAmino(object.withdrawal); + } + return message; + }, + toAmino(message: EventInsuranceWithdraw): EventInsuranceWithdrawAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_ticker = message.marketTicker === "" ? undefined : message.marketTicker; + obj.withdrawal = message.withdrawal ? Coin.toAmino(message.withdrawal) : undefined; + return obj; + }, + fromAminoMsg(object: EventInsuranceWithdrawAminoMsg): EventInsuranceWithdraw { + return EventInsuranceWithdraw.fromAmino(object.value); + }, + fromProtoMsg(message: EventInsuranceWithdrawProtoMsg): EventInsuranceWithdraw { + return EventInsuranceWithdraw.decode(message.value); + }, + toProto(message: EventInsuranceWithdraw): Uint8Array { + return EventInsuranceWithdraw.encode(message).finish(); + }, + toProtoMsg(message: EventInsuranceWithdraw): EventInsuranceWithdrawProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw", + value: EventInsuranceWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInsuranceWithdraw.typeUrl, EventInsuranceWithdraw); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/genesis.ts b/libs/injective-query/src/injective/insurance/v1beta1/genesis.ts new file mode 100644 index 00000000..ee8fb73c --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/genesis.ts @@ -0,0 +1,178 @@ +import { Params, ParamsAmino, InsuranceFund, InsuranceFundAmino, RedemptionSchedule, RedemptionScheduleAmino } from "./insurance"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the insurance module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to insurance. */ + params: Params; + /** + * insurance_funds describes the insurance funds available for derivative + * markets + */ + insuranceFunds: InsuranceFund[]; + /** redemption_schedule describes the redemption requests pending */ + redemptionSchedule: RedemptionSchedule[]; + /** + * next_share_denom_id describes the next share denom id to be used for newly + * creating insurance fund incremented by 1 per insurance fund creation + */ + nextShareDenomId: bigint; + /** + * next_redemption_schedule_id describes next redemption schedule id to be + * used for next schedule incremented by 1 per redemption request + */ + nextRedemptionScheduleId: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.insurance.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the insurance module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to insurance. */ + params: ParamsAmino; + /** + * insurance_funds describes the insurance funds available for derivative + * markets + */ + insurance_funds: InsuranceFundAmino[]; + /** redemption_schedule describes the redemption requests pending */ + redemption_schedule: RedemptionScheduleAmino[]; + /** + * next_share_denom_id describes the next share denom id to be used for newly + * creating insurance fund incremented by 1 per insurance fund creation + */ + next_share_denom_id: string; + /** + * next_redemption_schedule_id describes next redemption schedule id to be + * used for next schedule incremented by 1 per redemption request + */ + next_redemption_schedule_id: string; +} +export interface GenesisStateAminoMsg { + type: "/injective.insurance.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + insuranceFunds: [], + redemptionSchedule: [], + nextShareDenomId: BigInt(0), + nextRedemptionScheduleId: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/injective.insurance.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.insuranceFunds) && (!o.insuranceFunds.length || InsuranceFund.is(o.insuranceFunds[0])) && Array.isArray(o.redemptionSchedule) && (!o.redemptionSchedule.length || RedemptionSchedule.is(o.redemptionSchedule[0])) && typeof o.nextShareDenomId === "bigint" && typeof o.nextRedemptionScheduleId === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.insurance_funds) && (!o.insurance_funds.length || InsuranceFund.isAmino(o.insurance_funds[0])) && Array.isArray(o.redemption_schedule) && (!o.redemption_schedule.length || RedemptionSchedule.isAmino(o.redemption_schedule[0])) && typeof o.next_share_denom_id === "bigint" && typeof o.next_redemption_schedule_id === "bigint"); + }, + 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.insuranceFunds) { + InsuranceFund.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.redemptionSchedule) { + RedemptionSchedule.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.nextShareDenomId !== BigInt(0)) { + writer.uint32(32).uint64(message.nextShareDenomId); + } + if (message.nextRedemptionScheduleId !== BigInt(0)) { + writer.uint32(40).uint64(message.nextRedemptionScheduleId); + } + 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.insuranceFunds.push(InsuranceFund.decode(reader, reader.uint32())); + break; + case 3: + message.redemptionSchedule.push(RedemptionSchedule.decode(reader, reader.uint32())); + break; + case 4: + message.nextShareDenomId = reader.uint64(); + break; + case 5: + message.nextRedemptionScheduleId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.insuranceFunds = object.insuranceFunds?.map(e => InsuranceFund.fromPartial(e)) || []; + message.redemptionSchedule = object.redemptionSchedule?.map(e => RedemptionSchedule.fromPartial(e)) || []; + message.nextShareDenomId = object.nextShareDenomId !== undefined && object.nextShareDenomId !== null ? BigInt(object.nextShareDenomId.toString()) : BigInt(0); + message.nextRedemptionScheduleId = object.nextRedemptionScheduleId !== undefined && object.nextRedemptionScheduleId !== null ? BigInt(object.nextRedemptionScheduleId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.insuranceFunds = object.insurance_funds?.map(e => InsuranceFund.fromAmino(e)) || []; + message.redemptionSchedule = object.redemption_schedule?.map(e => RedemptionSchedule.fromAmino(e)) || []; + if (object.next_share_denom_id !== undefined && object.next_share_denom_id !== null) { + message.nextShareDenomId = BigInt(object.next_share_denom_id); + } + if (object.next_redemption_schedule_id !== undefined && object.next_redemption_schedule_id !== null) { + message.nextRedemptionScheduleId = BigInt(object.next_redemption_schedule_id); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.insuranceFunds) { + obj.insurance_funds = message.insuranceFunds.map(e => e ? InsuranceFund.toAmino(e) : undefined); + } else { + obj.insurance_funds = message.insuranceFunds; + } + if (message.redemptionSchedule) { + obj.redemption_schedule = message.redemptionSchedule.map(e => e ? RedemptionSchedule.toAmino(e) : undefined); + } else { + obj.redemption_schedule = message.redemptionSchedule; + } + obj.next_share_denom_id = message.nextShareDenomId !== BigInt(0) ? message.nextShareDenomId?.toString() : undefined; + obj.next_redemption_schedule_id = message.nextRedemptionScheduleId !== BigInt(0) ? message.nextRedemptionScheduleId?.toString() : undefined; + 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: "/injective.insurance.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/insurance.ts b/libs/injective-query/src/injective/insurance/v1beta1/insurance.ts new file mode 100644 index 00000000..ac3a0186 --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/insurance.ts @@ -0,0 +1,531 @@ +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** + * default_redemption_notice_period_duration defines the default minimum + * notice period duration that must pass after an underwriter sends a + * redemption request before the underwriter can claim his tokens + */ + defaultRedemptionNoticePeriodDuration: Duration; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.insurance.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * default_redemption_notice_period_duration defines the default minimum + * notice period duration that must pass after an underwriter sends a + * redemption request before the underwriter can claim his tokens + */ + default_redemption_notice_period_duration: DurationAmino; +} +export interface ParamsAminoMsg { + type: "insurance/Params"; + value: ParamsAmino; +} +export interface InsuranceFund { + /** deposit denomination for the given insurance fund */ + depositDenom: string; + /** insurance fund pool token denomination for the given insurance fund */ + insurancePoolTokenDenom: string; + /** + * redemption_notice_period_duration defines the minimum notice period + * duration that must pass after an underwriter sends a redemption request + * before the underwriter can claim his tokens + */ + redemptionNoticePeriodDuration: Duration; + /** balance of fund */ + balance: string; + /** total share tokens minted */ + totalShare: string; + /** marketID of the derivative market */ + marketId: string; + /** ticker of the derivative market */ + marketTicker: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracleBase: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracleQuote: string; + /** Oracle type of the binary options or derivative market */ + oracleType: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: bigint; +} +export interface InsuranceFundProtoMsg { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund"; + value: Uint8Array; +} +export interface InsuranceFundAmino { + /** deposit denomination for the given insurance fund */ + deposit_denom: string; + /** insurance fund pool token denomination for the given insurance fund */ + insurance_pool_token_denom: string; + /** + * redemption_notice_period_duration defines the minimum notice period + * duration that must pass after an underwriter sends a redemption request + * before the underwriter can claim his tokens + */ + redemption_notice_period_duration: DurationAmino; + /** balance of fund */ + balance: string; + /** total share tokens minted */ + total_share: string; + /** marketID of the derivative market */ + market_id: string; + /** ticker of the derivative market */ + market_ticker: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracle_base: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracle_quote: string; + /** Oracle type of the binary options or derivative market */ + oracle_type: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: string; +} +export interface InsuranceFundAminoMsg { + type: "/injective.insurance.v1beta1.InsuranceFund"; + value: InsuranceFundAmino; +} +export interface RedemptionSchedule { + /** id of redemption schedule */ + id: bigint; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** address of the redeemer */ + redeemer: string; + /** the time after which the redemption can be claimed */ + claimableRedemptionTime: Date; + /** the insurance_pool_token amount to redeem */ + redemptionAmount: Coin; +} +export interface RedemptionScheduleProtoMsg { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule"; + value: Uint8Array; +} +export interface RedemptionScheduleAmino { + /** id of redemption schedule */ + id: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** address of the redeemer */ + redeemer: string; + /** the time after which the redemption can be claimed */ + claimable_redemption_time: string; + /** the insurance_pool_token amount to redeem */ + redemption_amount: CoinAmino; +} +export interface RedemptionScheduleAminoMsg { + type: "/injective.insurance.v1beta1.RedemptionSchedule"; + value: RedemptionScheduleAmino; +} +function createBaseParams(): Params { + return { + defaultRedemptionNoticePeriodDuration: Duration.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/injective.insurance.v1beta1.Params", + aminoType: "insurance/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.defaultRedemptionNoticePeriodDuration)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.default_redemption_notice_period_duration)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.defaultRedemptionNoticePeriodDuration !== undefined) { + Duration.encode(message.defaultRedemptionNoticePeriodDuration, 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.defaultRedemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.defaultRedemptionNoticePeriodDuration = object.defaultRedemptionNoticePeriodDuration !== undefined && object.defaultRedemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.defaultRedemptionNoticePeriodDuration) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.default_redemption_notice_period_duration !== undefined && object.default_redemption_notice_period_duration !== null) { + message.defaultRedemptionNoticePeriodDuration = Duration.fromAmino(object.default_redemption_notice_period_duration); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.default_redemption_notice_period_duration = message.defaultRedemptionNoticePeriodDuration ? Duration.toAmino(message.defaultRedemptionNoticePeriodDuration) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "insurance/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: "/injective.insurance.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseInsuranceFund(): InsuranceFund { + return { + depositDenom: "", + insurancePoolTokenDenom: "", + redemptionNoticePeriodDuration: Duration.fromPartial({}), + balance: "", + totalShare: "", + marketId: "", + marketTicker: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + expiry: BigInt(0) + }; +} +export const InsuranceFund = { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund", + is(o: any): o is InsuranceFund { + return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.depositDenom === "string" && typeof o.insurancePoolTokenDenom === "string" && Duration.is(o.redemptionNoticePeriodDuration) && typeof o.balance === "string" && typeof o.totalShare === "string" && typeof o.marketId === "string" && typeof o.marketTicker === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.expiry === "bigint"); + }, + isAmino(o: any): o is InsuranceFundAmino { + return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.deposit_denom === "string" && typeof o.insurance_pool_token_denom === "string" && Duration.isAmino(o.redemption_notice_period_duration) && typeof o.balance === "string" && typeof o.total_share === "string" && typeof o.market_id === "string" && typeof o.market_ticker === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.expiry === "bigint"); + }, + encode(message: InsuranceFund, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.depositDenom !== "") { + writer.uint32(10).string(message.depositDenom); + } + if (message.insurancePoolTokenDenom !== "") { + writer.uint32(18).string(message.insurancePoolTokenDenom); + } + if (message.redemptionNoticePeriodDuration !== undefined) { + Duration.encode(message.redemptionNoticePeriodDuration, writer.uint32(26).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + if (message.totalShare !== "") { + writer.uint32(42).string(message.totalShare); + } + if (message.marketId !== "") { + writer.uint32(50).string(message.marketId); + } + if (message.marketTicker !== "") { + writer.uint32(58).string(message.marketTicker); + } + if (message.oracleBase !== "") { + writer.uint32(66).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(74).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(80).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(88).int64(message.expiry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InsuranceFund { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInsuranceFund(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositDenom = reader.string(); + break; + case 2: + message.insurancePoolTokenDenom = reader.string(); + break; + case 3: + message.redemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + case 5: + message.totalShare = reader.string(); + break; + case 6: + message.marketId = reader.string(); + break; + case 7: + message.marketTicker = reader.string(); + break; + case 8: + message.oracleBase = reader.string(); + break; + case 9: + message.oracleQuote = reader.string(); + break; + case 10: + message.oracleType = (reader.int32() as any); + break; + case 11: + message.expiry = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): InsuranceFund { + const message = createBaseInsuranceFund(); + message.depositDenom = object.depositDenom ?? ""; + message.insurancePoolTokenDenom = object.insurancePoolTokenDenom ?? ""; + message.redemptionNoticePeriodDuration = object.redemptionNoticePeriodDuration !== undefined && object.redemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.redemptionNoticePeriodDuration) : undefined; + message.balance = object.balance ?? ""; + message.totalShare = object.totalShare ?? ""; + message.marketId = object.marketId ?? ""; + message.marketTicker = object.marketTicker ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + return message; + }, + fromAmino(object: InsuranceFundAmino): InsuranceFund { + const message = createBaseInsuranceFund(); + if (object.deposit_denom !== undefined && object.deposit_denom !== null) { + message.depositDenom = object.deposit_denom; + } + if (object.insurance_pool_token_denom !== undefined && object.insurance_pool_token_denom !== null) { + message.insurancePoolTokenDenom = object.insurance_pool_token_denom; + } + if (object.redemption_notice_period_duration !== undefined && object.redemption_notice_period_duration !== null) { + message.redemptionNoticePeriodDuration = Duration.fromAmino(object.redemption_notice_period_duration); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.total_share !== undefined && object.total_share !== null) { + message.totalShare = object.total_share; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_ticker !== undefined && object.market_ticker !== null) { + message.marketTicker = object.market_ticker; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + return message; + }, + toAmino(message: InsuranceFund): InsuranceFundAmino { + const obj: any = {}; + obj.deposit_denom = message.depositDenom === "" ? undefined : message.depositDenom; + obj.insurance_pool_token_denom = message.insurancePoolTokenDenom === "" ? undefined : message.insurancePoolTokenDenom; + obj.redemption_notice_period_duration = message.redemptionNoticePeriodDuration ? Duration.toAmino(message.redemptionNoticePeriodDuration) : undefined; + obj.balance = message.balance === "" ? undefined : message.balance; + obj.total_share = message.totalShare === "" ? undefined : message.totalShare; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_ticker = message.marketTicker === "" ? undefined : message.marketTicker; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: InsuranceFundAminoMsg): InsuranceFund { + return InsuranceFund.fromAmino(object.value); + }, + fromProtoMsg(message: InsuranceFundProtoMsg): InsuranceFund { + return InsuranceFund.decode(message.value); + }, + toProto(message: InsuranceFund): Uint8Array { + return InsuranceFund.encode(message).finish(); + }, + toProtoMsg(message: InsuranceFund): InsuranceFundProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund", + value: InsuranceFund.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InsuranceFund.typeUrl, InsuranceFund); +function createBaseRedemptionSchedule(): RedemptionSchedule { + return { + id: BigInt(0), + marketId: "", + redeemer: "", + claimableRedemptionTime: new Date(), + redemptionAmount: Coin.fromPartial({}) + }; +} +export const RedemptionSchedule = { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule", + is(o: any): o is RedemptionSchedule { + return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.is(o.claimableRedemptionTime) && Coin.is(o.redemptionAmount)); + }, + isAmino(o: any): o is RedemptionScheduleAmino { + return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.isAmino(o.claimable_redemption_time) && Coin.isAmino(o.redemption_amount)); + }, + encode(message: RedemptionSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.redeemer !== "") { + writer.uint32(26).string(message.redeemer); + } + if (message.claimableRedemptionTime !== undefined) { + Timestamp.encode(toTimestamp(message.claimableRedemptionTime), writer.uint32(34).fork()).ldelim(); + } + if (message.redemptionAmount !== undefined) { + Coin.encode(message.redemptionAmount, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedemptionSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedemptionSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.redeemer = reader.string(); + break; + case 4: + message.claimableRedemptionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.redemptionAmount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedemptionSchedule { + const message = createBaseRedemptionSchedule(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.marketId = object.marketId ?? ""; + message.redeemer = object.redeemer ?? ""; + message.claimableRedemptionTime = object.claimableRedemptionTime ?? undefined; + message.redemptionAmount = object.redemptionAmount !== undefined && object.redemptionAmount !== null ? Coin.fromPartial(object.redemptionAmount) : undefined; + return message; + }, + fromAmino(object: RedemptionScheduleAmino): RedemptionSchedule { + const message = createBaseRedemptionSchedule(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.redeemer !== undefined && object.redeemer !== null) { + message.redeemer = object.redeemer; + } + if (object.claimable_redemption_time !== undefined && object.claimable_redemption_time !== null) { + message.claimableRedemptionTime = fromTimestamp(Timestamp.fromAmino(object.claimable_redemption_time)); + } + if (object.redemption_amount !== undefined && object.redemption_amount !== null) { + message.redemptionAmount = Coin.fromAmino(object.redemption_amount); + } + return message; + }, + toAmino(message: RedemptionSchedule): RedemptionScheduleAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.redeemer = message.redeemer === "" ? undefined : message.redeemer; + obj.claimable_redemption_time = message.claimableRedemptionTime ? Timestamp.toAmino(toTimestamp(message.claimableRedemptionTime)) : undefined; + obj.redemption_amount = message.redemptionAmount ? Coin.toAmino(message.redemptionAmount) : undefined; + return obj; + }, + fromAminoMsg(object: RedemptionScheduleAminoMsg): RedemptionSchedule { + return RedemptionSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: RedemptionScheduleProtoMsg): RedemptionSchedule { + return RedemptionSchedule.decode(message.value); + }, + toProto(message: RedemptionSchedule): Uint8Array { + return RedemptionSchedule.encode(message).finish(); + }, + toProtoMsg(message: RedemptionSchedule): RedemptionScheduleProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule", + value: RedemptionSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedemptionSchedule.typeUrl, RedemptionSchedule); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/insurance/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..7097c72b --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/query.rpc.func.ts @@ -0,0 +1,69 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceParamsRequest.encode, + decode: QueryInsuranceParamsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceParams", + clientResolver +}); +export const useGetInsuranceParams = buildUseQuery({ + builderQueryFn: createGetInsuranceParams, + queryKeyPrefix: "InsuranceParamsQuery" +}); +export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundRequest.encode, + decode: QueryInsuranceFundResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFund", + clientResolver +}); +export const useGetInsuranceFund = buildUseQuery({ + builderQueryFn: createGetInsuranceFund, + queryKeyPrefix: "InsuranceFundQuery" +}); +export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundsRequest.encode, + decode: QueryInsuranceFundsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFunds", + clientResolver +}); +export const useGetInsuranceFunds = buildUseQuery({ + builderQueryFn: createGetInsuranceFunds, + queryKeyPrefix: "InsuranceFundsQuery" +}); +export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryEstimatedRedemptionsRequest.encode, + decode: QueryEstimatedRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "EstimatedRedemptions", + clientResolver +}); +export const useGetEstimatedRedemptions = buildUseQuery({ + builderQueryFn: createGetEstimatedRedemptions, + queryKeyPrefix: "EstimatedRedemptionsQuery" +}); +export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingRedemptionsRequest.encode, + decode: QueryPendingRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "PendingRedemptions", + clientResolver +}); +export const useGetPendingRedemptions = buildUseQuery({ + builderQueryFn: createGetPendingRedemptions, + queryKeyPrefix: "PendingRedemptionsQuery" +}); +export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceModuleState", + clientResolver +}); +export const useGetInsuranceModuleState = buildUseQuery({ + builderQueryFn: createGetInsuranceModuleState, + queryKeyPrefix: "InsuranceModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/query.ts b/libs/injective-query/src/injective/insurance/v1beta1/query.ts new file mode 100644 index 00000000..f8ee7aae --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/query.ts @@ -0,0 +1,1095 @@ +import { Params, ParamsAmino, InsuranceFund, InsuranceFundAmino } from "./insurance"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams + * RPC method. + */ +export interface QueryInsuranceParamsRequest {} +export interface QueryInsuranceParamsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams + * RPC method. + */ +export interface QueryInsuranceParamsRequestAmino {} +export interface QueryInsuranceParamsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest"; + value: QueryInsuranceParamsRequestAmino; +} +/** + * QueryInsuranceParamsRequest is the response type for the + * Query/InsuranceParams RPC method. + */ +export interface QueryInsuranceParamsResponse { + params: Params; +} +export interface QueryInsuranceParamsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceParamsRequest is the response type for the + * Query/InsuranceParams RPC method. + */ +export interface QueryInsuranceParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryInsuranceParamsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse"; + value: QueryInsuranceParamsResponseAmino; +} +/** + * QueryInsuranceFundRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryInsuranceFundRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceFundRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryInsuranceFundRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundRequest"; + value: QueryInsuranceFundRequestAmino; +} +/** + * QueryInsuranceFundResponse is the response type for the Query/InsuranceFund + * RPC method. + */ +export interface QueryInsuranceFundResponse { + fund?: InsuranceFund; +} +export interface QueryInsuranceFundResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceFundResponse is the response type for the Query/InsuranceFund + * RPC method. + */ +export interface QueryInsuranceFundResponseAmino { + fund?: InsuranceFundAmino; +} +export interface QueryInsuranceFundResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundResponse"; + value: QueryInsuranceFundResponseAmino; +} +/** + * QueryInsuranceFundsRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsRequest {} +export interface QueryInsuranceFundsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceFundsRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsRequestAmino {} +export interface QueryInsuranceFundsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest"; + value: QueryInsuranceFundsRequestAmino; +} +/** + * QueryInsuranceFundsResponse is the response type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsResponse { + funds: InsuranceFund[]; +} +export interface QueryInsuranceFundsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceFundsResponse is the response type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsResponseAmino { + funds: InsuranceFundAmino[]; +} +export interface QueryInsuranceFundsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse"; + value: QueryInsuranceFundsResponseAmino; +} +/** + * QueryEstimatedRedemptionsRequest is the request type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsRequest { + marketId: string; + address: string; +} +export interface QueryEstimatedRedemptionsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest"; + value: Uint8Array; +} +/** + * QueryEstimatedRedemptionsRequest is the request type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsRequestAmino { + marketId: string; + address: string; +} +export interface QueryEstimatedRedemptionsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest"; + value: QueryEstimatedRedemptionsRequestAmino; +} +/** + * QueryEstimatedRedemptionsResponse is the response type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsResponse { + amount: Coin[]; +} +export interface QueryEstimatedRedemptionsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse"; + value: Uint8Array; +} +/** + * QueryEstimatedRedemptionsResponse is the response type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsResponseAmino { + amount: CoinAmino[]; +} +export interface QueryEstimatedRedemptionsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse"; + value: QueryEstimatedRedemptionsResponseAmino; +} +/** + * QueryPendingRedemptionsRequest is the request type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsRequest { + marketId: string; + address: string; +} +export interface QueryPendingRedemptionsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest"; + value: Uint8Array; +} +/** + * QueryPendingRedemptionsRequest is the request type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsRequestAmino { + marketId: string; + address: string; +} +export interface QueryPendingRedemptionsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest"; + value: QueryPendingRedemptionsRequestAmino; +} +/** + * QueryPendingRedemptionsResponse is the response type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsResponse { + amount: Coin[]; +} +export interface QueryPendingRedemptionsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse"; + value: Uint8Array; +} +/** + * QueryPendingRedemptionsResponse is the response type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsResponseAmino { + amount: CoinAmino[]; +} +export interface QueryPendingRedemptionsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse"; + value: QueryPendingRedemptionsResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryInsuranceParamsRequest(): QueryInsuranceParamsRequest { + return {}; +} +export const QueryInsuranceParamsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest", + is(o: any): o is QueryInsuranceParamsRequest { + return o && o.$typeUrl === QueryInsuranceParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceParamsRequestAmino { + return o && o.$typeUrl === QueryInsuranceParamsRequest.typeUrl; + }, + encode(_: QueryInsuranceParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryInsuranceParamsRequest { + const message = createBaseQueryInsuranceParamsRequest(); + return message; + }, + fromAmino(_: QueryInsuranceParamsRequestAmino): QueryInsuranceParamsRequest { + const message = createBaseQueryInsuranceParamsRequest(); + return message; + }, + toAmino(_: QueryInsuranceParamsRequest): QueryInsuranceParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryInsuranceParamsRequestAminoMsg): QueryInsuranceParamsRequest { + return QueryInsuranceParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceParamsRequestProtoMsg): QueryInsuranceParamsRequest { + return QueryInsuranceParamsRequest.decode(message.value); + }, + toProto(message: QueryInsuranceParamsRequest): Uint8Array { + return QueryInsuranceParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceParamsRequest): QueryInsuranceParamsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest", + value: QueryInsuranceParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceParamsRequest.typeUrl, QueryInsuranceParamsRequest); +function createBaseQueryInsuranceParamsResponse(): QueryInsuranceParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryInsuranceParamsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse", + is(o: any): o is QueryInsuranceParamsResponse { + return o && (o.$typeUrl === QueryInsuranceParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryInsuranceParamsResponseAmino { + return o && (o.$typeUrl === QueryInsuranceParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryInsuranceParamsResponse, 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): QueryInsuranceParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceParamsResponse(); + 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: DeepPartial): QueryInsuranceParamsResponse { + const message = createBaseQueryInsuranceParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryInsuranceParamsResponseAmino): QueryInsuranceParamsResponse { + const message = createBaseQueryInsuranceParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryInsuranceParamsResponse): QueryInsuranceParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryInsuranceParamsResponseAminoMsg): QueryInsuranceParamsResponse { + return QueryInsuranceParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceParamsResponseProtoMsg): QueryInsuranceParamsResponse { + return QueryInsuranceParamsResponse.decode(message.value); + }, + toProto(message: QueryInsuranceParamsResponse): Uint8Array { + return QueryInsuranceParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceParamsResponse): QueryInsuranceParamsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse", + value: QueryInsuranceParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceParamsResponse.typeUrl, QueryInsuranceParamsResponse); +function createBaseQueryInsuranceFundRequest(): QueryInsuranceFundRequest { + return { + marketId: "" + }; +} +export const QueryInsuranceFundRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest", + is(o: any): o is QueryInsuranceFundRequest { + return o && (o.$typeUrl === QueryInsuranceFundRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryInsuranceFundRequestAmino { + return o && (o.$typeUrl === QueryInsuranceFundRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryInsuranceFundRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundRequest { + const message = createBaseQueryInsuranceFundRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryInsuranceFundRequestAmino): QueryInsuranceFundRequest { + const message = createBaseQueryInsuranceFundRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryInsuranceFundRequest): QueryInsuranceFundRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundRequestAminoMsg): QueryInsuranceFundRequest { + return QueryInsuranceFundRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundRequestProtoMsg): QueryInsuranceFundRequest { + return QueryInsuranceFundRequest.decode(message.value); + }, + toProto(message: QueryInsuranceFundRequest): Uint8Array { + return QueryInsuranceFundRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundRequest): QueryInsuranceFundRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest", + value: QueryInsuranceFundRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundRequest.typeUrl, QueryInsuranceFundRequest); +function createBaseQueryInsuranceFundResponse(): QueryInsuranceFundResponse { + return { + fund: undefined + }; +} +export const QueryInsuranceFundResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse", + is(o: any): o is QueryInsuranceFundResponse { + return o && o.$typeUrl === QueryInsuranceFundResponse.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceFundResponseAmino { + return o && o.$typeUrl === QueryInsuranceFundResponse.typeUrl; + }, + encode(message: QueryInsuranceFundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fund !== undefined) { + InsuranceFund.encode(message.fund, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fund = InsuranceFund.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundResponse { + const message = createBaseQueryInsuranceFundResponse(); + message.fund = object.fund !== undefined && object.fund !== null ? InsuranceFund.fromPartial(object.fund) : undefined; + return message; + }, + fromAmino(object: QueryInsuranceFundResponseAmino): QueryInsuranceFundResponse { + const message = createBaseQueryInsuranceFundResponse(); + if (object.fund !== undefined && object.fund !== null) { + message.fund = InsuranceFund.fromAmino(object.fund); + } + return message; + }, + toAmino(message: QueryInsuranceFundResponse): QueryInsuranceFundResponseAmino { + const obj: any = {}; + obj.fund = message.fund ? InsuranceFund.toAmino(message.fund) : undefined; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundResponseAminoMsg): QueryInsuranceFundResponse { + return QueryInsuranceFundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundResponseProtoMsg): QueryInsuranceFundResponse { + return QueryInsuranceFundResponse.decode(message.value); + }, + toProto(message: QueryInsuranceFundResponse): Uint8Array { + return QueryInsuranceFundResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundResponse): QueryInsuranceFundResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse", + value: QueryInsuranceFundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundResponse.typeUrl, QueryInsuranceFundResponse); +function createBaseQueryInsuranceFundsRequest(): QueryInsuranceFundsRequest { + return {}; +} +export const QueryInsuranceFundsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest", + is(o: any): o is QueryInsuranceFundsRequest { + return o && o.$typeUrl === QueryInsuranceFundsRequest.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceFundsRequestAmino { + return o && o.$typeUrl === QueryInsuranceFundsRequest.typeUrl; + }, + encode(_: QueryInsuranceFundsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryInsuranceFundsRequest { + const message = createBaseQueryInsuranceFundsRequest(); + return message; + }, + fromAmino(_: QueryInsuranceFundsRequestAmino): QueryInsuranceFundsRequest { + const message = createBaseQueryInsuranceFundsRequest(); + return message; + }, + toAmino(_: QueryInsuranceFundsRequest): QueryInsuranceFundsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundsRequestAminoMsg): QueryInsuranceFundsRequest { + return QueryInsuranceFundsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundsRequestProtoMsg): QueryInsuranceFundsRequest { + return QueryInsuranceFundsRequest.decode(message.value); + }, + toProto(message: QueryInsuranceFundsRequest): Uint8Array { + return QueryInsuranceFundsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundsRequest): QueryInsuranceFundsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest", + value: QueryInsuranceFundsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundsRequest.typeUrl, QueryInsuranceFundsRequest); +function createBaseQueryInsuranceFundsResponse(): QueryInsuranceFundsResponse { + return { + funds: [] + }; +} +export const QueryInsuranceFundsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse", + is(o: any): o is QueryInsuranceFundsResponse { + return o && (o.$typeUrl === QueryInsuranceFundsResponse.typeUrl || Array.isArray(o.funds) && (!o.funds.length || InsuranceFund.is(o.funds[0]))); + }, + isAmino(o: any): o is QueryInsuranceFundsResponseAmino { + return o && (o.$typeUrl === QueryInsuranceFundsResponse.typeUrl || Array.isArray(o.funds) && (!o.funds.length || InsuranceFund.isAmino(o.funds[0]))); + }, + encode(message: QueryInsuranceFundsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.funds) { + InsuranceFund.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.funds.push(InsuranceFund.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundsResponse { + const message = createBaseQueryInsuranceFundsResponse(); + message.funds = object.funds?.map(e => InsuranceFund.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryInsuranceFundsResponseAmino): QueryInsuranceFundsResponse { + const message = createBaseQueryInsuranceFundsResponse(); + message.funds = object.funds?.map(e => InsuranceFund.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryInsuranceFundsResponse): QueryInsuranceFundsResponseAmino { + const obj: any = {}; + if (message.funds) { + obj.funds = message.funds.map(e => e ? InsuranceFund.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundsResponseAminoMsg): QueryInsuranceFundsResponse { + return QueryInsuranceFundsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundsResponseProtoMsg): QueryInsuranceFundsResponse { + return QueryInsuranceFundsResponse.decode(message.value); + }, + toProto(message: QueryInsuranceFundsResponse): Uint8Array { + return QueryInsuranceFundsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundsResponse): QueryInsuranceFundsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse", + value: QueryInsuranceFundsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundsResponse.typeUrl, QueryInsuranceFundsResponse); +function createBaseQueryEstimatedRedemptionsRequest(): QueryEstimatedRedemptionsRequest { + return { + marketId: "", + address: "" + }; +} +export const QueryEstimatedRedemptionsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest", + is(o: any): o is QueryEstimatedRedemptionsRequest { + return o && (o.$typeUrl === QueryEstimatedRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryEstimatedRedemptionsRequestAmino { + return o && (o.$typeUrl === QueryEstimatedRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + encode(message: QueryEstimatedRedemptionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEstimatedRedemptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimatedRedemptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryEstimatedRedemptionsRequest { + const message = createBaseQueryEstimatedRedemptionsRequest(); + message.marketId = object.marketId ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryEstimatedRedemptionsRequestAmino): QueryEstimatedRedemptionsRequest { + const message = createBaseQueryEstimatedRedemptionsRequest(); + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryEstimatedRedemptionsRequest): QueryEstimatedRedemptionsRequestAmino { + const obj: any = {}; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryEstimatedRedemptionsRequestAminoMsg): QueryEstimatedRedemptionsRequest { + return QueryEstimatedRedemptionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimatedRedemptionsRequestProtoMsg): QueryEstimatedRedemptionsRequest { + return QueryEstimatedRedemptionsRequest.decode(message.value); + }, + toProto(message: QueryEstimatedRedemptionsRequest): Uint8Array { + return QueryEstimatedRedemptionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimatedRedemptionsRequest): QueryEstimatedRedemptionsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest", + value: QueryEstimatedRedemptionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEstimatedRedemptionsRequest.typeUrl, QueryEstimatedRedemptionsRequest); +function createBaseQueryEstimatedRedemptionsResponse(): QueryEstimatedRedemptionsResponse { + return { + amount: [] + }; +} +export const QueryEstimatedRedemptionsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse", + is(o: any): o is QueryEstimatedRedemptionsResponse { + return o && (o.$typeUrl === QueryEstimatedRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is QueryEstimatedRedemptionsResponseAmino { + return o && (o.$typeUrl === QueryEstimatedRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: QueryEstimatedRedemptionsResponse, 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): QueryEstimatedRedemptionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimatedRedemptionsResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryEstimatedRedemptionsResponse { + const message = createBaseQueryEstimatedRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryEstimatedRedemptionsResponseAmino): QueryEstimatedRedemptionsResponse { + const message = createBaseQueryEstimatedRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryEstimatedRedemptionsResponse): QueryEstimatedRedemptionsResponseAmino { + 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: QueryEstimatedRedemptionsResponseAminoMsg): QueryEstimatedRedemptionsResponse { + return QueryEstimatedRedemptionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimatedRedemptionsResponseProtoMsg): QueryEstimatedRedemptionsResponse { + return QueryEstimatedRedemptionsResponse.decode(message.value); + }, + toProto(message: QueryEstimatedRedemptionsResponse): Uint8Array { + return QueryEstimatedRedemptionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimatedRedemptionsResponse): QueryEstimatedRedemptionsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse", + value: QueryEstimatedRedemptionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEstimatedRedemptionsResponse.typeUrl, QueryEstimatedRedemptionsResponse); +function createBaseQueryPendingRedemptionsRequest(): QueryPendingRedemptionsRequest { + return { + marketId: "", + address: "" + }; +} +export const QueryPendingRedemptionsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest", + is(o: any): o is QueryPendingRedemptionsRequest { + return o && (o.$typeUrl === QueryPendingRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryPendingRedemptionsRequestAmino { + return o && (o.$typeUrl === QueryPendingRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + encode(message: QueryPendingRedemptionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingRedemptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingRedemptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingRedemptionsRequest { + const message = createBaseQueryPendingRedemptionsRequest(); + message.marketId = object.marketId ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryPendingRedemptionsRequestAmino): QueryPendingRedemptionsRequest { + const message = createBaseQueryPendingRedemptionsRequest(); + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryPendingRedemptionsRequest): QueryPendingRedemptionsRequestAmino { + const obj: any = {}; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryPendingRedemptionsRequestAminoMsg): QueryPendingRedemptionsRequest { + return QueryPendingRedemptionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingRedemptionsRequestProtoMsg): QueryPendingRedemptionsRequest { + return QueryPendingRedemptionsRequest.decode(message.value); + }, + toProto(message: QueryPendingRedemptionsRequest): Uint8Array { + return QueryPendingRedemptionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingRedemptionsRequest): QueryPendingRedemptionsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest", + value: QueryPendingRedemptionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingRedemptionsRequest.typeUrl, QueryPendingRedemptionsRequest); +function createBaseQueryPendingRedemptionsResponse(): QueryPendingRedemptionsResponse { + return { + amount: [] + }; +} +export const QueryPendingRedemptionsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse", + is(o: any): o is QueryPendingRedemptionsResponse { + return o && (o.$typeUrl === QueryPendingRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is QueryPendingRedemptionsResponseAmino { + return o && (o.$typeUrl === QueryPendingRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: QueryPendingRedemptionsResponse, 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): QueryPendingRedemptionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingRedemptionsResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingRedemptionsResponse { + const message = createBaseQueryPendingRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPendingRedemptionsResponseAmino): QueryPendingRedemptionsResponse { + const message = createBaseQueryPendingRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPendingRedemptionsResponse): QueryPendingRedemptionsResponseAmino { + 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: QueryPendingRedemptionsResponseAminoMsg): QueryPendingRedemptionsResponse { + return QueryPendingRedemptionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingRedemptionsResponseProtoMsg): QueryPendingRedemptionsResponse { + return QueryPendingRedemptionsResponse.decode(message.value); + }, + toProto(message: QueryPendingRedemptionsResponse): Uint8Array { + return QueryPendingRedemptionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingRedemptionsResponse): QueryPendingRedemptionsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse", + value: QueryPendingRedemptionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingRedemptionsResponse.typeUrl, QueryPendingRedemptionsResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/insurance/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..d4525d1e --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/tx.rpc.func.ts @@ -0,0 +1,40 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; +export const createCreateInsuranceFund = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateInsuranceFund.typeUrl, + encoders: toEncoders(MsgCreateInsuranceFund), + converters: toConverters(MsgCreateInsuranceFund) +}); +export const useCreateInsuranceFund = buildUseMutation({ + builderMutationFn: createCreateInsuranceFund +}); +export const createUnderwrite = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnderwrite.typeUrl, + encoders: toEncoders(MsgUnderwrite), + converters: toConverters(MsgUnderwrite) +}); +export const useUnderwrite = buildUseMutation({ + builderMutationFn: createUnderwrite +}); +export const createRequestRedemption = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestRedemption.typeUrl, + encoders: toEncoders(MsgRequestRedemption), + converters: toConverters(MsgRequestRedemption) +}); +export const useRequestRedemption = buildUseMutation({ + builderMutationFn: createRequestRedemption +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/insurance/v1beta1/tx.ts b/libs/injective-query/src/injective/insurance/v1beta1/tx.ts new file mode 100644 index 00000000..1965e15c --- /dev/null +++ b/libs/injective-query/src/injective/insurance/v1beta1/tx.ts @@ -0,0 +1,892 @@ +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino } from "./insurance"; +import { isSet, DeepPartial } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgCreateInsuranceFund a message to create an insurance fund for a derivative + * market. + */ +export interface MsgCreateInsuranceFund { + /** Creator of the insurance fund. */ + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** Coin denom to use for the market quote denom */ + quoteDenom: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracleBase: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracleQuote: string; + /** Oracle type of the binary options or derivative market */ + oracleType: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: bigint; + /** Initial deposit of the insurance fund */ + initialDeposit: Coin; +} +export interface MsgCreateInsuranceFundProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund"; + value: Uint8Array; +} +/** + * MsgCreateInsuranceFund a message to create an insurance fund for a derivative + * market. + */ +export interface MsgCreateInsuranceFundAmino { + /** Creator of the insurance fund. */ + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** Coin denom to use for the market quote denom */ + quote_denom: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracle_base: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracle_quote: string; + /** Oracle type of the binary options or derivative market */ + oracle_type: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: string; + /** Initial deposit of the insurance fund */ + initial_deposit: CoinAmino; +} +export interface MsgCreateInsuranceFundAminoMsg { + type: "insurance/MsgCreateInsuranceFund"; + value: MsgCreateInsuranceFundAmino; +} +export interface MsgCreateInsuranceFundResponse {} +export interface MsgCreateInsuranceFundResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse"; + value: Uint8Array; +} +export interface MsgCreateInsuranceFundResponseAmino {} +export interface MsgCreateInsuranceFundResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse"; + value: MsgCreateInsuranceFundResponseAmino; +} +/** + * MsgUnderwrite defines a message for depositing coins to underwrite an + * insurance fund + */ +export interface MsgUnderwrite { + /** Address of the underwriter. */ + sender: string; + /** MarketID of the insurance fund. */ + marketId: string; + /** Amount of quote_denom to underwrite the insurance fund. */ + deposit: Coin; +} +export interface MsgUnderwriteProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite"; + value: Uint8Array; +} +/** + * MsgUnderwrite defines a message for depositing coins to underwrite an + * insurance fund + */ +export interface MsgUnderwriteAmino { + /** Address of the underwriter. */ + sender: string; + /** MarketID of the insurance fund. */ + market_id: string; + /** Amount of quote_denom to underwrite the insurance fund. */ + deposit: CoinAmino; +} +export interface MsgUnderwriteAminoMsg { + type: "insurance/MsgUnderwrite"; + value: MsgUnderwriteAmino; +} +export interface MsgUnderwriteResponse {} +export interface MsgUnderwriteResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse"; + value: Uint8Array; +} +export interface MsgUnderwriteResponseAmino {} +export interface MsgUnderwriteResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgUnderwriteResponse"; + value: MsgUnderwriteResponseAmino; +} +/** + * MsgRequestRedemption defines a message for requesting a redemption of the + * sender's insurance fund tokens + */ +export interface MsgRequestRedemption { + /** Address of the underwriter requesting a redemption. */ + sender: string; + /** MarketID of the insurance fund. */ + marketId: string; + /** Insurance fund share token amount to be redeemed. */ + amount: Coin; +} +export interface MsgRequestRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption"; + value: Uint8Array; +} +/** + * MsgRequestRedemption defines a message for requesting a redemption of the + * sender's insurance fund tokens + */ +export interface MsgRequestRedemptionAmino { + /** Address of the underwriter requesting a redemption. */ + sender: string; + /** MarketID of the insurance fund. */ + market_id: string; + /** Insurance fund share token amount to be redeemed. */ + amount: CoinAmino; +} +export interface MsgRequestRedemptionAminoMsg { + type: "insurance/MsgRequestRedemption"; + value: MsgRequestRedemptionAmino; +} +export interface MsgRequestRedemptionResponse {} +export interface MsgRequestRedemptionResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse"; + value: Uint8Array; +} +export interface MsgRequestRedemptionResponseAmino {} +export interface MsgRequestRedemptionResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse"; + value: MsgRequestRedemptionResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the insurance parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the insurance parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "insurance/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateInsuranceFund(): MsgCreateInsuranceFund { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + expiry: BigInt(0), + initialDeposit: Coin.fromPartial({}) + }; +} +export const MsgCreateInsuranceFund = { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund", + aminoType: "insurance/MsgCreateInsuranceFund", + is(o: any): o is MsgCreateInsuranceFund { + return o && (o.$typeUrl === MsgCreateInsuranceFund.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.expiry === "bigint" && Coin.is(o.initialDeposit)); + }, + isAmino(o: any): o is MsgCreateInsuranceFundAmino { + return o && (o.$typeUrl === MsgCreateInsuranceFund.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.expiry === "bigint" && Coin.isAmino(o.initial_deposit)); + }, + encode(message: MsgCreateInsuranceFund, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(56).int64(message.expiry); + } + if (message.initialDeposit !== undefined) { + Coin.encode(message.initialDeposit, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateInsuranceFund { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateInsuranceFund(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.expiry = reader.int64(); + break; + case 8: + message.initialDeposit = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateInsuranceFund { + const message = createBaseMsgCreateInsuranceFund(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.initialDeposit = object.initialDeposit !== undefined && object.initialDeposit !== null ? Coin.fromPartial(object.initialDeposit) : undefined; + return message; + }, + fromAmino(object: MsgCreateInsuranceFundAmino): MsgCreateInsuranceFund { + const message = createBaseMsgCreateInsuranceFund(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.initial_deposit !== undefined && object.initial_deposit !== null) { + message.initialDeposit = Coin.fromAmino(object.initial_deposit); + } + return message; + }, + toAmino(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.initial_deposit = message.initialDeposit ? Coin.toAmino(message.initialDeposit) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateInsuranceFundAminoMsg): MsgCreateInsuranceFund { + return MsgCreateInsuranceFund.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundAminoMsg { + return { + type: "insurance/MsgCreateInsuranceFund", + value: MsgCreateInsuranceFund.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateInsuranceFundProtoMsg): MsgCreateInsuranceFund { + return MsgCreateInsuranceFund.decode(message.value); + }, + toProto(message: MsgCreateInsuranceFund): Uint8Array { + return MsgCreateInsuranceFund.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund", + value: MsgCreateInsuranceFund.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateInsuranceFund.typeUrl, MsgCreateInsuranceFund); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateInsuranceFund.aminoType, MsgCreateInsuranceFund.typeUrl); +function createBaseMsgCreateInsuranceFundResponse(): MsgCreateInsuranceFundResponse { + return {}; +} +export const MsgCreateInsuranceFundResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse", + is(o: any): o is MsgCreateInsuranceFundResponse { + return o && o.$typeUrl === MsgCreateInsuranceFundResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateInsuranceFundResponseAmino { + return o && o.$typeUrl === MsgCreateInsuranceFundResponse.typeUrl; + }, + encode(_: MsgCreateInsuranceFundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateInsuranceFundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateInsuranceFundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateInsuranceFundResponse { + const message = createBaseMsgCreateInsuranceFundResponse(); + return message; + }, + fromAmino(_: MsgCreateInsuranceFundResponseAmino): MsgCreateInsuranceFundResponse { + const message = createBaseMsgCreateInsuranceFundResponse(); + return message; + }, + toAmino(_: MsgCreateInsuranceFundResponse): MsgCreateInsuranceFundResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateInsuranceFundResponseAminoMsg): MsgCreateInsuranceFundResponse { + return MsgCreateInsuranceFundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateInsuranceFundResponseProtoMsg): MsgCreateInsuranceFundResponse { + return MsgCreateInsuranceFundResponse.decode(message.value); + }, + toProto(message: MsgCreateInsuranceFundResponse): Uint8Array { + return MsgCreateInsuranceFundResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateInsuranceFundResponse): MsgCreateInsuranceFundResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse", + value: MsgCreateInsuranceFundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateInsuranceFundResponse.typeUrl, MsgCreateInsuranceFundResponse); +function createBaseMsgUnderwrite(): MsgUnderwrite { + return { + sender: "", + marketId: "", + deposit: Coin.fromPartial({}) + }; +} +export const MsgUnderwrite = { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite", + aminoType: "insurance/MsgUnderwrite", + is(o: any): o is MsgUnderwrite { + return o && (o.$typeUrl === MsgUnderwrite.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && Coin.is(o.deposit)); + }, + isAmino(o: any): o is MsgUnderwriteAmino { + return o && (o.$typeUrl === MsgUnderwrite.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && Coin.isAmino(o.deposit)); + }, + encode(message: MsgUnderwrite, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnderwrite { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnderwrite(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.deposit = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUnderwrite { + const message = createBaseMsgUnderwrite(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Coin.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: MsgUnderwriteAmino): MsgUnderwrite { + const message = createBaseMsgUnderwrite(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Coin.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: MsgUnderwrite): MsgUnderwriteAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.deposit = message.deposit ? Coin.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUnderwriteAminoMsg): MsgUnderwrite { + return MsgUnderwrite.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnderwrite): MsgUnderwriteAminoMsg { + return { + type: "insurance/MsgUnderwrite", + value: MsgUnderwrite.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnderwriteProtoMsg): MsgUnderwrite { + return MsgUnderwrite.decode(message.value); + }, + toProto(message: MsgUnderwrite): Uint8Array { + return MsgUnderwrite.encode(message).finish(); + }, + toProtoMsg(message: MsgUnderwrite): MsgUnderwriteProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite", + value: MsgUnderwrite.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnderwrite.typeUrl, MsgUnderwrite); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnderwrite.aminoType, MsgUnderwrite.typeUrl); +function createBaseMsgUnderwriteResponse(): MsgUnderwriteResponse { + return {}; +} +export const MsgUnderwriteResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse", + is(o: any): o is MsgUnderwriteResponse { + return o && o.$typeUrl === MsgUnderwriteResponse.typeUrl; + }, + isAmino(o: any): o is MsgUnderwriteResponseAmino { + return o && o.$typeUrl === MsgUnderwriteResponse.typeUrl; + }, + encode(_: MsgUnderwriteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnderwriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnderwriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUnderwriteResponse { + const message = createBaseMsgUnderwriteResponse(); + return message; + }, + fromAmino(_: MsgUnderwriteResponseAmino): MsgUnderwriteResponse { + const message = createBaseMsgUnderwriteResponse(); + return message; + }, + toAmino(_: MsgUnderwriteResponse): MsgUnderwriteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnderwriteResponseAminoMsg): MsgUnderwriteResponse { + return MsgUnderwriteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnderwriteResponseProtoMsg): MsgUnderwriteResponse { + return MsgUnderwriteResponse.decode(message.value); + }, + toProto(message: MsgUnderwriteResponse): Uint8Array { + return MsgUnderwriteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnderwriteResponse): MsgUnderwriteResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse", + value: MsgUnderwriteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnderwriteResponse.typeUrl, MsgUnderwriteResponse); +function createBaseMsgRequestRedemption(): MsgRequestRedemption { + return { + sender: "", + marketId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgRequestRedemption = { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption", + aminoType: "insurance/MsgRequestRedemption", + is(o: any): o is MsgRequestRedemption { + return o && (o.$typeUrl === MsgRequestRedemption.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgRequestRedemptionAmino { + return o && (o.$typeUrl === MsgRequestRedemption.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgRequestRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestRedemption { + const message = createBaseMsgRequestRedemption(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgRequestRedemptionAmino): MsgRequestRedemption { + const message = createBaseMsgRequestRedemption(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgRequestRedemption): MsgRequestRedemptionAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRequestRedemptionAminoMsg): MsgRequestRedemption { + return MsgRequestRedemption.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestRedemption): MsgRequestRedemptionAminoMsg { + return { + type: "insurance/MsgRequestRedemption", + value: MsgRequestRedemption.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestRedemptionProtoMsg): MsgRequestRedemption { + return MsgRequestRedemption.decode(message.value); + }, + toProto(message: MsgRequestRedemption): Uint8Array { + return MsgRequestRedemption.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestRedemption): MsgRequestRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption", + value: MsgRequestRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestRedemption.typeUrl, MsgRequestRedemption); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestRedemption.aminoType, MsgRequestRedemption.typeUrl); +function createBaseMsgRequestRedemptionResponse(): MsgRequestRedemptionResponse { + return {}; +} +export const MsgRequestRedemptionResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse", + is(o: any): o is MsgRequestRedemptionResponse { + return o && o.$typeUrl === MsgRequestRedemptionResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestRedemptionResponseAmino { + return o && o.$typeUrl === MsgRequestRedemptionResponse.typeUrl; + }, + encode(_: MsgRequestRedemptionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestRedemptionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestRedemptionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestRedemptionResponse { + const message = createBaseMsgRequestRedemptionResponse(); + return message; + }, + fromAmino(_: MsgRequestRedemptionResponseAmino): MsgRequestRedemptionResponse { + const message = createBaseMsgRequestRedemptionResponse(); + return message; + }, + toAmino(_: MsgRequestRedemptionResponse): MsgRequestRedemptionResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestRedemptionResponseAminoMsg): MsgRequestRedemptionResponse { + return MsgRequestRedemptionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestRedemptionResponseProtoMsg): MsgRequestRedemptionResponse { + return MsgRequestRedemptionResponse.decode(message.value); + }, + toProto(message: MsgRequestRedemptionResponse): Uint8Array { + return MsgRequestRedemptionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestRedemptionResponse): MsgRequestRedemptionResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse", + value: MsgRequestRedemptionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestRedemptionResponse.typeUrl, MsgRequestRedemptionResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParams", + aminoType: "insurance/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "insurance/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: "/injective.insurance.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/genesis.ts b/libs/injective-query/src/injective/ocr/v1beta1/genesis.ts new file mode 100644 index 00000000..2fd0d991 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/genesis.ts @@ -0,0 +1,945 @@ +import { Params, ParamsAmino, FeedConfig, FeedConfigAmino, Transmission, TransmissionAmino, EpochAndRound, EpochAndRoundAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the OCR module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to OCR. */ + params: Params; + /** feed_configs stores all of the supported OCR feeds */ + feedConfigs: FeedConfig[]; + /** latest_epoch_and_rounds stores the latest epoch and round for each feedId */ + latestEpochAndRounds: FeedEpochAndRound[]; + /** feed_transmissions stores the last transmission for each feed */ + feedTransmissions: FeedTransmission[]; + /** + * latest_aggregator_round_ids stores the latest aggregator round ID for each + * feedId + */ + latestAggregatorRoundIds: FeedLatestAggregatorRoundIDs[]; + /** reward_pools stores the reward pools */ + rewardPools: RewardPool[]; + /** feed_observation_counts stores the feed observation counts */ + feedObservationCounts: FeedCounts[]; + /** feed_transmission_counts stores the feed transmission counts */ + feedTransmissionCounts: FeedCounts[]; + /** pending_payeeships stores the pending payeeships */ + pendingPayeeships: PendingPayeeship[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.ocr.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the OCR module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to OCR. */ + params: ParamsAmino; + /** feed_configs stores all of the supported OCR feeds */ + feed_configs: FeedConfigAmino[]; + /** latest_epoch_and_rounds stores the latest epoch and round for each feedId */ + latest_epoch_and_rounds: FeedEpochAndRoundAmino[]; + /** feed_transmissions stores the last transmission for each feed */ + feed_transmissions: FeedTransmissionAmino[]; + /** + * latest_aggregator_round_ids stores the latest aggregator round ID for each + * feedId + */ + latest_aggregator_round_ids: FeedLatestAggregatorRoundIDsAmino[]; + /** reward_pools stores the reward pools */ + reward_pools: RewardPoolAmino[]; + /** feed_observation_counts stores the feed observation counts */ + feed_observation_counts: FeedCountsAmino[]; + /** feed_transmission_counts stores the feed transmission counts */ + feed_transmission_counts: FeedCountsAmino[]; + /** pending_payeeships stores the pending payeeships */ + pending_payeeships: PendingPayeeshipAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.ocr.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface FeedTransmission { + feedId: string; + transmission?: Transmission; +} +export interface FeedTransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission"; + value: Uint8Array; +} +export interface FeedTransmissionAmino { + feed_id: string; + transmission?: TransmissionAmino; +} +export interface FeedTransmissionAminoMsg { + type: "/injective.ocr.v1beta1.FeedTransmission"; + value: FeedTransmissionAmino; +} +export interface FeedEpochAndRound { + feedId: string; + epochAndRound?: EpochAndRound; +} +export interface FeedEpochAndRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound"; + value: Uint8Array; +} +export interface FeedEpochAndRoundAmino { + feed_id: string; + epoch_and_round?: EpochAndRoundAmino; +} +export interface FeedEpochAndRoundAminoMsg { + type: "/injective.ocr.v1beta1.FeedEpochAndRound"; + value: FeedEpochAndRoundAmino; +} +export interface FeedLatestAggregatorRoundIDs { + feedId: string; + aggregatorRoundId: bigint; +} +export interface FeedLatestAggregatorRoundIDsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs"; + value: Uint8Array; +} +export interface FeedLatestAggregatorRoundIDsAmino { + feed_id: string; + aggregator_round_id: string; +} +export interface FeedLatestAggregatorRoundIDsAminoMsg { + type: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs"; + value: FeedLatestAggregatorRoundIDsAmino; +} +export interface RewardPool { + feedId: string; + amount: Coin; +} +export interface RewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.RewardPool"; + value: Uint8Array; +} +export interface RewardPoolAmino { + feed_id: string; + amount: CoinAmino; +} +export interface RewardPoolAminoMsg { + type: "/injective.ocr.v1beta1.RewardPool"; + value: RewardPoolAmino; +} +export interface FeedCounts { + feedId: string; + counts: Count[]; +} +export interface FeedCountsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedCounts"; + value: Uint8Array; +} +export interface FeedCountsAmino { + feed_id: string; + counts: CountAmino[]; +} +export interface FeedCountsAminoMsg { + type: "/injective.ocr.v1beta1.FeedCounts"; + value: FeedCountsAmino; +} +export interface Count { + address: string; + count: bigint; +} +export interface CountProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Count"; + value: Uint8Array; +} +export interface CountAmino { + address: string; + count: string; +} +export interface CountAminoMsg { + type: "/injective.ocr.v1beta1.Count"; + value: CountAmino; +} +export interface PendingPayeeship { + feedId: string; + transmitter: string; + proposedPayee: string; +} +export interface PendingPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship"; + value: Uint8Array; +} +export interface PendingPayeeshipAmino { + feed_id: string; + transmitter: string; + proposed_payee: string; +} +export interface PendingPayeeshipAminoMsg { + type: "/injective.ocr.v1beta1.PendingPayeeship"; + value: PendingPayeeshipAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + feedConfigs: [], + latestEpochAndRounds: [], + feedTransmissions: [], + latestAggregatorRoundIds: [], + rewardPools: [], + feedObservationCounts: [], + feedTransmissionCounts: [], + pendingPayeeships: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.ocr.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.feedConfigs) && (!o.feedConfigs.length || FeedConfig.is(o.feedConfigs[0])) && Array.isArray(o.latestEpochAndRounds) && (!o.latestEpochAndRounds.length || FeedEpochAndRound.is(o.latestEpochAndRounds[0])) && Array.isArray(o.feedTransmissions) && (!o.feedTransmissions.length || FeedTransmission.is(o.feedTransmissions[0])) && Array.isArray(o.latestAggregatorRoundIds) && (!o.latestAggregatorRoundIds.length || FeedLatestAggregatorRoundIDs.is(o.latestAggregatorRoundIds[0])) && Array.isArray(o.rewardPools) && (!o.rewardPools.length || RewardPool.is(o.rewardPools[0])) && Array.isArray(o.feedObservationCounts) && (!o.feedObservationCounts.length || FeedCounts.is(o.feedObservationCounts[0])) && Array.isArray(o.feedTransmissionCounts) && (!o.feedTransmissionCounts.length || FeedCounts.is(o.feedTransmissionCounts[0])) && Array.isArray(o.pendingPayeeships) && (!o.pendingPayeeships.length || PendingPayeeship.is(o.pendingPayeeships[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.feed_configs) && (!o.feed_configs.length || FeedConfig.isAmino(o.feed_configs[0])) && Array.isArray(o.latest_epoch_and_rounds) && (!o.latest_epoch_and_rounds.length || FeedEpochAndRound.isAmino(o.latest_epoch_and_rounds[0])) && Array.isArray(o.feed_transmissions) && (!o.feed_transmissions.length || FeedTransmission.isAmino(o.feed_transmissions[0])) && Array.isArray(o.latest_aggregator_round_ids) && (!o.latest_aggregator_round_ids.length || FeedLatestAggregatorRoundIDs.isAmino(o.latest_aggregator_round_ids[0])) && Array.isArray(o.reward_pools) && (!o.reward_pools.length || RewardPool.isAmino(o.reward_pools[0])) && Array.isArray(o.feed_observation_counts) && (!o.feed_observation_counts.length || FeedCounts.isAmino(o.feed_observation_counts[0])) && Array.isArray(o.feed_transmission_counts) && (!o.feed_transmission_counts.length || FeedCounts.isAmino(o.feed_transmission_counts[0])) && Array.isArray(o.pending_payeeships) && (!o.pending_payeeships.length || PendingPayeeship.isAmino(o.pending_payeeships[0]))); + }, + 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.feedConfigs) { + FeedConfig.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.latestEpochAndRounds) { + FeedEpochAndRound.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.feedTransmissions) { + FeedTransmission.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.latestAggregatorRoundIds) { + FeedLatestAggregatorRoundIDs.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.rewardPools) { + RewardPool.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.feedObservationCounts) { + FeedCounts.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.feedTransmissionCounts) { + FeedCounts.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.pendingPayeeships) { + PendingPayeeship.encode(v!, writer.uint32(74).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.feedConfigs.push(FeedConfig.decode(reader, reader.uint32())); + break; + case 3: + message.latestEpochAndRounds.push(FeedEpochAndRound.decode(reader, reader.uint32())); + break; + case 4: + message.feedTransmissions.push(FeedTransmission.decode(reader, reader.uint32())); + break; + case 5: + message.latestAggregatorRoundIds.push(FeedLatestAggregatorRoundIDs.decode(reader, reader.uint32())); + break; + case 6: + message.rewardPools.push(RewardPool.decode(reader, reader.uint32())); + break; + case 7: + message.feedObservationCounts.push(FeedCounts.decode(reader, reader.uint32())); + break; + case 8: + message.feedTransmissionCounts.push(FeedCounts.decode(reader, reader.uint32())); + break; + case 9: + message.pendingPayeeships.push(PendingPayeeship.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.feedConfigs = object.feedConfigs?.map(e => FeedConfig.fromPartial(e)) || []; + message.latestEpochAndRounds = object.latestEpochAndRounds?.map(e => FeedEpochAndRound.fromPartial(e)) || []; + message.feedTransmissions = object.feedTransmissions?.map(e => FeedTransmission.fromPartial(e)) || []; + message.latestAggregatorRoundIds = object.latestAggregatorRoundIds?.map(e => FeedLatestAggregatorRoundIDs.fromPartial(e)) || []; + message.rewardPools = object.rewardPools?.map(e => RewardPool.fromPartial(e)) || []; + message.feedObservationCounts = object.feedObservationCounts?.map(e => FeedCounts.fromPartial(e)) || []; + message.feedTransmissionCounts = object.feedTransmissionCounts?.map(e => FeedCounts.fromPartial(e)) || []; + message.pendingPayeeships = object.pendingPayeeships?.map(e => PendingPayeeship.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.feedConfigs = object.feed_configs?.map(e => FeedConfig.fromAmino(e)) || []; + message.latestEpochAndRounds = object.latest_epoch_and_rounds?.map(e => FeedEpochAndRound.fromAmino(e)) || []; + message.feedTransmissions = object.feed_transmissions?.map(e => FeedTransmission.fromAmino(e)) || []; + message.latestAggregatorRoundIds = object.latest_aggregator_round_ids?.map(e => FeedLatestAggregatorRoundIDs.fromAmino(e)) || []; + message.rewardPools = object.reward_pools?.map(e => RewardPool.fromAmino(e)) || []; + message.feedObservationCounts = object.feed_observation_counts?.map(e => FeedCounts.fromAmino(e)) || []; + message.feedTransmissionCounts = object.feed_transmission_counts?.map(e => FeedCounts.fromAmino(e)) || []; + message.pendingPayeeships = object.pending_payeeships?.map(e => PendingPayeeship.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.feedConfigs) { + obj.feed_configs = message.feedConfigs.map(e => e ? FeedConfig.toAmino(e) : undefined); + } else { + obj.feed_configs = message.feedConfigs; + } + if (message.latestEpochAndRounds) { + obj.latest_epoch_and_rounds = message.latestEpochAndRounds.map(e => e ? FeedEpochAndRound.toAmino(e) : undefined); + } else { + obj.latest_epoch_and_rounds = message.latestEpochAndRounds; + } + if (message.feedTransmissions) { + obj.feed_transmissions = message.feedTransmissions.map(e => e ? FeedTransmission.toAmino(e) : undefined); + } else { + obj.feed_transmissions = message.feedTransmissions; + } + if (message.latestAggregatorRoundIds) { + obj.latest_aggregator_round_ids = message.latestAggregatorRoundIds.map(e => e ? FeedLatestAggregatorRoundIDs.toAmino(e) : undefined); + } else { + obj.latest_aggregator_round_ids = message.latestAggregatorRoundIds; + } + if (message.rewardPools) { + obj.reward_pools = message.rewardPools.map(e => e ? RewardPool.toAmino(e) : undefined); + } else { + obj.reward_pools = message.rewardPools; + } + if (message.feedObservationCounts) { + obj.feed_observation_counts = message.feedObservationCounts.map(e => e ? FeedCounts.toAmino(e) : undefined); + } else { + obj.feed_observation_counts = message.feedObservationCounts; + } + if (message.feedTransmissionCounts) { + obj.feed_transmission_counts = message.feedTransmissionCounts.map(e => e ? FeedCounts.toAmino(e) : undefined); + } else { + obj.feed_transmission_counts = message.feedTransmissionCounts; + } + if (message.pendingPayeeships) { + obj.pending_payeeships = message.pendingPayeeships.map(e => e ? PendingPayeeship.toAmino(e) : undefined); + } else { + obj.pending_payeeships = message.pendingPayeeships; + } + 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: "/injective.ocr.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseFeedTransmission(): FeedTransmission { + return { + feedId: "", + transmission: undefined + }; +} +export const FeedTransmission = { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission", + is(o: any): o is FeedTransmission { + return o && (o.$typeUrl === FeedTransmission.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is FeedTransmissionAmino { + return o && (o.$typeUrl === FeedTransmission.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: FeedTransmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.transmission !== undefined) { + Transmission.encode(message.transmission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedTransmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.transmission = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedTransmission { + const message = createBaseFeedTransmission(); + message.feedId = object.feedId ?? ""; + message.transmission = object.transmission !== undefined && object.transmission !== null ? Transmission.fromPartial(object.transmission) : undefined; + return message; + }, + fromAmino(object: FeedTransmissionAmino): FeedTransmission { + const message = createBaseFeedTransmission(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.transmission !== undefined && object.transmission !== null) { + message.transmission = Transmission.fromAmino(object.transmission); + } + return message; + }, + toAmino(message: FeedTransmission): FeedTransmissionAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.transmission = message.transmission ? Transmission.toAmino(message.transmission) : undefined; + return obj; + }, + fromAminoMsg(object: FeedTransmissionAminoMsg): FeedTransmission { + return FeedTransmission.fromAmino(object.value); + }, + fromProtoMsg(message: FeedTransmissionProtoMsg): FeedTransmission { + return FeedTransmission.decode(message.value); + }, + toProto(message: FeedTransmission): Uint8Array { + return FeedTransmission.encode(message).finish(); + }, + toProtoMsg(message: FeedTransmission): FeedTransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission", + value: FeedTransmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedTransmission.typeUrl, FeedTransmission); +function createBaseFeedEpochAndRound(): FeedEpochAndRound { + return { + feedId: "", + epochAndRound: undefined + }; +} +export const FeedEpochAndRound = { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound", + is(o: any): o is FeedEpochAndRound { + return o && (o.$typeUrl === FeedEpochAndRound.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is FeedEpochAndRoundAmino { + return o && (o.$typeUrl === FeedEpochAndRound.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: FeedEpochAndRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedEpochAndRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedEpochAndRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedEpochAndRound { + const message = createBaseFeedEpochAndRound(); + message.feedId = object.feedId ?? ""; + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: FeedEpochAndRoundAmino): FeedEpochAndRound { + const message = createBaseFeedEpochAndRound(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: FeedEpochAndRound): FeedEpochAndRoundAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: FeedEpochAndRoundAminoMsg): FeedEpochAndRound { + return FeedEpochAndRound.fromAmino(object.value); + }, + fromProtoMsg(message: FeedEpochAndRoundProtoMsg): FeedEpochAndRound { + return FeedEpochAndRound.decode(message.value); + }, + toProto(message: FeedEpochAndRound): Uint8Array { + return FeedEpochAndRound.encode(message).finish(); + }, + toProtoMsg(message: FeedEpochAndRound): FeedEpochAndRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound", + value: FeedEpochAndRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedEpochAndRound.typeUrl, FeedEpochAndRound); +function createBaseFeedLatestAggregatorRoundIDs(): FeedLatestAggregatorRoundIDs { + return { + feedId: "", + aggregatorRoundId: BigInt(0) + }; +} +export const FeedLatestAggregatorRoundIDs = { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs", + is(o: any): o is FeedLatestAggregatorRoundIDs { + return o && (o.$typeUrl === FeedLatestAggregatorRoundIDs.typeUrl || typeof o.feedId === "string" && typeof o.aggregatorRoundId === "bigint"); + }, + isAmino(o: any): o is FeedLatestAggregatorRoundIDsAmino { + return o && (o.$typeUrl === FeedLatestAggregatorRoundIDs.typeUrl || typeof o.feed_id === "string" && typeof o.aggregator_round_id === "bigint"); + }, + encode(message: FeedLatestAggregatorRoundIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.aggregatorRoundId !== BigInt(0)) { + writer.uint32(16).uint64(message.aggregatorRoundId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedLatestAggregatorRoundIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedLatestAggregatorRoundIDs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.aggregatorRoundId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedLatestAggregatorRoundIDs { + const message = createBaseFeedLatestAggregatorRoundIDs(); + message.feedId = object.feedId ?? ""; + message.aggregatorRoundId = object.aggregatorRoundId !== undefined && object.aggregatorRoundId !== null ? BigInt(object.aggregatorRoundId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeedLatestAggregatorRoundIDsAmino): FeedLatestAggregatorRoundIDs { + const message = createBaseFeedLatestAggregatorRoundIDs(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.aggregator_round_id !== undefined && object.aggregator_round_id !== null) { + message.aggregatorRoundId = BigInt(object.aggregator_round_id); + } + return message; + }, + toAmino(message: FeedLatestAggregatorRoundIDs): FeedLatestAggregatorRoundIDsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.aggregator_round_id = message.aggregatorRoundId !== BigInt(0) ? message.aggregatorRoundId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeedLatestAggregatorRoundIDsAminoMsg): FeedLatestAggregatorRoundIDs { + return FeedLatestAggregatorRoundIDs.fromAmino(object.value); + }, + fromProtoMsg(message: FeedLatestAggregatorRoundIDsProtoMsg): FeedLatestAggregatorRoundIDs { + return FeedLatestAggregatorRoundIDs.decode(message.value); + }, + toProto(message: FeedLatestAggregatorRoundIDs): Uint8Array { + return FeedLatestAggregatorRoundIDs.encode(message).finish(); + }, + toProtoMsg(message: FeedLatestAggregatorRoundIDs): FeedLatestAggregatorRoundIDsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs", + value: FeedLatestAggregatorRoundIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedLatestAggregatorRoundIDs.typeUrl, FeedLatestAggregatorRoundIDs); +function createBaseRewardPool(): RewardPool { + return { + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const RewardPool = { + typeUrl: "/injective.ocr.v1beta1.RewardPool", + is(o: any): o is RewardPool { + return o && (o.$typeUrl === RewardPool.typeUrl || typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is RewardPoolAmino { + return o && (o.$typeUrl === RewardPool.typeUrl || typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: RewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RewardPool { + const message = createBaseRewardPool(); + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: RewardPoolAmino): RewardPool { + const message = createBaseRewardPool(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: RewardPool): RewardPoolAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: RewardPoolAminoMsg): RewardPool { + return RewardPool.fromAmino(object.value); + }, + fromProtoMsg(message: RewardPoolProtoMsg): RewardPool { + return RewardPool.decode(message.value); + }, + toProto(message: RewardPool): Uint8Array { + return RewardPool.encode(message).finish(); + }, + toProtoMsg(message: RewardPool): RewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.RewardPool", + value: RewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RewardPool.typeUrl, RewardPool); +function createBaseFeedCounts(): FeedCounts { + return { + feedId: "", + counts: [] + }; +} +export const FeedCounts = { + typeUrl: "/injective.ocr.v1beta1.FeedCounts", + is(o: any): o is FeedCounts { + return o && (o.$typeUrl === FeedCounts.typeUrl || typeof o.feedId === "string" && Array.isArray(o.counts) && (!o.counts.length || Count.is(o.counts[0]))); + }, + isAmino(o: any): o is FeedCountsAmino { + return o && (o.$typeUrl === FeedCounts.typeUrl || typeof o.feed_id === "string" && Array.isArray(o.counts) && (!o.counts.length || Count.isAmino(o.counts[0]))); + }, + encode(message: FeedCounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + for (const v of message.counts) { + Count.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedCounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedCounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.counts.push(Count.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedCounts { + const message = createBaseFeedCounts(); + message.feedId = object.feedId ?? ""; + message.counts = object.counts?.map(e => Count.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeedCountsAmino): FeedCounts { + const message = createBaseFeedCounts(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.counts = object.counts?.map(e => Count.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeedCounts): FeedCountsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.counts) { + obj.counts = message.counts.map(e => e ? Count.toAmino(e) : undefined); + } else { + obj.counts = message.counts; + } + return obj; + }, + fromAminoMsg(object: FeedCountsAminoMsg): FeedCounts { + return FeedCounts.fromAmino(object.value); + }, + fromProtoMsg(message: FeedCountsProtoMsg): FeedCounts { + return FeedCounts.decode(message.value); + }, + toProto(message: FeedCounts): Uint8Array { + return FeedCounts.encode(message).finish(); + }, + toProtoMsg(message: FeedCounts): FeedCountsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedCounts", + value: FeedCounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedCounts.typeUrl, FeedCounts); +function createBaseCount(): Count { + return { + address: "", + count: BigInt(0) + }; +} +export const Count = { + typeUrl: "/injective.ocr.v1beta1.Count", + is(o: any): o is Count { + return o && (o.$typeUrl === Count.typeUrl || typeof o.address === "string" && typeof o.count === "bigint"); + }, + isAmino(o: any): o is CountAmino { + return o && (o.$typeUrl === Count.typeUrl || typeof o.address === "string" && typeof o.count === "bigint"); + }, + encode(message: Count, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Count { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Count { + const message = createBaseCount(); + message.address = object.address ?? ""; + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CountAmino): Count { + const message = createBaseCount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + return message; + }, + toAmino(message: Count): CountAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.count = message.count !== BigInt(0) ? message.count?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CountAminoMsg): Count { + return Count.fromAmino(object.value); + }, + fromProtoMsg(message: CountProtoMsg): Count { + return Count.decode(message.value); + }, + toProto(message: Count): Uint8Array { + return Count.encode(message).finish(); + }, + toProtoMsg(message: Count): CountProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Count", + value: Count.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Count.typeUrl, Count); +function createBasePendingPayeeship(): PendingPayeeship { + return { + feedId: "", + transmitter: "", + proposedPayee: "" + }; +} +export const PendingPayeeship = { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship", + is(o: any): o is PendingPayeeship { + return o && (o.$typeUrl === PendingPayeeship.typeUrl || typeof o.feedId === "string" && typeof o.transmitter === "string" && typeof o.proposedPayee === "string"); + }, + isAmino(o: any): o is PendingPayeeshipAmino { + return o && (o.$typeUrl === PendingPayeeship.typeUrl || typeof o.feed_id === "string" && typeof o.transmitter === "string" && typeof o.proposed_payee === "string"); + }, + encode(message: PendingPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.proposedPayee !== "") { + writer.uint32(26).string(message.proposedPayee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PendingPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePendingPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.proposedPayee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PendingPayeeship { + const message = createBasePendingPayeeship(); + message.feedId = object.feedId ?? ""; + message.transmitter = object.transmitter ?? ""; + message.proposedPayee = object.proposedPayee ?? ""; + return message; + }, + fromAmino(object: PendingPayeeshipAmino): PendingPayeeship { + const message = createBasePendingPayeeship(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.proposed_payee !== undefined && object.proposed_payee !== null) { + message.proposedPayee = object.proposed_payee; + } + return message; + }, + toAmino(message: PendingPayeeship): PendingPayeeshipAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.proposed_payee = message.proposedPayee === "" ? undefined : message.proposedPayee; + return obj; + }, + fromAminoMsg(object: PendingPayeeshipAminoMsg): PendingPayeeship { + return PendingPayeeship.fromAmino(object.value); + }, + fromProtoMsg(message: PendingPayeeshipProtoMsg): PendingPayeeship { + return PendingPayeeship.decode(message.value); + }, + toProto(message: PendingPayeeship): Uint8Array { + return PendingPayeeship.encode(message).finish(); + }, + toProtoMsg(message: PendingPayeeship): PendingPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship", + value: PendingPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PendingPayeeship.typeUrl, PendingPayeeship); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/ocr.ts b/libs/injective-query/src/injective/ocr/v1beta1/ocr.ts new file mode 100644 index 00000000..6a93f048 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/ocr.ts @@ -0,0 +1,3044 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** The block number interval at which payouts are made */ + payoutBlockInterval: bigint; + /** The admin for the OCR module */ + moduleAdmin: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** The block number interval at which payouts are made */ + payout_block_interval: string; + /** The admin for the OCR module */ + module_admin: string; +} +export interface ParamsAminoMsg { + type: "ocr/Params"; + value: ParamsAmino; +} +export interface FeedConfig { + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; + /** feed-specific params for the Cosmos module. */ + moduleParams?: ModuleParams; +} +export interface FeedConfigProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedConfig"; + value: Uint8Array; +} +export interface FeedConfigAmino { + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; + /** feed-specific params for the Cosmos module. */ + module_params?: ModuleParamsAmino; +} +export interface FeedConfigAminoMsg { + type: "/injective.ocr.v1beta1.FeedConfig"; + value: FeedConfigAmino; +} +export interface FeedConfigInfo { + latestConfigDigest: Uint8Array; + f: number; + n: number; + /** + * config_count ordinal number of this config setting among all config + * settings + */ + configCount: bigint; + latestConfigBlockNumber: bigint; +} +export interface FeedConfigInfoProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo"; + value: Uint8Array; +} +export interface FeedConfigInfoAmino { + latest_config_digest: string; + f: number; + n: number; + /** + * config_count ordinal number of this config setting among all config + * settings + */ + config_count: string; + latest_config_block_number: string; +} +export interface FeedConfigInfoAminoMsg { + type: "/injective.ocr.v1beta1.FeedConfigInfo"; + value: FeedConfigInfoAmino; +} +export interface ModuleParams { + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** lowest answer the median of a report is allowed to be */ + minAnswer: string; + /** highest answer the median of a report is allowed to be */ + maxAnswer: string; + /** Fixed LINK reward for each observer */ + linkPerObservation: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission: string; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** Enables unique reports */ + uniqueReports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; + /** feed administrator */ + feedAdmin: string; + /** feed billing administrator */ + billingAdmin: string; +} +export interface ModuleParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ModuleParams"; + value: Uint8Array; +} +export interface ModuleParamsAmino { + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** lowest answer the median of a report is allowed to be */ + min_answer: string; + /** highest answer the median of a report is allowed to be */ + max_answer: string; + /** Fixed LINK reward for each observer */ + link_per_observation: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission: string; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** Enables unique reports */ + unique_reports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; + /** feed administrator */ + feed_admin: string; + /** feed billing administrator */ + billing_admin: string; +} +export interface ModuleParamsAminoMsg { + type: "/injective.ocr.v1beta1.ModuleParams"; + value: ModuleParamsAmino; +} +export interface ContractConfig { + /** + * config_count ordinal number of this config setting among all config + * settings + */ + configCount: bigint; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; +} +export interface ContractConfigProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ContractConfig"; + value: Uint8Array; +} +export interface ContractConfigAmino { + /** + * config_count ordinal number of this config setting among all config + * settings + */ + config_count: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; +} +export interface ContractConfigAminoMsg { + type: "/injective.ocr.v1beta1.ContractConfig"; + value: ContractConfigAmino; +} +export interface SetConfigProposal { + title: string; + description: string; + config?: FeedConfig; +} +export interface SetConfigProposalProtoMsg { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal"; + value: Uint8Array; +} +export interface SetConfigProposalAmino { + title: string; + description: string; + config?: FeedConfigAmino; +} +export interface SetConfigProposalAminoMsg { + type: "ocr/SetConfigProposal"; + value: SetConfigProposalAmino; +} +export interface FeedProperties { + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; + /** lowest answer the median of a report is allowed to be */ + minAnswer: string; + /** highest answer the median of a report is allowed to be */ + maxAnswer: string; + /** Fixed LINK reward for each observer */ + linkPerObservation: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission: string; + /** Enables unique reports */ + uniqueReports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; +} +export interface FeedPropertiesProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedProperties"; + value: Uint8Array; +} +export interface FeedPropertiesAmino { + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; + /** lowest answer the median of a report is allowed to be */ + min_answer: string; + /** highest answer the median of a report is allowed to be */ + max_answer: string; + /** Fixed LINK reward for each observer */ + link_per_observation: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission: string; + /** Enables unique reports */ + unique_reports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; +} +export interface FeedPropertiesAminoMsg { + type: "/injective.ocr.v1beta1.FeedProperties"; + value: FeedPropertiesAmino; +} +export interface SetBatchConfigProposal { + title: string; + description: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** feed properties */ + feedProperties: FeedProperties[]; +} +export interface SetBatchConfigProposalProtoMsg { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal"; + value: Uint8Array; +} +export interface SetBatchConfigProposalAmino { + title: string; + description: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** feed properties */ + feed_properties: FeedPropertiesAmino[]; +} +export interface SetBatchConfigProposalAminoMsg { + type: "ocr/SetBatchConfigProposal"; + value: SetBatchConfigProposalAmino; +} +export interface OracleObservationsCounts { + counts: number[]; +} +export interface OracleObservationsCountsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts"; + value: Uint8Array; +} +export interface OracleObservationsCountsAmino { + counts: number[]; +} +export interface OracleObservationsCountsAminoMsg { + type: "/injective.ocr.v1beta1.OracleObservationsCounts"; + value: OracleObservationsCountsAmino; +} +/** LINK-INJ-denominated reimbursements for gas used by transmitters. */ +export interface GasReimbursements { + reimbursements: Coin[]; +} +export interface GasReimbursementsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements"; + value: Uint8Array; +} +/** LINK-INJ-denominated reimbursements for gas used by transmitters. */ +export interface GasReimbursementsAmino { + reimbursements: CoinAmino[]; +} +export interface GasReimbursementsAminoMsg { + type: "/injective.ocr.v1beta1.GasReimbursements"; + value: GasReimbursementsAmino; +} +export interface Payee { + transmitterAddr: string; + paymentAddr: string; +} +export interface PayeeProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Payee"; + value: Uint8Array; +} +export interface PayeeAmino { + transmitter_addr: string; + payment_addr: string; +} +export interface PayeeAminoMsg { + type: "/injective.ocr.v1beta1.Payee"; + value: PayeeAmino; +} +/** + * Transmission records the median answer from the transmit transaction at + * time timestamp + */ +export interface Transmission { + answer: string; + /** when were observations made offchain */ + observationsTimestamp: bigint; + /** when was report received onchain */ + transmissionTimestamp: bigint; +} +export interface TransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Transmission"; + value: Uint8Array; +} +/** + * Transmission records the median answer from the transmit transaction at + * time timestamp + */ +export interface TransmissionAmino { + answer: string; + /** when were observations made offchain */ + observations_timestamp: string; + /** when was report received onchain */ + transmission_timestamp: string; +} +export interface TransmissionAminoMsg { + type: "/injective.ocr.v1beta1.Transmission"; + value: TransmissionAmino; +} +export interface EpochAndRound { + epoch: bigint; + round: bigint; +} +export interface EpochAndRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound"; + value: Uint8Array; +} +export interface EpochAndRoundAmino { + epoch: string; + round: string; +} +export interface EpochAndRoundAminoMsg { + type: "/injective.ocr.v1beta1.EpochAndRound"; + value: EpochAndRoundAmino; +} +export interface Report { + observationsTimestamp: bigint; + /** ith element is the index of the ith observer */ + observers: Uint8Array; + observations: string[]; +} +export interface ReportProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Report"; + value: Uint8Array; +} +export interface ReportAmino { + observations_timestamp: string; + /** ith element is the index of the ith observer */ + observers: string; + observations: string[]; +} +export interface ReportAminoMsg { + type: "/injective.ocr.v1beta1.Report"; + value: ReportAmino; +} +export interface ReportToSign { + configDigest: Uint8Array; + epoch: bigint; + round: bigint; + extraHash: Uint8Array; + /** Opaque report */ + report: Uint8Array; +} +export interface ReportToSignProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ReportToSign"; + value: Uint8Array; +} +export interface ReportToSignAmino { + config_digest: string; + epoch: string; + round: string; + extra_hash: string; + /** Opaque report */ + report: string; +} +export interface ReportToSignAminoMsg { + type: "/injective.ocr.v1beta1.ReportToSign"; + value: ReportToSignAmino; +} +export interface EventOraclePaid { + transmitterAddr: string; + payeeAddr: string; + amount: Coin; +} +export interface EventOraclePaidProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid"; + value: Uint8Array; +} +export interface EventOraclePaidAmino { + transmitter_addr: string; + payee_addr: string; + amount: CoinAmino; +} +export interface EventOraclePaidAminoMsg { + type: "/injective.ocr.v1beta1.EventOraclePaid"; + value: EventOraclePaidAmino; +} +export interface EventAnswerUpdated { + current: string; + roundId: string; + updatedAt: Date; +} +export interface EventAnswerUpdatedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated"; + value: Uint8Array; +} +export interface EventAnswerUpdatedAmino { + current: string; + round_id: string; + updated_at: string; +} +export interface EventAnswerUpdatedAminoMsg { + type: "/injective.ocr.v1beta1.EventAnswerUpdated"; + value: EventAnswerUpdatedAmino; +} +export interface EventNewRound { + roundId: string; + /** address of starter */ + startedBy: string; + startedAt: Date; +} +export interface EventNewRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventNewRound"; + value: Uint8Array; +} +export interface EventNewRoundAmino { + round_id: string; + /** address of starter */ + started_by: string; + started_at: string; +} +export interface EventNewRoundAminoMsg { + type: "/injective.ocr.v1beta1.EventNewRound"; + value: EventNewRoundAmino; +} +export interface EventTransmitted { + configDigest: Uint8Array; + epoch: bigint; +} +export interface EventTransmittedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted"; + value: Uint8Array; +} +export interface EventTransmittedAmino { + config_digest: string; + epoch: string; +} +export interface EventTransmittedAminoMsg { + type: "/injective.ocr.v1beta1.EventTransmitted"; + value: EventTransmittedAmino; +} +export interface EventNewTransmission { + feedId: string; + aggregatorRoundId: number; + answer: string; + transmitter: string; + observationsTimestamp: bigint; + observations: string[]; + observers: Uint8Array; + configDigest: Uint8Array; + epochAndRound?: EpochAndRound; +} +export interface EventNewTransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission"; + value: Uint8Array; +} +export interface EventNewTransmissionAmino { + feed_id: string; + aggregator_round_id: number; + answer: string; + transmitter: string; + observations_timestamp: string; + observations: string[]; + observers: string; + config_digest: string; + epoch_and_round?: EpochAndRoundAmino; +} +export interface EventNewTransmissionAminoMsg { + type: "/injective.ocr.v1beta1.EventNewTransmission"; + value: EventNewTransmissionAmino; +} +export interface EventConfigSet { + /** hash of the config */ + configDigest: Uint8Array; + /** + * previous_config_block_number block in which the previous config was set, to + * simplify historic analysis + */ + previousConfigBlockNumber: bigint; + config?: FeedConfig; + configInfo?: FeedConfigInfo; +} +export interface EventConfigSetProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet"; + value: Uint8Array; +} +export interface EventConfigSetAmino { + /** hash of the config */ + config_digest: string; + /** + * previous_config_block_number block in which the previous config was set, to + * simplify historic analysis + */ + previous_config_block_number: string; + config?: FeedConfigAmino; + config_info?: FeedConfigInfoAmino; +} +export interface EventConfigSetAminoMsg { + type: "/injective.ocr.v1beta1.EventConfigSet"; + value: EventConfigSetAmino; +} +function createBaseParams(): Params { + return { + linkDenom: "", + payoutBlockInterval: BigInt(0), + moduleAdmin: "" + }; +} +export const Params = { + typeUrl: "/injective.ocr.v1beta1.Params", + aminoType: "ocr/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.linkDenom === "string" && typeof o.payoutBlockInterval === "bigint" && typeof o.moduleAdmin === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.link_denom === "string" && typeof o.payout_block_interval === "bigint" && typeof o.module_admin === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.linkDenom !== "") { + writer.uint32(10).string(message.linkDenom); + } + if (message.payoutBlockInterval !== BigInt(0)) { + writer.uint32(16).uint64(message.payoutBlockInterval); + } + if (message.moduleAdmin !== "") { + writer.uint32(26).string(message.moduleAdmin); + } + 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.linkDenom = reader.string(); + break; + case 2: + message.payoutBlockInterval = reader.uint64(); + break; + case 3: + message.moduleAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.linkDenom = object.linkDenom ?? ""; + message.payoutBlockInterval = object.payoutBlockInterval !== undefined && object.payoutBlockInterval !== null ? BigInt(object.payoutBlockInterval.toString()) : BigInt(0); + message.moduleAdmin = object.moduleAdmin ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.payout_block_interval !== undefined && object.payout_block_interval !== null) { + message.payoutBlockInterval = BigInt(object.payout_block_interval); + } + if (object.module_admin !== undefined && object.module_admin !== null) { + message.moduleAdmin = object.module_admin; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.payout_block_interval = message.payoutBlockInterval !== BigInt(0) ? message.payoutBlockInterval?.toString() : undefined; + obj.module_admin = message.moduleAdmin === "" ? undefined : message.moduleAdmin; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "ocr/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: "/injective.ocr.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseFeedConfig(): FeedConfig { + return { + signers: [], + transmitters: [], + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array(), + moduleParams: undefined + }; +} +export const FeedConfig = { + typeUrl: "/injective.ocr.v1beta1.FeedConfig", + is(o: any): o is FeedConfig { + return o && (o.$typeUrl === FeedConfig.typeUrl || Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string")); + }, + isAmino(o: any): o is FeedConfigAmino { + return o && (o.$typeUrl === FeedConfig.typeUrl || Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string")); + }, + encode(message: FeedConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signers) { + writer.uint32(10).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(18).string(v!); + } + if (message.f !== 0) { + writer.uint32(24).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(34).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(40).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(50).bytes(message.offchainConfig); + } + if (message.moduleParams !== undefined) { + ModuleParams.encode(message.moduleParams, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signers.push(reader.string()); + break; + case 2: + message.transmitters.push(reader.string()); + break; + case 3: + message.f = reader.uint32(); + break; + case 4: + message.onchainConfig = reader.bytes(); + break; + case 5: + message.offchainConfigVersion = reader.uint64(); + break; + case 6: + message.offchainConfig = reader.bytes(); + break; + case 7: + message.moduleParams = ModuleParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedConfig { + const message = createBaseFeedConfig(); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + message.moduleParams = object.moduleParams !== undefined && object.moduleParams !== null ? ModuleParams.fromPartial(object.moduleParams) : undefined; + return message; + }, + fromAmino(object: FeedConfigAmino): FeedConfig { + const message = createBaseFeedConfig(); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + if (object.module_params !== undefined && object.module_params !== null) { + message.moduleParams = ModuleParams.fromAmino(object.module_params); + } + return message; + }, + toAmino(message: FeedConfig): FeedConfigAmino { + const obj: any = {}; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + obj.module_params = message.moduleParams ? ModuleParams.toAmino(message.moduleParams) : undefined; + return obj; + }, + fromAminoMsg(object: FeedConfigAminoMsg): FeedConfig { + return FeedConfig.fromAmino(object.value); + }, + fromProtoMsg(message: FeedConfigProtoMsg): FeedConfig { + return FeedConfig.decode(message.value); + }, + toProto(message: FeedConfig): Uint8Array { + return FeedConfig.encode(message).finish(); + }, + toProtoMsg(message: FeedConfig): FeedConfigProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedConfig", + value: FeedConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedConfig.typeUrl, FeedConfig); +function createBaseFeedConfigInfo(): FeedConfigInfo { + return { + latestConfigDigest: new Uint8Array(), + f: 0, + n: 0, + configCount: BigInt(0), + latestConfigBlockNumber: BigInt(0) + }; +} +export const FeedConfigInfo = { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo", + is(o: any): o is FeedConfigInfo { + return o && (o.$typeUrl === FeedConfigInfo.typeUrl || (o.latestConfigDigest instanceof Uint8Array || typeof o.latestConfigDigest === "string") && typeof o.f === "number" && typeof o.n === "number" && typeof o.configCount === "bigint" && typeof o.latestConfigBlockNumber === "bigint"); + }, + isAmino(o: any): o is FeedConfigInfoAmino { + return o && (o.$typeUrl === FeedConfigInfo.typeUrl || (o.latest_config_digest instanceof Uint8Array || typeof o.latest_config_digest === "string") && typeof o.f === "number" && typeof o.n === "number" && typeof o.config_count === "bigint" && typeof o.latest_config_block_number === "bigint"); + }, + encode(message: FeedConfigInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.latestConfigDigest.length !== 0) { + writer.uint32(10).bytes(message.latestConfigDigest); + } + if (message.f !== 0) { + writer.uint32(16).uint32(message.f); + } + if (message.n !== 0) { + writer.uint32(24).uint32(message.n); + } + if (message.configCount !== BigInt(0)) { + writer.uint32(32).uint64(message.configCount); + } + if (message.latestConfigBlockNumber !== BigInt(0)) { + writer.uint32(40).int64(message.latestConfigBlockNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedConfigInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedConfigInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestConfigDigest = reader.bytes(); + break; + case 2: + message.f = reader.uint32(); + break; + case 3: + message.n = reader.uint32(); + break; + case 4: + message.configCount = reader.uint64(); + break; + case 5: + message.latestConfigBlockNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedConfigInfo { + const message = createBaseFeedConfigInfo(); + message.latestConfigDigest = object.latestConfigDigest ?? new Uint8Array(); + message.f = object.f ?? 0; + message.n = object.n ?? 0; + message.configCount = object.configCount !== undefined && object.configCount !== null ? BigInt(object.configCount.toString()) : BigInt(0); + message.latestConfigBlockNumber = object.latestConfigBlockNumber !== undefined && object.latestConfigBlockNumber !== null ? BigInt(object.latestConfigBlockNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeedConfigInfoAmino): FeedConfigInfo { + const message = createBaseFeedConfigInfo(); + if (object.latest_config_digest !== undefined && object.latest_config_digest !== null) { + message.latestConfigDigest = bytesFromBase64(object.latest_config_digest); + } + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.n !== undefined && object.n !== null) { + message.n = object.n; + } + if (object.config_count !== undefined && object.config_count !== null) { + message.configCount = BigInt(object.config_count); + } + if (object.latest_config_block_number !== undefined && object.latest_config_block_number !== null) { + message.latestConfigBlockNumber = BigInt(object.latest_config_block_number); + } + return message; + }, + toAmino(message: FeedConfigInfo): FeedConfigInfoAmino { + const obj: any = {}; + obj.latest_config_digest = message.latestConfigDigest ? base64FromBytes(message.latestConfigDigest) : undefined; + obj.f = message.f === 0 ? undefined : message.f; + obj.n = message.n === 0 ? undefined : message.n; + obj.config_count = message.configCount !== BigInt(0) ? message.configCount?.toString() : undefined; + obj.latest_config_block_number = message.latestConfigBlockNumber !== BigInt(0) ? message.latestConfigBlockNumber?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeedConfigInfoAminoMsg): FeedConfigInfo { + return FeedConfigInfo.fromAmino(object.value); + }, + fromProtoMsg(message: FeedConfigInfoProtoMsg): FeedConfigInfo { + return FeedConfigInfo.decode(message.value); + }, + toProto(message: FeedConfigInfo): Uint8Array { + return FeedConfigInfo.encode(message).finish(); + }, + toProtoMsg(message: FeedConfigInfo): FeedConfigInfoProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo", + value: FeedConfigInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedConfigInfo.typeUrl, FeedConfigInfo); +function createBaseModuleParams(): ModuleParams { + return { + feedId: "", + minAnswer: "", + maxAnswer: "", + linkPerObservation: "", + linkPerTransmission: "", + linkDenom: "", + uniqueReports: false, + description: "", + feedAdmin: "", + billingAdmin: "" + }; +} +export const ModuleParams = { + typeUrl: "/injective.ocr.v1beta1.ModuleParams", + is(o: any): o is ModuleParams { + return o && (o.$typeUrl === ModuleParams.typeUrl || typeof o.feedId === "string" && typeof o.minAnswer === "string" && typeof o.maxAnswer === "string" && typeof o.linkPerObservation === "string" && typeof o.linkPerTransmission === "string" && typeof o.linkDenom === "string" && typeof o.uniqueReports === "boolean" && typeof o.description === "string" && typeof o.feedAdmin === "string" && typeof o.billingAdmin === "string"); + }, + isAmino(o: any): o is ModuleParamsAmino { + return o && (o.$typeUrl === ModuleParams.typeUrl || typeof o.feed_id === "string" && typeof o.min_answer === "string" && typeof o.max_answer === "string" && typeof o.link_per_observation === "string" && typeof o.link_per_transmission === "string" && typeof o.link_denom === "string" && typeof o.unique_reports === "boolean" && typeof o.description === "string" && typeof o.feed_admin === "string" && typeof o.billing_admin === "string"); + }, + encode(message: ModuleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.minAnswer !== "") { + writer.uint32(18).string(message.minAnswer); + } + if (message.maxAnswer !== "") { + writer.uint32(26).string(message.maxAnswer); + } + if (message.linkPerObservation !== "") { + writer.uint32(34).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== "") { + writer.uint32(42).string(message.linkPerTransmission); + } + if (message.linkDenom !== "") { + writer.uint32(50).string(message.linkDenom); + } + if (message.uniqueReports === true) { + writer.uint32(56).bool(message.uniqueReports); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.feedAdmin !== "") { + writer.uint32(74).string(message.feedAdmin); + } + if (message.billingAdmin !== "") { + writer.uint32(82).string(message.billingAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.minAnswer = reader.string(); + break; + case 3: + message.maxAnswer = reader.string(); + break; + case 4: + message.linkPerObservation = reader.string(); + break; + case 5: + message.linkPerTransmission = reader.string(); + break; + case 6: + message.linkDenom = reader.string(); + break; + case 7: + message.uniqueReports = reader.bool(); + break; + case 8: + message.description = reader.string(); + break; + case 9: + message.feedAdmin = reader.string(); + break; + case 10: + message.billingAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleParams { + const message = createBaseModuleParams(); + message.feedId = object.feedId ?? ""; + message.minAnswer = object.minAnswer ?? ""; + message.maxAnswer = object.maxAnswer ?? ""; + message.linkPerObservation = object.linkPerObservation ?? ""; + message.linkPerTransmission = object.linkPerTransmission ?? ""; + message.linkDenom = object.linkDenom ?? ""; + message.uniqueReports = object.uniqueReports ?? false; + message.description = object.description ?? ""; + message.feedAdmin = object.feedAdmin ?? ""; + message.billingAdmin = object.billingAdmin ?? ""; + return message; + }, + fromAmino(object: ModuleParamsAmino): ModuleParams { + const message = createBaseModuleParams(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.min_answer !== undefined && object.min_answer !== null) { + message.minAnswer = object.min_answer; + } + if (object.max_answer !== undefined && object.max_answer !== null) { + message.maxAnswer = object.max_answer; + } + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.unique_reports !== undefined && object.unique_reports !== null) { + message.uniqueReports = object.unique_reports; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.feed_admin !== undefined && object.feed_admin !== null) { + message.feedAdmin = object.feed_admin; + } + if (object.billing_admin !== undefined && object.billing_admin !== null) { + message.billingAdmin = object.billing_admin; + } + return message; + }, + toAmino(message: ModuleParams): ModuleParamsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.min_answer = message.minAnswer === "" ? undefined : message.minAnswer; + obj.max_answer = message.maxAnswer === "" ? undefined : message.maxAnswer; + obj.link_per_observation = message.linkPerObservation === "" ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === "" ? undefined : message.linkPerTransmission; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.unique_reports = message.uniqueReports === false ? undefined : message.uniqueReports; + obj.description = message.description === "" ? undefined : message.description; + obj.feed_admin = message.feedAdmin === "" ? undefined : message.feedAdmin; + obj.billing_admin = message.billingAdmin === "" ? undefined : message.billingAdmin; + return obj; + }, + fromAminoMsg(object: ModuleParamsAminoMsg): ModuleParams { + return ModuleParams.fromAmino(object.value); + }, + fromProtoMsg(message: ModuleParamsProtoMsg): ModuleParams { + return ModuleParams.decode(message.value); + }, + toProto(message: ModuleParams): Uint8Array { + return ModuleParams.encode(message).finish(); + }, + toProtoMsg(message: ModuleParams): ModuleParamsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ModuleParams", + value: ModuleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleParams.typeUrl, ModuleParams); +function createBaseContractConfig(): ContractConfig { + return { + configCount: BigInt(0), + signers: [], + transmitters: [], + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array() + }; +} +export const ContractConfig = { + typeUrl: "/injective.ocr.v1beta1.ContractConfig", + is(o: any): o is ContractConfig { + return o && (o.$typeUrl === ContractConfig.typeUrl || typeof o.configCount === "bigint" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string")); + }, + isAmino(o: any): o is ContractConfigAmino { + return o && (o.$typeUrl === ContractConfig.typeUrl || typeof o.config_count === "bigint" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string")); + }, + encode(message: ContractConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configCount !== BigInt(0)) { + writer.uint32(8).uint64(message.configCount); + } + for (const v of message.signers) { + writer.uint32(18).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(26).string(v!); + } + if (message.f !== 0) { + writer.uint32(32).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(42).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(48).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(58).bytes(message.offchainConfig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configCount = reader.uint64(); + break; + case 2: + message.signers.push(reader.string()); + break; + case 3: + message.transmitters.push(reader.string()); + break; + case 4: + message.f = reader.uint32(); + break; + case 5: + message.onchainConfig = reader.bytes(); + break; + case 6: + message.offchainConfigVersion = reader.uint64(); + break; + case 7: + message.offchainConfig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractConfig { + const message = createBaseContractConfig(); + message.configCount = object.configCount !== undefined && object.configCount !== null ? BigInt(object.configCount.toString()) : BigInt(0); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractConfigAmino): ContractConfig { + const message = createBaseContractConfig(); + if (object.config_count !== undefined && object.config_count !== null) { + message.configCount = BigInt(object.config_count); + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + return message; + }, + toAmino(message: ContractConfig): ContractConfigAmino { + const obj: any = {}; + obj.config_count = message.configCount !== BigInt(0) ? message.configCount?.toString() : undefined; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + return obj; + }, + fromAminoMsg(object: ContractConfigAminoMsg): ContractConfig { + return ContractConfig.fromAmino(object.value); + }, + fromProtoMsg(message: ContractConfigProtoMsg): ContractConfig { + return ContractConfig.decode(message.value); + }, + toProto(message: ContractConfig): Uint8Array { + return ContractConfig.encode(message).finish(); + }, + toProtoMsg(message: ContractConfig): ContractConfigProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ContractConfig", + value: ContractConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractConfig.typeUrl, ContractConfig); +function createBaseSetConfigProposal(): SetConfigProposal { + return { + title: "", + description: "", + config: undefined + }; +} +export const SetConfigProposal = { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal", + aminoType: "ocr/SetConfigProposal", + is(o: any): o is SetConfigProposal { + return o && (o.$typeUrl === SetConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is SetConfigProposalAmino { + return o && (o.$typeUrl === SetConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: SetConfigProposal, 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.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetConfigProposal(); + 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.config = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetConfigProposal { + const message = createBaseSetConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: SetConfigProposalAmino): SetConfigProposal { + const message = createBaseSetConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + return message; + }, + toAmino(message: SetConfigProposal): SetConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: SetConfigProposalAminoMsg): SetConfigProposal { + return SetConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetConfigProposal): SetConfigProposalAminoMsg { + return { + type: "ocr/SetConfigProposal", + value: SetConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetConfigProposalProtoMsg): SetConfigProposal { + return SetConfigProposal.decode(message.value); + }, + toProto(message: SetConfigProposal): Uint8Array { + return SetConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: SetConfigProposal): SetConfigProposalProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal", + value: SetConfigProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetConfigProposal.typeUrl, SetConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetConfigProposal.aminoType, SetConfigProposal.typeUrl); +function createBaseFeedProperties(): FeedProperties { + return { + feedId: "", + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array(), + minAnswer: "", + maxAnswer: "", + linkPerObservation: "", + linkPerTransmission: "", + uniqueReports: false, + description: "" + }; +} +export const FeedProperties = { + typeUrl: "/injective.ocr.v1beta1.FeedProperties", + is(o: any): o is FeedProperties { + return o && (o.$typeUrl === FeedProperties.typeUrl || typeof o.feedId === "string" && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string") && typeof o.minAnswer === "string" && typeof o.maxAnswer === "string" && typeof o.linkPerObservation === "string" && typeof o.linkPerTransmission === "string" && typeof o.uniqueReports === "boolean" && typeof o.description === "string"); + }, + isAmino(o: any): o is FeedPropertiesAmino { + return o && (o.$typeUrl === FeedProperties.typeUrl || typeof o.feed_id === "string" && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string") && typeof o.min_answer === "string" && typeof o.max_answer === "string" && typeof o.link_per_observation === "string" && typeof o.link_per_transmission === "string" && typeof o.unique_reports === "boolean" && typeof o.description === "string"); + }, + encode(message: FeedProperties, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.f !== 0) { + writer.uint32(16).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(26).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(32).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(42).bytes(message.offchainConfig); + } + if (message.minAnswer !== "") { + writer.uint32(50).string(message.minAnswer); + } + if (message.maxAnswer !== "") { + writer.uint32(58).string(message.maxAnswer); + } + if (message.linkPerObservation !== "") { + writer.uint32(66).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== "") { + writer.uint32(74).string(message.linkPerTransmission); + } + if (message.uniqueReports === true) { + writer.uint32(80).bool(message.uniqueReports); + } + if (message.description !== "") { + writer.uint32(90).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedProperties { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedProperties(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.f = reader.uint32(); + break; + case 3: + message.onchainConfig = reader.bytes(); + break; + case 4: + message.offchainConfigVersion = reader.uint64(); + break; + case 5: + message.offchainConfig = reader.bytes(); + break; + case 6: + message.minAnswer = reader.string(); + break; + case 7: + message.maxAnswer = reader.string(); + break; + case 8: + message.linkPerObservation = reader.string(); + break; + case 9: + message.linkPerTransmission = reader.string(); + break; + case 10: + message.uniqueReports = reader.bool(); + break; + case 11: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedProperties { + const message = createBaseFeedProperties(); + message.feedId = object.feedId ?? ""; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + message.minAnswer = object.minAnswer ?? ""; + message.maxAnswer = object.maxAnswer ?? ""; + message.linkPerObservation = object.linkPerObservation ?? ""; + message.linkPerTransmission = object.linkPerTransmission ?? ""; + message.uniqueReports = object.uniqueReports ?? false; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: FeedPropertiesAmino): FeedProperties { + const message = createBaseFeedProperties(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + if (object.min_answer !== undefined && object.min_answer !== null) { + message.minAnswer = object.min_answer; + } + if (object.max_answer !== undefined && object.max_answer !== null) { + message.maxAnswer = object.max_answer; + } + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.unique_reports !== undefined && object.unique_reports !== null) { + message.uniqueReports = object.unique_reports; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: FeedProperties): FeedPropertiesAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + obj.min_answer = message.minAnswer === "" ? undefined : message.minAnswer; + obj.max_answer = message.maxAnswer === "" ? undefined : message.maxAnswer; + obj.link_per_observation = message.linkPerObservation === "" ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === "" ? undefined : message.linkPerTransmission; + obj.unique_reports = message.uniqueReports === false ? undefined : message.uniqueReports; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: FeedPropertiesAminoMsg): FeedProperties { + return FeedProperties.fromAmino(object.value); + }, + fromProtoMsg(message: FeedPropertiesProtoMsg): FeedProperties { + return FeedProperties.decode(message.value); + }, + toProto(message: FeedProperties): Uint8Array { + return FeedProperties.encode(message).finish(); + }, + toProtoMsg(message: FeedProperties): FeedPropertiesProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedProperties", + value: FeedProperties.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedProperties.typeUrl, FeedProperties); +function createBaseSetBatchConfigProposal(): SetBatchConfigProposal { + return { + title: "", + description: "", + signers: [], + transmitters: [], + linkDenom: "", + feedProperties: [] + }; +} +export const SetBatchConfigProposal = { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal", + aminoType: "ocr/SetBatchConfigProposal", + is(o: any): o is SetBatchConfigProposal { + return o && (o.$typeUrl === SetBatchConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.linkDenom === "string" && Array.isArray(o.feedProperties) && (!o.feedProperties.length || FeedProperties.is(o.feedProperties[0]))); + }, + isAmino(o: any): o is SetBatchConfigProposalAmino { + return o && (o.$typeUrl === SetBatchConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.link_denom === "string" && Array.isArray(o.feed_properties) && (!o.feed_properties.length || FeedProperties.isAmino(o.feed_properties[0]))); + }, + encode(message: SetBatchConfigProposal, 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.signers) { + writer.uint32(26).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(34).string(v!); + } + if (message.linkDenom !== "") { + writer.uint32(42).string(message.linkDenom); + } + for (const v of message.feedProperties) { + FeedProperties.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBatchConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBatchConfigProposal(); + 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.signers.push(reader.string()); + break; + case 4: + message.transmitters.push(reader.string()); + break; + case 5: + message.linkDenom = reader.string(); + break; + case 6: + message.feedProperties.push(FeedProperties.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBatchConfigProposal { + const message = createBaseSetBatchConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.linkDenom = object.linkDenom ?? ""; + message.feedProperties = object.feedProperties?.map(e => FeedProperties.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SetBatchConfigProposalAmino): SetBatchConfigProposal { + const message = createBaseSetBatchConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + message.feedProperties = object.feed_properties?.map(e => FeedProperties.fromAmino(e)) || []; + return message; + }, + toAmino(message: SetBatchConfigProposal): SetBatchConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + if (message.feedProperties) { + obj.feed_properties = message.feedProperties.map(e => e ? FeedProperties.toAmino(e) : undefined); + } else { + obj.feed_properties = message.feedProperties; + } + return obj; + }, + fromAminoMsg(object: SetBatchConfigProposalAminoMsg): SetBatchConfigProposal { + return SetBatchConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetBatchConfigProposal): SetBatchConfigProposalAminoMsg { + return { + type: "ocr/SetBatchConfigProposal", + value: SetBatchConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetBatchConfigProposalProtoMsg): SetBatchConfigProposal { + return SetBatchConfigProposal.decode(message.value); + }, + toProto(message: SetBatchConfigProposal): Uint8Array { + return SetBatchConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: SetBatchConfigProposal): SetBatchConfigProposalProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal", + value: SetBatchConfigProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBatchConfigProposal.typeUrl, SetBatchConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetBatchConfigProposal.aminoType, SetBatchConfigProposal.typeUrl); +function createBaseOracleObservationsCounts(): OracleObservationsCounts { + return { + counts: [] + }; +} +export const OracleObservationsCounts = { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts", + is(o: any): o is OracleObservationsCounts { + return o && (o.$typeUrl === OracleObservationsCounts.typeUrl || Array.isArray(o.counts) && (!o.counts.length || typeof o.counts[0] === "number")); + }, + isAmino(o: any): o is OracleObservationsCountsAmino { + return o && (o.$typeUrl === OracleObservationsCounts.typeUrl || Array.isArray(o.counts) && (!o.counts.length || typeof o.counts[0] === "number")); + }, + encode(message: OracleObservationsCounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.counts) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleObservationsCounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleObservationsCounts(); + 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.counts.push(reader.uint32()); + } + } else { + message.counts.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleObservationsCounts { + const message = createBaseOracleObservationsCounts(); + message.counts = object.counts?.map(e => e) || []; + return message; + }, + fromAmino(object: OracleObservationsCountsAmino): OracleObservationsCounts { + const message = createBaseOracleObservationsCounts(); + message.counts = object.counts?.map(e => e) || []; + return message; + }, + toAmino(message: OracleObservationsCounts): OracleObservationsCountsAmino { + const obj: any = {}; + if (message.counts) { + obj.counts = message.counts.map(e => e); + } else { + obj.counts = message.counts; + } + return obj; + }, + fromAminoMsg(object: OracleObservationsCountsAminoMsg): OracleObservationsCounts { + return OracleObservationsCounts.fromAmino(object.value); + }, + fromProtoMsg(message: OracleObservationsCountsProtoMsg): OracleObservationsCounts { + return OracleObservationsCounts.decode(message.value); + }, + toProto(message: OracleObservationsCounts): Uint8Array { + return OracleObservationsCounts.encode(message).finish(); + }, + toProtoMsg(message: OracleObservationsCounts): OracleObservationsCountsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts", + value: OracleObservationsCounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleObservationsCounts.typeUrl, OracleObservationsCounts); +function createBaseGasReimbursements(): GasReimbursements { + return { + reimbursements: [] + }; +} +export const GasReimbursements = { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements", + is(o: any): o is GasReimbursements { + return o && (o.$typeUrl === GasReimbursements.typeUrl || Array.isArray(o.reimbursements) && (!o.reimbursements.length || Coin.is(o.reimbursements[0]))); + }, + isAmino(o: any): o is GasReimbursementsAmino { + return o && (o.$typeUrl === GasReimbursements.typeUrl || Array.isArray(o.reimbursements) && (!o.reimbursements.length || Coin.isAmino(o.reimbursements[0]))); + }, + encode(message: GasReimbursements, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.reimbursements) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GasReimbursements { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasReimbursements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reimbursements.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GasReimbursements { + const message = createBaseGasReimbursements(); + message.reimbursements = object.reimbursements?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GasReimbursementsAmino): GasReimbursements { + const message = createBaseGasReimbursements(); + message.reimbursements = object.reimbursements?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: GasReimbursements): GasReimbursementsAmino { + const obj: any = {}; + if (message.reimbursements) { + obj.reimbursements = message.reimbursements.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.reimbursements = message.reimbursements; + } + return obj; + }, + fromAminoMsg(object: GasReimbursementsAminoMsg): GasReimbursements { + return GasReimbursements.fromAmino(object.value); + }, + fromProtoMsg(message: GasReimbursementsProtoMsg): GasReimbursements { + return GasReimbursements.decode(message.value); + }, + toProto(message: GasReimbursements): Uint8Array { + return GasReimbursements.encode(message).finish(); + }, + toProtoMsg(message: GasReimbursements): GasReimbursementsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements", + value: GasReimbursements.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GasReimbursements.typeUrl, GasReimbursements); +function createBasePayee(): Payee { + return { + transmitterAddr: "", + paymentAddr: "" + }; +} +export const Payee = { + typeUrl: "/injective.ocr.v1beta1.Payee", + is(o: any): o is Payee { + return o && (o.$typeUrl === Payee.typeUrl || typeof o.transmitterAddr === "string" && typeof o.paymentAddr === "string"); + }, + isAmino(o: any): o is PayeeAmino { + return o && (o.$typeUrl === Payee.typeUrl || typeof o.transmitter_addr === "string" && typeof o.payment_addr === "string"); + }, + encode(message: Payee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitterAddr !== "") { + writer.uint32(10).string(message.transmitterAddr); + } + if (message.paymentAddr !== "") { + writer.uint32(18).string(message.paymentAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Payee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePayee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitterAddr = reader.string(); + break; + case 2: + message.paymentAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Payee { + const message = createBasePayee(); + message.transmitterAddr = object.transmitterAddr ?? ""; + message.paymentAddr = object.paymentAddr ?? ""; + return message; + }, + fromAmino(object: PayeeAmino): Payee { + const message = createBasePayee(); + if (object.transmitter_addr !== undefined && object.transmitter_addr !== null) { + message.transmitterAddr = object.transmitter_addr; + } + if (object.payment_addr !== undefined && object.payment_addr !== null) { + message.paymentAddr = object.payment_addr; + } + return message; + }, + toAmino(message: Payee): PayeeAmino { + const obj: any = {}; + obj.transmitter_addr = message.transmitterAddr === "" ? undefined : message.transmitterAddr; + obj.payment_addr = message.paymentAddr === "" ? undefined : message.paymentAddr; + return obj; + }, + fromAminoMsg(object: PayeeAminoMsg): Payee { + return Payee.fromAmino(object.value); + }, + fromProtoMsg(message: PayeeProtoMsg): Payee { + return Payee.decode(message.value); + }, + toProto(message: Payee): Uint8Array { + return Payee.encode(message).finish(); + }, + toProtoMsg(message: Payee): PayeeProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Payee", + value: Payee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Payee.typeUrl, Payee); +function createBaseTransmission(): Transmission { + return { + answer: "", + observationsTimestamp: BigInt(0), + transmissionTimestamp: BigInt(0) + }; +} +export const Transmission = { + typeUrl: "/injective.ocr.v1beta1.Transmission", + is(o: any): o is Transmission { + return o && (o.$typeUrl === Transmission.typeUrl || typeof o.answer === "string" && typeof o.observationsTimestamp === "bigint" && typeof o.transmissionTimestamp === "bigint"); + }, + isAmino(o: any): o is TransmissionAmino { + return o && (o.$typeUrl === Transmission.typeUrl || typeof o.answer === "string" && typeof o.observations_timestamp === "bigint" && typeof o.transmission_timestamp === "bigint"); + }, + encode(message: Transmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.answer !== "") { + writer.uint32(10).string(message.answer); + } + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.observationsTimestamp); + } + if (message.transmissionTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.transmissionTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Transmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answer = reader.string(); + break; + case 2: + message.observationsTimestamp = reader.int64(); + break; + case 3: + message.transmissionTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Transmission { + const message = createBaseTransmission(); + message.answer = object.answer ?? ""; + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.transmissionTimestamp = object.transmissionTimestamp !== undefined && object.transmissionTimestamp !== null ? BigInt(object.transmissionTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TransmissionAmino): Transmission { + const message = createBaseTransmission(); + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + if (object.transmission_timestamp !== undefined && object.transmission_timestamp !== null) { + message.transmissionTimestamp = BigInt(object.transmission_timestamp); + } + return message; + }, + toAmino(message: Transmission): TransmissionAmino { + const obj: any = {}; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + obj.transmission_timestamp = message.transmissionTimestamp !== BigInt(0) ? message.transmissionTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TransmissionAminoMsg): Transmission { + return Transmission.fromAmino(object.value); + }, + fromProtoMsg(message: TransmissionProtoMsg): Transmission { + return Transmission.decode(message.value); + }, + toProto(message: Transmission): Uint8Array { + return Transmission.encode(message).finish(); + }, + toProtoMsg(message: Transmission): TransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Transmission", + value: Transmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Transmission.typeUrl, Transmission); +function createBaseEpochAndRound(): EpochAndRound { + return { + epoch: BigInt(0), + round: BigInt(0) + }; +} +export const EpochAndRound = { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound", + is(o: any): o is EpochAndRound { + return o && (o.$typeUrl === EpochAndRound.typeUrl || typeof o.epoch === "bigint" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EpochAndRoundAmino { + return o && (o.$typeUrl === EpochAndRound.typeUrl || typeof o.epoch === "bigint" && typeof o.round === "bigint"); + }, + encode(message: EpochAndRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epoch !== BigInt(0)) { + writer.uint32(8).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(16).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EpochAndRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEpochAndRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint64(); + break; + case 2: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EpochAndRound { + const message = createBaseEpochAndRound(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EpochAndRoundAmino): EpochAndRound { + const message = createBaseEpochAndRound(); + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EpochAndRound): EpochAndRoundAmino { + const obj: any = {}; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EpochAndRoundAminoMsg): EpochAndRound { + return EpochAndRound.fromAmino(object.value); + }, + fromProtoMsg(message: EpochAndRoundProtoMsg): EpochAndRound { + return EpochAndRound.decode(message.value); + }, + toProto(message: EpochAndRound): Uint8Array { + return EpochAndRound.encode(message).finish(); + }, + toProtoMsg(message: EpochAndRound): EpochAndRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound", + value: EpochAndRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EpochAndRound.typeUrl, EpochAndRound); +function createBaseReport(): Report { + return { + observationsTimestamp: BigInt(0), + observers: new Uint8Array(), + observations: [] + }; +} +export const Report = { + typeUrl: "/injective.ocr.v1beta1.Report", + is(o: any): o is Report { + return o && (o.$typeUrl === Report.typeUrl || typeof o.observationsTimestamp === "bigint" && (o.observers instanceof Uint8Array || typeof o.observers === "string") && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string")); + }, + isAmino(o: any): o is ReportAmino { + return o && (o.$typeUrl === Report.typeUrl || typeof o.observations_timestamp === "bigint" && (o.observers instanceof Uint8Array || typeof o.observers === "string") && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string")); + }, + encode(message: Report, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.observationsTimestamp); + } + if (message.observers.length !== 0) { + writer.uint32(18).bytes(message.observers); + } + for (const v of message.observations) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Report { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.observationsTimestamp = reader.int64(); + break; + case 2: + message.observers = reader.bytes(); + break; + case 3: + message.observations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Report { + const message = createBaseReport(); + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.observers = object.observers ?? new Uint8Array(); + message.observations = object.observations?.map(e => e) || []; + return message; + }, + fromAmino(object: ReportAmino): Report { + const message = createBaseReport(); + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + if (object.observers !== undefined && object.observers !== null) { + message.observers = bytesFromBase64(object.observers); + } + message.observations = object.observations?.map(e => e) || []; + return message; + }, + toAmino(message: Report): ReportAmino { + const obj: any = {}; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + obj.observers = message.observers ? base64FromBytes(message.observers) : undefined; + if (message.observations) { + obj.observations = message.observations.map(e => e); + } else { + obj.observations = message.observations; + } + return obj; + }, + fromAminoMsg(object: ReportAminoMsg): Report { + return Report.fromAmino(object.value); + }, + fromProtoMsg(message: ReportProtoMsg): Report { + return Report.decode(message.value); + }, + toProto(message: Report): Uint8Array { + return Report.encode(message).finish(); + }, + toProtoMsg(message: Report): ReportProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Report", + value: Report.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Report.typeUrl, Report); +function createBaseReportToSign(): ReportToSign { + return { + configDigest: new Uint8Array(), + epoch: BigInt(0), + round: BigInt(0), + extraHash: new Uint8Array(), + report: new Uint8Array() + }; +} +export const ReportToSign = { + typeUrl: "/injective.ocr.v1beta1.ReportToSign", + is(o: any): o is ReportToSign { + return o && (o.$typeUrl === ReportToSign.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extraHash instanceof Uint8Array || typeof o.extraHash === "string") && (o.report instanceof Uint8Array || typeof o.report === "string")); + }, + isAmino(o: any): o is ReportToSignAmino { + return o && (o.$typeUrl === ReportToSign.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extra_hash instanceof Uint8Array || typeof o.extra_hash === "string") && (o.report instanceof Uint8Array || typeof o.report === "string")); + }, + encode(message: ReportToSign, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(16).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + if (message.extraHash.length !== 0) { + writer.uint32(34).bytes(message.extraHash); + } + if (message.report.length !== 0) { + writer.uint32(42).bytes(message.report); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ReportToSign { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReportToSign(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epoch = reader.uint64(); + break; + case 3: + message.round = reader.uint64(); + break; + case 4: + message.extraHash = reader.bytes(); + break; + case 5: + message.report = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ReportToSign { + const message = createBaseReportToSign(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.extraHash = object.extraHash ?? new Uint8Array(); + message.report = object.report ?? new Uint8Array(); + return message; + }, + fromAmino(object: ReportToSignAmino): ReportToSign { + const message = createBaseReportToSign(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.extra_hash !== undefined && object.extra_hash !== null) { + message.extraHash = bytesFromBase64(object.extra_hash); + } + if (object.report !== undefined && object.report !== null) { + message.report = bytesFromBase64(object.report); + } + return message; + }, + toAmino(message: ReportToSign): ReportToSignAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.extra_hash = message.extraHash ? base64FromBytes(message.extraHash) : undefined; + obj.report = message.report ? base64FromBytes(message.report) : undefined; + return obj; + }, + fromAminoMsg(object: ReportToSignAminoMsg): ReportToSign { + return ReportToSign.fromAmino(object.value); + }, + fromProtoMsg(message: ReportToSignProtoMsg): ReportToSign { + return ReportToSign.decode(message.value); + }, + toProto(message: ReportToSign): Uint8Array { + return ReportToSign.encode(message).finish(); + }, + toProtoMsg(message: ReportToSign): ReportToSignProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ReportToSign", + value: ReportToSign.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ReportToSign.typeUrl, ReportToSign); +function createBaseEventOraclePaid(): EventOraclePaid { + return { + transmitterAddr: "", + payeeAddr: "", + amount: Coin.fromPartial({}) + }; +} +export const EventOraclePaid = { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid", + is(o: any): o is EventOraclePaid { + return o && (o.$typeUrl === EventOraclePaid.typeUrl || typeof o.transmitterAddr === "string" && typeof o.payeeAddr === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventOraclePaidAmino { + return o && (o.$typeUrl === EventOraclePaid.typeUrl || typeof o.transmitter_addr === "string" && typeof o.payee_addr === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventOraclePaid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitterAddr !== "") { + writer.uint32(10).string(message.transmitterAddr); + } + if (message.payeeAddr !== "") { + writer.uint32(18).string(message.payeeAddr); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOraclePaid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOraclePaid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitterAddr = reader.string(); + break; + case 2: + message.payeeAddr = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOraclePaid { + const message = createBaseEventOraclePaid(); + message.transmitterAddr = object.transmitterAddr ?? ""; + message.payeeAddr = object.payeeAddr ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventOraclePaidAmino): EventOraclePaid { + const message = createBaseEventOraclePaid(); + if (object.transmitter_addr !== undefined && object.transmitter_addr !== null) { + message.transmitterAddr = object.transmitter_addr; + } + if (object.payee_addr !== undefined && object.payee_addr !== null) { + message.payeeAddr = object.payee_addr; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventOraclePaid): EventOraclePaidAmino { + const obj: any = {}; + obj.transmitter_addr = message.transmitterAddr === "" ? undefined : message.transmitterAddr; + obj.payee_addr = message.payeeAddr === "" ? undefined : message.payeeAddr; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventOraclePaidAminoMsg): EventOraclePaid { + return EventOraclePaid.fromAmino(object.value); + }, + fromProtoMsg(message: EventOraclePaidProtoMsg): EventOraclePaid { + return EventOraclePaid.decode(message.value); + }, + toProto(message: EventOraclePaid): Uint8Array { + return EventOraclePaid.encode(message).finish(); + }, + toProtoMsg(message: EventOraclePaid): EventOraclePaidProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid", + value: EventOraclePaid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOraclePaid.typeUrl, EventOraclePaid); +function createBaseEventAnswerUpdated(): EventAnswerUpdated { + return { + current: "", + roundId: "", + updatedAt: new Date() + }; +} +export const EventAnswerUpdated = { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated", + is(o: any): o is EventAnswerUpdated { + return o && (o.$typeUrl === EventAnswerUpdated.typeUrl || typeof o.current === "string" && typeof o.roundId === "string" && Timestamp.is(o.updatedAt)); + }, + isAmino(o: any): o is EventAnswerUpdatedAmino { + return o && (o.$typeUrl === EventAnswerUpdated.typeUrl || typeof o.current === "string" && typeof o.round_id === "string" && Timestamp.isAmino(o.updated_at)); + }, + encode(message: EventAnswerUpdated, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.current !== "") { + writer.uint32(10).string(message.current); + } + if (message.roundId !== "") { + writer.uint32(18).string(message.roundId); + } + if (message.updatedAt !== undefined) { + Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAnswerUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAnswerUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.current = reader.string(); + break; + case 2: + message.roundId = reader.string(); + break; + case 3: + message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAnswerUpdated { + const message = createBaseEventAnswerUpdated(); + message.current = object.current ?? ""; + message.roundId = object.roundId ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + return message; + }, + fromAmino(object: EventAnswerUpdatedAmino): EventAnswerUpdated { + const message = createBaseEventAnswerUpdated(); + if (object.current !== undefined && object.current !== null) { + message.current = object.current; + } + if (object.round_id !== undefined && object.round_id !== null) { + message.roundId = object.round_id; + } + if (object.updated_at !== undefined && object.updated_at !== null) { + message.updatedAt = fromTimestamp(Timestamp.fromAmino(object.updated_at)); + } + return message; + }, + toAmino(message: EventAnswerUpdated): EventAnswerUpdatedAmino { + const obj: any = {}; + obj.current = message.current === "" ? undefined : message.current; + obj.round_id = message.roundId === "" ? undefined : message.roundId; + obj.updated_at = message.updatedAt ? Timestamp.toAmino(toTimestamp(message.updatedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: EventAnswerUpdatedAminoMsg): EventAnswerUpdated { + return EventAnswerUpdated.fromAmino(object.value); + }, + fromProtoMsg(message: EventAnswerUpdatedProtoMsg): EventAnswerUpdated { + return EventAnswerUpdated.decode(message.value); + }, + toProto(message: EventAnswerUpdated): Uint8Array { + return EventAnswerUpdated.encode(message).finish(); + }, + toProtoMsg(message: EventAnswerUpdated): EventAnswerUpdatedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated", + value: EventAnswerUpdated.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAnswerUpdated.typeUrl, EventAnswerUpdated); +function createBaseEventNewRound(): EventNewRound { + return { + roundId: "", + startedBy: "", + startedAt: new Date() + }; +} +export const EventNewRound = { + typeUrl: "/injective.ocr.v1beta1.EventNewRound", + is(o: any): o is EventNewRound { + return o && (o.$typeUrl === EventNewRound.typeUrl || typeof o.roundId === "string" && typeof o.startedBy === "string" && Timestamp.is(o.startedAt)); + }, + isAmino(o: any): o is EventNewRoundAmino { + return o && (o.$typeUrl === EventNewRound.typeUrl || typeof o.round_id === "string" && typeof o.started_by === "string" && Timestamp.isAmino(o.started_at)); + }, + encode(message: EventNewRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.roundId !== "") { + writer.uint32(10).string(message.roundId); + } + if (message.startedBy !== "") { + writer.uint32(18).string(message.startedBy); + } + if (message.startedAt !== undefined) { + Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.string(); + break; + case 2: + message.startedBy = reader.string(); + break; + case 3: + message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewRound { + const message = createBaseEventNewRound(); + message.roundId = object.roundId ?? ""; + message.startedBy = object.startedBy ?? ""; + message.startedAt = object.startedAt ?? undefined; + return message; + }, + fromAmino(object: EventNewRoundAmino): EventNewRound { + const message = createBaseEventNewRound(); + if (object.round_id !== undefined && object.round_id !== null) { + message.roundId = object.round_id; + } + if (object.started_by !== undefined && object.started_by !== null) { + message.startedBy = object.started_by; + } + if (object.started_at !== undefined && object.started_at !== null) { + message.startedAt = fromTimestamp(Timestamp.fromAmino(object.started_at)); + } + return message; + }, + toAmino(message: EventNewRound): EventNewRoundAmino { + const obj: any = {}; + obj.round_id = message.roundId === "" ? undefined : message.roundId; + obj.started_by = message.startedBy === "" ? undefined : message.startedBy; + obj.started_at = message.startedAt ? Timestamp.toAmino(toTimestamp(message.startedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: EventNewRoundAminoMsg): EventNewRound { + return EventNewRound.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewRoundProtoMsg): EventNewRound { + return EventNewRound.decode(message.value); + }, + toProto(message: EventNewRound): Uint8Array { + return EventNewRound.encode(message).finish(); + }, + toProtoMsg(message: EventNewRound): EventNewRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventNewRound", + value: EventNewRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewRound.typeUrl, EventNewRound); +function createBaseEventTransmitted(): EventTransmitted { + return { + configDigest: new Uint8Array(), + epoch: BigInt(0) + }; +} +export const EventTransmitted = { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted", + is(o: any): o is EventTransmitted { + return o && (o.$typeUrl === EventTransmitted.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.epoch === "bigint"); + }, + isAmino(o: any): o is EventTransmittedAmino { + return o && (o.$typeUrl === EventTransmitted.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.epoch === "bigint"); + }, + encode(message: EventTransmitted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(16).uint64(message.epoch); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTransmitted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTransmitted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epoch = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTransmitted { + const message = createBaseEventTransmitted(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventTransmittedAmino): EventTransmitted { + const message = createBaseEventTransmitted(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + return message; + }, + toAmino(message: EventTransmitted): EventTransmittedAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventTransmittedAminoMsg): EventTransmitted { + return EventTransmitted.fromAmino(object.value); + }, + fromProtoMsg(message: EventTransmittedProtoMsg): EventTransmitted { + return EventTransmitted.decode(message.value); + }, + toProto(message: EventTransmitted): Uint8Array { + return EventTransmitted.encode(message).finish(); + }, + toProtoMsg(message: EventTransmitted): EventTransmittedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted", + value: EventTransmitted.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTransmitted.typeUrl, EventTransmitted); +function createBaseEventNewTransmission(): EventNewTransmission { + return { + feedId: "", + aggregatorRoundId: 0, + answer: "", + transmitter: "", + observationsTimestamp: BigInt(0), + observations: [], + observers: new Uint8Array(), + configDigest: new Uint8Array(), + epochAndRound: undefined + }; +} +export const EventNewTransmission = { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission", + is(o: any): o is EventNewTransmission { + return o && (o.$typeUrl === EventNewTransmission.typeUrl || typeof o.feedId === "string" && typeof o.aggregatorRoundId === "number" && typeof o.answer === "string" && typeof o.transmitter === "string" && typeof o.observationsTimestamp === "bigint" && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string") && (o.observers instanceof Uint8Array || typeof o.observers === "string") && (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string")); + }, + isAmino(o: any): o is EventNewTransmissionAmino { + return o && (o.$typeUrl === EventNewTransmission.typeUrl || typeof o.feed_id === "string" && typeof o.aggregator_round_id === "number" && typeof o.answer === "string" && typeof o.transmitter === "string" && typeof o.observations_timestamp === "bigint" && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string") && (o.observers instanceof Uint8Array || typeof o.observers === "string") && (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string")); + }, + encode(message: EventNewTransmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.aggregatorRoundId !== 0) { + writer.uint32(16).uint32(message.aggregatorRoundId); + } + if (message.answer !== "") { + writer.uint32(26).string(message.answer); + } + if (message.transmitter !== "") { + writer.uint32(34).string(message.transmitter); + } + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.observationsTimestamp); + } + for (const v of message.observations) { + writer.uint32(50).string(v!); + } + if (message.observers.length !== 0) { + writer.uint32(58).bytes(message.observers); + } + if (message.configDigest.length !== 0) { + writer.uint32(66).bytes(message.configDigest); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewTransmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.aggregatorRoundId = reader.uint32(); + break; + case 3: + message.answer = reader.string(); + break; + case 4: + message.transmitter = reader.string(); + break; + case 5: + message.observationsTimestamp = reader.int64(); + break; + case 6: + message.observations.push(reader.string()); + break; + case 7: + message.observers = reader.bytes(); + break; + case 8: + message.configDigest = reader.bytes(); + break; + case 9: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewTransmission { + const message = createBaseEventNewTransmission(); + message.feedId = object.feedId ?? ""; + message.aggregatorRoundId = object.aggregatorRoundId ?? 0; + message.answer = object.answer ?? ""; + message.transmitter = object.transmitter ?? ""; + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.observations = object.observations?.map(e => e) || []; + message.observers = object.observers ?? new Uint8Array(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: EventNewTransmissionAmino): EventNewTransmission { + const message = createBaseEventNewTransmission(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.aggregator_round_id !== undefined && object.aggregator_round_id !== null) { + message.aggregatorRoundId = object.aggregator_round_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + message.observations = object.observations?.map(e => e) || []; + if (object.observers !== undefined && object.observers !== null) { + message.observers = bytesFromBase64(object.observers); + } + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: EventNewTransmission): EventNewTransmissionAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.aggregator_round_id = message.aggregatorRoundId === 0 ? undefined : message.aggregatorRoundId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + if (message.observations) { + obj.observations = message.observations.map(e => e); + } else { + obj.observations = message.observations; + } + obj.observers = message.observers ? base64FromBytes(message.observers) : undefined; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: EventNewTransmissionAminoMsg): EventNewTransmission { + return EventNewTransmission.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewTransmissionProtoMsg): EventNewTransmission { + return EventNewTransmission.decode(message.value); + }, + toProto(message: EventNewTransmission): Uint8Array { + return EventNewTransmission.encode(message).finish(); + }, + toProtoMsg(message: EventNewTransmission): EventNewTransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission", + value: EventNewTransmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewTransmission.typeUrl, EventNewTransmission); +function createBaseEventConfigSet(): EventConfigSet { + return { + configDigest: new Uint8Array(), + previousConfigBlockNumber: BigInt(0), + config: undefined, + configInfo: undefined + }; +} +export const EventConfigSet = { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet", + is(o: any): o is EventConfigSet { + return o && (o.$typeUrl === EventConfigSet.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.previousConfigBlockNumber === "bigint"); + }, + isAmino(o: any): o is EventConfigSetAmino { + return o && (o.$typeUrl === EventConfigSet.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.previous_config_block_number === "bigint"); + }, + encode(message: EventConfigSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.previousConfigBlockNumber !== BigInt(0)) { + writer.uint32(16).int64(message.previousConfigBlockNumber); + } + if (message.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(26).fork()).ldelim(); + } + if (message.configInfo !== undefined) { + FeedConfigInfo.encode(message.configInfo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConfigSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConfigSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.previousConfigBlockNumber = reader.int64(); + break; + case 3: + message.config = FeedConfig.decode(reader, reader.uint32()); + break; + case 4: + message.configInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConfigSet { + const message = createBaseEventConfigSet(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.previousConfigBlockNumber = object.previousConfigBlockNumber !== undefined && object.previousConfigBlockNumber !== null ? BigInt(object.previousConfigBlockNumber.toString()) : BigInt(0); + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + message.configInfo = object.configInfo !== undefined && object.configInfo !== null ? FeedConfigInfo.fromPartial(object.configInfo) : undefined; + return message; + }, + fromAmino(object: EventConfigSetAmino): EventConfigSet { + const message = createBaseEventConfigSet(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.previous_config_block_number !== undefined && object.previous_config_block_number !== null) { + message.previousConfigBlockNumber = BigInt(object.previous_config_block_number); + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + if (object.config_info !== undefined && object.config_info !== null) { + message.configInfo = FeedConfigInfo.fromAmino(object.config_info); + } + return message; + }, + toAmino(message: EventConfigSet): EventConfigSetAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.previous_config_block_number = message.previousConfigBlockNumber !== BigInt(0) ? message.previousConfigBlockNumber?.toString() : undefined; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + obj.config_info = message.configInfo ? FeedConfigInfo.toAmino(message.configInfo) : undefined; + return obj; + }, + fromAminoMsg(object: EventConfigSetAminoMsg): EventConfigSet { + return EventConfigSet.fromAmino(object.value); + }, + fromProtoMsg(message: EventConfigSetProtoMsg): EventConfigSet { + return EventConfigSet.decode(message.value); + }, + toProto(message: EventConfigSet): Uint8Array { + return EventConfigSet.encode(message).finish(); + }, + toProtoMsg(message: EventConfigSet): EventConfigSetProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet", + value: EventConfigSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConfigSet.typeUrl, EventConfigSet); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/ocr/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..4532c505 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/query.rpc.func.ts @@ -0,0 +1,80 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetFeedConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigRequest.encode, + decode: QueryFeedConfigResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfig", + clientResolver +}); +export const useGetFeedConfig = buildUseQuery({ + builderQueryFn: createGetFeedConfig, + queryKeyPrefix: "FeedConfigQuery" +}); +export const createGetFeedConfigInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigInfoRequest.encode, + decode: QueryFeedConfigInfoResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfigInfo", + clientResolver +}); +export const useGetFeedConfigInfo = buildUseQuery({ + builderQueryFn: createGetFeedConfigInfo, + queryKeyPrefix: "FeedConfigInfoQuery" +}); +export const createGetLatestRound = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestRoundRequest.encode, + decode: QueryLatestRoundResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestRound", + clientResolver +}); +export const useGetLatestRound = buildUseQuery({ + builderQueryFn: createGetLatestRound, + queryKeyPrefix: "LatestRoundQuery" +}); +export const createGetLatestTransmissionDetails = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestTransmissionDetailsRequest.encode, + decode: QueryLatestTransmissionDetailsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestTransmissionDetails", + clientResolver +}); +export const useGetLatestTransmissionDetails = buildUseQuery({ + builderQueryFn: createGetLatestTransmissionDetails, + queryKeyPrefix: "LatestTransmissionDetailsQuery" +}); +export const createGetOwedAmount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOwedAmountRequest.encode, + decode: QueryOwedAmountResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OwedAmount", + clientResolver +}); +export const useGetOwedAmount = buildUseQuery({ + builderQueryFn: createGetOwedAmount, + queryKeyPrefix: "OwedAmountQuery" +}); +export const createGetOcrModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OcrModuleState", + clientResolver +}); +export const useGetOcrModuleState = buildUseQuery({ + builderQueryFn: createGetOcrModuleState, + queryKeyPrefix: "OcrModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/query.ts b/libs/injective-query/src/injective/ocr/v1beta1/query.ts new file mode 100644 index 00000000..d4dbcdb8 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/query.ts @@ -0,0 +1,1218 @@ +import { Params, ParamsAmino, FeedConfigInfo, FeedConfigInfoAmino, FeedConfig, FeedConfigAmino, EpochAndRound, EpochAndRoundAmino, Transmission, TransmissionAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +export interface QueryFeedConfigRequest { + feedId: string; +} +export interface QueryFeedConfigRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest"; + value: Uint8Array; +} +export interface QueryFeedConfigRequestAmino { + feed_id: string; +} +export interface QueryFeedConfigRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigRequest"; + value: QueryFeedConfigRequestAmino; +} +export interface QueryFeedConfigResponse { + feedConfigInfo?: FeedConfigInfo; + feedConfig?: FeedConfig; +} +export interface QueryFeedConfigResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse"; + value: Uint8Array; +} +export interface QueryFeedConfigResponseAmino { + feed_config_info?: FeedConfigInfoAmino; + feed_config?: FeedConfigAmino; +} +export interface QueryFeedConfigResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigResponse"; + value: QueryFeedConfigResponseAmino; +} +export interface QueryFeedConfigInfoRequest { + feedId: string; +} +export interface QueryFeedConfigInfoRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest"; + value: Uint8Array; +} +export interface QueryFeedConfigInfoRequestAmino { + feed_id: string; +} +export interface QueryFeedConfigInfoRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest"; + value: QueryFeedConfigInfoRequestAmino; +} +export interface QueryFeedConfigInfoResponse { + feedConfigInfo?: FeedConfigInfo; + epochAndRound?: EpochAndRound; +} +export interface QueryFeedConfigInfoResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse"; + value: Uint8Array; +} +export interface QueryFeedConfigInfoResponseAmino { + feed_config_info?: FeedConfigInfoAmino; + epoch_and_round?: EpochAndRoundAmino; +} +export interface QueryFeedConfigInfoResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse"; + value: QueryFeedConfigInfoResponseAmino; +} +export interface QueryLatestRoundRequest { + feedId: string; +} +export interface QueryLatestRoundRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest"; + value: Uint8Array; +} +export interface QueryLatestRoundRequestAmino { + feed_id: string; +} +export interface QueryLatestRoundRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestRoundRequest"; + value: QueryLatestRoundRequestAmino; +} +export interface QueryLatestRoundResponse { + latestRoundId: bigint; + data?: Transmission; +} +export interface QueryLatestRoundResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse"; + value: Uint8Array; +} +export interface QueryLatestRoundResponseAmino { + latest_round_id: string; + data?: TransmissionAmino; +} +export interface QueryLatestRoundResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestRoundResponse"; + value: QueryLatestRoundResponseAmino; +} +export interface QueryLatestTransmissionDetailsRequest { + feedId: string; +} +export interface QueryLatestTransmissionDetailsRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest"; + value: Uint8Array; +} +export interface QueryLatestTransmissionDetailsRequestAmino { + feed_id: string; +} +export interface QueryLatestTransmissionDetailsRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest"; + value: QueryLatestTransmissionDetailsRequestAmino; +} +export interface QueryLatestTransmissionDetailsResponse { + configDigest: Uint8Array; + epochAndRound?: EpochAndRound; + data?: Transmission; +} +export interface QueryLatestTransmissionDetailsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse"; + value: Uint8Array; +} +export interface QueryLatestTransmissionDetailsResponseAmino { + config_digest: string; + epoch_and_round?: EpochAndRoundAmino; + data?: TransmissionAmino; +} +export interface QueryLatestTransmissionDetailsResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse"; + value: QueryLatestTransmissionDetailsResponseAmino; +} +export interface QueryOwedAmountRequest { + transmitter: string; +} +export interface QueryOwedAmountRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest"; + value: Uint8Array; +} +export interface QueryOwedAmountRequestAmino { + transmitter: string; +} +export interface QueryOwedAmountRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryOwedAmountRequest"; + value: QueryOwedAmountRequestAmino; +} +export interface QueryOwedAmountResponse { + amount: Coin; +} +export interface QueryOwedAmountResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse"; + value: Uint8Array; +} +export interface QueryOwedAmountResponseAmino { + amount: CoinAmino; +} +export interface QueryOwedAmountResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryOwedAmountResponse"; + value: QueryOwedAmountResponseAmino; +} +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryFeedConfigRequest(): QueryFeedConfigRequest { + return { + feedId: "" + }; +} +export const QueryFeedConfigRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest", + is(o: any): o is QueryFeedConfigRequest { + return o && (o.$typeUrl === QueryFeedConfigRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryFeedConfigRequestAmino { + return o && (o.$typeUrl === QueryFeedConfigRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryFeedConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigRequest { + const message = createBaseQueryFeedConfigRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryFeedConfigRequestAmino): QueryFeedConfigRequest { + const message = createBaseQueryFeedConfigRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryFeedConfigRequest): QueryFeedConfigRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigRequestAminoMsg): QueryFeedConfigRequest { + return QueryFeedConfigRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigRequestProtoMsg): QueryFeedConfigRequest { + return QueryFeedConfigRequest.decode(message.value); + }, + toProto(message: QueryFeedConfigRequest): Uint8Array { + return QueryFeedConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigRequest): QueryFeedConfigRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest", + value: QueryFeedConfigRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigRequest.typeUrl, QueryFeedConfigRequest); +function createBaseQueryFeedConfigResponse(): QueryFeedConfigResponse { + return { + feedConfigInfo: undefined, + feedConfig: undefined + }; +} +export const QueryFeedConfigResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse", + is(o: any): o is QueryFeedConfigResponse { + return o && o.$typeUrl === QueryFeedConfigResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeedConfigResponseAmino { + return o && o.$typeUrl === QueryFeedConfigResponse.typeUrl; + }, + encode(message: QueryFeedConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedConfigInfo !== undefined) { + FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.feedConfig !== undefined) { + FeedConfig.encode(message.feedConfig, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedConfigInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + case 2: + message.feedConfig = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigResponse { + const message = createBaseQueryFeedConfigResponse(); + message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined; + message.feedConfig = object.feedConfig !== undefined && object.feedConfig !== null ? FeedConfig.fromPartial(object.feedConfig) : undefined; + return message; + }, + fromAmino(object: QueryFeedConfigResponseAmino): QueryFeedConfigResponse { + const message = createBaseQueryFeedConfigResponse(); + if (object.feed_config_info !== undefined && object.feed_config_info !== null) { + message.feedConfigInfo = FeedConfigInfo.fromAmino(object.feed_config_info); + } + if (object.feed_config !== undefined && object.feed_config !== null) { + message.feedConfig = FeedConfig.fromAmino(object.feed_config); + } + return message; + }, + toAmino(message: QueryFeedConfigResponse): QueryFeedConfigResponseAmino { + const obj: any = {}; + obj.feed_config_info = message.feedConfigInfo ? FeedConfigInfo.toAmino(message.feedConfigInfo) : undefined; + obj.feed_config = message.feedConfig ? FeedConfig.toAmino(message.feedConfig) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigResponseAminoMsg): QueryFeedConfigResponse { + return QueryFeedConfigResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigResponseProtoMsg): QueryFeedConfigResponse { + return QueryFeedConfigResponse.decode(message.value); + }, + toProto(message: QueryFeedConfigResponse): Uint8Array { + return QueryFeedConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigResponse): QueryFeedConfigResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse", + value: QueryFeedConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigResponse.typeUrl, QueryFeedConfigResponse); +function createBaseQueryFeedConfigInfoRequest(): QueryFeedConfigInfoRequest { + return { + feedId: "" + }; +} +export const QueryFeedConfigInfoRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest", + is(o: any): o is QueryFeedConfigInfoRequest { + return o && (o.$typeUrl === QueryFeedConfigInfoRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryFeedConfigInfoRequestAmino { + return o && (o.$typeUrl === QueryFeedConfigInfoRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryFeedConfigInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigInfoRequest { + const message = createBaseQueryFeedConfigInfoRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryFeedConfigInfoRequestAmino): QueryFeedConfigInfoRequest { + const message = createBaseQueryFeedConfigInfoRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryFeedConfigInfoRequest): QueryFeedConfigInfoRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigInfoRequestAminoMsg): QueryFeedConfigInfoRequest { + return QueryFeedConfigInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigInfoRequestProtoMsg): QueryFeedConfigInfoRequest { + return QueryFeedConfigInfoRequest.decode(message.value); + }, + toProto(message: QueryFeedConfigInfoRequest): Uint8Array { + return QueryFeedConfigInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigInfoRequest): QueryFeedConfigInfoRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest", + value: QueryFeedConfigInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigInfoRequest.typeUrl, QueryFeedConfigInfoRequest); +function createBaseQueryFeedConfigInfoResponse(): QueryFeedConfigInfoResponse { + return { + feedConfigInfo: undefined, + epochAndRound: undefined + }; +} +export const QueryFeedConfigInfoResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse", + is(o: any): o is QueryFeedConfigInfoResponse { + return o && o.$typeUrl === QueryFeedConfigInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeedConfigInfoResponseAmino { + return o && o.$typeUrl === QueryFeedConfigInfoResponse.typeUrl; + }, + encode(message: QueryFeedConfigInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedConfigInfo !== undefined) { + FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedConfigInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigInfoResponse { + const message = createBaseQueryFeedConfigInfoResponse(); + message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined; + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: QueryFeedConfigInfoResponseAmino): QueryFeedConfigInfoResponse { + const message = createBaseQueryFeedConfigInfoResponse(); + if (object.feed_config_info !== undefined && object.feed_config_info !== null) { + message.feedConfigInfo = FeedConfigInfo.fromAmino(object.feed_config_info); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: QueryFeedConfigInfoResponse): QueryFeedConfigInfoResponseAmino { + const obj: any = {}; + obj.feed_config_info = message.feedConfigInfo ? FeedConfigInfo.toAmino(message.feedConfigInfo) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigInfoResponseAminoMsg): QueryFeedConfigInfoResponse { + return QueryFeedConfigInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigInfoResponseProtoMsg): QueryFeedConfigInfoResponse { + return QueryFeedConfigInfoResponse.decode(message.value); + }, + toProto(message: QueryFeedConfigInfoResponse): Uint8Array { + return QueryFeedConfigInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigInfoResponse): QueryFeedConfigInfoResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse", + value: QueryFeedConfigInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigInfoResponse.typeUrl, QueryFeedConfigInfoResponse); +function createBaseQueryLatestRoundRequest(): QueryLatestRoundRequest { + return { + feedId: "" + }; +} +export const QueryLatestRoundRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest", + is(o: any): o is QueryLatestRoundRequest { + return o && (o.$typeUrl === QueryLatestRoundRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryLatestRoundRequestAmino { + return o && (o.$typeUrl === QueryLatestRoundRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryLatestRoundRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestRoundRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestRoundRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestRoundRequest { + const message = createBaseQueryLatestRoundRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryLatestRoundRequestAmino): QueryLatestRoundRequest { + const message = createBaseQueryLatestRoundRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryLatestRoundRequest): QueryLatestRoundRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryLatestRoundRequestAminoMsg): QueryLatestRoundRequest { + return QueryLatestRoundRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestRoundRequestProtoMsg): QueryLatestRoundRequest { + return QueryLatestRoundRequest.decode(message.value); + }, + toProto(message: QueryLatestRoundRequest): Uint8Array { + return QueryLatestRoundRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestRoundRequest): QueryLatestRoundRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest", + value: QueryLatestRoundRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestRoundRequest.typeUrl, QueryLatestRoundRequest); +function createBaseQueryLatestRoundResponse(): QueryLatestRoundResponse { + return { + latestRoundId: BigInt(0), + data: undefined + }; +} +export const QueryLatestRoundResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse", + is(o: any): o is QueryLatestRoundResponse { + return o && (o.$typeUrl === QueryLatestRoundResponse.typeUrl || typeof o.latestRoundId === "bigint"); + }, + isAmino(o: any): o is QueryLatestRoundResponseAmino { + return o && (o.$typeUrl === QueryLatestRoundResponse.typeUrl || typeof o.latest_round_id === "bigint"); + }, + encode(message: QueryLatestRoundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.latestRoundId !== BigInt(0)) { + writer.uint32(8).uint64(message.latestRoundId); + } + if (message.data !== undefined) { + Transmission.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestRoundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestRoundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestRoundId = reader.uint64(); + break; + case 2: + message.data = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestRoundResponse { + const message = createBaseQueryLatestRoundResponse(); + message.latestRoundId = object.latestRoundId !== undefined && object.latestRoundId !== null ? BigInt(object.latestRoundId.toString()) : BigInt(0); + message.data = object.data !== undefined && object.data !== null ? Transmission.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: QueryLatestRoundResponseAmino): QueryLatestRoundResponse { + const message = createBaseQueryLatestRoundResponse(); + if (object.latest_round_id !== undefined && object.latest_round_id !== null) { + message.latestRoundId = BigInt(object.latest_round_id); + } + if (object.data !== undefined && object.data !== null) { + message.data = Transmission.fromAmino(object.data); + } + return message; + }, + toAmino(message: QueryLatestRoundResponse): QueryLatestRoundResponseAmino { + const obj: any = {}; + obj.latest_round_id = message.latestRoundId !== BigInt(0) ? message.latestRoundId?.toString() : undefined; + obj.data = message.data ? Transmission.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLatestRoundResponseAminoMsg): QueryLatestRoundResponse { + return QueryLatestRoundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestRoundResponseProtoMsg): QueryLatestRoundResponse { + return QueryLatestRoundResponse.decode(message.value); + }, + toProto(message: QueryLatestRoundResponse): Uint8Array { + return QueryLatestRoundResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestRoundResponse): QueryLatestRoundResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse", + value: QueryLatestRoundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestRoundResponse.typeUrl, QueryLatestRoundResponse); +function createBaseQueryLatestTransmissionDetailsRequest(): QueryLatestTransmissionDetailsRequest { + return { + feedId: "" + }; +} +export const QueryLatestTransmissionDetailsRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest", + is(o: any): o is QueryLatestTransmissionDetailsRequest { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryLatestTransmissionDetailsRequestAmino { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryLatestTransmissionDetailsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestTransmissionDetailsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestTransmissionDetailsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestTransmissionDetailsRequest { + const message = createBaseQueryLatestTransmissionDetailsRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryLatestTransmissionDetailsRequestAmino): QueryLatestTransmissionDetailsRequest { + const message = createBaseQueryLatestTransmissionDetailsRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryLatestTransmissionDetailsRequest): QueryLatestTransmissionDetailsRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryLatestTransmissionDetailsRequestAminoMsg): QueryLatestTransmissionDetailsRequest { + return QueryLatestTransmissionDetailsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestTransmissionDetailsRequestProtoMsg): QueryLatestTransmissionDetailsRequest { + return QueryLatestTransmissionDetailsRequest.decode(message.value); + }, + toProto(message: QueryLatestTransmissionDetailsRequest): Uint8Array { + return QueryLatestTransmissionDetailsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestTransmissionDetailsRequest): QueryLatestTransmissionDetailsRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest", + value: QueryLatestTransmissionDetailsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestTransmissionDetailsRequest.typeUrl, QueryLatestTransmissionDetailsRequest); +function createBaseQueryLatestTransmissionDetailsResponse(): QueryLatestTransmissionDetailsResponse { + return { + configDigest: new Uint8Array(), + epochAndRound: undefined, + data: undefined + }; +} +export const QueryLatestTransmissionDetailsResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse", + is(o: any): o is QueryLatestTransmissionDetailsResponse { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsResponse.typeUrl || o.configDigest instanceof Uint8Array || typeof o.configDigest === "string"); + }, + isAmino(o: any): o is QueryLatestTransmissionDetailsResponseAmino { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsResponse.typeUrl || o.config_digest instanceof Uint8Array || typeof o.config_digest === "string"); + }, + encode(message: QueryLatestTransmissionDetailsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + if (message.data !== undefined) { + Transmission.encode(message.data, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestTransmissionDetailsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestTransmissionDetailsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + case 3: + message.data = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestTransmissionDetailsResponse { + const message = createBaseQueryLatestTransmissionDetailsResponse(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + message.data = object.data !== undefined && object.data !== null ? Transmission.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: QueryLatestTransmissionDetailsResponseAmino): QueryLatestTransmissionDetailsResponse { + const message = createBaseQueryLatestTransmissionDetailsResponse(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + if (object.data !== undefined && object.data !== null) { + message.data = Transmission.fromAmino(object.data); + } + return message; + }, + toAmino(message: QueryLatestTransmissionDetailsResponse): QueryLatestTransmissionDetailsResponseAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + obj.data = message.data ? Transmission.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLatestTransmissionDetailsResponseAminoMsg): QueryLatestTransmissionDetailsResponse { + return QueryLatestTransmissionDetailsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestTransmissionDetailsResponseProtoMsg): QueryLatestTransmissionDetailsResponse { + return QueryLatestTransmissionDetailsResponse.decode(message.value); + }, + toProto(message: QueryLatestTransmissionDetailsResponse): Uint8Array { + return QueryLatestTransmissionDetailsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestTransmissionDetailsResponse): QueryLatestTransmissionDetailsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse", + value: QueryLatestTransmissionDetailsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestTransmissionDetailsResponse.typeUrl, QueryLatestTransmissionDetailsResponse); +function createBaseQueryOwedAmountRequest(): QueryOwedAmountRequest { + return { + transmitter: "" + }; +} +export const QueryOwedAmountRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest", + is(o: any): o is QueryOwedAmountRequest { + return o && (o.$typeUrl === QueryOwedAmountRequest.typeUrl || typeof o.transmitter === "string"); + }, + isAmino(o: any): o is QueryOwedAmountRequestAmino { + return o && (o.$typeUrl === QueryOwedAmountRequest.typeUrl || typeof o.transmitter === "string"); + }, + encode(message: QueryOwedAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitter !== "") { + writer.uint32(10).string(message.transmitter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwedAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwedAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOwedAmountRequest { + const message = createBaseQueryOwedAmountRequest(); + message.transmitter = object.transmitter ?? ""; + return message; + }, + fromAmino(object: QueryOwedAmountRequestAmino): QueryOwedAmountRequest { + const message = createBaseQueryOwedAmountRequest(); + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + return message; + }, + toAmino(message: QueryOwedAmountRequest): QueryOwedAmountRequestAmino { + const obj: any = {}; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + return obj; + }, + fromAminoMsg(object: QueryOwedAmountRequestAminoMsg): QueryOwedAmountRequest { + return QueryOwedAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwedAmountRequestProtoMsg): QueryOwedAmountRequest { + return QueryOwedAmountRequest.decode(message.value); + }, + toProto(message: QueryOwedAmountRequest): Uint8Array { + return QueryOwedAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOwedAmountRequest): QueryOwedAmountRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest", + value: QueryOwedAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOwedAmountRequest.typeUrl, QueryOwedAmountRequest); +function createBaseQueryOwedAmountResponse(): QueryOwedAmountResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryOwedAmountResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse", + is(o: any): o is QueryOwedAmountResponse { + return o && (o.$typeUrl === QueryOwedAmountResponse.typeUrl || Coin.is(o.amount)); + }, + isAmino(o: any): o is QueryOwedAmountResponseAmino { + return o && (o.$typeUrl === QueryOwedAmountResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QueryOwedAmountResponse, 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): QueryOwedAmountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwedAmountResponse(); + 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: DeepPartial): QueryOwedAmountResponse { + const message = createBaseQueryOwedAmountResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryOwedAmountResponseAmino): QueryOwedAmountResponse { + const message = createBaseQueryOwedAmountResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryOwedAmountResponse): QueryOwedAmountResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOwedAmountResponseAminoMsg): QueryOwedAmountResponse { + return QueryOwedAmountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwedAmountResponseProtoMsg): QueryOwedAmountResponse { + return QueryOwedAmountResponse.decode(message.value); + }, + toProto(message: QueryOwedAmountResponse): Uint8Array { + return QueryOwedAmountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOwedAmountResponse): QueryOwedAmountResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse", + value: QueryOwedAmountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOwedAmountResponse.typeUrl, QueryOwedAmountResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/ocr/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..adda4af6 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/tx.rpc.func.ts @@ -0,0 +1,85 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; +export const createCreateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateFeed.typeUrl, + encoders: toEncoders(MsgCreateFeed), + converters: toConverters(MsgCreateFeed) +}); +export const useCreateFeed = buildUseMutation({ + builderMutationFn: createCreateFeed +}); +export const createUpdateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateFeed.typeUrl, + encoders: toEncoders(MsgUpdateFeed), + converters: toConverters(MsgUpdateFeed) +}); +export const useUpdateFeed = buildUseMutation({ + builderMutationFn: createUpdateFeed +}); +export const createTransmit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransmit.typeUrl, + encoders: toEncoders(MsgTransmit), + converters: toConverters(MsgTransmit) +}); +export const useTransmit = buildUseMutation({ + builderMutationFn: createTransmit +}); +export const createFundFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundFeedRewardPool.typeUrl, + encoders: toEncoders(MsgFundFeedRewardPool), + converters: toConverters(MsgFundFeedRewardPool) +}); +export const useFundFeedRewardPool = buildUseMutation({ + builderMutationFn: createFundFeedRewardPool +}); +export const createWithdrawFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawFeedRewardPool.typeUrl, + encoders: toEncoders(MsgWithdrawFeedRewardPool), + converters: toConverters(MsgWithdrawFeedRewardPool) +}); +export const useWithdrawFeedRewardPool = buildUseMutation({ + builderMutationFn: createWithdrawFeedRewardPool +}); +export const createSetPayees = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetPayees.typeUrl, + encoders: toEncoders(MsgSetPayees), + converters: toConverters(MsgSetPayees) +}); +export const useSetPayees = buildUseMutation({ + builderMutationFn: createSetPayees +}); +export const createTransferPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransferPayeeship.typeUrl, + encoders: toEncoders(MsgTransferPayeeship), + converters: toConverters(MsgTransferPayeeship) +}); +export const useTransferPayeeship = buildUseMutation({ + builderMutationFn: createTransferPayeeship +}); +export const createAcceptPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcceptPayeeship.typeUrl, + encoders: toEncoders(MsgAcceptPayeeship), + converters: toConverters(MsgAcceptPayeeship) +}); +export const useAcceptPayeeship = buildUseMutation({ + builderMutationFn: createAcceptPayeeship +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/ocr/v1beta1/tx.ts b/libs/injective-query/src/injective/ocr/v1beta1/tx.ts new file mode 100644 index 00000000..d26b2a17 --- /dev/null +++ b/libs/injective-query/src/injective/ocr/v1beta1/tx.ts @@ -0,0 +1,1900 @@ +import { FeedConfig, FeedConfigAmino, Report, ReportAmino, Params, ParamsAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgCreateFeed { + sender: string; + config?: FeedConfig; +} +export interface MsgCreateFeedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed"; + value: Uint8Array; +} +export interface MsgCreateFeedAmino { + sender: string; + config?: FeedConfigAmino; +} +export interface MsgCreateFeedAminoMsg { + type: "ocr/MsgCreateFeed"; + value: MsgCreateFeedAmino; +} +export interface MsgCreateFeedResponse {} +export interface MsgCreateFeedResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse"; + value: Uint8Array; +} +export interface MsgCreateFeedResponseAmino {} +export interface MsgCreateFeedResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgCreateFeedResponse"; + value: MsgCreateFeedResponseAmino; +} +export interface MsgUpdateFeed { + sender: string; + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Fixed LINK reward for each observer */ + linkPerObservation?: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission?: string; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** feed administrator */ + feedAdmin: string; + /** feed billing administrator */ + billingAdmin: string; +} +export interface MsgUpdateFeedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed"; + value: Uint8Array; +} +export interface MsgUpdateFeedAmino { + sender: string; + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Fixed LINK reward for each observer */ + link_per_observation?: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission?: string; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** feed administrator */ + feed_admin: string; + /** feed billing administrator */ + billing_admin: string; +} +export interface MsgUpdateFeedAminoMsg { + type: "ocr/MsgUpdateFeed"; + value: MsgUpdateFeedAmino; +} +export interface MsgUpdateFeedResponse {} +export interface MsgUpdateFeedResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse"; + value: Uint8Array; +} +export interface MsgUpdateFeedResponseAmino {} +export interface MsgUpdateFeedResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgUpdateFeedResponse"; + value: MsgUpdateFeedResponseAmino; +} +export interface MsgTransmit { + /** Address of the transmitter */ + transmitter: string; + configDigest: Uint8Array; + feedId: string; + epoch: bigint; + round: bigint; + extraHash: Uint8Array; + report?: Report; + signatures: Uint8Array[]; +} +export interface MsgTransmitProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit"; + value: Uint8Array; +} +export interface MsgTransmitAmino { + /** Address of the transmitter */ + transmitter: string; + config_digest: string; + feed_id: string; + epoch: string; + round: string; + extra_hash: string; + report?: ReportAmino; + signatures: string[]; +} +export interface MsgTransmitAminoMsg { + type: "ocr/MsgTransmit"; + value: MsgTransmitAmino; +} +export interface MsgTransmitResponse {} +export interface MsgTransmitResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse"; + value: Uint8Array; +} +export interface MsgTransmitResponseAmino {} +export interface MsgTransmitResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgTransmitResponse"; + value: MsgTransmitResponseAmino; +} +export interface MsgFundFeedRewardPool { + sender: string; + feedId: string; + amount: Coin; +} +export interface MsgFundFeedRewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool"; + value: Uint8Array; +} +export interface MsgFundFeedRewardPoolAmino { + sender: string; + feed_id: string; + amount: CoinAmino; +} +export interface MsgFundFeedRewardPoolAminoMsg { + type: "ocr/MsgFundFeedRewardPool"; + value: MsgFundFeedRewardPoolAmino; +} +export interface MsgFundFeedRewardPoolResponse {} +export interface MsgFundFeedRewardPoolResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse"; + value: Uint8Array; +} +export interface MsgFundFeedRewardPoolResponseAmino {} +export interface MsgFundFeedRewardPoolResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse"; + value: MsgFundFeedRewardPoolResponseAmino; +} +export interface MsgWithdrawFeedRewardPool { + sender: string; + feedId: string; + amount: Coin; +} +export interface MsgWithdrawFeedRewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool"; + value: Uint8Array; +} +export interface MsgWithdrawFeedRewardPoolAmino { + sender: string; + feed_id: string; + amount: CoinAmino; +} +export interface MsgWithdrawFeedRewardPoolAminoMsg { + type: "ocr/MsgWithdrawFeedRewardPool"; + value: MsgWithdrawFeedRewardPoolAmino; +} +export interface MsgWithdrawFeedRewardPoolResponse {} +export interface MsgWithdrawFeedRewardPoolResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse"; + value: Uint8Array; +} +export interface MsgWithdrawFeedRewardPoolResponseAmino {} +export interface MsgWithdrawFeedRewardPoolResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse"; + value: MsgWithdrawFeedRewardPoolResponseAmino; +} +export interface MsgSetPayees { + sender: string; + feedId: string; + /** addresses oracles use to transmit the reports */ + transmitters: string[]; + /** addresses of payees corresponding to list of transmitters */ + payees: string[]; +} +export interface MsgSetPayeesProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees"; + value: Uint8Array; +} +export interface MsgSetPayeesAmino { + sender: string; + feed_id: string; + /** addresses oracles use to transmit the reports */ + transmitters: string[]; + /** addresses of payees corresponding to list of transmitters */ + payees: string[]; +} +export interface MsgSetPayeesAminoMsg { + type: "ocr/MsgSetPayees"; + value: MsgSetPayeesAmino; +} +export interface MsgSetPayeesResponse {} +export interface MsgSetPayeesResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse"; + value: Uint8Array; +} +export interface MsgSetPayeesResponseAmino {} +export interface MsgSetPayeesResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgSetPayeesResponse"; + value: MsgSetPayeesResponseAmino; +} +export interface MsgTransferPayeeship { + /** transmitter address of oracle whose payee is changing */ + sender: string; + transmitter: string; + feedId: string; + /** new payee address */ + proposed: string; +} +export interface MsgTransferPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship"; + value: Uint8Array; +} +export interface MsgTransferPayeeshipAmino { + /** transmitter address of oracle whose payee is changing */ + sender: string; + transmitter: string; + feed_id: string; + /** new payee address */ + proposed: string; +} +export interface MsgTransferPayeeshipAminoMsg { + type: "ocr/MsgTransferPayeeship"; + value: MsgTransferPayeeshipAmino; +} +export interface MsgTransferPayeeshipResponse {} +export interface MsgTransferPayeeshipResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse"; + value: Uint8Array; +} +export interface MsgTransferPayeeshipResponseAmino {} +export interface MsgTransferPayeeshipResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse"; + value: MsgTransferPayeeshipResponseAmino; +} +export interface MsgAcceptPayeeship { + /** new payee address */ + payee: string; + /** transmitter address of oracle whose payee is changing */ + transmitter: string; + feedId: string; +} +export interface MsgAcceptPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship"; + value: Uint8Array; +} +export interface MsgAcceptPayeeshipAmino { + /** new payee address */ + payee: string; + /** transmitter address of oracle whose payee is changing */ + transmitter: string; + feed_id: string; +} +export interface MsgAcceptPayeeshipAminoMsg { + type: "ocr/MsgAcceptPayeeship"; + value: MsgAcceptPayeeshipAmino; +} +export interface MsgAcceptPayeeshipResponse {} +export interface MsgAcceptPayeeshipResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse"; + value: Uint8Array; +} +export interface MsgAcceptPayeeshipResponseAmino {} +export interface MsgAcceptPayeeshipResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse"; + value: MsgAcceptPayeeshipResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "ocr/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateFeed(): MsgCreateFeed { + return { + sender: "", + config: undefined + }; +} +export const MsgCreateFeed = { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed", + aminoType: "ocr/MsgCreateFeed", + is(o: any): o is MsgCreateFeed { + return o && (o.$typeUrl === MsgCreateFeed.typeUrl || typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCreateFeedAmino { + return o && (o.$typeUrl === MsgCreateFeed.typeUrl || typeof o.sender === "string"); + }, + encode(message: MsgCreateFeed, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateFeed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateFeed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.config = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateFeed { + const message = createBaseMsgCreateFeed(); + message.sender = object.sender ?? ""; + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: MsgCreateFeedAmino): MsgCreateFeed { + const message = createBaseMsgCreateFeed(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + return message; + }, + toAmino(message: MsgCreateFeed): MsgCreateFeedAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateFeedAminoMsg): MsgCreateFeed { + return MsgCreateFeed.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateFeed): MsgCreateFeedAminoMsg { + return { + type: "ocr/MsgCreateFeed", + value: MsgCreateFeed.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateFeedProtoMsg): MsgCreateFeed { + return MsgCreateFeed.decode(message.value); + }, + toProto(message: MsgCreateFeed): Uint8Array { + return MsgCreateFeed.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateFeed): MsgCreateFeedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed", + value: MsgCreateFeed.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateFeed.typeUrl, MsgCreateFeed); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateFeed.aminoType, MsgCreateFeed.typeUrl); +function createBaseMsgCreateFeedResponse(): MsgCreateFeedResponse { + return {}; +} +export const MsgCreateFeedResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse", + is(o: any): o is MsgCreateFeedResponse { + return o && o.$typeUrl === MsgCreateFeedResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateFeedResponseAmino { + return o && o.$typeUrl === MsgCreateFeedResponse.typeUrl; + }, + encode(_: MsgCreateFeedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateFeedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateFeedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateFeedResponse { + const message = createBaseMsgCreateFeedResponse(); + return message; + }, + fromAmino(_: MsgCreateFeedResponseAmino): MsgCreateFeedResponse { + const message = createBaseMsgCreateFeedResponse(); + return message; + }, + toAmino(_: MsgCreateFeedResponse): MsgCreateFeedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateFeedResponseAminoMsg): MsgCreateFeedResponse { + return MsgCreateFeedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateFeedResponseProtoMsg): MsgCreateFeedResponse { + return MsgCreateFeedResponse.decode(message.value); + }, + toProto(message: MsgCreateFeedResponse): Uint8Array { + return MsgCreateFeedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateFeedResponse): MsgCreateFeedResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse", + value: MsgCreateFeedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateFeedResponse.typeUrl, MsgCreateFeedResponse); +function createBaseMsgUpdateFeed(): MsgUpdateFeed { + return { + sender: "", + feedId: "", + signers: [], + transmitters: [], + linkPerObservation: undefined, + linkPerTransmission: undefined, + linkDenom: "", + feedAdmin: "", + billingAdmin: "" + }; +} +export const MsgUpdateFeed = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed", + aminoType: "ocr/MsgUpdateFeed", + is(o: any): o is MsgUpdateFeed { + return o && (o.$typeUrl === MsgUpdateFeed.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.linkDenom === "string" && typeof o.feedAdmin === "string" && typeof o.billingAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateFeedAmino { + return o && (o.$typeUrl === MsgUpdateFeed.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.link_denom === "string" && typeof o.feed_admin === "string" && typeof o.billing_admin === "string"); + }, + encode(message: MsgUpdateFeed, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + for (const v of message.signers) { + writer.uint32(26).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(34).string(v!); + } + if (message.linkPerObservation !== undefined) { + writer.uint32(42).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== undefined) { + writer.uint32(50).string(message.linkPerTransmission); + } + if (message.linkDenom !== "") { + writer.uint32(58).string(message.linkDenom); + } + if (message.feedAdmin !== "") { + writer.uint32(66).string(message.feedAdmin); + } + if (message.billingAdmin !== "") { + writer.uint32(74).string(message.billingAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateFeed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateFeed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.signers.push(reader.string()); + break; + case 4: + message.transmitters.push(reader.string()); + break; + case 5: + message.linkPerObservation = reader.string(); + break; + case 6: + message.linkPerTransmission = reader.string(); + break; + case 7: + message.linkDenom = reader.string(); + break; + case 8: + message.feedAdmin = reader.string(); + break; + case 9: + message.billingAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateFeed { + const message = createBaseMsgUpdateFeed(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.linkPerObservation = object.linkPerObservation ?? undefined; + message.linkPerTransmission = object.linkPerTransmission ?? undefined; + message.linkDenom = object.linkDenom ?? ""; + message.feedAdmin = object.feedAdmin ?? ""; + message.billingAdmin = object.billingAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateFeedAmino): MsgUpdateFeed { + const message = createBaseMsgUpdateFeed(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.feed_admin !== undefined && object.feed_admin !== null) { + message.feedAdmin = object.feed_admin; + } + if (object.billing_admin !== undefined && object.billing_admin !== null) { + message.billingAdmin = object.billing_admin; + } + return message; + }, + toAmino(message: MsgUpdateFeed): MsgUpdateFeedAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.link_per_observation = message.linkPerObservation === null ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === null ? undefined : message.linkPerTransmission; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.feed_admin = message.feedAdmin === "" ? undefined : message.feedAdmin; + obj.billing_admin = message.billingAdmin === "" ? undefined : message.billingAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateFeedAminoMsg): MsgUpdateFeed { + return MsgUpdateFeed.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateFeed): MsgUpdateFeedAminoMsg { + return { + type: "ocr/MsgUpdateFeed", + value: MsgUpdateFeed.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateFeedProtoMsg): MsgUpdateFeed { + return MsgUpdateFeed.decode(message.value); + }, + toProto(message: MsgUpdateFeed): Uint8Array { + return MsgUpdateFeed.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateFeed): MsgUpdateFeedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed", + value: MsgUpdateFeed.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateFeed.typeUrl, MsgUpdateFeed); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateFeed.aminoType, MsgUpdateFeed.typeUrl); +function createBaseMsgUpdateFeedResponse(): MsgUpdateFeedResponse { + return {}; +} +export const MsgUpdateFeedResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse", + is(o: any): o is MsgUpdateFeedResponse { + return o && o.$typeUrl === MsgUpdateFeedResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateFeedResponseAmino { + return o && o.$typeUrl === MsgUpdateFeedResponse.typeUrl; + }, + encode(_: MsgUpdateFeedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateFeedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateFeedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateFeedResponse { + const message = createBaseMsgUpdateFeedResponse(); + return message; + }, + fromAmino(_: MsgUpdateFeedResponseAmino): MsgUpdateFeedResponse { + const message = createBaseMsgUpdateFeedResponse(); + return message; + }, + toAmino(_: MsgUpdateFeedResponse): MsgUpdateFeedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateFeedResponseAminoMsg): MsgUpdateFeedResponse { + return MsgUpdateFeedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateFeedResponseProtoMsg): MsgUpdateFeedResponse { + return MsgUpdateFeedResponse.decode(message.value); + }, + toProto(message: MsgUpdateFeedResponse): Uint8Array { + return MsgUpdateFeedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateFeedResponse): MsgUpdateFeedResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse", + value: MsgUpdateFeedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateFeedResponse.typeUrl, MsgUpdateFeedResponse); +function createBaseMsgTransmit(): MsgTransmit { + return { + transmitter: "", + configDigest: new Uint8Array(), + feedId: "", + epoch: BigInt(0), + round: BigInt(0), + extraHash: new Uint8Array(), + report: undefined, + signatures: [] + }; +} +export const MsgTransmit = { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit", + aminoType: "ocr/MsgTransmit", + is(o: any): o is MsgTransmit { + return o && (o.$typeUrl === MsgTransmit.typeUrl || typeof o.transmitter === "string" && (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.feedId === "string" && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extraHash instanceof Uint8Array || typeof o.extraHash === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MsgTransmitAmino { + return o && (o.$typeUrl === MsgTransmit.typeUrl || typeof o.transmitter === "string" && (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.feed_id === "string" && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extra_hash instanceof Uint8Array || typeof o.extra_hash === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MsgTransmit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitter !== "") { + writer.uint32(10).string(message.transmitter); + } + if (message.configDigest.length !== 0) { + writer.uint32(18).bytes(message.configDigest); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(32).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(40).uint64(message.round); + } + if (message.extraHash.length !== 0) { + writer.uint32(50).bytes(message.extraHash); + } + if (message.report !== undefined) { + Report.encode(message.report, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(66).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransmit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransmit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitter = reader.string(); + break; + case 2: + message.configDigest = reader.bytes(); + break; + case 3: + message.feedId = reader.string(); + break; + case 4: + message.epoch = reader.uint64(); + break; + case 5: + message.round = reader.uint64(); + break; + case 6: + message.extraHash = reader.bytes(); + break; + case 7: + message.report = Report.decode(reader, reader.uint32()); + break; + case 8: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransmit { + const message = createBaseMsgTransmit(); + message.transmitter = object.transmitter ?? ""; + message.configDigest = object.configDigest ?? new Uint8Array(); + message.feedId = object.feedId ?? ""; + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.extraHash = object.extraHash ?? new Uint8Array(); + message.report = object.report !== undefined && object.report !== null ? Report.fromPartial(object.report) : undefined; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgTransmitAmino): MsgTransmit { + const message = createBaseMsgTransmit(); + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.extra_hash !== undefined && object.extra_hash !== null) { + message.extraHash = bytesFromBase64(object.extra_hash); + } + if (object.report !== undefined && object.report !== null) { + message.report = Report.fromAmino(object.report); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgTransmit): MsgTransmitAmino { + const obj: any = {}; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.extra_hash = message.extraHash ? base64FromBytes(message.extraHash) : undefined; + obj.report = message.report ? Report.toAmino(message.report) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MsgTransmitAminoMsg): MsgTransmit { + return MsgTransmit.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransmit): MsgTransmitAminoMsg { + return { + type: "ocr/MsgTransmit", + value: MsgTransmit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransmitProtoMsg): MsgTransmit { + return MsgTransmit.decode(message.value); + }, + toProto(message: MsgTransmit): Uint8Array { + return MsgTransmit.encode(message).finish(); + }, + toProtoMsg(message: MsgTransmit): MsgTransmitProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit", + value: MsgTransmit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransmit.typeUrl, MsgTransmit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransmit.aminoType, MsgTransmit.typeUrl); +function createBaseMsgTransmitResponse(): MsgTransmitResponse { + return {}; +} +export const MsgTransmitResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse", + is(o: any): o is MsgTransmitResponse { + return o && o.$typeUrl === MsgTransmitResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransmitResponseAmino { + return o && o.$typeUrl === MsgTransmitResponse.typeUrl; + }, + encode(_: MsgTransmitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransmitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransmitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgTransmitResponse { + const message = createBaseMsgTransmitResponse(); + return message; + }, + fromAmino(_: MsgTransmitResponseAmino): MsgTransmitResponse { + const message = createBaseMsgTransmitResponse(); + return message; + }, + toAmino(_: MsgTransmitResponse): MsgTransmitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransmitResponseAminoMsg): MsgTransmitResponse { + return MsgTransmitResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransmitResponseProtoMsg): MsgTransmitResponse { + return MsgTransmitResponse.decode(message.value); + }, + toProto(message: MsgTransmitResponse): Uint8Array { + return MsgTransmitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransmitResponse): MsgTransmitResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse", + value: MsgTransmitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransmitResponse.typeUrl, MsgTransmitResponse); +function createBaseMsgFundFeedRewardPool(): MsgFundFeedRewardPool { + return { + sender: "", + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgFundFeedRewardPool = { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool", + aminoType: "ocr/MsgFundFeedRewardPool", + is(o: any): o is MsgFundFeedRewardPool { + return o && (o.$typeUrl === MsgFundFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgFundFeedRewardPoolAmino { + return o && (o.$typeUrl === MsgFundFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgFundFeedRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundFeedRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundFeedRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgFundFeedRewardPool { + const message = createBaseMsgFundFeedRewardPool(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgFundFeedRewardPoolAmino): MsgFundFeedRewardPool { + const message = createBaseMsgFundFeedRewardPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgFundFeedRewardPoolAminoMsg): MsgFundFeedRewardPool { + return MsgFundFeedRewardPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolAminoMsg { + return { + type: "ocr/MsgFundFeedRewardPool", + value: MsgFundFeedRewardPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundFeedRewardPoolProtoMsg): MsgFundFeedRewardPool { + return MsgFundFeedRewardPool.decode(message.value); + }, + toProto(message: MsgFundFeedRewardPool): Uint8Array { + return MsgFundFeedRewardPool.encode(message).finish(); + }, + toProtoMsg(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool", + value: MsgFundFeedRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundFeedRewardPool.typeUrl, MsgFundFeedRewardPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundFeedRewardPool.aminoType, MsgFundFeedRewardPool.typeUrl); +function createBaseMsgFundFeedRewardPoolResponse(): MsgFundFeedRewardPoolResponse { + return {}; +} +export const MsgFundFeedRewardPoolResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse", + is(o: any): o is MsgFundFeedRewardPoolResponse { + return o && o.$typeUrl === MsgFundFeedRewardPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgFundFeedRewardPoolResponseAmino { + return o && o.$typeUrl === MsgFundFeedRewardPoolResponse.typeUrl; + }, + encode(_: MsgFundFeedRewardPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundFeedRewardPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundFeedRewardPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgFundFeedRewardPoolResponse { + const message = createBaseMsgFundFeedRewardPoolResponse(); + return message; + }, + fromAmino(_: MsgFundFeedRewardPoolResponseAmino): MsgFundFeedRewardPoolResponse { + const message = createBaseMsgFundFeedRewardPoolResponse(); + return message; + }, + toAmino(_: MsgFundFeedRewardPoolResponse): MsgFundFeedRewardPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgFundFeedRewardPoolResponseAminoMsg): MsgFundFeedRewardPoolResponse { + return MsgFundFeedRewardPoolResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgFundFeedRewardPoolResponseProtoMsg): MsgFundFeedRewardPoolResponse { + return MsgFundFeedRewardPoolResponse.decode(message.value); + }, + toProto(message: MsgFundFeedRewardPoolResponse): Uint8Array { + return MsgFundFeedRewardPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgFundFeedRewardPoolResponse): MsgFundFeedRewardPoolResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse", + value: MsgFundFeedRewardPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundFeedRewardPoolResponse.typeUrl, MsgFundFeedRewardPoolResponse); +function createBaseMsgWithdrawFeedRewardPool(): MsgWithdrawFeedRewardPool { + return { + sender: "", + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgWithdrawFeedRewardPool = { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool", + aminoType: "ocr/MsgWithdrawFeedRewardPool", + is(o: any): o is MsgWithdrawFeedRewardPool { + return o && (o.$typeUrl === MsgWithdrawFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgWithdrawFeedRewardPoolAmino { + return o && (o.$typeUrl === MsgWithdrawFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgWithdrawFeedRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFeedRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFeedRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawFeedRewardPool { + const message = createBaseMsgWithdrawFeedRewardPool(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgWithdrawFeedRewardPoolAmino): MsgWithdrawFeedRewardPool { + const message = createBaseMsgWithdrawFeedRewardPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFeedRewardPoolAminoMsg): MsgWithdrawFeedRewardPool { + return MsgWithdrawFeedRewardPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolAminoMsg { + return { + type: "ocr/MsgWithdrawFeedRewardPool", + value: MsgWithdrawFeedRewardPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawFeedRewardPoolProtoMsg): MsgWithdrawFeedRewardPool { + return MsgWithdrawFeedRewardPool.decode(message.value); + }, + toProto(message: MsgWithdrawFeedRewardPool): Uint8Array { + return MsgWithdrawFeedRewardPool.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool", + value: MsgWithdrawFeedRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawFeedRewardPool.typeUrl, MsgWithdrawFeedRewardPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawFeedRewardPool.aminoType, MsgWithdrawFeedRewardPool.typeUrl); +function createBaseMsgWithdrawFeedRewardPoolResponse(): MsgWithdrawFeedRewardPoolResponse { + return {}; +} +export const MsgWithdrawFeedRewardPoolResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse", + is(o: any): o is MsgWithdrawFeedRewardPoolResponse { + return o && o.$typeUrl === MsgWithdrawFeedRewardPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawFeedRewardPoolResponseAmino { + return o && o.$typeUrl === MsgWithdrawFeedRewardPoolResponse.typeUrl; + }, + encode(_: MsgWithdrawFeedRewardPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFeedRewardPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawFeedRewardPoolResponse { + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + return message; + }, + fromAmino(_: MsgWithdrawFeedRewardPoolResponseAmino): MsgWithdrawFeedRewardPoolResponse { + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + return message; + }, + toAmino(_: MsgWithdrawFeedRewardPoolResponse): MsgWithdrawFeedRewardPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFeedRewardPoolResponseAminoMsg): MsgWithdrawFeedRewardPoolResponse { + return MsgWithdrawFeedRewardPoolResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawFeedRewardPoolResponseProtoMsg): MsgWithdrawFeedRewardPoolResponse { + return MsgWithdrawFeedRewardPoolResponse.decode(message.value); + }, + toProto(message: MsgWithdrawFeedRewardPoolResponse): Uint8Array { + return MsgWithdrawFeedRewardPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFeedRewardPoolResponse): MsgWithdrawFeedRewardPoolResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse", + value: MsgWithdrawFeedRewardPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawFeedRewardPoolResponse.typeUrl, MsgWithdrawFeedRewardPoolResponse); +function createBaseMsgSetPayees(): MsgSetPayees { + return { + sender: "", + feedId: "", + transmitters: [], + payees: [] + }; +} +export const MsgSetPayees = { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees", + aminoType: "ocr/MsgSetPayees", + is(o: any): o is MsgSetPayees { + return o && (o.$typeUrl === MsgSetPayees.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && Array.isArray(o.payees) && (!o.payees.length || typeof o.payees[0] === "string")); + }, + isAmino(o: any): o is MsgSetPayeesAmino { + return o && (o.$typeUrl === MsgSetPayees.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && Array.isArray(o.payees) && (!o.payees.length || typeof o.payees[0] === "string")); + }, + encode(message: MsgSetPayees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + for (const v of message.transmitters) { + writer.uint32(26).string(v!); + } + for (const v of message.payees) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPayees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetPayees(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.transmitters.push(reader.string()); + break; + case 4: + message.payees.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetPayees { + const message = createBaseMsgSetPayees(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.transmitters = object.transmitters?.map(e => e) || []; + message.payees = object.payees?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgSetPayeesAmino): MsgSetPayees { + const message = createBaseMsgSetPayees(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.transmitters = object.transmitters?.map(e => e) || []; + message.payees = object.payees?.map(e => e) || []; + return message; + }, + toAmino(message: MsgSetPayees): MsgSetPayeesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + if (message.payees) { + obj.payees = message.payees.map(e => e); + } else { + obj.payees = message.payees; + } + return obj; + }, + fromAminoMsg(object: MsgSetPayeesAminoMsg): MsgSetPayees { + return MsgSetPayees.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetPayees): MsgSetPayeesAminoMsg { + return { + type: "ocr/MsgSetPayees", + value: MsgSetPayees.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetPayeesProtoMsg): MsgSetPayees { + return MsgSetPayees.decode(message.value); + }, + toProto(message: MsgSetPayees): Uint8Array { + return MsgSetPayees.encode(message).finish(); + }, + toProtoMsg(message: MsgSetPayees): MsgSetPayeesProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees", + value: MsgSetPayees.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetPayees.typeUrl, MsgSetPayees); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetPayees.aminoType, MsgSetPayees.typeUrl); +function createBaseMsgSetPayeesResponse(): MsgSetPayeesResponse { + return {}; +} +export const MsgSetPayeesResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse", + is(o: any): o is MsgSetPayeesResponse { + return o && o.$typeUrl === MsgSetPayeesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetPayeesResponseAmino { + return o && o.$typeUrl === MsgSetPayeesResponse.typeUrl; + }, + encode(_: MsgSetPayeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPayeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetPayeesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetPayeesResponse { + const message = createBaseMsgSetPayeesResponse(); + return message; + }, + fromAmino(_: MsgSetPayeesResponseAmino): MsgSetPayeesResponse { + const message = createBaseMsgSetPayeesResponse(); + return message; + }, + toAmino(_: MsgSetPayeesResponse): MsgSetPayeesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetPayeesResponseAminoMsg): MsgSetPayeesResponse { + return MsgSetPayeesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetPayeesResponseProtoMsg): MsgSetPayeesResponse { + return MsgSetPayeesResponse.decode(message.value); + }, + toProto(message: MsgSetPayeesResponse): Uint8Array { + return MsgSetPayeesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetPayeesResponse): MsgSetPayeesResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse", + value: MsgSetPayeesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetPayeesResponse.typeUrl, MsgSetPayeesResponse); +function createBaseMsgTransferPayeeship(): MsgTransferPayeeship { + return { + sender: "", + transmitter: "", + feedId: "", + proposed: "" + }; +} +export const MsgTransferPayeeship = { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship", + aminoType: "ocr/MsgTransferPayeeship", + is(o: any): o is MsgTransferPayeeship { + return o && (o.$typeUrl === MsgTransferPayeeship.typeUrl || typeof o.sender === "string" && typeof o.transmitter === "string" && typeof o.feedId === "string" && typeof o.proposed === "string"); + }, + isAmino(o: any): o is MsgTransferPayeeshipAmino { + return o && (o.$typeUrl === MsgTransferPayeeship.typeUrl || typeof o.sender === "string" && typeof o.transmitter === "string" && typeof o.feed_id === "string" && typeof o.proposed === "string"); + }, + encode(message: MsgTransferPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + if (message.proposed !== "") { + writer.uint32(34).string(message.proposed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.feedId = reader.string(); + break; + case 4: + message.proposed = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransferPayeeship { + const message = createBaseMsgTransferPayeeship(); + message.sender = object.sender ?? ""; + message.transmitter = object.transmitter ?? ""; + message.feedId = object.feedId ?? ""; + message.proposed = object.proposed ?? ""; + return message; + }, + fromAmino(object: MsgTransferPayeeshipAmino): MsgTransferPayeeship { + const message = createBaseMsgTransferPayeeship(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.proposed !== undefined && object.proposed !== null) { + message.proposed = object.proposed; + } + return message; + }, + toAmino(message: MsgTransferPayeeship): MsgTransferPayeeshipAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.proposed = message.proposed === "" ? undefined : message.proposed; + return obj; + }, + fromAminoMsg(object: MsgTransferPayeeshipAminoMsg): MsgTransferPayeeship { + return MsgTransferPayeeship.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPayeeship): MsgTransferPayeeshipAminoMsg { + return { + type: "ocr/MsgTransferPayeeship", + value: MsgTransferPayeeship.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPayeeshipProtoMsg): MsgTransferPayeeship { + return MsgTransferPayeeship.decode(message.value); + }, + toProto(message: MsgTransferPayeeship): Uint8Array { + return MsgTransferPayeeship.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPayeeship): MsgTransferPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship", + value: MsgTransferPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPayeeship.typeUrl, MsgTransferPayeeship); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferPayeeship.aminoType, MsgTransferPayeeship.typeUrl); +function createBaseMsgTransferPayeeshipResponse(): MsgTransferPayeeshipResponse { + return {}; +} +export const MsgTransferPayeeshipResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse", + is(o: any): o is MsgTransferPayeeshipResponse { + return o && o.$typeUrl === MsgTransferPayeeshipResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransferPayeeshipResponseAmino { + return o && o.$typeUrl === MsgTransferPayeeshipResponse.typeUrl; + }, + encode(_: MsgTransferPayeeshipResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPayeeshipResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPayeeshipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgTransferPayeeshipResponse { + const message = createBaseMsgTransferPayeeshipResponse(); + return message; + }, + fromAmino(_: MsgTransferPayeeshipResponseAmino): MsgTransferPayeeshipResponse { + const message = createBaseMsgTransferPayeeshipResponse(); + return message; + }, + toAmino(_: MsgTransferPayeeshipResponse): MsgTransferPayeeshipResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferPayeeshipResponseAminoMsg): MsgTransferPayeeshipResponse { + return MsgTransferPayeeshipResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransferPayeeshipResponseProtoMsg): MsgTransferPayeeshipResponse { + return MsgTransferPayeeshipResponse.decode(message.value); + }, + toProto(message: MsgTransferPayeeshipResponse): Uint8Array { + return MsgTransferPayeeshipResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPayeeshipResponse): MsgTransferPayeeshipResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse", + value: MsgTransferPayeeshipResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPayeeshipResponse.typeUrl, MsgTransferPayeeshipResponse); +function createBaseMsgAcceptPayeeship(): MsgAcceptPayeeship { + return { + payee: "", + transmitter: "", + feedId: "" + }; +} +export const MsgAcceptPayeeship = { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship", + aminoType: "ocr/MsgAcceptPayeeship", + is(o: any): o is MsgAcceptPayeeship { + return o && (o.$typeUrl === MsgAcceptPayeeship.typeUrl || typeof o.payee === "string" && typeof o.transmitter === "string" && typeof o.feedId === "string"); + }, + isAmino(o: any): o is MsgAcceptPayeeshipAmino { + return o && (o.$typeUrl === MsgAcceptPayeeship.typeUrl || typeof o.payee === "string" && typeof o.transmitter === "string" && typeof o.feed_id === "string"); + }, + encode(message: MsgAcceptPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.payee !== "") { + writer.uint32(10).string(message.payee); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcceptPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payee = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAcceptPayeeship { + const message = createBaseMsgAcceptPayeeship(); + message.payee = object.payee ?? ""; + message.transmitter = object.transmitter ?? ""; + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: MsgAcceptPayeeshipAmino): MsgAcceptPayeeship { + const message = createBaseMsgAcceptPayeeship(); + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: MsgAcceptPayeeship): MsgAcceptPayeeshipAmino { + const obj: any = {}; + obj.payee = message.payee === "" ? undefined : message.payee; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: MsgAcceptPayeeshipAminoMsg): MsgAcceptPayeeship { + return MsgAcceptPayeeship.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcceptPayeeship): MsgAcceptPayeeshipAminoMsg { + return { + type: "ocr/MsgAcceptPayeeship", + value: MsgAcceptPayeeship.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcceptPayeeshipProtoMsg): MsgAcceptPayeeship { + return MsgAcceptPayeeship.decode(message.value); + }, + toProto(message: MsgAcceptPayeeship): Uint8Array { + return MsgAcceptPayeeship.encode(message).finish(); + }, + toProtoMsg(message: MsgAcceptPayeeship): MsgAcceptPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship", + value: MsgAcceptPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcceptPayeeship.typeUrl, MsgAcceptPayeeship); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcceptPayeeship.aminoType, MsgAcceptPayeeship.typeUrl); +function createBaseMsgAcceptPayeeshipResponse(): MsgAcceptPayeeshipResponse { + return {}; +} +export const MsgAcceptPayeeshipResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse", + is(o: any): o is MsgAcceptPayeeshipResponse { + return o && o.$typeUrl === MsgAcceptPayeeshipResponse.typeUrl; + }, + isAmino(o: any): o is MsgAcceptPayeeshipResponseAmino { + return o && o.$typeUrl === MsgAcceptPayeeshipResponse.typeUrl; + }, + encode(_: MsgAcceptPayeeshipResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcceptPayeeshipResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptPayeeshipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAcceptPayeeshipResponse { + const message = createBaseMsgAcceptPayeeshipResponse(); + return message; + }, + fromAmino(_: MsgAcceptPayeeshipResponseAmino): MsgAcceptPayeeshipResponse { + const message = createBaseMsgAcceptPayeeshipResponse(); + return message; + }, + toAmino(_: MsgAcceptPayeeshipResponse): MsgAcceptPayeeshipResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAcceptPayeeshipResponseAminoMsg): MsgAcceptPayeeshipResponse { + return MsgAcceptPayeeshipResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAcceptPayeeshipResponseProtoMsg): MsgAcceptPayeeshipResponse { + return MsgAcceptPayeeshipResponse.decode(message.value); + }, + toProto(message: MsgAcceptPayeeshipResponse): Uint8Array { + return MsgAcceptPayeeshipResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcceptPayeeshipResponse): MsgAcceptPayeeshipResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse", + value: MsgAcceptPayeeshipResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcceptPayeeshipResponse.typeUrl, MsgAcceptPayeeshipResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParams", + aminoType: "ocr/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "ocr/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: "/injective.ocr.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/events.ts b/libs/injective-query/src/injective/oracle/v1beta1/events.ts new file mode 100644 index 00000000..e78a07bd --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/events.ts @@ -0,0 +1,1234 @@ +import { StorkPriceState, StorkPriceStateAmino, PythPriceState, PythPriceStateAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface SetChainlinkPriceEvent { + feedId: string; + answer: string; + timestamp: bigint; +} +export interface SetChainlinkPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent"; + value: Uint8Array; +} +export interface SetChainlinkPriceEventAmino { + feed_id: string; + answer: string; + timestamp: string; +} +export interface SetChainlinkPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetChainlinkPriceEvent"; + value: SetChainlinkPriceEventAmino; +} +/** Event type upon set ref */ +export interface SetBandPriceEvent { + relayer: string; + symbol: string; + price: string; + resolveTime: bigint; + requestId: bigint; +} +export interface SetBandPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent"; + value: Uint8Array; +} +/** Event type upon set ref */ +export interface SetBandPriceEventAmino { + relayer: string; + symbol: string; + price: string; + resolve_time: string; + request_id: string; +} +export interface SetBandPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetBandPriceEvent"; + value: SetBandPriceEventAmino; +} +export interface SetBandIBCPriceEvent { + relayer: string; + symbols: string[]; + prices: string[]; + resolveTime: bigint; + requestId: bigint; + clientId: bigint; +} +export interface SetBandIBCPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent"; + value: Uint8Array; +} +export interface SetBandIBCPriceEventAmino { + relayer: string; + symbols: string[]; + prices: string[]; + resolve_time: string; + request_id: string; + client_id: string; +} +export interface SetBandIBCPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetBandIBCPriceEvent"; + value: SetBandIBCPriceEventAmino; +} +export interface EventBandIBCAckSuccess { + ackResult: string; + clientId: bigint; +} +export interface EventBandIBCAckSuccessProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess"; + value: Uint8Array; +} +export interface EventBandIBCAckSuccessAmino { + ack_result: string; + client_id: string; +} +export interface EventBandIBCAckSuccessAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCAckSuccess"; + value: EventBandIBCAckSuccessAmino; +} +export interface EventBandIBCAckError { + ackError: string; + clientId: bigint; +} +export interface EventBandIBCAckErrorProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError"; + value: Uint8Array; +} +export interface EventBandIBCAckErrorAmino { + ack_error: string; + client_id: string; +} +export interface EventBandIBCAckErrorAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCAckError"; + value: EventBandIBCAckErrorAmino; +} +export interface EventBandIBCResponseTimeout { + clientId: bigint; +} +export interface EventBandIBCResponseTimeoutProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout"; + value: Uint8Array; +} +export interface EventBandIBCResponseTimeoutAmino { + client_id: string; +} +export interface EventBandIBCResponseTimeoutAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout"; + value: EventBandIBCResponseTimeoutAmino; +} +export interface SetPriceFeedPriceEvent { + relayer: string; + base: string; + quote: string; + /** price defines the price of the oracle base and quote */ + price: string; +} +export interface SetPriceFeedPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent"; + value: Uint8Array; +} +export interface SetPriceFeedPriceEventAmino { + relayer: string; + base: string; + quote: string; + /** price defines the price of the oracle base and quote */ + price: string; +} +export interface SetPriceFeedPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent"; + value: SetPriceFeedPriceEventAmino; +} +export interface SetProviderPriceEvent { + provider: string; + relayer: string; + symbol: string; + price: string; +} +export interface SetProviderPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent"; + value: Uint8Array; +} +export interface SetProviderPriceEventAmino { + provider: string; + relayer: string; + symbol: string; + price: string; +} +export interface SetProviderPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetProviderPriceEvent"; + value: SetProviderPriceEventAmino; +} +export interface SetCoinbasePriceEvent { + symbol: string; + price: string; + timestamp: bigint; +} +export interface SetCoinbasePriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent"; + value: Uint8Array; +} +export interface SetCoinbasePriceEventAmino { + symbol: string; + price: string; + timestamp: string; +} +export interface SetCoinbasePriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetCoinbasePriceEvent"; + value: SetCoinbasePriceEventAmino; +} +export interface EventSetStorkPrices { + prices: StorkPriceState[]; +} +export interface EventSetStorkPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices"; + value: Uint8Array; +} +export interface EventSetStorkPricesAmino { + prices: StorkPriceStateAmino[]; +} +export interface EventSetStorkPricesAminoMsg { + type: "/injective.oracle.v1beta1.EventSetStorkPrices"; + value: EventSetStorkPricesAmino; +} +export interface EventSetPythPrices { + prices: PythPriceState[]; +} +export interface EventSetPythPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices"; + value: Uint8Array; +} +export interface EventSetPythPricesAmino { + prices: PythPriceStateAmino[]; +} +export interface EventSetPythPricesAminoMsg { + type: "/injective.oracle.v1beta1.EventSetPythPrices"; + value: EventSetPythPricesAmino; +} +function createBaseSetChainlinkPriceEvent(): SetChainlinkPriceEvent { + return { + feedId: "", + answer: "", + timestamp: BigInt(0) + }; +} +export const SetChainlinkPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent", + is(o: any): o is SetChainlinkPriceEvent { + return o && (o.$typeUrl === SetChainlinkPriceEvent.typeUrl || typeof o.feedId === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SetChainlinkPriceEventAmino { + return o && (o.$typeUrl === SetChainlinkPriceEvent.typeUrl || typeof o.feed_id === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SetChainlinkPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.answer !== "") { + writer.uint32(18).string(message.answer); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetChainlinkPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetChainlinkPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.answer = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetChainlinkPriceEvent { + const message = createBaseSetChainlinkPriceEvent(); + message.feedId = object.feedId ?? ""; + message.answer = object.answer ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetChainlinkPriceEventAmino): SetChainlinkPriceEvent { + const message = createBaseSetChainlinkPriceEvent(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SetChainlinkPriceEvent): SetChainlinkPriceEventAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetChainlinkPriceEventAminoMsg): SetChainlinkPriceEvent { + return SetChainlinkPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetChainlinkPriceEventProtoMsg): SetChainlinkPriceEvent { + return SetChainlinkPriceEvent.decode(message.value); + }, + toProto(message: SetChainlinkPriceEvent): Uint8Array { + return SetChainlinkPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetChainlinkPriceEvent): SetChainlinkPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent", + value: SetChainlinkPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetChainlinkPriceEvent.typeUrl, SetChainlinkPriceEvent); +function createBaseSetBandPriceEvent(): SetBandPriceEvent { + return { + relayer: "", + symbol: "", + price: "", + resolveTime: BigInt(0), + requestId: BigInt(0) + }; +} +export const SetBandPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent", + is(o: any): o is SetBandPriceEvent { + return o && (o.$typeUrl === SetBandPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string" && typeof o.resolveTime === "bigint" && typeof o.requestId === "bigint"); + }, + isAmino(o: any): o is SetBandPriceEventAmino { + return o && (o.$typeUrl === SetBandPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string" && typeof o.resolve_time === "bigint" && typeof o.request_id === "bigint"); + }, + encode(message: SetBandPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(32).uint64(message.resolveTime); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(40).uint64(message.requestId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBandPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBandPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.resolveTime = reader.uint64(); + break; + case 5: + message.requestId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBandPriceEvent { + const message = createBaseSetBandPriceEvent(); + message.relayer = object.relayer ?? ""; + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetBandPriceEventAmino): SetBandPriceEvent { + const message = createBaseSetBandPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + return message; + }, + toAmino(message: SetBandPriceEvent): SetBandPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetBandPriceEventAminoMsg): SetBandPriceEvent { + return SetBandPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetBandPriceEventProtoMsg): SetBandPriceEvent { + return SetBandPriceEvent.decode(message.value); + }, + toProto(message: SetBandPriceEvent): Uint8Array { + return SetBandPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetBandPriceEvent): SetBandPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent", + value: SetBandPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBandPriceEvent.typeUrl, SetBandPriceEvent); +function createBaseSetBandIBCPriceEvent(): SetBandIBCPriceEvent { + return { + relayer: "", + symbols: [], + prices: [], + resolveTime: BigInt(0), + requestId: BigInt(0), + clientId: BigInt(0) + }; +} +export const SetBandIBCPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent", + is(o: any): o is SetBandIBCPriceEvent { + return o && (o.$typeUrl === SetBandIBCPriceEvent.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string") && typeof o.resolveTime === "bigint" && typeof o.requestId === "bigint" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is SetBandIBCPriceEventAmino { + return o && (o.$typeUrl === SetBandIBCPriceEvent.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string") && typeof o.resolve_time === "bigint" && typeof o.request_id === "bigint" && typeof o.client_id === "bigint"); + }, + encode(message: SetBandIBCPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + for (const v of message.symbols) { + writer.uint32(18).string(v!); + } + for (const v of message.prices) { + writer.uint32(26).string(v!); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(32).uint64(message.resolveTime); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(40).uint64(message.requestId); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(48).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBandIBCPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBandIBCPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbols.push(reader.string()); + break; + case 3: + message.prices.push(reader.string()); + break; + case 4: + message.resolveTime = reader.uint64(); + break; + case 5: + message.requestId = reader.uint64(); + break; + case 6: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBandIBCPriceEvent { + const message = createBaseSetBandIBCPriceEvent(); + message.relayer = object.relayer ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetBandIBCPriceEventAmino): SetBandIBCPriceEvent { + const message = createBaseSetBandIBCPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: SetBandIBCPriceEvent): SetBandIBCPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.prices) { + obj.prices = message.prices.map(e => e); + } else { + obj.prices = message.prices; + } + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetBandIBCPriceEventAminoMsg): SetBandIBCPriceEvent { + return SetBandIBCPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetBandIBCPriceEventProtoMsg): SetBandIBCPriceEvent { + return SetBandIBCPriceEvent.decode(message.value); + }, + toProto(message: SetBandIBCPriceEvent): Uint8Array { + return SetBandIBCPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetBandIBCPriceEvent): SetBandIBCPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent", + value: SetBandIBCPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBandIBCPriceEvent.typeUrl, SetBandIBCPriceEvent); +function createBaseEventBandIBCAckSuccess(): EventBandIBCAckSuccess { + return { + ackResult: "", + clientId: BigInt(0) + }; +} +export const EventBandIBCAckSuccess = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess", + is(o: any): o is EventBandIBCAckSuccess { + return o && (o.$typeUrl === EventBandIBCAckSuccess.typeUrl || typeof o.ackResult === "string" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCAckSuccessAmino { + return o && (o.$typeUrl === EventBandIBCAckSuccess.typeUrl || typeof o.ack_result === "string" && typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCAckSuccess, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ackResult !== "") { + writer.uint32(10).string(message.ackResult); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(16).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCAckSuccess { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCAckSuccess(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ackResult = reader.string(); + break; + case 2: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCAckSuccess { + const message = createBaseEventBandIBCAckSuccess(); + message.ackResult = object.ackResult ?? ""; + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCAckSuccessAmino): EventBandIBCAckSuccess { + const message = createBaseEventBandIBCAckSuccess(); + if (object.ack_result !== undefined && object.ack_result !== null) { + message.ackResult = object.ack_result; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCAckSuccess): EventBandIBCAckSuccessAmino { + const obj: any = {}; + obj.ack_result = message.ackResult === "" ? undefined : message.ackResult; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCAckSuccessAminoMsg): EventBandIBCAckSuccess { + return EventBandIBCAckSuccess.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCAckSuccessProtoMsg): EventBandIBCAckSuccess { + return EventBandIBCAckSuccess.decode(message.value); + }, + toProto(message: EventBandIBCAckSuccess): Uint8Array { + return EventBandIBCAckSuccess.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCAckSuccess): EventBandIBCAckSuccessProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess", + value: EventBandIBCAckSuccess.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCAckSuccess.typeUrl, EventBandIBCAckSuccess); +function createBaseEventBandIBCAckError(): EventBandIBCAckError { + return { + ackError: "", + clientId: BigInt(0) + }; +} +export const EventBandIBCAckError = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError", + is(o: any): o is EventBandIBCAckError { + return o && (o.$typeUrl === EventBandIBCAckError.typeUrl || typeof o.ackError === "string" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCAckErrorAmino { + return o && (o.$typeUrl === EventBandIBCAckError.typeUrl || typeof o.ack_error === "string" && typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCAckError, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ackError !== "") { + writer.uint32(10).string(message.ackError); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(16).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCAckError { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCAckError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ackError = reader.string(); + break; + case 2: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCAckError { + const message = createBaseEventBandIBCAckError(); + message.ackError = object.ackError ?? ""; + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCAckErrorAmino): EventBandIBCAckError { + const message = createBaseEventBandIBCAckError(); + if (object.ack_error !== undefined && object.ack_error !== null) { + message.ackError = object.ack_error; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCAckError): EventBandIBCAckErrorAmino { + const obj: any = {}; + obj.ack_error = message.ackError === "" ? undefined : message.ackError; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCAckErrorAminoMsg): EventBandIBCAckError { + return EventBandIBCAckError.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCAckErrorProtoMsg): EventBandIBCAckError { + return EventBandIBCAckError.decode(message.value); + }, + toProto(message: EventBandIBCAckError): Uint8Array { + return EventBandIBCAckError.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCAckError): EventBandIBCAckErrorProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError", + value: EventBandIBCAckError.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCAckError.typeUrl, EventBandIBCAckError); +function createBaseEventBandIBCResponseTimeout(): EventBandIBCResponseTimeout { + return { + clientId: BigInt(0) + }; +} +export const EventBandIBCResponseTimeout = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout", + is(o: any): o is EventBandIBCResponseTimeout { + return o && (o.$typeUrl === EventBandIBCResponseTimeout.typeUrl || typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCResponseTimeoutAmino { + return o && (o.$typeUrl === EventBandIBCResponseTimeout.typeUrl || typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCResponseTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== BigInt(0)) { + writer.uint32(8).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCResponseTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCResponseTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCResponseTimeout { + const message = createBaseEventBandIBCResponseTimeout(); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCResponseTimeoutAmino): EventBandIBCResponseTimeout { + const message = createBaseEventBandIBCResponseTimeout(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCResponseTimeout): EventBandIBCResponseTimeoutAmino { + const obj: any = {}; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCResponseTimeoutAminoMsg): EventBandIBCResponseTimeout { + return EventBandIBCResponseTimeout.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCResponseTimeoutProtoMsg): EventBandIBCResponseTimeout { + return EventBandIBCResponseTimeout.decode(message.value); + }, + toProto(message: EventBandIBCResponseTimeout): Uint8Array { + return EventBandIBCResponseTimeout.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCResponseTimeout): EventBandIBCResponseTimeoutProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout", + value: EventBandIBCResponseTimeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCResponseTimeout.typeUrl, EventBandIBCResponseTimeout); +function createBaseSetPriceFeedPriceEvent(): SetPriceFeedPriceEvent { + return { + relayer: "", + base: "", + quote: "", + price: "" + }; +} +export const SetPriceFeedPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent", + is(o: any): o is SetPriceFeedPriceEvent { + return o && (o.$typeUrl === SetPriceFeedPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.base === "string" && typeof o.quote === "string" && typeof o.price === "string"); + }, + isAmino(o: any): o is SetPriceFeedPriceEventAmino { + return o && (o.$typeUrl === SetPriceFeedPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.base === "string" && typeof o.quote === "string" && typeof o.price === "string"); + }, + encode(message: SetPriceFeedPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + if (message.base !== "") { + writer.uint32(18).string(message.base); + } + if (message.quote !== "") { + writer.uint32(26).string(message.quote); + } + if (message.price !== "") { + writer.uint32(34).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetPriceFeedPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetPriceFeedPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.base = reader.string(); + break; + case 3: + message.quote = reader.string(); + break; + case 4: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetPriceFeedPriceEvent { + const message = createBaseSetPriceFeedPriceEvent(); + message.relayer = object.relayer ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: SetPriceFeedPriceEventAmino): SetPriceFeedPriceEvent { + const message = createBaseSetPriceFeedPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: SetPriceFeedPriceEvent): SetPriceFeedPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: SetPriceFeedPriceEventAminoMsg): SetPriceFeedPriceEvent { + return SetPriceFeedPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetPriceFeedPriceEventProtoMsg): SetPriceFeedPriceEvent { + return SetPriceFeedPriceEvent.decode(message.value); + }, + toProto(message: SetPriceFeedPriceEvent): Uint8Array { + return SetPriceFeedPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetPriceFeedPriceEvent): SetPriceFeedPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent", + value: SetPriceFeedPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetPriceFeedPriceEvent.typeUrl, SetPriceFeedPriceEvent); +function createBaseSetProviderPriceEvent(): SetProviderPriceEvent { + return { + provider: "", + relayer: "", + symbol: "", + price: "" + }; +} +export const SetProviderPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent", + is(o: any): o is SetProviderPriceEvent { + return o && (o.$typeUrl === SetProviderPriceEvent.typeUrl || typeof o.provider === "string" && typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string"); + }, + isAmino(o: any): o is SetProviderPriceEventAmino { + return o && (o.$typeUrl === SetProviderPriceEvent.typeUrl || typeof o.provider === "string" && typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string"); + }, + encode(message: SetProviderPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + if (message.relayer !== "") { + writer.uint32(18).string(message.relayer); + } + if (message.symbol !== "") { + writer.uint32(26).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(34).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetProviderPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetProviderPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.relayer = reader.string(); + break; + case 3: + message.symbol = reader.string(); + break; + case 4: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetProviderPriceEvent { + const message = createBaseSetProviderPriceEvent(); + message.provider = object.provider ?? ""; + message.relayer = object.relayer ?? ""; + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: SetProviderPriceEventAmino): SetProviderPriceEvent { + const message = createBaseSetProviderPriceEvent(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: SetProviderPriceEvent): SetProviderPriceEventAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: SetProviderPriceEventAminoMsg): SetProviderPriceEvent { + return SetProviderPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetProviderPriceEventProtoMsg): SetProviderPriceEvent { + return SetProviderPriceEvent.decode(message.value); + }, + toProto(message: SetProviderPriceEvent): Uint8Array { + return SetProviderPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetProviderPriceEvent): SetProviderPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent", + value: SetProviderPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetProviderPriceEvent.typeUrl, SetProviderPriceEvent); +function createBaseSetCoinbasePriceEvent(): SetCoinbasePriceEvent { + return { + symbol: "", + price: "", + timestamp: BigInt(0) + }; +} +export const SetCoinbasePriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent", + is(o: any): o is SetCoinbasePriceEvent { + return o && (o.$typeUrl === SetCoinbasePriceEvent.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SetCoinbasePriceEventAmino { + return o && (o.$typeUrl === SetCoinbasePriceEvent.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SetCoinbasePriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetCoinbasePriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetCoinbasePriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetCoinbasePriceEvent { + const message = createBaseSetCoinbasePriceEvent(); + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetCoinbasePriceEventAmino): SetCoinbasePriceEvent { + const message = createBaseSetCoinbasePriceEvent(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SetCoinbasePriceEvent): SetCoinbasePriceEventAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetCoinbasePriceEventAminoMsg): SetCoinbasePriceEvent { + return SetCoinbasePriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetCoinbasePriceEventProtoMsg): SetCoinbasePriceEvent { + return SetCoinbasePriceEvent.decode(message.value); + }, + toProto(message: SetCoinbasePriceEvent): Uint8Array { + return SetCoinbasePriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetCoinbasePriceEvent): SetCoinbasePriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent", + value: SetCoinbasePriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetCoinbasePriceEvent.typeUrl, SetCoinbasePriceEvent); +function createBaseEventSetStorkPrices(): EventSetStorkPrices { + return { + prices: [] + }; +} +export const EventSetStorkPrices = { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices", + is(o: any): o is EventSetStorkPrices { + return o && (o.$typeUrl === EventSetStorkPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || StorkPriceState.is(o.prices[0]))); + }, + isAmino(o: any): o is EventSetStorkPricesAmino { + return o && (o.$typeUrl === EventSetStorkPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || StorkPriceState.isAmino(o.prices[0]))); + }, + encode(message: EventSetStorkPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + StorkPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetStorkPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetStorkPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(StorkPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetStorkPrices { + const message = createBaseEventSetStorkPrices(); + message.prices = object.prices?.map(e => StorkPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventSetStorkPricesAmino): EventSetStorkPrices { + const message = createBaseEventSetStorkPrices(); + message.prices = object.prices?.map(e => StorkPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventSetStorkPrices): EventSetStorkPricesAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: EventSetStorkPricesAminoMsg): EventSetStorkPrices { + return EventSetStorkPrices.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetStorkPricesProtoMsg): EventSetStorkPrices { + return EventSetStorkPrices.decode(message.value); + }, + toProto(message: EventSetStorkPrices): Uint8Array { + return EventSetStorkPrices.encode(message).finish(); + }, + toProtoMsg(message: EventSetStorkPrices): EventSetStorkPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices", + value: EventSetStorkPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetStorkPrices.typeUrl, EventSetStorkPrices); +function createBaseEventSetPythPrices(): EventSetPythPrices { + return { + prices: [] + }; +} +export const EventSetPythPrices = { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices", + is(o: any): o is EventSetPythPrices { + return o && (o.$typeUrl === EventSetPythPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || PythPriceState.is(o.prices[0]))); + }, + isAmino(o: any): o is EventSetPythPricesAmino { + return o && (o.$typeUrl === EventSetPythPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || PythPriceState.isAmino(o.prices[0]))); + }, + encode(message: EventSetPythPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + PythPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetPythPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetPythPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(PythPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetPythPrices { + const message = createBaseEventSetPythPrices(); + message.prices = object.prices?.map(e => PythPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventSetPythPricesAmino): EventSetPythPrices { + const message = createBaseEventSetPythPrices(); + message.prices = object.prices?.map(e => PythPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventSetPythPrices): EventSetPythPricesAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: EventSetPythPricesAminoMsg): EventSetPythPrices { + return EventSetPythPrices.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetPythPricesProtoMsg): EventSetPythPrices { + return EventSetPythPrices.decode(message.value); + }, + toProto(message: EventSetPythPrices): Uint8Array { + return EventSetPythPrices.encode(message).finish(); + }, + toProtoMsg(message: EventSetPythPrices): EventSetPythPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices", + value: EventSetPythPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetPythPrices.typeUrl, EventSetPythPrices); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/genesis.ts b/libs/injective-query/src/injective/oracle/v1beta1/genesis.ts new file mode 100644 index 00000000..de88f8a9 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/genesis.ts @@ -0,0 +1,440 @@ +import { Params, ParamsAmino, BandPriceState, BandPriceStateAmino, PriceFeedState, PriceFeedStateAmino, CoinbasePriceState, CoinbasePriceStateAmino, BandOracleRequest, BandOracleRequestAmino, BandIBCParams, BandIBCParamsAmino, ChainlinkPriceState, ChainlinkPriceStateAmino, PriceRecords, PriceRecordsAmino, ProviderState, ProviderStateAmino, PythPriceState, PythPriceStateAmino, StorkPriceState, StorkPriceStateAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to oracle. */ + params: Params; + bandRelayers: string[]; + bandPriceStates: BandPriceState[]; + priceFeedPriceStates: PriceFeedState[]; + coinbasePriceStates: CoinbasePriceState[]; + bandIbcPriceStates: BandPriceState[]; + bandIbcOracleRequests: BandOracleRequest[]; + bandIbcParams: BandIBCParams; + bandIbcLatestClientId: bigint; + calldataRecords: CalldataRecord[]; + bandIbcLatestRequestId: bigint; + chainlinkPriceStates: ChainlinkPriceState[]; + historicalPriceRecords: PriceRecords[]; + providerStates: ProviderState[]; + pythPriceStates: PythPriceState[]; + storkPriceStates: StorkPriceState[]; + storkPublishers: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to oracle. */ + params: ParamsAmino; + band_relayers: string[]; + band_price_states: BandPriceStateAmino[]; + price_feed_price_states: PriceFeedStateAmino[]; + coinbase_price_states: CoinbasePriceStateAmino[]; + band_ibc_price_states: BandPriceStateAmino[]; + band_ibc_oracle_requests: BandOracleRequestAmino[]; + band_ibc_params: BandIBCParamsAmino; + band_ibc_latest_client_id: string; + calldata_records: CalldataRecordAmino[]; + band_ibc_latest_request_id: string; + chainlink_price_states: ChainlinkPriceStateAmino[]; + historical_price_records: PriceRecordsAmino[]; + provider_states: ProviderStateAmino[]; + pyth_price_states: PythPriceStateAmino[]; + stork_price_states: StorkPriceStateAmino[]; + stork_publishers: string[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.oracle.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface CalldataRecord { + clientId: bigint; + calldata: Uint8Array; +} +export interface CalldataRecordProtoMsg { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord"; + value: Uint8Array; +} +export interface CalldataRecordAmino { + client_id: string; + calldata: string; +} +export interface CalldataRecordAminoMsg { + type: "/injective.oracle.v1beta1.CalldataRecord"; + value: CalldataRecordAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + bandRelayers: [], + bandPriceStates: [], + priceFeedPriceStates: [], + coinbasePriceStates: [], + bandIbcPriceStates: [], + bandIbcOracleRequests: [], + bandIbcParams: BandIBCParams.fromPartial({}), + bandIbcLatestClientId: BigInt(0), + calldataRecords: [], + bandIbcLatestRequestId: BigInt(0), + chainlinkPriceStates: [], + historicalPriceRecords: [], + providerStates: [], + pythPriceStates: [], + storkPriceStates: [], + storkPublishers: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.oracle.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.bandRelayers) && (!o.bandRelayers.length || typeof o.bandRelayers[0] === "string") && Array.isArray(o.bandPriceStates) && (!o.bandPriceStates.length || BandPriceState.is(o.bandPriceStates[0])) && Array.isArray(o.priceFeedPriceStates) && (!o.priceFeedPriceStates.length || PriceFeedState.is(o.priceFeedPriceStates[0])) && Array.isArray(o.coinbasePriceStates) && (!o.coinbasePriceStates.length || CoinbasePriceState.is(o.coinbasePriceStates[0])) && Array.isArray(o.bandIbcPriceStates) && (!o.bandIbcPriceStates.length || BandPriceState.is(o.bandIbcPriceStates[0])) && Array.isArray(o.bandIbcOracleRequests) && (!o.bandIbcOracleRequests.length || BandOracleRequest.is(o.bandIbcOracleRequests[0])) && BandIBCParams.is(o.bandIbcParams) && typeof o.bandIbcLatestClientId === "bigint" && Array.isArray(o.calldataRecords) && (!o.calldataRecords.length || CalldataRecord.is(o.calldataRecords[0])) && typeof o.bandIbcLatestRequestId === "bigint" && Array.isArray(o.chainlinkPriceStates) && (!o.chainlinkPriceStates.length || ChainlinkPriceState.is(o.chainlinkPriceStates[0])) && Array.isArray(o.historicalPriceRecords) && (!o.historicalPriceRecords.length || PriceRecords.is(o.historicalPriceRecords[0])) && Array.isArray(o.providerStates) && (!o.providerStates.length || ProviderState.is(o.providerStates[0])) && Array.isArray(o.pythPriceStates) && (!o.pythPriceStates.length || PythPriceState.is(o.pythPriceStates[0])) && Array.isArray(o.storkPriceStates) && (!o.storkPriceStates.length || StorkPriceState.is(o.storkPriceStates[0])) && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.band_relayers) && (!o.band_relayers.length || typeof o.band_relayers[0] === "string") && Array.isArray(o.band_price_states) && (!o.band_price_states.length || BandPriceState.isAmino(o.band_price_states[0])) && Array.isArray(o.price_feed_price_states) && (!o.price_feed_price_states.length || PriceFeedState.isAmino(o.price_feed_price_states[0])) && Array.isArray(o.coinbase_price_states) && (!o.coinbase_price_states.length || CoinbasePriceState.isAmino(o.coinbase_price_states[0])) && Array.isArray(o.band_ibc_price_states) && (!o.band_ibc_price_states.length || BandPriceState.isAmino(o.band_ibc_price_states[0])) && Array.isArray(o.band_ibc_oracle_requests) && (!o.band_ibc_oracle_requests.length || BandOracleRequest.isAmino(o.band_ibc_oracle_requests[0])) && BandIBCParams.isAmino(o.band_ibc_params) && typeof o.band_ibc_latest_client_id === "bigint" && Array.isArray(o.calldata_records) && (!o.calldata_records.length || CalldataRecord.isAmino(o.calldata_records[0])) && typeof o.band_ibc_latest_request_id === "bigint" && Array.isArray(o.chainlink_price_states) && (!o.chainlink_price_states.length || ChainlinkPriceState.isAmino(o.chainlink_price_states[0])) && Array.isArray(o.historical_price_records) && (!o.historical_price_records.length || PriceRecords.isAmino(o.historical_price_records[0])) && Array.isArray(o.provider_states) && (!o.provider_states.length || ProviderState.isAmino(o.provider_states[0])) && Array.isArray(o.pyth_price_states) && (!o.pyth_price_states.length || PythPriceState.isAmino(o.pyth_price_states[0])) && Array.isArray(o.stork_price_states) && (!o.stork_price_states.length || StorkPriceState.isAmino(o.stork_price_states[0])) && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + 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.bandRelayers) { + writer.uint32(18).string(v!); + } + for (const v of message.bandPriceStates) { + BandPriceState.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.priceFeedPriceStates) { + PriceFeedState.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.coinbasePriceStates) { + CoinbasePriceState.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.bandIbcPriceStates) { + BandPriceState.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.bandIbcOracleRequests) { + BandOracleRequest.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.bandIbcParams !== undefined) { + BandIBCParams.encode(message.bandIbcParams, writer.uint32(66).fork()).ldelim(); + } + if (message.bandIbcLatestClientId !== BigInt(0)) { + writer.uint32(72).uint64(message.bandIbcLatestClientId); + } + for (const v of message.calldataRecords) { + CalldataRecord.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.bandIbcLatestRequestId !== BigInt(0)) { + writer.uint32(88).uint64(message.bandIbcLatestRequestId); + } + for (const v of message.chainlinkPriceStates) { + ChainlinkPriceState.encode(v!, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.historicalPriceRecords) { + PriceRecords.encode(v!, writer.uint32(106).fork()).ldelim(); + } + for (const v of message.providerStates) { + ProviderState.encode(v!, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.pythPriceStates) { + PythPriceState.encode(v!, writer.uint32(122).fork()).ldelim(); + } + for (const v of message.storkPriceStates) { + StorkPriceState.encode(v!, writer.uint32(130).fork()).ldelim(); + } + for (const v of message.storkPublishers) { + writer.uint32(138).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.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.bandRelayers.push(reader.string()); + break; + case 3: + message.bandPriceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + case 4: + message.priceFeedPriceStates.push(PriceFeedState.decode(reader, reader.uint32())); + break; + case 5: + message.coinbasePriceStates.push(CoinbasePriceState.decode(reader, reader.uint32())); + break; + case 6: + message.bandIbcPriceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + case 7: + message.bandIbcOracleRequests.push(BandOracleRequest.decode(reader, reader.uint32())); + break; + case 8: + message.bandIbcParams = BandIBCParams.decode(reader, reader.uint32()); + break; + case 9: + message.bandIbcLatestClientId = reader.uint64(); + break; + case 10: + message.calldataRecords.push(CalldataRecord.decode(reader, reader.uint32())); + break; + case 11: + message.bandIbcLatestRequestId = reader.uint64(); + break; + case 12: + message.chainlinkPriceStates.push(ChainlinkPriceState.decode(reader, reader.uint32())); + break; + case 13: + message.historicalPriceRecords.push(PriceRecords.decode(reader, reader.uint32())); + break; + case 14: + message.providerStates.push(ProviderState.decode(reader, reader.uint32())); + break; + case 15: + message.pythPriceStates.push(PythPriceState.decode(reader, reader.uint32())); + break; + case 16: + message.storkPriceStates.push(StorkPriceState.decode(reader, reader.uint32())); + break; + case 17: + message.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.bandRelayers = object.bandRelayers?.map(e => e) || []; + message.bandPriceStates = object.bandPriceStates?.map(e => BandPriceState.fromPartial(e)) || []; + message.priceFeedPriceStates = object.priceFeedPriceStates?.map(e => PriceFeedState.fromPartial(e)) || []; + message.coinbasePriceStates = object.coinbasePriceStates?.map(e => CoinbasePriceState.fromPartial(e)) || []; + message.bandIbcPriceStates = object.bandIbcPriceStates?.map(e => BandPriceState.fromPartial(e)) || []; + message.bandIbcOracleRequests = object.bandIbcOracleRequests?.map(e => BandOracleRequest.fromPartial(e)) || []; + message.bandIbcParams = object.bandIbcParams !== undefined && object.bandIbcParams !== null ? BandIBCParams.fromPartial(object.bandIbcParams) : undefined; + message.bandIbcLatestClientId = object.bandIbcLatestClientId !== undefined && object.bandIbcLatestClientId !== null ? BigInt(object.bandIbcLatestClientId.toString()) : BigInt(0); + message.calldataRecords = object.calldataRecords?.map(e => CalldataRecord.fromPartial(e)) || []; + message.bandIbcLatestRequestId = object.bandIbcLatestRequestId !== undefined && object.bandIbcLatestRequestId !== null ? BigInt(object.bandIbcLatestRequestId.toString()) : BigInt(0); + message.chainlinkPriceStates = object.chainlinkPriceStates?.map(e => ChainlinkPriceState.fromPartial(e)) || []; + message.historicalPriceRecords = object.historicalPriceRecords?.map(e => PriceRecords.fromPartial(e)) || []; + message.providerStates = object.providerStates?.map(e => ProviderState.fromPartial(e)) || []; + message.pythPriceStates = object.pythPriceStates?.map(e => PythPriceState.fromPartial(e)) || []; + message.storkPriceStates = object.storkPriceStates?.map(e => StorkPriceState.fromPartial(e)) || []; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.bandRelayers = object.band_relayers?.map(e => e) || []; + message.bandPriceStates = object.band_price_states?.map(e => BandPriceState.fromAmino(e)) || []; + message.priceFeedPriceStates = object.price_feed_price_states?.map(e => PriceFeedState.fromAmino(e)) || []; + message.coinbasePriceStates = object.coinbase_price_states?.map(e => CoinbasePriceState.fromAmino(e)) || []; + message.bandIbcPriceStates = object.band_ibc_price_states?.map(e => BandPriceState.fromAmino(e)) || []; + message.bandIbcOracleRequests = object.band_ibc_oracle_requests?.map(e => BandOracleRequest.fromAmino(e)) || []; + if (object.band_ibc_params !== undefined && object.band_ibc_params !== null) { + message.bandIbcParams = BandIBCParams.fromAmino(object.band_ibc_params); + } + if (object.band_ibc_latest_client_id !== undefined && object.band_ibc_latest_client_id !== null) { + message.bandIbcLatestClientId = BigInt(object.band_ibc_latest_client_id); + } + message.calldataRecords = object.calldata_records?.map(e => CalldataRecord.fromAmino(e)) || []; + if (object.band_ibc_latest_request_id !== undefined && object.band_ibc_latest_request_id !== null) { + message.bandIbcLatestRequestId = BigInt(object.band_ibc_latest_request_id); + } + message.chainlinkPriceStates = object.chainlink_price_states?.map(e => ChainlinkPriceState.fromAmino(e)) || []; + message.historicalPriceRecords = object.historical_price_records?.map(e => PriceRecords.fromAmino(e)) || []; + message.providerStates = object.provider_states?.map(e => ProviderState.fromAmino(e)) || []; + message.pythPriceStates = object.pyth_price_states?.map(e => PythPriceState.fromAmino(e)) || []; + message.storkPriceStates = object.stork_price_states?.map(e => StorkPriceState.fromAmino(e)) || []; + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.bandRelayers) { + obj.band_relayers = message.bandRelayers.map(e => e); + } else { + obj.band_relayers = message.bandRelayers; + } + if (message.bandPriceStates) { + obj.band_price_states = message.bandPriceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.band_price_states = message.bandPriceStates; + } + if (message.priceFeedPriceStates) { + obj.price_feed_price_states = message.priceFeedPriceStates.map(e => e ? PriceFeedState.toAmino(e) : undefined); + } else { + obj.price_feed_price_states = message.priceFeedPriceStates; + } + if (message.coinbasePriceStates) { + obj.coinbase_price_states = message.coinbasePriceStates.map(e => e ? CoinbasePriceState.toAmino(e) : undefined); + } else { + obj.coinbase_price_states = message.coinbasePriceStates; + } + if (message.bandIbcPriceStates) { + obj.band_ibc_price_states = message.bandIbcPriceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.band_ibc_price_states = message.bandIbcPriceStates; + } + if (message.bandIbcOracleRequests) { + obj.band_ibc_oracle_requests = message.bandIbcOracleRequests.map(e => e ? BandOracleRequest.toAmino(e) : undefined); + } else { + obj.band_ibc_oracle_requests = message.bandIbcOracleRequests; + } + obj.band_ibc_params = message.bandIbcParams ? BandIBCParams.toAmino(message.bandIbcParams) : undefined; + obj.band_ibc_latest_client_id = message.bandIbcLatestClientId !== BigInt(0) ? message.bandIbcLatestClientId?.toString() : undefined; + if (message.calldataRecords) { + obj.calldata_records = message.calldataRecords.map(e => e ? CalldataRecord.toAmino(e) : undefined); + } else { + obj.calldata_records = message.calldataRecords; + } + obj.band_ibc_latest_request_id = message.bandIbcLatestRequestId !== BigInt(0) ? message.bandIbcLatestRequestId?.toString() : undefined; + if (message.chainlinkPriceStates) { + obj.chainlink_price_states = message.chainlinkPriceStates.map(e => e ? ChainlinkPriceState.toAmino(e) : undefined); + } else { + obj.chainlink_price_states = message.chainlinkPriceStates; + } + if (message.historicalPriceRecords) { + obj.historical_price_records = message.historicalPriceRecords.map(e => e ? PriceRecords.toAmino(e) : undefined); + } else { + obj.historical_price_records = message.historicalPriceRecords; + } + if (message.providerStates) { + obj.provider_states = message.providerStates.map(e => e ? ProviderState.toAmino(e) : undefined); + } else { + obj.provider_states = message.providerStates; + } + if (message.pythPriceStates) { + obj.pyth_price_states = message.pythPriceStates.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.pyth_price_states = message.pythPriceStates; + } + if (message.storkPriceStates) { + obj.stork_price_states = message.storkPriceStates.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.stork_price_states = message.storkPriceStates; + } + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + 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: "/injective.oracle.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseCalldataRecord(): CalldataRecord { + return { + clientId: BigInt(0), + calldata: new Uint8Array() + }; +} +export const CalldataRecord = { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord", + is(o: any): o is CalldataRecord { + return o && (o.$typeUrl === CalldataRecord.typeUrl || typeof o.clientId === "bigint" && (o.calldata instanceof Uint8Array || typeof o.calldata === "string")); + }, + isAmino(o: any): o is CalldataRecordAmino { + return o && (o.$typeUrl === CalldataRecord.typeUrl || typeof o.client_id === "bigint" && (o.calldata instanceof Uint8Array || typeof o.calldata === "string")); + }, + encode(message: CalldataRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== BigInt(0)) { + writer.uint32(8).uint64(message.clientId); + } + if (message.calldata.length !== 0) { + writer.uint32(18).bytes(message.calldata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CalldataRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalldataRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.uint64(); + break; + case 2: + message.calldata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CalldataRecord { + const message = createBaseCalldataRecord(); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + message.calldata = object.calldata ?? new Uint8Array(); + return message; + }, + fromAmino(object: CalldataRecordAmino): CalldataRecord { + const message = createBaseCalldataRecord(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + if (object.calldata !== undefined && object.calldata !== null) { + message.calldata = bytesFromBase64(object.calldata); + } + return message; + }, + toAmino(message: CalldataRecord): CalldataRecordAmino { + const obj: any = {}; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + obj.calldata = message.calldata ? base64FromBytes(message.calldata) : undefined; + return obj; + }, + fromAminoMsg(object: CalldataRecordAminoMsg): CalldataRecord { + return CalldataRecord.fromAmino(object.value); + }, + fromProtoMsg(message: CalldataRecordProtoMsg): CalldataRecord { + return CalldataRecord.decode(message.value); + }, + toProto(message: CalldataRecord): Uint8Array { + return CalldataRecord.encode(message).finish(); + }, + toProtoMsg(message: CalldataRecord): CalldataRecordProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord", + value: CalldataRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CalldataRecord.typeUrl, CalldataRecord); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/oracle.ts b/libs/injective-query/src/injective/oracle/v1beta1/oracle.ts new file mode 100644 index 00000000..36616d68 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/oracle.ts @@ -0,0 +1,3206 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OracleType { + Unspecified = 0, + Band = 1, + PriceFeed = 2, + Coinbase = 3, + Chainlink = 4, + Razor = 5, + Dia = 6, + API3 = 7, + Uma = 8, + Pyth = 9, + BandIBC = 10, + Provider = 11, + Stork = 12, + UNRECOGNIZED = -1, +} +export const OracleTypeAmino = OracleType; +export function oracleTypeFromJSON(object: any): OracleType { + switch (object) { + case 0: + case "Unspecified": + return OracleType.Unspecified; + case 1: + case "Band": + return OracleType.Band; + case 2: + case "PriceFeed": + return OracleType.PriceFeed; + case 3: + case "Coinbase": + return OracleType.Coinbase; + case 4: + case "Chainlink": + return OracleType.Chainlink; + case 5: + case "Razor": + return OracleType.Razor; + case 6: + case "Dia": + return OracleType.Dia; + case 7: + case "API3": + return OracleType.API3; + case 8: + case "Uma": + return OracleType.Uma; + case 9: + case "Pyth": + return OracleType.Pyth; + case 10: + case "BandIBC": + return OracleType.BandIBC; + case 11: + case "Provider": + return OracleType.Provider; + case 12: + case "Stork": + return OracleType.Stork; + case -1: + case "UNRECOGNIZED": + default: + return OracleType.UNRECOGNIZED; + } +} +export function oracleTypeToJSON(object: OracleType): string { + switch (object) { + case OracleType.Unspecified: + return "Unspecified"; + case OracleType.Band: + return "Band"; + case OracleType.PriceFeed: + return "PriceFeed"; + case OracleType.Coinbase: + return "Coinbase"; + case OracleType.Chainlink: + return "Chainlink"; + case OracleType.Razor: + return "Razor"; + case OracleType.Dia: + return "Dia"; + case OracleType.API3: + return "API3"; + case OracleType.Uma: + return "Uma"; + case OracleType.Pyth: + return "Pyth"; + case OracleType.BandIBC: + return "BandIBC"; + case OracleType.Provider: + return "Provider"; + case OracleType.Stork: + return "Stork"; + case OracleType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Params { + pythContract: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + pyth_contract: string; +} +export interface ParamsAminoMsg { + type: "oracle/Params"; + value: ParamsAmino; +} +export interface OracleInfo { + symbol: string; + oracleType: OracleType; +} +export interface OracleInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.OracleInfo"; + value: Uint8Array; +} +export interface OracleInfoAmino { + symbol: string; + oracle_type: OracleType; +} +export interface OracleInfoAminoMsg { + type: "/injective.oracle.v1beta1.OracleInfo"; + value: OracleInfoAmino; +} +export interface ChainlinkPriceState { + feedId: string; + answer: string; + timestamp: bigint; + priceState: PriceState; +} +export interface ChainlinkPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState"; + value: Uint8Array; +} +export interface ChainlinkPriceStateAmino { + feed_id: string; + answer: string; + timestamp: string; + price_state: PriceStateAmino; +} +export interface ChainlinkPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.ChainlinkPriceState"; + value: ChainlinkPriceStateAmino; +} +export interface BandPriceState { + symbol: string; + rate: string; + resolveTime: bigint; + requestID: bigint; + priceState: PriceState; +} +export interface BandPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandPriceState"; + value: Uint8Array; +} +export interface BandPriceStateAmino { + symbol: string; + rate: string; + resolve_time: string; + request_ID: string; + price_state: PriceStateAmino; +} +export interface BandPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.BandPriceState"; + value: BandPriceStateAmino; +} +export interface PriceFeedState { + base: string; + quote: string; + priceState?: PriceState; + relayers: string[]; +} +export interface PriceFeedStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState"; + value: Uint8Array; +} +export interface PriceFeedStateAmino { + base: string; + quote: string; + price_state?: PriceStateAmino; + relayers: string[]; +} +export interface PriceFeedStateAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedState"; + value: PriceFeedStateAmino; +} +export interface ProviderInfo { + provider: string; + relayers: string[]; +} +export interface ProviderInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo"; + value: Uint8Array; +} +export interface ProviderInfoAmino { + provider: string; + relayers: string[]; +} +export interface ProviderInfoAminoMsg { + type: "/injective.oracle.v1beta1.ProviderInfo"; + value: ProviderInfoAmino; +} +export interface ProviderState { + providerInfo?: ProviderInfo; + providerPriceStates: ProviderPriceState[]; +} +export interface ProviderStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderState"; + value: Uint8Array; +} +export interface ProviderStateAmino { + provider_info?: ProviderInfoAmino; + provider_price_states: ProviderPriceStateAmino[]; +} +export interface ProviderStateAminoMsg { + type: "/injective.oracle.v1beta1.ProviderState"; + value: ProviderStateAmino; +} +export interface ProviderPriceState { + symbol: string; + state?: PriceState; +} +export interface ProviderPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState"; + value: Uint8Array; +} +export interface ProviderPriceStateAmino { + symbol: string; + state?: PriceStateAmino; +} +export interface ProviderPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.ProviderPriceState"; + value: ProviderPriceStateAmino; +} +export interface PriceFeedInfo { + base: string; + quote: string; +} +export interface PriceFeedInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo"; + value: Uint8Array; +} +export interface PriceFeedInfoAmino { + base: string; + quote: string; +} +export interface PriceFeedInfoAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedInfo"; + value: PriceFeedInfoAmino; +} +export interface PriceFeedPrice { + price: string; +} +export interface PriceFeedPriceProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice"; + value: Uint8Array; +} +export interface PriceFeedPriceAmino { + price: string; +} +export interface PriceFeedPriceAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedPrice"; + value: PriceFeedPriceAmino; +} +export interface CoinbasePriceState { + /** kind should always be "prices" */ + kind: string; + /** timestamp of the when the price was signed by coinbase */ + timestamp: bigint; + /** the symbol of the price, e.g. BTC */ + key: string; + /** the value of the price scaled by 1e6 */ + value: bigint; + /** the price state */ + priceState: PriceState; +} +export interface CoinbasePriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState"; + value: Uint8Array; +} +export interface CoinbasePriceStateAmino { + /** kind should always be "prices" */ + kind: string; + /** timestamp of the when the price was signed by coinbase */ + timestamp: string; + /** the symbol of the price, e.g. BTC */ + key: string; + /** the value of the price scaled by 1e6 */ + value: string; + /** the price state */ + price_state: PriceStateAmino; +} +export interface CoinbasePriceStateAminoMsg { + type: "/injective.oracle.v1beta1.CoinbasePriceState"; + value: CoinbasePriceStateAmino; +} +export interface StorkPriceState { + /** timestamp of the when the price was signed by stork */ + timestamp: bigint; + /** the symbol of the price, e.g. BTC */ + symbol: string; + /** the value of the price scaled by 1e18 */ + value: string; + /** the price state */ + priceState: PriceState; +} +export interface StorkPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState"; + value: Uint8Array; +} +export interface StorkPriceStateAmino { + /** timestamp of the when the price was signed by stork */ + timestamp: string; + /** the symbol of the price, e.g. BTC */ + symbol: string; + /** the value of the price scaled by 1e18 */ + value: string; + /** the price state */ + price_state: PriceStateAmino; +} +export interface StorkPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.StorkPriceState"; + value: StorkPriceStateAmino; +} +export interface PriceState { + price: string; + cumulativePrice: string; + timestamp: bigint; +} +export interface PriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceState"; + value: Uint8Array; +} +export interface PriceStateAmino { + price: string; + cumulative_price: string; + timestamp: string; +} +export interface PriceStateAminoMsg { + type: "/injective.oracle.v1beta1.PriceState"; + value: PriceStateAmino; +} +export interface PythPriceState { + priceId: string; + emaPrice: string; + emaConf: string; + conf: string; + publishTime: bigint; + priceState: PriceState; +} +export interface PythPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PythPriceState"; + value: Uint8Array; +} +export interface PythPriceStateAmino { + price_id: string; + ema_price: string; + ema_conf: string; + conf: string; + publish_time: string; + price_state: PriceStateAmino; +} +export interface PythPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.PythPriceState"; + value: PythPriceStateAmino; +} +export interface BandOracleRequest { + /** Unique Identifier for band ibc oracle request */ + requestId: bigint; + /** + * OracleScriptID is the unique identifier of the oracle script to be + * executed. + */ + oracleScriptId: bigint; + /** Symbols is the list of symbols to prepare in the calldata */ + symbols: string[]; + /** + * AskCount is the number of validators that are requested to respond to this + * oracle request. Higher value means more security, at a higher gas cost. + */ + askCount: bigint; + /** + * MinCount is the minimum number of validators necessary for the request to + * proceed to the execution phase. Higher value means more security, at the + * cost of liveness. + */ + minCount: bigint; + /** + * FeeLimit is the maximum tokens that will be paid to all data source + * providers. + */ + feeLimit: Coin[]; + /** PrepareGas is amount of gas to pay to prepare raw requests */ + prepareGas: bigint; + /** ExecuteGas is amount of gas to reserve for executing */ + executeGas: bigint; + /** + * MinSourceCount is the minimum number of data sources that must be used by + * each validator + */ + minSourceCount: bigint; +} +export interface BandOracleRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest"; + value: Uint8Array; +} +export interface BandOracleRequestAmino { + /** Unique Identifier for band ibc oracle request */ + request_id: string; + /** + * OracleScriptID is the unique identifier of the oracle script to be + * executed. + */ + oracle_script_id: string; + /** Symbols is the list of symbols to prepare in the calldata */ + symbols: string[]; + /** + * AskCount is the number of validators that are requested to respond to this + * oracle request. Higher value means more security, at a higher gas cost. + */ + ask_count: string; + /** + * MinCount is the minimum number of validators necessary for the request to + * proceed to the execution phase. Higher value means more security, at the + * cost of liveness. + */ + min_count: string; + /** + * FeeLimit is the maximum tokens that will be paid to all data source + * providers. + */ + fee_limit: CoinAmino[]; + /** PrepareGas is amount of gas to pay to prepare raw requests */ + prepare_gas: string; + /** ExecuteGas is amount of gas to reserve for executing */ + execute_gas: string; + /** + * MinSourceCount is the minimum number of data sources that must be used by + * each validator + */ + min_source_count: string; +} +export interface BandOracleRequestAminoMsg { + type: "/injective.oracle.v1beta1.BandOracleRequest"; + value: BandOracleRequestAmino; +} +export interface BandIBCParams { + /** true if Band IBC should be enabled */ + bandIbcEnabled: boolean; + /** block request interval to send Band IBC prices */ + ibcRequestInterval: bigint; + /** band IBC source channel */ + ibcSourceChannel: string; + /** band IBC version */ + ibcVersion: string; + /** band IBC portID */ + ibcPortId: string; + /** legacy oracle scheme ids */ + legacyOracleIds: bigint[]; +} +export interface BandIBCParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams"; + value: Uint8Array; +} +export interface BandIBCParamsAmino { + /** true if Band IBC should be enabled */ + band_ibc_enabled: boolean; + /** block request interval to send Band IBC prices */ + ibc_request_interval: string; + /** band IBC source channel */ + ibc_source_channel: string; + /** band IBC version */ + ibc_version: string; + /** band IBC portID */ + ibc_port_id: string; + /** legacy oracle scheme ids */ + legacy_oracle_ids: string[]; +} +export interface BandIBCParamsAminoMsg { + type: "/injective.oracle.v1beta1.BandIBCParams"; + value: BandIBCParamsAmino; +} +export interface SymbolPriceTimestamp { + oracle: OracleType; + symbolId: string; + timestamp: bigint; +} +export interface SymbolPriceTimestampProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp"; + value: Uint8Array; +} +export interface SymbolPriceTimestampAmino { + oracle: OracleType; + symbol_id: string; + timestamp: string; +} +export interface SymbolPriceTimestampAminoMsg { + type: "/injective.oracle.v1beta1.SymbolPriceTimestamp"; + value: SymbolPriceTimestampAmino; +} +export interface LastPriceTimestamps { + lastPriceTimestamps: SymbolPriceTimestamp[]; +} +export interface LastPriceTimestampsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps"; + value: Uint8Array; +} +export interface LastPriceTimestampsAmino { + last_price_timestamps: SymbolPriceTimestampAmino[]; +} +export interface LastPriceTimestampsAminoMsg { + type: "/injective.oracle.v1beta1.LastPriceTimestamps"; + value: LastPriceTimestampsAmino; +} +export interface PriceRecords { + oracle: OracleType; + symbolId: string; + latestPriceRecords: PriceRecord[]; +} +export interface PriceRecordsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceRecords"; + value: Uint8Array; +} +export interface PriceRecordsAmino { + oracle: OracleType; + symbol_id: string; + latest_price_records: PriceRecordAmino[]; +} +export interface PriceRecordsAminoMsg { + type: "/injective.oracle.v1beta1.PriceRecords"; + value: PriceRecordsAmino; +} +export interface PriceRecord { + timestamp: bigint; + price: string; +} +export interface PriceRecordProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceRecord"; + value: Uint8Array; +} +export interface PriceRecordAmino { + timestamp: string; + price: string; +} +export interface PriceRecordAminoMsg { + type: "/injective.oracle.v1beta1.PriceRecord"; + value: PriceRecordAmino; +} +/** + * MetadataStatistics refers to the metadata summary statistics of the + * historical sample considered + */ +export interface MetadataStatistics { + /** + * GroupCount refers to the number of groups used. Equals RecordsSampleSize if + * no grouping is used + */ + groupCount: number; + /** RecordsSampleSize refers to the total number of records used. */ + recordsSampleSize: number; + /** + * Mean refers to the arithmetic mean + * For trades, the mean is the VWAP computed over the grouped trade records ∑ + * (price * quantity) / ∑ quantity For oracle prices, the mean is computed + * over the price records ∑ (price) / prices_count + */ + mean: string; + /** + * TWAP refers to the time-weighted average price which equals ∑ (price_i * + * ∆t_i) / ∑ ∆t_i where ∆t_i = t_i - t_{i-1} + */ + twap: string; + /** FirstTimestamp is the timestamp of the oldest record considered */ + firstTimestamp: bigint; + /** LastTimestamp is the timestamp of the youngest record considered */ + lastTimestamp: bigint; + /** MinPrice refers to the smallest individual raw price considered */ + minPrice: string; + /** MaxPrice refers to the largest individual raw price considered */ + maxPrice: string; + /** MedianPrice refers to the median individual raw price considered */ + medianPrice: string; +} +export interface MetadataStatisticsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics"; + value: Uint8Array; +} +/** + * MetadataStatistics refers to the metadata summary statistics of the + * historical sample considered + */ +export interface MetadataStatisticsAmino { + /** + * GroupCount refers to the number of groups used. Equals RecordsSampleSize if + * no grouping is used + */ + group_count: number; + /** RecordsSampleSize refers to the total number of records used. */ + records_sample_size: number; + /** + * Mean refers to the arithmetic mean + * For trades, the mean is the VWAP computed over the grouped trade records ∑ + * (price * quantity) / ∑ quantity For oracle prices, the mean is computed + * over the price records ∑ (price) / prices_count + */ + mean: string; + /** + * TWAP refers to the time-weighted average price which equals ∑ (price_i * + * ∆t_i) / ∑ ∆t_i where ∆t_i = t_i - t_{i-1} + */ + twap: string; + /** FirstTimestamp is the timestamp of the oldest record considered */ + first_timestamp: string; + /** LastTimestamp is the timestamp of the youngest record considered */ + last_timestamp: string; + /** MinPrice refers to the smallest individual raw price considered */ + min_price: string; + /** MaxPrice refers to the largest individual raw price considered */ + max_price: string; + /** MedianPrice refers to the median individual raw price considered */ + median_price: string; +} +export interface MetadataStatisticsAminoMsg { + type: "/injective.oracle.v1beta1.MetadataStatistics"; + value: MetadataStatisticsAmino; +} +export interface PriceAttestation { + priceId: string; + /** MaxPrice refers to the largest individual raw price considered */ + price: bigint; + conf: bigint; + expo: number; + emaPrice: bigint; + emaConf: bigint; + emaExpo: number; + publishTime: bigint; +} +export interface PriceAttestationProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation"; + value: Uint8Array; +} +export interface PriceAttestationAmino { + price_id: string; + /** MaxPrice refers to the largest individual raw price considered */ + price: string; + conf: string; + expo: number; + ema_price: string; + ema_conf: string; + ema_expo: number; + publish_time: string; +} +export interface PriceAttestationAminoMsg { + type: "/injective.oracle.v1beta1.PriceAttestation"; + value: PriceAttestationAmino; +} +export interface AssetPair { + assetId: string; + signedPrices: SignedPriceOfAssetPair[]; +} +export interface AssetPairProtoMsg { + typeUrl: "/injective.oracle.v1beta1.AssetPair"; + value: Uint8Array; +} +export interface AssetPairAmino { + asset_id: string; + signed_prices: SignedPriceOfAssetPairAmino[]; +} +export interface AssetPairAminoMsg { + type: "/injective.oracle.v1beta1.AssetPair"; + value: AssetPairAmino; +} +export interface SignedPriceOfAssetPair { + publisherKey: string; + timestamp: bigint; + price: string; + signature: Uint8Array; +} +export interface SignedPriceOfAssetPairProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair"; + value: Uint8Array; +} +export interface SignedPriceOfAssetPairAmino { + publisher_key: string; + timestamp: string; + price: string; + signature: string; +} +export interface SignedPriceOfAssetPairAminoMsg { + type: "/injective.oracle.v1beta1.SignedPriceOfAssetPair"; + value: SignedPriceOfAssetPairAmino; +} +function createBaseParams(): Params { + return { + pythContract: "" + }; +} +export const Params = { + typeUrl: "/injective.oracle.v1beta1.Params", + aminoType: "oracle/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.pythContract === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.pyth_contract === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pythContract !== "") { + writer.uint32(10).string(message.pythContract); + } + 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.pythContract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.pythContract = object.pythContract ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.pyth_contract !== undefined && object.pyth_contract !== null) { + message.pythContract = object.pyth_contract; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.pyth_contract = message.pythContract === "" ? undefined : message.pythContract; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "oracle/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: "/injective.oracle.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseOracleInfo(): OracleInfo { + return { + symbol: "", + oracleType: 0 + }; +} +export const OracleInfo = { + typeUrl: "/injective.oracle.v1beta1.OracleInfo", + is(o: any): o is OracleInfo { + return o && (o.$typeUrl === OracleInfo.typeUrl || typeof o.symbol === "string" && isSet(o.oracleType)); + }, + isAmino(o: any): o is OracleInfoAmino { + return o && (o.$typeUrl === OracleInfo.typeUrl || typeof o.symbol === "string" && isSet(o.oracle_type)); + }, + encode(message: OracleInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.oracleType !== 0) { + writer.uint32(16).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleInfo { + const message = createBaseOracleInfo(); + message.symbol = object.symbol ?? ""; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: OracleInfoAmino): OracleInfo { + const message = createBaseOracleInfo(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: OracleInfo): OracleInfoAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: OracleInfoAminoMsg): OracleInfo { + return OracleInfo.fromAmino(object.value); + }, + fromProtoMsg(message: OracleInfoProtoMsg): OracleInfo { + return OracleInfo.decode(message.value); + }, + toProto(message: OracleInfo): Uint8Array { + return OracleInfo.encode(message).finish(); + }, + toProtoMsg(message: OracleInfo): OracleInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.OracleInfo", + value: OracleInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleInfo.typeUrl, OracleInfo); +function createBaseChainlinkPriceState(): ChainlinkPriceState { + return { + feedId: "", + answer: "", + timestamp: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const ChainlinkPriceState = { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState", + is(o: any): o is ChainlinkPriceState { + return o && (o.$typeUrl === ChainlinkPriceState.typeUrl || typeof o.feedId === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is ChainlinkPriceStateAmino { + return o && (o.$typeUrl === ChainlinkPriceState.typeUrl || typeof o.feed_id === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: ChainlinkPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.answer !== "") { + writer.uint32(18).string(message.answer); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ChainlinkPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChainlinkPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.answer = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + case 4: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ChainlinkPriceState { + const message = createBaseChainlinkPriceState(); + message.feedId = object.feedId ?? ""; + message.answer = object.answer ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: ChainlinkPriceStateAmino): ChainlinkPriceState { + const message = createBaseChainlinkPriceState(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: ChainlinkPriceState): ChainlinkPriceStateAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: ChainlinkPriceStateAminoMsg): ChainlinkPriceState { + return ChainlinkPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: ChainlinkPriceStateProtoMsg): ChainlinkPriceState { + return ChainlinkPriceState.decode(message.value); + }, + toProto(message: ChainlinkPriceState): Uint8Array { + return ChainlinkPriceState.encode(message).finish(); + }, + toProtoMsg(message: ChainlinkPriceState): ChainlinkPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState", + value: ChainlinkPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ChainlinkPriceState.typeUrl, ChainlinkPriceState); +function createBaseBandPriceState(): BandPriceState { + return { + symbol: "", + rate: "", + resolveTime: BigInt(0), + requestID: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const BandPriceState = { + typeUrl: "/injective.oracle.v1beta1.BandPriceState", + is(o: any): o is BandPriceState { + return o && (o.$typeUrl === BandPriceState.typeUrl || typeof o.symbol === "string" && typeof o.rate === "string" && typeof o.resolveTime === "bigint" && typeof o.requestID === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is BandPriceStateAmino { + return o && (o.$typeUrl === BandPriceState.typeUrl || typeof o.symbol === "string" && typeof o.rate === "string" && typeof o.resolve_time === "bigint" && typeof o.request_ID === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: BandPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.rate !== "") { + writer.uint32(18).string(message.rate); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(24).uint64(message.resolveTime); + } + if (message.requestID !== BigInt(0)) { + writer.uint32(32).uint64(message.requestID); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.rate = reader.string(); + break; + case 3: + message.resolveTime = reader.uint64(); + break; + case 4: + message.requestID = reader.uint64(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandPriceState { + const message = createBaseBandPriceState(); + message.symbol = object.symbol ?? ""; + message.rate = object.rate ?? ""; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestID = object.requestID !== undefined && object.requestID !== null ? BigInt(object.requestID.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: BandPriceStateAmino): BandPriceState { + const message = createBaseBandPriceState(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_ID !== undefined && object.request_ID !== null) { + message.requestID = BigInt(object.request_ID); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: BandPriceState): BandPriceStateAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.rate = message.rate === "" ? undefined : message.rate; + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_ID = message.requestID !== BigInt(0) ? message.requestID?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: BandPriceStateAminoMsg): BandPriceState { + return BandPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: BandPriceStateProtoMsg): BandPriceState { + return BandPriceState.decode(message.value); + }, + toProto(message: BandPriceState): Uint8Array { + return BandPriceState.encode(message).finish(); + }, + toProtoMsg(message: BandPriceState): BandPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandPriceState", + value: BandPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandPriceState.typeUrl, BandPriceState); +function createBasePriceFeedState(): PriceFeedState { + return { + base: "", + quote: "", + priceState: undefined, + relayers: [] + }; +} +export const PriceFeedState = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState", + is(o: any): o is PriceFeedState { + return o && (o.$typeUrl === PriceFeedState.typeUrl || typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is PriceFeedStateAmino { + return o && (o.$typeUrl === PriceFeedState.typeUrl || typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: PriceFeedState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== "") { + writer.uint32(10).string(message.base); + } + if (message.quote !== "") { + writer.uint32(18).string(message.quote); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.relayers) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = reader.string(); + break; + case 2: + message.quote = reader.string(); + break; + case 3: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + case 4: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedState { + const message = createBasePriceFeedState(); + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: PriceFeedStateAmino): PriceFeedState { + const message = createBasePriceFeedState(); + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: PriceFeedState): PriceFeedStateAmino { + const obj: any = {}; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: PriceFeedStateAminoMsg): PriceFeedState { + return PriceFeedState.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedStateProtoMsg): PriceFeedState { + return PriceFeedState.decode(message.value); + }, + toProto(message: PriceFeedState): Uint8Array { + return PriceFeedState.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedState): PriceFeedStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState", + value: PriceFeedState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedState.typeUrl, PriceFeedState); +function createBaseProviderInfo(): ProviderInfo { + return { + provider: "", + relayers: [] + }; +} +export const ProviderInfo = { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo", + is(o: any): o is ProviderInfo { + return o && (o.$typeUrl === ProviderInfo.typeUrl || typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is ProviderInfoAmino { + return o && (o.$typeUrl === ProviderInfo.typeUrl || typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: ProviderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderInfo { + const message = createBaseProviderInfo(); + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: ProviderInfoAmino): ProviderInfo { + const message = createBaseProviderInfo(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: ProviderInfo): ProviderInfoAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: ProviderInfoAminoMsg): ProviderInfo { + return ProviderInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderInfoProtoMsg): ProviderInfo { + return ProviderInfo.decode(message.value); + }, + toProto(message: ProviderInfo): Uint8Array { + return ProviderInfo.encode(message).finish(); + }, + toProtoMsg(message: ProviderInfo): ProviderInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo", + value: ProviderInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderInfo.typeUrl, ProviderInfo); +function createBaseProviderState(): ProviderState { + return { + providerInfo: undefined, + providerPriceStates: [] + }; +} +export const ProviderState = { + typeUrl: "/injective.oracle.v1beta1.ProviderState", + is(o: any): o is ProviderState { + return o && (o.$typeUrl === ProviderState.typeUrl || Array.isArray(o.providerPriceStates) && (!o.providerPriceStates.length || ProviderPriceState.is(o.providerPriceStates[0]))); + }, + isAmino(o: any): o is ProviderStateAmino { + return o && (o.$typeUrl === ProviderState.typeUrl || Array.isArray(o.provider_price_states) && (!o.provider_price_states.length || ProviderPriceState.isAmino(o.provider_price_states[0]))); + }, + encode(message: ProviderState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.providerInfo !== undefined) { + ProviderInfo.encode(message.providerInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.providerPriceStates) { + ProviderPriceState.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providerInfo = ProviderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.providerPriceStates.push(ProviderPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderState { + const message = createBaseProviderState(); + message.providerInfo = object.providerInfo !== undefined && object.providerInfo !== null ? ProviderInfo.fromPartial(object.providerInfo) : undefined; + message.providerPriceStates = object.providerPriceStates?.map(e => ProviderPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProviderStateAmino): ProviderState { + const message = createBaseProviderState(); + if (object.provider_info !== undefined && object.provider_info !== null) { + message.providerInfo = ProviderInfo.fromAmino(object.provider_info); + } + message.providerPriceStates = object.provider_price_states?.map(e => ProviderPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: ProviderState): ProviderStateAmino { + const obj: any = {}; + obj.provider_info = message.providerInfo ? ProviderInfo.toAmino(message.providerInfo) : undefined; + if (message.providerPriceStates) { + obj.provider_price_states = message.providerPriceStates.map(e => e ? ProviderPriceState.toAmino(e) : undefined); + } else { + obj.provider_price_states = message.providerPriceStates; + } + return obj; + }, + fromAminoMsg(object: ProviderStateAminoMsg): ProviderState { + return ProviderState.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderStateProtoMsg): ProviderState { + return ProviderState.decode(message.value); + }, + toProto(message: ProviderState): Uint8Array { + return ProviderState.encode(message).finish(); + }, + toProtoMsg(message: ProviderState): ProviderStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderState", + value: ProviderState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderState.typeUrl, ProviderState); +function createBaseProviderPriceState(): ProviderPriceState { + return { + symbol: "", + state: undefined + }; +} +export const ProviderPriceState = { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState", + is(o: any): o is ProviderPriceState { + return o && (o.$typeUrl === ProviderPriceState.typeUrl || typeof o.symbol === "string"); + }, + isAmino(o: any): o is ProviderPriceStateAmino { + return o && (o.$typeUrl === ProviderPriceState.typeUrl || typeof o.symbol === "string"); + }, + encode(message: ProviderPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.state !== undefined) { + PriceState.encode(message.state, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.state = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderPriceState { + const message = createBaseProviderPriceState(); + message.symbol = object.symbol ?? ""; + message.state = object.state !== undefined && object.state !== null ? PriceState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: ProviderPriceStateAmino): ProviderPriceState { + const message = createBaseProviderPriceState(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.state !== undefined && object.state !== null) { + message.state = PriceState.fromAmino(object.state); + } + return message; + }, + toAmino(message: ProviderPriceState): ProviderPriceStateAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.state = message.state ? PriceState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: ProviderPriceStateAminoMsg): ProviderPriceState { + return ProviderPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderPriceStateProtoMsg): ProviderPriceState { + return ProviderPriceState.decode(message.value); + }, + toProto(message: ProviderPriceState): Uint8Array { + return ProviderPriceState.encode(message).finish(); + }, + toProtoMsg(message: ProviderPriceState): ProviderPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState", + value: ProviderPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderPriceState.typeUrl, ProviderPriceState); +function createBasePriceFeedInfo(): PriceFeedInfo { + return { + base: "", + quote: "" + }; +} +export const PriceFeedInfo = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo", + is(o: any): o is PriceFeedInfo { + return o && (o.$typeUrl === PriceFeedInfo.typeUrl || typeof o.base === "string" && typeof o.quote === "string"); + }, + isAmino(o: any): o is PriceFeedInfoAmino { + return o && (o.$typeUrl === PriceFeedInfo.typeUrl || typeof o.base === "string" && typeof o.quote === "string"); + }, + encode(message: PriceFeedInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== "") { + writer.uint32(10).string(message.base); + } + if (message.quote !== "") { + writer.uint32(18).string(message.quote); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = reader.string(); + break; + case 2: + message.quote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedInfo { + const message = createBasePriceFeedInfo(); + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + return message; + }, + fromAmino(object: PriceFeedInfoAmino): PriceFeedInfo { + const message = createBasePriceFeedInfo(); + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + return message; + }, + toAmino(message: PriceFeedInfo): PriceFeedInfoAmino { + const obj: any = {}; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + return obj; + }, + fromAminoMsg(object: PriceFeedInfoAminoMsg): PriceFeedInfo { + return PriceFeedInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedInfoProtoMsg): PriceFeedInfo { + return PriceFeedInfo.decode(message.value); + }, + toProto(message: PriceFeedInfo): Uint8Array { + return PriceFeedInfo.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedInfo): PriceFeedInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo", + value: PriceFeedInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedInfo.typeUrl, PriceFeedInfo); +function createBasePriceFeedPrice(): PriceFeedPrice { + return { + price: "" + }; +} +export const PriceFeedPrice = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice", + is(o: any): o is PriceFeedPrice { + return o && (o.$typeUrl === PriceFeedPrice.typeUrl || typeof o.price === "string"); + }, + isAmino(o: any): o is PriceFeedPriceAmino { + return o && (o.$typeUrl === PriceFeedPrice.typeUrl || typeof o.price === "string"); + }, + encode(message: PriceFeedPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedPrice { + const message = createBasePriceFeedPrice(); + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: PriceFeedPriceAmino): PriceFeedPrice { + const message = createBasePriceFeedPrice(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: PriceFeedPrice): PriceFeedPriceAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: PriceFeedPriceAminoMsg): PriceFeedPrice { + return PriceFeedPrice.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedPriceProtoMsg): PriceFeedPrice { + return PriceFeedPrice.decode(message.value); + }, + toProto(message: PriceFeedPrice): Uint8Array { + return PriceFeedPrice.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedPrice): PriceFeedPriceProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice", + value: PriceFeedPrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedPrice.typeUrl, PriceFeedPrice); +function createBaseCoinbasePriceState(): CoinbasePriceState { + return { + kind: "", + timestamp: BigInt(0), + key: "", + value: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const CoinbasePriceState = { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState", + is(o: any): o is CoinbasePriceState { + return o && (o.$typeUrl === CoinbasePriceState.typeUrl || typeof o.kind === "string" && typeof o.timestamp === "bigint" && typeof o.key === "string" && typeof o.value === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is CoinbasePriceStateAmino { + return o && (o.$typeUrl === CoinbasePriceState.typeUrl || typeof o.kind === "string" && typeof o.timestamp === "bigint" && typeof o.key === "string" && typeof o.value === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: CoinbasePriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.key !== "") { + writer.uint32(26).string(message.key); + } + if (message.value !== BigInt(0)) { + writer.uint32(32).uint64(message.value); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CoinbasePriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoinbasePriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.key = reader.string(); + break; + case 4: + message.value = reader.uint64(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CoinbasePriceState { + const message = createBaseCoinbasePriceState(); + message.kind = object.kind ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: CoinbasePriceStateAmino): CoinbasePriceState { + const message = createBaseCoinbasePriceState(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: CoinbasePriceState): CoinbasePriceStateAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: CoinbasePriceStateAminoMsg): CoinbasePriceState { + return CoinbasePriceState.fromAmino(object.value); + }, + fromProtoMsg(message: CoinbasePriceStateProtoMsg): CoinbasePriceState { + return CoinbasePriceState.decode(message.value); + }, + toProto(message: CoinbasePriceState): Uint8Array { + return CoinbasePriceState.encode(message).finish(); + }, + toProtoMsg(message: CoinbasePriceState): CoinbasePriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState", + value: CoinbasePriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CoinbasePriceState.typeUrl, CoinbasePriceState); +function createBaseStorkPriceState(): StorkPriceState { + return { + timestamp: BigInt(0), + symbol: "", + value: "", + priceState: PriceState.fromPartial({}) + }; +} +export const StorkPriceState = { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState", + is(o: any): o is StorkPriceState { + return o && (o.$typeUrl === StorkPriceState.typeUrl || typeof o.timestamp === "bigint" && typeof o.symbol === "string" && typeof o.value === "string" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is StorkPriceStateAmino { + return o && (o.$typeUrl === StorkPriceState.typeUrl || typeof o.timestamp === "bigint" && typeof o.symbol === "string" && typeof o.value === "string" && PriceState.isAmino(o.price_state)); + }, + encode(message: StorkPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).uint64(message.timestamp); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StorkPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorkPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StorkPriceState { + const message = createBaseStorkPriceState(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.symbol = object.symbol ?? ""; + message.value = object.value ?? ""; + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: StorkPriceStateAmino): StorkPriceState { + const message = createBaseStorkPriceState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: StorkPriceState): StorkPriceStateAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.value = message.value === "" ? undefined : message.value; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: StorkPriceStateAminoMsg): StorkPriceState { + return StorkPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: StorkPriceStateProtoMsg): StorkPriceState { + return StorkPriceState.decode(message.value); + }, + toProto(message: StorkPriceState): Uint8Array { + return StorkPriceState.encode(message).finish(); + }, + toProtoMsg(message: StorkPriceState): StorkPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState", + value: StorkPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StorkPriceState.typeUrl, StorkPriceState); +function createBasePriceState(): PriceState { + return { + price: "", + cumulativePrice: "", + timestamp: BigInt(0) + }; +} +export const PriceState = { + typeUrl: "/injective.oracle.v1beta1.PriceState", + is(o: any): o is PriceState { + return o && (o.$typeUrl === PriceState.typeUrl || typeof o.price === "string" && typeof o.cumulativePrice === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is PriceStateAmino { + return o && (o.$typeUrl === PriceState.typeUrl || typeof o.price === "string" && typeof o.cumulative_price === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: PriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.cumulativePrice !== "") { + writer.uint32(18).string(message.cumulativePrice); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).int64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.cumulativePrice = reader.string(); + break; + case 3: + message.timestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceState { + const message = createBasePriceState(); + message.price = object.price ?? ""; + message.cumulativePrice = object.cumulativePrice ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PriceStateAmino): PriceState { + const message = createBasePriceState(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.cumulative_price !== undefined && object.cumulative_price !== null) { + message.cumulativePrice = object.cumulative_price; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: PriceState): PriceStateAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.cumulative_price = message.cumulativePrice === "" ? undefined : message.cumulativePrice; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PriceStateAminoMsg): PriceState { + return PriceState.fromAmino(object.value); + }, + fromProtoMsg(message: PriceStateProtoMsg): PriceState { + return PriceState.decode(message.value); + }, + toProto(message: PriceState): Uint8Array { + return PriceState.encode(message).finish(); + }, + toProtoMsg(message: PriceState): PriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceState", + value: PriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceState.typeUrl, PriceState); +function createBasePythPriceState(): PythPriceState { + return { + priceId: "", + emaPrice: "", + emaConf: "", + conf: "", + publishTime: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const PythPriceState = { + typeUrl: "/injective.oracle.v1beta1.PythPriceState", + is(o: any): o is PythPriceState { + return o && (o.$typeUrl === PythPriceState.typeUrl || typeof o.priceId === "string" && typeof o.emaPrice === "string" && typeof o.emaConf === "string" && typeof o.conf === "string" && typeof o.publishTime === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is PythPriceStateAmino { + return o && (o.$typeUrl === PythPriceState.typeUrl || typeof o.price_id === "string" && typeof o.ema_price === "string" && typeof o.ema_conf === "string" && typeof o.conf === "string" && typeof o.publish_time === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: PythPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + if (message.emaPrice !== "") { + writer.uint32(18).string(message.emaPrice); + } + if (message.emaConf !== "") { + writer.uint32(26).string(message.emaConf); + } + if (message.conf !== "") { + writer.uint32(34).string(message.conf); + } + if (message.publishTime !== BigInt(0)) { + writer.uint32(40).uint64(message.publishTime); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PythPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePythPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + case 2: + message.emaPrice = reader.string(); + break; + case 3: + message.emaConf = reader.string(); + break; + case 4: + message.conf = reader.string(); + break; + case 5: + message.publishTime = reader.uint64(); + break; + case 6: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PythPriceState { + const message = createBasePythPriceState(); + message.priceId = object.priceId ?? ""; + message.emaPrice = object.emaPrice ?? ""; + message.emaConf = object.emaConf ?? ""; + message.conf = object.conf ?? ""; + message.publishTime = object.publishTime !== undefined && object.publishTime !== null ? BigInt(object.publishTime.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: PythPriceStateAmino): PythPriceState { + const message = createBasePythPriceState(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + if (object.ema_price !== undefined && object.ema_price !== null) { + message.emaPrice = object.ema_price; + } + if (object.ema_conf !== undefined && object.ema_conf !== null) { + message.emaConf = object.ema_conf; + } + if (object.conf !== undefined && object.conf !== null) { + message.conf = object.conf; + } + if (object.publish_time !== undefined && object.publish_time !== null) { + message.publishTime = BigInt(object.publish_time); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: PythPriceState): PythPriceStateAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + obj.ema_price = message.emaPrice === "" ? undefined : message.emaPrice; + obj.ema_conf = message.emaConf === "" ? undefined : message.emaConf; + obj.conf = message.conf === "" ? undefined : message.conf; + obj.publish_time = message.publishTime !== BigInt(0) ? message.publishTime?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: PythPriceStateAminoMsg): PythPriceState { + return PythPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: PythPriceStateProtoMsg): PythPriceState { + return PythPriceState.decode(message.value); + }, + toProto(message: PythPriceState): Uint8Array { + return PythPriceState.encode(message).finish(); + }, + toProtoMsg(message: PythPriceState): PythPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PythPriceState", + value: PythPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PythPriceState.typeUrl, PythPriceState); +function createBaseBandOracleRequest(): BandOracleRequest { + return { + requestId: BigInt(0), + oracleScriptId: BigInt(0), + symbols: [], + askCount: BigInt(0), + minCount: BigInt(0), + feeLimit: [], + prepareGas: BigInt(0), + executeGas: BigInt(0), + minSourceCount: BigInt(0) + }; +} +export const BandOracleRequest = { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest", + is(o: any): o is BandOracleRequest { + return o && (o.$typeUrl === BandOracleRequest.typeUrl || typeof o.requestId === "bigint" && typeof o.oracleScriptId === "bigint" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && typeof o.askCount === "bigint" && typeof o.minCount === "bigint" && Array.isArray(o.feeLimit) && (!o.feeLimit.length || Coin.is(o.feeLimit[0])) && typeof o.prepareGas === "bigint" && typeof o.executeGas === "bigint" && typeof o.minSourceCount === "bigint"); + }, + isAmino(o: any): o is BandOracleRequestAmino { + return o && (o.$typeUrl === BandOracleRequest.typeUrl || typeof o.request_id === "bigint" && typeof o.oracle_script_id === "bigint" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && typeof o.ask_count === "bigint" && typeof o.min_count === "bigint" && Array.isArray(o.fee_limit) && (!o.fee_limit.length || Coin.isAmino(o.fee_limit[0])) && typeof o.prepare_gas === "bigint" && typeof o.execute_gas === "bigint" && typeof o.min_source_count === "bigint"); + }, + encode(message: BandOracleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.requestId !== BigInt(0)) { + writer.uint32(8).uint64(message.requestId); + } + if (message.oracleScriptId !== BigInt(0)) { + writer.uint32(16).int64(message.oracleScriptId); + } + for (const v of message.symbols) { + writer.uint32(26).string(v!); + } + if (message.askCount !== BigInt(0)) { + writer.uint32(32).uint64(message.askCount); + } + if (message.minCount !== BigInt(0)) { + writer.uint32(40).uint64(message.minCount); + } + for (const v of message.feeLimit) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.prepareGas !== BigInt(0)) { + writer.uint32(56).uint64(message.prepareGas); + } + if (message.executeGas !== BigInt(0)) { + writer.uint32(64).uint64(message.executeGas); + } + if (message.minSourceCount !== BigInt(0)) { + writer.uint32(72).uint64(message.minSourceCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandOracleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandOracleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.uint64(); + break; + case 2: + message.oracleScriptId = reader.int64(); + break; + case 3: + message.symbols.push(reader.string()); + break; + case 4: + message.askCount = reader.uint64(); + break; + case 5: + message.minCount = reader.uint64(); + break; + case 6: + message.feeLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.prepareGas = reader.uint64(); + break; + case 8: + message.executeGas = reader.uint64(); + break; + case 9: + message.minSourceCount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandOracleRequest { + const message = createBaseBandOracleRequest(); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + message.oracleScriptId = object.oracleScriptId !== undefined && object.oracleScriptId !== null ? BigInt(object.oracleScriptId.toString()) : BigInt(0); + message.symbols = object.symbols?.map(e => e) || []; + message.askCount = object.askCount !== undefined && object.askCount !== null ? BigInt(object.askCount.toString()) : BigInt(0); + message.minCount = object.minCount !== undefined && object.minCount !== null ? BigInt(object.minCount.toString()) : BigInt(0); + message.feeLimit = object.feeLimit?.map(e => Coin.fromPartial(e)) || []; + message.prepareGas = object.prepareGas !== undefined && object.prepareGas !== null ? BigInt(object.prepareGas.toString()) : BigInt(0); + message.executeGas = object.executeGas !== undefined && object.executeGas !== null ? BigInt(object.executeGas.toString()) : BigInt(0); + message.minSourceCount = object.minSourceCount !== undefined && object.minSourceCount !== null ? BigInt(object.minSourceCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BandOracleRequestAmino): BandOracleRequest { + const message = createBaseBandOracleRequest(); + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + if (object.oracle_script_id !== undefined && object.oracle_script_id !== null) { + message.oracleScriptId = BigInt(object.oracle_script_id); + } + message.symbols = object.symbols?.map(e => e) || []; + if (object.ask_count !== undefined && object.ask_count !== null) { + message.askCount = BigInt(object.ask_count); + } + if (object.min_count !== undefined && object.min_count !== null) { + message.minCount = BigInt(object.min_count); + } + message.feeLimit = object.fee_limit?.map(e => Coin.fromAmino(e)) || []; + if (object.prepare_gas !== undefined && object.prepare_gas !== null) { + message.prepareGas = BigInt(object.prepare_gas); + } + if (object.execute_gas !== undefined && object.execute_gas !== null) { + message.executeGas = BigInt(object.execute_gas); + } + if (object.min_source_count !== undefined && object.min_source_count !== null) { + message.minSourceCount = BigInt(object.min_source_count); + } + return message; + }, + toAmino(message: BandOracleRequest): BandOracleRequestAmino { + const obj: any = {}; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + obj.oracle_script_id = message.oracleScriptId !== BigInt(0) ? message.oracleScriptId?.toString() : undefined; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + obj.ask_count = message.askCount !== BigInt(0) ? message.askCount?.toString() : undefined; + obj.min_count = message.minCount !== BigInt(0) ? message.minCount?.toString() : undefined; + if (message.feeLimit) { + obj.fee_limit = message.feeLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.fee_limit = message.feeLimit; + } + obj.prepare_gas = message.prepareGas !== BigInt(0) ? message.prepareGas?.toString() : undefined; + obj.execute_gas = message.executeGas !== BigInt(0) ? message.executeGas?.toString() : undefined; + obj.min_source_count = message.minSourceCount !== BigInt(0) ? message.minSourceCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BandOracleRequestAminoMsg): BandOracleRequest { + return BandOracleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: BandOracleRequestProtoMsg): BandOracleRequest { + return BandOracleRequest.decode(message.value); + }, + toProto(message: BandOracleRequest): Uint8Array { + return BandOracleRequest.encode(message).finish(); + }, + toProtoMsg(message: BandOracleRequest): BandOracleRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest", + value: BandOracleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandOracleRequest.typeUrl, BandOracleRequest); +function createBaseBandIBCParams(): BandIBCParams { + return { + bandIbcEnabled: false, + ibcRequestInterval: BigInt(0), + ibcSourceChannel: "", + ibcVersion: "", + ibcPortId: "", + legacyOracleIds: [] + }; +} +export const BandIBCParams = { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams", + is(o: any): o is BandIBCParams { + return o && (o.$typeUrl === BandIBCParams.typeUrl || typeof o.bandIbcEnabled === "boolean" && typeof o.ibcRequestInterval === "bigint" && typeof o.ibcSourceChannel === "string" && typeof o.ibcVersion === "string" && typeof o.ibcPortId === "string" && Array.isArray(o.legacyOracleIds) && (!o.legacyOracleIds.length || typeof o.legacyOracleIds[0] === "bigint")); + }, + isAmino(o: any): o is BandIBCParamsAmino { + return o && (o.$typeUrl === BandIBCParams.typeUrl || typeof o.band_ibc_enabled === "boolean" && typeof o.ibc_request_interval === "bigint" && typeof o.ibc_source_channel === "string" && typeof o.ibc_version === "string" && typeof o.ibc_port_id === "string" && Array.isArray(o.legacy_oracle_ids) && (!o.legacy_oracle_ids.length || typeof o.legacy_oracle_ids[0] === "bigint")); + }, + encode(message: BandIBCParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bandIbcEnabled === true) { + writer.uint32(8).bool(message.bandIbcEnabled); + } + if (message.ibcRequestInterval !== BigInt(0)) { + writer.uint32(16).int64(message.ibcRequestInterval); + } + if (message.ibcSourceChannel !== "") { + writer.uint32(26).string(message.ibcSourceChannel); + } + if (message.ibcVersion !== "") { + writer.uint32(34).string(message.ibcVersion); + } + if (message.ibcPortId !== "") { + writer.uint32(42).string(message.ibcPortId); + } + writer.uint32(50).fork(); + for (const v of message.legacyOracleIds) { + writer.int64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandIBCParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandIBCParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bandIbcEnabled = reader.bool(); + break; + case 2: + message.ibcRequestInterval = reader.int64(); + break; + case 3: + message.ibcSourceChannel = reader.string(); + break; + case 4: + message.ibcVersion = reader.string(); + break; + case 5: + message.ibcPortId = reader.string(); + break; + case 6: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.legacyOracleIds.push(reader.int64()); + } + } else { + message.legacyOracleIds.push(reader.int64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandIBCParams { + const message = createBaseBandIBCParams(); + message.bandIbcEnabled = object.bandIbcEnabled ?? false; + message.ibcRequestInterval = object.ibcRequestInterval !== undefined && object.ibcRequestInterval !== null ? BigInt(object.ibcRequestInterval.toString()) : BigInt(0); + message.ibcSourceChannel = object.ibcSourceChannel ?? ""; + message.ibcVersion = object.ibcVersion ?? ""; + message.ibcPortId = object.ibcPortId ?? ""; + message.legacyOracleIds = object.legacyOracleIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: BandIBCParamsAmino): BandIBCParams { + const message = createBaseBandIBCParams(); + if (object.band_ibc_enabled !== undefined && object.band_ibc_enabled !== null) { + message.bandIbcEnabled = object.band_ibc_enabled; + } + if (object.ibc_request_interval !== undefined && object.ibc_request_interval !== null) { + message.ibcRequestInterval = BigInt(object.ibc_request_interval); + } + if (object.ibc_source_channel !== undefined && object.ibc_source_channel !== null) { + message.ibcSourceChannel = object.ibc_source_channel; + } + if (object.ibc_version !== undefined && object.ibc_version !== null) { + message.ibcVersion = object.ibc_version; + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + message.legacyOracleIds = object.legacy_oracle_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: BandIBCParams): BandIBCParamsAmino { + const obj: any = {}; + obj.band_ibc_enabled = message.bandIbcEnabled === false ? undefined : message.bandIbcEnabled; + obj.ibc_request_interval = message.ibcRequestInterval !== BigInt(0) ? message.ibcRequestInterval?.toString() : undefined; + obj.ibc_source_channel = message.ibcSourceChannel === "" ? undefined : message.ibcSourceChannel; + obj.ibc_version = message.ibcVersion === "" ? undefined : message.ibcVersion; + obj.ibc_port_id = message.ibcPortId === "" ? undefined : message.ibcPortId; + if (message.legacyOracleIds) { + obj.legacy_oracle_ids = message.legacyOracleIds.map(e => e.toString()); + } else { + obj.legacy_oracle_ids = message.legacyOracleIds; + } + return obj; + }, + fromAminoMsg(object: BandIBCParamsAminoMsg): BandIBCParams { + return BandIBCParams.fromAmino(object.value); + }, + fromProtoMsg(message: BandIBCParamsProtoMsg): BandIBCParams { + return BandIBCParams.decode(message.value); + }, + toProto(message: BandIBCParams): Uint8Array { + return BandIBCParams.encode(message).finish(); + }, + toProtoMsg(message: BandIBCParams): BandIBCParamsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams", + value: BandIBCParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandIBCParams.typeUrl, BandIBCParams); +function createBaseSymbolPriceTimestamp(): SymbolPriceTimestamp { + return { + oracle: 0, + symbolId: "", + timestamp: BigInt(0) + }; +} +export const SymbolPriceTimestamp = { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp", + is(o: any): o is SymbolPriceTimestamp { + return o && (o.$typeUrl === SymbolPriceTimestamp.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SymbolPriceTimestampAmino { + return o && (o.$typeUrl === SymbolPriceTimestamp.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SymbolPriceTimestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).int64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SymbolPriceTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSymbolPriceTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + case 3: + message.timestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SymbolPriceTimestamp { + const message = createBaseSymbolPriceTimestamp(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SymbolPriceTimestampAmino): SymbolPriceTimestamp { + const message = createBaseSymbolPriceTimestamp(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SymbolPriceTimestamp): SymbolPriceTimestampAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SymbolPriceTimestampAminoMsg): SymbolPriceTimestamp { + return SymbolPriceTimestamp.fromAmino(object.value); + }, + fromProtoMsg(message: SymbolPriceTimestampProtoMsg): SymbolPriceTimestamp { + return SymbolPriceTimestamp.decode(message.value); + }, + toProto(message: SymbolPriceTimestamp): Uint8Array { + return SymbolPriceTimestamp.encode(message).finish(); + }, + toProtoMsg(message: SymbolPriceTimestamp): SymbolPriceTimestampProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp", + value: SymbolPriceTimestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SymbolPriceTimestamp.typeUrl, SymbolPriceTimestamp); +function createBaseLastPriceTimestamps(): LastPriceTimestamps { + return { + lastPriceTimestamps: [] + }; +} +export const LastPriceTimestamps = { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps", + is(o: any): o is LastPriceTimestamps { + return o && (o.$typeUrl === LastPriceTimestamps.typeUrl || Array.isArray(o.lastPriceTimestamps) && (!o.lastPriceTimestamps.length || SymbolPriceTimestamp.is(o.lastPriceTimestamps[0]))); + }, + isAmino(o: any): o is LastPriceTimestampsAmino { + return o && (o.$typeUrl === LastPriceTimestamps.typeUrl || Array.isArray(o.last_price_timestamps) && (!o.last_price_timestamps.length || SymbolPriceTimestamp.isAmino(o.last_price_timestamps[0]))); + }, + encode(message: LastPriceTimestamps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.lastPriceTimestamps) { + SymbolPriceTimestamp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastPriceTimestamps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastPriceTimestamps(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastPriceTimestamps.push(SymbolPriceTimestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastPriceTimestamps { + const message = createBaseLastPriceTimestamps(); + message.lastPriceTimestamps = object.lastPriceTimestamps?.map(e => SymbolPriceTimestamp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LastPriceTimestampsAmino): LastPriceTimestamps { + const message = createBaseLastPriceTimestamps(); + message.lastPriceTimestamps = object.last_price_timestamps?.map(e => SymbolPriceTimestamp.fromAmino(e)) || []; + return message; + }, + toAmino(message: LastPriceTimestamps): LastPriceTimestampsAmino { + const obj: any = {}; + if (message.lastPriceTimestamps) { + obj.last_price_timestamps = message.lastPriceTimestamps.map(e => e ? SymbolPriceTimestamp.toAmino(e) : undefined); + } else { + obj.last_price_timestamps = message.lastPriceTimestamps; + } + return obj; + }, + fromAminoMsg(object: LastPriceTimestampsAminoMsg): LastPriceTimestamps { + return LastPriceTimestamps.fromAmino(object.value); + }, + fromProtoMsg(message: LastPriceTimestampsProtoMsg): LastPriceTimestamps { + return LastPriceTimestamps.decode(message.value); + }, + toProto(message: LastPriceTimestamps): Uint8Array { + return LastPriceTimestamps.encode(message).finish(); + }, + toProtoMsg(message: LastPriceTimestamps): LastPriceTimestampsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps", + value: LastPriceTimestamps.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastPriceTimestamps.typeUrl, LastPriceTimestamps); +function createBasePriceRecords(): PriceRecords { + return { + oracle: 0, + symbolId: "", + latestPriceRecords: [] + }; +} +export const PriceRecords = { + typeUrl: "/injective.oracle.v1beta1.PriceRecords", + is(o: any): o is PriceRecords { + return o && (o.$typeUrl === PriceRecords.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string" && Array.isArray(o.latestPriceRecords) && (!o.latestPriceRecords.length || PriceRecord.is(o.latestPriceRecords[0]))); + }, + isAmino(o: any): o is PriceRecordsAmino { + return o && (o.$typeUrl === PriceRecords.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string" && Array.isArray(o.latest_price_records) && (!o.latest_price_records.length || PriceRecord.isAmino(o.latest_price_records[0]))); + }, + encode(message: PriceRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + for (const v of message.latestPriceRecords) { + PriceRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceRecords { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceRecords(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + case 3: + message.latestPriceRecords.push(PriceRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceRecords { + const message = createBasePriceRecords(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + message.latestPriceRecords = object.latestPriceRecords?.map(e => PriceRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PriceRecordsAmino): PriceRecords { + const message = createBasePriceRecords(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + message.latestPriceRecords = object.latest_price_records?.map(e => PriceRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: PriceRecords): PriceRecordsAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + if (message.latestPriceRecords) { + obj.latest_price_records = message.latestPriceRecords.map(e => e ? PriceRecord.toAmino(e) : undefined); + } else { + obj.latest_price_records = message.latestPriceRecords; + } + return obj; + }, + fromAminoMsg(object: PriceRecordsAminoMsg): PriceRecords { + return PriceRecords.fromAmino(object.value); + }, + fromProtoMsg(message: PriceRecordsProtoMsg): PriceRecords { + return PriceRecords.decode(message.value); + }, + toProto(message: PriceRecords): Uint8Array { + return PriceRecords.encode(message).finish(); + }, + toProtoMsg(message: PriceRecords): PriceRecordsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceRecords", + value: PriceRecords.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceRecords.typeUrl, PriceRecords); +function createBasePriceRecord(): PriceRecord { + return { + timestamp: BigInt(0), + price: "" + }; +} +export const PriceRecord = { + typeUrl: "/injective.oracle.v1beta1.PriceRecord", + is(o: any): o is PriceRecord { + return o && (o.$typeUrl === PriceRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string"); + }, + isAmino(o: any): o is PriceRecordAmino { + return o && (o.$typeUrl === PriceRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string"); + }, + encode(message: PriceRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).int64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.int64(); + break; + case 2: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceRecord { + const message = createBasePriceRecord(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: PriceRecordAmino): PriceRecord { + const message = createBasePriceRecord(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: PriceRecord): PriceRecordAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: PriceRecordAminoMsg): PriceRecord { + return PriceRecord.fromAmino(object.value); + }, + fromProtoMsg(message: PriceRecordProtoMsg): PriceRecord { + return PriceRecord.decode(message.value); + }, + toProto(message: PriceRecord): Uint8Array { + return PriceRecord.encode(message).finish(); + }, + toProtoMsg(message: PriceRecord): PriceRecordProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceRecord", + value: PriceRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceRecord.typeUrl, PriceRecord); +function createBaseMetadataStatistics(): MetadataStatistics { + return { + groupCount: 0, + recordsSampleSize: 0, + mean: "", + twap: "", + firstTimestamp: BigInt(0), + lastTimestamp: BigInt(0), + minPrice: "", + maxPrice: "", + medianPrice: "" + }; +} +export const MetadataStatistics = { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics", + is(o: any): o is MetadataStatistics { + return o && (o.$typeUrl === MetadataStatistics.typeUrl || typeof o.groupCount === "number" && typeof o.recordsSampleSize === "number" && typeof o.mean === "string" && typeof o.twap === "string" && typeof o.firstTimestamp === "bigint" && typeof o.lastTimestamp === "bigint" && typeof o.minPrice === "string" && typeof o.maxPrice === "string" && typeof o.medianPrice === "string"); + }, + isAmino(o: any): o is MetadataStatisticsAmino { + return o && (o.$typeUrl === MetadataStatistics.typeUrl || typeof o.group_count === "number" && typeof o.records_sample_size === "number" && typeof o.mean === "string" && typeof o.twap === "string" && typeof o.first_timestamp === "bigint" && typeof o.last_timestamp === "bigint" && typeof o.min_price === "string" && typeof o.max_price === "string" && typeof o.median_price === "string"); + }, + encode(message: MetadataStatistics, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupCount !== 0) { + writer.uint32(8).uint32(message.groupCount); + } + if (message.recordsSampleSize !== 0) { + writer.uint32(16).uint32(message.recordsSampleSize); + } + if (message.mean !== "") { + writer.uint32(26).string(message.mean); + } + if (message.twap !== "") { + writer.uint32(34).string(message.twap); + } + if (message.firstTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.firstTimestamp); + } + if (message.lastTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.lastTimestamp); + } + if (message.minPrice !== "") { + writer.uint32(58).string(message.minPrice); + } + if (message.maxPrice !== "") { + writer.uint32(66).string(message.maxPrice); + } + if (message.medianPrice !== "") { + writer.uint32(74).string(message.medianPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MetadataStatistics { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadataStatistics(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupCount = reader.uint32(); + break; + case 2: + message.recordsSampleSize = reader.uint32(); + break; + case 3: + message.mean = reader.string(); + break; + case 4: + message.twap = reader.string(); + break; + case 5: + message.firstTimestamp = reader.int64(); + break; + case 6: + message.lastTimestamp = reader.int64(); + break; + case 7: + message.minPrice = reader.string(); + break; + case 8: + message.maxPrice = reader.string(); + break; + case 9: + message.medianPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MetadataStatistics { + const message = createBaseMetadataStatistics(); + message.groupCount = object.groupCount ?? 0; + message.recordsSampleSize = object.recordsSampleSize ?? 0; + message.mean = object.mean ?? ""; + message.twap = object.twap ?? ""; + message.firstTimestamp = object.firstTimestamp !== undefined && object.firstTimestamp !== null ? BigInt(object.firstTimestamp.toString()) : BigInt(0); + message.lastTimestamp = object.lastTimestamp !== undefined && object.lastTimestamp !== null ? BigInt(object.lastTimestamp.toString()) : BigInt(0); + message.minPrice = object.minPrice ?? ""; + message.maxPrice = object.maxPrice ?? ""; + message.medianPrice = object.medianPrice ?? ""; + return message; + }, + fromAmino(object: MetadataStatisticsAmino): MetadataStatistics { + const message = createBaseMetadataStatistics(); + if (object.group_count !== undefined && object.group_count !== null) { + message.groupCount = object.group_count; + } + if (object.records_sample_size !== undefined && object.records_sample_size !== null) { + message.recordsSampleSize = object.records_sample_size; + } + if (object.mean !== undefined && object.mean !== null) { + message.mean = object.mean; + } + if (object.twap !== undefined && object.twap !== null) { + message.twap = object.twap; + } + if (object.first_timestamp !== undefined && object.first_timestamp !== null) { + message.firstTimestamp = BigInt(object.first_timestamp); + } + if (object.last_timestamp !== undefined && object.last_timestamp !== null) { + message.lastTimestamp = BigInt(object.last_timestamp); + } + if (object.min_price !== undefined && object.min_price !== null) { + message.minPrice = object.min_price; + } + if (object.max_price !== undefined && object.max_price !== null) { + message.maxPrice = object.max_price; + } + if (object.median_price !== undefined && object.median_price !== null) { + message.medianPrice = object.median_price; + } + return message; + }, + toAmino(message: MetadataStatistics): MetadataStatisticsAmino { + const obj: any = {}; + obj.group_count = message.groupCount === 0 ? undefined : message.groupCount; + obj.records_sample_size = message.recordsSampleSize === 0 ? undefined : message.recordsSampleSize; + obj.mean = message.mean === "" ? undefined : message.mean; + obj.twap = message.twap === "" ? undefined : message.twap; + obj.first_timestamp = message.firstTimestamp !== BigInt(0) ? message.firstTimestamp?.toString() : undefined; + obj.last_timestamp = message.lastTimestamp !== BigInt(0) ? message.lastTimestamp?.toString() : undefined; + obj.min_price = message.minPrice === "" ? undefined : message.minPrice; + obj.max_price = message.maxPrice === "" ? undefined : message.maxPrice; + obj.median_price = message.medianPrice === "" ? undefined : message.medianPrice; + return obj; + }, + fromAminoMsg(object: MetadataStatisticsAminoMsg): MetadataStatistics { + return MetadataStatistics.fromAmino(object.value); + }, + fromProtoMsg(message: MetadataStatisticsProtoMsg): MetadataStatistics { + return MetadataStatistics.decode(message.value); + }, + toProto(message: MetadataStatistics): Uint8Array { + return MetadataStatistics.encode(message).finish(); + }, + toProtoMsg(message: MetadataStatistics): MetadataStatisticsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics", + value: MetadataStatistics.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MetadataStatistics.typeUrl, MetadataStatistics); +function createBasePriceAttestation(): PriceAttestation { + return { + priceId: "", + price: BigInt(0), + conf: BigInt(0), + expo: 0, + emaPrice: BigInt(0), + emaConf: BigInt(0), + emaExpo: 0, + publishTime: BigInt(0) + }; +} +export const PriceAttestation = { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation", + is(o: any): o is PriceAttestation { + return o && (o.$typeUrl === PriceAttestation.typeUrl || typeof o.priceId === "string" && typeof o.price === "bigint" && typeof o.conf === "bigint" && typeof o.expo === "number" && typeof o.emaPrice === "bigint" && typeof o.emaConf === "bigint" && typeof o.emaExpo === "number" && typeof o.publishTime === "bigint"); + }, + isAmino(o: any): o is PriceAttestationAmino { + return o && (o.$typeUrl === PriceAttestation.typeUrl || typeof o.price_id === "string" && typeof o.price === "bigint" && typeof o.conf === "bigint" && typeof o.expo === "number" && typeof o.ema_price === "bigint" && typeof o.ema_conf === "bigint" && typeof o.ema_expo === "number" && typeof o.publish_time === "bigint"); + }, + encode(message: PriceAttestation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + if (message.price !== BigInt(0)) { + writer.uint32(16).int64(message.price); + } + if (message.conf !== BigInt(0)) { + writer.uint32(24).uint64(message.conf); + } + if (message.expo !== 0) { + writer.uint32(32).int32(message.expo); + } + if (message.emaPrice !== BigInt(0)) { + writer.uint32(40).int64(message.emaPrice); + } + if (message.emaConf !== BigInt(0)) { + writer.uint32(48).uint64(message.emaConf); + } + if (message.emaExpo !== 0) { + writer.uint32(56).int32(message.emaExpo); + } + if (message.publishTime !== BigInt(0)) { + writer.uint32(64).int64(message.publishTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceAttestation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceAttestation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + case 2: + message.price = reader.int64(); + break; + case 3: + message.conf = reader.uint64(); + break; + case 4: + message.expo = reader.int32(); + break; + case 5: + message.emaPrice = reader.int64(); + break; + case 6: + message.emaConf = reader.uint64(); + break; + case 7: + message.emaExpo = reader.int32(); + break; + case 8: + message.publishTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceAttestation { + const message = createBasePriceAttestation(); + message.priceId = object.priceId ?? ""; + message.price = object.price !== undefined && object.price !== null ? BigInt(object.price.toString()) : BigInt(0); + message.conf = object.conf !== undefined && object.conf !== null ? BigInt(object.conf.toString()) : BigInt(0); + message.expo = object.expo ?? 0; + message.emaPrice = object.emaPrice !== undefined && object.emaPrice !== null ? BigInt(object.emaPrice.toString()) : BigInt(0); + message.emaConf = object.emaConf !== undefined && object.emaConf !== null ? BigInt(object.emaConf.toString()) : BigInt(0); + message.emaExpo = object.emaExpo ?? 0; + message.publishTime = object.publishTime !== undefined && object.publishTime !== null ? BigInt(object.publishTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PriceAttestationAmino): PriceAttestation { + const message = createBasePriceAttestation(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + if (object.price !== undefined && object.price !== null) { + message.price = BigInt(object.price); + } + if (object.conf !== undefined && object.conf !== null) { + message.conf = BigInt(object.conf); + } + if (object.expo !== undefined && object.expo !== null) { + message.expo = object.expo; + } + if (object.ema_price !== undefined && object.ema_price !== null) { + message.emaPrice = BigInt(object.ema_price); + } + if (object.ema_conf !== undefined && object.ema_conf !== null) { + message.emaConf = BigInt(object.ema_conf); + } + if (object.ema_expo !== undefined && object.ema_expo !== null) { + message.emaExpo = object.ema_expo; + } + if (object.publish_time !== undefined && object.publish_time !== null) { + message.publishTime = BigInt(object.publish_time); + } + return message; + }, + toAmino(message: PriceAttestation): PriceAttestationAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + obj.price = message.price !== BigInt(0) ? message.price?.toString() : undefined; + obj.conf = message.conf !== BigInt(0) ? message.conf?.toString() : undefined; + obj.expo = message.expo === 0 ? undefined : message.expo; + obj.ema_price = message.emaPrice !== BigInt(0) ? message.emaPrice?.toString() : undefined; + obj.ema_conf = message.emaConf !== BigInt(0) ? message.emaConf?.toString() : undefined; + obj.ema_expo = message.emaExpo === 0 ? undefined : message.emaExpo; + obj.publish_time = message.publishTime !== BigInt(0) ? message.publishTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PriceAttestationAminoMsg): PriceAttestation { + return PriceAttestation.fromAmino(object.value); + }, + fromProtoMsg(message: PriceAttestationProtoMsg): PriceAttestation { + return PriceAttestation.decode(message.value); + }, + toProto(message: PriceAttestation): Uint8Array { + return PriceAttestation.encode(message).finish(); + }, + toProtoMsg(message: PriceAttestation): PriceAttestationProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation", + value: PriceAttestation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceAttestation.typeUrl, PriceAttestation); +function createBaseAssetPair(): AssetPair { + return { + assetId: "", + signedPrices: [] + }; +} +export const AssetPair = { + typeUrl: "/injective.oracle.v1beta1.AssetPair", + is(o: any): o is AssetPair { + return o && (o.$typeUrl === AssetPair.typeUrl || typeof o.assetId === "string" && Array.isArray(o.signedPrices) && (!o.signedPrices.length || SignedPriceOfAssetPair.is(o.signedPrices[0]))); + }, + isAmino(o: any): o is AssetPairAmino { + return o && (o.$typeUrl === AssetPair.typeUrl || typeof o.asset_id === "string" && Array.isArray(o.signed_prices) && (!o.signed_prices.length || SignedPriceOfAssetPair.isAmino(o.signed_prices[0]))); + }, + encode(message: AssetPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetId !== "") { + writer.uint32(10).string(message.assetId); + } + for (const v of message.signedPrices) { + SignedPriceOfAssetPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AssetPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetId = reader.string(); + break; + case 2: + message.signedPrices.push(SignedPriceOfAssetPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AssetPair { + const message = createBaseAssetPair(); + message.assetId = object.assetId ?? ""; + message.signedPrices = object.signedPrices?.map(e => SignedPriceOfAssetPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AssetPairAmino): AssetPair { + const message = createBaseAssetPair(); + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + message.signedPrices = object.signed_prices?.map(e => SignedPriceOfAssetPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: AssetPair): AssetPairAmino { + const obj: any = {}; + obj.asset_id = message.assetId === "" ? undefined : message.assetId; + if (message.signedPrices) { + obj.signed_prices = message.signedPrices.map(e => e ? SignedPriceOfAssetPair.toAmino(e) : undefined); + } else { + obj.signed_prices = message.signedPrices; + } + return obj; + }, + fromAminoMsg(object: AssetPairAminoMsg): AssetPair { + return AssetPair.fromAmino(object.value); + }, + fromProtoMsg(message: AssetPairProtoMsg): AssetPair { + return AssetPair.decode(message.value); + }, + toProto(message: AssetPair): Uint8Array { + return AssetPair.encode(message).finish(); + }, + toProtoMsg(message: AssetPair): AssetPairProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.AssetPair", + value: AssetPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AssetPair.typeUrl, AssetPair); +function createBaseSignedPriceOfAssetPair(): SignedPriceOfAssetPair { + return { + publisherKey: "", + timestamp: BigInt(0), + price: "", + signature: new Uint8Array() + }; +} +export const SignedPriceOfAssetPair = { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair", + is(o: any): o is SignedPriceOfAssetPair { + return o && (o.$typeUrl === SignedPriceOfAssetPair.typeUrl || typeof o.publisherKey === "string" && typeof o.timestamp === "bigint" && typeof o.price === "string" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is SignedPriceOfAssetPairAmino { + return o && (o.$typeUrl === SignedPriceOfAssetPair.typeUrl || typeof o.publisher_key === "string" && typeof o.timestamp === "bigint" && typeof o.price === "string" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: SignedPriceOfAssetPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publisherKey !== "") { + writer.uint32(10).string(message.publisherKey); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedPriceOfAssetPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedPriceOfAssetPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisherKey = reader.string(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignedPriceOfAssetPair { + const message = createBaseSignedPriceOfAssetPair(); + message.publisherKey = object.publisherKey ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignedPriceOfAssetPairAmino): SignedPriceOfAssetPair { + const message = createBaseSignedPriceOfAssetPair(); + if (object.publisher_key !== undefined && object.publisher_key !== null) { + message.publisherKey = object.publisher_key; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: SignedPriceOfAssetPair): SignedPriceOfAssetPairAmino { + const obj: any = {}; + obj.publisher_key = message.publisherKey === "" ? undefined : message.publisherKey; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignedPriceOfAssetPairAminoMsg): SignedPriceOfAssetPair { + return SignedPriceOfAssetPair.fromAmino(object.value); + }, + fromProtoMsg(message: SignedPriceOfAssetPairProtoMsg): SignedPriceOfAssetPair { + return SignedPriceOfAssetPair.decode(message.value); + }, + toProto(message: SignedPriceOfAssetPair): Uint8Array { + return SignedPriceOfAssetPair.encode(message).finish(); + }, + toProtoMsg(message: SignedPriceOfAssetPair): SignedPriceOfAssetPairProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair", + value: SignedPriceOfAssetPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignedPriceOfAssetPair.typeUrl, SignedPriceOfAssetPair); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/proposal.ts b/libs/injective-query/src/injective/oracle/v1beta1/proposal.ts new file mode 100644 index 00000000..453fdef3 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/proposal.ts @@ -0,0 +1,1449 @@ +import { BandOracleRequest, BandOracleRequestAmino, BandIBCParams, BandIBCParamsAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface GrantBandOraclePrivilegeProposal { + title: string; + description: string; + relayers: string[]; +} +export interface GrantBandOraclePrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal"; + value: Uint8Array; +} +export interface GrantBandOraclePrivilegeProposalAmino { + title: string; + description: string; + relayers: string[]; +} +export interface GrantBandOraclePrivilegeProposalAminoMsg { + type: "oracle/GrantBandOraclePrivilegeProposal"; + value: GrantBandOraclePrivilegeProposalAmino; +} +export interface RevokeBandOraclePrivilegeProposal { + title: string; + description: string; + relayers: string[]; +} +export interface RevokeBandOraclePrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeBandOraclePrivilegeProposalAmino { + title: string; + description: string; + relayers: string[]; +} +export interface RevokeBandOraclePrivilegeProposalAminoMsg { + type: "oracle/RevokeBandOraclePrivilegeProposal"; + value: RevokeBandOraclePrivilegeProposalAmino; +} +export interface GrantPriceFeederPrivilegeProposal { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface GrantPriceFeederPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantPriceFeederPrivilegeProposalAmino { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface GrantPriceFeederPrivilegeProposalAminoMsg { + type: "oracle/GrantPriceFeederPrivilegeProposal"; + value: GrantPriceFeederPrivilegeProposalAmino; +} +export interface GrantProviderPrivilegeProposal { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface GrantProviderPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantProviderPrivilegeProposalAmino { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface GrantProviderPrivilegeProposalAminoMsg { + type: "oracle/GrantProviderPrivilegeProposal"; + value: GrantProviderPrivilegeProposalAmino; +} +export interface RevokeProviderPrivilegeProposal { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface RevokeProviderPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeProviderPrivilegeProposalAmino { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface RevokeProviderPrivilegeProposalAminoMsg { + type: "oracle/RevokeProviderPrivilegeProposal"; + value: RevokeProviderPrivilegeProposalAmino; +} +export interface RevokePriceFeederPrivilegeProposal { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface RevokePriceFeederPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokePriceFeederPrivilegeProposalAmino { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface RevokePriceFeederPrivilegeProposalAminoMsg { + type: "oracle/RevokePriceFeederPrivilegeProposal"; + value: RevokePriceFeederPrivilegeProposalAmino; +} +export interface AuthorizeBandOracleRequestProposal { + title: string; + description: string; + request: BandOracleRequest; +} +export interface AuthorizeBandOracleRequestProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal"; + value: Uint8Array; +} +export interface AuthorizeBandOracleRequestProposalAmino { + title: string; + description: string; + request: BandOracleRequestAmino; +} +export interface AuthorizeBandOracleRequestProposalAminoMsg { + type: "oracle/AuthorizeBandOracleRequestProposal"; + value: AuthorizeBandOracleRequestProposalAmino; +} +export interface UpdateBandOracleRequestProposal { + title: string; + description: string; + deleteRequestIds: bigint[]; + updateOracleRequest?: BandOracleRequest; +} +export interface UpdateBandOracleRequestProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal"; + value: Uint8Array; +} +export interface UpdateBandOracleRequestProposalAmino { + title: string; + description: string; + delete_request_ids: string[]; + update_oracle_request?: BandOracleRequestAmino; +} +export interface UpdateBandOracleRequestProposalAminoMsg { + type: "oracle/UpdateBandOracleRequestProposal"; + value: UpdateBandOracleRequestProposalAmino; +} +export interface EnableBandIBCProposal { + title: string; + description: string; + bandIbcParams: BandIBCParams; +} +export interface EnableBandIBCProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal"; + value: Uint8Array; +} +export interface EnableBandIBCProposalAmino { + title: string; + description: string; + band_ibc_params: BandIBCParamsAmino; +} +export interface EnableBandIBCProposalAminoMsg { + type: "oracle/EnableBandIBCProposal"; + value: EnableBandIBCProposalAmino; +} +export interface GrantStorkPublisherPrivilegeProposal { + title: string; + description: string; + storkPublishers: string[]; +} +export interface GrantStorkPublisherPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantStorkPublisherPrivilegeProposalAmino { + title: string; + description: string; + stork_publishers: string[]; +} +export interface GrantStorkPublisherPrivilegeProposalAminoMsg { + type: "oracle/GrantStorkPublisherPrivilegeProposal"; + value: GrantStorkPublisherPrivilegeProposalAmino; +} +export interface RevokeStorkPublisherPrivilegeProposal { + title: string; + description: string; + storkPublishers: string[]; +} +export interface RevokeStorkPublisherPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeStorkPublisherPrivilegeProposalAmino { + title: string; + description: string; + stork_publishers: string[]; +} +export interface RevokeStorkPublisherPrivilegeProposalAminoMsg { + type: "oracle/RevokeStorkPublisherPrivilegeProposal"; + value: RevokeStorkPublisherPrivilegeProposalAmino; +} +function createBaseGrantBandOraclePrivilegeProposal(): GrantBandOraclePrivilegeProposal { + return { + title: "", + description: "", + relayers: [] + }; +} +export const GrantBandOraclePrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal", + aminoType: "oracle/GrantBandOraclePrivilegeProposal", + is(o: any): o is GrantBandOraclePrivilegeProposal { + return o && (o.$typeUrl === GrantBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantBandOraclePrivilegeProposalAmino { + return o && (o.$typeUrl === GrantBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantBandOraclePrivilegeProposal, 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.relayers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantBandOraclePrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantBandOraclePrivilegeProposal(); + 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.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantBandOraclePrivilegeProposal { + const message = createBaseGrantBandOraclePrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantBandOraclePrivilegeProposalAmino): GrantBandOraclePrivilegeProposal { + const message = createBaseGrantBandOraclePrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantBandOraclePrivilegeProposalAminoMsg): GrantBandOraclePrivilegeProposal { + return GrantBandOraclePrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalAminoMsg { + return { + type: "oracle/GrantBandOraclePrivilegeProposal", + value: GrantBandOraclePrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantBandOraclePrivilegeProposalProtoMsg): GrantBandOraclePrivilegeProposal { + return GrantBandOraclePrivilegeProposal.decode(message.value); + }, + toProto(message: GrantBandOraclePrivilegeProposal): Uint8Array { + return GrantBandOraclePrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal", + value: GrantBandOraclePrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantBandOraclePrivilegeProposal.typeUrl, GrantBandOraclePrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantBandOraclePrivilegeProposal.aminoType, GrantBandOraclePrivilegeProposal.typeUrl); +function createBaseRevokeBandOraclePrivilegeProposal(): RevokeBandOraclePrivilegeProposal { + return { + title: "", + description: "", + relayers: [] + }; +} +export const RevokeBandOraclePrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal", + aminoType: "oracle/RevokeBandOraclePrivilegeProposal", + is(o: any): o is RevokeBandOraclePrivilegeProposal { + return o && (o.$typeUrl === RevokeBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokeBandOraclePrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokeBandOraclePrivilegeProposal, 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.relayers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeBandOraclePrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeBandOraclePrivilegeProposal(); + 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.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeBandOraclePrivilegeProposal { + const message = createBaseRevokeBandOraclePrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeBandOraclePrivilegeProposalAmino): RevokeBandOraclePrivilegeProposal { + const message = createBaseRevokeBandOraclePrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokeBandOraclePrivilegeProposalAminoMsg): RevokeBandOraclePrivilegeProposal { + return RevokeBandOraclePrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeBandOraclePrivilegeProposal", + value: RevokeBandOraclePrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeBandOraclePrivilegeProposalProtoMsg): RevokeBandOraclePrivilegeProposal { + return RevokeBandOraclePrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeBandOraclePrivilegeProposal): Uint8Array { + return RevokeBandOraclePrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal", + value: RevokeBandOraclePrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeBandOraclePrivilegeProposal.typeUrl, RevokeBandOraclePrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeBandOraclePrivilegeProposal.aminoType, RevokeBandOraclePrivilegeProposal.typeUrl); +function createBaseGrantPriceFeederPrivilegeProposal(): GrantPriceFeederPrivilegeProposal { + return { + title: "", + description: "", + base: "", + quote: "", + relayers: [] + }; +} +export const GrantPriceFeederPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal", + aminoType: "oracle/GrantPriceFeederPrivilegeProposal", + is(o: any): o is GrantPriceFeederPrivilegeProposal { + return o && (o.$typeUrl === GrantPriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantPriceFeederPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantPriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantPriceFeederPrivilegeProposal, 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.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.quote !== "") { + writer.uint32(34).string(message.quote); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantPriceFeederPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantPriceFeederPrivilegeProposal(); + 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.base = reader.string(); + break; + case 4: + message.quote = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantPriceFeederPrivilegeProposal { + const message = createBaseGrantPriceFeederPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantPriceFeederPrivilegeProposalAmino): GrantPriceFeederPrivilegeProposal { + const message = createBaseGrantPriceFeederPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantPriceFeederPrivilegeProposalAminoMsg): GrantPriceFeederPrivilegeProposal { + return GrantPriceFeederPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantPriceFeederPrivilegeProposal", + value: GrantPriceFeederPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantPriceFeederPrivilegeProposalProtoMsg): GrantPriceFeederPrivilegeProposal { + return GrantPriceFeederPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantPriceFeederPrivilegeProposal): Uint8Array { + return GrantPriceFeederPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal", + value: GrantPriceFeederPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantPriceFeederPrivilegeProposal.typeUrl, GrantPriceFeederPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantPriceFeederPrivilegeProposal.aminoType, GrantPriceFeederPrivilegeProposal.typeUrl); +function createBaseGrantProviderPrivilegeProposal(): GrantProviderPrivilegeProposal { + return { + title: "", + description: "", + provider: "", + relayers: [] + }; +} +export const GrantProviderPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal", + aminoType: "oracle/GrantProviderPrivilegeProposal", + is(o: any): o is GrantProviderPrivilegeProposal { + return o && (o.$typeUrl === GrantProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantProviderPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantProviderPrivilegeProposal, 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.provider !== "") { + writer.uint32(26).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantProviderPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantProviderPrivilegeProposal(); + 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.provider = reader.string(); + break; + case 4: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantProviderPrivilegeProposal { + const message = createBaseGrantProviderPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantProviderPrivilegeProposalAmino): GrantProviderPrivilegeProposal { + const message = createBaseGrantProviderPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantProviderPrivilegeProposalAminoMsg): GrantProviderPrivilegeProposal { + return GrantProviderPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantProviderPrivilegeProposal", + value: GrantProviderPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProviderPrivilegeProposalProtoMsg): GrantProviderPrivilegeProposal { + return GrantProviderPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantProviderPrivilegeProposal): Uint8Array { + return GrantProviderPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal", + value: GrantProviderPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantProviderPrivilegeProposal.typeUrl, GrantProviderPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantProviderPrivilegeProposal.aminoType, GrantProviderPrivilegeProposal.typeUrl); +function createBaseRevokeProviderPrivilegeProposal(): RevokeProviderPrivilegeProposal { + return { + title: "", + description: "", + provider: "", + relayers: [] + }; +} +export const RevokeProviderPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal", + aminoType: "oracle/RevokeProviderPrivilegeProposal", + is(o: any): o is RevokeProviderPrivilegeProposal { + return o && (o.$typeUrl === RevokeProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokeProviderPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokeProviderPrivilegeProposal, 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.provider !== "") { + writer.uint32(26).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeProviderPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeProviderPrivilegeProposal(); + 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.provider = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeProviderPrivilegeProposal { + const message = createBaseRevokeProviderPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeProviderPrivilegeProposalAmino): RevokeProviderPrivilegeProposal { + const message = createBaseRevokeProviderPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokeProviderPrivilegeProposalAminoMsg): RevokeProviderPrivilegeProposal { + return RevokeProviderPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeProviderPrivilegeProposal", + value: RevokeProviderPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeProviderPrivilegeProposalProtoMsg): RevokeProviderPrivilegeProposal { + return RevokeProviderPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeProviderPrivilegeProposal): Uint8Array { + return RevokeProviderPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal", + value: RevokeProviderPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeProviderPrivilegeProposal.typeUrl, RevokeProviderPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeProviderPrivilegeProposal.aminoType, RevokeProviderPrivilegeProposal.typeUrl); +function createBaseRevokePriceFeederPrivilegeProposal(): RevokePriceFeederPrivilegeProposal { + return { + title: "", + description: "", + base: "", + quote: "", + relayers: [] + }; +} +export const RevokePriceFeederPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal", + aminoType: "oracle/RevokePriceFeederPrivilegeProposal", + is(o: any): o is RevokePriceFeederPrivilegeProposal { + return o && (o.$typeUrl === RevokePriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokePriceFeederPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokePriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokePriceFeederPrivilegeProposal, 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.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.quote !== "") { + writer.uint32(34).string(message.quote); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokePriceFeederPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokePriceFeederPrivilegeProposal(); + 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.base = reader.string(); + break; + case 4: + message.quote = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokePriceFeederPrivilegeProposal { + const message = createBaseRevokePriceFeederPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokePriceFeederPrivilegeProposalAmino): RevokePriceFeederPrivilegeProposal { + const message = createBaseRevokePriceFeederPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokePriceFeederPrivilegeProposalAminoMsg): RevokePriceFeederPrivilegeProposal { + return RevokePriceFeederPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokePriceFeederPrivilegeProposal", + value: RevokePriceFeederPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokePriceFeederPrivilegeProposalProtoMsg): RevokePriceFeederPrivilegeProposal { + return RevokePriceFeederPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokePriceFeederPrivilegeProposal): Uint8Array { + return RevokePriceFeederPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal", + value: RevokePriceFeederPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokePriceFeederPrivilegeProposal.typeUrl, RevokePriceFeederPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokePriceFeederPrivilegeProposal.aminoType, RevokePriceFeederPrivilegeProposal.typeUrl); +function createBaseAuthorizeBandOracleRequestProposal(): AuthorizeBandOracleRequestProposal { + return { + title: "", + description: "", + request: BandOracleRequest.fromPartial({}) + }; +} +export const AuthorizeBandOracleRequestProposal = { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal", + aminoType: "oracle/AuthorizeBandOracleRequestProposal", + is(o: any): o is AuthorizeBandOracleRequestProposal { + return o && (o.$typeUrl === AuthorizeBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandOracleRequest.is(o.request)); + }, + isAmino(o: any): o is AuthorizeBandOracleRequestProposalAmino { + return o && (o.$typeUrl === AuthorizeBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandOracleRequest.isAmino(o.request)); + }, + encode(message: AuthorizeBandOracleRequestProposal, 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.request !== undefined) { + BandOracleRequest.encode(message.request, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuthorizeBandOracleRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthorizeBandOracleRequestProposal(); + 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.request = BandOracleRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AuthorizeBandOracleRequestProposal { + const message = createBaseAuthorizeBandOracleRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.request = object.request !== undefined && object.request !== null ? BandOracleRequest.fromPartial(object.request) : undefined; + return message; + }, + fromAmino(object: AuthorizeBandOracleRequestProposalAmino): AuthorizeBandOracleRequestProposal { + const message = createBaseAuthorizeBandOracleRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.request !== undefined && object.request !== null) { + message.request = BandOracleRequest.fromAmino(object.request); + } + return message; + }, + toAmino(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.request = message.request ? BandOracleRequest.toAmino(message.request) : undefined; + return obj; + }, + fromAminoMsg(object: AuthorizeBandOracleRequestProposalAminoMsg): AuthorizeBandOracleRequestProposal { + return AuthorizeBandOracleRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalAminoMsg { + return { + type: "oracle/AuthorizeBandOracleRequestProposal", + value: AuthorizeBandOracleRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: AuthorizeBandOracleRequestProposalProtoMsg): AuthorizeBandOracleRequestProposal { + return AuthorizeBandOracleRequestProposal.decode(message.value); + }, + toProto(message: AuthorizeBandOracleRequestProposal): Uint8Array { + return AuthorizeBandOracleRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal", + value: AuthorizeBandOracleRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AuthorizeBandOracleRequestProposal.typeUrl, AuthorizeBandOracleRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthorizeBandOracleRequestProposal.aminoType, AuthorizeBandOracleRequestProposal.typeUrl); +function createBaseUpdateBandOracleRequestProposal(): UpdateBandOracleRequestProposal { + return { + title: "", + description: "", + deleteRequestIds: [], + updateOracleRequest: undefined + }; +} +export const UpdateBandOracleRequestProposal = { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal", + aminoType: "oracle/UpdateBandOracleRequestProposal", + is(o: any): o is UpdateBandOracleRequestProposal { + return o && (o.$typeUrl === UpdateBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.deleteRequestIds) && (!o.deleteRequestIds.length || typeof o.deleteRequestIds[0] === "bigint")); + }, + isAmino(o: any): o is UpdateBandOracleRequestProposalAmino { + return o && (o.$typeUrl === UpdateBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.delete_request_ids) && (!o.delete_request_ids.length || typeof o.delete_request_ids[0] === "bigint")); + }, + encode(message: UpdateBandOracleRequestProposal, 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.deleteRequestIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.updateOracleRequest !== undefined) { + BandOracleRequest.encode(message.updateOracleRequest, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateBandOracleRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateBandOracleRequestProposal(); + 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.deleteRequestIds.push(reader.uint64()); + } + } else { + message.deleteRequestIds.push(reader.uint64()); + } + break; + case 4: + message.updateOracleRequest = BandOracleRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UpdateBandOracleRequestProposal { + const message = createBaseUpdateBandOracleRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.deleteRequestIds = object.deleteRequestIds?.map(e => BigInt(e.toString())) || []; + message.updateOracleRequest = object.updateOracleRequest !== undefined && object.updateOracleRequest !== null ? BandOracleRequest.fromPartial(object.updateOracleRequest) : undefined; + return message; + }, + fromAmino(object: UpdateBandOracleRequestProposalAmino): UpdateBandOracleRequestProposal { + const message = createBaseUpdateBandOracleRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.deleteRequestIds = object.delete_request_ids?.map(e => BigInt(e)) || []; + if (object.update_oracle_request !== undefined && object.update_oracle_request !== null) { + message.updateOracleRequest = BandOracleRequest.fromAmino(object.update_oracle_request); + } + return message; + }, + toAmino(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.deleteRequestIds) { + obj.delete_request_ids = message.deleteRequestIds.map(e => e.toString()); + } else { + obj.delete_request_ids = message.deleteRequestIds; + } + obj.update_oracle_request = message.updateOracleRequest ? BandOracleRequest.toAmino(message.updateOracleRequest) : undefined; + return obj; + }, + fromAminoMsg(object: UpdateBandOracleRequestProposalAminoMsg): UpdateBandOracleRequestProposal { + return UpdateBandOracleRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalAminoMsg { + return { + type: "oracle/UpdateBandOracleRequestProposal", + value: UpdateBandOracleRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateBandOracleRequestProposalProtoMsg): UpdateBandOracleRequestProposal { + return UpdateBandOracleRequestProposal.decode(message.value); + }, + toProto(message: UpdateBandOracleRequestProposal): Uint8Array { + return UpdateBandOracleRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal", + value: UpdateBandOracleRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UpdateBandOracleRequestProposal.typeUrl, UpdateBandOracleRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateBandOracleRequestProposal.aminoType, UpdateBandOracleRequestProposal.typeUrl); +function createBaseEnableBandIBCProposal(): EnableBandIBCProposal { + return { + title: "", + description: "", + bandIbcParams: BandIBCParams.fromPartial({}) + }; +} +export const EnableBandIBCProposal = { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal", + aminoType: "oracle/EnableBandIBCProposal", + is(o: any): o is EnableBandIBCProposal { + return o && (o.$typeUrl === EnableBandIBCProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandIBCParams.is(o.bandIbcParams)); + }, + isAmino(o: any): o is EnableBandIBCProposalAmino { + return o && (o.$typeUrl === EnableBandIBCProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandIBCParams.isAmino(o.band_ibc_params)); + }, + encode(message: EnableBandIBCProposal, 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.bandIbcParams !== undefined) { + BandIBCParams.encode(message.bandIbcParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnableBandIBCProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnableBandIBCProposal(); + 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.bandIbcParams = BandIBCParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnableBandIBCProposal { + const message = createBaseEnableBandIBCProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.bandIbcParams = object.bandIbcParams !== undefined && object.bandIbcParams !== null ? BandIBCParams.fromPartial(object.bandIbcParams) : undefined; + return message; + }, + fromAmino(object: EnableBandIBCProposalAmino): EnableBandIBCProposal { + const message = createBaseEnableBandIBCProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.band_ibc_params !== undefined && object.band_ibc_params !== null) { + message.bandIbcParams = BandIBCParams.fromAmino(object.band_ibc_params); + } + return message; + }, + toAmino(message: EnableBandIBCProposal): EnableBandIBCProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.band_ibc_params = message.bandIbcParams ? BandIBCParams.toAmino(message.bandIbcParams) : undefined; + return obj; + }, + fromAminoMsg(object: EnableBandIBCProposalAminoMsg): EnableBandIBCProposal { + return EnableBandIBCProposal.fromAmino(object.value); + }, + toAminoMsg(message: EnableBandIBCProposal): EnableBandIBCProposalAminoMsg { + return { + type: "oracle/EnableBandIBCProposal", + value: EnableBandIBCProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EnableBandIBCProposalProtoMsg): EnableBandIBCProposal { + return EnableBandIBCProposal.decode(message.value); + }, + toProto(message: EnableBandIBCProposal): Uint8Array { + return EnableBandIBCProposal.encode(message).finish(); + }, + toProtoMsg(message: EnableBandIBCProposal): EnableBandIBCProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal", + value: EnableBandIBCProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnableBandIBCProposal.typeUrl, EnableBandIBCProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(EnableBandIBCProposal.aminoType, EnableBandIBCProposal.typeUrl); +function createBaseGrantStorkPublisherPrivilegeProposal(): GrantStorkPublisherPrivilegeProposal { + return { + title: "", + description: "", + storkPublishers: [] + }; +} +export const GrantStorkPublisherPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal", + aminoType: "oracle/GrantStorkPublisherPrivilegeProposal", + is(o: any): o is GrantStorkPublisherPrivilegeProposal { + return o && (o.$typeUrl === GrantStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is GrantStorkPublisherPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + encode(message: GrantStorkPublisherPrivilegeProposal, 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.storkPublishers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantStorkPublisherPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + 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.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantStorkPublisherPrivilegeProposal { + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantStorkPublisherPrivilegeProposalAmino): GrantStorkPublisherPrivilegeProposal { + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + return obj; + }, + fromAminoMsg(object: GrantStorkPublisherPrivilegeProposalAminoMsg): GrantStorkPublisherPrivilegeProposal { + return GrantStorkPublisherPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantStorkPublisherPrivilegeProposal", + value: GrantStorkPublisherPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantStorkPublisherPrivilegeProposalProtoMsg): GrantStorkPublisherPrivilegeProposal { + return GrantStorkPublisherPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantStorkPublisherPrivilegeProposal): Uint8Array { + return GrantStorkPublisherPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal", + value: GrantStorkPublisherPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantStorkPublisherPrivilegeProposal.typeUrl, GrantStorkPublisherPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantStorkPublisherPrivilegeProposal.aminoType, GrantStorkPublisherPrivilegeProposal.typeUrl); +function createBaseRevokeStorkPublisherPrivilegeProposal(): RevokeStorkPublisherPrivilegeProposal { + return { + title: "", + description: "", + storkPublishers: [] + }; +} +export const RevokeStorkPublisherPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal", + aminoType: "oracle/RevokeStorkPublisherPrivilegeProposal", + is(o: any): o is RevokeStorkPublisherPrivilegeProposal { + return o && (o.$typeUrl === RevokeStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is RevokeStorkPublisherPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + encode(message: RevokeStorkPublisherPrivilegeProposal, 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.storkPublishers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeStorkPublisherPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + 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.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeStorkPublisherPrivilegeProposal { + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeStorkPublisherPrivilegeProposalAmino): RevokeStorkPublisherPrivilegeProposal { + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + return obj; + }, + fromAminoMsg(object: RevokeStorkPublisherPrivilegeProposalAminoMsg): RevokeStorkPublisherPrivilegeProposal { + return RevokeStorkPublisherPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeStorkPublisherPrivilegeProposal", + value: RevokeStorkPublisherPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeStorkPublisherPrivilegeProposalProtoMsg): RevokeStorkPublisherPrivilegeProposal { + return RevokeStorkPublisherPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeStorkPublisherPrivilegeProposal): Uint8Array { + return RevokeStorkPublisherPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal", + value: RevokeStorkPublisherPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeStorkPublisherPrivilegeProposal.typeUrl, RevokeStorkPublisherPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeStorkPublisherPrivilegeProposal.aminoType, RevokeStorkPublisherPrivilegeProposal.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/oracle/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..195cd3f4 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/query.rpc.func.ts @@ -0,0 +1,190 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetBandRelayers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandRelayersRequest.encode, + decode: QueryBandRelayersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandRelayers", + clientResolver +}); +export const useGetBandRelayers = buildUseQuery({ + builderQueryFn: createGetBandRelayers, + queryKeyPrefix: "BandRelayersQuery" +}); +export const createGetBandPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandPriceStatesRequest.encode, + decode: QueryBandPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandPriceStates", + clientResolver +}); +export const useGetBandPriceStates = buildUseQuery({ + builderQueryFn: createGetBandPriceStates, + queryKeyPrefix: "BandPriceStatesQuery" +}); +export const createGetBandIBCPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandIBCPriceStatesRequest.encode, + decode: QueryBandIBCPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandIBCPriceStates", + clientResolver +}); +export const useGetBandIBCPriceStates = buildUseQuery({ + builderQueryFn: createGetBandIBCPriceStates, + queryKeyPrefix: "BandIBCPriceStatesQuery" +}); +export const createGetPriceFeedPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPriceFeedPriceStatesRequest.encode, + decode: QueryPriceFeedPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PriceFeedPriceStates", + clientResolver +}); +export const useGetPriceFeedPriceStates = buildUseQuery({ + builderQueryFn: createGetPriceFeedPriceStates, + queryKeyPrefix: "PriceFeedPriceStatesQuery" +}); +export const createGetCoinbasePriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCoinbasePriceStatesRequest.encode, + decode: QueryCoinbasePriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "CoinbasePriceStates", + clientResolver +}); +export const useGetCoinbasePriceStates = buildUseQuery({ + builderQueryFn: createGetCoinbasePriceStates, + queryKeyPrefix: "CoinbasePriceStatesQuery" +}); +export const createGetPythPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceStatesRequest.encode, + decode: QueryPythPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPriceStates", + clientResolver +}); +export const useGetPythPriceStates = buildUseQuery({ + builderQueryFn: createGetPythPriceStates, + queryKeyPrefix: "PythPriceStatesQuery" +}); +export const createGetStorkPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPriceStatesRequest.encode, + decode: QueryStorkPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPriceStates", + clientResolver +}); +export const useGetStorkPriceStates = buildUseQuery({ + builderQueryFn: createGetStorkPriceStates, + queryKeyPrefix: "StorkPriceStatesQuery" +}); +export const createGetStorkPublishers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPublishersRequest.encode, + decode: QueryStorkPublishersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPublishers", + clientResolver +}); +export const useGetStorkPublishers = buildUseQuery({ + builderQueryFn: createGetStorkPublishers, + queryKeyPrefix: "StorkPublishersQuery" +}); +export const createGetProviderPriceState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProviderPriceStateRequest.encode, + decode: QueryProviderPriceStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "ProviderPriceState", + clientResolver +}); +export const useGetProviderPriceState = buildUseQuery({ + builderQueryFn: createGetProviderPriceState, + queryKeyPrefix: "ProviderPriceStateQuery" +}); +export const createGetOracleModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleModuleState", + clientResolver +}); +export const useGetOracleModuleState = buildUseQuery({ + builderQueryFn: createGetOracleModuleState, + queryKeyPrefix: "OracleModuleStateQuery" +}); +export const createGetHistoricalPriceRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalPriceRecordsRequest.encode, + decode: QueryHistoricalPriceRecordsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "HistoricalPriceRecords", + clientResolver +}); +export const useGetHistoricalPriceRecords = buildUseQuery({ + builderQueryFn: createGetHistoricalPriceRecords, + queryKeyPrefix: "HistoricalPriceRecordsQuery" +}); +export const createGetOracleVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleVolatilityRequest.encode, + decode: QueryOracleVolatilityResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleVolatility", + clientResolver +}); +export const useGetOracleVolatility = buildUseQuery({ + builderQueryFn: createGetOracleVolatility, + queryKeyPrefix: "OracleVolatilityQuery" +}); +export const createGetOracleProvidersInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProvidersInfoRequest.encode, + decode: QueryOracleProvidersInfoResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProvidersInfo", + clientResolver +}); +export const useGetOracleProvidersInfo = buildUseQuery({ + builderQueryFn: createGetOracleProvidersInfo, + queryKeyPrefix: "OracleProvidersInfoQuery" +}); +export const createGetOracleProviderPrices = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProviderPricesRequest.encode, + decode: QueryOracleProviderPricesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProviderPrices", + clientResolver +}); +export const useGetOracleProviderPrices = buildUseQuery({ + builderQueryFn: createGetOracleProviderPrices, + queryKeyPrefix: "OracleProviderPricesQuery" +}); +export const createGetOraclePrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOraclePriceRequest.encode, + decode: QueryOraclePriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OraclePrice", + clientResolver +}); +export const useGetOraclePrice = buildUseQuery({ + builderQueryFn: createGetOraclePrice, + queryKeyPrefix: "OraclePriceQuery" +}); +export const createGetPythPrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceRequest.encode, + decode: QueryPythPriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPrice", + clientResolver +}); +export const useGetPythPrice = buildUseQuery({ + builderQueryFn: createGetPythPrice, + queryKeyPrefix: "PythPriceQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/query.ts b/libs/injective-query/src/injective/oracle/v1beta1/query.ts new file mode 100644 index 00000000..e44832a4 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/query.ts @@ -0,0 +1,3446 @@ +import { OracleType, OracleInfo, OracleInfoAmino, PythPriceState, PythPriceStateAmino, Params, ParamsAmino, BandPriceState, BandPriceStateAmino, PriceFeedState, PriceFeedStateAmino, CoinbasePriceState, CoinbasePriceStateAmino, StorkPriceState, StorkPriceStateAmino, PriceState, PriceStateAmino, PriceRecords, PriceRecordsAmino, MetadataStatistics, MetadataStatisticsAmino, PriceRecord, PriceRecordAmino, ProviderInfo, ProviderInfoAmino, ProviderState, ProviderStateAmino } from "./oracle"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryPythPriceRequest { + priceId: string; +} +export interface QueryPythPriceRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest"; + value: Uint8Array; +} +export interface QueryPythPriceRequestAmino { + price_id: string; +} +export interface QueryPythPriceRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceRequest"; + value: QueryPythPriceRequestAmino; +} +export interface QueryPythPriceResponse { + priceState?: PythPriceState; +} +export interface QueryPythPriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse"; + value: Uint8Array; +} +export interface QueryPythPriceResponseAmino { + price_state?: PythPriceStateAmino; +} +export interface QueryPythPriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceResponse"; + value: QueryPythPriceResponseAmino; +} +/** + * QueryOracleParamsRequest is the request type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** + * QueryOracleParamsRequest is the request type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** + * QueryOracleParamsResponse is the response type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** + * QueryOracleParamsResponse is the response type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryBandRelayersRequest is the request type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersRequest {} +export interface QueryBandRelayersRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest"; + value: Uint8Array; +} +/** + * QueryBandRelayersRequest is the request type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersRequestAmino {} +export interface QueryBandRelayersRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandRelayersRequest"; + value: QueryBandRelayersRequestAmino; +} +/** + * QueryBandRelayersResponse is the response type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersResponse { + relayers: string[]; +} +export interface QueryBandRelayersResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse"; + value: Uint8Array; +} +/** + * QueryBandRelayersResponse is the response type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersResponseAmino { + relayers: string[]; +} +export interface QueryBandRelayersResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandRelayersResponse"; + value: QueryBandRelayersResponseAmino; +} +/** + * QueryBandPriceStatesRequest is the request type for the Query/BandPriceStates + * RPC method. + */ +export interface QueryBandPriceStatesRequest {} +export interface QueryBandPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryBandPriceStatesRequest is the request type for the Query/BandPriceStates + * RPC method. + */ +export interface QueryBandPriceStatesRequestAmino {} +export interface QueryBandPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest"; + value: QueryBandPriceStatesRequestAmino; +} +/** + * QueryBandPriceStatesResponse is the response type for the + * Query/BandPriceStates RPC method. + */ +export interface QueryBandPriceStatesResponse { + priceStates: BandPriceState[]; +} +export interface QueryBandPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryBandPriceStatesResponse is the response type for the + * Query/BandPriceStates RPC method. + */ +export interface QueryBandPriceStatesResponseAmino { + price_states: BandPriceStateAmino[]; +} +export interface QueryBandPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse"; + value: QueryBandPriceStatesResponseAmino; +} +/** + * QueryBandIBCPriceStatesRequest is the request type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesRequest {} +export interface QueryBandIBCPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryBandIBCPriceStatesRequest is the request type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesRequestAmino {} +export interface QueryBandIBCPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest"; + value: QueryBandIBCPriceStatesRequestAmino; +} +/** + * QueryBandIBCPriceStatesResponse is the response type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesResponse { + priceStates: BandPriceState[]; +} +export interface QueryBandIBCPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryBandIBCPriceStatesResponse is the response type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesResponseAmino { + price_states: BandPriceStateAmino[]; +} +export interface QueryBandIBCPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse"; + value: QueryBandIBCPriceStatesResponseAmino; +} +/** + * QueryPriceFeedPriceStatesRequest is the request type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesRequest {} +export interface QueryPriceFeedPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryPriceFeedPriceStatesRequest is the request type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesRequestAmino {} +export interface QueryPriceFeedPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest"; + value: QueryPriceFeedPriceStatesRequestAmino; +} +/** + * QueryPriceFeedPriceStatesResponse is the response type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesResponse { + priceStates: PriceFeedState[]; +} +export interface QueryPriceFeedPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryPriceFeedPriceStatesResponse is the response type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesResponseAmino { + price_states: PriceFeedStateAmino[]; +} +export interface QueryPriceFeedPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse"; + value: QueryPriceFeedPriceStatesResponseAmino; +} +/** + * QueryCoinbasePriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesRequest {} +export interface QueryCoinbasePriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryCoinbasePriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesRequestAmino {} +export interface QueryCoinbasePriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest"; + value: QueryCoinbasePriceStatesRequestAmino; +} +/** + * QueryCoinbasePriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesResponse { + priceStates: CoinbasePriceState[]; +} +export interface QueryCoinbasePriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryCoinbasePriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesResponseAmino { + price_states: CoinbasePriceStateAmino[]; +} +export interface QueryCoinbasePriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse"; + value: QueryCoinbasePriceStatesResponseAmino; +} +/** + * QueryPythPriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesRequest {} +export interface QueryPythPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryPythPriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesRequestAmino {} +export interface QueryPythPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest"; + value: QueryPythPriceStatesRequestAmino; +} +/** + * QueryPythPriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesResponse { + priceStates: PythPriceState[]; +} +export interface QueryPythPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryPythPriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesResponseAmino { + price_states: PythPriceStateAmino[]; +} +export interface QueryPythPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse"; + value: QueryPythPriceStatesResponseAmino; +} +/** + * QueryStorkPriceStatesRequest is the request type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesRequest {} +export interface QueryStorkPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryStorkPriceStatesRequest is the request type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesRequestAmino {} +export interface QueryStorkPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest"; + value: QueryStorkPriceStatesRequestAmino; +} +/** + * QueryStorkPriceStatesResponse is the response type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesResponse { + priceStates: StorkPriceState[]; +} +export interface QueryStorkPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryStorkPriceStatesResponse is the response type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesResponseAmino { + price_states: StorkPriceStateAmino[]; +} +export interface QueryStorkPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse"; + value: QueryStorkPriceStatesResponseAmino; +} +/** + * QueryStorkPublishersRequest is the request type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersRequest {} +export interface QueryStorkPublishersRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest"; + value: Uint8Array; +} +/** + * QueryStorkPublishersRequest is the request type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersRequestAmino {} +export interface QueryStorkPublishersRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPublishersRequest"; + value: QueryStorkPublishersRequestAmino; +} +/** + * QueryStorkPublishersResponse is the response type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersResponse { + publishers: string[]; +} +export interface QueryStorkPublishersResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse"; + value: Uint8Array; +} +/** + * QueryStorkPublishersResponse is the response type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersResponseAmino { + publishers: string[]; +} +export interface QueryStorkPublishersResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPublishersResponse"; + value: QueryStorkPublishersResponseAmino; +} +/** + * QueryProviderPriceStateRequest is the request type for the + * Query/ProviderPriceState RPC method. + */ +export interface QueryProviderPriceStateRequest { + provider: string; + symbol: string; +} +export interface QueryProviderPriceStateRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest"; + value: Uint8Array; +} +/** + * QueryProviderPriceStateRequest is the request type for the + * Query/ProviderPriceState RPC method. + */ +export interface QueryProviderPriceStateRequestAmino { + provider: string; + symbol: string; +} +export interface QueryProviderPriceStateRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest"; + value: QueryProviderPriceStateRequestAmino; +} +/** + * QueryProviderPriceStatesResponse is the response type for the + * Query/ProviderPriceStates RPC method. + */ +export interface QueryProviderPriceStateResponse { + priceState?: PriceState; +} +export interface QueryProviderPriceStateResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse"; + value: Uint8Array; +} +/** + * QueryProviderPriceStatesResponse is the response type for the + * Query/ProviderPriceStates RPC method. + */ +export interface QueryProviderPriceStateResponseAmino { + price_state?: PriceStateAmino; +} +export interface QueryProviderPriceStateResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse"; + value: QueryProviderPriceStateResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface QueryHistoricalPriceRecordsRequest { + oracle: OracleType; + symbolId: string; +} +export interface QueryHistoricalPriceRecordsRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest"; + value: Uint8Array; +} +export interface QueryHistoricalPriceRecordsRequestAmino { + oracle: OracleType; + symbol_id: string; +} +export interface QueryHistoricalPriceRecordsRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest"; + value: QueryHistoricalPriceRecordsRequestAmino; +} +export interface QueryHistoricalPriceRecordsResponse { + priceRecords: PriceRecords[]; +} +export interface QueryHistoricalPriceRecordsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse"; + value: Uint8Array; +} +export interface QueryHistoricalPriceRecordsResponseAmino { + price_records: PriceRecordsAmino[]; +} +export interface QueryHistoricalPriceRecordsResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse"; + value: QueryHistoricalPriceRecordsResponseAmino; +} +export interface OracleHistoryOptions { + /** + * MaxAge restricts the oracle price records oldest age in seconds from the + * current block time to consider. A value of 0 means use all the records + * present on the chain. + */ + maxAge: bigint; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + includeRawHistory: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + includeMetadata: boolean; +} +export interface OracleHistoryOptionsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions"; + value: Uint8Array; +} +export interface OracleHistoryOptionsAmino { + /** + * MaxAge restricts the oracle price records oldest age in seconds from the + * current block time to consider. A value of 0 means use all the records + * present on the chain. + */ + max_age: string; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + include_raw_history: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + include_metadata: boolean; +} +export interface OracleHistoryOptionsAminoMsg { + type: "/injective.oracle.v1beta1.OracleHistoryOptions"; + value: OracleHistoryOptionsAmino; +} +/** + * QueryOracleVolatilityRequest is the request type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityRequest { + baseInfo?: OracleInfo; + quoteInfo?: OracleInfo; + oracleHistoryOptions?: OracleHistoryOptions; +} +export interface QueryOracleVolatilityRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest"; + value: Uint8Array; +} +/** + * QueryOracleVolatilityRequest is the request type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityRequestAmino { + base_info?: OracleInfoAmino; + quote_info?: OracleInfoAmino; + oracle_history_options?: OracleHistoryOptionsAmino; +} +export interface QueryOracleVolatilityRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest"; + value: QueryOracleVolatilityRequestAmino; +} +/** + * QueryOracleVolatilityResponse is the response type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityResponse { + volatility: string; + historyMetadata?: MetadataStatistics; + rawHistory: PriceRecord[]; +} +export interface QueryOracleVolatilityResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse"; + value: Uint8Array; +} +/** + * QueryOracleVolatilityResponse is the response type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityResponseAmino { + volatility: string; + history_metadata?: MetadataStatisticsAmino; + raw_history: PriceRecordAmino[]; +} +export interface QueryOracleVolatilityResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse"; + value: QueryOracleVolatilityResponseAmino; +} +export interface QueryOracleProvidersInfoRequest {} +export interface QueryOracleProvidersInfoRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest"; + value: Uint8Array; +} +export interface QueryOracleProvidersInfoRequestAmino {} +export interface QueryOracleProvidersInfoRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest"; + value: QueryOracleProvidersInfoRequestAmino; +} +export interface QueryOracleProvidersInfoResponse { + providers: ProviderInfo[]; +} +export interface QueryOracleProvidersInfoResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse"; + value: Uint8Array; +} +export interface QueryOracleProvidersInfoResponseAmino { + providers: ProviderInfoAmino[]; +} +export interface QueryOracleProvidersInfoResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse"; + value: QueryOracleProvidersInfoResponseAmino; +} +export interface QueryOracleProviderPricesRequest { + provider: string; +} +export interface QueryOracleProviderPricesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest"; + value: Uint8Array; +} +export interface QueryOracleProviderPricesRequestAmino { + provider: string; +} +export interface QueryOracleProviderPricesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest"; + value: QueryOracleProviderPricesRequestAmino; +} +export interface QueryOracleProviderPricesResponse { + providerState: ProviderState[]; +} +export interface QueryOracleProviderPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse"; + value: Uint8Array; +} +export interface QueryOracleProviderPricesResponseAmino { + providerState: ProviderStateAmino[]; +} +export interface QueryOracleProviderPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse"; + value: QueryOracleProviderPricesResponseAmino; +} +/** + * ScalingOptions defines optional configuration to avoid precision loss. The + * oracle result will be returned as base_price * 10^base_decimals / quote_price + * * 10^quote_decimals + */ +export interface ScalingOptions { + baseDecimals: number; + quoteDecimals: number; +} +export interface ScalingOptionsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions"; + value: Uint8Array; +} +/** + * ScalingOptions defines optional configuration to avoid precision loss. The + * oracle result will be returned as base_price * 10^base_decimals / quote_price + * * 10^quote_decimals + */ +export interface ScalingOptionsAmino { + base_decimals: number; + quote_decimals: number; +} +export interface ScalingOptionsAminoMsg { + type: "/injective.oracle.v1beta1.ScalingOptions"; + value: ScalingOptionsAmino; +} +/** + * QueryOraclePriceRequest is the request type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceRequest { + oracleType: OracleType; + base: string; + quote: string; + scalingOptions?: ScalingOptions; +} +export interface QueryOraclePriceRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest"; + value: Uint8Array; +} +/** + * QueryOraclePriceRequest is the request type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceRequestAmino { + oracle_type: OracleType; + base: string; + quote: string; + scaling_options?: ScalingOptionsAmino; +} +export interface QueryOraclePriceRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOraclePriceRequest"; + value: QueryOraclePriceRequestAmino; +} +export interface PricePairState { + pairPrice: string; + basePrice: string; + quotePrice: string; + baseCumulativePrice: string; + quoteCumulativePrice: string; + baseTimestamp: bigint; + quoteTimestamp: bigint; +} +export interface PricePairStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PricePairState"; + value: Uint8Array; +} +export interface PricePairStateAmino { + pair_price: string; + base_price: string; + quote_price: string; + base_cumulative_price: string; + quote_cumulative_price: string; + base_timestamp: string; + quote_timestamp: string; +} +export interface PricePairStateAminoMsg { + type: "/injective.oracle.v1beta1.PricePairState"; + value: PricePairStateAmino; +} +/** + * QueryOraclePriceResponse is the response type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceResponse { + pricePairState?: PricePairState; +} +export interface QueryOraclePriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse"; + value: Uint8Array; +} +/** + * QueryOraclePriceResponse is the response type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceResponseAmino { + price_pair_state?: PricePairStateAmino; +} +export interface QueryOraclePriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOraclePriceResponse"; + value: QueryOraclePriceResponseAmino; +} +function createBaseQueryPythPriceRequest(): QueryPythPriceRequest { + return { + priceId: "" + }; +} +export const QueryPythPriceRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest", + is(o: any): o is QueryPythPriceRequest { + return o && (o.$typeUrl === QueryPythPriceRequest.typeUrl || typeof o.priceId === "string"); + }, + isAmino(o: any): o is QueryPythPriceRequestAmino { + return o && (o.$typeUrl === QueryPythPriceRequest.typeUrl || typeof o.price_id === "string"); + }, + encode(message: QueryPythPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceRequest { + const message = createBaseQueryPythPriceRequest(); + message.priceId = object.priceId ?? ""; + return message; + }, + fromAmino(object: QueryPythPriceRequestAmino): QueryPythPriceRequest { + const message = createBaseQueryPythPriceRequest(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + return message; + }, + toAmino(message: QueryPythPriceRequest): QueryPythPriceRequestAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + return obj; + }, + fromAminoMsg(object: QueryPythPriceRequestAminoMsg): QueryPythPriceRequest { + return QueryPythPriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceRequestProtoMsg): QueryPythPriceRequest { + return QueryPythPriceRequest.decode(message.value); + }, + toProto(message: QueryPythPriceRequest): Uint8Array { + return QueryPythPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceRequest): QueryPythPriceRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest", + value: QueryPythPriceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceRequest.typeUrl, QueryPythPriceRequest); +function createBaseQueryPythPriceResponse(): QueryPythPriceResponse { + return { + priceState: undefined + }; +} +export const QueryPythPriceResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse", + is(o: any): o is QueryPythPriceResponse { + return o && o.$typeUrl === QueryPythPriceResponse.typeUrl; + }, + isAmino(o: any): o is QueryPythPriceResponseAmino { + return o && o.$typeUrl === QueryPythPriceResponse.typeUrl; + }, + encode(message: QueryPythPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceState !== undefined) { + PythPriceState.encode(message.priceState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceState = PythPriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceResponse { + const message = createBaseQueryPythPriceResponse(); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PythPriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: QueryPythPriceResponseAmino): QueryPythPriceResponse { + const message = createBaseQueryPythPriceResponse(); + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PythPriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: QueryPythPriceResponse): QueryPythPriceResponseAmino { + const obj: any = {}; + obj.price_state = message.priceState ? PythPriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPythPriceResponseAminoMsg): QueryPythPriceResponse { + return QueryPythPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceResponseProtoMsg): QueryPythPriceResponse { + return QueryPythPriceResponse.decode(message.value); + }, + toProto(message: QueryPythPriceResponse): Uint8Array { + return QueryPythPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceResponse): QueryPythPriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse", + value: QueryPythPriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceResponse.typeUrl, QueryPythPriceResponse); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryBandRelayersRequest(): QueryBandRelayersRequest { + return {}; +} +export const QueryBandRelayersRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest", + is(o: any): o is QueryBandRelayersRequest { + return o && o.$typeUrl === QueryBandRelayersRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandRelayersRequestAmino { + return o && o.$typeUrl === QueryBandRelayersRequest.typeUrl; + }, + encode(_: QueryBandRelayersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandRelayersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandRelayersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandRelayersRequest { + const message = createBaseQueryBandRelayersRequest(); + return message; + }, + fromAmino(_: QueryBandRelayersRequestAmino): QueryBandRelayersRequest { + const message = createBaseQueryBandRelayersRequest(); + return message; + }, + toAmino(_: QueryBandRelayersRequest): QueryBandRelayersRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandRelayersRequestAminoMsg): QueryBandRelayersRequest { + return QueryBandRelayersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandRelayersRequestProtoMsg): QueryBandRelayersRequest { + return QueryBandRelayersRequest.decode(message.value); + }, + toProto(message: QueryBandRelayersRequest): Uint8Array { + return QueryBandRelayersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandRelayersRequest): QueryBandRelayersRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest", + value: QueryBandRelayersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandRelayersRequest.typeUrl, QueryBandRelayersRequest); +function createBaseQueryBandRelayersResponse(): QueryBandRelayersResponse { + return { + relayers: [] + }; +} +export const QueryBandRelayersResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse", + is(o: any): o is QueryBandRelayersResponse { + return o && (o.$typeUrl === QueryBandRelayersResponse.typeUrl || Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is QueryBandRelayersResponseAmino { + return o && (o.$typeUrl === QueryBandRelayersResponse.typeUrl || Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: QueryBandRelayersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.relayers) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandRelayersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandRelayersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandRelayersResponse { + const message = createBaseQueryBandRelayersResponse(); + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryBandRelayersResponseAmino): QueryBandRelayersResponse { + const message = createBaseQueryBandRelayersResponse(); + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: QueryBandRelayersResponse): QueryBandRelayersResponseAmino { + const obj: any = {}; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: QueryBandRelayersResponseAminoMsg): QueryBandRelayersResponse { + return QueryBandRelayersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandRelayersResponseProtoMsg): QueryBandRelayersResponse { + return QueryBandRelayersResponse.decode(message.value); + }, + toProto(message: QueryBandRelayersResponse): Uint8Array { + return QueryBandRelayersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandRelayersResponse): QueryBandRelayersResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse", + value: QueryBandRelayersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandRelayersResponse.typeUrl, QueryBandRelayersResponse); +function createBaseQueryBandPriceStatesRequest(): QueryBandPriceStatesRequest { + return {}; +} +export const QueryBandPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest", + is(o: any): o is QueryBandPriceStatesRequest { + return o && o.$typeUrl === QueryBandPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandPriceStatesRequestAmino { + return o && o.$typeUrl === QueryBandPriceStatesRequest.typeUrl; + }, + encode(_: QueryBandPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandPriceStatesRequest { + const message = createBaseQueryBandPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryBandPriceStatesRequestAmino): QueryBandPriceStatesRequest { + const message = createBaseQueryBandPriceStatesRequest(); + return message; + }, + toAmino(_: QueryBandPriceStatesRequest): QueryBandPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandPriceStatesRequestAminoMsg): QueryBandPriceStatesRequest { + return QueryBandPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandPriceStatesRequestProtoMsg): QueryBandPriceStatesRequest { + return QueryBandPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryBandPriceStatesRequest): Uint8Array { + return QueryBandPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandPriceStatesRequest): QueryBandPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest", + value: QueryBandPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandPriceStatesRequest.typeUrl, QueryBandPriceStatesRequest); +function createBaseQueryBandPriceStatesResponse(): QueryBandPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryBandPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse", + is(o: any): o is QueryBandPriceStatesResponse { + return o && (o.$typeUrl === QueryBandPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || BandPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryBandPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryBandPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || BandPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryBandPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + BandPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandPriceStatesResponse { + const message = createBaseQueryBandPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => BandPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBandPriceStatesResponseAmino): QueryBandPriceStatesResponse { + const message = createBaseQueryBandPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => BandPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBandPriceStatesResponse): QueryBandPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryBandPriceStatesResponseAminoMsg): QueryBandPriceStatesResponse { + return QueryBandPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandPriceStatesResponseProtoMsg): QueryBandPriceStatesResponse { + return QueryBandPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryBandPriceStatesResponse): Uint8Array { + return QueryBandPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandPriceStatesResponse): QueryBandPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse", + value: QueryBandPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandPriceStatesResponse.typeUrl, QueryBandPriceStatesResponse); +function createBaseQueryBandIBCPriceStatesRequest(): QueryBandIBCPriceStatesRequest { + return {}; +} +export const QueryBandIBCPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest", + is(o: any): o is QueryBandIBCPriceStatesRequest { + return o && o.$typeUrl === QueryBandIBCPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandIBCPriceStatesRequestAmino { + return o && o.$typeUrl === QueryBandIBCPriceStatesRequest.typeUrl; + }, + encode(_: QueryBandIBCPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandIBCPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandIBCPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandIBCPriceStatesRequest { + const message = createBaseQueryBandIBCPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryBandIBCPriceStatesRequestAmino): QueryBandIBCPriceStatesRequest { + const message = createBaseQueryBandIBCPriceStatesRequest(); + return message; + }, + toAmino(_: QueryBandIBCPriceStatesRequest): QueryBandIBCPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandIBCPriceStatesRequestAminoMsg): QueryBandIBCPriceStatesRequest { + return QueryBandIBCPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandIBCPriceStatesRequestProtoMsg): QueryBandIBCPriceStatesRequest { + return QueryBandIBCPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryBandIBCPriceStatesRequest): Uint8Array { + return QueryBandIBCPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandIBCPriceStatesRequest): QueryBandIBCPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest", + value: QueryBandIBCPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandIBCPriceStatesRequest.typeUrl, QueryBandIBCPriceStatesRequest); +function createBaseQueryBandIBCPriceStatesResponse(): QueryBandIBCPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryBandIBCPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse", + is(o: any): o is QueryBandIBCPriceStatesResponse { + return o && (o.$typeUrl === QueryBandIBCPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || BandPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryBandIBCPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryBandIBCPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || BandPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryBandIBCPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + BandPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandIBCPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandIBCPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandIBCPriceStatesResponse { + const message = createBaseQueryBandIBCPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => BandPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBandIBCPriceStatesResponseAmino): QueryBandIBCPriceStatesResponse { + const message = createBaseQueryBandIBCPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => BandPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBandIBCPriceStatesResponse): QueryBandIBCPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryBandIBCPriceStatesResponseAminoMsg): QueryBandIBCPriceStatesResponse { + return QueryBandIBCPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandIBCPriceStatesResponseProtoMsg): QueryBandIBCPriceStatesResponse { + return QueryBandIBCPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryBandIBCPriceStatesResponse): Uint8Array { + return QueryBandIBCPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandIBCPriceStatesResponse): QueryBandIBCPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse", + value: QueryBandIBCPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandIBCPriceStatesResponse.typeUrl, QueryBandIBCPriceStatesResponse); +function createBaseQueryPriceFeedPriceStatesRequest(): QueryPriceFeedPriceStatesRequest { + return {}; +} +export const QueryPriceFeedPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest", + is(o: any): o is QueryPriceFeedPriceStatesRequest { + return o && o.$typeUrl === QueryPriceFeedPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPriceFeedPriceStatesRequestAmino { + return o && o.$typeUrl === QueryPriceFeedPriceStatesRequest.typeUrl; + }, + encode(_: QueryPriceFeedPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPriceFeedPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPriceFeedPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPriceFeedPriceStatesRequest { + const message = createBaseQueryPriceFeedPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryPriceFeedPriceStatesRequestAmino): QueryPriceFeedPriceStatesRequest { + const message = createBaseQueryPriceFeedPriceStatesRequest(); + return message; + }, + toAmino(_: QueryPriceFeedPriceStatesRequest): QueryPriceFeedPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPriceFeedPriceStatesRequestAminoMsg): QueryPriceFeedPriceStatesRequest { + return QueryPriceFeedPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPriceFeedPriceStatesRequestProtoMsg): QueryPriceFeedPriceStatesRequest { + return QueryPriceFeedPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryPriceFeedPriceStatesRequest): Uint8Array { + return QueryPriceFeedPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPriceFeedPriceStatesRequest): QueryPriceFeedPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest", + value: QueryPriceFeedPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPriceFeedPriceStatesRequest.typeUrl, QueryPriceFeedPriceStatesRequest); +function createBaseQueryPriceFeedPriceStatesResponse(): QueryPriceFeedPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryPriceFeedPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse", + is(o: any): o is QueryPriceFeedPriceStatesResponse { + return o && (o.$typeUrl === QueryPriceFeedPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || PriceFeedState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryPriceFeedPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryPriceFeedPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || PriceFeedState.isAmino(o.price_states[0]))); + }, + encode(message: QueryPriceFeedPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + PriceFeedState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPriceFeedPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPriceFeedPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(PriceFeedState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPriceFeedPriceStatesResponse { + const message = createBaseQueryPriceFeedPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => PriceFeedState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPriceFeedPriceStatesResponseAmino): QueryPriceFeedPriceStatesResponse { + const message = createBaseQueryPriceFeedPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => PriceFeedState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPriceFeedPriceStatesResponse): QueryPriceFeedPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? PriceFeedState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryPriceFeedPriceStatesResponseAminoMsg): QueryPriceFeedPriceStatesResponse { + return QueryPriceFeedPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPriceFeedPriceStatesResponseProtoMsg): QueryPriceFeedPriceStatesResponse { + return QueryPriceFeedPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryPriceFeedPriceStatesResponse): Uint8Array { + return QueryPriceFeedPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPriceFeedPriceStatesResponse): QueryPriceFeedPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse", + value: QueryPriceFeedPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPriceFeedPriceStatesResponse.typeUrl, QueryPriceFeedPriceStatesResponse); +function createBaseQueryCoinbasePriceStatesRequest(): QueryCoinbasePriceStatesRequest { + return {}; +} +export const QueryCoinbasePriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest", + is(o: any): o is QueryCoinbasePriceStatesRequest { + return o && o.$typeUrl === QueryCoinbasePriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryCoinbasePriceStatesRequestAmino { + return o && o.$typeUrl === QueryCoinbasePriceStatesRequest.typeUrl; + }, + encode(_: QueryCoinbasePriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCoinbasePriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCoinbasePriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCoinbasePriceStatesRequest { + const message = createBaseQueryCoinbasePriceStatesRequest(); + return message; + }, + fromAmino(_: QueryCoinbasePriceStatesRequestAmino): QueryCoinbasePriceStatesRequest { + const message = createBaseQueryCoinbasePriceStatesRequest(); + return message; + }, + toAmino(_: QueryCoinbasePriceStatesRequest): QueryCoinbasePriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCoinbasePriceStatesRequestAminoMsg): QueryCoinbasePriceStatesRequest { + return QueryCoinbasePriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCoinbasePriceStatesRequestProtoMsg): QueryCoinbasePriceStatesRequest { + return QueryCoinbasePriceStatesRequest.decode(message.value); + }, + toProto(message: QueryCoinbasePriceStatesRequest): Uint8Array { + return QueryCoinbasePriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCoinbasePriceStatesRequest): QueryCoinbasePriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest", + value: QueryCoinbasePriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCoinbasePriceStatesRequest.typeUrl, QueryCoinbasePriceStatesRequest); +function createBaseQueryCoinbasePriceStatesResponse(): QueryCoinbasePriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryCoinbasePriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse", + is(o: any): o is QueryCoinbasePriceStatesResponse { + return o && (o.$typeUrl === QueryCoinbasePriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || CoinbasePriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryCoinbasePriceStatesResponseAmino { + return o && (o.$typeUrl === QueryCoinbasePriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || CoinbasePriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryCoinbasePriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + CoinbasePriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCoinbasePriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCoinbasePriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(CoinbasePriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCoinbasePriceStatesResponse { + const message = createBaseQueryCoinbasePriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => CoinbasePriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCoinbasePriceStatesResponseAmino): QueryCoinbasePriceStatesResponse { + const message = createBaseQueryCoinbasePriceStatesResponse(); + message.priceStates = object.price_states?.map(e => CoinbasePriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCoinbasePriceStatesResponse): QueryCoinbasePriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? CoinbasePriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryCoinbasePriceStatesResponseAminoMsg): QueryCoinbasePriceStatesResponse { + return QueryCoinbasePriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCoinbasePriceStatesResponseProtoMsg): QueryCoinbasePriceStatesResponse { + return QueryCoinbasePriceStatesResponse.decode(message.value); + }, + toProto(message: QueryCoinbasePriceStatesResponse): Uint8Array { + return QueryCoinbasePriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCoinbasePriceStatesResponse): QueryCoinbasePriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse", + value: QueryCoinbasePriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCoinbasePriceStatesResponse.typeUrl, QueryCoinbasePriceStatesResponse); +function createBaseQueryPythPriceStatesRequest(): QueryPythPriceStatesRequest { + return {}; +} +export const QueryPythPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest", + is(o: any): o is QueryPythPriceStatesRequest { + return o && o.$typeUrl === QueryPythPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPythPriceStatesRequestAmino { + return o && o.$typeUrl === QueryPythPriceStatesRequest.typeUrl; + }, + encode(_: QueryPythPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPythPriceStatesRequest { + const message = createBaseQueryPythPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryPythPriceStatesRequestAmino): QueryPythPriceStatesRequest { + const message = createBaseQueryPythPriceStatesRequest(); + return message; + }, + toAmino(_: QueryPythPriceStatesRequest): QueryPythPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPythPriceStatesRequestAminoMsg): QueryPythPriceStatesRequest { + return QueryPythPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceStatesRequestProtoMsg): QueryPythPriceStatesRequest { + return QueryPythPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryPythPriceStatesRequest): Uint8Array { + return QueryPythPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceStatesRequest): QueryPythPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest", + value: QueryPythPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceStatesRequest.typeUrl, QueryPythPriceStatesRequest); +function createBaseQueryPythPriceStatesResponse(): QueryPythPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryPythPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse", + is(o: any): o is QueryPythPriceStatesResponse { + return o && (o.$typeUrl === QueryPythPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || PythPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryPythPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryPythPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || PythPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryPythPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + PythPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(PythPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceStatesResponse { + const message = createBaseQueryPythPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => PythPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPythPriceStatesResponseAmino): QueryPythPriceStatesResponse { + const message = createBaseQueryPythPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => PythPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPythPriceStatesResponse): QueryPythPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryPythPriceStatesResponseAminoMsg): QueryPythPriceStatesResponse { + return QueryPythPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceStatesResponseProtoMsg): QueryPythPriceStatesResponse { + return QueryPythPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryPythPriceStatesResponse): Uint8Array { + return QueryPythPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceStatesResponse): QueryPythPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse", + value: QueryPythPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceStatesResponse.typeUrl, QueryPythPriceStatesResponse); +function createBaseQueryStorkPriceStatesRequest(): QueryStorkPriceStatesRequest { + return {}; +} +export const QueryStorkPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest", + is(o: any): o is QueryStorkPriceStatesRequest { + return o && o.$typeUrl === QueryStorkPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryStorkPriceStatesRequestAmino { + return o && o.$typeUrl === QueryStorkPriceStatesRequest.typeUrl; + }, + encode(_: QueryStorkPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryStorkPriceStatesRequest { + const message = createBaseQueryStorkPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryStorkPriceStatesRequestAmino): QueryStorkPriceStatesRequest { + const message = createBaseQueryStorkPriceStatesRequest(); + return message; + }, + toAmino(_: QueryStorkPriceStatesRequest): QueryStorkPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStorkPriceStatesRequestAminoMsg): QueryStorkPriceStatesRequest { + return QueryStorkPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPriceStatesRequestProtoMsg): QueryStorkPriceStatesRequest { + return QueryStorkPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryStorkPriceStatesRequest): Uint8Array { + return QueryStorkPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPriceStatesRequest): QueryStorkPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest", + value: QueryStorkPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPriceStatesRequest.typeUrl, QueryStorkPriceStatesRequest); +function createBaseQueryStorkPriceStatesResponse(): QueryStorkPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryStorkPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse", + is(o: any): o is QueryStorkPriceStatesResponse { + return o && (o.$typeUrl === QueryStorkPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || StorkPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryStorkPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryStorkPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || StorkPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryStorkPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + StorkPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(StorkPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryStorkPriceStatesResponse { + const message = createBaseQueryStorkPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => StorkPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryStorkPriceStatesResponseAmino): QueryStorkPriceStatesResponse { + const message = createBaseQueryStorkPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => StorkPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryStorkPriceStatesResponse): QueryStorkPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryStorkPriceStatesResponseAminoMsg): QueryStorkPriceStatesResponse { + return QueryStorkPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPriceStatesResponseProtoMsg): QueryStorkPriceStatesResponse { + return QueryStorkPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryStorkPriceStatesResponse): Uint8Array { + return QueryStorkPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPriceStatesResponse): QueryStorkPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse", + value: QueryStorkPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPriceStatesResponse.typeUrl, QueryStorkPriceStatesResponse); +function createBaseQueryStorkPublishersRequest(): QueryStorkPublishersRequest { + return {}; +} +export const QueryStorkPublishersRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest", + is(o: any): o is QueryStorkPublishersRequest { + return o && o.$typeUrl === QueryStorkPublishersRequest.typeUrl; + }, + isAmino(o: any): o is QueryStorkPublishersRequestAmino { + return o && o.$typeUrl === QueryStorkPublishersRequest.typeUrl; + }, + encode(_: QueryStorkPublishersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPublishersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPublishersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryStorkPublishersRequest { + const message = createBaseQueryStorkPublishersRequest(); + return message; + }, + fromAmino(_: QueryStorkPublishersRequestAmino): QueryStorkPublishersRequest { + const message = createBaseQueryStorkPublishersRequest(); + return message; + }, + toAmino(_: QueryStorkPublishersRequest): QueryStorkPublishersRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStorkPublishersRequestAminoMsg): QueryStorkPublishersRequest { + return QueryStorkPublishersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPublishersRequestProtoMsg): QueryStorkPublishersRequest { + return QueryStorkPublishersRequest.decode(message.value); + }, + toProto(message: QueryStorkPublishersRequest): Uint8Array { + return QueryStorkPublishersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPublishersRequest): QueryStorkPublishersRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest", + value: QueryStorkPublishersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPublishersRequest.typeUrl, QueryStorkPublishersRequest); +function createBaseQueryStorkPublishersResponse(): QueryStorkPublishersResponse { + return { + publishers: [] + }; +} +export const QueryStorkPublishersResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse", + is(o: any): o is QueryStorkPublishersResponse { + return o && (o.$typeUrl === QueryStorkPublishersResponse.typeUrl || Array.isArray(o.publishers) && (!o.publishers.length || typeof o.publishers[0] === "string")); + }, + isAmino(o: any): o is QueryStorkPublishersResponseAmino { + return o && (o.$typeUrl === QueryStorkPublishersResponse.typeUrl || Array.isArray(o.publishers) && (!o.publishers.length || typeof o.publishers[0] === "string")); + }, + encode(message: QueryStorkPublishersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.publishers) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPublishersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPublishersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryStorkPublishersResponse { + const message = createBaseQueryStorkPublishersResponse(); + message.publishers = object.publishers?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryStorkPublishersResponseAmino): QueryStorkPublishersResponse { + const message = createBaseQueryStorkPublishersResponse(); + message.publishers = object.publishers?.map(e => e) || []; + return message; + }, + toAmino(message: QueryStorkPublishersResponse): QueryStorkPublishersResponseAmino { + const obj: any = {}; + if (message.publishers) { + obj.publishers = message.publishers.map(e => e); + } else { + obj.publishers = message.publishers; + } + return obj; + }, + fromAminoMsg(object: QueryStorkPublishersResponseAminoMsg): QueryStorkPublishersResponse { + return QueryStorkPublishersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPublishersResponseProtoMsg): QueryStorkPublishersResponse { + return QueryStorkPublishersResponse.decode(message.value); + }, + toProto(message: QueryStorkPublishersResponse): Uint8Array { + return QueryStorkPublishersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPublishersResponse): QueryStorkPublishersResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse", + value: QueryStorkPublishersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPublishersResponse.typeUrl, QueryStorkPublishersResponse); +function createBaseQueryProviderPriceStateRequest(): QueryProviderPriceStateRequest { + return { + provider: "", + symbol: "" + }; +} +export const QueryProviderPriceStateRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest", + is(o: any): o is QueryProviderPriceStateRequest { + return o && (o.$typeUrl === QueryProviderPriceStateRequest.typeUrl || typeof o.provider === "string" && typeof o.symbol === "string"); + }, + isAmino(o: any): o is QueryProviderPriceStateRequestAmino { + return o && (o.$typeUrl === QueryProviderPriceStateRequest.typeUrl || typeof o.provider === "string" && typeof o.symbol === "string"); + }, + encode(message: QueryProviderPriceStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProviderPriceStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderPriceStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryProviderPriceStateRequest { + const message = createBaseQueryProviderPriceStateRequest(); + message.provider = object.provider ?? ""; + message.symbol = object.symbol ?? ""; + return message; + }, + fromAmino(object: QueryProviderPriceStateRequestAmino): QueryProviderPriceStateRequest { + const message = createBaseQueryProviderPriceStateRequest(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + return message; + }, + toAmino(message: QueryProviderPriceStateRequest): QueryProviderPriceStateRequestAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + return obj; + }, + fromAminoMsg(object: QueryProviderPriceStateRequestAminoMsg): QueryProviderPriceStateRequest { + return QueryProviderPriceStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderPriceStateRequestProtoMsg): QueryProviderPriceStateRequest { + return QueryProviderPriceStateRequest.decode(message.value); + }, + toProto(message: QueryProviderPriceStateRequest): Uint8Array { + return QueryProviderPriceStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderPriceStateRequest): QueryProviderPriceStateRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest", + value: QueryProviderPriceStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProviderPriceStateRequest.typeUrl, QueryProviderPriceStateRequest); +function createBaseQueryProviderPriceStateResponse(): QueryProviderPriceStateResponse { + return { + priceState: undefined + }; +} +export const QueryProviderPriceStateResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse", + is(o: any): o is QueryProviderPriceStateResponse { + return o && o.$typeUrl === QueryProviderPriceStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryProviderPriceStateResponseAmino { + return o && o.$typeUrl === QueryProviderPriceStateResponse.typeUrl; + }, + encode(message: QueryProviderPriceStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProviderPriceStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderPriceStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryProviderPriceStateResponse { + const message = createBaseQueryProviderPriceStateResponse(); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: QueryProviderPriceStateResponseAmino): QueryProviderPriceStateResponse { + const message = createBaseQueryProviderPriceStateResponse(); + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: QueryProviderPriceStateResponse): QueryProviderPriceStateResponseAmino { + const obj: any = {}; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProviderPriceStateResponseAminoMsg): QueryProviderPriceStateResponse { + return QueryProviderPriceStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderPriceStateResponseProtoMsg): QueryProviderPriceStateResponse { + return QueryProviderPriceStateResponse.decode(message.value); + }, + toProto(message: QueryProviderPriceStateResponse): Uint8Array { + return QueryProviderPriceStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderPriceStateResponse): QueryProviderPriceStateResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse", + value: QueryProviderPriceStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProviderPriceStateResponse.typeUrl, QueryProviderPriceStateResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryHistoricalPriceRecordsRequest(): QueryHistoricalPriceRecordsRequest { + return { + oracle: 0, + symbolId: "" + }; +} +export const QueryHistoricalPriceRecordsRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest", + is(o: any): o is QueryHistoricalPriceRecordsRequest { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsRequest.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string"); + }, + isAmino(o: any): o is QueryHistoricalPriceRecordsRequestAmino { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsRequest.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string"); + }, + encode(message: QueryHistoricalPriceRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalPriceRecordsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalPriceRecordsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalPriceRecordsRequest { + const message = createBaseQueryHistoricalPriceRecordsRequest(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + return message; + }, + fromAmino(object: QueryHistoricalPriceRecordsRequestAmino): QueryHistoricalPriceRecordsRequest { + const message = createBaseQueryHistoricalPriceRecordsRequest(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + return message; + }, + toAmino(message: QueryHistoricalPriceRecordsRequest): QueryHistoricalPriceRecordsRequestAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + return obj; + }, + fromAminoMsg(object: QueryHistoricalPriceRecordsRequestAminoMsg): QueryHistoricalPriceRecordsRequest { + return QueryHistoricalPriceRecordsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalPriceRecordsRequestProtoMsg): QueryHistoricalPriceRecordsRequest { + return QueryHistoricalPriceRecordsRequest.decode(message.value); + }, + toProto(message: QueryHistoricalPriceRecordsRequest): Uint8Array { + return QueryHistoricalPriceRecordsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalPriceRecordsRequest): QueryHistoricalPriceRecordsRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest", + value: QueryHistoricalPriceRecordsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalPriceRecordsRequest.typeUrl, QueryHistoricalPriceRecordsRequest); +function createBaseQueryHistoricalPriceRecordsResponse(): QueryHistoricalPriceRecordsResponse { + return { + priceRecords: [] + }; +} +export const QueryHistoricalPriceRecordsResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse", + is(o: any): o is QueryHistoricalPriceRecordsResponse { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsResponse.typeUrl || Array.isArray(o.priceRecords) && (!o.priceRecords.length || PriceRecords.is(o.priceRecords[0]))); + }, + isAmino(o: any): o is QueryHistoricalPriceRecordsResponseAmino { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsResponse.typeUrl || Array.isArray(o.price_records) && (!o.price_records.length || PriceRecords.isAmino(o.price_records[0]))); + }, + encode(message: QueryHistoricalPriceRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceRecords) { + PriceRecords.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalPriceRecordsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalPriceRecordsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceRecords.push(PriceRecords.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalPriceRecordsResponse { + const message = createBaseQueryHistoricalPriceRecordsResponse(); + message.priceRecords = object.priceRecords?.map(e => PriceRecords.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryHistoricalPriceRecordsResponseAmino): QueryHistoricalPriceRecordsResponse { + const message = createBaseQueryHistoricalPriceRecordsResponse(); + message.priceRecords = object.price_records?.map(e => PriceRecords.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryHistoricalPriceRecordsResponse): QueryHistoricalPriceRecordsResponseAmino { + const obj: any = {}; + if (message.priceRecords) { + obj.price_records = message.priceRecords.map(e => e ? PriceRecords.toAmino(e) : undefined); + } else { + obj.price_records = message.priceRecords; + } + return obj; + }, + fromAminoMsg(object: QueryHistoricalPriceRecordsResponseAminoMsg): QueryHistoricalPriceRecordsResponse { + return QueryHistoricalPriceRecordsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalPriceRecordsResponseProtoMsg): QueryHistoricalPriceRecordsResponse { + return QueryHistoricalPriceRecordsResponse.decode(message.value); + }, + toProto(message: QueryHistoricalPriceRecordsResponse): Uint8Array { + return QueryHistoricalPriceRecordsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalPriceRecordsResponse): QueryHistoricalPriceRecordsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse", + value: QueryHistoricalPriceRecordsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalPriceRecordsResponse.typeUrl, QueryHistoricalPriceRecordsResponse); +function createBaseOracleHistoryOptions(): OracleHistoryOptions { + return { + maxAge: BigInt(0), + includeRawHistory: false, + includeMetadata: false + }; +} +export const OracleHistoryOptions = { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions", + is(o: any): o is OracleHistoryOptions { + return o && (o.$typeUrl === OracleHistoryOptions.typeUrl || typeof o.maxAge === "bigint" && typeof o.includeRawHistory === "boolean" && typeof o.includeMetadata === "boolean"); + }, + isAmino(o: any): o is OracleHistoryOptionsAmino { + return o && (o.$typeUrl === OracleHistoryOptions.typeUrl || typeof o.max_age === "bigint" && typeof o.include_raw_history === "boolean" && typeof o.include_metadata === "boolean"); + }, + encode(message: OracleHistoryOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAge !== BigInt(0)) { + writer.uint32(8).uint64(message.maxAge); + } + if (message.includeRawHistory === true) { + writer.uint32(16).bool(message.includeRawHistory); + } + if (message.includeMetadata === true) { + writer.uint32(24).bool(message.includeMetadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleHistoryOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleHistoryOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAge = reader.uint64(); + break; + case 2: + message.includeRawHistory = reader.bool(); + break; + case 3: + message.includeMetadata = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleHistoryOptions { + const message = createBaseOracleHistoryOptions(); + message.maxAge = object.maxAge !== undefined && object.maxAge !== null ? BigInt(object.maxAge.toString()) : BigInt(0); + message.includeRawHistory = object.includeRawHistory ?? false; + message.includeMetadata = object.includeMetadata ?? false; + return message; + }, + fromAmino(object: OracleHistoryOptionsAmino): OracleHistoryOptions { + const message = createBaseOracleHistoryOptions(); + if (object.max_age !== undefined && object.max_age !== null) { + message.maxAge = BigInt(object.max_age); + } + if (object.include_raw_history !== undefined && object.include_raw_history !== null) { + message.includeRawHistory = object.include_raw_history; + } + if (object.include_metadata !== undefined && object.include_metadata !== null) { + message.includeMetadata = object.include_metadata; + } + return message; + }, + toAmino(message: OracleHistoryOptions): OracleHistoryOptionsAmino { + const obj: any = {}; + obj.max_age = message.maxAge !== BigInt(0) ? message.maxAge?.toString() : undefined; + obj.include_raw_history = message.includeRawHistory === false ? undefined : message.includeRawHistory; + obj.include_metadata = message.includeMetadata === false ? undefined : message.includeMetadata; + return obj; + }, + fromAminoMsg(object: OracleHistoryOptionsAminoMsg): OracleHistoryOptions { + return OracleHistoryOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OracleHistoryOptionsProtoMsg): OracleHistoryOptions { + return OracleHistoryOptions.decode(message.value); + }, + toProto(message: OracleHistoryOptions): Uint8Array { + return OracleHistoryOptions.encode(message).finish(); + }, + toProtoMsg(message: OracleHistoryOptions): OracleHistoryOptionsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions", + value: OracleHistoryOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleHistoryOptions.typeUrl, OracleHistoryOptions); +function createBaseQueryOracleVolatilityRequest(): QueryOracleVolatilityRequest { + return { + baseInfo: undefined, + quoteInfo: undefined, + oracleHistoryOptions: undefined + }; +} +export const QueryOracleVolatilityRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest", + is(o: any): o is QueryOracleVolatilityRequest { + return o && o.$typeUrl === QueryOracleVolatilityRequest.typeUrl; + }, + isAmino(o: any): o is QueryOracleVolatilityRequestAmino { + return o && o.$typeUrl === QueryOracleVolatilityRequest.typeUrl; + }, + encode(message: QueryOracleVolatilityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseInfo !== undefined) { + OracleInfo.encode(message.baseInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.quoteInfo !== undefined) { + OracleInfo.encode(message.quoteInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.oracleHistoryOptions !== undefined) { + OracleHistoryOptions.encode(message.oracleHistoryOptions, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleVolatilityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleVolatilityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseInfo = OracleInfo.decode(reader, reader.uint32()); + break; + case 2: + message.quoteInfo = OracleInfo.decode(reader, reader.uint32()); + break; + case 3: + message.oracleHistoryOptions = OracleHistoryOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleVolatilityRequest { + const message = createBaseQueryOracleVolatilityRequest(); + message.baseInfo = object.baseInfo !== undefined && object.baseInfo !== null ? OracleInfo.fromPartial(object.baseInfo) : undefined; + message.quoteInfo = object.quoteInfo !== undefined && object.quoteInfo !== null ? OracleInfo.fromPartial(object.quoteInfo) : undefined; + message.oracleHistoryOptions = object.oracleHistoryOptions !== undefined && object.oracleHistoryOptions !== null ? OracleHistoryOptions.fromPartial(object.oracleHistoryOptions) : undefined; + return message; + }, + fromAmino(object: QueryOracleVolatilityRequestAmino): QueryOracleVolatilityRequest { + const message = createBaseQueryOracleVolatilityRequest(); + if (object.base_info !== undefined && object.base_info !== null) { + message.baseInfo = OracleInfo.fromAmino(object.base_info); + } + if (object.quote_info !== undefined && object.quote_info !== null) { + message.quoteInfo = OracleInfo.fromAmino(object.quote_info); + } + if (object.oracle_history_options !== undefined && object.oracle_history_options !== null) { + message.oracleHistoryOptions = OracleHistoryOptions.fromAmino(object.oracle_history_options); + } + return message; + }, + toAmino(message: QueryOracleVolatilityRequest): QueryOracleVolatilityRequestAmino { + const obj: any = {}; + obj.base_info = message.baseInfo ? OracleInfo.toAmino(message.baseInfo) : undefined; + obj.quote_info = message.quoteInfo ? OracleInfo.toAmino(message.quoteInfo) : undefined; + obj.oracle_history_options = message.oracleHistoryOptions ? OracleHistoryOptions.toAmino(message.oracleHistoryOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOracleVolatilityRequestAminoMsg): QueryOracleVolatilityRequest { + return QueryOracleVolatilityRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleVolatilityRequestProtoMsg): QueryOracleVolatilityRequest { + return QueryOracleVolatilityRequest.decode(message.value); + }, + toProto(message: QueryOracleVolatilityRequest): Uint8Array { + return QueryOracleVolatilityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleVolatilityRequest): QueryOracleVolatilityRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest", + value: QueryOracleVolatilityRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleVolatilityRequest.typeUrl, QueryOracleVolatilityRequest); +function createBaseQueryOracleVolatilityResponse(): QueryOracleVolatilityResponse { + return { + volatility: "", + historyMetadata: undefined, + rawHistory: [] + }; +} +export const QueryOracleVolatilityResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse", + is(o: any): o is QueryOracleVolatilityResponse { + return o && (o.$typeUrl === QueryOracleVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.rawHistory) && (!o.rawHistory.length || PriceRecord.is(o.rawHistory[0]))); + }, + isAmino(o: any): o is QueryOracleVolatilityResponseAmino { + return o && (o.$typeUrl === QueryOracleVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.raw_history) && (!o.raw_history.length || PriceRecord.isAmino(o.raw_history[0]))); + }, + encode(message: QueryOracleVolatilityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volatility !== "") { + writer.uint32(10).string(message.volatility); + } + if (message.historyMetadata !== undefined) { + MetadataStatistics.encode(message.historyMetadata, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.rawHistory) { + PriceRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleVolatilityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleVolatilityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volatility = reader.string(); + break; + case 2: + message.historyMetadata = MetadataStatistics.decode(reader, reader.uint32()); + break; + case 3: + message.rawHistory.push(PriceRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleVolatilityResponse { + const message = createBaseQueryOracleVolatilityResponse(); + message.volatility = object.volatility ?? ""; + message.historyMetadata = object.historyMetadata !== undefined && object.historyMetadata !== null ? MetadataStatistics.fromPartial(object.historyMetadata) : undefined; + message.rawHistory = object.rawHistory?.map(e => PriceRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleVolatilityResponseAmino): QueryOracleVolatilityResponse { + const message = createBaseQueryOracleVolatilityResponse(); + if (object.volatility !== undefined && object.volatility !== null) { + message.volatility = object.volatility; + } + if (object.history_metadata !== undefined && object.history_metadata !== null) { + message.historyMetadata = MetadataStatistics.fromAmino(object.history_metadata); + } + message.rawHistory = object.raw_history?.map(e => PriceRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleVolatilityResponse): QueryOracleVolatilityResponseAmino { + const obj: any = {}; + obj.volatility = message.volatility === "" ? undefined : message.volatility; + obj.history_metadata = message.historyMetadata ? MetadataStatistics.toAmino(message.historyMetadata) : undefined; + if (message.rawHistory) { + obj.raw_history = message.rawHistory.map(e => e ? PriceRecord.toAmino(e) : undefined); + } else { + obj.raw_history = message.rawHistory; + } + return obj; + }, + fromAminoMsg(object: QueryOracleVolatilityResponseAminoMsg): QueryOracleVolatilityResponse { + return QueryOracleVolatilityResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleVolatilityResponseProtoMsg): QueryOracleVolatilityResponse { + return QueryOracleVolatilityResponse.decode(message.value); + }, + toProto(message: QueryOracleVolatilityResponse): Uint8Array { + return QueryOracleVolatilityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleVolatilityResponse): QueryOracleVolatilityResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse", + value: QueryOracleVolatilityResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleVolatilityResponse.typeUrl, QueryOracleVolatilityResponse); +function createBaseQueryOracleProvidersInfoRequest(): QueryOracleProvidersInfoRequest { + return {}; +} +export const QueryOracleProvidersInfoRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest", + is(o: any): o is QueryOracleProvidersInfoRequest { + return o && o.$typeUrl === QueryOracleProvidersInfoRequest.typeUrl; + }, + isAmino(o: any): o is QueryOracleProvidersInfoRequestAmino { + return o && o.$typeUrl === QueryOracleProvidersInfoRequest.typeUrl; + }, + encode(_: QueryOracleProvidersInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProvidersInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProvidersInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOracleProvidersInfoRequest { + const message = createBaseQueryOracleProvidersInfoRequest(); + return message; + }, + fromAmino(_: QueryOracleProvidersInfoRequestAmino): QueryOracleProvidersInfoRequest { + const message = createBaseQueryOracleProvidersInfoRequest(); + return message; + }, + toAmino(_: QueryOracleProvidersInfoRequest): QueryOracleProvidersInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOracleProvidersInfoRequestAminoMsg): QueryOracleProvidersInfoRequest { + return QueryOracleProvidersInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProvidersInfoRequestProtoMsg): QueryOracleProvidersInfoRequest { + return QueryOracleProvidersInfoRequest.decode(message.value); + }, + toProto(message: QueryOracleProvidersInfoRequest): Uint8Array { + return QueryOracleProvidersInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProvidersInfoRequest): QueryOracleProvidersInfoRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest", + value: QueryOracleProvidersInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProvidersInfoRequest.typeUrl, QueryOracleProvidersInfoRequest); +function createBaseQueryOracleProvidersInfoResponse(): QueryOracleProvidersInfoResponse { + return { + providers: [] + }; +} +export const QueryOracleProvidersInfoResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse", + is(o: any): o is QueryOracleProvidersInfoResponse { + return o && (o.$typeUrl === QueryOracleProvidersInfoResponse.typeUrl || Array.isArray(o.providers) && (!o.providers.length || ProviderInfo.is(o.providers[0]))); + }, + isAmino(o: any): o is QueryOracleProvidersInfoResponseAmino { + return o && (o.$typeUrl === QueryOracleProvidersInfoResponse.typeUrl || Array.isArray(o.providers) && (!o.providers.length || ProviderInfo.isAmino(o.providers[0]))); + }, + encode(message: QueryOracleProvidersInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.providers) { + ProviderInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProvidersInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProvidersInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providers.push(ProviderInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProvidersInfoResponse { + const message = createBaseQueryOracleProvidersInfoResponse(); + message.providers = object.providers?.map(e => ProviderInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleProvidersInfoResponseAmino): QueryOracleProvidersInfoResponse { + const message = createBaseQueryOracleProvidersInfoResponse(); + message.providers = object.providers?.map(e => ProviderInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleProvidersInfoResponse): QueryOracleProvidersInfoResponseAmino { + const obj: any = {}; + if (message.providers) { + obj.providers = message.providers.map(e => e ? ProviderInfo.toAmino(e) : undefined); + } else { + obj.providers = message.providers; + } + return obj; + }, + fromAminoMsg(object: QueryOracleProvidersInfoResponseAminoMsg): QueryOracleProvidersInfoResponse { + return QueryOracleProvidersInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProvidersInfoResponseProtoMsg): QueryOracleProvidersInfoResponse { + return QueryOracleProvidersInfoResponse.decode(message.value); + }, + toProto(message: QueryOracleProvidersInfoResponse): Uint8Array { + return QueryOracleProvidersInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProvidersInfoResponse): QueryOracleProvidersInfoResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse", + value: QueryOracleProvidersInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProvidersInfoResponse.typeUrl, QueryOracleProvidersInfoResponse); +function createBaseQueryOracleProviderPricesRequest(): QueryOracleProviderPricesRequest { + return { + provider: "" + }; +} +export const QueryOracleProviderPricesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest", + is(o: any): o is QueryOracleProviderPricesRequest { + return o && (o.$typeUrl === QueryOracleProviderPricesRequest.typeUrl || typeof o.provider === "string"); + }, + isAmino(o: any): o is QueryOracleProviderPricesRequestAmino { + return o && (o.$typeUrl === QueryOracleProviderPricesRequest.typeUrl || typeof o.provider === "string"); + }, + encode(message: QueryOracleProviderPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProviderPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProviderPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProviderPricesRequest { + const message = createBaseQueryOracleProviderPricesRequest(); + message.provider = object.provider ?? ""; + return message; + }, + fromAmino(object: QueryOracleProviderPricesRequestAmino): QueryOracleProviderPricesRequest { + const message = createBaseQueryOracleProviderPricesRequest(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + return message; + }, + toAmino(message: QueryOracleProviderPricesRequest): QueryOracleProviderPricesRequestAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + return obj; + }, + fromAminoMsg(object: QueryOracleProviderPricesRequestAminoMsg): QueryOracleProviderPricesRequest { + return QueryOracleProviderPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProviderPricesRequestProtoMsg): QueryOracleProviderPricesRequest { + return QueryOracleProviderPricesRequest.decode(message.value); + }, + toProto(message: QueryOracleProviderPricesRequest): Uint8Array { + return QueryOracleProviderPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProviderPricesRequest): QueryOracleProviderPricesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest", + value: QueryOracleProviderPricesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProviderPricesRequest.typeUrl, QueryOracleProviderPricesRequest); +function createBaseQueryOracleProviderPricesResponse(): QueryOracleProviderPricesResponse { + return { + providerState: [] + }; +} +export const QueryOracleProviderPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse", + is(o: any): o is QueryOracleProviderPricesResponse { + return o && (o.$typeUrl === QueryOracleProviderPricesResponse.typeUrl || Array.isArray(o.providerState) && (!o.providerState.length || ProviderState.is(o.providerState[0]))); + }, + isAmino(o: any): o is QueryOracleProviderPricesResponseAmino { + return o && (o.$typeUrl === QueryOracleProviderPricesResponse.typeUrl || Array.isArray(o.providerState) && (!o.providerState.length || ProviderState.isAmino(o.providerState[0]))); + }, + encode(message: QueryOracleProviderPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.providerState) { + ProviderState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProviderPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProviderPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providerState.push(ProviderState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProviderPricesResponse { + const message = createBaseQueryOracleProviderPricesResponse(); + message.providerState = object.providerState?.map(e => ProviderState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleProviderPricesResponseAmino): QueryOracleProviderPricesResponse { + const message = createBaseQueryOracleProviderPricesResponse(); + message.providerState = object.providerState?.map(e => ProviderState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleProviderPricesResponse): QueryOracleProviderPricesResponseAmino { + const obj: any = {}; + if (message.providerState) { + obj.providerState = message.providerState.map(e => e ? ProviderState.toAmino(e) : undefined); + } else { + obj.providerState = message.providerState; + } + return obj; + }, + fromAminoMsg(object: QueryOracleProviderPricesResponseAminoMsg): QueryOracleProviderPricesResponse { + return QueryOracleProviderPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProviderPricesResponseProtoMsg): QueryOracleProviderPricesResponse { + return QueryOracleProviderPricesResponse.decode(message.value); + }, + toProto(message: QueryOracleProviderPricesResponse): Uint8Array { + return QueryOracleProviderPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProviderPricesResponse): QueryOracleProviderPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse", + value: QueryOracleProviderPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProviderPricesResponse.typeUrl, QueryOracleProviderPricesResponse); +function createBaseScalingOptions(): ScalingOptions { + return { + baseDecimals: 0, + quoteDecimals: 0 + }; +} +export const ScalingOptions = { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions", + is(o: any): o is ScalingOptions { + return o && (o.$typeUrl === ScalingOptions.typeUrl || typeof o.baseDecimals === "number" && typeof o.quoteDecimals === "number"); + }, + isAmino(o: any): o is ScalingOptionsAmino { + return o && (o.$typeUrl === ScalingOptions.typeUrl || typeof o.base_decimals === "number" && typeof o.quote_decimals === "number"); + }, + encode(message: ScalingOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseDecimals !== 0) { + writer.uint32(8).uint32(message.baseDecimals); + } + if (message.quoteDecimals !== 0) { + writer.uint32(16).uint32(message.quoteDecimals); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalingOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalingOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDecimals = reader.uint32(); + break; + case 2: + message.quoteDecimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ScalingOptions { + const message = createBaseScalingOptions(); + message.baseDecimals = object.baseDecimals ?? 0; + message.quoteDecimals = object.quoteDecimals ?? 0; + return message; + }, + fromAmino(object: ScalingOptionsAmino): ScalingOptions { + const message = createBaseScalingOptions(); + if (object.base_decimals !== undefined && object.base_decimals !== null) { + message.baseDecimals = object.base_decimals; + } + if (object.quote_decimals !== undefined && object.quote_decimals !== null) { + message.quoteDecimals = object.quote_decimals; + } + return message; + }, + toAmino(message: ScalingOptions): ScalingOptionsAmino { + const obj: any = {}; + obj.base_decimals = message.baseDecimals === 0 ? undefined : message.baseDecimals; + obj.quote_decimals = message.quoteDecimals === 0 ? undefined : message.quoteDecimals; + return obj; + }, + fromAminoMsg(object: ScalingOptionsAminoMsg): ScalingOptions { + return ScalingOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ScalingOptionsProtoMsg): ScalingOptions { + return ScalingOptions.decode(message.value); + }, + toProto(message: ScalingOptions): Uint8Array { + return ScalingOptions.encode(message).finish(); + }, + toProtoMsg(message: ScalingOptions): ScalingOptionsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions", + value: ScalingOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ScalingOptions.typeUrl, ScalingOptions); +function createBaseQueryOraclePriceRequest(): QueryOraclePriceRequest { + return { + oracleType: 0, + base: "", + quote: "", + scalingOptions: undefined + }; +} +export const QueryOraclePriceRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest", + is(o: any): o is QueryOraclePriceRequest { + return o && (o.$typeUrl === QueryOraclePriceRequest.typeUrl || isSet(o.oracleType) && typeof o.base === "string" && typeof o.quote === "string"); + }, + isAmino(o: any): o is QueryOraclePriceRequestAmino { + return o && (o.$typeUrl === QueryOraclePriceRequest.typeUrl || isSet(o.oracle_type) && typeof o.base === "string" && typeof o.quote === "string"); + }, + encode(message: QueryOraclePriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracleType !== 0) { + writer.uint32(8).int32(message.oracleType); + } + if (message.base !== "") { + writer.uint32(18).string(message.base); + } + if (message.quote !== "") { + writer.uint32(26).string(message.quote); + } + if (message.scalingOptions !== undefined) { + ScalingOptions.encode(message.scalingOptions, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOraclePriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOraclePriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracleType = (reader.int32() as any); + break; + case 2: + message.base = reader.string(); + break; + case 3: + message.quote = reader.string(); + break; + case 4: + message.scalingOptions = ScalingOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOraclePriceRequest { + const message = createBaseQueryOraclePriceRequest(); + message.oracleType = object.oracleType ?? 0; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.scalingOptions = object.scalingOptions !== undefined && object.scalingOptions !== null ? ScalingOptions.fromPartial(object.scalingOptions) : undefined; + return message; + }, + fromAmino(object: QueryOraclePriceRequestAmino): QueryOraclePriceRequest { + const message = createBaseQueryOraclePriceRequest(); + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.scaling_options !== undefined && object.scaling_options !== null) { + message.scalingOptions = ScalingOptions.fromAmino(object.scaling_options); + } + return message; + }, + toAmino(message: QueryOraclePriceRequest): QueryOraclePriceRequestAmino { + const obj: any = {}; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.scaling_options = message.scalingOptions ? ScalingOptions.toAmino(message.scalingOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOraclePriceRequestAminoMsg): QueryOraclePriceRequest { + return QueryOraclePriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOraclePriceRequestProtoMsg): QueryOraclePriceRequest { + return QueryOraclePriceRequest.decode(message.value); + }, + toProto(message: QueryOraclePriceRequest): Uint8Array { + return QueryOraclePriceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOraclePriceRequest): QueryOraclePriceRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest", + value: QueryOraclePriceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOraclePriceRequest.typeUrl, QueryOraclePriceRequest); +function createBasePricePairState(): PricePairState { + return { + pairPrice: "", + basePrice: "", + quotePrice: "", + baseCumulativePrice: "", + quoteCumulativePrice: "", + baseTimestamp: BigInt(0), + quoteTimestamp: BigInt(0) + }; +} +export const PricePairState = { + typeUrl: "/injective.oracle.v1beta1.PricePairState", + is(o: any): o is PricePairState { + return o && (o.$typeUrl === PricePairState.typeUrl || typeof o.pairPrice === "string" && typeof o.basePrice === "string" && typeof o.quotePrice === "string" && typeof o.baseCumulativePrice === "string" && typeof o.quoteCumulativePrice === "string" && typeof o.baseTimestamp === "bigint" && typeof o.quoteTimestamp === "bigint"); + }, + isAmino(o: any): o is PricePairStateAmino { + return o && (o.$typeUrl === PricePairState.typeUrl || typeof o.pair_price === "string" && typeof o.base_price === "string" && typeof o.quote_price === "string" && typeof o.base_cumulative_price === "string" && typeof o.quote_cumulative_price === "string" && typeof o.base_timestamp === "bigint" && typeof o.quote_timestamp === "bigint"); + }, + encode(message: PricePairState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pairPrice !== "") { + writer.uint32(10).string(message.pairPrice); + } + if (message.basePrice !== "") { + writer.uint32(18).string(message.basePrice); + } + if (message.quotePrice !== "") { + writer.uint32(26).string(message.quotePrice); + } + if (message.baseCumulativePrice !== "") { + writer.uint32(34).string(message.baseCumulativePrice); + } + if (message.quoteCumulativePrice !== "") { + writer.uint32(42).string(message.quoteCumulativePrice); + } + if (message.baseTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.baseTimestamp); + } + if (message.quoteTimestamp !== BigInt(0)) { + writer.uint32(56).int64(message.quoteTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PricePairState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePricePairState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairPrice = reader.string(); + break; + case 2: + message.basePrice = reader.string(); + break; + case 3: + message.quotePrice = reader.string(); + break; + case 4: + message.baseCumulativePrice = reader.string(); + break; + case 5: + message.quoteCumulativePrice = reader.string(); + break; + case 6: + message.baseTimestamp = reader.int64(); + break; + case 7: + message.quoteTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PricePairState { + const message = createBasePricePairState(); + message.pairPrice = object.pairPrice ?? ""; + message.basePrice = object.basePrice ?? ""; + message.quotePrice = object.quotePrice ?? ""; + message.baseCumulativePrice = object.baseCumulativePrice ?? ""; + message.quoteCumulativePrice = object.quoteCumulativePrice ?? ""; + message.baseTimestamp = object.baseTimestamp !== undefined && object.baseTimestamp !== null ? BigInt(object.baseTimestamp.toString()) : BigInt(0); + message.quoteTimestamp = object.quoteTimestamp !== undefined && object.quoteTimestamp !== null ? BigInt(object.quoteTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PricePairStateAmino): PricePairState { + const message = createBasePricePairState(); + if (object.pair_price !== undefined && object.pair_price !== null) { + message.pairPrice = object.pair_price; + } + if (object.base_price !== undefined && object.base_price !== null) { + message.basePrice = object.base_price; + } + if (object.quote_price !== undefined && object.quote_price !== null) { + message.quotePrice = object.quote_price; + } + if (object.base_cumulative_price !== undefined && object.base_cumulative_price !== null) { + message.baseCumulativePrice = object.base_cumulative_price; + } + if (object.quote_cumulative_price !== undefined && object.quote_cumulative_price !== null) { + message.quoteCumulativePrice = object.quote_cumulative_price; + } + if (object.base_timestamp !== undefined && object.base_timestamp !== null) { + message.baseTimestamp = BigInt(object.base_timestamp); + } + if (object.quote_timestamp !== undefined && object.quote_timestamp !== null) { + message.quoteTimestamp = BigInt(object.quote_timestamp); + } + return message; + }, + toAmino(message: PricePairState): PricePairStateAmino { + const obj: any = {}; + obj.pair_price = message.pairPrice === "" ? undefined : message.pairPrice; + obj.base_price = message.basePrice === "" ? undefined : message.basePrice; + obj.quote_price = message.quotePrice === "" ? undefined : message.quotePrice; + obj.base_cumulative_price = message.baseCumulativePrice === "" ? undefined : message.baseCumulativePrice; + obj.quote_cumulative_price = message.quoteCumulativePrice === "" ? undefined : message.quoteCumulativePrice; + obj.base_timestamp = message.baseTimestamp !== BigInt(0) ? message.baseTimestamp?.toString() : undefined; + obj.quote_timestamp = message.quoteTimestamp !== BigInt(0) ? message.quoteTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PricePairStateAminoMsg): PricePairState { + return PricePairState.fromAmino(object.value); + }, + fromProtoMsg(message: PricePairStateProtoMsg): PricePairState { + return PricePairState.decode(message.value); + }, + toProto(message: PricePairState): Uint8Array { + return PricePairState.encode(message).finish(); + }, + toProtoMsg(message: PricePairState): PricePairStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PricePairState", + value: PricePairState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PricePairState.typeUrl, PricePairState); +function createBaseQueryOraclePriceResponse(): QueryOraclePriceResponse { + return { + pricePairState: undefined + }; +} +export const QueryOraclePriceResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse", + is(o: any): o is QueryOraclePriceResponse { + return o && o.$typeUrl === QueryOraclePriceResponse.typeUrl; + }, + isAmino(o: any): o is QueryOraclePriceResponseAmino { + return o && o.$typeUrl === QueryOraclePriceResponse.typeUrl; + }, + encode(message: QueryOraclePriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pricePairState !== undefined) { + PricePairState.encode(message.pricePairState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOraclePriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOraclePriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pricePairState = PricePairState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOraclePriceResponse { + const message = createBaseQueryOraclePriceResponse(); + message.pricePairState = object.pricePairState !== undefined && object.pricePairState !== null ? PricePairState.fromPartial(object.pricePairState) : undefined; + return message; + }, + fromAmino(object: QueryOraclePriceResponseAmino): QueryOraclePriceResponse { + const message = createBaseQueryOraclePriceResponse(); + if (object.price_pair_state !== undefined && object.price_pair_state !== null) { + message.pricePairState = PricePairState.fromAmino(object.price_pair_state); + } + return message; + }, + toAmino(message: QueryOraclePriceResponse): QueryOraclePriceResponseAmino { + const obj: any = {}; + obj.price_pair_state = message.pricePairState ? PricePairState.toAmino(message.pricePairState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOraclePriceResponseAminoMsg): QueryOraclePriceResponse { + return QueryOraclePriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOraclePriceResponseProtoMsg): QueryOraclePriceResponse { + return QueryOraclePriceResponse.decode(message.value); + }, + toProto(message: QueryOraclePriceResponse): Uint8Array { + return QueryOraclePriceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOraclePriceResponse): QueryOraclePriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse", + value: QueryOraclePriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOraclePriceResponse.typeUrl, QueryOraclePriceResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/oracle/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..b832c86a --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/tx.rpc.func.ts @@ -0,0 +1,76 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; +export const createRelayProviderPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayProviderPrices.typeUrl, + encoders: toEncoders(MsgRelayProviderPrices), + converters: toConverters(MsgRelayProviderPrices) +}); +export const useRelayProviderPrices = buildUseMutation({ + builderMutationFn: createRelayProviderPrices +}); +export const createRelayPriceFeedPrice = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPriceFeedPrice.typeUrl, + encoders: toEncoders(MsgRelayPriceFeedPrice), + converters: toConverters(MsgRelayPriceFeedPrice) +}); +export const useRelayPriceFeedPrice = buildUseMutation({ + builderMutationFn: createRelayPriceFeedPrice +}); +export const createRelayBandRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayBandRates.typeUrl, + encoders: toEncoders(MsgRelayBandRates), + converters: toConverters(MsgRelayBandRates) +}); +export const useRelayBandRates = buildUseMutation({ + builderMutationFn: createRelayBandRates +}); +export const createRequestBandIBCRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBandIBCRates.typeUrl, + encoders: toEncoders(MsgRequestBandIBCRates), + converters: toConverters(MsgRequestBandIBCRates) +}); +export const useRequestBandIBCRates = buildUseMutation({ + builderMutationFn: createRequestBandIBCRates +}); +export const createRelayCoinbaseMessages = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayCoinbaseMessages.typeUrl, + encoders: toEncoders(MsgRelayCoinbaseMessages), + converters: toConverters(MsgRelayCoinbaseMessages) +}); +export const useRelayCoinbaseMessages = buildUseMutation({ + builderMutationFn: createRelayCoinbaseMessages +}); +export const createRelayStorkMessage = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayStorkPrices.typeUrl, + encoders: toEncoders(MsgRelayStorkPrices), + converters: toConverters(MsgRelayStorkPrices) +}); +export const useRelayStorkMessage = buildUseMutation({ + builderMutationFn: createRelayStorkMessage +}); +export const createRelayPythPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPythPrices.typeUrl, + encoders: toEncoders(MsgRelayPythPrices), + converters: toConverters(MsgRelayPythPrices) +}); +export const useRelayPythPrices = buildUseMutation({ + builderMutationFn: createRelayPythPrices +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/oracle/v1beta1/tx.ts b/libs/injective-query/src/injective/oracle/v1beta1/tx.ts new file mode 100644 index 00000000..d87e3df4 --- /dev/null +++ b/libs/injective-query/src/injective/oracle/v1beta1/tx.ts @@ -0,0 +1,1605 @@ +import { AssetPair, AssetPairAmino, PriceAttestation, PriceAttestationAmino, Params, ParamsAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgRelayProviderPrice defines a SDK message for setting a price through the + * provider oracle. + */ +export interface MsgRelayProviderPrices { + sender: string; + provider: string; + symbols: string[]; + prices: string[]; +} +export interface MsgRelayProviderPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices"; + value: Uint8Array; +} +/** + * MsgRelayProviderPrice defines a SDK message for setting a price through the + * provider oracle. + */ +export interface MsgRelayProviderPricesAmino { + sender: string; + provider: string; + symbols: string[]; + prices: string[]; +} +export interface MsgRelayProviderPricesAminoMsg { + type: "oracle/MsgRelayProviderPrices"; + value: MsgRelayProviderPricesAmino; +} +export interface MsgRelayProviderPricesResponse {} +export interface MsgRelayProviderPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse"; + value: Uint8Array; +} +export interface MsgRelayProviderPricesResponseAmino {} +export interface MsgRelayProviderPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse"; + value: MsgRelayProviderPricesResponseAmino; +} +/** + * MsgRelayPriceFeedPrice defines a SDK message for setting a price through the + * pricefeed oracle. + */ +export interface MsgRelayPriceFeedPrice { + sender: string; + base: string[]; + quote: string[]; + /** price defines the price of the oracle base and quote */ + price: string[]; +} +export interface MsgRelayPriceFeedPriceProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice"; + value: Uint8Array; +} +/** + * MsgRelayPriceFeedPrice defines a SDK message for setting a price through the + * pricefeed oracle. + */ +export interface MsgRelayPriceFeedPriceAmino { + sender: string; + base: string[]; + quote: string[]; + /** price defines the price of the oracle base and quote */ + price: string[]; +} +export interface MsgRelayPriceFeedPriceAminoMsg { + type: "oracle/MsgRelayPriceFeedPrice"; + value: MsgRelayPriceFeedPriceAmino; +} +export interface MsgRelayPriceFeedPriceResponse {} +export interface MsgRelayPriceFeedPriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse"; + value: Uint8Array; +} +export interface MsgRelayPriceFeedPriceResponseAmino {} +export interface MsgRelayPriceFeedPriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse"; + value: MsgRelayPriceFeedPriceResponseAmino; +} +export interface MsgRelayBandRates { + relayer: string; + symbols: string[]; + rates: bigint[]; + resolveTimes: bigint[]; + requestIDs: bigint[]; +} +export interface MsgRelayBandRatesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates"; + value: Uint8Array; +} +export interface MsgRelayBandRatesAmino { + relayer: string; + symbols: string[]; + rates: string[]; + resolve_times: string[]; + requestIDs: string[]; +} +export interface MsgRelayBandRatesAminoMsg { + type: "oracle/MsgRelayBandRates"; + value: MsgRelayBandRatesAmino; +} +export interface MsgRelayBandRatesResponse {} +export interface MsgRelayBandRatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse"; + value: Uint8Array; +} +export interface MsgRelayBandRatesResponseAmino {} +export interface MsgRelayBandRatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse"; + value: MsgRelayBandRatesResponseAmino; +} +/** + * MsgRelayCoinbaseMessages defines a SDK message for relaying price messages + * from Coinbase API. + */ +export interface MsgRelayCoinbaseMessages { + sender: string; + messages: Uint8Array[]; + signatures: Uint8Array[]; +} +export interface MsgRelayCoinbaseMessagesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages"; + value: Uint8Array; +} +/** + * MsgRelayCoinbaseMessages defines a SDK message for relaying price messages + * from Coinbase API. + */ +export interface MsgRelayCoinbaseMessagesAmino { + sender: string; + messages: string[]; + signatures: string[]; +} +export interface MsgRelayCoinbaseMessagesAminoMsg { + type: "oracle/MsgRelayCoinbaseMessages"; + value: MsgRelayCoinbaseMessagesAmino; +} +export interface MsgRelayCoinbaseMessagesResponse {} +export interface MsgRelayCoinbaseMessagesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse"; + value: Uint8Array; +} +export interface MsgRelayCoinbaseMessagesResponseAmino {} +export interface MsgRelayCoinbaseMessagesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse"; + value: MsgRelayCoinbaseMessagesResponseAmino; +} +/** + * MsgRelayStorkPrices defines a SDK message for relaying price message + * from Stork API. + */ +export interface MsgRelayStorkPrices { + sender: string; + assetPairs: AssetPair[]; +} +export interface MsgRelayStorkPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices"; + value: Uint8Array; +} +/** + * MsgRelayStorkPrices defines a SDK message for relaying price message + * from Stork API. + */ +export interface MsgRelayStorkPricesAmino { + sender: string; + asset_pairs: AssetPairAmino[]; +} +export interface MsgRelayStorkPricesAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayStorkPrices"; + value: MsgRelayStorkPricesAmino; +} +export interface MsgRelayStorkPricesResponse {} +export interface MsgRelayStorkPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse"; + value: Uint8Array; +} +export interface MsgRelayStorkPricesResponseAmino {} +export interface MsgRelayStorkPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse"; + value: MsgRelayStorkPricesResponseAmino; +} +/** + * MsgRequestBandIBCRates defines a SDK message for requesting data from + * BandChain using IBC. + */ +export interface MsgRequestBandIBCRates { + sender: string; + requestId: bigint; +} +export interface MsgRequestBandIBCRatesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates"; + value: Uint8Array; +} +/** + * MsgRequestBandIBCRates defines a SDK message for requesting data from + * BandChain using IBC. + */ +export interface MsgRequestBandIBCRatesAmino { + sender: string; + request_id: string; +} +export interface MsgRequestBandIBCRatesAminoMsg { + type: "oracle/MsgRequestBandIBCRates"; + value: MsgRequestBandIBCRatesAmino; +} +/** MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. */ +export interface MsgRequestBandIBCRatesResponse {} +export interface MsgRequestBandIBCRatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse"; + value: Uint8Array; +} +/** MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. */ +export interface MsgRequestBandIBCRatesResponseAmino {} +export interface MsgRequestBandIBCRatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse"; + value: MsgRequestBandIBCRatesResponseAmino; +} +/** MsgRelayPythPrices defines a SDK message for updating Pyth prices */ +export interface MsgRelayPythPrices { + sender: string; + priceAttestations: PriceAttestation[]; +} +export interface MsgRelayPythPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices"; + value: Uint8Array; +} +/** MsgRelayPythPrices defines a SDK message for updating Pyth prices */ +export interface MsgRelayPythPricesAmino { + sender: string; + price_attestations: PriceAttestationAmino[]; +} +export interface MsgRelayPythPricesAminoMsg { + type: "oracle/MsgRelayPythPrices"; + value: MsgRelayPythPricesAmino; +} +/** MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. */ +export interface MsgRelayPythPricesResponse {} +export interface MsgRelayPythPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse"; + value: Uint8Array; +} +/** MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. */ +export interface MsgRelayPythPricesResponseAmino {} +export interface MsgRelayPythPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse"; + value: MsgRelayPythPricesResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the oracle parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the oracle parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "oracle/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgRelayProviderPrices(): MsgRelayProviderPrices { + return { + sender: "", + provider: "", + symbols: [], + prices: [] + }; +} +export const MsgRelayProviderPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices", + aminoType: "oracle/MsgRelayProviderPrices", + is(o: any): o is MsgRelayProviderPrices { + return o && (o.$typeUrl === MsgRelayProviderPrices.typeUrl || typeof o.sender === "string" && typeof o.provider === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string")); + }, + isAmino(o: any): o is MsgRelayProviderPricesAmino { + return o && (o.$typeUrl === MsgRelayProviderPrices.typeUrl || typeof o.sender === "string" && typeof o.provider === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string")); + }, + encode(message: MsgRelayProviderPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.provider !== "") { + writer.uint32(18).string(message.provider); + } + for (const v of message.symbols) { + writer.uint32(26).string(v!); + } + for (const v of message.prices) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayProviderPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayProviderPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.provider = reader.string(); + break; + case 3: + message.symbols.push(reader.string()); + break; + case 4: + message.prices.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayProviderPrices { + const message = createBaseMsgRelayProviderPrices(); + message.sender = object.sender ?? ""; + message.provider = object.provider ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayProviderPricesAmino): MsgRelayProviderPrices { + const message = createBaseMsgRelayProviderPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRelayProviderPrices): MsgRelayProviderPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.prices) { + obj.prices = message.prices.map(e => e); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: MsgRelayProviderPricesAminoMsg): MsgRelayProviderPrices { + return MsgRelayProviderPrices.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayProviderPrices): MsgRelayProviderPricesAminoMsg { + return { + type: "oracle/MsgRelayProviderPrices", + value: MsgRelayProviderPrices.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayProviderPricesProtoMsg): MsgRelayProviderPrices { + return MsgRelayProviderPrices.decode(message.value); + }, + toProto(message: MsgRelayProviderPrices): Uint8Array { + return MsgRelayProviderPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayProviderPrices): MsgRelayProviderPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices", + value: MsgRelayProviderPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayProviderPrices.typeUrl, MsgRelayProviderPrices); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayProviderPrices.aminoType, MsgRelayProviderPrices.typeUrl); +function createBaseMsgRelayProviderPricesResponse(): MsgRelayProviderPricesResponse { + return {}; +} +export const MsgRelayProviderPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse", + is(o: any): o is MsgRelayProviderPricesResponse { + return o && o.$typeUrl === MsgRelayProviderPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayProviderPricesResponseAmino { + return o && o.$typeUrl === MsgRelayProviderPricesResponse.typeUrl; + }, + encode(_: MsgRelayProviderPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayProviderPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayProviderPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayProviderPricesResponse { + const message = createBaseMsgRelayProviderPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayProviderPricesResponseAmino): MsgRelayProviderPricesResponse { + const message = createBaseMsgRelayProviderPricesResponse(); + return message; + }, + toAmino(_: MsgRelayProviderPricesResponse): MsgRelayProviderPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayProviderPricesResponseAminoMsg): MsgRelayProviderPricesResponse { + return MsgRelayProviderPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayProviderPricesResponseProtoMsg): MsgRelayProviderPricesResponse { + return MsgRelayProviderPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayProviderPricesResponse): Uint8Array { + return MsgRelayProviderPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayProviderPricesResponse): MsgRelayProviderPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse", + value: MsgRelayProviderPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayProviderPricesResponse.typeUrl, MsgRelayProviderPricesResponse); +function createBaseMsgRelayPriceFeedPrice(): MsgRelayPriceFeedPrice { + return { + sender: "", + base: [], + quote: [], + price: [] + }; +} +export const MsgRelayPriceFeedPrice = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice", + aminoType: "oracle/MsgRelayPriceFeedPrice", + is(o: any): o is MsgRelayPriceFeedPrice { + return o && (o.$typeUrl === MsgRelayPriceFeedPrice.typeUrl || typeof o.sender === "string" && Array.isArray(o.base) && (!o.base.length || typeof o.base[0] === "string") && Array.isArray(o.quote) && (!o.quote.length || typeof o.quote[0] === "string") && Array.isArray(o.price) && (!o.price.length || typeof o.price[0] === "string")); + }, + isAmino(o: any): o is MsgRelayPriceFeedPriceAmino { + return o && (o.$typeUrl === MsgRelayPriceFeedPrice.typeUrl || typeof o.sender === "string" && Array.isArray(o.base) && (!o.base.length || typeof o.base[0] === "string") && Array.isArray(o.quote) && (!o.quote.length || typeof o.quote[0] === "string") && Array.isArray(o.price) && (!o.price.length || typeof o.price[0] === "string")); + }, + encode(message: MsgRelayPriceFeedPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.base) { + writer.uint32(18).string(v!); + } + for (const v of message.quote) { + writer.uint32(26).string(v!); + } + for (const v of message.price) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPriceFeedPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPriceFeedPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.base.push(reader.string()); + break; + case 3: + message.quote.push(reader.string()); + break; + case 4: + message.price.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayPriceFeedPrice { + const message = createBaseMsgRelayPriceFeedPrice(); + message.sender = object.sender ?? ""; + message.base = object.base?.map(e => e) || []; + message.quote = object.quote?.map(e => e) || []; + message.price = object.price?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayPriceFeedPriceAmino): MsgRelayPriceFeedPrice { + const message = createBaseMsgRelayPriceFeedPrice(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.base = object.base?.map(e => e) || []; + message.quote = object.quote?.map(e => e) || []; + message.price = object.price?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.base) { + obj.base = message.base.map(e => e); + } else { + obj.base = message.base; + } + if (message.quote) { + obj.quote = message.quote.map(e => e); + } else { + obj.quote = message.quote; + } + if (message.price) { + obj.price = message.price.map(e => e); + } else { + obj.price = message.price; + } + return obj; + }, + fromAminoMsg(object: MsgRelayPriceFeedPriceAminoMsg): MsgRelayPriceFeedPrice { + return MsgRelayPriceFeedPrice.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceAminoMsg { + return { + type: "oracle/MsgRelayPriceFeedPrice", + value: MsgRelayPriceFeedPrice.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayPriceFeedPriceProtoMsg): MsgRelayPriceFeedPrice { + return MsgRelayPriceFeedPrice.decode(message.value); + }, + toProto(message: MsgRelayPriceFeedPrice): Uint8Array { + return MsgRelayPriceFeedPrice.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice", + value: MsgRelayPriceFeedPrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPriceFeedPrice.typeUrl, MsgRelayPriceFeedPrice); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayPriceFeedPrice.aminoType, MsgRelayPriceFeedPrice.typeUrl); +function createBaseMsgRelayPriceFeedPriceResponse(): MsgRelayPriceFeedPriceResponse { + return {}; +} +export const MsgRelayPriceFeedPriceResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse", + is(o: any): o is MsgRelayPriceFeedPriceResponse { + return o && o.$typeUrl === MsgRelayPriceFeedPriceResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayPriceFeedPriceResponseAmino { + return o && o.$typeUrl === MsgRelayPriceFeedPriceResponse.typeUrl; + }, + encode(_: MsgRelayPriceFeedPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPriceFeedPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPriceFeedPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayPriceFeedPriceResponse { + const message = createBaseMsgRelayPriceFeedPriceResponse(); + return message; + }, + fromAmino(_: MsgRelayPriceFeedPriceResponseAmino): MsgRelayPriceFeedPriceResponse { + const message = createBaseMsgRelayPriceFeedPriceResponse(); + return message; + }, + toAmino(_: MsgRelayPriceFeedPriceResponse): MsgRelayPriceFeedPriceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayPriceFeedPriceResponseAminoMsg): MsgRelayPriceFeedPriceResponse { + return MsgRelayPriceFeedPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayPriceFeedPriceResponseProtoMsg): MsgRelayPriceFeedPriceResponse { + return MsgRelayPriceFeedPriceResponse.decode(message.value); + }, + toProto(message: MsgRelayPriceFeedPriceResponse): Uint8Array { + return MsgRelayPriceFeedPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPriceFeedPriceResponse): MsgRelayPriceFeedPriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse", + value: MsgRelayPriceFeedPriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPriceFeedPriceResponse.typeUrl, MsgRelayPriceFeedPriceResponse); +function createBaseMsgRelayBandRates(): MsgRelayBandRates { + return { + relayer: "", + symbols: [], + rates: [], + resolveTimes: [], + requestIDs: [] + }; +} +export const MsgRelayBandRates = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates", + aminoType: "oracle/MsgRelayBandRates", + is(o: any): o is MsgRelayBandRates { + return o && (o.$typeUrl === MsgRelayBandRates.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.rates) && (!o.rates.length || typeof o.rates[0] === "bigint") && Array.isArray(o.resolveTimes) && (!o.resolveTimes.length || typeof o.resolveTimes[0] === "bigint") && Array.isArray(o.requestIDs) && (!o.requestIDs.length || typeof o.requestIDs[0] === "bigint")); + }, + isAmino(o: any): o is MsgRelayBandRatesAmino { + return o && (o.$typeUrl === MsgRelayBandRates.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.rates) && (!o.rates.length || typeof o.rates[0] === "bigint") && Array.isArray(o.resolve_times) && (!o.resolve_times.length || typeof o.resolve_times[0] === "bigint") && Array.isArray(o.requestIDs) && (!o.requestIDs.length || typeof o.requestIDs[0] === "bigint")); + }, + encode(message: MsgRelayBandRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + for (const v of message.symbols) { + writer.uint32(18).string(v!); + } + writer.uint32(26).fork(); + for (const v of message.rates) { + writer.uint64(v); + } + writer.ldelim(); + writer.uint32(34).fork(); + for (const v of message.resolveTimes) { + writer.uint64(v); + } + writer.ldelim(); + writer.uint32(42).fork(); + for (const v of message.requestIDs) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayBandRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayBandRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbols.push(reader.string()); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.rates.push(reader.uint64()); + } + } else { + message.rates.push(reader.uint64()); + } + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.resolveTimes.push(reader.uint64()); + } + } else { + message.resolveTimes.push(reader.uint64()); + } + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.requestIDs.push(reader.uint64()); + } + } else { + message.requestIDs.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayBandRates { + const message = createBaseMsgRelayBandRates(); + message.relayer = object.relayer ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.rates = object.rates?.map(e => BigInt(e.toString())) || []; + message.resolveTimes = object.resolveTimes?.map(e => BigInt(e.toString())) || []; + message.requestIDs = object.requestIDs?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgRelayBandRatesAmino): MsgRelayBandRates { + const message = createBaseMsgRelayBandRates(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + message.symbols = object.symbols?.map(e => e) || []; + message.rates = object.rates?.map(e => BigInt(e)) || []; + message.resolveTimes = object.resolve_times?.map(e => BigInt(e)) || []; + message.requestIDs = object.requestIDs?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgRelayBandRates): MsgRelayBandRatesAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.rates) { + obj.rates = message.rates.map(e => e.toString()); + } else { + obj.rates = message.rates; + } + if (message.resolveTimes) { + obj.resolve_times = message.resolveTimes.map(e => e.toString()); + } else { + obj.resolve_times = message.resolveTimes; + } + if (message.requestIDs) { + obj.requestIDs = message.requestIDs.map(e => e.toString()); + } else { + obj.requestIDs = message.requestIDs; + } + return obj; + }, + fromAminoMsg(object: MsgRelayBandRatesAminoMsg): MsgRelayBandRates { + return MsgRelayBandRates.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayBandRates): MsgRelayBandRatesAminoMsg { + return { + type: "oracle/MsgRelayBandRates", + value: MsgRelayBandRates.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayBandRatesProtoMsg): MsgRelayBandRates { + return MsgRelayBandRates.decode(message.value); + }, + toProto(message: MsgRelayBandRates): Uint8Array { + return MsgRelayBandRates.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayBandRates): MsgRelayBandRatesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates", + value: MsgRelayBandRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayBandRates.typeUrl, MsgRelayBandRates); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayBandRates.aminoType, MsgRelayBandRates.typeUrl); +function createBaseMsgRelayBandRatesResponse(): MsgRelayBandRatesResponse { + return {}; +} +export const MsgRelayBandRatesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse", + is(o: any): o is MsgRelayBandRatesResponse { + return o && o.$typeUrl === MsgRelayBandRatesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayBandRatesResponseAmino { + return o && o.$typeUrl === MsgRelayBandRatesResponse.typeUrl; + }, + encode(_: MsgRelayBandRatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayBandRatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayBandRatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayBandRatesResponse { + const message = createBaseMsgRelayBandRatesResponse(); + return message; + }, + fromAmino(_: MsgRelayBandRatesResponseAmino): MsgRelayBandRatesResponse { + const message = createBaseMsgRelayBandRatesResponse(); + return message; + }, + toAmino(_: MsgRelayBandRatesResponse): MsgRelayBandRatesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayBandRatesResponseAminoMsg): MsgRelayBandRatesResponse { + return MsgRelayBandRatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayBandRatesResponseProtoMsg): MsgRelayBandRatesResponse { + return MsgRelayBandRatesResponse.decode(message.value); + }, + toProto(message: MsgRelayBandRatesResponse): Uint8Array { + return MsgRelayBandRatesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayBandRatesResponse): MsgRelayBandRatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse", + value: MsgRelayBandRatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayBandRatesResponse.typeUrl, MsgRelayBandRatesResponse); +function createBaseMsgRelayCoinbaseMessages(): MsgRelayCoinbaseMessages { + return { + sender: "", + messages: [], + signatures: [] + }; +} +export const MsgRelayCoinbaseMessages = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages", + aminoType: "oracle/MsgRelayCoinbaseMessages", + is(o: any): o is MsgRelayCoinbaseMessages { + return o && (o.$typeUrl === MsgRelayCoinbaseMessages.typeUrl || typeof o.sender === "string" && Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MsgRelayCoinbaseMessagesAmino { + return o && (o.$typeUrl === MsgRelayCoinbaseMessages.typeUrl || typeof o.sender === "string" && Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MsgRelayCoinbaseMessages, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.messages) { + writer.uint32(18).bytes(v!); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayCoinbaseMessages { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayCoinbaseMessages(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.messages.push(reader.bytes()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayCoinbaseMessages { + const message = createBaseMsgRelayCoinbaseMessages(); + message.sender = object.sender ?? ""; + message.messages = object.messages?.map(e => e) || []; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayCoinbaseMessagesAmino): MsgRelayCoinbaseMessages { + const message = createBaseMsgRelayCoinbaseMessages(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.messages = object.messages?.map(e => bytesFromBase64(e)) || []; + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.messages) { + obj.messages = message.messages.map(e => base64FromBytes(e)); + } else { + obj.messages = message.messages; + } + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MsgRelayCoinbaseMessagesAminoMsg): MsgRelayCoinbaseMessages { + return MsgRelayCoinbaseMessages.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesAminoMsg { + return { + type: "oracle/MsgRelayCoinbaseMessages", + value: MsgRelayCoinbaseMessages.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayCoinbaseMessagesProtoMsg): MsgRelayCoinbaseMessages { + return MsgRelayCoinbaseMessages.decode(message.value); + }, + toProto(message: MsgRelayCoinbaseMessages): Uint8Array { + return MsgRelayCoinbaseMessages.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages", + value: MsgRelayCoinbaseMessages.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayCoinbaseMessages.typeUrl, MsgRelayCoinbaseMessages); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayCoinbaseMessages.aminoType, MsgRelayCoinbaseMessages.typeUrl); +function createBaseMsgRelayCoinbaseMessagesResponse(): MsgRelayCoinbaseMessagesResponse { + return {}; +} +export const MsgRelayCoinbaseMessagesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse", + is(o: any): o is MsgRelayCoinbaseMessagesResponse { + return o && o.$typeUrl === MsgRelayCoinbaseMessagesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayCoinbaseMessagesResponseAmino { + return o && o.$typeUrl === MsgRelayCoinbaseMessagesResponse.typeUrl; + }, + encode(_: MsgRelayCoinbaseMessagesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayCoinbaseMessagesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayCoinbaseMessagesResponse { + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + return message; + }, + fromAmino(_: MsgRelayCoinbaseMessagesResponseAmino): MsgRelayCoinbaseMessagesResponse { + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + return message; + }, + toAmino(_: MsgRelayCoinbaseMessagesResponse): MsgRelayCoinbaseMessagesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayCoinbaseMessagesResponseAminoMsg): MsgRelayCoinbaseMessagesResponse { + return MsgRelayCoinbaseMessagesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayCoinbaseMessagesResponseProtoMsg): MsgRelayCoinbaseMessagesResponse { + return MsgRelayCoinbaseMessagesResponse.decode(message.value); + }, + toProto(message: MsgRelayCoinbaseMessagesResponse): Uint8Array { + return MsgRelayCoinbaseMessagesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayCoinbaseMessagesResponse): MsgRelayCoinbaseMessagesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse", + value: MsgRelayCoinbaseMessagesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayCoinbaseMessagesResponse.typeUrl, MsgRelayCoinbaseMessagesResponse); +function createBaseMsgRelayStorkPrices(): MsgRelayStorkPrices { + return { + sender: "", + assetPairs: [] + }; +} +export const MsgRelayStorkPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices", + is(o: any): o is MsgRelayStorkPrices { + return o && (o.$typeUrl === MsgRelayStorkPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.assetPairs) && (!o.assetPairs.length || AssetPair.is(o.assetPairs[0]))); + }, + isAmino(o: any): o is MsgRelayStorkPricesAmino { + return o && (o.$typeUrl === MsgRelayStorkPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.asset_pairs) && (!o.asset_pairs.length || AssetPair.isAmino(o.asset_pairs[0]))); + }, + encode(message: MsgRelayStorkPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.assetPairs) { + AssetPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayStorkPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayStorkPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.assetPairs.push(AssetPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayStorkPrices { + const message = createBaseMsgRelayStorkPrices(); + message.sender = object.sender ?? ""; + message.assetPairs = object.assetPairs?.map(e => AssetPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRelayStorkPricesAmino): MsgRelayStorkPrices { + const message = createBaseMsgRelayStorkPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.assetPairs = object.asset_pairs?.map(e => AssetPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRelayStorkPrices): MsgRelayStorkPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.assetPairs) { + obj.asset_pairs = message.assetPairs.map(e => e ? AssetPair.toAmino(e) : undefined); + } else { + obj.asset_pairs = message.assetPairs; + } + return obj; + }, + fromAminoMsg(object: MsgRelayStorkPricesAminoMsg): MsgRelayStorkPrices { + return MsgRelayStorkPrices.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayStorkPricesProtoMsg): MsgRelayStorkPrices { + return MsgRelayStorkPrices.decode(message.value); + }, + toProto(message: MsgRelayStorkPrices): Uint8Array { + return MsgRelayStorkPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayStorkPrices): MsgRelayStorkPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices", + value: MsgRelayStorkPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayStorkPrices.typeUrl, MsgRelayStorkPrices); +function createBaseMsgRelayStorkPricesResponse(): MsgRelayStorkPricesResponse { + return {}; +} +export const MsgRelayStorkPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse", + is(o: any): o is MsgRelayStorkPricesResponse { + return o && o.$typeUrl === MsgRelayStorkPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayStorkPricesResponseAmino { + return o && o.$typeUrl === MsgRelayStorkPricesResponse.typeUrl; + }, + encode(_: MsgRelayStorkPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayStorkPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayStorkPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayStorkPricesResponse { + const message = createBaseMsgRelayStorkPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayStorkPricesResponseAmino): MsgRelayStorkPricesResponse { + const message = createBaseMsgRelayStorkPricesResponse(); + return message; + }, + toAmino(_: MsgRelayStorkPricesResponse): MsgRelayStorkPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayStorkPricesResponseAminoMsg): MsgRelayStorkPricesResponse { + return MsgRelayStorkPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayStorkPricesResponseProtoMsg): MsgRelayStorkPricesResponse { + return MsgRelayStorkPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayStorkPricesResponse): Uint8Array { + return MsgRelayStorkPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayStorkPricesResponse): MsgRelayStorkPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse", + value: MsgRelayStorkPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayStorkPricesResponse.typeUrl, MsgRelayStorkPricesResponse); +function createBaseMsgRequestBandIBCRates(): MsgRequestBandIBCRates { + return { + sender: "", + requestId: BigInt(0) + }; +} +export const MsgRequestBandIBCRates = { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates", + aminoType: "oracle/MsgRequestBandIBCRates", + is(o: any): o is MsgRequestBandIBCRates { + return o && (o.$typeUrl === MsgRequestBandIBCRates.typeUrl || typeof o.sender === "string" && typeof o.requestId === "bigint"); + }, + isAmino(o: any): o is MsgRequestBandIBCRatesAmino { + return o && (o.$typeUrl === MsgRequestBandIBCRates.typeUrl || typeof o.sender === "string" && typeof o.request_id === "bigint"); + }, + encode(message: MsgRequestBandIBCRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(16).uint64(message.requestId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBandIBCRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBandIBCRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.requestId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestBandIBCRates { + const message = createBaseMsgRequestBandIBCRates(); + message.sender = object.sender ?? ""; + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgRequestBandIBCRatesAmino): MsgRequestBandIBCRates { + const message = createBaseMsgRequestBandIBCRates(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + return message; + }, + toAmino(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgRequestBandIBCRatesAminoMsg): MsgRequestBandIBCRates { + return MsgRequestBandIBCRates.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesAminoMsg { + return { + type: "oracle/MsgRequestBandIBCRates", + value: MsgRequestBandIBCRates.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestBandIBCRatesProtoMsg): MsgRequestBandIBCRates { + return MsgRequestBandIBCRates.decode(message.value); + }, + toProto(message: MsgRequestBandIBCRates): Uint8Array { + return MsgRequestBandIBCRates.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates", + value: MsgRequestBandIBCRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBandIBCRates.typeUrl, MsgRequestBandIBCRates); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestBandIBCRates.aminoType, MsgRequestBandIBCRates.typeUrl); +function createBaseMsgRequestBandIBCRatesResponse(): MsgRequestBandIBCRatesResponse { + return {}; +} +export const MsgRequestBandIBCRatesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse", + is(o: any): o is MsgRequestBandIBCRatesResponse { + return o && o.$typeUrl === MsgRequestBandIBCRatesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestBandIBCRatesResponseAmino { + return o && o.$typeUrl === MsgRequestBandIBCRatesResponse.typeUrl; + }, + encode(_: MsgRequestBandIBCRatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBandIBCRatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBandIBCRatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestBandIBCRatesResponse { + const message = createBaseMsgRequestBandIBCRatesResponse(); + return message; + }, + fromAmino(_: MsgRequestBandIBCRatesResponseAmino): MsgRequestBandIBCRatesResponse { + const message = createBaseMsgRequestBandIBCRatesResponse(); + return message; + }, + toAmino(_: MsgRequestBandIBCRatesResponse): MsgRequestBandIBCRatesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestBandIBCRatesResponseAminoMsg): MsgRequestBandIBCRatesResponse { + return MsgRequestBandIBCRatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestBandIBCRatesResponseProtoMsg): MsgRequestBandIBCRatesResponse { + return MsgRequestBandIBCRatesResponse.decode(message.value); + }, + toProto(message: MsgRequestBandIBCRatesResponse): Uint8Array { + return MsgRequestBandIBCRatesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBandIBCRatesResponse): MsgRequestBandIBCRatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse", + value: MsgRequestBandIBCRatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBandIBCRatesResponse.typeUrl, MsgRequestBandIBCRatesResponse); +function createBaseMsgRelayPythPrices(): MsgRelayPythPrices { + return { + sender: "", + priceAttestations: [] + }; +} +export const MsgRelayPythPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices", + aminoType: "oracle/MsgRelayPythPrices", + is(o: any): o is MsgRelayPythPrices { + return o && (o.$typeUrl === MsgRelayPythPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.priceAttestations) && (!o.priceAttestations.length || PriceAttestation.is(o.priceAttestations[0]))); + }, + isAmino(o: any): o is MsgRelayPythPricesAmino { + return o && (o.$typeUrl === MsgRelayPythPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.price_attestations) && (!o.price_attestations.length || PriceAttestation.isAmino(o.price_attestations[0]))); + }, + encode(message: MsgRelayPythPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.priceAttestations) { + PriceAttestation.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPythPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPythPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.priceAttestations.push(PriceAttestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayPythPrices { + const message = createBaseMsgRelayPythPrices(); + message.sender = object.sender ?? ""; + message.priceAttestations = object.priceAttestations?.map(e => PriceAttestation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRelayPythPricesAmino): MsgRelayPythPrices { + const message = createBaseMsgRelayPythPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.priceAttestations = object.price_attestations?.map(e => PriceAttestation.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRelayPythPrices): MsgRelayPythPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.priceAttestations) { + obj.price_attestations = message.priceAttestations.map(e => e ? PriceAttestation.toAmino(e) : undefined); + } else { + obj.price_attestations = message.priceAttestations; + } + return obj; + }, + fromAminoMsg(object: MsgRelayPythPricesAminoMsg): MsgRelayPythPrices { + return MsgRelayPythPrices.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayPythPrices): MsgRelayPythPricesAminoMsg { + return { + type: "oracle/MsgRelayPythPrices", + value: MsgRelayPythPrices.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayPythPricesProtoMsg): MsgRelayPythPrices { + return MsgRelayPythPrices.decode(message.value); + }, + toProto(message: MsgRelayPythPrices): Uint8Array { + return MsgRelayPythPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPythPrices): MsgRelayPythPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices", + value: MsgRelayPythPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPythPrices.typeUrl, MsgRelayPythPrices); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayPythPrices.aminoType, MsgRelayPythPrices.typeUrl); +function createBaseMsgRelayPythPricesResponse(): MsgRelayPythPricesResponse { + return {}; +} +export const MsgRelayPythPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse", + is(o: any): o is MsgRelayPythPricesResponse { + return o && o.$typeUrl === MsgRelayPythPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayPythPricesResponseAmino { + return o && o.$typeUrl === MsgRelayPythPricesResponse.typeUrl; + }, + encode(_: MsgRelayPythPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPythPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPythPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayPythPricesResponse { + const message = createBaseMsgRelayPythPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayPythPricesResponseAmino): MsgRelayPythPricesResponse { + const message = createBaseMsgRelayPythPricesResponse(); + return message; + }, + toAmino(_: MsgRelayPythPricesResponse): MsgRelayPythPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayPythPricesResponseAminoMsg): MsgRelayPythPricesResponse { + return MsgRelayPythPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayPythPricesResponseProtoMsg): MsgRelayPythPricesResponse { + return MsgRelayPythPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayPythPricesResponse): Uint8Array { + return MsgRelayPythPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPythPricesResponse): MsgRelayPythPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse", + value: MsgRelayPythPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPythPricesResponse.typeUrl, MsgRelayPythPricesResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParams", + aminoType: "oracle/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "oracle/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: "/injective.oracle.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/attestation.ts b/libs/injective-query/src/injective/peggy/v1/attestation.ts new file mode 100644 index 00000000..2b00c1ac --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/attestation.ts @@ -0,0 +1,333 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * ClaimType is the cosmos type of an event from the counterpart chain that can + * be handled + */ +export enum ClaimType { + CLAIM_TYPE_UNKNOWN = 0, + CLAIM_TYPE_DEPOSIT = 1, + CLAIM_TYPE_WITHDRAW = 2, + CLAIM_TYPE_ERC20_DEPLOYED = 3, + CLAIM_TYPE_VALSET_UPDATED = 4, + UNRECOGNIZED = -1, +} +export const ClaimTypeAmino = ClaimType; +export function claimTypeFromJSON(object: any): ClaimType { + switch (object) { + case 0: + case "CLAIM_TYPE_UNKNOWN": + return ClaimType.CLAIM_TYPE_UNKNOWN; + case 1: + case "CLAIM_TYPE_DEPOSIT": + return ClaimType.CLAIM_TYPE_DEPOSIT; + case 2: + case "CLAIM_TYPE_WITHDRAW": + return ClaimType.CLAIM_TYPE_WITHDRAW; + case 3: + case "CLAIM_TYPE_ERC20_DEPLOYED": + return ClaimType.CLAIM_TYPE_ERC20_DEPLOYED; + case 4: + case "CLAIM_TYPE_VALSET_UPDATED": + return ClaimType.CLAIM_TYPE_VALSET_UPDATED; + case -1: + case "UNRECOGNIZED": + default: + return ClaimType.UNRECOGNIZED; + } +} +export function claimTypeToJSON(object: ClaimType): string { + switch (object) { + case ClaimType.CLAIM_TYPE_UNKNOWN: + return "CLAIM_TYPE_UNKNOWN"; + case ClaimType.CLAIM_TYPE_DEPOSIT: + return "CLAIM_TYPE_DEPOSIT"; + case ClaimType.CLAIM_TYPE_WITHDRAW: + return "CLAIM_TYPE_WITHDRAW"; + case ClaimType.CLAIM_TYPE_ERC20_DEPLOYED: + return "CLAIM_TYPE_ERC20_DEPLOYED"; + case ClaimType.CLAIM_TYPE_VALSET_UPDATED: + return "CLAIM_TYPE_VALSET_UPDATED"; + case ClaimType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Attestation is an aggregate of `claims` that eventually becomes `observed` by + * all orchestrators + * EVENT_NONCE: + * EventNonce a nonce provided by the peggy contract that is unique per event + * fired These event nonces must be relayed in order. This is a correctness + * issue, if relaying out of order transaction replay attacks become possible + * OBSERVED: + * Observed indicates that >67% of validators have attested to the event, + * and that the event should be executed by the peggy state machine + * + * The actual content of the claims is passed in with the transaction making the + * claim and then passed through the call stack alongside the attestation while + * it is processed the key in which the attestation is stored is keyed on the + * exact details of the claim but there is no reason to store those exact + * details becuause the next message sender will kindly provide you with them. + */ +export interface Attestation { + observed: boolean; + votes: string[]; + height: bigint; + claim?: Any; +} +export interface AttestationProtoMsg { + typeUrl: "/injective.peggy.v1.Attestation"; + value: Uint8Array; +} +/** + * Attestation is an aggregate of `claims` that eventually becomes `observed` by + * all orchestrators + * EVENT_NONCE: + * EventNonce a nonce provided by the peggy contract that is unique per event + * fired These event nonces must be relayed in order. This is a correctness + * issue, if relaying out of order transaction replay attacks become possible + * OBSERVED: + * Observed indicates that >67% of validators have attested to the event, + * and that the event should be executed by the peggy state machine + * + * The actual content of the claims is passed in with the transaction making the + * claim and then passed through the call stack alongside the attestation while + * it is processed the key in which the attestation is stored is keyed on the + * exact details of the claim but there is no reason to store those exact + * details becuause the next message sender will kindly provide you with them. + */ +export interface AttestationAmino { + observed: boolean; + votes: string[]; + height: string; + claim?: AnyAmino; +} +export interface AttestationAminoMsg { + type: "/injective.peggy.v1.Attestation"; + value: AttestationAmino; +} +/** + * ERC20Token unique identifier for an Ethereum ERC20 token. + * CONTRACT: + * The contract address on ETH of the token, this could be a Cosmos + * originated token, if so it will be the ERC20 address of the representation + * (note: developers should look up the token symbol using the address on ETH to + * display for UI) + */ +export interface ERC20Token { + contract: string; + amount: string; +} +export interface ERC20TokenProtoMsg { + typeUrl: "/injective.peggy.v1.ERC20Token"; + value: Uint8Array; +} +/** + * ERC20Token unique identifier for an Ethereum ERC20 token. + * CONTRACT: + * The contract address on ETH of the token, this could be a Cosmos + * originated token, if so it will be the ERC20 address of the representation + * (note: developers should look up the token symbol using the address on ETH to + * display for UI) + */ +export interface ERC20TokenAmino { + contract: string; + amount: string; +} +export interface ERC20TokenAminoMsg { + type: "/injective.peggy.v1.ERC20Token"; + value: ERC20TokenAmino; +} +function createBaseAttestation(): Attestation { + return { + observed: false, + votes: [], + height: BigInt(0), + claim: undefined + }; +} +export const Attestation = { + typeUrl: "/injective.peggy.v1.Attestation", + is(o: any): o is Attestation { + return o && (o.$typeUrl === Attestation.typeUrl || typeof o.observed === "boolean" && Array.isArray(o.votes) && (!o.votes.length || typeof o.votes[0] === "string") && typeof o.height === "bigint"); + }, + isAmino(o: any): o is AttestationAmino { + return o && (o.$typeUrl === Attestation.typeUrl || typeof o.observed === "boolean" && Array.isArray(o.votes) && (!o.votes.length || typeof o.votes[0] === "string") && typeof o.height === "bigint"); + }, + encode(message: Attestation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.observed === true) { + writer.uint32(8).bool(message.observed); + } + for (const v of message.votes) { + writer.uint32(18).string(v!); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + if (message.claim !== undefined) { + Any.encode(message.claim, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Attestation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttestation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.observed = reader.bool(); + break; + case 2: + message.votes.push(reader.string()); + break; + case 3: + message.height = reader.uint64(); + break; + case 4: + message.claim = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Attestation { + const message = createBaseAttestation(); + message.observed = object.observed ?? false; + message.votes = object.votes?.map(e => e) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.claim = object.claim !== undefined && object.claim !== null ? Any.fromPartial(object.claim) : undefined; + return message; + }, + fromAmino(object: AttestationAmino): Attestation { + const message = createBaseAttestation(); + if (object.observed !== undefined && object.observed !== null) { + message.observed = object.observed; + } + message.votes = object.votes?.map(e => e) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.claim !== undefined && object.claim !== null) { + message.claim = Any.fromAmino(object.claim); + } + return message; + }, + toAmino(message: Attestation): AttestationAmino { + const obj: any = {}; + obj.observed = message.observed === false ? undefined : message.observed; + if (message.votes) { + obj.votes = message.votes.map(e => e); + } else { + obj.votes = message.votes; + } + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.claim = message.claim ? Any.toAmino(message.claim) : undefined; + return obj; + }, + fromAminoMsg(object: AttestationAminoMsg): Attestation { + return Attestation.fromAmino(object.value); + }, + fromProtoMsg(message: AttestationProtoMsg): Attestation { + return Attestation.decode(message.value); + }, + toProto(message: Attestation): Uint8Array { + return Attestation.encode(message).finish(); + }, + toProtoMsg(message: Attestation): AttestationProtoMsg { + return { + typeUrl: "/injective.peggy.v1.Attestation", + value: Attestation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Attestation.typeUrl, Attestation); +function createBaseERC20Token(): ERC20Token { + return { + contract: "", + amount: "" + }; +} +export const ERC20Token = { + typeUrl: "/injective.peggy.v1.ERC20Token", + is(o: any): o is ERC20Token { + return o && (o.$typeUrl === ERC20Token.typeUrl || typeof o.contract === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is ERC20TokenAmino { + return o && (o.$typeUrl === ERC20Token.typeUrl || typeof o.contract === "string" && typeof o.amount === "string"); + }, + encode(message: ERC20Token, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contract !== "") { + writer.uint32(10).string(message.contract); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ERC20Token { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseERC20Token(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contract = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ERC20Token { + const message = createBaseERC20Token(); + message.contract = object.contract ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: ERC20TokenAmino): ERC20Token { + const message = createBaseERC20Token(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: ERC20Token): ERC20TokenAmino { + const obj: any = {}; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: ERC20TokenAminoMsg): ERC20Token { + return ERC20Token.fromAmino(object.value); + }, + fromProtoMsg(message: ERC20TokenProtoMsg): ERC20Token { + return ERC20Token.decode(message.value); + }, + toProto(message: ERC20Token): Uint8Array { + return ERC20Token.encode(message).finish(); + }, + toProtoMsg(message: ERC20Token): ERC20TokenProtoMsg { + return { + typeUrl: "/injective.peggy.v1.ERC20Token", + value: ERC20Token.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ERC20Token.typeUrl, ERC20Token); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/batch.ts b/libs/injective-query/src/injective/peggy/v1/batch.ts new file mode 100644 index 00000000..c4bc396f --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/batch.ts @@ -0,0 +1,290 @@ +import { ERC20Token, ERC20TokenAmino } from "./attestation"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** OutgoingTxBatch represents a batch of transactions going from Peggy to ETH */ +export interface OutgoingTxBatch { + batchNonce: bigint; + batchTimeout: bigint; + transactions: OutgoingTransferTx[]; + tokenContract: string; + block: bigint; +} +export interface OutgoingTxBatchProtoMsg { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch"; + value: Uint8Array; +} +/** OutgoingTxBatch represents a batch of transactions going from Peggy to ETH */ +export interface OutgoingTxBatchAmino { + batch_nonce: string; + batch_timeout: string; + transactions: OutgoingTransferTxAmino[]; + token_contract: string; + block: string; +} +export interface OutgoingTxBatchAminoMsg { + type: "/injective.peggy.v1.OutgoingTxBatch"; + value: OutgoingTxBatchAmino; +} +/** OutgoingTransferTx represents an individual send from Peggy to ETH */ +export interface OutgoingTransferTx { + id: bigint; + sender: string; + destAddress: string; + erc20Token?: ERC20Token; + erc20Fee?: ERC20Token; +} +export interface OutgoingTransferTxProtoMsg { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx"; + value: Uint8Array; +} +/** OutgoingTransferTx represents an individual send from Peggy to ETH */ +export interface OutgoingTransferTxAmino { + id: string; + sender: string; + dest_address: string; + erc20_token?: ERC20TokenAmino; + erc20_fee?: ERC20TokenAmino; +} +export interface OutgoingTransferTxAminoMsg { + type: "/injective.peggy.v1.OutgoingTransferTx"; + value: OutgoingTransferTxAmino; +} +function createBaseOutgoingTxBatch(): OutgoingTxBatch { + return { + batchNonce: BigInt(0), + batchTimeout: BigInt(0), + transactions: [], + tokenContract: "", + block: BigInt(0) + }; +} +export const OutgoingTxBatch = { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch", + is(o: any): o is OutgoingTxBatch { + return o && (o.$typeUrl === OutgoingTxBatch.typeUrl || typeof o.batchNonce === "bigint" && typeof o.batchTimeout === "bigint" && Array.isArray(o.transactions) && (!o.transactions.length || OutgoingTransferTx.is(o.transactions[0])) && typeof o.tokenContract === "string" && typeof o.block === "bigint"); + }, + isAmino(o: any): o is OutgoingTxBatchAmino { + return o && (o.$typeUrl === OutgoingTxBatch.typeUrl || typeof o.batch_nonce === "bigint" && typeof o.batch_timeout === "bigint" && Array.isArray(o.transactions) && (!o.transactions.length || OutgoingTransferTx.isAmino(o.transactions[0])) && typeof o.token_contract === "string" && typeof o.block === "bigint"); + }, + encode(message: OutgoingTxBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.batchNonce); + } + if (message.batchTimeout !== BigInt(0)) { + writer.uint32(16).uint64(message.batchTimeout); + } + for (const v of message.transactions) { + OutgoingTransferTx.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.block !== BigInt(0)) { + writer.uint32(40).uint64(message.block); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OutgoingTxBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingTxBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchNonce = reader.uint64(); + break; + case 2: + message.batchTimeout = reader.uint64(); + break; + case 3: + message.transactions.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.block = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OutgoingTxBatch { + const message = createBaseOutgoingTxBatch(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.batchTimeout = object.batchTimeout !== undefined && object.batchTimeout !== null ? BigInt(object.batchTimeout.toString()) : BigInt(0); + message.transactions = object.transactions?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.tokenContract = object.tokenContract ?? ""; + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + return message; + }, + fromAmino(object: OutgoingTxBatchAmino): OutgoingTxBatch { + const message = createBaseOutgoingTxBatch(); + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.batch_timeout !== undefined && object.batch_timeout !== null) { + message.batchTimeout = BigInt(object.batch_timeout); + } + message.transactions = object.transactions?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + return message; + }, + toAmino(message: OutgoingTxBatch): OutgoingTxBatchAmino { + const obj: any = {}; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.batch_timeout = message.batchTimeout !== BigInt(0) ? message.batchTimeout?.toString() : undefined; + if (message.transactions) { + obj.transactions = message.transactions.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.transactions = message.transactions; + } + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.block = message.block !== BigInt(0) ? message.block?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: OutgoingTxBatchAminoMsg): OutgoingTxBatch { + return OutgoingTxBatch.fromAmino(object.value); + }, + fromProtoMsg(message: OutgoingTxBatchProtoMsg): OutgoingTxBatch { + return OutgoingTxBatch.decode(message.value); + }, + toProto(message: OutgoingTxBatch): Uint8Array { + return OutgoingTxBatch.encode(message).finish(); + }, + toProtoMsg(message: OutgoingTxBatch): OutgoingTxBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch", + value: OutgoingTxBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OutgoingTxBatch.typeUrl, OutgoingTxBatch); +function createBaseOutgoingTransferTx(): OutgoingTransferTx { + return { + id: BigInt(0), + sender: "", + destAddress: "", + erc20Token: undefined, + erc20Fee: undefined + }; +} +export const OutgoingTransferTx = { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx", + is(o: any): o is OutgoingTransferTx { + return o && (o.$typeUrl === OutgoingTransferTx.typeUrl || typeof o.id === "bigint" && typeof o.sender === "string" && typeof o.destAddress === "string"); + }, + isAmino(o: any): o is OutgoingTransferTxAmino { + return o && (o.$typeUrl === OutgoingTransferTx.typeUrl || typeof o.id === "bigint" && typeof o.sender === "string" && typeof o.dest_address === "string"); + }, + encode(message: OutgoingTransferTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.destAddress !== "") { + writer.uint32(26).string(message.destAddress); + } + if (message.erc20Token !== undefined) { + ERC20Token.encode(message.erc20Token, writer.uint32(34).fork()).ldelim(); + } + if (message.erc20Fee !== undefined) { + ERC20Token.encode(message.erc20Fee, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OutgoingTransferTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingTransferTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.destAddress = reader.string(); + break; + case 4: + message.erc20Token = ERC20Token.decode(reader, reader.uint32()); + break; + case 5: + message.erc20Fee = ERC20Token.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OutgoingTransferTx { + const message = createBaseOutgoingTransferTx(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.destAddress = object.destAddress ?? ""; + message.erc20Token = object.erc20Token !== undefined && object.erc20Token !== null ? ERC20Token.fromPartial(object.erc20Token) : undefined; + message.erc20Fee = object.erc20Fee !== undefined && object.erc20Fee !== null ? ERC20Token.fromPartial(object.erc20Fee) : undefined; + return message; + }, + fromAmino(object: OutgoingTransferTxAmino): OutgoingTransferTx { + const message = createBaseOutgoingTransferTx(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.dest_address !== undefined && object.dest_address !== null) { + message.destAddress = object.dest_address; + } + if (object.erc20_token !== undefined && object.erc20_token !== null) { + message.erc20Token = ERC20Token.fromAmino(object.erc20_token); + } + if (object.erc20_fee !== undefined && object.erc20_fee !== null) { + message.erc20Fee = ERC20Token.fromAmino(object.erc20_fee); + } + return message; + }, + toAmino(message: OutgoingTransferTx): OutgoingTransferTxAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.dest_address = message.destAddress === "" ? undefined : message.destAddress; + obj.erc20_token = message.erc20Token ? ERC20Token.toAmino(message.erc20Token) : undefined; + obj.erc20_fee = message.erc20Fee ? ERC20Token.toAmino(message.erc20Fee) : undefined; + return obj; + }, + fromAminoMsg(object: OutgoingTransferTxAminoMsg): OutgoingTransferTx { + return OutgoingTransferTx.fromAmino(object.value); + }, + fromProtoMsg(message: OutgoingTransferTxProtoMsg): OutgoingTransferTx { + return OutgoingTransferTx.decode(message.value); + }, + toProto(message: OutgoingTransferTx): Uint8Array { + return OutgoingTransferTx.encode(message).finish(); + }, + toProtoMsg(message: OutgoingTransferTx): OutgoingTransferTxProtoMsg { + return { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx", + value: OutgoingTransferTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OutgoingTransferTx.typeUrl, OutgoingTransferTx); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/ethereum_signer.ts b/libs/injective-query/src/injective/peggy/v1/ethereum_signer.ts new file mode 100644 index 00000000..5c00229c --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/ethereum_signer.ts @@ -0,0 +1,38 @@ +/** SignType defines messages that have been signed by an orchestrator */ +export enum SignType { + SIGN_TYPE_UNKNOWN = 0, + SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE = 1, + SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH = 2, + UNRECOGNIZED = -1, +} +export const SignTypeAmino = SignType; +export function signTypeFromJSON(object: any): SignType { + switch (object) { + case 0: + case "SIGN_TYPE_UNKNOWN": + return SignType.SIGN_TYPE_UNKNOWN; + case 1: + case "SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE": + return SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE; + case 2: + case "SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH": + return SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH; + case -1: + case "UNRECOGNIZED": + default: + return SignType.UNRECOGNIZED; + } +} +export function signTypeToJSON(object: SignType): string { + switch (object) { + case SignType.SIGN_TYPE_UNKNOWN: + return "SIGN_TYPE_UNKNOWN"; + case SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE: + return "SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE"; + case SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH: + return "SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH"; + case SignType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/events.ts b/libs/injective-query/src/injective/peggy/v1/events.ts new file mode 100644 index 00000000..bb0b7095 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/events.ts @@ -0,0 +1,2274 @@ +import { ClaimType } from "./attestation"; +import { BridgeValidator, BridgeValidatorAmino } from "./types"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventAttestationObserved { + attestationType: ClaimType; + bridgeContract: string; + bridgeChainId: bigint; + attestationId: Uint8Array; + nonce: bigint; +} +export interface EventAttestationObservedProtoMsg { + typeUrl: "/injective.peggy.v1.EventAttestationObserved"; + value: Uint8Array; +} +export interface EventAttestationObservedAmino { + attestation_type: ClaimType; + bridge_contract: string; + bridge_chain_id: string; + attestation_id: string; + nonce: string; +} +export interface EventAttestationObservedAminoMsg { + type: "/injective.peggy.v1.EventAttestationObserved"; + value: EventAttestationObservedAmino; +} +export interface EventBridgeWithdrawCanceled { + bridgeContract: string; + bridgeChainId: bigint; +} +export interface EventBridgeWithdrawCanceledProtoMsg { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled"; + value: Uint8Array; +} +export interface EventBridgeWithdrawCanceledAmino { + bridge_contract: string; + bridge_chain_id: string; +} +export interface EventBridgeWithdrawCanceledAminoMsg { + type: "/injective.peggy.v1.EventBridgeWithdrawCanceled"; + value: EventBridgeWithdrawCanceledAmino; +} +export interface EventOutgoingBatch { + denom: string; + orchestratorAddress: string; + batchNonce: bigint; + batchTimeout: bigint; + batchTxIds: bigint[]; +} +export interface EventOutgoingBatchProtoMsg { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch"; + value: Uint8Array; +} +export interface EventOutgoingBatchAmino { + denom: string; + orchestrator_address: string; + batch_nonce: string; + batch_timeout: string; + batch_tx_ids: string[]; +} +export interface EventOutgoingBatchAminoMsg { + type: "/injective.peggy.v1.EventOutgoingBatch"; + value: EventOutgoingBatchAmino; +} +export interface EventOutgoingBatchCanceled { + bridgeContract: string; + bridgeChainId: bigint; + batchId: bigint; + nonce: bigint; +} +export interface EventOutgoingBatchCanceledProtoMsg { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled"; + value: Uint8Array; +} +export interface EventOutgoingBatchCanceledAmino { + bridge_contract: string; + bridge_chain_id: string; + batch_id: string; + nonce: string; +} +export interface EventOutgoingBatchCanceledAminoMsg { + type: "/injective.peggy.v1.EventOutgoingBatchCanceled"; + value: EventOutgoingBatchCanceledAmino; +} +export interface EventValsetUpdateRequest { + valsetNonce: bigint; + valsetHeight: bigint; + valsetMembers: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; +} +export interface EventValsetUpdateRequestProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest"; + value: Uint8Array; +} +export interface EventValsetUpdateRequestAmino { + valset_nonce: string; + valset_height: string; + valset_members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; +} +export interface EventValsetUpdateRequestAminoMsg { + type: "/injective.peggy.v1.EventValsetUpdateRequest"; + value: EventValsetUpdateRequestAmino; +} +export interface EventSetOrchestratorAddresses { + validatorAddress: string; + orchestratorAddress: string; + operatorEthAddress: string; +} +export interface EventSetOrchestratorAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses"; + value: Uint8Array; +} +export interface EventSetOrchestratorAddressesAmino { + validator_address: string; + orchestrator_address: string; + operator_eth_address: string; +} +export interface EventSetOrchestratorAddressesAminoMsg { + type: "/injective.peggy.v1.EventSetOrchestratorAddresses"; + value: EventSetOrchestratorAddressesAmino; +} +export interface EventValsetConfirm { + valsetNonce: bigint; + orchestratorAddress: string; +} +export interface EventValsetConfirmProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetConfirm"; + value: Uint8Array; +} +export interface EventValsetConfirmAmino { + valset_nonce: string; + orchestrator_address: string; +} +export interface EventValsetConfirmAminoMsg { + type: "/injective.peggy.v1.EventValsetConfirm"; + value: EventValsetConfirmAmino; +} +export interface EventSendToEth { + outgoingTxId: bigint; + sender: string; + receiver: string; + amount: string; + bridgeFee: string; +} +export interface EventSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.EventSendToEth"; + value: Uint8Array; +} +export interface EventSendToEthAmino { + outgoing_tx_id: string; + sender: string; + receiver: string; + amount: string; + bridge_fee: string; +} +export interface EventSendToEthAminoMsg { + type: "/injective.peggy.v1.EventSendToEth"; + value: EventSendToEthAmino; +} +export interface EventConfirmBatch { + batchNonce: bigint; + orchestratorAddress: string; +} +export interface EventConfirmBatchProtoMsg { + typeUrl: "/injective.peggy.v1.EventConfirmBatch"; + value: Uint8Array; +} +export interface EventConfirmBatchAmino { + batch_nonce: string; + orchestrator_address: string; +} +export interface EventConfirmBatchAminoMsg { + type: "/injective.peggy.v1.EventConfirmBatch"; + value: EventConfirmBatchAmino; +} +export interface EventAttestationVote { + eventNonce: bigint; + attestationId: Uint8Array; + voter: string; +} +export interface EventAttestationVoteProtoMsg { + typeUrl: "/injective.peggy.v1.EventAttestationVote"; + value: Uint8Array; +} +export interface EventAttestationVoteAmino { + event_nonce: string; + attestation_id: string; + voter: string; +} +export interface EventAttestationVoteAminoMsg { + type: "/injective.peggy.v1.EventAttestationVote"; + value: EventAttestationVoteAmino; +} +export interface EventDepositClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + ethereumSender: string; + cosmosReceiver: string; + tokenContract: string; + amount: string; + orchestratorAddress: string; + data: string; +} +export interface EventDepositClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventDepositClaim"; + value: Uint8Array; +} +export interface EventDepositClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + ethereum_sender: string; + cosmos_receiver: string; + token_contract: string; + amount: string; + orchestrator_address: string; + data: string; +} +export interface EventDepositClaimAminoMsg { + type: "/injective.peggy.v1.EventDepositClaim"; + value: EventDepositClaimAmino; +} +export interface EventWithdrawClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + batchNonce: bigint; + tokenContract: string; + orchestratorAddress: string; +} +export interface EventWithdrawClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim"; + value: Uint8Array; +} +export interface EventWithdrawClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + batch_nonce: string; + token_contract: string; + orchestrator_address: string; +} +export interface EventWithdrawClaimAminoMsg { + type: "/injective.peggy.v1.EventWithdrawClaim"; + value: EventWithdrawClaimAmino; +} +export interface EventERC20DeployedClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + cosmosDenom: string; + tokenContract: string; + name: string; + symbol: string; + decimals: bigint; + orchestratorAddress: string; +} +export interface EventERC20DeployedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim"; + value: Uint8Array; +} +export interface EventERC20DeployedClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + cosmos_denom: string; + token_contract: string; + name: string; + symbol: string; + decimals: string; + orchestrator_address: string; +} +export interface EventERC20DeployedClaimAminoMsg { + type: "/injective.peggy.v1.EventERC20DeployedClaim"; + value: EventERC20DeployedClaimAmino; +} +export interface EventValsetUpdateClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + valsetNonce: bigint; + valsetMembers: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; + orchestratorAddress: string; +} +export interface EventValsetUpdateClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim"; + value: Uint8Array; +} +export interface EventValsetUpdateClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + valset_nonce: string; + valset_members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; + orchestrator_address: string; +} +export interface EventValsetUpdateClaimAminoMsg { + type: "/injective.peggy.v1.EventValsetUpdateClaim"; + value: EventValsetUpdateClaimAmino; +} +export interface EventCancelSendToEth { + outgoingTxId: bigint; +} +export interface EventCancelSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth"; + value: Uint8Array; +} +export interface EventCancelSendToEthAmino { + outgoing_tx_id: string; +} +export interface EventCancelSendToEthAminoMsg { + type: "/injective.peggy.v1.EventCancelSendToEth"; + value: EventCancelSendToEthAmino; +} +export interface EventSubmitBadSignatureEvidence { + badEthSignature: string; + badEthSignatureSubject: string; +} +export interface EventSubmitBadSignatureEvidenceProtoMsg { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence"; + value: Uint8Array; +} +export interface EventSubmitBadSignatureEvidenceAmino { + bad_eth_signature: string; + bad_eth_signature_subject: string; +} +export interface EventSubmitBadSignatureEvidenceAminoMsg { + type: "/injective.peggy.v1.EventSubmitBadSignatureEvidence"; + value: EventSubmitBadSignatureEvidenceAmino; +} +export interface EventValidatorSlash { + power: bigint; + reason: string; + consensusAddress: string; + operatorAddress: string; + moniker: string; +} +export interface EventValidatorSlashProtoMsg { + typeUrl: "/injective.peggy.v1.EventValidatorSlash"; + value: Uint8Array; +} +export interface EventValidatorSlashAmino { + power: string; + reason: string; + consensus_address: string; + operator_address: string; + moniker: string; +} +export interface EventValidatorSlashAminoMsg { + type: "/injective.peggy.v1.EventValidatorSlash"; + value: EventValidatorSlashAmino; +} +function createBaseEventAttestationObserved(): EventAttestationObserved { + return { + attestationType: 0, + bridgeContract: "", + bridgeChainId: BigInt(0), + attestationId: new Uint8Array(), + nonce: BigInt(0) + }; +} +export const EventAttestationObserved = { + typeUrl: "/injective.peggy.v1.EventAttestationObserved", + is(o: any): o is EventAttestationObserved { + return o && (o.$typeUrl === EventAttestationObserved.typeUrl || isSet(o.attestationType) && typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is EventAttestationObservedAmino { + return o && (o.$typeUrl === EventAttestationObserved.typeUrl || isSet(o.attestation_type) && typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.nonce === "bigint"); + }, + encode(message: EventAttestationObserved, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.attestationType !== 0) { + writer.uint32(8).int32(message.attestationType); + } + if (message.bridgeContract !== "") { + writer.uint32(18).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(24).uint64(message.bridgeChainId); + } + if (message.attestationId.length !== 0) { + writer.uint32(34).bytes(message.attestationId); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(40).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttestationObserved { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttestationObserved(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attestationType = (reader.int32() as any); + break; + case 2: + message.bridgeContract = reader.string(); + break; + case 3: + message.bridgeChainId = reader.uint64(); + break; + case 4: + message.attestationId = reader.bytes(); + break; + case 5: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttestationObserved { + const message = createBaseEventAttestationObserved(); + message.attestationType = object.attestationType ?? 0; + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventAttestationObservedAmino): EventAttestationObserved { + const message = createBaseEventAttestationObserved(); + if (object.attestation_type !== undefined && object.attestation_type !== null) { + message.attestationType = object.attestation_type; + } + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: EventAttestationObserved): EventAttestationObservedAmino { + const obj: any = {}; + obj.attestation_type = message.attestationType === 0 ? undefined : message.attestationType; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventAttestationObservedAminoMsg): EventAttestationObserved { + return EventAttestationObserved.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttestationObservedProtoMsg): EventAttestationObserved { + return EventAttestationObserved.decode(message.value); + }, + toProto(message: EventAttestationObserved): Uint8Array { + return EventAttestationObserved.encode(message).finish(); + }, + toProtoMsg(message: EventAttestationObserved): EventAttestationObservedProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventAttestationObserved", + value: EventAttestationObserved.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttestationObserved.typeUrl, EventAttestationObserved); +function createBaseEventBridgeWithdrawCanceled(): EventBridgeWithdrawCanceled { + return { + bridgeContract: "", + bridgeChainId: BigInt(0) + }; +} +export const EventBridgeWithdrawCanceled = { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled", + is(o: any): o is EventBridgeWithdrawCanceled { + return o && (o.$typeUrl === EventBridgeWithdrawCanceled.typeUrl || typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint"); + }, + isAmino(o: any): o is EventBridgeWithdrawCanceledAmino { + return o && (o.$typeUrl === EventBridgeWithdrawCanceled.typeUrl || typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint"); + }, + encode(message: EventBridgeWithdrawCanceled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bridgeContract !== "") { + writer.uint32(10).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(16).uint64(message.bridgeChainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBridgeWithdrawCanceled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBridgeWithdrawCanceled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bridgeContract = reader.string(); + break; + case 2: + message.bridgeChainId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBridgeWithdrawCanceled { + const message = createBaseEventBridgeWithdrawCanceled(); + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBridgeWithdrawCanceledAmino): EventBridgeWithdrawCanceled { + const message = createBaseEventBridgeWithdrawCanceled(); + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + return message; + }, + toAmino(message: EventBridgeWithdrawCanceled): EventBridgeWithdrawCanceledAmino { + const obj: any = {}; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBridgeWithdrawCanceledAminoMsg): EventBridgeWithdrawCanceled { + return EventBridgeWithdrawCanceled.fromAmino(object.value); + }, + fromProtoMsg(message: EventBridgeWithdrawCanceledProtoMsg): EventBridgeWithdrawCanceled { + return EventBridgeWithdrawCanceled.decode(message.value); + }, + toProto(message: EventBridgeWithdrawCanceled): Uint8Array { + return EventBridgeWithdrawCanceled.encode(message).finish(); + }, + toProtoMsg(message: EventBridgeWithdrawCanceled): EventBridgeWithdrawCanceledProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled", + value: EventBridgeWithdrawCanceled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBridgeWithdrawCanceled.typeUrl, EventBridgeWithdrawCanceled); +function createBaseEventOutgoingBatch(): EventOutgoingBatch { + return { + denom: "", + orchestratorAddress: "", + batchNonce: BigInt(0), + batchTimeout: BigInt(0), + batchTxIds: [] + }; +} +export const EventOutgoingBatch = { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch", + is(o: any): o is EventOutgoingBatch { + return o && (o.$typeUrl === EventOutgoingBatch.typeUrl || typeof o.denom === "string" && typeof o.orchestratorAddress === "string" && typeof o.batchNonce === "bigint" && typeof o.batchTimeout === "bigint" && Array.isArray(o.batchTxIds) && (!o.batchTxIds.length || typeof o.batchTxIds[0] === "bigint")); + }, + isAmino(o: any): o is EventOutgoingBatchAmino { + return o && (o.$typeUrl === EventOutgoingBatch.typeUrl || typeof o.denom === "string" && typeof o.orchestrator_address === "string" && typeof o.batch_nonce === "bigint" && typeof o.batch_timeout === "bigint" && Array.isArray(o.batch_tx_ids) && (!o.batch_tx_ids.length || typeof o.batch_tx_ids[0] === "bigint")); + }, + encode(message: EventOutgoingBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(24).uint64(message.batchNonce); + } + if (message.batchTimeout !== BigInt(0)) { + writer.uint32(32).uint64(message.batchTimeout); + } + writer.uint32(42).fork(); + for (const v of message.batchTxIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOutgoingBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOutgoingBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + case 3: + message.batchNonce = reader.uint64(); + break; + case 4: + message.batchTimeout = reader.uint64(); + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.batchTxIds.push(reader.uint64()); + } + } else { + message.batchTxIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOutgoingBatch { + const message = createBaseEventOutgoingBatch(); + message.denom = object.denom ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.batchTimeout = object.batchTimeout !== undefined && object.batchTimeout !== null ? BigInt(object.batchTimeout.toString()) : BigInt(0); + message.batchTxIds = object.batchTxIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: EventOutgoingBatchAmino): EventOutgoingBatch { + const message = createBaseEventOutgoingBatch(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.batch_timeout !== undefined && object.batch_timeout !== null) { + message.batchTimeout = BigInt(object.batch_timeout); + } + message.batchTxIds = object.batch_tx_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: EventOutgoingBatch): EventOutgoingBatchAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.batch_timeout = message.batchTimeout !== BigInt(0) ? message.batchTimeout?.toString() : undefined; + if (message.batchTxIds) { + obj.batch_tx_ids = message.batchTxIds.map(e => e.toString()); + } else { + obj.batch_tx_ids = message.batchTxIds; + } + return obj; + }, + fromAminoMsg(object: EventOutgoingBatchAminoMsg): EventOutgoingBatch { + return EventOutgoingBatch.fromAmino(object.value); + }, + fromProtoMsg(message: EventOutgoingBatchProtoMsg): EventOutgoingBatch { + return EventOutgoingBatch.decode(message.value); + }, + toProto(message: EventOutgoingBatch): Uint8Array { + return EventOutgoingBatch.encode(message).finish(); + }, + toProtoMsg(message: EventOutgoingBatch): EventOutgoingBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch", + value: EventOutgoingBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOutgoingBatch.typeUrl, EventOutgoingBatch); +function createBaseEventOutgoingBatchCanceled(): EventOutgoingBatchCanceled { + return { + bridgeContract: "", + bridgeChainId: BigInt(0), + batchId: BigInt(0), + nonce: BigInt(0) + }; +} +export const EventOutgoingBatchCanceled = { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled", + is(o: any): o is EventOutgoingBatchCanceled { + return o && (o.$typeUrl === EventOutgoingBatchCanceled.typeUrl || typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint" && typeof o.batchId === "bigint" && typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is EventOutgoingBatchCanceledAmino { + return o && (o.$typeUrl === EventOutgoingBatchCanceled.typeUrl || typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint" && typeof o.batch_id === "bigint" && typeof o.nonce === "bigint"); + }, + encode(message: EventOutgoingBatchCanceled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bridgeContract !== "") { + writer.uint32(10).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(16).uint64(message.bridgeChainId); + } + if (message.batchId !== BigInt(0)) { + writer.uint32(24).uint64(message.batchId); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(32).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOutgoingBatchCanceled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOutgoingBatchCanceled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bridgeContract = reader.string(); + break; + case 2: + message.bridgeChainId = reader.uint64(); + break; + case 3: + message.batchId = reader.uint64(); + break; + case 4: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOutgoingBatchCanceled { + const message = createBaseEventOutgoingBatchCanceled(); + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.batchId = object.batchId !== undefined && object.batchId !== null ? BigInt(object.batchId.toString()) : BigInt(0); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventOutgoingBatchCanceledAmino): EventOutgoingBatchCanceled { + const message = createBaseEventOutgoingBatchCanceled(); + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.batch_id !== undefined && object.batch_id !== null) { + message.batchId = BigInt(object.batch_id); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: EventOutgoingBatchCanceled): EventOutgoingBatchCanceledAmino { + const obj: any = {}; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.batch_id = message.batchId !== BigInt(0) ? message.batchId?.toString() : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventOutgoingBatchCanceledAminoMsg): EventOutgoingBatchCanceled { + return EventOutgoingBatchCanceled.fromAmino(object.value); + }, + fromProtoMsg(message: EventOutgoingBatchCanceledProtoMsg): EventOutgoingBatchCanceled { + return EventOutgoingBatchCanceled.decode(message.value); + }, + toProto(message: EventOutgoingBatchCanceled): Uint8Array { + return EventOutgoingBatchCanceled.encode(message).finish(); + }, + toProtoMsg(message: EventOutgoingBatchCanceled): EventOutgoingBatchCanceledProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled", + value: EventOutgoingBatchCanceled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOutgoingBatchCanceled.typeUrl, EventOutgoingBatchCanceled); +function createBaseEventValsetUpdateRequest(): EventValsetUpdateRequest { + return { + valsetNonce: BigInt(0), + valsetHeight: BigInt(0), + valsetMembers: [], + rewardAmount: "", + rewardToken: "" + }; +} +export const EventValsetUpdateRequest = { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest", + is(o: any): o is EventValsetUpdateRequest { + return o && (o.$typeUrl === EventValsetUpdateRequest.typeUrl || typeof o.valsetNonce === "bigint" && typeof o.valsetHeight === "bigint" && Array.isArray(o.valsetMembers) && (!o.valsetMembers.length || BridgeValidator.is(o.valsetMembers[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string"); + }, + isAmino(o: any): o is EventValsetUpdateRequestAmino { + return o && (o.$typeUrl === EventValsetUpdateRequest.typeUrl || typeof o.valset_nonce === "bigint" && typeof o.valset_height === "bigint" && Array.isArray(o.valset_members) && (!o.valset_members.length || BridgeValidator.isAmino(o.valset_members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string"); + }, + encode(message: EventValsetUpdateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.valsetNonce); + } + if (message.valsetHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetHeight); + } + for (const v of message.valsetMembers) { + BridgeValidator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(34).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(42).string(message.rewardToken); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetUpdateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsetNonce = reader.uint64(); + break; + case 2: + message.valsetHeight = reader.uint64(); + break; + case 3: + message.valsetMembers.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 4: + message.rewardAmount = reader.string(); + break; + case 5: + message.rewardToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetUpdateRequest { + const message = createBaseEventValsetUpdateRequest(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.valsetHeight = object.valsetHeight !== undefined && object.valsetHeight !== null ? BigInt(object.valsetHeight.toString()) : BigInt(0); + message.valsetMembers = object.valsetMembers?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + return message; + }, + fromAmino(object: EventValsetUpdateRequestAmino): EventValsetUpdateRequest { + const message = createBaseEventValsetUpdateRequest(); + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.valset_height !== undefined && object.valset_height !== null) { + message.valsetHeight = BigInt(object.valset_height); + } + message.valsetMembers = object.valset_members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + return message; + }, + toAmino(message: EventValsetUpdateRequest): EventValsetUpdateRequestAmino { + const obj: any = {}; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.valset_height = message.valsetHeight !== BigInt(0) ? message.valsetHeight?.toString() : undefined; + if (message.valsetMembers) { + obj.valset_members = message.valsetMembers.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.valset_members = message.valsetMembers; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + return obj; + }, + fromAminoMsg(object: EventValsetUpdateRequestAminoMsg): EventValsetUpdateRequest { + return EventValsetUpdateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetUpdateRequestProtoMsg): EventValsetUpdateRequest { + return EventValsetUpdateRequest.decode(message.value); + }, + toProto(message: EventValsetUpdateRequest): Uint8Array { + return EventValsetUpdateRequest.encode(message).finish(); + }, + toProtoMsg(message: EventValsetUpdateRequest): EventValsetUpdateRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest", + value: EventValsetUpdateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetUpdateRequest.typeUrl, EventValsetUpdateRequest); +function createBaseEventSetOrchestratorAddresses(): EventSetOrchestratorAddresses { + return { + validatorAddress: "", + orchestratorAddress: "", + operatorEthAddress: "" + }; +} +export const EventSetOrchestratorAddresses = { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses", + is(o: any): o is EventSetOrchestratorAddresses { + return o && (o.$typeUrl === EventSetOrchestratorAddresses.typeUrl || typeof o.validatorAddress === "string" && typeof o.orchestratorAddress === "string" && typeof o.operatorEthAddress === "string"); + }, + isAmino(o: any): o is EventSetOrchestratorAddressesAmino { + return o && (o.$typeUrl === EventSetOrchestratorAddresses.typeUrl || typeof o.validator_address === "string" && typeof o.orchestrator_address === "string" && typeof o.operator_eth_address === "string"); + }, + encode(message: EventSetOrchestratorAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + if (message.operatorEthAddress !== "") { + writer.uint32(26).string(message.operatorEthAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetOrchestratorAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetOrchestratorAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + case 3: + message.operatorEthAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetOrchestratorAddresses { + const message = createBaseEventSetOrchestratorAddresses(); + message.validatorAddress = object.validatorAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.operatorEthAddress = object.operatorEthAddress ?? ""; + return message; + }, + fromAmino(object: EventSetOrchestratorAddressesAmino): EventSetOrchestratorAddresses { + const message = createBaseEventSetOrchestratorAddresses(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.operator_eth_address !== undefined && object.operator_eth_address !== null) { + message.operatorEthAddress = object.operator_eth_address; + } + return message; + }, + toAmino(message: EventSetOrchestratorAddresses): EventSetOrchestratorAddressesAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.operator_eth_address = message.operatorEthAddress === "" ? undefined : message.operatorEthAddress; + return obj; + }, + fromAminoMsg(object: EventSetOrchestratorAddressesAminoMsg): EventSetOrchestratorAddresses { + return EventSetOrchestratorAddresses.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetOrchestratorAddressesProtoMsg): EventSetOrchestratorAddresses { + return EventSetOrchestratorAddresses.decode(message.value); + }, + toProto(message: EventSetOrchestratorAddresses): Uint8Array { + return EventSetOrchestratorAddresses.encode(message).finish(); + }, + toProtoMsg(message: EventSetOrchestratorAddresses): EventSetOrchestratorAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses", + value: EventSetOrchestratorAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetOrchestratorAddresses.typeUrl, EventSetOrchestratorAddresses); +function createBaseEventValsetConfirm(): EventValsetConfirm { + return { + valsetNonce: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventValsetConfirm = { + typeUrl: "/injective.peggy.v1.EventValsetConfirm", + is(o: any): o is EventValsetConfirm { + return o && (o.$typeUrl === EventValsetConfirm.typeUrl || typeof o.valsetNonce === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventValsetConfirmAmino { + return o && (o.$typeUrl === EventValsetConfirm.typeUrl || typeof o.valset_nonce === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventValsetConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.valsetNonce); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsetNonce = reader.uint64(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetConfirm { + const message = createBaseEventValsetConfirm(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventValsetConfirmAmino): EventValsetConfirm { + const message = createBaseEventValsetConfirm(); + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventValsetConfirm): EventValsetConfirmAmino { + const obj: any = {}; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventValsetConfirmAminoMsg): EventValsetConfirm { + return EventValsetConfirm.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetConfirmProtoMsg): EventValsetConfirm { + return EventValsetConfirm.decode(message.value); + }, + toProto(message: EventValsetConfirm): Uint8Array { + return EventValsetConfirm.encode(message).finish(); + }, + toProtoMsg(message: EventValsetConfirm): EventValsetConfirmProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetConfirm", + value: EventValsetConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetConfirm.typeUrl, EventValsetConfirm); +function createBaseEventSendToEth(): EventSendToEth { + return { + outgoingTxId: BigInt(0), + sender: "", + receiver: "", + amount: "", + bridgeFee: "" + }; +} +export const EventSendToEth = { + typeUrl: "/injective.peggy.v1.EventSendToEth", + is(o: any): o is EventSendToEth { + return o && (o.$typeUrl === EventSendToEth.typeUrl || typeof o.outgoingTxId === "bigint" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.amount === "string" && typeof o.bridgeFee === "string"); + }, + isAmino(o: any): o is EventSendToEthAmino { + return o && (o.$typeUrl === EventSendToEth.typeUrl || typeof o.outgoing_tx_id === "bigint" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.amount === "string" && typeof o.bridge_fee === "string"); + }, + encode(message: EventSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.outgoingTxId !== BigInt(0)) { + writer.uint32(8).uint64(message.outgoingTxId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(26).string(message.receiver); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.bridgeFee !== "") { + writer.uint32(42).string(message.bridgeFee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outgoingTxId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.receiver = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.bridgeFee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSendToEth { + const message = createBaseEventSendToEth(); + message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? BigInt(object.outgoingTxId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.amount = object.amount ?? ""; + message.bridgeFee = object.bridgeFee ?? ""; + return message; + }, + fromAmino(object: EventSendToEthAmino): EventSendToEth { + const message = createBaseEventSendToEth(); + if (object.outgoing_tx_id !== undefined && object.outgoing_tx_id !== null) { + message.outgoingTxId = BigInt(object.outgoing_tx_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.bridge_fee !== undefined && object.bridge_fee !== null) { + message.bridgeFee = object.bridge_fee; + } + return message; + }, + toAmino(message: EventSendToEth): EventSendToEthAmino { + const obj: any = {}; + obj.outgoing_tx_id = message.outgoingTxId !== BigInt(0) ? message.outgoingTxId?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.bridge_fee = message.bridgeFee === "" ? undefined : message.bridgeFee; + return obj; + }, + fromAminoMsg(object: EventSendToEthAminoMsg): EventSendToEth { + return EventSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: EventSendToEthProtoMsg): EventSendToEth { + return EventSendToEth.decode(message.value); + }, + toProto(message: EventSendToEth): Uint8Array { + return EventSendToEth.encode(message).finish(); + }, + toProtoMsg(message: EventSendToEth): EventSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSendToEth", + value: EventSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSendToEth.typeUrl, EventSendToEth); +function createBaseEventConfirmBatch(): EventConfirmBatch { + return { + batchNonce: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventConfirmBatch = { + typeUrl: "/injective.peggy.v1.EventConfirmBatch", + is(o: any): o is EventConfirmBatch { + return o && (o.$typeUrl === EventConfirmBatch.typeUrl || typeof o.batchNonce === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventConfirmBatchAmino { + return o && (o.$typeUrl === EventConfirmBatch.typeUrl || typeof o.batch_nonce === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventConfirmBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.batchNonce); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConfirmBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConfirmBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchNonce = reader.uint64(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConfirmBatch { + const message = createBaseEventConfirmBatch(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventConfirmBatchAmino): EventConfirmBatch { + const message = createBaseEventConfirmBatch(); + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventConfirmBatch): EventConfirmBatchAmino { + const obj: any = {}; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventConfirmBatchAminoMsg): EventConfirmBatch { + return EventConfirmBatch.fromAmino(object.value); + }, + fromProtoMsg(message: EventConfirmBatchProtoMsg): EventConfirmBatch { + return EventConfirmBatch.decode(message.value); + }, + toProto(message: EventConfirmBatch): Uint8Array { + return EventConfirmBatch.encode(message).finish(); + }, + toProtoMsg(message: EventConfirmBatch): EventConfirmBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventConfirmBatch", + value: EventConfirmBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConfirmBatch.typeUrl, EventConfirmBatch); +function createBaseEventAttestationVote(): EventAttestationVote { + return { + eventNonce: BigInt(0), + attestationId: new Uint8Array(), + voter: "" + }; +} +export const EventAttestationVote = { + typeUrl: "/injective.peggy.v1.EventAttestationVote", + is(o: any): o is EventAttestationVote { + return o && (o.$typeUrl === EventAttestationVote.typeUrl || typeof o.eventNonce === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.voter === "string"); + }, + isAmino(o: any): o is EventAttestationVoteAmino { + return o && (o.$typeUrl === EventAttestationVote.typeUrl || typeof o.event_nonce === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.voter === "string"); + }, + encode(message: EventAttestationVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.attestationId.length !== 0) { + writer.uint32(18).bytes(message.attestationId); + } + if (message.voter !== "") { + writer.uint32(26).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttestationVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttestationVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.attestationId = reader.bytes(); + break; + case 3: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttestationVote { + const message = createBaseEventAttestationVote(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: EventAttestationVoteAmino): EventAttestationVote { + const message = createBaseEventAttestationVote(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: EventAttestationVote): EventAttestationVoteAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: EventAttestationVoteAminoMsg): EventAttestationVote { + return EventAttestationVote.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttestationVoteProtoMsg): EventAttestationVote { + return EventAttestationVote.decode(message.value); + }, + toProto(message: EventAttestationVote): Uint8Array { + return EventAttestationVote.encode(message).finish(); + }, + toProtoMsg(message: EventAttestationVote): EventAttestationVoteProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventAttestationVote", + value: EventAttestationVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttestationVote.typeUrl, EventAttestationVote); +function createBaseEventDepositClaim(): EventDepositClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + ethereumSender: "", + cosmosReceiver: "", + tokenContract: "", + amount: "", + orchestratorAddress: "", + data: "" + }; +} +export const EventDepositClaim = { + typeUrl: "/injective.peggy.v1.EventDepositClaim", + is(o: any): o is EventDepositClaim { + return o && (o.$typeUrl === EventDepositClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.ethereumSender === "string" && typeof o.cosmosReceiver === "string" && typeof o.tokenContract === "string" && typeof o.amount === "string" && typeof o.orchestratorAddress === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is EventDepositClaimAmino { + return o && (o.$typeUrl === EventDepositClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.ethereum_sender === "string" && typeof o.cosmos_receiver === "string" && typeof o.token_contract === "string" && typeof o.amount === "string" && typeof o.orchestrator_address === "string" && typeof o.data === "string"); + }, + encode(message: EventDepositClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.ethereumSender !== "") { + writer.uint32(34).string(message.ethereumSender); + } + if (message.cosmosReceiver !== "") { + writer.uint32(42).string(message.cosmosReceiver); + } + if (message.tokenContract !== "") { + writer.uint32(50).string(message.tokenContract); + } + if (message.amount !== "") { + writer.uint32(58).string(message.amount); + } + if (message.orchestratorAddress !== "") { + writer.uint32(66).string(message.orchestratorAddress); + } + if (message.data !== "") { + writer.uint32(74).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventDepositClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventDepositClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.ethereumSender = reader.string(); + break; + case 5: + message.cosmosReceiver = reader.string(); + break; + case 6: + message.tokenContract = reader.string(); + break; + case 7: + message.amount = reader.string(); + break; + case 8: + message.orchestratorAddress = reader.string(); + break; + case 9: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventDepositClaim { + const message = createBaseEventDepositClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.ethereumSender = object.ethereumSender ?? ""; + message.cosmosReceiver = object.cosmosReceiver ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.amount = object.amount ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: EventDepositClaimAmino): EventDepositClaim { + const message = createBaseEventDepositClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.ethereum_sender !== undefined && object.ethereum_sender !== null) { + message.ethereumSender = object.ethereum_sender; + } + if (object.cosmos_receiver !== undefined && object.cosmos_receiver !== null) { + message.cosmosReceiver = object.cosmos_receiver; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: EventDepositClaim): EventDepositClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.ethereum_sender = message.ethereumSender === "" ? undefined : message.ethereumSender; + obj.cosmos_receiver = message.cosmosReceiver === "" ? undefined : message.cosmosReceiver; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: EventDepositClaimAminoMsg): EventDepositClaim { + return EventDepositClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventDepositClaimProtoMsg): EventDepositClaim { + return EventDepositClaim.decode(message.value); + }, + toProto(message: EventDepositClaim): Uint8Array { + return EventDepositClaim.encode(message).finish(); + }, + toProtoMsg(message: EventDepositClaim): EventDepositClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventDepositClaim", + value: EventDepositClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventDepositClaim.typeUrl, EventDepositClaim); +function createBaseEventWithdrawClaim(): EventWithdrawClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + batchNonce: BigInt(0), + tokenContract: "", + orchestratorAddress: "" + }; +} +export const EventWithdrawClaim = { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim", + is(o: any): o is EventWithdrawClaim { + return o && (o.$typeUrl === EventWithdrawClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.batchNonce === "bigint" && typeof o.tokenContract === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventWithdrawClaimAmino { + return o && (o.$typeUrl === EventWithdrawClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.batch_nonce === "bigint" && typeof o.token_contract === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventWithdrawClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(32).uint64(message.batchNonce); + } + if (message.tokenContract !== "") { + writer.uint32(42).string(message.tokenContract); + } + if (message.orchestratorAddress !== "") { + writer.uint32(50).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.batchNonce = reader.uint64(); + break; + case 5: + message.tokenContract = reader.string(); + break; + case 6: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventWithdrawClaim { + const message = createBaseEventWithdrawClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventWithdrawClaimAmino): EventWithdrawClaim { + const message = createBaseEventWithdrawClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventWithdrawClaim): EventWithdrawClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventWithdrawClaimAminoMsg): EventWithdrawClaim { + return EventWithdrawClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventWithdrawClaimProtoMsg): EventWithdrawClaim { + return EventWithdrawClaim.decode(message.value); + }, + toProto(message: EventWithdrawClaim): Uint8Array { + return EventWithdrawClaim.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawClaim): EventWithdrawClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim", + value: EventWithdrawClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventWithdrawClaim.typeUrl, EventWithdrawClaim); +function createBaseEventERC20DeployedClaim(): EventERC20DeployedClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + cosmosDenom: "", + tokenContract: "", + name: "", + symbol: "", + decimals: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventERC20DeployedClaim = { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim", + is(o: any): o is EventERC20DeployedClaim { + return o && (o.$typeUrl === EventERC20DeployedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.cosmosDenom === "string" && typeof o.tokenContract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventERC20DeployedClaimAmino { + return o && (o.$typeUrl === EventERC20DeployedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.cosmos_denom === "string" && typeof o.token_contract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventERC20DeployedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.cosmosDenom !== "") { + writer.uint32(34).string(message.cosmosDenom); + } + if (message.tokenContract !== "") { + writer.uint32(42).string(message.tokenContract); + } + if (message.name !== "") { + writer.uint32(50).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(58).string(message.symbol); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(64).uint64(message.decimals); + } + if (message.orchestratorAddress !== "") { + writer.uint32(74).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventERC20DeployedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventERC20DeployedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.cosmosDenom = reader.string(); + break; + case 5: + message.tokenContract = reader.string(); + break; + case 6: + message.name = reader.string(); + break; + case 7: + message.symbol = reader.string(); + break; + case 8: + message.decimals = reader.uint64(); + break; + case 9: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventERC20DeployedClaim { + const message = createBaseEventERC20DeployedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.cosmosDenom = object.cosmosDenom ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventERC20DeployedClaimAmino): EventERC20DeployedClaim { + const message = createBaseEventERC20DeployedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.cosmos_denom !== undefined && object.cosmos_denom !== null) { + message.cosmosDenom = object.cosmos_denom; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventERC20DeployedClaim): EventERC20DeployedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.cosmos_denom = message.cosmosDenom === "" ? undefined : message.cosmosDenom; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventERC20DeployedClaimAminoMsg): EventERC20DeployedClaim { + return EventERC20DeployedClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventERC20DeployedClaimProtoMsg): EventERC20DeployedClaim { + return EventERC20DeployedClaim.decode(message.value); + }, + toProto(message: EventERC20DeployedClaim): Uint8Array { + return EventERC20DeployedClaim.encode(message).finish(); + }, + toProtoMsg(message: EventERC20DeployedClaim): EventERC20DeployedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim", + value: EventERC20DeployedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventERC20DeployedClaim.typeUrl, EventERC20DeployedClaim); +function createBaseEventValsetUpdateClaim(): EventValsetUpdateClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + valsetNonce: BigInt(0), + valsetMembers: [], + rewardAmount: "", + rewardToken: "", + orchestratorAddress: "" + }; +} +export const EventValsetUpdateClaim = { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim", + is(o: any): o is EventValsetUpdateClaim { + return o && (o.$typeUrl === EventValsetUpdateClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.valsetNonce === "bigint" && Array.isArray(o.valsetMembers) && (!o.valsetMembers.length || BridgeValidator.is(o.valsetMembers[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventValsetUpdateClaimAmino { + return o && (o.$typeUrl === EventValsetUpdateClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.valset_nonce === "bigint" && Array.isArray(o.valset_members) && (!o.valset_members.length || BridgeValidator.isAmino(o.valset_members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventValsetUpdateClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(32).uint64(message.valsetNonce); + } + for (const v of message.valsetMembers) { + BridgeValidator.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(50).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(58).string(message.rewardToken); + } + if (message.orchestratorAddress !== "") { + writer.uint32(66).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetUpdateClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetUpdateClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.valsetNonce = reader.uint64(); + break; + case 5: + message.valsetMembers.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 6: + message.rewardAmount = reader.string(); + break; + case 7: + message.rewardToken = reader.string(); + break; + case 8: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetUpdateClaim { + const message = createBaseEventValsetUpdateClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.valsetMembers = object.valsetMembers?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventValsetUpdateClaimAmino): EventValsetUpdateClaim { + const message = createBaseEventValsetUpdateClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + message.valsetMembers = object.valset_members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventValsetUpdateClaim): EventValsetUpdateClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + if (message.valsetMembers) { + obj.valset_members = message.valsetMembers.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.valset_members = message.valsetMembers; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventValsetUpdateClaimAminoMsg): EventValsetUpdateClaim { + return EventValsetUpdateClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetUpdateClaimProtoMsg): EventValsetUpdateClaim { + return EventValsetUpdateClaim.decode(message.value); + }, + toProto(message: EventValsetUpdateClaim): Uint8Array { + return EventValsetUpdateClaim.encode(message).finish(); + }, + toProtoMsg(message: EventValsetUpdateClaim): EventValsetUpdateClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim", + value: EventValsetUpdateClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetUpdateClaim.typeUrl, EventValsetUpdateClaim); +function createBaseEventCancelSendToEth(): EventCancelSendToEth { + return { + outgoingTxId: BigInt(0) + }; +} +export const EventCancelSendToEth = { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth", + is(o: any): o is EventCancelSendToEth { + return o && (o.$typeUrl === EventCancelSendToEth.typeUrl || typeof o.outgoingTxId === "bigint"); + }, + isAmino(o: any): o is EventCancelSendToEthAmino { + return o && (o.$typeUrl === EventCancelSendToEth.typeUrl || typeof o.outgoing_tx_id === "bigint"); + }, + encode(message: EventCancelSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.outgoingTxId !== BigInt(0)) { + writer.uint32(8).uint64(message.outgoingTxId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outgoingTxId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelSendToEth { + const message = createBaseEventCancelSendToEth(); + message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? BigInt(object.outgoingTxId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventCancelSendToEthAmino): EventCancelSendToEth { + const message = createBaseEventCancelSendToEth(); + if (object.outgoing_tx_id !== undefined && object.outgoing_tx_id !== null) { + message.outgoingTxId = BigInt(object.outgoing_tx_id); + } + return message; + }, + toAmino(message: EventCancelSendToEth): EventCancelSendToEthAmino { + const obj: any = {}; + obj.outgoing_tx_id = message.outgoingTxId !== BigInt(0) ? message.outgoingTxId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelSendToEthAminoMsg): EventCancelSendToEth { + return EventCancelSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelSendToEthProtoMsg): EventCancelSendToEth { + return EventCancelSendToEth.decode(message.value); + }, + toProto(message: EventCancelSendToEth): Uint8Array { + return EventCancelSendToEth.encode(message).finish(); + }, + toProtoMsg(message: EventCancelSendToEth): EventCancelSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth", + value: EventCancelSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelSendToEth.typeUrl, EventCancelSendToEth); +function createBaseEventSubmitBadSignatureEvidence(): EventSubmitBadSignatureEvidence { + return { + badEthSignature: "", + badEthSignatureSubject: "" + }; +} +export const EventSubmitBadSignatureEvidence = { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence", + is(o: any): o is EventSubmitBadSignatureEvidence { + return o && (o.$typeUrl === EventSubmitBadSignatureEvidence.typeUrl || typeof o.badEthSignature === "string" && typeof o.badEthSignatureSubject === "string"); + }, + isAmino(o: any): o is EventSubmitBadSignatureEvidenceAmino { + return o && (o.$typeUrl === EventSubmitBadSignatureEvidence.typeUrl || typeof o.bad_eth_signature === "string" && typeof o.bad_eth_signature_subject === "string"); + }, + encode(message: EventSubmitBadSignatureEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.badEthSignature !== "") { + writer.uint32(10).string(message.badEthSignature); + } + if (message.badEthSignatureSubject !== "") { + writer.uint32(18).string(message.badEthSignatureSubject); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitBadSignatureEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubmitBadSignatureEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.badEthSignature = reader.string(); + break; + case 2: + message.badEthSignatureSubject = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubmitBadSignatureEvidence { + const message = createBaseEventSubmitBadSignatureEvidence(); + message.badEthSignature = object.badEthSignature ?? ""; + message.badEthSignatureSubject = object.badEthSignatureSubject ?? ""; + return message; + }, + fromAmino(object: EventSubmitBadSignatureEvidenceAmino): EventSubmitBadSignatureEvidence { + const message = createBaseEventSubmitBadSignatureEvidence(); + if (object.bad_eth_signature !== undefined && object.bad_eth_signature !== null) { + message.badEthSignature = object.bad_eth_signature; + } + if (object.bad_eth_signature_subject !== undefined && object.bad_eth_signature_subject !== null) { + message.badEthSignatureSubject = object.bad_eth_signature_subject; + } + return message; + }, + toAmino(message: EventSubmitBadSignatureEvidence): EventSubmitBadSignatureEvidenceAmino { + const obj: any = {}; + obj.bad_eth_signature = message.badEthSignature === "" ? undefined : message.badEthSignature; + obj.bad_eth_signature_subject = message.badEthSignatureSubject === "" ? undefined : message.badEthSignatureSubject; + return obj; + }, + fromAminoMsg(object: EventSubmitBadSignatureEvidenceAminoMsg): EventSubmitBadSignatureEvidence { + return EventSubmitBadSignatureEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubmitBadSignatureEvidenceProtoMsg): EventSubmitBadSignatureEvidence { + return EventSubmitBadSignatureEvidence.decode(message.value); + }, + toProto(message: EventSubmitBadSignatureEvidence): Uint8Array { + return EventSubmitBadSignatureEvidence.encode(message).finish(); + }, + toProtoMsg(message: EventSubmitBadSignatureEvidence): EventSubmitBadSignatureEvidenceProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence", + value: EventSubmitBadSignatureEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubmitBadSignatureEvidence.typeUrl, EventSubmitBadSignatureEvidence); +function createBaseEventValidatorSlash(): EventValidatorSlash { + return { + power: BigInt(0), + reason: "", + consensusAddress: "", + operatorAddress: "", + moniker: "" + }; +} +export const EventValidatorSlash = { + typeUrl: "/injective.peggy.v1.EventValidatorSlash", + is(o: any): o is EventValidatorSlash { + return o && (o.$typeUrl === EventValidatorSlash.typeUrl || typeof o.power === "bigint" && typeof o.reason === "string" && typeof o.consensusAddress === "string" && typeof o.operatorAddress === "string" && typeof o.moniker === "string"); + }, + isAmino(o: any): o is EventValidatorSlashAmino { + return o && (o.$typeUrl === EventValidatorSlash.typeUrl || typeof o.power === "bigint" && typeof o.reason === "string" && typeof o.consensus_address === "string" && typeof o.operator_address === "string" && typeof o.moniker === "string"); + }, + encode(message: EventValidatorSlash, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.power !== BigInt(0)) { + writer.uint32(8).int64(message.power); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + if (message.consensusAddress !== "") { + writer.uint32(26).string(message.consensusAddress); + } + if (message.operatorAddress !== "") { + writer.uint32(34).string(message.operatorAddress); + } + if (message.moniker !== "") { + writer.uint32(42).string(message.moniker); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValidatorSlash { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValidatorSlash(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.power = reader.int64(); + break; + case 2: + message.reason = reader.string(); + break; + case 3: + message.consensusAddress = reader.string(); + break; + case 4: + message.operatorAddress = reader.string(); + break; + case 5: + message.moniker = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValidatorSlash { + const message = createBaseEventValidatorSlash(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + message.reason = object.reason ?? ""; + message.consensusAddress = object.consensusAddress ?? ""; + message.operatorAddress = object.operatorAddress ?? ""; + message.moniker = object.moniker ?? ""; + return message; + }, + fromAmino(object: EventValidatorSlashAmino): EventValidatorSlash { + const message = createBaseEventValidatorSlash(); + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + if (object.consensus_address !== undefined && object.consensus_address !== null) { + message.consensusAddress = object.consensus_address; + } + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + return message; + }, + toAmino(message: EventValidatorSlash): EventValidatorSlashAmino { + const obj: any = {}; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + obj.reason = message.reason === "" ? undefined : message.reason; + obj.consensus_address = message.consensusAddress === "" ? undefined : message.consensusAddress; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + return obj; + }, + fromAminoMsg(object: EventValidatorSlashAminoMsg): EventValidatorSlash { + return EventValidatorSlash.fromAmino(object.value); + }, + fromProtoMsg(message: EventValidatorSlashProtoMsg): EventValidatorSlash { + return EventValidatorSlash.decode(message.value); + }, + toProto(message: EventValidatorSlash): Uint8Array { + return EventValidatorSlash.encode(message).finish(); + }, + toProtoMsg(message: EventValidatorSlash): EventValidatorSlashProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValidatorSlash", + value: EventValidatorSlash.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValidatorSlash.typeUrl, EventValidatorSlash); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/genesis.ts b/libs/injective-query/src/injective/peggy/v1/genesis.ts new file mode 100644 index 00000000..d26c2e15 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/genesis.ts @@ -0,0 +1,308 @@ +import { Params, ParamsAmino } from "./params"; +import { Valset, ValsetAmino, ERC20ToDenom, ERC20ToDenomAmino } from "./types"; +import { MsgValsetConfirm, MsgValsetConfirmAmino, MsgConfirmBatch, MsgConfirmBatchAmino, MsgSetOrchestratorAddresses, MsgSetOrchestratorAddressesAmino } from "./msgs"; +import { OutgoingTxBatch, OutgoingTxBatchAmino, OutgoingTransferTx, OutgoingTransferTxAmino } from "./batch"; +import { Attestation, AttestationAmino } from "./attestation"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState struct */ +export interface GenesisState { + params?: Params; + lastObservedNonce: bigint; + valsets: Valset[]; + valsetConfirms: MsgValsetConfirm[]; + batches: OutgoingTxBatch[]; + batchConfirms: MsgConfirmBatch[]; + attestations: Attestation[]; + orchestratorAddresses: MsgSetOrchestratorAddresses[]; + erc20ToDenoms: ERC20ToDenom[]; + unbatchedTransfers: OutgoingTransferTx[]; + lastObservedEthereumHeight: bigint; + lastOutgoingBatchId: bigint; + lastOutgoingPoolId: bigint; + lastObservedValset: Valset; + ethereumBlacklist: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.peggy.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState struct */ +export interface GenesisStateAmino { + params?: ParamsAmino; + last_observed_nonce: string; + valsets: ValsetAmino[]; + valset_confirms: MsgValsetConfirmAmino[]; + batches: OutgoingTxBatchAmino[]; + batch_confirms: MsgConfirmBatchAmino[]; + attestations: AttestationAmino[]; + orchestrator_addresses: MsgSetOrchestratorAddressesAmino[]; + erc20_to_denoms: ERC20ToDenomAmino[]; + unbatched_transfers: OutgoingTransferTxAmino[]; + last_observed_ethereum_height: string; + last_outgoing_batch_id: string; + last_outgoing_pool_id: string; + last_observed_valset: ValsetAmino; + ethereum_blacklist: string[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.peggy.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: undefined, + lastObservedNonce: BigInt(0), + valsets: [], + valsetConfirms: [], + batches: [], + batchConfirms: [], + attestations: [], + orchestratorAddresses: [], + erc20ToDenoms: [], + unbatchedTransfers: [], + lastObservedEthereumHeight: BigInt(0), + lastOutgoingBatchId: BigInt(0), + lastOutgoingPoolId: BigInt(0), + lastObservedValset: Valset.fromPartial({}), + ethereumBlacklist: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.peggy.v1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.lastObservedNonce === "bigint" && Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0])) && Array.isArray(o.valsetConfirms) && (!o.valsetConfirms.length || MsgValsetConfirm.is(o.valsetConfirms[0])) && Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.is(o.batches[0])) && Array.isArray(o.batchConfirms) && (!o.batchConfirms.length || MsgConfirmBatch.is(o.batchConfirms[0])) && Array.isArray(o.attestations) && (!o.attestations.length || Attestation.is(o.attestations[0])) && Array.isArray(o.orchestratorAddresses) && (!o.orchestratorAddresses.length || MsgSetOrchestratorAddresses.is(o.orchestratorAddresses[0])) && Array.isArray(o.erc20ToDenoms) && (!o.erc20ToDenoms.length || ERC20ToDenom.is(o.erc20ToDenoms[0])) && Array.isArray(o.unbatchedTransfers) && (!o.unbatchedTransfers.length || OutgoingTransferTx.is(o.unbatchedTransfers[0])) && typeof o.lastObservedEthereumHeight === "bigint" && typeof o.lastOutgoingBatchId === "bigint" && typeof o.lastOutgoingPoolId === "bigint" && Valset.is(o.lastObservedValset) && Array.isArray(o.ethereumBlacklist) && (!o.ethereumBlacklist.length || typeof o.ethereumBlacklist[0] === "string")); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.last_observed_nonce === "bigint" && Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0])) && Array.isArray(o.valset_confirms) && (!o.valset_confirms.length || MsgValsetConfirm.isAmino(o.valset_confirms[0])) && Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.isAmino(o.batches[0])) && Array.isArray(o.batch_confirms) && (!o.batch_confirms.length || MsgConfirmBatch.isAmino(o.batch_confirms[0])) && Array.isArray(o.attestations) && (!o.attestations.length || Attestation.isAmino(o.attestations[0])) && Array.isArray(o.orchestrator_addresses) && (!o.orchestrator_addresses.length || MsgSetOrchestratorAddresses.isAmino(o.orchestrator_addresses[0])) && Array.isArray(o.erc20_to_denoms) && (!o.erc20_to_denoms.length || ERC20ToDenom.isAmino(o.erc20_to_denoms[0])) && Array.isArray(o.unbatched_transfers) && (!o.unbatched_transfers.length || OutgoingTransferTx.isAmino(o.unbatched_transfers[0])) && typeof o.last_observed_ethereum_height === "bigint" && typeof o.last_outgoing_batch_id === "bigint" && typeof o.last_outgoing_pool_id === "bigint" && Valset.isAmino(o.last_observed_valset) && Array.isArray(o.ethereum_blacklist) && (!o.ethereum_blacklist.length || typeof o.ethereum_blacklist[0] === "string")); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.lastObservedNonce !== BigInt(0)) { + writer.uint32(16).uint64(message.lastObservedNonce); + } + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.valsetConfirms) { + MsgValsetConfirm.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.batches) { + OutgoingTxBatch.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.batchConfirms) { + MsgConfirmBatch.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.attestations) { + Attestation.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.orchestratorAddresses) { + MsgSetOrchestratorAddresses.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.erc20ToDenoms) { + ERC20ToDenom.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.unbatchedTransfers) { + OutgoingTransferTx.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.lastObservedEthereumHeight !== BigInt(0)) { + writer.uint32(88).uint64(message.lastObservedEthereumHeight); + } + if (message.lastOutgoingBatchId !== BigInt(0)) { + writer.uint32(96).uint64(message.lastOutgoingBatchId); + } + if (message.lastOutgoingPoolId !== BigInt(0)) { + writer.uint32(104).uint64(message.lastOutgoingPoolId); + } + if (message.lastObservedValset !== undefined) { + Valset.encode(message.lastObservedValset, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.ethereumBlacklist) { + writer.uint32(122).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.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.lastObservedNonce = reader.uint64(); + break; + case 3: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + case 4: + message.valsetConfirms.push(MsgValsetConfirm.decode(reader, reader.uint32())); + break; + case 5: + message.batches.push(OutgoingTxBatch.decode(reader, reader.uint32())); + break; + case 6: + message.batchConfirms.push(MsgConfirmBatch.decode(reader, reader.uint32())); + break; + case 7: + message.attestations.push(Attestation.decode(reader, reader.uint32())); + break; + case 8: + message.orchestratorAddresses.push(MsgSetOrchestratorAddresses.decode(reader, reader.uint32())); + break; + case 9: + message.erc20ToDenoms.push(ERC20ToDenom.decode(reader, reader.uint32())); + break; + case 10: + message.unbatchedTransfers.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 11: + message.lastObservedEthereumHeight = reader.uint64(); + break; + case 12: + message.lastOutgoingBatchId = reader.uint64(); + break; + case 13: + message.lastOutgoingPoolId = reader.uint64(); + break; + case 14: + message.lastObservedValset = Valset.decode(reader, reader.uint32()); + break; + case 15: + message.ethereumBlacklist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.lastObservedNonce = object.lastObservedNonce !== undefined && object.lastObservedNonce !== null ? BigInt(object.lastObservedNonce.toString()) : BigInt(0); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + message.valsetConfirms = object.valsetConfirms?.map(e => MsgValsetConfirm.fromPartial(e)) || []; + message.batches = object.batches?.map(e => OutgoingTxBatch.fromPartial(e)) || []; + message.batchConfirms = object.batchConfirms?.map(e => MsgConfirmBatch.fromPartial(e)) || []; + message.attestations = object.attestations?.map(e => Attestation.fromPartial(e)) || []; + message.orchestratorAddresses = object.orchestratorAddresses?.map(e => MsgSetOrchestratorAddresses.fromPartial(e)) || []; + message.erc20ToDenoms = object.erc20ToDenoms?.map(e => ERC20ToDenom.fromPartial(e)) || []; + message.unbatchedTransfers = object.unbatchedTransfers?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.lastObservedEthereumHeight = object.lastObservedEthereumHeight !== undefined && object.lastObservedEthereumHeight !== null ? BigInt(object.lastObservedEthereumHeight.toString()) : BigInt(0); + message.lastOutgoingBatchId = object.lastOutgoingBatchId !== undefined && object.lastOutgoingBatchId !== null ? BigInt(object.lastOutgoingBatchId.toString()) : BigInt(0); + message.lastOutgoingPoolId = object.lastOutgoingPoolId !== undefined && object.lastOutgoingPoolId !== null ? BigInt(object.lastOutgoingPoolId.toString()) : BigInt(0); + message.lastObservedValset = object.lastObservedValset !== undefined && object.lastObservedValset !== null ? Valset.fromPartial(object.lastObservedValset) : undefined; + message.ethereumBlacklist = object.ethereumBlacklist?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_observed_nonce !== undefined && object.last_observed_nonce !== null) { + message.lastObservedNonce = BigInt(object.last_observed_nonce); + } + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + message.valsetConfirms = object.valset_confirms?.map(e => MsgValsetConfirm.fromAmino(e)) || []; + message.batches = object.batches?.map(e => OutgoingTxBatch.fromAmino(e)) || []; + message.batchConfirms = object.batch_confirms?.map(e => MsgConfirmBatch.fromAmino(e)) || []; + message.attestations = object.attestations?.map(e => Attestation.fromAmino(e)) || []; + message.orchestratorAddresses = object.orchestrator_addresses?.map(e => MsgSetOrchestratorAddresses.fromAmino(e)) || []; + message.erc20ToDenoms = object.erc20_to_denoms?.map(e => ERC20ToDenom.fromAmino(e)) || []; + message.unbatchedTransfers = object.unbatched_transfers?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + if (object.last_observed_ethereum_height !== undefined && object.last_observed_ethereum_height !== null) { + message.lastObservedEthereumHeight = BigInt(object.last_observed_ethereum_height); + } + if (object.last_outgoing_batch_id !== undefined && object.last_outgoing_batch_id !== null) { + message.lastOutgoingBatchId = BigInt(object.last_outgoing_batch_id); + } + if (object.last_outgoing_pool_id !== undefined && object.last_outgoing_pool_id !== null) { + message.lastOutgoingPoolId = BigInt(object.last_outgoing_pool_id); + } + if (object.last_observed_valset !== undefined && object.last_observed_valset !== null) { + message.lastObservedValset = Valset.fromAmino(object.last_observed_valset); + } + message.ethereumBlacklist = object.ethereum_blacklist?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.last_observed_nonce = message.lastObservedNonce !== BigInt(0) ? message.lastObservedNonce?.toString() : undefined; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + if (message.valsetConfirms) { + obj.valset_confirms = message.valsetConfirms.map(e => e ? MsgValsetConfirm.toAmino(e) : undefined); + } else { + obj.valset_confirms = message.valsetConfirms; + } + if (message.batches) { + obj.batches = message.batches.map(e => e ? OutgoingTxBatch.toAmino(e) : undefined); + } else { + obj.batches = message.batches; + } + if (message.batchConfirms) { + obj.batch_confirms = message.batchConfirms.map(e => e ? MsgConfirmBatch.toAmino(e) : undefined); + } else { + obj.batch_confirms = message.batchConfirms; + } + if (message.attestations) { + obj.attestations = message.attestations.map(e => e ? Attestation.toAmino(e) : undefined); + } else { + obj.attestations = message.attestations; + } + if (message.orchestratorAddresses) { + obj.orchestrator_addresses = message.orchestratorAddresses.map(e => e ? MsgSetOrchestratorAddresses.toAmino(e) : undefined); + } else { + obj.orchestrator_addresses = message.orchestratorAddresses; + } + if (message.erc20ToDenoms) { + obj.erc20_to_denoms = message.erc20ToDenoms.map(e => e ? ERC20ToDenom.toAmino(e) : undefined); + } else { + obj.erc20_to_denoms = message.erc20ToDenoms; + } + if (message.unbatchedTransfers) { + obj.unbatched_transfers = message.unbatchedTransfers.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.unbatched_transfers = message.unbatchedTransfers; + } + obj.last_observed_ethereum_height = message.lastObservedEthereumHeight !== BigInt(0) ? message.lastObservedEthereumHeight?.toString() : undefined; + obj.last_outgoing_batch_id = message.lastOutgoingBatchId !== BigInt(0) ? message.lastOutgoingBatchId?.toString() : undefined; + obj.last_outgoing_pool_id = message.lastOutgoingPoolId !== BigInt(0) ? message.lastOutgoingPoolId?.toString() : undefined; + obj.last_observed_valset = message.lastObservedValset ? Valset.toAmino(message.lastObservedValset) : undefined; + if (message.ethereumBlacklist) { + obj.ethereum_blacklist = message.ethereumBlacklist.map(e => e); + } else { + obj.ethereum_blacklist = message.ethereumBlacklist; + } + 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: "/injective.peggy.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/msgs.rpc.func.ts b/libs/injective-query/src/injective/peggy/v1/msgs.rpc.func.ts new file mode 100644 index 00000000..6137afa4 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/msgs.rpc.func.ts @@ -0,0 +1,130 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; +export const createValsetConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetConfirm.typeUrl, + encoders: toEncoders(MsgValsetConfirm), + converters: toConverters(MsgValsetConfirm) +}); +export const useValsetConfirm = buildUseMutation({ + builderMutationFn: createValsetConfirm +}); +export const createSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSendToEth.typeUrl, + encoders: toEncoders(MsgSendToEth), + converters: toConverters(MsgSendToEth) +}); +export const useSendToEth = buildUseMutation({ + builderMutationFn: createSendToEth +}); +export const createRequestBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBatch.typeUrl, + encoders: toEncoders(MsgRequestBatch), + converters: toConverters(MsgRequestBatch) +}); +export const useRequestBatch = buildUseMutation({ + builderMutationFn: createRequestBatch +}); +export const createConfirmBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConfirmBatch.typeUrl, + encoders: toEncoders(MsgConfirmBatch), + converters: toConverters(MsgConfirmBatch) +}); +export const useConfirmBatch = buildUseMutation({ + builderMutationFn: createConfirmBatch +}); +export const createDepositClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositClaim.typeUrl, + encoders: toEncoders(MsgDepositClaim), + converters: toConverters(MsgDepositClaim) +}); +export const useDepositClaim = buildUseMutation({ + builderMutationFn: createDepositClaim +}); +export const createWithdrawClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawClaim.typeUrl, + encoders: toEncoders(MsgWithdrawClaim), + converters: toConverters(MsgWithdrawClaim) +}); +export const useWithdrawClaim = buildUseMutation({ + builderMutationFn: createWithdrawClaim +}); +export const createValsetUpdateClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetUpdatedClaim.typeUrl, + encoders: toEncoders(MsgValsetUpdatedClaim), + converters: toConverters(MsgValsetUpdatedClaim) +}); +export const useValsetUpdateClaim = buildUseMutation({ + builderMutationFn: createValsetUpdateClaim +}); +export const createERC20DeployedClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgERC20DeployedClaim.typeUrl, + encoders: toEncoders(MsgERC20DeployedClaim), + converters: toConverters(MsgERC20DeployedClaim) +}); +export const useERC20DeployedClaim = buildUseMutation({ + builderMutationFn: createERC20DeployedClaim +}); +export const createSetOrchestratorAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetOrchestratorAddresses.typeUrl, + encoders: toEncoders(MsgSetOrchestratorAddresses), + converters: toConverters(MsgSetOrchestratorAddresses) +}); +export const useSetOrchestratorAddresses = buildUseMutation({ + builderMutationFn: createSetOrchestratorAddresses +}); +export const createCancelSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSendToEth.typeUrl, + encoders: toEncoders(MsgCancelSendToEth), + converters: toConverters(MsgCancelSendToEth) +}); +export const useCancelSendToEth = buildUseMutation({ + builderMutationFn: createCancelSendToEth +}); +export const createSubmitBadSignatureEvidence = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitBadSignatureEvidence.typeUrl, + encoders: toEncoders(MsgSubmitBadSignatureEvidence), + converters: toConverters(MsgSubmitBadSignatureEvidence) +}); +export const useSubmitBadSignatureEvidence = buildUseMutation({ + builderMutationFn: createSubmitBadSignatureEvidence +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createBlacklistEthereumAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBlacklistEthereumAddresses.typeUrl, + encoders: toEncoders(MsgBlacklistEthereumAddresses), + converters: toConverters(MsgBlacklistEthereumAddresses) +}); +export const useBlacklistEthereumAddresses = buildUseMutation({ + builderMutationFn: createBlacklistEthereumAddresses +}); +export const createRevokeEthereumBlacklist = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeEthereumBlacklist.typeUrl, + encoders: toEncoders(MsgRevokeEthereumBlacklist), + converters: toConverters(MsgRevokeEthereumBlacklist) +}); +export const useRevokeEthereumBlacklist = buildUseMutation({ + builderMutationFn: createRevokeEthereumBlacklist +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/msgs.ts b/libs/injective-query/src/injective/peggy/v1/msgs.ts new file mode 100644 index 00000000..32e90531 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/msgs.ts @@ -0,0 +1,3087 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BridgeValidator, BridgeValidatorAmino } from "./types"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { Params, ParamsAmino } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSetOrchestratorAddresses + * this message allows validators to delegate their voting responsibilities + * to a given key. This key is then used as an optional authentication method + * for sigining oracle claims + * VALIDATOR + * The validator field is a cosmosvaloper1... string (i.e. sdk.ValAddress) + * that references a validator in the active set + * ORCHESTRATOR + * The orchestrator field is a cosmos1... string (i.e. sdk.AccAddress) that + * references the key that is being delegated to + * ETH_ADDRESS + * This is a hex encoded 0x Ethereum public key that will be used by this + * validator on Ethereum + */ +export interface MsgSetOrchestratorAddresses { + sender: string; + orchestrator: string; + ethAddress: string; +} +export interface MsgSetOrchestratorAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses"; + value: Uint8Array; +} +/** + * MsgSetOrchestratorAddresses + * this message allows validators to delegate their voting responsibilities + * to a given key. This key is then used as an optional authentication method + * for sigining oracle claims + * VALIDATOR + * The validator field is a cosmosvaloper1... string (i.e. sdk.ValAddress) + * that references a validator in the active set + * ORCHESTRATOR + * The orchestrator field is a cosmos1... string (i.e. sdk.AccAddress) that + * references the key that is being delegated to + * ETH_ADDRESS + * This is a hex encoded 0x Ethereum public key that will be used by this + * validator on Ethereum + */ +export interface MsgSetOrchestratorAddressesAmino { + sender: string; + orchestrator: string; + eth_address: string; +} +export interface MsgSetOrchestratorAddressesAminoMsg { + type: "peggy/MsgSetOrchestratorAddresses"; + value: MsgSetOrchestratorAddressesAmino; +} +export interface MsgSetOrchestratorAddressesResponse {} +export interface MsgSetOrchestratorAddressesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse"; + value: Uint8Array; +} +export interface MsgSetOrchestratorAddressesResponseAmino {} +export interface MsgSetOrchestratorAddressesResponseAminoMsg { + type: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse"; + value: MsgSetOrchestratorAddressesResponseAmino; +} +/** + * MsgValsetConfirm + * this is the message sent by the validators when they wish to submit their + * signatures over the validator set at a given block height. A validator must + * first call MsgSetEthAddress to set their Ethereum address to be used for + * signing. Then someone (anyone) must make a ValsetRequest the request is + * essentially a messaging mechanism to determine which block all validators + * should submit signatures over. Finally validators sign the validator set, + * powers, and Ethereum addresses of the entire validator set at the height of a + * ValsetRequest and submit that signature with this message. + * + * If a sufficient number of validators (66% of voting power) (A) have set + * Ethereum addresses and (B) submit ValsetConfirm messages with their + * signatures it is then possible for anyone to view these signatures in the + * chain store and submit them to Ethereum to update the validator set + * ------------- + */ +export interface MsgValsetConfirm { + nonce: bigint; + orchestrator: string; + ethAddress: string; + signature: string; +} +export interface MsgValsetConfirmProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm"; + value: Uint8Array; +} +/** + * MsgValsetConfirm + * this is the message sent by the validators when they wish to submit their + * signatures over the validator set at a given block height. A validator must + * first call MsgSetEthAddress to set their Ethereum address to be used for + * signing. Then someone (anyone) must make a ValsetRequest the request is + * essentially a messaging mechanism to determine which block all validators + * should submit signatures over. Finally validators sign the validator set, + * powers, and Ethereum addresses of the entire validator set at the height of a + * ValsetRequest and submit that signature with this message. + * + * If a sufficient number of validators (66% of voting power) (A) have set + * Ethereum addresses and (B) submit ValsetConfirm messages with their + * signatures it is then possible for anyone to view these signatures in the + * chain store and submit them to Ethereum to update the validator set + * ------------- + */ +export interface MsgValsetConfirmAmino { + nonce: string; + orchestrator: string; + eth_address: string; + signature: string; +} +export interface MsgValsetConfirmAminoMsg { + type: "peggy/MsgValsetConfirm"; + value: MsgValsetConfirmAmino; +} +export interface MsgValsetConfirmResponse {} +export interface MsgValsetConfirmResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse"; + value: Uint8Array; +} +export interface MsgValsetConfirmResponseAmino {} +export interface MsgValsetConfirmResponseAminoMsg { + type: "/injective.peggy.v1.MsgValsetConfirmResponse"; + value: MsgValsetConfirmResponseAmino; +} +/** + * MsgSendToEth + * This is the message that a user calls when they want to bridge an asset + * it will later be removed when it is included in a batch and successfully + * submitted tokens are removed from the users balance immediately + * ------------- + * AMOUNT: + * the coin to send across the bridge, note the restriction that this is a + * single coin not a set of coins that is normal in other Cosmos messages + * FEE: + * the fee paid for the bridge, distinct from the fee paid to the chain to + * actually send this message in the first place. So a successful send has + * two layers of fees for the user + */ +export interface MsgSendToEth { + sender: string; + ethDest: string; + amount: Coin; + bridgeFee: Coin; +} +export interface MsgSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSendToEth"; + value: Uint8Array; +} +/** + * MsgSendToEth + * This is the message that a user calls when they want to bridge an asset + * it will later be removed when it is included in a batch and successfully + * submitted tokens are removed from the users balance immediately + * ------------- + * AMOUNT: + * the coin to send across the bridge, note the restriction that this is a + * single coin not a set of coins that is normal in other Cosmos messages + * FEE: + * the fee paid for the bridge, distinct from the fee paid to the chain to + * actually send this message in the first place. So a successful send has + * two layers of fees for the user + */ +export interface MsgSendToEthAmino { + sender: string; + eth_dest: string; + amount: CoinAmino; + bridge_fee: CoinAmino; +} +export interface MsgSendToEthAminoMsg { + type: "peggy/MsgSendToEth"; + value: MsgSendToEthAmino; +} +export interface MsgSendToEthResponse {} +export interface MsgSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse"; + value: Uint8Array; +} +export interface MsgSendToEthResponseAmino {} +export interface MsgSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.MsgSendToEthResponse"; + value: MsgSendToEthResponseAmino; +} +/** + * MsgRequestBatch + * this is a message anyone can send that requests a batch of transactions to + * send across the bridge be created for whatever block height this message is + * included in. This acts as a coordination point, the handler for this message + * looks at the AddToOutgoingPool tx's in the store and generates a batch, also + * available in the store tied to this message. The validators then grab this + * batch, sign it, submit the signatures with a MsgConfirmBatch before a relayer + * can finally submit the batch + * ------------- + */ +export interface MsgRequestBatch { + orchestrator: string; + denom: string; +} +export interface MsgRequestBatchProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRequestBatch"; + value: Uint8Array; +} +/** + * MsgRequestBatch + * this is a message anyone can send that requests a batch of transactions to + * send across the bridge be created for whatever block height this message is + * included in. This acts as a coordination point, the handler for this message + * looks at the AddToOutgoingPool tx's in the store and generates a batch, also + * available in the store tied to this message. The validators then grab this + * batch, sign it, submit the signatures with a MsgConfirmBatch before a relayer + * can finally submit the batch + * ------------- + */ +export interface MsgRequestBatchAmino { + orchestrator: string; + denom: string; +} +export interface MsgRequestBatchAminoMsg { + type: "peggy/MsgRequestBatch"; + value: MsgRequestBatchAmino; +} +export interface MsgRequestBatchResponse {} +export interface MsgRequestBatchResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse"; + value: Uint8Array; +} +export interface MsgRequestBatchResponseAmino {} +export interface MsgRequestBatchResponseAminoMsg { + type: "/injective.peggy.v1.MsgRequestBatchResponse"; + value: MsgRequestBatchResponseAmino; +} +/** + * MsgConfirmBatch + * When validators observe a MsgRequestBatch they form a batch by ordering + * transactions currently in the txqueue in order of highest to lowest fee, + * cutting off when the batch either reaches a hardcoded maximum size (to be + * decided, probably around 100) or when transactions stop being profitable + * (TODO determine this without nondeterminism) This message includes the batch + * as well as an Ethereum signature over this batch by the validator + * ------------- + */ +export interface MsgConfirmBatch { + nonce: bigint; + tokenContract: string; + ethSigner: string; + orchestrator: string; + signature: string; +} +export interface MsgConfirmBatchProtoMsg { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch"; + value: Uint8Array; +} +/** + * MsgConfirmBatch + * When validators observe a MsgRequestBatch they form a batch by ordering + * transactions currently in the txqueue in order of highest to lowest fee, + * cutting off when the batch either reaches a hardcoded maximum size (to be + * decided, probably around 100) or when transactions stop being profitable + * (TODO determine this without nondeterminism) This message includes the batch + * as well as an Ethereum signature over this batch by the validator + * ------------- + */ +export interface MsgConfirmBatchAmino { + nonce: string; + token_contract: string; + eth_signer: string; + orchestrator: string; + signature: string; +} +export interface MsgConfirmBatchAminoMsg { + type: "peggy/MsgConfirmBatch"; + value: MsgConfirmBatchAmino; +} +export interface MsgConfirmBatchResponse {} +export interface MsgConfirmBatchResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse"; + value: Uint8Array; +} +export interface MsgConfirmBatchResponseAmino {} +export interface MsgConfirmBatchResponseAminoMsg { + type: "/injective.peggy.v1.MsgConfirmBatchResponse"; + value: MsgConfirmBatchResponseAmino; +} +/** + * EthereumBridgeDepositClaim + * When more than 66% of the active validator set has + * claimed to have seen the deposit enter the ethereum blockchain coins are + * issued to the Cosmos address in question + * ------------- + */ +export interface MsgDepositClaim { + eventNonce: bigint; + blockHeight: bigint; + tokenContract: string; + amount: string; + ethereumSender: string; + cosmosReceiver: string; + orchestrator: string; + data: string; +} +export interface MsgDepositClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgDepositClaim"; + value: Uint8Array; +} +/** + * EthereumBridgeDepositClaim + * When more than 66% of the active validator set has + * claimed to have seen the deposit enter the ethereum blockchain coins are + * issued to the Cosmos address in question + * ------------- + */ +export interface MsgDepositClaimAmino { + event_nonce: string; + block_height: string; + token_contract: string; + amount: string; + ethereum_sender: string; + cosmos_receiver: string; + orchestrator: string; + data: string; +} +export interface MsgDepositClaimAminoMsg { + type: "peggy/MsgDepositClaim"; + value: MsgDepositClaimAmino; +} +export interface MsgDepositClaimResponse {} +export interface MsgDepositClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse"; + value: Uint8Array; +} +export interface MsgDepositClaimResponseAmino {} +export interface MsgDepositClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgDepositClaimResponse"; + value: MsgDepositClaimResponseAmino; +} +/** + * WithdrawClaim claims that a batch of withdrawal + * operations on the bridge contract was executed. + */ +export interface MsgWithdrawClaim { + eventNonce: bigint; + blockHeight: bigint; + batchNonce: bigint; + tokenContract: string; + orchestrator: string; +} +export interface MsgWithdrawClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim"; + value: Uint8Array; +} +/** + * WithdrawClaim claims that a batch of withdrawal + * operations on the bridge contract was executed. + */ +export interface MsgWithdrawClaimAmino { + event_nonce: string; + block_height: string; + batch_nonce: string; + token_contract: string; + orchestrator: string; +} +export interface MsgWithdrawClaimAminoMsg { + type: "peggy/MsgWithdrawClaim"; + value: MsgWithdrawClaimAmino; +} +export interface MsgWithdrawClaimResponse {} +export interface MsgWithdrawClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse"; + value: Uint8Array; +} +export interface MsgWithdrawClaimResponseAmino {} +export interface MsgWithdrawClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgWithdrawClaimResponse"; + value: MsgWithdrawClaimResponseAmino; +} +/** + * ERC20DeployedClaim allows the Cosmos module + * to learn about an ERC20 that someone deployed + * to represent a Cosmos asset + */ +export interface MsgERC20DeployedClaim { + eventNonce: bigint; + blockHeight: bigint; + cosmosDenom: string; + tokenContract: string; + name: string; + symbol: string; + decimals: bigint; + orchestrator: string; +} +export interface MsgERC20DeployedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim"; + value: Uint8Array; +} +/** + * ERC20DeployedClaim allows the Cosmos module + * to learn about an ERC20 that someone deployed + * to represent a Cosmos asset + */ +export interface MsgERC20DeployedClaimAmino { + event_nonce: string; + block_height: string; + cosmos_denom: string; + token_contract: string; + name: string; + symbol: string; + decimals: string; + orchestrator: string; +} +export interface MsgERC20DeployedClaimAminoMsg { + type: "peggy/MsgERC20DeployedClaim"; + value: MsgERC20DeployedClaimAmino; +} +export interface MsgERC20DeployedClaimResponse {} +export interface MsgERC20DeployedClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse"; + value: Uint8Array; +} +export interface MsgERC20DeployedClaimResponseAmino {} +export interface MsgERC20DeployedClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgERC20DeployedClaimResponse"; + value: MsgERC20DeployedClaimResponseAmino; +} +/** + * This call allows the sender (and only the sender) + * to cancel a given MsgSendToEth and recieve a refund + * of the tokens + */ +export interface MsgCancelSendToEth { + transactionId: bigint; + sender: string; +} +export interface MsgCancelSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth"; + value: Uint8Array; +} +/** + * This call allows the sender (and only the sender) + * to cancel a given MsgSendToEth and recieve a refund + * of the tokens + */ +export interface MsgCancelSendToEthAmino { + transaction_id: string; + sender: string; +} +export interface MsgCancelSendToEthAminoMsg { + type: "peggy/MsgCancelSendToEth"; + value: MsgCancelSendToEthAmino; +} +export interface MsgCancelSendToEthResponse {} +export interface MsgCancelSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse"; + value: Uint8Array; +} +export interface MsgCancelSendToEthResponseAmino {} +export interface MsgCancelSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.MsgCancelSendToEthResponse"; + value: MsgCancelSendToEthResponseAmino; +} +/** + * This call allows anyone to submit evidence that a + * validator has signed a valset, batch, or logic call that never + * existed. Subject contains the batch, valset, or logic call. + */ +export interface MsgSubmitBadSignatureEvidence { + subject?: Any; + signature: string; + sender: string; +} +export interface MsgSubmitBadSignatureEvidenceProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence"; + value: Uint8Array; +} +/** + * This call allows anyone to submit evidence that a + * validator has signed a valset, batch, or logic call that never + * existed. Subject contains the batch, valset, or logic call. + */ +export interface MsgSubmitBadSignatureEvidenceAmino { + subject?: AnyAmino; + signature: string; + sender: string; +} +export interface MsgSubmitBadSignatureEvidenceAminoMsg { + type: "peggy/MsgSubmitBadSignatureEvidence"; + value: MsgSubmitBadSignatureEvidenceAmino; +} +export interface MsgSubmitBadSignatureEvidenceResponse {} +export interface MsgSubmitBadSignatureEvidenceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse"; + value: Uint8Array; +} +export interface MsgSubmitBadSignatureEvidenceResponseAmino {} +export interface MsgSubmitBadSignatureEvidenceResponseAminoMsg { + type: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse"; + value: MsgSubmitBadSignatureEvidenceResponseAmino; +} +/** + * This informs the Cosmos module that a validator + * set has been updated. + */ +export interface MsgValsetUpdatedClaim { + eventNonce: bigint; + valsetNonce: bigint; + blockHeight: bigint; + members: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; + orchestrator: string; +} +export interface MsgValsetUpdatedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim"; + value: Uint8Array; +} +/** + * This informs the Cosmos module that a validator + * set has been updated. + */ +export interface MsgValsetUpdatedClaimAmino { + event_nonce: string; + valset_nonce: string; + block_height: string; + members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; + orchestrator: string; +} +export interface MsgValsetUpdatedClaimAminoMsg { + type: "peggy/MsgValsetUpdatedClaim"; + value: MsgValsetUpdatedClaimAmino; +} +export interface MsgValsetUpdatedClaimResponse {} +export interface MsgValsetUpdatedClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse"; + value: Uint8Array; +} +export interface MsgValsetUpdatedClaimResponseAmino {} +export interface MsgValsetUpdatedClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse"; + value: MsgValsetUpdatedClaimResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the peggy parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.peggy.v1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the peggy parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "peggy/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.peggy.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgBlacklistEthereumAddresses defines the message used to add Ethereum + * addresses to peggy blacklist. + */ +export interface MsgBlacklistEthereumAddresses { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklistAddresses: string[]; +} +export interface MsgBlacklistEthereumAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses"; + value: Uint8Array; +} +/** + * MsgBlacklistEthereumAddresses defines the message used to add Ethereum + * addresses to peggy blacklist. + */ +export interface MsgBlacklistEthereumAddressesAmino { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklist_addresses: string[]; +} +export interface MsgBlacklistEthereumAddressesAminoMsg { + type: "peggy/MsgBlacklistEthereumAddresses"; + value: MsgBlacklistEthereumAddressesAmino; +} +/** + * MsgBlacklistEthereumAddressesResponse defines the + * MsgBlacklistEthereumAddresses response type. + */ +export interface MsgBlacklistEthereumAddressesResponse {} +export interface MsgBlacklistEthereumAddressesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse"; + value: Uint8Array; +} +/** + * MsgBlacklistEthereumAddressesResponse defines the + * MsgBlacklistEthereumAddresses response type. + */ +export interface MsgBlacklistEthereumAddressesResponseAmino {} +export interface MsgBlacklistEthereumAddressesResponseAminoMsg { + type: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse"; + value: MsgBlacklistEthereumAddressesResponseAmino; +} +/** + * MsgRevokeEthereumBlacklist defines the message used to remove Ethereum + * addresses from peggy blacklist. + */ +export interface MsgRevokeEthereumBlacklist { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklistAddresses: string[]; +} +export interface MsgRevokeEthereumBlacklistProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist"; + value: Uint8Array; +} +/** + * MsgRevokeEthereumBlacklist defines the message used to remove Ethereum + * addresses from peggy blacklist. + */ +export interface MsgRevokeEthereumBlacklistAmino { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklist_addresses: string[]; +} +export interface MsgRevokeEthereumBlacklistAminoMsg { + type: "peggy/MsgRevokeEthereumBlacklist"; + value: MsgRevokeEthereumBlacklistAmino; +} +/** + * MsgRevokeEthereumBlacklistResponse defines the MsgRevokeEthereumBlacklist + * response type. + */ +export interface MsgRevokeEthereumBlacklistResponse {} +export interface MsgRevokeEthereumBlacklistResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse"; + value: Uint8Array; +} +/** + * MsgRevokeEthereumBlacklistResponse defines the MsgRevokeEthereumBlacklist + * response type. + */ +export interface MsgRevokeEthereumBlacklistResponseAmino {} +export interface MsgRevokeEthereumBlacklistResponseAminoMsg { + type: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse"; + value: MsgRevokeEthereumBlacklistResponseAmino; +} +function createBaseMsgSetOrchestratorAddresses(): MsgSetOrchestratorAddresses { + return { + sender: "", + orchestrator: "", + ethAddress: "" + }; +} +export const MsgSetOrchestratorAddresses = { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses", + aminoType: "peggy/MsgSetOrchestratorAddresses", + is(o: any): o is MsgSetOrchestratorAddresses { + return o && (o.$typeUrl === MsgSetOrchestratorAddresses.typeUrl || typeof o.sender === "string" && typeof o.orchestrator === "string" && typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is MsgSetOrchestratorAddressesAmino { + return o && (o.$typeUrl === MsgSetOrchestratorAddresses.typeUrl || typeof o.sender === "string" && typeof o.orchestrator === "string" && typeof o.eth_address === "string"); + }, + encode(message: MsgSetOrchestratorAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.orchestrator !== "") { + writer.uint32(18).string(message.orchestrator); + } + if (message.ethAddress !== "") { + writer.uint32(26).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetOrchestratorAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetOrchestratorAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orchestrator = reader.string(); + break; + case 3: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetOrchestratorAddresses { + const message = createBaseMsgSetOrchestratorAddresses(); + message.sender = object.sender ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetOrchestratorAddressesAmino): MsgSetOrchestratorAddresses { + const message = createBaseMsgSetOrchestratorAddresses(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: MsgSetOrchestratorAddressesAminoMsg): MsgSetOrchestratorAddresses { + return MsgSetOrchestratorAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesAminoMsg { + return { + type: "peggy/MsgSetOrchestratorAddresses", + value: MsgSetOrchestratorAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetOrchestratorAddressesProtoMsg): MsgSetOrchestratorAddresses { + return MsgSetOrchestratorAddresses.decode(message.value); + }, + toProto(message: MsgSetOrchestratorAddresses): Uint8Array { + return MsgSetOrchestratorAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses", + value: MsgSetOrchestratorAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetOrchestratorAddresses.typeUrl, MsgSetOrchestratorAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetOrchestratorAddresses.aminoType, MsgSetOrchestratorAddresses.typeUrl); +function createBaseMsgSetOrchestratorAddressesResponse(): MsgSetOrchestratorAddressesResponse { + return {}; +} +export const MsgSetOrchestratorAddressesResponse = { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse", + is(o: any): o is MsgSetOrchestratorAddressesResponse { + return o && o.$typeUrl === MsgSetOrchestratorAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetOrchestratorAddressesResponseAmino { + return o && o.$typeUrl === MsgSetOrchestratorAddressesResponse.typeUrl; + }, + encode(_: MsgSetOrchestratorAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetOrchestratorAddressesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetOrchestratorAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetOrchestratorAddressesResponse { + const message = createBaseMsgSetOrchestratorAddressesResponse(); + return message; + }, + fromAmino(_: MsgSetOrchestratorAddressesResponseAmino): MsgSetOrchestratorAddressesResponse { + const message = createBaseMsgSetOrchestratorAddressesResponse(); + return message; + }, + toAmino(_: MsgSetOrchestratorAddressesResponse): MsgSetOrchestratorAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetOrchestratorAddressesResponseAminoMsg): MsgSetOrchestratorAddressesResponse { + return MsgSetOrchestratorAddressesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetOrchestratorAddressesResponseProtoMsg): MsgSetOrchestratorAddressesResponse { + return MsgSetOrchestratorAddressesResponse.decode(message.value); + }, + toProto(message: MsgSetOrchestratorAddressesResponse): Uint8Array { + return MsgSetOrchestratorAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetOrchestratorAddressesResponse): MsgSetOrchestratorAddressesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse", + value: MsgSetOrchestratorAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetOrchestratorAddressesResponse.typeUrl, MsgSetOrchestratorAddressesResponse); +function createBaseMsgValsetConfirm(): MsgValsetConfirm { + return { + nonce: BigInt(0), + orchestrator: "", + ethAddress: "", + signature: "" + }; +} +export const MsgValsetConfirm = { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm", + aminoType: "peggy/MsgValsetConfirm", + is(o: any): o is MsgValsetConfirm { + return o && (o.$typeUrl === MsgValsetConfirm.typeUrl || typeof o.nonce === "bigint" && typeof o.orchestrator === "string" && typeof o.ethAddress === "string" && typeof o.signature === "string"); + }, + isAmino(o: any): o is MsgValsetConfirmAmino { + return o && (o.$typeUrl === MsgValsetConfirm.typeUrl || typeof o.nonce === "bigint" && typeof o.orchestrator === "string" && typeof o.eth_address === "string" && typeof o.signature === "string"); + }, + encode(message: MsgValsetConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.orchestrator !== "") { + writer.uint32(18).string(message.orchestrator); + } + if (message.ethAddress !== "") { + writer.uint32(26).string(message.ethAddress); + } + if (message.signature !== "") { + writer.uint32(34).string(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.orchestrator = reader.string(); + break; + case 3: + message.ethAddress = reader.string(); + break; + case 4: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgValsetConfirm { + const message = createBaseMsgValsetConfirm(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.orchestrator = object.orchestrator ?? ""; + message.ethAddress = object.ethAddress ?? ""; + message.signature = object.signature ?? ""; + return message; + }, + fromAmino(object: MsgValsetConfirmAmino): MsgValsetConfirm { + const message = createBaseMsgValsetConfirm(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + return message; + }, + toAmino(message: MsgValsetConfirm): MsgValsetConfirmAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + obj.signature = message.signature === "" ? undefined : message.signature; + return obj; + }, + fromAminoMsg(object: MsgValsetConfirmAminoMsg): MsgValsetConfirm { + return MsgValsetConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgValsetConfirm): MsgValsetConfirmAminoMsg { + return { + type: "peggy/MsgValsetConfirm", + value: MsgValsetConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgValsetConfirmProtoMsg): MsgValsetConfirm { + return MsgValsetConfirm.decode(message.value); + }, + toProto(message: MsgValsetConfirm): Uint8Array { + return MsgValsetConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetConfirm): MsgValsetConfirmProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm", + value: MsgValsetConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetConfirm.typeUrl, MsgValsetConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgValsetConfirm.aminoType, MsgValsetConfirm.typeUrl); +function createBaseMsgValsetConfirmResponse(): MsgValsetConfirmResponse { + return {}; +} +export const MsgValsetConfirmResponse = { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse", + is(o: any): o is MsgValsetConfirmResponse { + return o && o.$typeUrl === MsgValsetConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgValsetConfirmResponseAmino { + return o && o.$typeUrl === MsgValsetConfirmResponse.typeUrl; + }, + encode(_: MsgValsetConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgValsetConfirmResponse { + const message = createBaseMsgValsetConfirmResponse(); + return message; + }, + fromAmino(_: MsgValsetConfirmResponseAmino): MsgValsetConfirmResponse { + const message = createBaseMsgValsetConfirmResponse(); + return message; + }, + toAmino(_: MsgValsetConfirmResponse): MsgValsetConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgValsetConfirmResponseAminoMsg): MsgValsetConfirmResponse { + return MsgValsetConfirmResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgValsetConfirmResponseProtoMsg): MsgValsetConfirmResponse { + return MsgValsetConfirmResponse.decode(message.value); + }, + toProto(message: MsgValsetConfirmResponse): Uint8Array { + return MsgValsetConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetConfirmResponse): MsgValsetConfirmResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse", + value: MsgValsetConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetConfirmResponse.typeUrl, MsgValsetConfirmResponse); +function createBaseMsgSendToEth(): MsgSendToEth { + return { + sender: "", + ethDest: "", + amount: Coin.fromPartial({}), + bridgeFee: Coin.fromPartial({}) + }; +} +export const MsgSendToEth = { + typeUrl: "/injective.peggy.v1.MsgSendToEth", + aminoType: "peggy/MsgSendToEth", + is(o: any): o is MsgSendToEth { + return o && (o.$typeUrl === MsgSendToEth.typeUrl || typeof o.sender === "string" && typeof o.ethDest === "string" && Coin.is(o.amount) && Coin.is(o.bridgeFee)); + }, + isAmino(o: any): o is MsgSendToEthAmino { + return o && (o.$typeUrl === MsgSendToEth.typeUrl || typeof o.sender === "string" && typeof o.eth_dest === "string" && Coin.isAmino(o.amount) && Coin.isAmino(o.bridge_fee)); + }, + encode(message: MsgSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ethDest !== "") { + writer.uint32(18).string(message.ethDest); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.bridgeFee !== undefined) { + Coin.encode(message.bridgeFee, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ethDest = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.bridgeFee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSendToEth { + const message = createBaseMsgSendToEth(); + message.sender = object.sender ?? ""; + message.ethDest = object.ethDest ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.bridgeFee = object.bridgeFee !== undefined && object.bridgeFee !== null ? Coin.fromPartial(object.bridgeFee) : undefined; + return message; + }, + fromAmino(object: MsgSendToEthAmino): MsgSendToEth { + const message = createBaseMsgSendToEth(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.eth_dest !== undefined && object.eth_dest !== null) { + message.ethDest = object.eth_dest; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.bridge_fee !== undefined && object.bridge_fee !== null) { + message.bridgeFee = Coin.fromAmino(object.bridge_fee); + } + return message; + }, + toAmino(message: MsgSendToEth): MsgSendToEthAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.eth_dest = message.ethDest === "" ? undefined : message.ethDest; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.bridge_fee = message.bridgeFee ? Coin.toAmino(message.bridgeFee) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendToEthAminoMsg): MsgSendToEth { + return MsgSendToEth.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendToEth): MsgSendToEthAminoMsg { + return { + type: "peggy/MsgSendToEth", + value: MsgSendToEth.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendToEthProtoMsg): MsgSendToEth { + return MsgSendToEth.decode(message.value); + }, + toProto(message: MsgSendToEth): Uint8Array { + return MsgSendToEth.encode(message).finish(); + }, + toProtoMsg(message: MsgSendToEth): MsgSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSendToEth", + value: MsgSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendToEth.typeUrl, MsgSendToEth); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendToEth.aminoType, MsgSendToEth.typeUrl); +function createBaseMsgSendToEthResponse(): MsgSendToEthResponse { + return {}; +} +export const MsgSendToEthResponse = { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse", + is(o: any): o is MsgSendToEthResponse { + return o && o.$typeUrl === MsgSendToEthResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendToEthResponseAmino { + return o && o.$typeUrl === MsgSendToEthResponse.typeUrl; + }, + encode(_: MsgSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSendToEthResponse { + const message = createBaseMsgSendToEthResponse(); + return message; + }, + fromAmino(_: MsgSendToEthResponseAmino): MsgSendToEthResponse { + const message = createBaseMsgSendToEthResponse(); + return message; + }, + toAmino(_: MsgSendToEthResponse): MsgSendToEthResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendToEthResponseAminoMsg): MsgSendToEthResponse { + return MsgSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendToEthResponseProtoMsg): MsgSendToEthResponse { + return MsgSendToEthResponse.decode(message.value); + }, + toProto(message: MsgSendToEthResponse): Uint8Array { + return MsgSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendToEthResponse): MsgSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse", + value: MsgSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendToEthResponse.typeUrl, MsgSendToEthResponse); +function createBaseMsgRequestBatch(): MsgRequestBatch { + return { + orchestrator: "", + denom: "" + }; +} +export const MsgRequestBatch = { + typeUrl: "/injective.peggy.v1.MsgRequestBatch", + aminoType: "peggy/MsgRequestBatch", + is(o: any): o is MsgRequestBatch { + return o && (o.$typeUrl === MsgRequestBatch.typeUrl || typeof o.orchestrator === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is MsgRequestBatchAmino { + return o && (o.$typeUrl === MsgRequestBatch.typeUrl || typeof o.orchestrator === "string" && typeof o.denom === "string"); + }, + encode(message: MsgRequestBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orchestrator !== "") { + writer.uint32(10).string(message.orchestrator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orchestrator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestBatch { + const message = createBaseMsgRequestBatch(); + message.orchestrator = object.orchestrator ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: MsgRequestBatchAmino): MsgRequestBatch { + const message = createBaseMsgRequestBatch(); + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: MsgRequestBatch): MsgRequestBatchAmino { + const obj: any = {}; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: MsgRequestBatchAminoMsg): MsgRequestBatch { + return MsgRequestBatch.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestBatch): MsgRequestBatchAminoMsg { + return { + type: "peggy/MsgRequestBatch", + value: MsgRequestBatch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestBatchProtoMsg): MsgRequestBatch { + return MsgRequestBatch.decode(message.value); + }, + toProto(message: MsgRequestBatch): Uint8Array { + return MsgRequestBatch.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBatch): MsgRequestBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRequestBatch", + value: MsgRequestBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBatch.typeUrl, MsgRequestBatch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestBatch.aminoType, MsgRequestBatch.typeUrl); +function createBaseMsgRequestBatchResponse(): MsgRequestBatchResponse { + return {}; +} +export const MsgRequestBatchResponse = { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse", + is(o: any): o is MsgRequestBatchResponse { + return o && o.$typeUrl === MsgRequestBatchResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestBatchResponseAmino { + return o && o.$typeUrl === MsgRequestBatchResponse.typeUrl; + }, + encode(_: MsgRequestBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBatchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestBatchResponse { + const message = createBaseMsgRequestBatchResponse(); + return message; + }, + fromAmino(_: MsgRequestBatchResponseAmino): MsgRequestBatchResponse { + const message = createBaseMsgRequestBatchResponse(); + return message; + }, + toAmino(_: MsgRequestBatchResponse): MsgRequestBatchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestBatchResponseAminoMsg): MsgRequestBatchResponse { + return MsgRequestBatchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestBatchResponseProtoMsg): MsgRequestBatchResponse { + return MsgRequestBatchResponse.decode(message.value); + }, + toProto(message: MsgRequestBatchResponse): Uint8Array { + return MsgRequestBatchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBatchResponse): MsgRequestBatchResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse", + value: MsgRequestBatchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBatchResponse.typeUrl, MsgRequestBatchResponse); +function createBaseMsgConfirmBatch(): MsgConfirmBatch { + return { + nonce: BigInt(0), + tokenContract: "", + ethSigner: "", + orchestrator: "", + signature: "" + }; +} +export const MsgConfirmBatch = { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch", + aminoType: "peggy/MsgConfirmBatch", + is(o: any): o is MsgConfirmBatch { + return o && (o.$typeUrl === MsgConfirmBatch.typeUrl || typeof o.nonce === "bigint" && typeof o.tokenContract === "string" && typeof o.ethSigner === "string" && typeof o.orchestrator === "string" && typeof o.signature === "string"); + }, + isAmino(o: any): o is MsgConfirmBatchAmino { + return o && (o.$typeUrl === MsgConfirmBatch.typeUrl || typeof o.nonce === "bigint" && typeof o.token_contract === "string" && typeof o.eth_signer === "string" && typeof o.orchestrator === "string" && typeof o.signature === "string"); + }, + encode(message: MsgConfirmBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.tokenContract !== "") { + writer.uint32(18).string(message.tokenContract); + } + if (message.ethSigner !== "") { + writer.uint32(26).string(message.ethSigner); + } + if (message.orchestrator !== "") { + writer.uint32(34).string(message.orchestrator); + } + if (message.signature !== "") { + writer.uint32(42).string(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConfirmBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConfirmBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.tokenContract = reader.string(); + break; + case 3: + message.ethSigner = reader.string(); + break; + case 4: + message.orchestrator = reader.string(); + break; + case 5: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConfirmBatch { + const message = createBaseMsgConfirmBatch(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.ethSigner = object.ethSigner ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.signature = object.signature ?? ""; + return message; + }, + fromAmino(object: MsgConfirmBatchAmino): MsgConfirmBatch { + const message = createBaseMsgConfirmBatch(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.eth_signer !== undefined && object.eth_signer !== null) { + message.ethSigner = object.eth_signer; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + return message; + }, + toAmino(message: MsgConfirmBatch): MsgConfirmBatchAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.eth_signer = message.ethSigner === "" ? undefined : message.ethSigner; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.signature = message.signature === "" ? undefined : message.signature; + return obj; + }, + fromAminoMsg(object: MsgConfirmBatchAminoMsg): MsgConfirmBatch { + return MsgConfirmBatch.fromAmino(object.value); + }, + toAminoMsg(message: MsgConfirmBatch): MsgConfirmBatchAminoMsg { + return { + type: "peggy/MsgConfirmBatch", + value: MsgConfirmBatch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConfirmBatchProtoMsg): MsgConfirmBatch { + return MsgConfirmBatch.decode(message.value); + }, + toProto(message: MsgConfirmBatch): Uint8Array { + return MsgConfirmBatch.encode(message).finish(); + }, + toProtoMsg(message: MsgConfirmBatch): MsgConfirmBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch", + value: MsgConfirmBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConfirmBatch.typeUrl, MsgConfirmBatch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConfirmBatch.aminoType, MsgConfirmBatch.typeUrl); +function createBaseMsgConfirmBatchResponse(): MsgConfirmBatchResponse { + return {}; +} +export const MsgConfirmBatchResponse = { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse", + is(o: any): o is MsgConfirmBatchResponse { + return o && o.$typeUrl === MsgConfirmBatchResponse.typeUrl; + }, + isAmino(o: any): o is MsgConfirmBatchResponseAmino { + return o && o.$typeUrl === MsgConfirmBatchResponse.typeUrl; + }, + encode(_: MsgConfirmBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConfirmBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConfirmBatchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConfirmBatchResponse { + const message = createBaseMsgConfirmBatchResponse(); + return message; + }, + fromAmino(_: MsgConfirmBatchResponseAmino): MsgConfirmBatchResponse { + const message = createBaseMsgConfirmBatchResponse(); + return message; + }, + toAmino(_: MsgConfirmBatchResponse): MsgConfirmBatchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConfirmBatchResponseAminoMsg): MsgConfirmBatchResponse { + return MsgConfirmBatchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgConfirmBatchResponseProtoMsg): MsgConfirmBatchResponse { + return MsgConfirmBatchResponse.decode(message.value); + }, + toProto(message: MsgConfirmBatchResponse): Uint8Array { + return MsgConfirmBatchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConfirmBatchResponse): MsgConfirmBatchResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse", + value: MsgConfirmBatchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConfirmBatchResponse.typeUrl, MsgConfirmBatchResponse); +function createBaseMsgDepositClaim(): MsgDepositClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + tokenContract: "", + amount: "", + ethereumSender: "", + cosmosReceiver: "", + orchestrator: "", + data: "" + }; +} +export const MsgDepositClaim = { + typeUrl: "/injective.peggy.v1.MsgDepositClaim", + aminoType: "peggy/MsgDepositClaim", + is(o: any): o is MsgDepositClaim { + return o && (o.$typeUrl === MsgDepositClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.tokenContract === "string" && typeof o.amount === "string" && typeof o.ethereumSender === "string" && typeof o.cosmosReceiver === "string" && typeof o.orchestrator === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is MsgDepositClaimAmino { + return o && (o.$typeUrl === MsgDepositClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.token_contract === "string" && typeof o.amount === "string" && typeof o.ethereum_sender === "string" && typeof o.cosmos_receiver === "string" && typeof o.orchestrator === "string" && typeof o.data === "string"); + }, + encode(message: MsgDepositClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.tokenContract !== "") { + writer.uint32(26).string(message.tokenContract); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.ethereumSender !== "") { + writer.uint32(42).string(message.ethereumSender); + } + if (message.cosmosReceiver !== "") { + writer.uint32(50).string(message.cosmosReceiver); + } + if (message.orchestrator !== "") { + writer.uint32(58).string(message.orchestrator); + } + if (message.data !== "") { + writer.uint32(66).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.tokenContract = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.ethereumSender = reader.string(); + break; + case 6: + message.cosmosReceiver = reader.string(); + break; + case 7: + message.orchestrator = reader.string(); + break; + case 8: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDepositClaim { + const message = createBaseMsgDepositClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.amount = object.amount ?? ""; + message.ethereumSender = object.ethereumSender ?? ""; + message.cosmosReceiver = object.cosmosReceiver ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: MsgDepositClaimAmino): MsgDepositClaim { + const message = createBaseMsgDepositClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.ethereum_sender !== undefined && object.ethereum_sender !== null) { + message.ethereumSender = object.ethereum_sender; + } + if (object.cosmos_receiver !== undefined && object.cosmos_receiver !== null) { + message.cosmosReceiver = object.cosmos_receiver; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: MsgDepositClaim): MsgDepositClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.ethereum_sender = message.ethereumSender === "" ? undefined : message.ethereumSender; + obj.cosmos_receiver = message.cosmosReceiver === "" ? undefined : message.cosmosReceiver; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: MsgDepositClaimAminoMsg): MsgDepositClaim { + return MsgDepositClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositClaim): MsgDepositClaimAminoMsg { + return { + type: "peggy/MsgDepositClaim", + value: MsgDepositClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositClaimProtoMsg): MsgDepositClaim { + return MsgDepositClaim.decode(message.value); + }, + toProto(message: MsgDepositClaim): Uint8Array { + return MsgDepositClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositClaim): MsgDepositClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgDepositClaim", + value: MsgDepositClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositClaim.typeUrl, MsgDepositClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositClaim.aminoType, MsgDepositClaim.typeUrl); +function createBaseMsgDepositClaimResponse(): MsgDepositClaimResponse { + return {}; +} +export const MsgDepositClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse", + is(o: any): o is MsgDepositClaimResponse { + return o && o.$typeUrl === MsgDepositClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositClaimResponseAmino { + return o && o.$typeUrl === MsgDepositClaimResponse.typeUrl; + }, + encode(_: MsgDepositClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDepositClaimResponse { + const message = createBaseMsgDepositClaimResponse(); + return message; + }, + fromAmino(_: MsgDepositClaimResponseAmino): MsgDepositClaimResponse { + const message = createBaseMsgDepositClaimResponse(); + return message; + }, + toAmino(_: MsgDepositClaimResponse): MsgDepositClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositClaimResponseAminoMsg): MsgDepositClaimResponse { + return MsgDepositClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositClaimResponseProtoMsg): MsgDepositClaimResponse { + return MsgDepositClaimResponse.decode(message.value); + }, + toProto(message: MsgDepositClaimResponse): Uint8Array { + return MsgDepositClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositClaimResponse): MsgDepositClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse", + value: MsgDepositClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositClaimResponse.typeUrl, MsgDepositClaimResponse); +function createBaseMsgWithdrawClaim(): MsgWithdrawClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + batchNonce: BigInt(0), + tokenContract: "", + orchestrator: "" + }; +} +export const MsgWithdrawClaim = { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim", + aminoType: "peggy/MsgWithdrawClaim", + is(o: any): o is MsgWithdrawClaim { + return o && (o.$typeUrl === MsgWithdrawClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.batchNonce === "bigint" && typeof o.tokenContract === "string" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgWithdrawClaimAmino { + return o && (o.$typeUrl === MsgWithdrawClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.batch_nonce === "bigint" && typeof o.token_contract === "string" && typeof o.orchestrator === "string"); + }, + encode(message: MsgWithdrawClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(24).uint64(message.batchNonce); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.orchestrator !== "") { + writer.uint32(42).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.batchNonce = reader.uint64(); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawClaim { + const message = createBaseMsgWithdrawClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawClaimAmino): MsgWithdrawClaim { + const message = createBaseMsgWithdrawClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgWithdrawClaim): MsgWithdrawClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgWithdrawClaimAminoMsg): MsgWithdrawClaim { + return MsgWithdrawClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawClaim): MsgWithdrawClaimAminoMsg { + return { + type: "peggy/MsgWithdrawClaim", + value: MsgWithdrawClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawClaimProtoMsg): MsgWithdrawClaim { + return MsgWithdrawClaim.decode(message.value); + }, + toProto(message: MsgWithdrawClaim): Uint8Array { + return MsgWithdrawClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawClaim): MsgWithdrawClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim", + value: MsgWithdrawClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawClaim.typeUrl, MsgWithdrawClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawClaim.aminoType, MsgWithdrawClaim.typeUrl); +function createBaseMsgWithdrawClaimResponse(): MsgWithdrawClaimResponse { + return {}; +} +export const MsgWithdrawClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse", + is(o: any): o is MsgWithdrawClaimResponse { + return o && o.$typeUrl === MsgWithdrawClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawClaimResponseAmino { + return o && o.$typeUrl === MsgWithdrawClaimResponse.typeUrl; + }, + encode(_: MsgWithdrawClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawClaimResponse { + const message = createBaseMsgWithdrawClaimResponse(); + return message; + }, + fromAmino(_: MsgWithdrawClaimResponseAmino): MsgWithdrawClaimResponse { + const message = createBaseMsgWithdrawClaimResponse(); + return message; + }, + toAmino(_: MsgWithdrawClaimResponse): MsgWithdrawClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawClaimResponseAminoMsg): MsgWithdrawClaimResponse { + return MsgWithdrawClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawClaimResponseProtoMsg): MsgWithdrawClaimResponse { + return MsgWithdrawClaimResponse.decode(message.value); + }, + toProto(message: MsgWithdrawClaimResponse): Uint8Array { + return MsgWithdrawClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawClaimResponse): MsgWithdrawClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse", + value: MsgWithdrawClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawClaimResponse.typeUrl, MsgWithdrawClaimResponse); +function createBaseMsgERC20DeployedClaim(): MsgERC20DeployedClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + cosmosDenom: "", + tokenContract: "", + name: "", + symbol: "", + decimals: BigInt(0), + orchestrator: "" + }; +} +export const MsgERC20DeployedClaim = { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim", + aminoType: "peggy/MsgERC20DeployedClaim", + is(o: any): o is MsgERC20DeployedClaim { + return o && (o.$typeUrl === MsgERC20DeployedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.cosmosDenom === "string" && typeof o.tokenContract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgERC20DeployedClaimAmino { + return o && (o.$typeUrl === MsgERC20DeployedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.cosmos_denom === "string" && typeof o.token_contract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator === "string"); + }, + encode(message: MsgERC20DeployedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.cosmosDenom !== "") { + writer.uint32(26).string(message.cosmosDenom); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(50).string(message.symbol); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(56).uint64(message.decimals); + } + if (message.orchestrator !== "") { + writer.uint32(66).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgERC20DeployedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgERC20DeployedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.cosmosDenom = reader.string(); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.symbol = reader.string(); + break; + case 7: + message.decimals = reader.uint64(); + break; + case 8: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgERC20DeployedClaim { + const message = createBaseMsgERC20DeployedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.cosmosDenom = object.cosmosDenom ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgERC20DeployedClaimAmino): MsgERC20DeployedClaim { + const message = createBaseMsgERC20DeployedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.cosmos_denom !== undefined && object.cosmos_denom !== null) { + message.cosmosDenom = object.cosmos_denom; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.cosmos_denom = message.cosmosDenom === "" ? undefined : message.cosmosDenom; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgERC20DeployedClaimAminoMsg): MsgERC20DeployedClaim { + return MsgERC20DeployedClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimAminoMsg { + return { + type: "peggy/MsgERC20DeployedClaim", + value: MsgERC20DeployedClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgERC20DeployedClaimProtoMsg): MsgERC20DeployedClaim { + return MsgERC20DeployedClaim.decode(message.value); + }, + toProto(message: MsgERC20DeployedClaim): Uint8Array { + return MsgERC20DeployedClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim", + value: MsgERC20DeployedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgERC20DeployedClaim.typeUrl, MsgERC20DeployedClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgERC20DeployedClaim.aminoType, MsgERC20DeployedClaim.typeUrl); +function createBaseMsgERC20DeployedClaimResponse(): MsgERC20DeployedClaimResponse { + return {}; +} +export const MsgERC20DeployedClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse", + is(o: any): o is MsgERC20DeployedClaimResponse { + return o && o.$typeUrl === MsgERC20DeployedClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgERC20DeployedClaimResponseAmino { + return o && o.$typeUrl === MsgERC20DeployedClaimResponse.typeUrl; + }, + encode(_: MsgERC20DeployedClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgERC20DeployedClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgERC20DeployedClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgERC20DeployedClaimResponse { + const message = createBaseMsgERC20DeployedClaimResponse(); + return message; + }, + fromAmino(_: MsgERC20DeployedClaimResponseAmino): MsgERC20DeployedClaimResponse { + const message = createBaseMsgERC20DeployedClaimResponse(); + return message; + }, + toAmino(_: MsgERC20DeployedClaimResponse): MsgERC20DeployedClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgERC20DeployedClaimResponseAminoMsg): MsgERC20DeployedClaimResponse { + return MsgERC20DeployedClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgERC20DeployedClaimResponseProtoMsg): MsgERC20DeployedClaimResponse { + return MsgERC20DeployedClaimResponse.decode(message.value); + }, + toProto(message: MsgERC20DeployedClaimResponse): Uint8Array { + return MsgERC20DeployedClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgERC20DeployedClaimResponse): MsgERC20DeployedClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse", + value: MsgERC20DeployedClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgERC20DeployedClaimResponse.typeUrl, MsgERC20DeployedClaimResponse); +function createBaseMsgCancelSendToEth(): MsgCancelSendToEth { + return { + transactionId: BigInt(0), + sender: "" + }; +} +export const MsgCancelSendToEth = { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth", + aminoType: "peggy/MsgCancelSendToEth", + is(o: any): o is MsgCancelSendToEth { + return o && (o.$typeUrl === MsgCancelSendToEth.typeUrl || typeof o.transactionId === "bigint" && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCancelSendToEthAmino { + return o && (o.$typeUrl === MsgCancelSendToEth.typeUrl || typeof o.transaction_id === "bigint" && typeof o.sender === "string"); + }, + encode(message: MsgCancelSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transactionId !== BigInt(0)) { + writer.uint32(8).uint64(message.transactionId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transactionId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelSendToEth { + const message = createBaseMsgCancelSendToEth(); + message.transactionId = object.transactionId !== undefined && object.transactionId !== null ? BigInt(object.transactionId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgCancelSendToEthAmino): MsgCancelSendToEth { + const message = createBaseMsgCancelSendToEth(); + if (object.transaction_id !== undefined && object.transaction_id !== null) { + message.transactionId = BigInt(object.transaction_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgCancelSendToEth): MsgCancelSendToEthAmino { + const obj: any = {}; + obj.transaction_id = message.transactionId !== BigInt(0) ? message.transactionId?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgCancelSendToEthAminoMsg): MsgCancelSendToEth { + return MsgCancelSendToEth.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelSendToEth): MsgCancelSendToEthAminoMsg { + return { + type: "peggy/MsgCancelSendToEth", + value: MsgCancelSendToEth.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelSendToEthProtoMsg): MsgCancelSendToEth { + return MsgCancelSendToEth.decode(message.value); + }, + toProto(message: MsgCancelSendToEth): Uint8Array { + return MsgCancelSendToEth.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSendToEth): MsgCancelSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth", + value: MsgCancelSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSendToEth.typeUrl, MsgCancelSendToEth); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelSendToEth.aminoType, MsgCancelSendToEth.typeUrl); +function createBaseMsgCancelSendToEthResponse(): MsgCancelSendToEthResponse { + return {}; +} +export const MsgCancelSendToEthResponse = { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse", + is(o: any): o is MsgCancelSendToEthResponse { + return o && o.$typeUrl === MsgCancelSendToEthResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelSendToEthResponseAmino { + return o && o.$typeUrl === MsgCancelSendToEthResponse.typeUrl; + }, + encode(_: MsgCancelSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelSendToEthResponse { + const message = createBaseMsgCancelSendToEthResponse(); + return message; + }, + fromAmino(_: MsgCancelSendToEthResponseAmino): MsgCancelSendToEthResponse { + const message = createBaseMsgCancelSendToEthResponse(); + return message; + }, + toAmino(_: MsgCancelSendToEthResponse): MsgCancelSendToEthResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelSendToEthResponseAminoMsg): MsgCancelSendToEthResponse { + return MsgCancelSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelSendToEthResponseProtoMsg): MsgCancelSendToEthResponse { + return MsgCancelSendToEthResponse.decode(message.value); + }, + toProto(message: MsgCancelSendToEthResponse): Uint8Array { + return MsgCancelSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSendToEthResponse): MsgCancelSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse", + value: MsgCancelSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSendToEthResponse.typeUrl, MsgCancelSendToEthResponse); +function createBaseMsgSubmitBadSignatureEvidence(): MsgSubmitBadSignatureEvidence { + return { + subject: undefined, + signature: "", + sender: "" + }; +} +export const MsgSubmitBadSignatureEvidence = { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence", + aminoType: "peggy/MsgSubmitBadSignatureEvidence", + is(o: any): o is MsgSubmitBadSignatureEvidence { + return o && (o.$typeUrl === MsgSubmitBadSignatureEvidence.typeUrl || typeof o.signature === "string" && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgSubmitBadSignatureEvidenceAmino { + return o && (o.$typeUrl === MsgSubmitBadSignatureEvidence.typeUrl || typeof o.signature === "string" && typeof o.sender === "string"); + }, + encode(message: MsgSubmitBadSignatureEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subject !== undefined) { + Any.encode(message.subject, writer.uint32(10).fork()).ldelim(); + } + if (message.signature !== "") { + writer.uint32(18).string(message.signature); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitBadSignatureEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitBadSignatureEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = Any.decode(reader, reader.uint32()); + break; + case 2: + message.signature = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitBadSignatureEvidence { + const message = createBaseMsgSubmitBadSignatureEvidence(); + message.subject = object.subject !== undefined && object.subject !== null ? Any.fromPartial(object.subject) : undefined; + message.signature = object.signature ?? ""; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgSubmitBadSignatureEvidenceAmino): MsgSubmitBadSignatureEvidence { + const message = createBaseMsgSubmitBadSignatureEvidence(); + if (object.subject !== undefined && object.subject !== null) { + message.subject = Any.fromAmino(object.subject); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceAmino { + const obj: any = {}; + obj.subject = message.subject ? Any.toAmino(message.subject) : undefined; + obj.signature = message.signature === "" ? undefined : message.signature; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgSubmitBadSignatureEvidenceAminoMsg): MsgSubmitBadSignatureEvidence { + return MsgSubmitBadSignatureEvidence.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceAminoMsg { + return { + type: "peggy/MsgSubmitBadSignatureEvidence", + value: MsgSubmitBadSignatureEvidence.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitBadSignatureEvidenceProtoMsg): MsgSubmitBadSignatureEvidence { + return MsgSubmitBadSignatureEvidence.decode(message.value); + }, + toProto(message: MsgSubmitBadSignatureEvidence): Uint8Array { + return MsgSubmitBadSignatureEvidence.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence", + value: MsgSubmitBadSignatureEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitBadSignatureEvidence.typeUrl, MsgSubmitBadSignatureEvidence); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitBadSignatureEvidence.aminoType, MsgSubmitBadSignatureEvidence.typeUrl); +function createBaseMsgSubmitBadSignatureEvidenceResponse(): MsgSubmitBadSignatureEvidenceResponse { + return {}; +} +export const MsgSubmitBadSignatureEvidenceResponse = { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse", + is(o: any): o is MsgSubmitBadSignatureEvidenceResponse { + return o && o.$typeUrl === MsgSubmitBadSignatureEvidenceResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubmitBadSignatureEvidenceResponseAmino { + return o && o.$typeUrl === MsgSubmitBadSignatureEvidenceResponse.typeUrl; + }, + encode(_: MsgSubmitBadSignatureEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitBadSignatureEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubmitBadSignatureEvidenceResponse { + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + return message; + }, + fromAmino(_: MsgSubmitBadSignatureEvidenceResponseAmino): MsgSubmitBadSignatureEvidenceResponse { + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + return message; + }, + toAmino(_: MsgSubmitBadSignatureEvidenceResponse): MsgSubmitBadSignatureEvidenceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitBadSignatureEvidenceResponseAminoMsg): MsgSubmitBadSignatureEvidenceResponse { + return MsgSubmitBadSignatureEvidenceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubmitBadSignatureEvidenceResponseProtoMsg): MsgSubmitBadSignatureEvidenceResponse { + return MsgSubmitBadSignatureEvidenceResponse.decode(message.value); + }, + toProto(message: MsgSubmitBadSignatureEvidenceResponse): Uint8Array { + return MsgSubmitBadSignatureEvidenceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitBadSignatureEvidenceResponse): MsgSubmitBadSignatureEvidenceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse", + value: MsgSubmitBadSignatureEvidenceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitBadSignatureEvidenceResponse.typeUrl, MsgSubmitBadSignatureEvidenceResponse); +function createBaseMsgValsetUpdatedClaim(): MsgValsetUpdatedClaim { + return { + eventNonce: BigInt(0), + valsetNonce: BigInt(0), + blockHeight: BigInt(0), + members: [], + rewardAmount: "", + rewardToken: "", + orchestrator: "" + }; +} +export const MsgValsetUpdatedClaim = { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim", + aminoType: "peggy/MsgValsetUpdatedClaim", + is(o: any): o is MsgValsetUpdatedClaim { + return o && (o.$typeUrl === MsgValsetUpdatedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.valsetNonce === "bigint" && typeof o.blockHeight === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.is(o.members[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgValsetUpdatedClaimAmino { + return o && (o.$typeUrl === MsgValsetUpdatedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.valset_nonce === "bigint" && typeof o.block_height === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.isAmino(o.members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string" && typeof o.orchestrator === "string"); + }, + encode(message: MsgValsetUpdatedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.blockHeight); + } + for (const v of message.members) { + BridgeValidator.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(42).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(50).string(message.rewardToken); + } + if (message.orchestrator !== "") { + writer.uint32(58).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetUpdatedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetUpdatedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.valsetNonce = reader.uint64(); + break; + case 3: + message.blockHeight = reader.uint64(); + break; + case 4: + message.members.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 5: + message.rewardAmount = reader.string(); + break; + case 6: + message.rewardToken = reader.string(); + break; + case 7: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgValsetUpdatedClaim { + const message = createBaseMsgValsetUpdatedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.members = object.members?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgValsetUpdatedClaimAmino): MsgValsetUpdatedClaim { + const message = createBaseMsgValsetUpdatedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + message.members = object.members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + if (message.members) { + obj.members = message.members.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgValsetUpdatedClaimAminoMsg): MsgValsetUpdatedClaim { + return MsgValsetUpdatedClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimAminoMsg { + return { + type: "peggy/MsgValsetUpdatedClaim", + value: MsgValsetUpdatedClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgValsetUpdatedClaimProtoMsg): MsgValsetUpdatedClaim { + return MsgValsetUpdatedClaim.decode(message.value); + }, + toProto(message: MsgValsetUpdatedClaim): Uint8Array { + return MsgValsetUpdatedClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim", + value: MsgValsetUpdatedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetUpdatedClaim.typeUrl, MsgValsetUpdatedClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgValsetUpdatedClaim.aminoType, MsgValsetUpdatedClaim.typeUrl); +function createBaseMsgValsetUpdatedClaimResponse(): MsgValsetUpdatedClaimResponse { + return {}; +} +export const MsgValsetUpdatedClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse", + is(o: any): o is MsgValsetUpdatedClaimResponse { + return o && o.$typeUrl === MsgValsetUpdatedClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgValsetUpdatedClaimResponseAmino { + return o && o.$typeUrl === MsgValsetUpdatedClaimResponse.typeUrl; + }, + encode(_: MsgValsetUpdatedClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetUpdatedClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetUpdatedClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgValsetUpdatedClaimResponse { + const message = createBaseMsgValsetUpdatedClaimResponse(); + return message; + }, + fromAmino(_: MsgValsetUpdatedClaimResponseAmino): MsgValsetUpdatedClaimResponse { + const message = createBaseMsgValsetUpdatedClaimResponse(); + return message; + }, + toAmino(_: MsgValsetUpdatedClaimResponse): MsgValsetUpdatedClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgValsetUpdatedClaimResponseAminoMsg): MsgValsetUpdatedClaimResponse { + return MsgValsetUpdatedClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgValsetUpdatedClaimResponseProtoMsg): MsgValsetUpdatedClaimResponse { + return MsgValsetUpdatedClaimResponse.decode(message.value); + }, + toProto(message: MsgValsetUpdatedClaimResponse): Uint8Array { + return MsgValsetUpdatedClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetUpdatedClaimResponse): MsgValsetUpdatedClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse", + value: MsgValsetUpdatedClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetUpdatedClaimResponse.typeUrl, MsgValsetUpdatedClaimResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.peggy.v1.MsgUpdateParams", + aminoType: "peggy/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "peggy/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: "/injective.peggy.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgBlacklistEthereumAddresses(): MsgBlacklistEthereumAddresses { + return { + signer: "", + blacklistAddresses: [] + }; +} +export const MsgBlacklistEthereumAddresses = { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses", + aminoType: "peggy/MsgBlacklistEthereumAddresses", + is(o: any): o is MsgBlacklistEthereumAddresses { + return o && (o.$typeUrl === MsgBlacklistEthereumAddresses.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is MsgBlacklistEthereumAddressesAmino { + return o && (o.$typeUrl === MsgBlacklistEthereumAddresses.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: MsgBlacklistEthereumAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.blacklistAddresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBlacklistEthereumAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBlacklistEthereumAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBlacklistEthereumAddresses { + const message = createBaseMsgBlacklistEthereumAddresses(); + message.signer = object.signer ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBlacklistEthereumAddressesAmino): MsgBlacklistEthereumAddresses { + const message = createBaseMsgBlacklistEthereumAddresses(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: MsgBlacklistEthereumAddressesAminoMsg): MsgBlacklistEthereumAddresses { + return MsgBlacklistEthereumAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesAminoMsg { + return { + type: "peggy/MsgBlacklistEthereumAddresses", + value: MsgBlacklistEthereumAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBlacklistEthereumAddressesProtoMsg): MsgBlacklistEthereumAddresses { + return MsgBlacklistEthereumAddresses.decode(message.value); + }, + toProto(message: MsgBlacklistEthereumAddresses): Uint8Array { + return MsgBlacklistEthereumAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses", + value: MsgBlacklistEthereumAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBlacklistEthereumAddresses.typeUrl, MsgBlacklistEthereumAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBlacklistEthereumAddresses.aminoType, MsgBlacklistEthereumAddresses.typeUrl); +function createBaseMsgBlacklistEthereumAddressesResponse(): MsgBlacklistEthereumAddressesResponse { + return {}; +} +export const MsgBlacklistEthereumAddressesResponse = { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse", + is(o: any): o is MsgBlacklistEthereumAddressesResponse { + return o && o.$typeUrl === MsgBlacklistEthereumAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgBlacklistEthereumAddressesResponseAmino { + return o && o.$typeUrl === MsgBlacklistEthereumAddressesResponse.typeUrl; + }, + encode(_: MsgBlacklistEthereumAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBlacklistEthereumAddressesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgBlacklistEthereumAddressesResponse { + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + return message; + }, + fromAmino(_: MsgBlacklistEthereumAddressesResponseAmino): MsgBlacklistEthereumAddressesResponse { + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + return message; + }, + toAmino(_: MsgBlacklistEthereumAddressesResponse): MsgBlacklistEthereumAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBlacklistEthereumAddressesResponseAminoMsg): MsgBlacklistEthereumAddressesResponse { + return MsgBlacklistEthereumAddressesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBlacklistEthereumAddressesResponseProtoMsg): MsgBlacklistEthereumAddressesResponse { + return MsgBlacklistEthereumAddressesResponse.decode(message.value); + }, + toProto(message: MsgBlacklistEthereumAddressesResponse): Uint8Array { + return MsgBlacklistEthereumAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBlacklistEthereumAddressesResponse): MsgBlacklistEthereumAddressesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse", + value: MsgBlacklistEthereumAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBlacklistEthereumAddressesResponse.typeUrl, MsgBlacklistEthereumAddressesResponse); +function createBaseMsgRevokeEthereumBlacklist(): MsgRevokeEthereumBlacklist { + return { + signer: "", + blacklistAddresses: [] + }; +} +export const MsgRevokeEthereumBlacklist = { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist", + aminoType: "peggy/MsgRevokeEthereumBlacklist", + is(o: any): o is MsgRevokeEthereumBlacklist { + return o && (o.$typeUrl === MsgRevokeEthereumBlacklist.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is MsgRevokeEthereumBlacklistAmino { + return o && (o.$typeUrl === MsgRevokeEthereumBlacklist.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: MsgRevokeEthereumBlacklist, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.blacklistAddresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeEthereumBlacklist { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeEthereumBlacklist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeEthereumBlacklist { + const message = createBaseMsgRevokeEthereumBlacklist(); + message.signer = object.signer ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRevokeEthereumBlacklistAmino): MsgRevokeEthereumBlacklist { + const message = createBaseMsgRevokeEthereumBlacklist(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: MsgRevokeEthereumBlacklistAminoMsg): MsgRevokeEthereumBlacklist { + return MsgRevokeEthereumBlacklist.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistAminoMsg { + return { + type: "peggy/MsgRevokeEthereumBlacklist", + value: MsgRevokeEthereumBlacklist.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeEthereumBlacklistProtoMsg): MsgRevokeEthereumBlacklist { + return MsgRevokeEthereumBlacklist.decode(message.value); + }, + toProto(message: MsgRevokeEthereumBlacklist): Uint8Array { + return MsgRevokeEthereumBlacklist.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist", + value: MsgRevokeEthereumBlacklist.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeEthereumBlacklist.typeUrl, MsgRevokeEthereumBlacklist); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeEthereumBlacklist.aminoType, MsgRevokeEthereumBlacklist.typeUrl); +function createBaseMsgRevokeEthereumBlacklistResponse(): MsgRevokeEthereumBlacklistResponse { + return {}; +} +export const MsgRevokeEthereumBlacklistResponse = { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse", + is(o: any): o is MsgRevokeEthereumBlacklistResponse { + return o && o.$typeUrl === MsgRevokeEthereumBlacklistResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeEthereumBlacklistResponseAmino { + return o && o.$typeUrl === MsgRevokeEthereumBlacklistResponse.typeUrl; + }, + encode(_: MsgRevokeEthereumBlacklistResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeEthereumBlacklistResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeEthereumBlacklistResponse { + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + return message; + }, + fromAmino(_: MsgRevokeEthereumBlacklistResponseAmino): MsgRevokeEthereumBlacklistResponse { + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + return message; + }, + toAmino(_: MsgRevokeEthereumBlacklistResponse): MsgRevokeEthereumBlacklistResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeEthereumBlacklistResponseAminoMsg): MsgRevokeEthereumBlacklistResponse { + return MsgRevokeEthereumBlacklistResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRevokeEthereumBlacklistResponseProtoMsg): MsgRevokeEthereumBlacklistResponse { + return MsgRevokeEthereumBlacklistResponse.decode(message.value); + }, + toProto(message: MsgRevokeEthereumBlacklistResponse): Uint8Array { + return MsgRevokeEthereumBlacklistResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeEthereumBlacklistResponse): MsgRevokeEthereumBlacklistResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse", + value: MsgRevokeEthereumBlacklistResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeEthereumBlacklistResponse.typeUrl, MsgRevokeEthereumBlacklistResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/params.ts b/libs/injective-query/src/injective/peggy/v1/params.ts new file mode 100644 index 00000000..8925790d --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/params.ts @@ -0,0 +1,392 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + peggyId: string; + contractSourceHash: string; + bridgeEthereumAddress: string; + bridgeChainId: bigint; + signedValsetsWindow: bigint; + signedBatchesWindow: bigint; + signedClaimsWindow: bigint; + targetBatchTimeout: bigint; + averageBlockTime: bigint; + averageEthereumBlockTime: bigint; + slashFractionValset: Uint8Array; + slashFractionBatch: Uint8Array; + slashFractionClaim: Uint8Array; + slashFractionConflictingClaim: Uint8Array; + unbondSlashingValsetsWindow: bigint; + slashFractionBadEthSignature: Uint8Array; + cosmosCoinDenom: string; + cosmosCoinErc20Contract: string; + claimSlashingEnabled: boolean; + bridgeContractStartHeight: bigint; + valsetReward: Coin; + admins: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.peggy.v1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + peggy_id: string; + contract_source_hash: string; + bridge_ethereum_address: string; + bridge_chain_id: string; + signed_valsets_window: string; + signed_batches_window: string; + signed_claims_window: string; + target_batch_timeout: string; + average_block_time: string; + average_ethereum_block_time: string; + slash_fraction_valset: string; + slash_fraction_batch: string; + slash_fraction_claim: string; + slash_fraction_conflicting_claim: string; + unbond_slashing_valsets_window: string; + slash_fraction_bad_eth_signature: string; + cosmos_coin_denom: string; + cosmos_coin_erc20_contract: string; + claim_slashing_enabled: boolean; + bridge_contract_start_height: string; + valset_reward: CoinAmino; + admins: string[]; +} +export interface ParamsAminoMsg { + type: "peggy/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + peggyId: "", + contractSourceHash: "", + bridgeEthereumAddress: "", + bridgeChainId: BigInt(0), + signedValsetsWindow: BigInt(0), + signedBatchesWindow: BigInt(0), + signedClaimsWindow: BigInt(0), + targetBatchTimeout: BigInt(0), + averageBlockTime: BigInt(0), + averageEthereumBlockTime: BigInt(0), + slashFractionValset: new Uint8Array(), + slashFractionBatch: new Uint8Array(), + slashFractionClaim: new Uint8Array(), + slashFractionConflictingClaim: new Uint8Array(), + unbondSlashingValsetsWindow: BigInt(0), + slashFractionBadEthSignature: new Uint8Array(), + cosmosCoinDenom: "", + cosmosCoinErc20Contract: "", + claimSlashingEnabled: false, + bridgeContractStartHeight: BigInt(0), + valsetReward: Coin.fromPartial({}), + admins: [] + }; +} +export const Params = { + typeUrl: "/injective.peggy.v1.Params", + aminoType: "peggy/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.peggyId === "string" && typeof o.contractSourceHash === "string" && typeof o.bridgeEthereumAddress === "string" && typeof o.bridgeChainId === "bigint" && typeof o.signedValsetsWindow === "bigint" && typeof o.signedBatchesWindow === "bigint" && typeof o.signedClaimsWindow === "bigint" && typeof o.targetBatchTimeout === "bigint" && typeof o.averageBlockTime === "bigint" && typeof o.averageEthereumBlockTime === "bigint" && (o.slashFractionValset instanceof Uint8Array || typeof o.slashFractionValset === "string") && (o.slashFractionBatch instanceof Uint8Array || typeof o.slashFractionBatch === "string") && (o.slashFractionClaim instanceof Uint8Array || typeof o.slashFractionClaim === "string") && (o.slashFractionConflictingClaim instanceof Uint8Array || typeof o.slashFractionConflictingClaim === "string") && typeof o.unbondSlashingValsetsWindow === "bigint" && (o.slashFractionBadEthSignature instanceof Uint8Array || typeof o.slashFractionBadEthSignature === "string") && typeof o.cosmosCoinDenom === "string" && typeof o.cosmosCoinErc20Contract === "string" && typeof o.claimSlashingEnabled === "boolean" && typeof o.bridgeContractStartHeight === "bigint" && Coin.is(o.valsetReward) && Array.isArray(o.admins) && (!o.admins.length || typeof o.admins[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.peggy_id === "string" && typeof o.contract_source_hash === "string" && typeof o.bridge_ethereum_address === "string" && typeof o.bridge_chain_id === "bigint" && typeof o.signed_valsets_window === "bigint" && typeof o.signed_batches_window === "bigint" && typeof o.signed_claims_window === "bigint" && typeof o.target_batch_timeout === "bigint" && typeof o.average_block_time === "bigint" && typeof o.average_ethereum_block_time === "bigint" && (o.slash_fraction_valset instanceof Uint8Array || typeof o.slash_fraction_valset === "string") && (o.slash_fraction_batch instanceof Uint8Array || typeof o.slash_fraction_batch === "string") && (o.slash_fraction_claim instanceof Uint8Array || typeof o.slash_fraction_claim === "string") && (o.slash_fraction_conflicting_claim instanceof Uint8Array || typeof o.slash_fraction_conflicting_claim === "string") && typeof o.unbond_slashing_valsets_window === "bigint" && (o.slash_fraction_bad_eth_signature instanceof Uint8Array || typeof o.slash_fraction_bad_eth_signature === "string") && typeof o.cosmos_coin_denom === "string" && typeof o.cosmos_coin_erc20_contract === "string" && typeof o.claim_slashing_enabled === "boolean" && typeof o.bridge_contract_start_height === "bigint" && Coin.isAmino(o.valset_reward) && Array.isArray(o.admins) && (!o.admins.length || typeof o.admins[0] === "string")); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.peggyId !== "") { + writer.uint32(10).string(message.peggyId); + } + if (message.contractSourceHash !== "") { + writer.uint32(18).string(message.contractSourceHash); + } + if (message.bridgeEthereumAddress !== "") { + writer.uint32(26).string(message.bridgeEthereumAddress); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(32).uint64(message.bridgeChainId); + } + if (message.signedValsetsWindow !== BigInt(0)) { + writer.uint32(40).uint64(message.signedValsetsWindow); + } + if (message.signedBatchesWindow !== BigInt(0)) { + writer.uint32(48).uint64(message.signedBatchesWindow); + } + if (message.signedClaimsWindow !== BigInt(0)) { + writer.uint32(56).uint64(message.signedClaimsWindow); + } + if (message.targetBatchTimeout !== BigInt(0)) { + writer.uint32(64).uint64(message.targetBatchTimeout); + } + if (message.averageBlockTime !== BigInt(0)) { + writer.uint32(72).uint64(message.averageBlockTime); + } + if (message.averageEthereumBlockTime !== BigInt(0)) { + writer.uint32(80).uint64(message.averageEthereumBlockTime); + } + if (message.slashFractionValset.length !== 0) { + writer.uint32(90).bytes(message.slashFractionValset); + } + if (message.slashFractionBatch.length !== 0) { + writer.uint32(98).bytes(message.slashFractionBatch); + } + if (message.slashFractionClaim.length !== 0) { + writer.uint32(106).bytes(message.slashFractionClaim); + } + if (message.slashFractionConflictingClaim.length !== 0) { + writer.uint32(114).bytes(message.slashFractionConflictingClaim); + } + if (message.unbondSlashingValsetsWindow !== BigInt(0)) { + writer.uint32(120).uint64(message.unbondSlashingValsetsWindow); + } + if (message.slashFractionBadEthSignature.length !== 0) { + writer.uint32(130).bytes(message.slashFractionBadEthSignature); + } + if (message.cosmosCoinDenom !== "") { + writer.uint32(138).string(message.cosmosCoinDenom); + } + if (message.cosmosCoinErc20Contract !== "") { + writer.uint32(146).string(message.cosmosCoinErc20Contract); + } + if (message.claimSlashingEnabled === true) { + writer.uint32(152).bool(message.claimSlashingEnabled); + } + if (message.bridgeContractStartHeight !== BigInt(0)) { + writer.uint32(160).uint64(message.bridgeContractStartHeight); + } + if (message.valsetReward !== undefined) { + Coin.encode(message.valsetReward, writer.uint32(170).fork()).ldelim(); + } + for (const v of message.admins) { + writer.uint32(178).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.peggyId = reader.string(); + break; + case 2: + message.contractSourceHash = reader.string(); + break; + case 3: + message.bridgeEthereumAddress = reader.string(); + break; + case 4: + message.bridgeChainId = reader.uint64(); + break; + case 5: + message.signedValsetsWindow = reader.uint64(); + break; + case 6: + message.signedBatchesWindow = reader.uint64(); + break; + case 7: + message.signedClaimsWindow = reader.uint64(); + break; + case 8: + message.targetBatchTimeout = reader.uint64(); + break; + case 9: + message.averageBlockTime = reader.uint64(); + break; + case 10: + message.averageEthereumBlockTime = reader.uint64(); + break; + case 11: + message.slashFractionValset = reader.bytes(); + break; + case 12: + message.slashFractionBatch = reader.bytes(); + break; + case 13: + message.slashFractionClaim = reader.bytes(); + break; + case 14: + message.slashFractionConflictingClaim = reader.bytes(); + break; + case 15: + message.unbondSlashingValsetsWindow = reader.uint64(); + break; + case 16: + message.slashFractionBadEthSignature = reader.bytes(); + break; + case 17: + message.cosmosCoinDenom = reader.string(); + break; + case 18: + message.cosmosCoinErc20Contract = reader.string(); + break; + case 19: + message.claimSlashingEnabled = reader.bool(); + break; + case 20: + message.bridgeContractStartHeight = reader.uint64(); + break; + case 21: + message.valsetReward = Coin.decode(reader, reader.uint32()); + break; + case 22: + message.admins.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.peggyId = object.peggyId ?? ""; + message.contractSourceHash = object.contractSourceHash ?? ""; + message.bridgeEthereumAddress = object.bridgeEthereumAddress ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.signedValsetsWindow = object.signedValsetsWindow !== undefined && object.signedValsetsWindow !== null ? BigInt(object.signedValsetsWindow.toString()) : BigInt(0); + message.signedBatchesWindow = object.signedBatchesWindow !== undefined && object.signedBatchesWindow !== null ? BigInt(object.signedBatchesWindow.toString()) : BigInt(0); + message.signedClaimsWindow = object.signedClaimsWindow !== undefined && object.signedClaimsWindow !== null ? BigInt(object.signedClaimsWindow.toString()) : BigInt(0); + message.targetBatchTimeout = object.targetBatchTimeout !== undefined && object.targetBatchTimeout !== null ? BigInt(object.targetBatchTimeout.toString()) : BigInt(0); + message.averageBlockTime = object.averageBlockTime !== undefined && object.averageBlockTime !== null ? BigInt(object.averageBlockTime.toString()) : BigInt(0); + message.averageEthereumBlockTime = object.averageEthereumBlockTime !== undefined && object.averageEthereumBlockTime !== null ? BigInt(object.averageEthereumBlockTime.toString()) : BigInt(0); + message.slashFractionValset = object.slashFractionValset ?? new Uint8Array(); + message.slashFractionBatch = object.slashFractionBatch ?? new Uint8Array(); + message.slashFractionClaim = object.slashFractionClaim ?? new Uint8Array(); + message.slashFractionConflictingClaim = object.slashFractionConflictingClaim ?? new Uint8Array(); + message.unbondSlashingValsetsWindow = object.unbondSlashingValsetsWindow !== undefined && object.unbondSlashingValsetsWindow !== null ? BigInt(object.unbondSlashingValsetsWindow.toString()) : BigInt(0); + message.slashFractionBadEthSignature = object.slashFractionBadEthSignature ?? new Uint8Array(); + message.cosmosCoinDenom = object.cosmosCoinDenom ?? ""; + message.cosmosCoinErc20Contract = object.cosmosCoinErc20Contract ?? ""; + message.claimSlashingEnabled = object.claimSlashingEnabled ?? false; + message.bridgeContractStartHeight = object.bridgeContractStartHeight !== undefined && object.bridgeContractStartHeight !== null ? BigInt(object.bridgeContractStartHeight.toString()) : BigInt(0); + message.valsetReward = object.valsetReward !== undefined && object.valsetReward !== null ? Coin.fromPartial(object.valsetReward) : undefined; + message.admins = object.admins?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.peggy_id !== undefined && object.peggy_id !== null) { + message.peggyId = object.peggy_id; + } + if (object.contract_source_hash !== undefined && object.contract_source_hash !== null) { + message.contractSourceHash = object.contract_source_hash; + } + if (object.bridge_ethereum_address !== undefined && object.bridge_ethereum_address !== null) { + message.bridgeEthereumAddress = object.bridge_ethereum_address; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.signed_valsets_window !== undefined && object.signed_valsets_window !== null) { + message.signedValsetsWindow = BigInt(object.signed_valsets_window); + } + if (object.signed_batches_window !== undefined && object.signed_batches_window !== null) { + message.signedBatchesWindow = BigInt(object.signed_batches_window); + } + if (object.signed_claims_window !== undefined && object.signed_claims_window !== null) { + message.signedClaimsWindow = BigInt(object.signed_claims_window); + } + if (object.target_batch_timeout !== undefined && object.target_batch_timeout !== null) { + message.targetBatchTimeout = BigInt(object.target_batch_timeout); + } + if (object.average_block_time !== undefined && object.average_block_time !== null) { + message.averageBlockTime = BigInt(object.average_block_time); + } + if (object.average_ethereum_block_time !== undefined && object.average_ethereum_block_time !== null) { + message.averageEthereumBlockTime = BigInt(object.average_ethereum_block_time); + } + if (object.slash_fraction_valset !== undefined && object.slash_fraction_valset !== null) { + message.slashFractionValset = bytesFromBase64(object.slash_fraction_valset); + } + if (object.slash_fraction_batch !== undefined && object.slash_fraction_batch !== null) { + message.slashFractionBatch = bytesFromBase64(object.slash_fraction_batch); + } + if (object.slash_fraction_claim !== undefined && object.slash_fraction_claim !== null) { + message.slashFractionClaim = bytesFromBase64(object.slash_fraction_claim); + } + if (object.slash_fraction_conflicting_claim !== undefined && object.slash_fraction_conflicting_claim !== null) { + message.slashFractionConflictingClaim = bytesFromBase64(object.slash_fraction_conflicting_claim); + } + if (object.unbond_slashing_valsets_window !== undefined && object.unbond_slashing_valsets_window !== null) { + message.unbondSlashingValsetsWindow = BigInt(object.unbond_slashing_valsets_window); + } + if (object.slash_fraction_bad_eth_signature !== undefined && object.slash_fraction_bad_eth_signature !== null) { + message.slashFractionBadEthSignature = bytesFromBase64(object.slash_fraction_bad_eth_signature); + } + if (object.cosmos_coin_denom !== undefined && object.cosmos_coin_denom !== null) { + message.cosmosCoinDenom = object.cosmos_coin_denom; + } + if (object.cosmos_coin_erc20_contract !== undefined && object.cosmos_coin_erc20_contract !== null) { + message.cosmosCoinErc20Contract = object.cosmos_coin_erc20_contract; + } + if (object.claim_slashing_enabled !== undefined && object.claim_slashing_enabled !== null) { + message.claimSlashingEnabled = object.claim_slashing_enabled; + } + if (object.bridge_contract_start_height !== undefined && object.bridge_contract_start_height !== null) { + message.bridgeContractStartHeight = BigInt(object.bridge_contract_start_height); + } + if (object.valset_reward !== undefined && object.valset_reward !== null) { + message.valsetReward = Coin.fromAmino(object.valset_reward); + } + message.admins = object.admins?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.peggy_id = message.peggyId === "" ? undefined : message.peggyId; + obj.contract_source_hash = message.contractSourceHash === "" ? undefined : message.contractSourceHash; + obj.bridge_ethereum_address = message.bridgeEthereumAddress === "" ? undefined : message.bridgeEthereumAddress; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.signed_valsets_window = message.signedValsetsWindow !== BigInt(0) ? message.signedValsetsWindow?.toString() : undefined; + obj.signed_batches_window = message.signedBatchesWindow !== BigInt(0) ? message.signedBatchesWindow?.toString() : undefined; + obj.signed_claims_window = message.signedClaimsWindow !== BigInt(0) ? message.signedClaimsWindow?.toString() : undefined; + obj.target_batch_timeout = message.targetBatchTimeout !== BigInt(0) ? message.targetBatchTimeout?.toString() : undefined; + obj.average_block_time = message.averageBlockTime !== BigInt(0) ? message.averageBlockTime?.toString() : undefined; + obj.average_ethereum_block_time = message.averageEthereumBlockTime !== BigInt(0) ? message.averageEthereumBlockTime?.toString() : undefined; + obj.slash_fraction_valset = message.slashFractionValset ? base64FromBytes(message.slashFractionValset) : undefined; + obj.slash_fraction_batch = message.slashFractionBatch ? base64FromBytes(message.slashFractionBatch) : undefined; + obj.slash_fraction_claim = message.slashFractionClaim ? base64FromBytes(message.slashFractionClaim) : undefined; + obj.slash_fraction_conflicting_claim = message.slashFractionConflictingClaim ? base64FromBytes(message.slashFractionConflictingClaim) : undefined; + obj.unbond_slashing_valsets_window = message.unbondSlashingValsetsWindow !== BigInt(0) ? message.unbondSlashingValsetsWindow?.toString() : undefined; + obj.slash_fraction_bad_eth_signature = message.slashFractionBadEthSignature ? base64FromBytes(message.slashFractionBadEthSignature) : undefined; + obj.cosmos_coin_denom = message.cosmosCoinDenom === "" ? undefined : message.cosmosCoinDenom; + obj.cosmos_coin_erc20_contract = message.cosmosCoinErc20Contract === "" ? undefined : message.cosmosCoinErc20Contract; + obj.claim_slashing_enabled = message.claimSlashingEnabled === false ? undefined : message.claimSlashingEnabled; + obj.bridge_contract_start_height = message.bridgeContractStartHeight !== BigInt(0) ? message.bridgeContractStartHeight?.toString() : undefined; + obj.valset_reward = message.valsetReward ? Coin.toAmino(message.valsetReward) : undefined; + if (message.admins) { + obj.admins = message.admins.map(e => e); + } else { + obj.admins = message.admins; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "peggy/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: "/injective.peggy.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/pool.ts b/libs/injective-query/src/injective/peggy/v1/pool.ts new file mode 100644 index 00000000..3b46adc4 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/pool.ts @@ -0,0 +1,198 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** IDSet represents a set of IDs */ +export interface IDSet { + ids: bigint[]; +} +export interface IDSetProtoMsg { + typeUrl: "/injective.peggy.v1.IDSet"; + value: Uint8Array; +} +/** IDSet represents a set of IDs */ +export interface IDSetAmino { + ids: string[]; +} +export interface IDSetAminoMsg { + type: "/injective.peggy.v1.IDSet"; + value: IDSetAmino; +} +export interface BatchFees { + token: string; + totalFees: string; +} +export interface BatchFeesProtoMsg { + typeUrl: "/injective.peggy.v1.BatchFees"; + value: Uint8Array; +} +export interface BatchFeesAmino { + token: string; + total_fees: string; +} +export interface BatchFeesAminoMsg { + type: "/injective.peggy.v1.BatchFees"; + value: BatchFeesAmino; +} +function createBaseIDSet(): IDSet { + return { + ids: [] + }; +} +export const IDSet = { + typeUrl: "/injective.peggy.v1.IDSet", + is(o: any): o is IDSet { + return o && (o.$typeUrl === IDSet.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + isAmino(o: any): o is IDSetAmino { + return o && (o.$typeUrl === IDSet.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + encode(message: IDSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.ids) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IDSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIDSet(); + 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.ids.push(reader.uint64()); + } + } else { + message.ids.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IDSet { + const message = createBaseIDSet(); + message.ids = object.ids?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: IDSetAmino): IDSet { + const message = createBaseIDSet(); + message.ids = object.ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: IDSet): IDSetAmino { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map(e => e.toString()); + } else { + obj.ids = message.ids; + } + return obj; + }, + fromAminoMsg(object: IDSetAminoMsg): IDSet { + return IDSet.fromAmino(object.value); + }, + fromProtoMsg(message: IDSetProtoMsg): IDSet { + return IDSet.decode(message.value); + }, + toProto(message: IDSet): Uint8Array { + return IDSet.encode(message).finish(); + }, + toProtoMsg(message: IDSet): IDSetProtoMsg { + return { + typeUrl: "/injective.peggy.v1.IDSet", + value: IDSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IDSet.typeUrl, IDSet); +function createBaseBatchFees(): BatchFees { + return { + token: "", + totalFees: "" + }; +} +export const BatchFees = { + typeUrl: "/injective.peggy.v1.BatchFees", + is(o: any): o is BatchFees { + return o && (o.$typeUrl === BatchFees.typeUrl || typeof o.token === "string" && typeof o.totalFees === "string"); + }, + isAmino(o: any): o is BatchFeesAmino { + return o && (o.$typeUrl === BatchFees.typeUrl || typeof o.token === "string" && typeof o.total_fees === "string"); + }, + encode(message: BatchFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + if (message.totalFees !== "") { + writer.uint32(18).string(message.totalFees); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchFees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchFees(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = reader.string(); + break; + case 2: + message.totalFees = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchFees { + const message = createBaseBatchFees(); + message.token = object.token ?? ""; + message.totalFees = object.totalFees ?? ""; + return message; + }, + fromAmino(object: BatchFeesAmino): BatchFees { + const message = createBaseBatchFees(); + if (object.token !== undefined && object.token !== null) { + message.token = object.token; + } + if (object.total_fees !== undefined && object.total_fees !== null) { + message.totalFees = object.total_fees; + } + return message; + }, + toAmino(message: BatchFees): BatchFeesAmino { + const obj: any = {}; + obj.token = message.token === "" ? undefined : message.token; + obj.total_fees = message.totalFees === "" ? undefined : message.totalFees; + return obj; + }, + fromAminoMsg(object: BatchFeesAminoMsg): BatchFees { + return BatchFees.fromAmino(object.value); + }, + fromProtoMsg(message: BatchFeesProtoMsg): BatchFees { + return BatchFees.decode(message.value); + }, + toProto(message: BatchFees): Uint8Array { + return BatchFees.encode(message).finish(); + }, + toProtoMsg(message: BatchFees): BatchFeesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BatchFees", + value: BatchFees.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchFees.typeUrl, BatchFees); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/proposal.ts b/libs/injective-query/src/injective/peggy/v1/proposal.ts new file mode 100644 index 00000000..cf60d937 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/proposal.ts @@ -0,0 +1,231 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface BlacklistEthereumAddressesProposal { + title: string; + description: string; + blacklistAddresses: string[]; +} +export interface BlacklistEthereumAddressesProposalProtoMsg { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal"; + value: Uint8Array; +} +export interface BlacklistEthereumAddressesProposalAmino { + title: string; + description: string; + blacklist_addresses: string[]; +} +export interface BlacklistEthereumAddressesProposalAminoMsg { + type: "/injective.peggy.v1.BlacklistEthereumAddressesProposal"; + value: BlacklistEthereumAddressesProposalAmino; +} +export interface RevokeEthereumBlacklistProposal { + title: string; + description: string; + blacklistAddresses: string[]; +} +export interface RevokeEthereumBlacklistProposalProtoMsg { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal"; + value: Uint8Array; +} +export interface RevokeEthereumBlacklistProposalAmino { + title: string; + description: string; + blacklist_addresses: string[]; +} +export interface RevokeEthereumBlacklistProposalAminoMsg { + type: "/injective.peggy.v1.RevokeEthereumBlacklistProposal"; + value: RevokeEthereumBlacklistProposalAmino; +} +function createBaseBlacklistEthereumAddressesProposal(): BlacklistEthereumAddressesProposal { + return { + title: "", + description: "", + blacklistAddresses: [] + }; +} +export const BlacklistEthereumAddressesProposal = { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal", + is(o: any): o is BlacklistEthereumAddressesProposal { + return o && (o.$typeUrl === BlacklistEthereumAddressesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is BlacklistEthereumAddressesProposalAmino { + return o && (o.$typeUrl === BlacklistEthereumAddressesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: BlacklistEthereumAddressesProposal, 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.blacklistAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlacklistEthereumAddressesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlacklistEthereumAddressesProposal(); + 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.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlacklistEthereumAddressesProposal { + const message = createBaseBlacklistEthereumAddressesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: BlacklistEthereumAddressesProposalAmino): BlacklistEthereumAddressesProposal { + const message = createBaseBlacklistEthereumAddressesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: BlacklistEthereumAddressesProposal): BlacklistEthereumAddressesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: BlacklistEthereumAddressesProposalAminoMsg): BlacklistEthereumAddressesProposal { + return BlacklistEthereumAddressesProposal.fromAmino(object.value); + }, + fromProtoMsg(message: BlacklistEthereumAddressesProposalProtoMsg): BlacklistEthereumAddressesProposal { + return BlacklistEthereumAddressesProposal.decode(message.value); + }, + toProto(message: BlacklistEthereumAddressesProposal): Uint8Array { + return BlacklistEthereumAddressesProposal.encode(message).finish(); + }, + toProtoMsg(message: BlacklistEthereumAddressesProposal): BlacklistEthereumAddressesProposalProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal", + value: BlacklistEthereumAddressesProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlacklistEthereumAddressesProposal.typeUrl, BlacklistEthereumAddressesProposal); +function createBaseRevokeEthereumBlacklistProposal(): RevokeEthereumBlacklistProposal { + return { + title: "", + description: "", + blacklistAddresses: [] + }; +} +export const RevokeEthereumBlacklistProposal = { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal", + is(o: any): o is RevokeEthereumBlacklistProposal { + return o && (o.$typeUrl === RevokeEthereumBlacklistProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is RevokeEthereumBlacklistProposalAmino { + return o && (o.$typeUrl === RevokeEthereumBlacklistProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: RevokeEthereumBlacklistProposal, 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.blacklistAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeEthereumBlacklistProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeEthereumBlacklistProposal(); + 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.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeEthereumBlacklistProposal { + const message = createBaseRevokeEthereumBlacklistProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeEthereumBlacklistProposalAmino): RevokeEthereumBlacklistProposal { + const message = createBaseRevokeEthereumBlacklistProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeEthereumBlacklistProposal): RevokeEthereumBlacklistProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: RevokeEthereumBlacklistProposalAminoMsg): RevokeEthereumBlacklistProposal { + return RevokeEthereumBlacklistProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RevokeEthereumBlacklistProposalProtoMsg): RevokeEthereumBlacklistProposal { + return RevokeEthereumBlacklistProposal.decode(message.value); + }, + toProto(message: RevokeEthereumBlacklistProposal): Uint8Array { + return RevokeEthereumBlacklistProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeEthereumBlacklistProposal): RevokeEthereumBlacklistProposalProtoMsg { + return { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal", + value: RevokeEthereumBlacklistProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeEthereumBlacklistProposal.typeUrl, RevokeEthereumBlacklistProposal); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/query.rpc.func.ts b/libs/injective-query/src/injective/peggy/v1/query.rpc.func.ts new file mode 100644 index 00000000..80f72ba1 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/query.rpc.func.ts @@ -0,0 +1,234 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.peggy.v1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetCurrentValset = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentValsetRequest.encode, + decode: QueryCurrentValsetResponse.decode, + service: "injective.peggy.v1.Query", + method: "CurrentValset", + clientResolver +}); +export const useGetCurrentValset = buildUseQuery({ + builderQueryFn: createGetCurrentValset, + queryKeyPrefix: "CurrentValsetQuery" +}); +export const createGetValsetRequest = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetRequestRequest.encode, + decode: QueryValsetRequestResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetRequest", + clientResolver +}); +export const useGetValsetRequest = buildUseQuery({ + builderQueryFn: createGetValsetRequest, + queryKeyPrefix: "ValsetRequestQuery" +}); +export const createGetValsetConfirm = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmRequest.encode, + decode: QueryValsetConfirmResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirm", + clientResolver +}); +export const useGetValsetConfirm = buildUseQuery({ + builderQueryFn: createGetValsetConfirm, + queryKeyPrefix: "ValsetConfirmQuery" +}); +export const createGetValsetConfirmsByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmsByNonceRequest.encode, + decode: QueryValsetConfirmsByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirmsByNonce", + clientResolver +}); +export const useGetValsetConfirmsByNonce = buildUseQuery({ + builderQueryFn: createGetValsetConfirmsByNonce, + queryKeyPrefix: "ValsetConfirmsByNonceQuery" +}); +export const createGetLastValsetRequests = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastValsetRequestsRequest.encode, + decode: QueryLastValsetRequestsResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastValsetRequests", + clientResolver +}); +export const useGetLastValsetRequests = buildUseQuery({ + builderQueryFn: createGetLastValsetRequests, + queryKeyPrefix: "LastValsetRequestsQuery" +}); +export const createGetLastPendingValsetRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingValsetRequestByAddrRequest.encode, + decode: QueryLastPendingValsetRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingValsetRequestByAddr", + clientResolver +}); +export const useGetLastPendingValsetRequestByAddr = buildUseQuery({ + builderQueryFn: createGetLastPendingValsetRequestByAddr, + queryKeyPrefix: "LastPendingValsetRequestByAddrQuery" +}); +export const createGetLastEventByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastEventByAddrRequest.encode, + decode: QueryLastEventByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastEventByAddr", + clientResolver +}); +export const useGetLastEventByAddr = buildUseQuery({ + builderQueryFn: createGetLastEventByAddr, + queryKeyPrefix: "LastEventByAddrQuery" +}); +export const createGetGetPendingSendToEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingSendToEth.encode, + decode: QueryPendingSendToEthResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetPendingSendToEth", + clientResolver +}); +export const useGetGetPendingSendToEth = buildUseQuery({ + builderQueryFn: createGetGetPendingSendToEth, + queryKeyPrefix: "GetPendingSendToEthQuery" +}); +export const createGetBatchFees = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchFeeRequest.encode, + decode: QueryBatchFeeResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchFees", + clientResolver +}); +export const useGetBatchFees = buildUseQuery({ + builderQueryFn: createGetBatchFees, + queryKeyPrefix: "BatchFeesQuery" +}); +export const createGetOutgoingTxBatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOutgoingTxBatchesRequest.encode, + decode: QueryOutgoingTxBatchesResponse.decode, + service: "injective.peggy.v1.Query", + method: "OutgoingTxBatches", + clientResolver +}); +export const useGetOutgoingTxBatches = buildUseQuery({ + builderQueryFn: createGetOutgoingTxBatches, + queryKeyPrefix: "OutgoingTxBatchesQuery" +}); +export const createGetLastPendingBatchRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingBatchRequestByAddrRequest.encode, + decode: QueryLastPendingBatchRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingBatchRequestByAddr", + clientResolver +}); +export const useGetLastPendingBatchRequestByAddr = buildUseQuery({ + builderQueryFn: createGetLastPendingBatchRequestByAddr, + queryKeyPrefix: "LastPendingBatchRequestByAddrQuery" +}); +export const createGetBatchRequestByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchRequestByNonceRequest.encode, + decode: QueryBatchRequestByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchRequestByNonce", + clientResolver +}); +export const useGetBatchRequestByNonce = buildUseQuery({ + builderQueryFn: createGetBatchRequestByNonce, + queryKeyPrefix: "BatchRequestByNonceQuery" +}); +export const createGetBatchConfirms = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchConfirmsRequest.encode, + decode: QueryBatchConfirmsResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchConfirms", + clientResolver +}); +export const useGetBatchConfirms = buildUseQuery({ + builderQueryFn: createGetBatchConfirms, + queryKeyPrefix: "BatchConfirmsQuery" +}); +export const createGetERC20ToDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryERC20ToDenomRequest.encode, + decode: QueryERC20ToDenomResponse.decode, + service: "injective.peggy.v1.Query", + method: "ERC20ToDenom", + clientResolver +}); +export const useGetERC20ToDenom = buildUseQuery({ + builderQueryFn: createGetERC20ToDenom, + queryKeyPrefix: "ERC20ToDenomQuery" +}); +export const createGetDenomToERC20 = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomToERC20Request.encode, + decode: QueryDenomToERC20Response.decode, + service: "injective.peggy.v1.Query", + method: "DenomToERC20", + clientResolver +}); +export const useGetDenomToERC20 = buildUseQuery({ + builderQueryFn: createGetDenomToERC20, + queryKeyPrefix: "DenomToERC20Query" +}); +export const createGetGetDelegateKeyByValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByValidatorAddress.encode, + decode: QueryDelegateKeysByValidatorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByValidator", + clientResolver +}); +export const useGetGetDelegateKeyByValidator = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByValidator, + queryKeyPrefix: "GetDelegateKeyByValidatorQuery" +}); +export const createGetGetDelegateKeyByEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByEthAddress.encode, + decode: QueryDelegateKeysByEthAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByEth", + clientResolver +}); +export const useGetGetDelegateKeyByEth = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByEth, + queryKeyPrefix: "GetDelegateKeyByEthQuery" +}); +export const createGetGetDelegateKeyByOrchestrator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByOrchestratorAddress.encode, + decode: QueryDelegateKeysByOrchestratorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByOrchestrator", + clientResolver +}); +export const useGetGetDelegateKeyByOrchestrator = buildUseQuery({ + builderQueryFn: createGetGetDelegateKeyByOrchestrator, + queryKeyPrefix: "GetDelegateKeyByOrchestratorQuery" +}); +export const createGetPeggyModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.peggy.v1.Query", + method: "PeggyModuleState", + clientResolver +}); +export const useGetPeggyModuleState = buildUseQuery({ + builderQueryFn: createGetPeggyModuleState, + queryKeyPrefix: "PeggyModuleStateQuery" +}); +export const createGetMissingPeggoNonces = (clientResolver?: RpcResolver) => buildQuery({ + encode: MissingNoncesRequest.encode, + decode: MissingNoncesResponse.decode, + service: "injective.peggy.v1.Query", + method: "MissingPeggoNonces", + clientResolver +}); +export const useGetMissingPeggoNonces = buildUseQuery({ + builderQueryFn: createGetMissingPeggoNonces, + queryKeyPrefix: "MissingPeggoNoncesQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/query.ts b/libs/injective-query/src/injective/peggy/v1/query.ts new file mode 100644 index 00000000..f325d5d4 --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/query.ts @@ -0,0 +1,3578 @@ +import { Params, ParamsAmino } from "./params"; +import { Valset, ValsetAmino, LastClaimEvent, LastClaimEventAmino } from "./types"; +import { MsgValsetConfirm, MsgValsetConfirmAmino, MsgConfirmBatch, MsgConfirmBatchAmino } from "./msgs"; +import { BatchFees, BatchFeesAmino } from "./pool"; +import { OutgoingTxBatch, OutgoingTxBatchAmino, OutgoingTransferTx, OutgoingTransferTxAmino } from "./batch"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.peggy.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.peggy.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +export interface QueryCurrentValsetRequest {} +export interface QueryCurrentValsetRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest"; + value: Uint8Array; +} +export interface QueryCurrentValsetRequestAmino {} +export interface QueryCurrentValsetRequestAminoMsg { + type: "/injective.peggy.v1.QueryCurrentValsetRequest"; + value: QueryCurrentValsetRequestAmino; +} +export interface QueryCurrentValsetResponse { + valset?: Valset; +} +export interface QueryCurrentValsetResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse"; + value: Uint8Array; +} +export interface QueryCurrentValsetResponseAmino { + valset?: ValsetAmino; +} +export interface QueryCurrentValsetResponseAminoMsg { + type: "/injective.peggy.v1.QueryCurrentValsetResponse"; + value: QueryCurrentValsetResponseAmino; +} +export interface QueryValsetRequestRequest { + nonce: bigint; +} +export interface QueryValsetRequestRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest"; + value: Uint8Array; +} +export interface QueryValsetRequestRequestAmino { + nonce: string; +} +export interface QueryValsetRequestRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetRequestRequest"; + value: QueryValsetRequestRequestAmino; +} +export interface QueryValsetRequestResponse { + valset?: Valset; +} +export interface QueryValsetRequestResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse"; + value: Uint8Array; +} +export interface QueryValsetRequestResponseAmino { + valset?: ValsetAmino; +} +export interface QueryValsetRequestResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetRequestResponse"; + value: QueryValsetRequestResponseAmino; +} +export interface QueryValsetConfirmRequest { + nonce: bigint; + address: string; +} +export interface QueryValsetConfirmRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest"; + value: Uint8Array; +} +export interface QueryValsetConfirmRequestAmino { + nonce: string; + address: string; +} +export interface QueryValsetConfirmRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmRequest"; + value: QueryValsetConfirmRequestAmino; +} +export interface QueryValsetConfirmResponse { + confirm?: MsgValsetConfirm; +} +export interface QueryValsetConfirmResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse"; + value: Uint8Array; +} +export interface QueryValsetConfirmResponseAmino { + confirm?: MsgValsetConfirmAmino; +} +export interface QueryValsetConfirmResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmResponse"; + value: QueryValsetConfirmResponseAmino; +} +export interface QueryValsetConfirmsByNonceRequest { + nonce: bigint; +} +export interface QueryValsetConfirmsByNonceRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest"; + value: Uint8Array; +} +export interface QueryValsetConfirmsByNonceRequestAmino { + nonce: string; +} +export interface QueryValsetConfirmsByNonceRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest"; + value: QueryValsetConfirmsByNonceRequestAmino; +} +export interface QueryValsetConfirmsByNonceResponse { + confirms: MsgValsetConfirm[]; +} +export interface QueryValsetConfirmsByNonceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse"; + value: Uint8Array; +} +export interface QueryValsetConfirmsByNonceResponseAmino { + confirms: MsgValsetConfirmAmino[]; +} +export interface QueryValsetConfirmsByNonceResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse"; + value: QueryValsetConfirmsByNonceResponseAmino; +} +export interface QueryLastValsetRequestsRequest {} +export interface QueryLastValsetRequestsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest"; + value: Uint8Array; +} +export interface QueryLastValsetRequestsRequestAmino {} +export interface QueryLastValsetRequestsRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastValsetRequestsRequest"; + value: QueryLastValsetRequestsRequestAmino; +} +export interface QueryLastValsetRequestsResponse { + valsets: Valset[]; +} +export interface QueryLastValsetRequestsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse"; + value: Uint8Array; +} +export interface QueryLastValsetRequestsResponseAmino { + valsets: ValsetAmino[]; +} +export interface QueryLastValsetRequestsResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastValsetRequestsResponse"; + value: QueryLastValsetRequestsResponseAmino; +} +export interface QueryLastPendingValsetRequestByAddrRequest { + address: string; +} +export interface QueryLastPendingValsetRequestByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastPendingValsetRequestByAddrRequestAmino { + address: string; +} +export interface QueryLastPendingValsetRequestByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest"; + value: QueryLastPendingValsetRequestByAddrRequestAmino; +} +export interface QueryLastPendingValsetRequestByAddrResponse { + valsets: Valset[]; +} +export interface QueryLastPendingValsetRequestByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastPendingValsetRequestByAddrResponseAmino { + valsets: ValsetAmino[]; +} +export interface QueryLastPendingValsetRequestByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse"; + value: QueryLastPendingValsetRequestByAddrResponseAmino; +} +export interface QueryBatchFeeRequest {} +export interface QueryBatchFeeRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest"; + value: Uint8Array; +} +export interface QueryBatchFeeRequestAmino {} +export interface QueryBatchFeeRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchFeeRequest"; + value: QueryBatchFeeRequestAmino; +} +export interface QueryBatchFeeResponse { + batchFees: BatchFees[]; +} +export interface QueryBatchFeeResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse"; + value: Uint8Array; +} +export interface QueryBatchFeeResponseAmino { + batchFees: BatchFeesAmino[]; +} +export interface QueryBatchFeeResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchFeeResponse"; + value: QueryBatchFeeResponseAmino; +} +export interface QueryLastPendingBatchRequestByAddrRequest { + address: string; +} +export interface QueryLastPendingBatchRequestByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastPendingBatchRequestByAddrRequestAmino { + address: string; +} +export interface QueryLastPendingBatchRequestByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest"; + value: QueryLastPendingBatchRequestByAddrRequestAmino; +} +export interface QueryLastPendingBatchRequestByAddrResponse { + batch?: OutgoingTxBatch; +} +export interface QueryLastPendingBatchRequestByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastPendingBatchRequestByAddrResponseAmino { + batch?: OutgoingTxBatchAmino; +} +export interface QueryLastPendingBatchRequestByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse"; + value: QueryLastPendingBatchRequestByAddrResponseAmino; +} +export interface QueryOutgoingTxBatchesRequest {} +export interface QueryOutgoingTxBatchesRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest"; + value: Uint8Array; +} +export interface QueryOutgoingTxBatchesRequestAmino {} +export interface QueryOutgoingTxBatchesRequestAminoMsg { + type: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest"; + value: QueryOutgoingTxBatchesRequestAmino; +} +export interface QueryOutgoingTxBatchesResponse { + batches: OutgoingTxBatch[]; +} +export interface QueryOutgoingTxBatchesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse"; + value: Uint8Array; +} +export interface QueryOutgoingTxBatchesResponseAmino { + batches: OutgoingTxBatchAmino[]; +} +export interface QueryOutgoingTxBatchesResponseAminoMsg { + type: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse"; + value: QueryOutgoingTxBatchesResponseAmino; +} +export interface QueryBatchRequestByNonceRequest { + nonce: bigint; + contractAddress: string; +} +export interface QueryBatchRequestByNonceRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest"; + value: Uint8Array; +} +export interface QueryBatchRequestByNonceRequestAmino { + nonce: string; + contract_address: string; +} +export interface QueryBatchRequestByNonceRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchRequestByNonceRequest"; + value: QueryBatchRequestByNonceRequestAmino; +} +export interface QueryBatchRequestByNonceResponse { + batch?: OutgoingTxBatch; +} +export interface QueryBatchRequestByNonceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse"; + value: Uint8Array; +} +export interface QueryBatchRequestByNonceResponseAmino { + batch?: OutgoingTxBatchAmino; +} +export interface QueryBatchRequestByNonceResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchRequestByNonceResponse"; + value: QueryBatchRequestByNonceResponseAmino; +} +export interface QueryBatchConfirmsRequest { + nonce: bigint; + contractAddress: string; +} +export interface QueryBatchConfirmsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest"; + value: Uint8Array; +} +export interface QueryBatchConfirmsRequestAmino { + nonce: string; + contract_address: string; +} +export interface QueryBatchConfirmsRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchConfirmsRequest"; + value: QueryBatchConfirmsRequestAmino; +} +export interface QueryBatchConfirmsResponse { + confirms: MsgConfirmBatch[]; +} +export interface QueryBatchConfirmsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse"; + value: Uint8Array; +} +export interface QueryBatchConfirmsResponseAmino { + confirms: MsgConfirmBatchAmino[]; +} +export interface QueryBatchConfirmsResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchConfirmsResponse"; + value: QueryBatchConfirmsResponseAmino; +} +export interface QueryLastEventByAddrRequest { + address: string; +} +export interface QueryLastEventByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastEventByAddrRequestAmino { + address: string; +} +export interface QueryLastEventByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastEventByAddrRequest"; + value: QueryLastEventByAddrRequestAmino; +} +export interface QueryLastEventByAddrResponse { + lastClaimEvent?: LastClaimEvent; +} +export interface QueryLastEventByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastEventByAddrResponseAmino { + last_claim_event?: LastClaimEventAmino; +} +export interface QueryLastEventByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastEventByAddrResponse"; + value: QueryLastEventByAddrResponseAmino; +} +export interface QueryERC20ToDenomRequest { + erc20: string; +} +export interface QueryERC20ToDenomRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest"; + value: Uint8Array; +} +export interface QueryERC20ToDenomRequestAmino { + erc20: string; +} +export interface QueryERC20ToDenomRequestAminoMsg { + type: "/injective.peggy.v1.QueryERC20ToDenomRequest"; + value: QueryERC20ToDenomRequestAmino; +} +export interface QueryERC20ToDenomResponse { + denom: string; + cosmosOriginated: boolean; +} +export interface QueryERC20ToDenomResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse"; + value: Uint8Array; +} +export interface QueryERC20ToDenomResponseAmino { + denom: string; + cosmos_originated: boolean; +} +export interface QueryERC20ToDenomResponseAminoMsg { + type: "/injective.peggy.v1.QueryERC20ToDenomResponse"; + value: QueryERC20ToDenomResponseAmino; +} +export interface QueryDenomToERC20Request { + denom: string; +} +export interface QueryDenomToERC20RequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request"; + value: Uint8Array; +} +export interface QueryDenomToERC20RequestAmino { + denom: string; +} +export interface QueryDenomToERC20RequestAminoMsg { + type: "/injective.peggy.v1.QueryDenomToERC20Request"; + value: QueryDenomToERC20RequestAmino; +} +export interface QueryDenomToERC20Response { + erc20: string; + cosmosOriginated: boolean; +} +export interface QueryDenomToERC20ResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response"; + value: Uint8Array; +} +export interface QueryDenomToERC20ResponseAmino { + erc20: string; + cosmos_originated: boolean; +} +export interface QueryDenomToERC20ResponseAminoMsg { + type: "/injective.peggy.v1.QueryDenomToERC20Response"; + value: QueryDenomToERC20ResponseAmino; +} +export interface QueryDelegateKeysByValidatorAddress { + validatorAddress: string; +} +export interface QueryDelegateKeysByValidatorAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByValidatorAddressAmino { + validator_address: string; +} +export interface QueryDelegateKeysByValidatorAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress"; + value: QueryDelegateKeysByValidatorAddressAmino; +} +export interface QueryDelegateKeysByValidatorAddressResponse { + ethAddress: string; + orchestratorAddress: string; +} +export interface QueryDelegateKeysByValidatorAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByValidatorAddressResponseAmino { + eth_address: string; + orchestrator_address: string; +} +export interface QueryDelegateKeysByValidatorAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse"; + value: QueryDelegateKeysByValidatorAddressResponseAmino; +} +export interface QueryDelegateKeysByEthAddress { + ethAddress: string; +} +export interface QueryDelegateKeysByEthAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByEthAddressAmino { + eth_address: string; +} +export interface QueryDelegateKeysByEthAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByEthAddress"; + value: QueryDelegateKeysByEthAddressAmino; +} +export interface QueryDelegateKeysByEthAddressResponse { + validatorAddress: string; + orchestratorAddress: string; +} +export interface QueryDelegateKeysByEthAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByEthAddressResponseAmino { + validator_address: string; + orchestrator_address: string; +} +export interface QueryDelegateKeysByEthAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse"; + value: QueryDelegateKeysByEthAddressResponseAmino; +} +export interface QueryDelegateKeysByOrchestratorAddress { + orchestratorAddress: string; +} +export interface QueryDelegateKeysByOrchestratorAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByOrchestratorAddressAmino { + orchestrator_address: string; +} +export interface QueryDelegateKeysByOrchestratorAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress"; + value: QueryDelegateKeysByOrchestratorAddressAmino; +} +export interface QueryDelegateKeysByOrchestratorAddressResponse { + validatorAddress: string; + ethAddress: string; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseAmino { + validator_address: string; + eth_address: string; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse"; + value: QueryDelegateKeysByOrchestratorAddressResponseAmino; +} +export interface QueryPendingSendToEth { + senderAddress: string; +} +export interface QueryPendingSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth"; + value: Uint8Array; +} +export interface QueryPendingSendToEthAmino { + sender_address: string; +} +export interface QueryPendingSendToEthAminoMsg { + type: "/injective.peggy.v1.QueryPendingSendToEth"; + value: QueryPendingSendToEthAmino; +} +export interface QueryPendingSendToEthResponse { + transfersInBatches: OutgoingTransferTx[]; + unbatchedTransfers: OutgoingTransferTx[]; +} +export interface QueryPendingSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse"; + value: Uint8Array; +} +export interface QueryPendingSendToEthResponseAmino { + transfers_in_batches: OutgoingTransferTxAmino[]; + unbatched_transfers: OutgoingTransferTxAmino[]; +} +export interface QueryPendingSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.QueryPendingSendToEthResponse"; + value: QueryPendingSendToEthResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.peggy.v1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.peggy.v1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface MissingNoncesRequest {} +export interface MissingNoncesRequestProtoMsg { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest"; + value: Uint8Array; +} +export interface MissingNoncesRequestAmino {} +export interface MissingNoncesRequestAminoMsg { + type: "/injective.peggy.v1.MissingNoncesRequest"; + value: MissingNoncesRequestAmino; +} +export interface MissingNoncesResponse { + operatorAddresses: string[]; +} +export interface MissingNoncesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse"; + value: Uint8Array; +} +export interface MissingNoncesResponseAmino { + operator_addresses: string[]; +} +export interface MissingNoncesResponseAminoMsg { + type: "/injective.peggy.v1.MissingNoncesResponse"; + value: MissingNoncesResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.peggy.v1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.peggy.v1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryCurrentValsetRequest(): QueryCurrentValsetRequest { + return {}; +} +export const QueryCurrentValsetRequest = { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest", + is(o: any): o is QueryCurrentValsetRequest { + return o && o.$typeUrl === QueryCurrentValsetRequest.typeUrl; + }, + isAmino(o: any): o is QueryCurrentValsetRequestAmino { + return o && o.$typeUrl === QueryCurrentValsetRequest.typeUrl; + }, + encode(_: QueryCurrentValsetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentValsetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentValsetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCurrentValsetRequest { + const message = createBaseQueryCurrentValsetRequest(); + return message; + }, + fromAmino(_: QueryCurrentValsetRequestAmino): QueryCurrentValsetRequest { + const message = createBaseQueryCurrentValsetRequest(); + return message; + }, + toAmino(_: QueryCurrentValsetRequest): QueryCurrentValsetRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCurrentValsetRequestAminoMsg): QueryCurrentValsetRequest { + return QueryCurrentValsetRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentValsetRequestProtoMsg): QueryCurrentValsetRequest { + return QueryCurrentValsetRequest.decode(message.value); + }, + toProto(message: QueryCurrentValsetRequest): Uint8Array { + return QueryCurrentValsetRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentValsetRequest): QueryCurrentValsetRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest", + value: QueryCurrentValsetRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentValsetRequest.typeUrl, QueryCurrentValsetRequest); +function createBaseQueryCurrentValsetResponse(): QueryCurrentValsetResponse { + return { + valset: undefined + }; +} +export const QueryCurrentValsetResponse = { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse", + is(o: any): o is QueryCurrentValsetResponse { + return o && o.$typeUrl === QueryCurrentValsetResponse.typeUrl; + }, + isAmino(o: any): o is QueryCurrentValsetResponseAmino { + return o && o.$typeUrl === QueryCurrentValsetResponse.typeUrl; + }, + encode(message: QueryCurrentValsetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valset !== undefined) { + Valset.encode(message.valset, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentValsetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentValsetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valset = Valset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCurrentValsetResponse { + const message = createBaseQueryCurrentValsetResponse(); + message.valset = object.valset !== undefined && object.valset !== null ? Valset.fromPartial(object.valset) : undefined; + return message; + }, + fromAmino(object: QueryCurrentValsetResponseAmino): QueryCurrentValsetResponse { + const message = createBaseQueryCurrentValsetResponse(); + if (object.valset !== undefined && object.valset !== null) { + message.valset = Valset.fromAmino(object.valset); + } + return message; + }, + toAmino(message: QueryCurrentValsetResponse): QueryCurrentValsetResponseAmino { + const obj: any = {}; + obj.valset = message.valset ? Valset.toAmino(message.valset) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCurrentValsetResponseAminoMsg): QueryCurrentValsetResponse { + return QueryCurrentValsetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentValsetResponseProtoMsg): QueryCurrentValsetResponse { + return QueryCurrentValsetResponse.decode(message.value); + }, + toProto(message: QueryCurrentValsetResponse): Uint8Array { + return QueryCurrentValsetResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentValsetResponse): QueryCurrentValsetResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse", + value: QueryCurrentValsetResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentValsetResponse.typeUrl, QueryCurrentValsetResponse); +function createBaseQueryValsetRequestRequest(): QueryValsetRequestRequest { + return { + nonce: BigInt(0) + }; +} +export const QueryValsetRequestRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest", + is(o: any): o is QueryValsetRequestRequest { + return o && (o.$typeUrl === QueryValsetRequestRequest.typeUrl || typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is QueryValsetRequestRequestAmino { + return o && (o.$typeUrl === QueryValsetRequestRequest.typeUrl || typeof o.nonce === "bigint"); + }, + encode(message: QueryValsetRequestRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetRequestRequest { + const message = createBaseQueryValsetRequestRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryValsetRequestRequestAmino): QueryValsetRequestRequest { + const message = createBaseQueryValsetRequestRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: QueryValsetRequestRequest): QueryValsetRequestRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetRequestRequestAminoMsg): QueryValsetRequestRequest { + return QueryValsetRequestRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetRequestRequestProtoMsg): QueryValsetRequestRequest { + return QueryValsetRequestRequest.decode(message.value); + }, + toProto(message: QueryValsetRequestRequest): Uint8Array { + return QueryValsetRequestRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetRequestRequest): QueryValsetRequestRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest", + value: QueryValsetRequestRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetRequestRequest.typeUrl, QueryValsetRequestRequest); +function createBaseQueryValsetRequestResponse(): QueryValsetRequestResponse { + return { + valset: undefined + }; +} +export const QueryValsetRequestResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse", + is(o: any): o is QueryValsetRequestResponse { + return o && o.$typeUrl === QueryValsetRequestResponse.typeUrl; + }, + isAmino(o: any): o is QueryValsetRequestResponseAmino { + return o && o.$typeUrl === QueryValsetRequestResponse.typeUrl; + }, + encode(message: QueryValsetRequestResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valset !== undefined) { + Valset.encode(message.valset, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valset = Valset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetRequestResponse { + const message = createBaseQueryValsetRequestResponse(); + message.valset = object.valset !== undefined && object.valset !== null ? Valset.fromPartial(object.valset) : undefined; + return message; + }, + fromAmino(object: QueryValsetRequestResponseAmino): QueryValsetRequestResponse { + const message = createBaseQueryValsetRequestResponse(); + if (object.valset !== undefined && object.valset !== null) { + message.valset = Valset.fromAmino(object.valset); + } + return message; + }, + toAmino(message: QueryValsetRequestResponse): QueryValsetRequestResponseAmino { + const obj: any = {}; + obj.valset = message.valset ? Valset.toAmino(message.valset) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetRequestResponseAminoMsg): QueryValsetRequestResponse { + return QueryValsetRequestResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetRequestResponseProtoMsg): QueryValsetRequestResponse { + return QueryValsetRequestResponse.decode(message.value); + }, + toProto(message: QueryValsetRequestResponse): Uint8Array { + return QueryValsetRequestResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetRequestResponse): QueryValsetRequestResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse", + value: QueryValsetRequestResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetRequestResponse.typeUrl, QueryValsetRequestResponse); +function createBaseQueryValsetConfirmRequest(): QueryValsetConfirmRequest { + return { + nonce: BigInt(0), + address: "" + }; +} +export const QueryValsetConfirmRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest", + is(o: any): o is QueryValsetConfirmRequest { + return o && (o.$typeUrl === QueryValsetConfirmRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryValsetConfirmRequestAmino { + return o && (o.$typeUrl === QueryValsetConfirmRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.address === "string"); + }, + encode(message: QueryValsetConfirmRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmRequest { + const message = createBaseQueryValsetConfirmRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryValsetConfirmRequestAmino): QueryValsetConfirmRequest { + const message = createBaseQueryValsetConfirmRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryValsetConfirmRequest): QueryValsetConfirmRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmRequestAminoMsg): QueryValsetConfirmRequest { + return QueryValsetConfirmRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmRequestProtoMsg): QueryValsetConfirmRequest { + return QueryValsetConfirmRequest.decode(message.value); + }, + toProto(message: QueryValsetConfirmRequest): Uint8Array { + return QueryValsetConfirmRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmRequest): QueryValsetConfirmRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest", + value: QueryValsetConfirmRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmRequest.typeUrl, QueryValsetConfirmRequest); +function createBaseQueryValsetConfirmResponse(): QueryValsetConfirmResponse { + return { + confirm: undefined + }; +} +export const QueryValsetConfirmResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse", + is(o: any): o is QueryValsetConfirmResponse { + return o && o.$typeUrl === QueryValsetConfirmResponse.typeUrl; + }, + isAmino(o: any): o is QueryValsetConfirmResponseAmino { + return o && o.$typeUrl === QueryValsetConfirmResponse.typeUrl; + }, + encode(message: QueryValsetConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.confirm !== undefined) { + MsgValsetConfirm.encode(message.confirm, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirm = MsgValsetConfirm.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmResponse { + const message = createBaseQueryValsetConfirmResponse(); + message.confirm = object.confirm !== undefined && object.confirm !== null ? MsgValsetConfirm.fromPartial(object.confirm) : undefined; + return message; + }, + fromAmino(object: QueryValsetConfirmResponseAmino): QueryValsetConfirmResponse { + const message = createBaseQueryValsetConfirmResponse(); + if (object.confirm !== undefined && object.confirm !== null) { + message.confirm = MsgValsetConfirm.fromAmino(object.confirm); + } + return message; + }, + toAmino(message: QueryValsetConfirmResponse): QueryValsetConfirmResponseAmino { + const obj: any = {}; + obj.confirm = message.confirm ? MsgValsetConfirm.toAmino(message.confirm) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmResponseAminoMsg): QueryValsetConfirmResponse { + return QueryValsetConfirmResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmResponseProtoMsg): QueryValsetConfirmResponse { + return QueryValsetConfirmResponse.decode(message.value); + }, + toProto(message: QueryValsetConfirmResponse): Uint8Array { + return QueryValsetConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmResponse): QueryValsetConfirmResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse", + value: QueryValsetConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmResponse.typeUrl, QueryValsetConfirmResponse); +function createBaseQueryValsetConfirmsByNonceRequest(): QueryValsetConfirmsByNonceRequest { + return { + nonce: BigInt(0) + }; +} +export const QueryValsetConfirmsByNonceRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest", + is(o: any): o is QueryValsetConfirmsByNonceRequest { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceRequest.typeUrl || typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is QueryValsetConfirmsByNonceRequestAmino { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceRequest.typeUrl || typeof o.nonce === "bigint"); + }, + encode(message: QueryValsetConfirmsByNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmsByNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmsByNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmsByNonceRequest { + const message = createBaseQueryValsetConfirmsByNonceRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryValsetConfirmsByNonceRequestAmino): QueryValsetConfirmsByNonceRequest { + const message = createBaseQueryValsetConfirmsByNonceRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: QueryValsetConfirmsByNonceRequest): QueryValsetConfirmsByNonceRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmsByNonceRequestAminoMsg): QueryValsetConfirmsByNonceRequest { + return QueryValsetConfirmsByNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmsByNonceRequestProtoMsg): QueryValsetConfirmsByNonceRequest { + return QueryValsetConfirmsByNonceRequest.decode(message.value); + }, + toProto(message: QueryValsetConfirmsByNonceRequest): Uint8Array { + return QueryValsetConfirmsByNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmsByNonceRequest): QueryValsetConfirmsByNonceRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest", + value: QueryValsetConfirmsByNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmsByNonceRequest.typeUrl, QueryValsetConfirmsByNonceRequest); +function createBaseQueryValsetConfirmsByNonceResponse(): QueryValsetConfirmsByNonceResponse { + return { + confirms: [] + }; +} +export const QueryValsetConfirmsByNonceResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse", + is(o: any): o is QueryValsetConfirmsByNonceResponse { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgValsetConfirm.is(o.confirms[0]))); + }, + isAmino(o: any): o is QueryValsetConfirmsByNonceResponseAmino { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgValsetConfirm.isAmino(o.confirms[0]))); + }, + encode(message: QueryValsetConfirmsByNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.confirms) { + MsgValsetConfirm.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmsByNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmsByNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirms.push(MsgValsetConfirm.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmsByNonceResponse { + const message = createBaseQueryValsetConfirmsByNonceResponse(); + message.confirms = object.confirms?.map(e => MsgValsetConfirm.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValsetConfirmsByNonceResponseAmino): QueryValsetConfirmsByNonceResponse { + const message = createBaseQueryValsetConfirmsByNonceResponse(); + message.confirms = object.confirms?.map(e => MsgValsetConfirm.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValsetConfirmsByNonceResponse): QueryValsetConfirmsByNonceResponseAmino { + const obj: any = {}; + if (message.confirms) { + obj.confirms = message.confirms.map(e => e ? MsgValsetConfirm.toAmino(e) : undefined); + } else { + obj.confirms = message.confirms; + } + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmsByNonceResponseAminoMsg): QueryValsetConfirmsByNonceResponse { + return QueryValsetConfirmsByNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmsByNonceResponseProtoMsg): QueryValsetConfirmsByNonceResponse { + return QueryValsetConfirmsByNonceResponse.decode(message.value); + }, + toProto(message: QueryValsetConfirmsByNonceResponse): Uint8Array { + return QueryValsetConfirmsByNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmsByNonceResponse): QueryValsetConfirmsByNonceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse", + value: QueryValsetConfirmsByNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmsByNonceResponse.typeUrl, QueryValsetConfirmsByNonceResponse); +function createBaseQueryLastValsetRequestsRequest(): QueryLastValsetRequestsRequest { + return {}; +} +export const QueryLastValsetRequestsRequest = { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest", + is(o: any): o is QueryLastValsetRequestsRequest { + return o && o.$typeUrl === QueryLastValsetRequestsRequest.typeUrl; + }, + isAmino(o: any): o is QueryLastValsetRequestsRequestAmino { + return o && o.$typeUrl === QueryLastValsetRequestsRequest.typeUrl; + }, + encode(_: QueryLastValsetRequestsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastValsetRequestsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastValsetRequestsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryLastValsetRequestsRequest { + const message = createBaseQueryLastValsetRequestsRequest(); + return message; + }, + fromAmino(_: QueryLastValsetRequestsRequestAmino): QueryLastValsetRequestsRequest { + const message = createBaseQueryLastValsetRequestsRequest(); + return message; + }, + toAmino(_: QueryLastValsetRequestsRequest): QueryLastValsetRequestsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLastValsetRequestsRequestAminoMsg): QueryLastValsetRequestsRequest { + return QueryLastValsetRequestsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastValsetRequestsRequestProtoMsg): QueryLastValsetRequestsRequest { + return QueryLastValsetRequestsRequest.decode(message.value); + }, + toProto(message: QueryLastValsetRequestsRequest): Uint8Array { + return QueryLastValsetRequestsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastValsetRequestsRequest): QueryLastValsetRequestsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest", + value: QueryLastValsetRequestsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastValsetRequestsRequest.typeUrl, QueryLastValsetRequestsRequest); +function createBaseQueryLastValsetRequestsResponse(): QueryLastValsetRequestsResponse { + return { + valsets: [] + }; +} +export const QueryLastValsetRequestsResponse = { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse", + is(o: any): o is QueryLastValsetRequestsResponse { + return o && (o.$typeUrl === QueryLastValsetRequestsResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0]))); + }, + isAmino(o: any): o is QueryLastValsetRequestsResponseAmino { + return o && (o.$typeUrl === QueryLastValsetRequestsResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0]))); + }, + encode(message: QueryLastValsetRequestsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastValsetRequestsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastValsetRequestsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastValsetRequestsResponse { + const message = createBaseQueryLastValsetRequestsResponse(); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLastValsetRequestsResponseAmino): QueryLastValsetRequestsResponse { + const message = createBaseQueryLastValsetRequestsResponse(); + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLastValsetRequestsResponse): QueryLastValsetRequestsResponseAmino { + const obj: any = {}; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + return obj; + }, + fromAminoMsg(object: QueryLastValsetRequestsResponseAminoMsg): QueryLastValsetRequestsResponse { + return QueryLastValsetRequestsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastValsetRequestsResponseProtoMsg): QueryLastValsetRequestsResponse { + return QueryLastValsetRequestsResponse.decode(message.value); + }, + toProto(message: QueryLastValsetRequestsResponse): Uint8Array { + return QueryLastValsetRequestsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastValsetRequestsResponse): QueryLastValsetRequestsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse", + value: QueryLastValsetRequestsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastValsetRequestsResponse.typeUrl, QueryLastValsetRequestsResponse); +function createBaseQueryLastPendingValsetRequestByAddrRequest(): QueryLastPendingValsetRequestByAddrRequest { + return { + address: "" + }; +} +export const QueryLastPendingValsetRequestByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest", + is(o: any): o is QueryLastPendingValsetRequestByAddrRequest { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastPendingValsetRequestByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastPendingValsetRequestByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingValsetRequestByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + 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: DeepPartial): QueryLastPendingValsetRequestByAddrRequest { + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastPendingValsetRequestByAddrRequestAmino): QueryLastPendingValsetRequestByAddrRequest { + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastPendingValsetRequestByAddrRequest): QueryLastPendingValsetRequestByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastPendingValsetRequestByAddrRequestAminoMsg): QueryLastPendingValsetRequestByAddrRequest { + return QueryLastPendingValsetRequestByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingValsetRequestByAddrRequestProtoMsg): QueryLastPendingValsetRequestByAddrRequest { + return QueryLastPendingValsetRequestByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastPendingValsetRequestByAddrRequest): Uint8Array { + return QueryLastPendingValsetRequestByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingValsetRequestByAddrRequest): QueryLastPendingValsetRequestByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest", + value: QueryLastPendingValsetRequestByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingValsetRequestByAddrRequest.typeUrl, QueryLastPendingValsetRequestByAddrRequest); +function createBaseQueryLastPendingValsetRequestByAddrResponse(): QueryLastPendingValsetRequestByAddrResponse { + return { + valsets: [] + }; +} +export const QueryLastPendingValsetRequestByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse", + is(o: any): o is QueryLastPendingValsetRequestByAddrResponse { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0]))); + }, + isAmino(o: any): o is QueryLastPendingValsetRequestByAddrResponseAmino { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0]))); + }, + encode(message: QueryLastPendingValsetRequestByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingValsetRequestByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastPendingValsetRequestByAddrResponse { + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLastPendingValsetRequestByAddrResponseAmino): QueryLastPendingValsetRequestByAddrResponse { + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLastPendingValsetRequestByAddrResponse): QueryLastPendingValsetRequestByAddrResponseAmino { + const obj: any = {}; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + return obj; + }, + fromAminoMsg(object: QueryLastPendingValsetRequestByAddrResponseAminoMsg): QueryLastPendingValsetRequestByAddrResponse { + return QueryLastPendingValsetRequestByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingValsetRequestByAddrResponseProtoMsg): QueryLastPendingValsetRequestByAddrResponse { + return QueryLastPendingValsetRequestByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastPendingValsetRequestByAddrResponse): Uint8Array { + return QueryLastPendingValsetRequestByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingValsetRequestByAddrResponse): QueryLastPendingValsetRequestByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse", + value: QueryLastPendingValsetRequestByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingValsetRequestByAddrResponse.typeUrl, QueryLastPendingValsetRequestByAddrResponse); +function createBaseQueryBatchFeeRequest(): QueryBatchFeeRequest { + return {}; +} +export const QueryBatchFeeRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest", + is(o: any): o is QueryBatchFeeRequest { + return o && o.$typeUrl === QueryBatchFeeRequest.typeUrl; + }, + isAmino(o: any): o is QueryBatchFeeRequestAmino { + return o && o.$typeUrl === QueryBatchFeeRequest.typeUrl; + }, + encode(_: QueryBatchFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBatchFeeRequest { + const message = createBaseQueryBatchFeeRequest(); + return message; + }, + fromAmino(_: QueryBatchFeeRequestAmino): QueryBatchFeeRequest { + const message = createBaseQueryBatchFeeRequest(); + return message; + }, + toAmino(_: QueryBatchFeeRequest): QueryBatchFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBatchFeeRequestAminoMsg): QueryBatchFeeRequest { + return QueryBatchFeeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchFeeRequestProtoMsg): QueryBatchFeeRequest { + return QueryBatchFeeRequest.decode(message.value); + }, + toProto(message: QueryBatchFeeRequest): Uint8Array { + return QueryBatchFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchFeeRequest): QueryBatchFeeRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest", + value: QueryBatchFeeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchFeeRequest.typeUrl, QueryBatchFeeRequest); +function createBaseQueryBatchFeeResponse(): QueryBatchFeeResponse { + return { + batchFees: [] + }; +} +export const QueryBatchFeeResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse", + is(o: any): o is QueryBatchFeeResponse { + return o && (o.$typeUrl === QueryBatchFeeResponse.typeUrl || Array.isArray(o.batchFees) && (!o.batchFees.length || BatchFees.is(o.batchFees[0]))); + }, + isAmino(o: any): o is QueryBatchFeeResponseAmino { + return o && (o.$typeUrl === QueryBatchFeeResponse.typeUrl || Array.isArray(o.batchFees) && (!o.batchFees.length || BatchFees.isAmino(o.batchFees[0]))); + }, + encode(message: QueryBatchFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.batchFees) { + BatchFees.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchFees.push(BatchFees.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchFeeResponse { + const message = createBaseQueryBatchFeeResponse(); + message.batchFees = object.batchFees?.map(e => BatchFees.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBatchFeeResponseAmino): QueryBatchFeeResponse { + const message = createBaseQueryBatchFeeResponse(); + message.batchFees = object.batchFees?.map(e => BatchFees.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBatchFeeResponse): QueryBatchFeeResponseAmino { + const obj: any = {}; + if (message.batchFees) { + obj.batchFees = message.batchFees.map(e => e ? BatchFees.toAmino(e) : undefined); + } else { + obj.batchFees = message.batchFees; + } + return obj; + }, + fromAminoMsg(object: QueryBatchFeeResponseAminoMsg): QueryBatchFeeResponse { + return QueryBatchFeeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchFeeResponseProtoMsg): QueryBatchFeeResponse { + return QueryBatchFeeResponse.decode(message.value); + }, + toProto(message: QueryBatchFeeResponse): Uint8Array { + return QueryBatchFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchFeeResponse): QueryBatchFeeResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse", + value: QueryBatchFeeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchFeeResponse.typeUrl, QueryBatchFeeResponse); +function createBaseQueryLastPendingBatchRequestByAddrRequest(): QueryLastPendingBatchRequestByAddrRequest { + return { + address: "" + }; +} +export const QueryLastPendingBatchRequestByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest", + is(o: any): o is QueryLastPendingBatchRequestByAddrRequest { + return o && (o.$typeUrl === QueryLastPendingBatchRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastPendingBatchRequestByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastPendingBatchRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastPendingBatchRequestByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingBatchRequestByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + 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: DeepPartial): QueryLastPendingBatchRequestByAddrRequest { + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastPendingBatchRequestByAddrRequestAmino): QueryLastPendingBatchRequestByAddrRequest { + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastPendingBatchRequestByAddrRequest): QueryLastPendingBatchRequestByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastPendingBatchRequestByAddrRequestAminoMsg): QueryLastPendingBatchRequestByAddrRequest { + return QueryLastPendingBatchRequestByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingBatchRequestByAddrRequestProtoMsg): QueryLastPendingBatchRequestByAddrRequest { + return QueryLastPendingBatchRequestByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastPendingBatchRequestByAddrRequest): Uint8Array { + return QueryLastPendingBatchRequestByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingBatchRequestByAddrRequest): QueryLastPendingBatchRequestByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest", + value: QueryLastPendingBatchRequestByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingBatchRequestByAddrRequest.typeUrl, QueryLastPendingBatchRequestByAddrRequest); +function createBaseQueryLastPendingBatchRequestByAddrResponse(): QueryLastPendingBatchRequestByAddrResponse { + return { + batch: undefined + }; +} +export const QueryLastPendingBatchRequestByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse", + is(o: any): o is QueryLastPendingBatchRequestByAddrResponse { + return o && o.$typeUrl === QueryLastPendingBatchRequestByAddrResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastPendingBatchRequestByAddrResponseAmino { + return o && o.$typeUrl === QueryLastPendingBatchRequestByAddrResponse.typeUrl; + }, + encode(message: QueryLastPendingBatchRequestByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batch !== undefined) { + OutgoingTxBatch.encode(message.batch, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingBatchRequestByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = OutgoingTxBatch.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastPendingBatchRequestByAddrResponse { + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + message.batch = object.batch !== undefined && object.batch !== null ? OutgoingTxBatch.fromPartial(object.batch) : undefined; + return message; + }, + fromAmino(object: QueryLastPendingBatchRequestByAddrResponseAmino): QueryLastPendingBatchRequestByAddrResponse { + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + if (object.batch !== undefined && object.batch !== null) { + message.batch = OutgoingTxBatch.fromAmino(object.batch); + } + return message; + }, + toAmino(message: QueryLastPendingBatchRequestByAddrResponse): QueryLastPendingBatchRequestByAddrResponseAmino { + const obj: any = {}; + obj.batch = message.batch ? OutgoingTxBatch.toAmino(message.batch) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastPendingBatchRequestByAddrResponseAminoMsg): QueryLastPendingBatchRequestByAddrResponse { + return QueryLastPendingBatchRequestByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingBatchRequestByAddrResponseProtoMsg): QueryLastPendingBatchRequestByAddrResponse { + return QueryLastPendingBatchRequestByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastPendingBatchRequestByAddrResponse): Uint8Array { + return QueryLastPendingBatchRequestByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingBatchRequestByAddrResponse): QueryLastPendingBatchRequestByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse", + value: QueryLastPendingBatchRequestByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingBatchRequestByAddrResponse.typeUrl, QueryLastPendingBatchRequestByAddrResponse); +function createBaseQueryOutgoingTxBatchesRequest(): QueryOutgoingTxBatchesRequest { + return {}; +} +export const QueryOutgoingTxBatchesRequest = { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest", + is(o: any): o is QueryOutgoingTxBatchesRequest { + return o && o.$typeUrl === QueryOutgoingTxBatchesRequest.typeUrl; + }, + isAmino(o: any): o is QueryOutgoingTxBatchesRequestAmino { + return o && o.$typeUrl === QueryOutgoingTxBatchesRequest.typeUrl; + }, + encode(_: QueryOutgoingTxBatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOutgoingTxBatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOutgoingTxBatchesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOutgoingTxBatchesRequest { + const message = createBaseQueryOutgoingTxBatchesRequest(); + return message; + }, + fromAmino(_: QueryOutgoingTxBatchesRequestAmino): QueryOutgoingTxBatchesRequest { + const message = createBaseQueryOutgoingTxBatchesRequest(); + return message; + }, + toAmino(_: QueryOutgoingTxBatchesRequest): QueryOutgoingTxBatchesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOutgoingTxBatchesRequestAminoMsg): QueryOutgoingTxBatchesRequest { + return QueryOutgoingTxBatchesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOutgoingTxBatchesRequestProtoMsg): QueryOutgoingTxBatchesRequest { + return QueryOutgoingTxBatchesRequest.decode(message.value); + }, + toProto(message: QueryOutgoingTxBatchesRequest): Uint8Array { + return QueryOutgoingTxBatchesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOutgoingTxBatchesRequest): QueryOutgoingTxBatchesRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest", + value: QueryOutgoingTxBatchesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOutgoingTxBatchesRequest.typeUrl, QueryOutgoingTxBatchesRequest); +function createBaseQueryOutgoingTxBatchesResponse(): QueryOutgoingTxBatchesResponse { + return { + batches: [] + }; +} +export const QueryOutgoingTxBatchesResponse = { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse", + is(o: any): o is QueryOutgoingTxBatchesResponse { + return o && (o.$typeUrl === QueryOutgoingTxBatchesResponse.typeUrl || Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.is(o.batches[0]))); + }, + isAmino(o: any): o is QueryOutgoingTxBatchesResponseAmino { + return o && (o.$typeUrl === QueryOutgoingTxBatchesResponse.typeUrl || Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.isAmino(o.batches[0]))); + }, + encode(message: QueryOutgoingTxBatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.batches) { + OutgoingTxBatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOutgoingTxBatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOutgoingTxBatchesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batches.push(OutgoingTxBatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOutgoingTxBatchesResponse { + const message = createBaseQueryOutgoingTxBatchesResponse(); + message.batches = object.batches?.map(e => OutgoingTxBatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOutgoingTxBatchesResponseAmino): QueryOutgoingTxBatchesResponse { + const message = createBaseQueryOutgoingTxBatchesResponse(); + message.batches = object.batches?.map(e => OutgoingTxBatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOutgoingTxBatchesResponse): QueryOutgoingTxBatchesResponseAmino { + const obj: any = {}; + if (message.batches) { + obj.batches = message.batches.map(e => e ? OutgoingTxBatch.toAmino(e) : undefined); + } else { + obj.batches = message.batches; + } + return obj; + }, + fromAminoMsg(object: QueryOutgoingTxBatchesResponseAminoMsg): QueryOutgoingTxBatchesResponse { + return QueryOutgoingTxBatchesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOutgoingTxBatchesResponseProtoMsg): QueryOutgoingTxBatchesResponse { + return QueryOutgoingTxBatchesResponse.decode(message.value); + }, + toProto(message: QueryOutgoingTxBatchesResponse): Uint8Array { + return QueryOutgoingTxBatchesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOutgoingTxBatchesResponse): QueryOutgoingTxBatchesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse", + value: QueryOutgoingTxBatchesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOutgoingTxBatchesResponse.typeUrl, QueryOutgoingTxBatchesResponse); +function createBaseQueryBatchRequestByNonceRequest(): QueryBatchRequestByNonceRequest { + return { + nonce: BigInt(0), + contractAddress: "" + }; +} +export const QueryBatchRequestByNonceRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest", + is(o: any): o is QueryBatchRequestByNonceRequest { + return o && (o.$typeUrl === QueryBatchRequestByNonceRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryBatchRequestByNonceRequestAmino { + return o && (o.$typeUrl === QueryBatchRequestByNonceRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contract_address === "string"); + }, + encode(message: QueryBatchRequestByNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchRequestByNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchRequestByNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchRequestByNonceRequest { + const message = createBaseQueryBatchRequestByNonceRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryBatchRequestByNonceRequestAmino): QueryBatchRequestByNonceRequest { + const message = createBaseQueryBatchRequestByNonceRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryBatchRequestByNonceRequest): QueryBatchRequestByNonceRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryBatchRequestByNonceRequestAminoMsg): QueryBatchRequestByNonceRequest { + return QueryBatchRequestByNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchRequestByNonceRequestProtoMsg): QueryBatchRequestByNonceRequest { + return QueryBatchRequestByNonceRequest.decode(message.value); + }, + toProto(message: QueryBatchRequestByNonceRequest): Uint8Array { + return QueryBatchRequestByNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchRequestByNonceRequest): QueryBatchRequestByNonceRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest", + value: QueryBatchRequestByNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchRequestByNonceRequest.typeUrl, QueryBatchRequestByNonceRequest); +function createBaseQueryBatchRequestByNonceResponse(): QueryBatchRequestByNonceResponse { + return { + batch: undefined + }; +} +export const QueryBatchRequestByNonceResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse", + is(o: any): o is QueryBatchRequestByNonceResponse { + return o && o.$typeUrl === QueryBatchRequestByNonceResponse.typeUrl; + }, + isAmino(o: any): o is QueryBatchRequestByNonceResponseAmino { + return o && o.$typeUrl === QueryBatchRequestByNonceResponse.typeUrl; + }, + encode(message: QueryBatchRequestByNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batch !== undefined) { + OutgoingTxBatch.encode(message.batch, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchRequestByNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchRequestByNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = OutgoingTxBatch.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchRequestByNonceResponse { + const message = createBaseQueryBatchRequestByNonceResponse(); + message.batch = object.batch !== undefined && object.batch !== null ? OutgoingTxBatch.fromPartial(object.batch) : undefined; + return message; + }, + fromAmino(object: QueryBatchRequestByNonceResponseAmino): QueryBatchRequestByNonceResponse { + const message = createBaseQueryBatchRequestByNonceResponse(); + if (object.batch !== undefined && object.batch !== null) { + message.batch = OutgoingTxBatch.fromAmino(object.batch); + } + return message; + }, + toAmino(message: QueryBatchRequestByNonceResponse): QueryBatchRequestByNonceResponseAmino { + const obj: any = {}; + obj.batch = message.batch ? OutgoingTxBatch.toAmino(message.batch) : undefined; + return obj; + }, + fromAminoMsg(object: QueryBatchRequestByNonceResponseAminoMsg): QueryBatchRequestByNonceResponse { + return QueryBatchRequestByNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchRequestByNonceResponseProtoMsg): QueryBatchRequestByNonceResponse { + return QueryBatchRequestByNonceResponse.decode(message.value); + }, + toProto(message: QueryBatchRequestByNonceResponse): Uint8Array { + return QueryBatchRequestByNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchRequestByNonceResponse): QueryBatchRequestByNonceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse", + value: QueryBatchRequestByNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchRequestByNonceResponse.typeUrl, QueryBatchRequestByNonceResponse); +function createBaseQueryBatchConfirmsRequest(): QueryBatchConfirmsRequest { + return { + nonce: BigInt(0), + contractAddress: "" + }; +} +export const QueryBatchConfirmsRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest", + is(o: any): o is QueryBatchConfirmsRequest { + return o && (o.$typeUrl === QueryBatchConfirmsRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryBatchConfirmsRequestAmino { + return o && (o.$typeUrl === QueryBatchConfirmsRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contract_address === "string"); + }, + encode(message: QueryBatchConfirmsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchConfirmsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchConfirmsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchConfirmsRequest { + const message = createBaseQueryBatchConfirmsRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryBatchConfirmsRequestAmino): QueryBatchConfirmsRequest { + const message = createBaseQueryBatchConfirmsRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryBatchConfirmsRequest): QueryBatchConfirmsRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryBatchConfirmsRequestAminoMsg): QueryBatchConfirmsRequest { + return QueryBatchConfirmsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchConfirmsRequestProtoMsg): QueryBatchConfirmsRequest { + return QueryBatchConfirmsRequest.decode(message.value); + }, + toProto(message: QueryBatchConfirmsRequest): Uint8Array { + return QueryBatchConfirmsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchConfirmsRequest): QueryBatchConfirmsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest", + value: QueryBatchConfirmsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchConfirmsRequest.typeUrl, QueryBatchConfirmsRequest); +function createBaseQueryBatchConfirmsResponse(): QueryBatchConfirmsResponse { + return { + confirms: [] + }; +} +export const QueryBatchConfirmsResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse", + is(o: any): o is QueryBatchConfirmsResponse { + return o && (o.$typeUrl === QueryBatchConfirmsResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgConfirmBatch.is(o.confirms[0]))); + }, + isAmino(o: any): o is QueryBatchConfirmsResponseAmino { + return o && (o.$typeUrl === QueryBatchConfirmsResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgConfirmBatch.isAmino(o.confirms[0]))); + }, + encode(message: QueryBatchConfirmsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.confirms) { + MsgConfirmBatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchConfirmsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchConfirmsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirms.push(MsgConfirmBatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchConfirmsResponse { + const message = createBaseQueryBatchConfirmsResponse(); + message.confirms = object.confirms?.map(e => MsgConfirmBatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBatchConfirmsResponseAmino): QueryBatchConfirmsResponse { + const message = createBaseQueryBatchConfirmsResponse(); + message.confirms = object.confirms?.map(e => MsgConfirmBatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBatchConfirmsResponse): QueryBatchConfirmsResponseAmino { + const obj: any = {}; + if (message.confirms) { + obj.confirms = message.confirms.map(e => e ? MsgConfirmBatch.toAmino(e) : undefined); + } else { + obj.confirms = message.confirms; + } + return obj; + }, + fromAminoMsg(object: QueryBatchConfirmsResponseAminoMsg): QueryBatchConfirmsResponse { + return QueryBatchConfirmsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchConfirmsResponseProtoMsg): QueryBatchConfirmsResponse { + return QueryBatchConfirmsResponse.decode(message.value); + }, + toProto(message: QueryBatchConfirmsResponse): Uint8Array { + return QueryBatchConfirmsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchConfirmsResponse): QueryBatchConfirmsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse", + value: QueryBatchConfirmsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchConfirmsResponse.typeUrl, QueryBatchConfirmsResponse); +function createBaseQueryLastEventByAddrRequest(): QueryLastEventByAddrRequest { + return { + address: "" + }; +} +export const QueryLastEventByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest", + is(o: any): o is QueryLastEventByAddrRequest { + return o && (o.$typeUrl === QueryLastEventByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastEventByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastEventByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastEventByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastEventByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastEventByAddrRequest(); + 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: DeepPartial): QueryLastEventByAddrRequest { + const message = createBaseQueryLastEventByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastEventByAddrRequestAmino): QueryLastEventByAddrRequest { + const message = createBaseQueryLastEventByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastEventByAddrRequest): QueryLastEventByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastEventByAddrRequestAminoMsg): QueryLastEventByAddrRequest { + return QueryLastEventByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastEventByAddrRequestProtoMsg): QueryLastEventByAddrRequest { + return QueryLastEventByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastEventByAddrRequest): Uint8Array { + return QueryLastEventByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastEventByAddrRequest): QueryLastEventByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest", + value: QueryLastEventByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastEventByAddrRequest.typeUrl, QueryLastEventByAddrRequest); +function createBaseQueryLastEventByAddrResponse(): QueryLastEventByAddrResponse { + return { + lastClaimEvent: undefined + }; +} +export const QueryLastEventByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse", + is(o: any): o is QueryLastEventByAddrResponse { + return o && o.$typeUrl === QueryLastEventByAddrResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastEventByAddrResponseAmino { + return o && o.$typeUrl === QueryLastEventByAddrResponse.typeUrl; + }, + encode(message: QueryLastEventByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastClaimEvent !== undefined) { + LastClaimEvent.encode(message.lastClaimEvent, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastEventByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastEventByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastClaimEvent = LastClaimEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastEventByAddrResponse { + const message = createBaseQueryLastEventByAddrResponse(); + message.lastClaimEvent = object.lastClaimEvent !== undefined && object.lastClaimEvent !== null ? LastClaimEvent.fromPartial(object.lastClaimEvent) : undefined; + return message; + }, + fromAmino(object: QueryLastEventByAddrResponseAmino): QueryLastEventByAddrResponse { + const message = createBaseQueryLastEventByAddrResponse(); + if (object.last_claim_event !== undefined && object.last_claim_event !== null) { + message.lastClaimEvent = LastClaimEvent.fromAmino(object.last_claim_event); + } + return message; + }, + toAmino(message: QueryLastEventByAddrResponse): QueryLastEventByAddrResponseAmino { + const obj: any = {}; + obj.last_claim_event = message.lastClaimEvent ? LastClaimEvent.toAmino(message.lastClaimEvent) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastEventByAddrResponseAminoMsg): QueryLastEventByAddrResponse { + return QueryLastEventByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastEventByAddrResponseProtoMsg): QueryLastEventByAddrResponse { + return QueryLastEventByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastEventByAddrResponse): Uint8Array { + return QueryLastEventByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastEventByAddrResponse): QueryLastEventByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse", + value: QueryLastEventByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastEventByAddrResponse.typeUrl, QueryLastEventByAddrResponse); +function createBaseQueryERC20ToDenomRequest(): QueryERC20ToDenomRequest { + return { + erc20: "" + }; +} +export const QueryERC20ToDenomRequest = { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest", + is(o: any): o is QueryERC20ToDenomRequest { + return o && (o.$typeUrl === QueryERC20ToDenomRequest.typeUrl || typeof o.erc20 === "string"); + }, + isAmino(o: any): o is QueryERC20ToDenomRequestAmino { + return o && (o.$typeUrl === QueryERC20ToDenomRequest.typeUrl || typeof o.erc20 === "string"); + }, + encode(message: QueryERC20ToDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryERC20ToDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryERC20ToDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryERC20ToDenomRequest { + const message = createBaseQueryERC20ToDenomRequest(); + message.erc20 = object.erc20 ?? ""; + return message; + }, + fromAmino(object: QueryERC20ToDenomRequestAmino): QueryERC20ToDenomRequest { + const message = createBaseQueryERC20ToDenomRequest(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + return message; + }, + toAmino(message: QueryERC20ToDenomRequest): QueryERC20ToDenomRequestAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + return obj; + }, + fromAminoMsg(object: QueryERC20ToDenomRequestAminoMsg): QueryERC20ToDenomRequest { + return QueryERC20ToDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryERC20ToDenomRequestProtoMsg): QueryERC20ToDenomRequest { + return QueryERC20ToDenomRequest.decode(message.value); + }, + toProto(message: QueryERC20ToDenomRequest): Uint8Array { + return QueryERC20ToDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryERC20ToDenomRequest): QueryERC20ToDenomRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest", + value: QueryERC20ToDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryERC20ToDenomRequest.typeUrl, QueryERC20ToDenomRequest); +function createBaseQueryERC20ToDenomResponse(): QueryERC20ToDenomResponse { + return { + denom: "", + cosmosOriginated: false + }; +} +export const QueryERC20ToDenomResponse = { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse", + is(o: any): o is QueryERC20ToDenomResponse { + return o && (o.$typeUrl === QueryERC20ToDenomResponse.typeUrl || typeof o.denom === "string" && typeof o.cosmosOriginated === "boolean"); + }, + isAmino(o: any): o is QueryERC20ToDenomResponseAmino { + return o && (o.$typeUrl === QueryERC20ToDenomResponse.typeUrl || typeof o.denom === "string" && typeof o.cosmos_originated === "boolean"); + }, + encode(message: QueryERC20ToDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.cosmosOriginated === true) { + writer.uint32(16).bool(message.cosmosOriginated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryERC20ToDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryERC20ToDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.cosmosOriginated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryERC20ToDenomResponse { + const message = createBaseQueryERC20ToDenomResponse(); + message.denom = object.denom ?? ""; + message.cosmosOriginated = object.cosmosOriginated ?? false; + return message; + }, + fromAmino(object: QueryERC20ToDenomResponseAmino): QueryERC20ToDenomResponse { + const message = createBaseQueryERC20ToDenomResponse(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cosmos_originated !== undefined && object.cosmos_originated !== null) { + message.cosmosOriginated = object.cosmos_originated; + } + return message; + }, + toAmino(message: QueryERC20ToDenomResponse): QueryERC20ToDenomResponseAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.cosmos_originated = message.cosmosOriginated === false ? undefined : message.cosmosOriginated; + return obj; + }, + fromAminoMsg(object: QueryERC20ToDenomResponseAminoMsg): QueryERC20ToDenomResponse { + return QueryERC20ToDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryERC20ToDenomResponseProtoMsg): QueryERC20ToDenomResponse { + return QueryERC20ToDenomResponse.decode(message.value); + }, + toProto(message: QueryERC20ToDenomResponse): Uint8Array { + return QueryERC20ToDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryERC20ToDenomResponse): QueryERC20ToDenomResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse", + value: QueryERC20ToDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryERC20ToDenomResponse.typeUrl, QueryERC20ToDenomResponse); +function createBaseQueryDenomToERC20Request(): QueryDenomToERC20Request { + return { + denom: "" + }; +} +export const QueryDenomToERC20Request = { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request", + is(o: any): o is QueryDenomToERC20Request { + return o && (o.$typeUrl === QueryDenomToERC20Request.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomToERC20RequestAmino { + return o && (o.$typeUrl === QueryDenomToERC20Request.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomToERC20Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomToERC20Request { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomToERC20Request(); + 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: DeepPartial): QueryDenomToERC20Request { + const message = createBaseQueryDenomToERC20Request(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomToERC20RequestAmino): QueryDenomToERC20Request { + const message = createBaseQueryDenomToERC20Request(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomToERC20Request): QueryDenomToERC20RequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomToERC20RequestAminoMsg): QueryDenomToERC20Request { + return QueryDenomToERC20Request.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomToERC20RequestProtoMsg): QueryDenomToERC20Request { + return QueryDenomToERC20Request.decode(message.value); + }, + toProto(message: QueryDenomToERC20Request): Uint8Array { + return QueryDenomToERC20Request.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomToERC20Request): QueryDenomToERC20RequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request", + value: QueryDenomToERC20Request.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomToERC20Request.typeUrl, QueryDenomToERC20Request); +function createBaseQueryDenomToERC20Response(): QueryDenomToERC20Response { + return { + erc20: "", + cosmosOriginated: false + }; +} +export const QueryDenomToERC20Response = { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response", + is(o: any): o is QueryDenomToERC20Response { + return o && (o.$typeUrl === QueryDenomToERC20Response.typeUrl || typeof o.erc20 === "string" && typeof o.cosmosOriginated === "boolean"); + }, + isAmino(o: any): o is QueryDenomToERC20ResponseAmino { + return o && (o.$typeUrl === QueryDenomToERC20Response.typeUrl || typeof o.erc20 === "string" && typeof o.cosmos_originated === "boolean"); + }, + encode(message: QueryDenomToERC20Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + if (message.cosmosOriginated === true) { + writer.uint32(16).bool(message.cosmosOriginated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomToERC20Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomToERC20Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + case 2: + message.cosmosOriginated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomToERC20Response { + const message = createBaseQueryDenomToERC20Response(); + message.erc20 = object.erc20 ?? ""; + message.cosmosOriginated = object.cosmosOriginated ?? false; + return message; + }, + fromAmino(object: QueryDenomToERC20ResponseAmino): QueryDenomToERC20Response { + const message = createBaseQueryDenomToERC20Response(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + if (object.cosmos_originated !== undefined && object.cosmos_originated !== null) { + message.cosmosOriginated = object.cosmos_originated; + } + return message; + }, + toAmino(message: QueryDenomToERC20Response): QueryDenomToERC20ResponseAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + obj.cosmos_originated = message.cosmosOriginated === false ? undefined : message.cosmosOriginated; + return obj; + }, + fromAminoMsg(object: QueryDenomToERC20ResponseAminoMsg): QueryDenomToERC20Response { + return QueryDenomToERC20Response.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomToERC20ResponseProtoMsg): QueryDenomToERC20Response { + return QueryDenomToERC20Response.decode(message.value); + }, + toProto(message: QueryDenomToERC20Response): Uint8Array { + return QueryDenomToERC20Response.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomToERC20Response): QueryDenomToERC20ResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response", + value: QueryDenomToERC20Response.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomToERC20Response.typeUrl, QueryDenomToERC20Response); +function createBaseQueryDelegateKeysByValidatorAddress(): QueryDelegateKeysByValidatorAddress { + return { + validatorAddress: "" + }; +} +export const QueryDelegateKeysByValidatorAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress", + is(o: any): o is QueryDelegateKeysByValidatorAddress { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddress.typeUrl || typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByValidatorAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddress.typeUrl || typeof o.validator_address === "string"); + }, + encode(message: QueryDelegateKeysByValidatorAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByValidatorAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByValidatorAddress(); + 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: DeepPartial): QueryDelegateKeysByValidatorAddress { + const message = createBaseQueryDelegateKeysByValidatorAddress(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByValidatorAddressAmino): QueryDelegateKeysByValidatorAddress { + const message = createBaseQueryDelegateKeysByValidatorAddress(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByValidatorAddress): QueryDelegateKeysByValidatorAddressAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByValidatorAddressAminoMsg): QueryDelegateKeysByValidatorAddress { + return QueryDelegateKeysByValidatorAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByValidatorAddressProtoMsg): QueryDelegateKeysByValidatorAddress { + return QueryDelegateKeysByValidatorAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByValidatorAddress): Uint8Array { + return QueryDelegateKeysByValidatorAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByValidatorAddress): QueryDelegateKeysByValidatorAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress", + value: QueryDelegateKeysByValidatorAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByValidatorAddress.typeUrl, QueryDelegateKeysByValidatorAddress); +function createBaseQueryDelegateKeysByValidatorAddressResponse(): QueryDelegateKeysByValidatorAddressResponse { + return { + ethAddress: "", + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByValidatorAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse", + is(o: any): o is QueryDelegateKeysByValidatorAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddressResponse.typeUrl || typeof o.ethAddress === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByValidatorAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddressResponse.typeUrl || typeof o.eth_address === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByValidatorAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethAddress !== "") { + writer.uint32(10).string(message.ethAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByValidatorAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByValidatorAddressResponse { + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + message.ethAddress = object.ethAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByValidatorAddressResponseAmino): QueryDelegateKeysByValidatorAddressResponse { + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByValidatorAddressResponse): QueryDelegateKeysByValidatorAddressResponseAmino { + const obj: any = {}; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByValidatorAddressResponseAminoMsg): QueryDelegateKeysByValidatorAddressResponse { + return QueryDelegateKeysByValidatorAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByValidatorAddressResponseProtoMsg): QueryDelegateKeysByValidatorAddressResponse { + return QueryDelegateKeysByValidatorAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByValidatorAddressResponse): Uint8Array { + return QueryDelegateKeysByValidatorAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByValidatorAddressResponse): QueryDelegateKeysByValidatorAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse", + value: QueryDelegateKeysByValidatorAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByValidatorAddressResponse.typeUrl, QueryDelegateKeysByValidatorAddressResponse); +function createBaseQueryDelegateKeysByEthAddress(): QueryDelegateKeysByEthAddress { + return { + ethAddress: "" + }; +} +export const QueryDelegateKeysByEthAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress", + is(o: any): o is QueryDelegateKeysByEthAddress { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddress.typeUrl || typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByEthAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddress.typeUrl || typeof o.eth_address === "string"); + }, + encode(message: QueryDelegateKeysByEthAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethAddress !== "") { + writer.uint32(10).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByEthAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByEthAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByEthAddress { + const message = createBaseQueryDelegateKeysByEthAddress(); + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByEthAddressAmino): QueryDelegateKeysByEthAddress { + const message = createBaseQueryDelegateKeysByEthAddress(); + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByEthAddress): QueryDelegateKeysByEthAddressAmino { + const obj: any = {}; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByEthAddressAminoMsg): QueryDelegateKeysByEthAddress { + return QueryDelegateKeysByEthAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByEthAddressProtoMsg): QueryDelegateKeysByEthAddress { + return QueryDelegateKeysByEthAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByEthAddress): Uint8Array { + return QueryDelegateKeysByEthAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByEthAddress): QueryDelegateKeysByEthAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress", + value: QueryDelegateKeysByEthAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByEthAddress.typeUrl, QueryDelegateKeysByEthAddress); +function createBaseQueryDelegateKeysByEthAddressResponse(): QueryDelegateKeysByEthAddressResponse { + return { + validatorAddress: "", + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByEthAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse", + is(o: any): o is QueryDelegateKeysByEthAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddressResponse.typeUrl || typeof o.validatorAddress === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByEthAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddressResponse.typeUrl || typeof o.validator_address === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByEthAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByEthAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByEthAddressResponse { + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + message.validatorAddress = object.validatorAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByEthAddressResponseAmino): QueryDelegateKeysByEthAddressResponse { + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByEthAddressResponse): QueryDelegateKeysByEthAddressResponseAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByEthAddressResponseAminoMsg): QueryDelegateKeysByEthAddressResponse { + return QueryDelegateKeysByEthAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByEthAddressResponseProtoMsg): QueryDelegateKeysByEthAddressResponse { + return QueryDelegateKeysByEthAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByEthAddressResponse): Uint8Array { + return QueryDelegateKeysByEthAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByEthAddressResponse): QueryDelegateKeysByEthAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse", + value: QueryDelegateKeysByEthAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByEthAddressResponse.typeUrl, QueryDelegateKeysByEthAddressResponse); +function createBaseQueryDelegateKeysByOrchestratorAddress(): QueryDelegateKeysByOrchestratorAddress { + return { + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByOrchestratorAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress", + is(o: any): o is QueryDelegateKeysByOrchestratorAddress { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddress.typeUrl || typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByOrchestratorAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddress.typeUrl || typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByOrchestratorAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orchestratorAddress !== "") { + writer.uint32(10).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByOrchestratorAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByOrchestratorAddress { + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByOrchestratorAddressAmino): QueryDelegateKeysByOrchestratorAddress { + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByOrchestratorAddress): QueryDelegateKeysByOrchestratorAddressAmino { + const obj: any = {}; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByOrchestratorAddressAminoMsg): QueryDelegateKeysByOrchestratorAddress { + return QueryDelegateKeysByOrchestratorAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByOrchestratorAddressProtoMsg): QueryDelegateKeysByOrchestratorAddress { + return QueryDelegateKeysByOrchestratorAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByOrchestratorAddress): Uint8Array { + return QueryDelegateKeysByOrchestratorAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByOrchestratorAddress): QueryDelegateKeysByOrchestratorAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress", + value: QueryDelegateKeysByOrchestratorAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByOrchestratorAddress.typeUrl, QueryDelegateKeysByOrchestratorAddress); +function createBaseQueryDelegateKeysByOrchestratorAddressResponse(): QueryDelegateKeysByOrchestratorAddressResponse { + return { + validatorAddress: "", + ethAddress: "" + }; +} +export const QueryDelegateKeysByOrchestratorAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse", + is(o: any): o is QueryDelegateKeysByOrchestratorAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddressResponse.typeUrl || typeof o.validatorAddress === "string" && typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByOrchestratorAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddressResponse.typeUrl || typeof o.validator_address === "string" && typeof o.eth_address === "string"); + }, + encode(message: QueryDelegateKeysByOrchestratorAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.ethAddress !== "") { + writer.uint32(18).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByOrchestratorAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByOrchestratorAddressResponse { + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + message.validatorAddress = object.validatorAddress ?? ""; + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByOrchestratorAddressResponseAmino): QueryDelegateKeysByOrchestratorAddressResponse { + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByOrchestratorAddressResponse): QueryDelegateKeysByOrchestratorAddressResponseAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByOrchestratorAddressResponseAminoMsg): QueryDelegateKeysByOrchestratorAddressResponse { + return QueryDelegateKeysByOrchestratorAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByOrchestratorAddressResponseProtoMsg): QueryDelegateKeysByOrchestratorAddressResponse { + return QueryDelegateKeysByOrchestratorAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByOrchestratorAddressResponse): Uint8Array { + return QueryDelegateKeysByOrchestratorAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByOrchestratorAddressResponse): QueryDelegateKeysByOrchestratorAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse", + value: QueryDelegateKeysByOrchestratorAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByOrchestratorAddressResponse.typeUrl, QueryDelegateKeysByOrchestratorAddressResponse); +function createBaseQueryPendingSendToEth(): QueryPendingSendToEth { + return { + senderAddress: "" + }; +} +export const QueryPendingSendToEth = { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth", + is(o: any): o is QueryPendingSendToEth { + return o && (o.$typeUrl === QueryPendingSendToEth.typeUrl || typeof o.senderAddress === "string"); + }, + isAmino(o: any): o is QueryPendingSendToEthAmino { + return o && (o.$typeUrl === QueryPendingSendToEth.typeUrl || typeof o.sender_address === "string"); + }, + encode(message: QueryPendingSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.senderAddress !== "") { + writer.uint32(10).string(message.senderAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingSendToEth { + const message = createBaseQueryPendingSendToEth(); + message.senderAddress = object.senderAddress ?? ""; + return message; + }, + fromAmino(object: QueryPendingSendToEthAmino): QueryPendingSendToEth { + const message = createBaseQueryPendingSendToEth(); + if (object.sender_address !== undefined && object.sender_address !== null) { + message.senderAddress = object.sender_address; + } + return message; + }, + toAmino(message: QueryPendingSendToEth): QueryPendingSendToEthAmino { + const obj: any = {}; + obj.sender_address = message.senderAddress === "" ? undefined : message.senderAddress; + return obj; + }, + fromAminoMsg(object: QueryPendingSendToEthAminoMsg): QueryPendingSendToEth { + return QueryPendingSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingSendToEthProtoMsg): QueryPendingSendToEth { + return QueryPendingSendToEth.decode(message.value); + }, + toProto(message: QueryPendingSendToEth): Uint8Array { + return QueryPendingSendToEth.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingSendToEth): QueryPendingSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth", + value: QueryPendingSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingSendToEth.typeUrl, QueryPendingSendToEth); +function createBaseQueryPendingSendToEthResponse(): QueryPendingSendToEthResponse { + return { + transfersInBatches: [], + unbatchedTransfers: [] + }; +} +export const QueryPendingSendToEthResponse = { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse", + is(o: any): o is QueryPendingSendToEthResponse { + return o && (o.$typeUrl === QueryPendingSendToEthResponse.typeUrl || Array.isArray(o.transfersInBatches) && (!o.transfersInBatches.length || OutgoingTransferTx.is(o.transfersInBatches[0])) && Array.isArray(o.unbatchedTransfers) && (!o.unbatchedTransfers.length || OutgoingTransferTx.is(o.unbatchedTransfers[0]))); + }, + isAmino(o: any): o is QueryPendingSendToEthResponseAmino { + return o && (o.$typeUrl === QueryPendingSendToEthResponse.typeUrl || Array.isArray(o.transfers_in_batches) && (!o.transfers_in_batches.length || OutgoingTransferTx.isAmino(o.transfers_in_batches[0])) && Array.isArray(o.unbatched_transfers) && (!o.unbatched_transfers.length || OutgoingTransferTx.isAmino(o.unbatched_transfers[0]))); + }, + encode(message: QueryPendingSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.transfersInBatches) { + OutgoingTransferTx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.unbatchedTransfers) { + OutgoingTransferTx.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transfersInBatches.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 2: + message.unbatchedTransfers.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingSendToEthResponse { + const message = createBaseQueryPendingSendToEthResponse(); + message.transfersInBatches = object.transfersInBatches?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.unbatchedTransfers = object.unbatchedTransfers?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPendingSendToEthResponseAmino): QueryPendingSendToEthResponse { + const message = createBaseQueryPendingSendToEthResponse(); + message.transfersInBatches = object.transfers_in_batches?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + message.unbatchedTransfers = object.unbatched_transfers?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPendingSendToEthResponse): QueryPendingSendToEthResponseAmino { + const obj: any = {}; + if (message.transfersInBatches) { + obj.transfers_in_batches = message.transfersInBatches.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.transfers_in_batches = message.transfersInBatches; + } + if (message.unbatchedTransfers) { + obj.unbatched_transfers = message.unbatchedTransfers.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.unbatched_transfers = message.unbatchedTransfers; + } + return obj; + }, + fromAminoMsg(object: QueryPendingSendToEthResponseAminoMsg): QueryPendingSendToEthResponse { + return QueryPendingSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingSendToEthResponseProtoMsg): QueryPendingSendToEthResponse { + return QueryPendingSendToEthResponse.decode(message.value); + }, + toProto(message: QueryPendingSendToEthResponse): Uint8Array { + return QueryPendingSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingSendToEthResponse): QueryPendingSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse", + value: QueryPendingSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingSendToEthResponse.typeUrl, QueryPendingSendToEthResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseMissingNoncesRequest(): MissingNoncesRequest { + return {}; +} +export const MissingNoncesRequest = { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest", + is(o: any): o is MissingNoncesRequest { + return o && o.$typeUrl === MissingNoncesRequest.typeUrl; + }, + isAmino(o: any): o is MissingNoncesRequestAmino { + return o && o.$typeUrl === MissingNoncesRequest.typeUrl; + }, + encode(_: MissingNoncesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MissingNoncesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMissingNoncesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MissingNoncesRequest { + const message = createBaseMissingNoncesRequest(); + return message; + }, + fromAmino(_: MissingNoncesRequestAmino): MissingNoncesRequest { + const message = createBaseMissingNoncesRequest(); + return message; + }, + toAmino(_: MissingNoncesRequest): MissingNoncesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MissingNoncesRequestAminoMsg): MissingNoncesRequest { + return MissingNoncesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MissingNoncesRequestProtoMsg): MissingNoncesRequest { + return MissingNoncesRequest.decode(message.value); + }, + toProto(message: MissingNoncesRequest): Uint8Array { + return MissingNoncesRequest.encode(message).finish(); + }, + toProtoMsg(message: MissingNoncesRequest): MissingNoncesRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest", + value: MissingNoncesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MissingNoncesRequest.typeUrl, MissingNoncesRequest); +function createBaseMissingNoncesResponse(): MissingNoncesResponse { + return { + operatorAddresses: [] + }; +} +export const MissingNoncesResponse = { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse", + is(o: any): o is MissingNoncesResponse { + return o && (o.$typeUrl === MissingNoncesResponse.typeUrl || Array.isArray(o.operatorAddresses) && (!o.operatorAddresses.length || typeof o.operatorAddresses[0] === "string")); + }, + isAmino(o: any): o is MissingNoncesResponseAmino { + return o && (o.$typeUrl === MissingNoncesResponse.typeUrl || Array.isArray(o.operator_addresses) && (!o.operator_addresses.length || typeof o.operator_addresses[0] === "string")); + }, + encode(message: MissingNoncesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.operatorAddresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MissingNoncesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMissingNoncesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MissingNoncesResponse { + const message = createBaseMissingNoncesResponse(); + message.operatorAddresses = object.operatorAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MissingNoncesResponseAmino): MissingNoncesResponse { + const message = createBaseMissingNoncesResponse(); + message.operatorAddresses = object.operator_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MissingNoncesResponse): MissingNoncesResponseAmino { + const obj: any = {}; + if (message.operatorAddresses) { + obj.operator_addresses = message.operatorAddresses.map(e => e); + } else { + obj.operator_addresses = message.operatorAddresses; + } + return obj; + }, + fromAminoMsg(object: MissingNoncesResponseAminoMsg): MissingNoncesResponse { + return MissingNoncesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MissingNoncesResponseProtoMsg): MissingNoncesResponse { + return MissingNoncesResponse.decode(message.value); + }, + toProto(message: MissingNoncesResponse): Uint8Array { + return MissingNoncesResponse.encode(message).finish(); + }, + toProtoMsg(message: MissingNoncesResponse): MissingNoncesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse", + value: MissingNoncesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MissingNoncesResponse.typeUrl, MissingNoncesResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/peggy/v1/types.ts b/libs/injective-query/src/injective/peggy/v1/types.ts new file mode 100644 index 00000000..37fbe06a --- /dev/null +++ b/libs/injective-query/src/injective/peggy/v1/types.ts @@ -0,0 +1,575 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** BridgeValidator represents a validator's ETH address and its power */ +export interface BridgeValidator { + power: bigint; + ethereumAddress: string; +} +export interface BridgeValidatorProtoMsg { + typeUrl: "/injective.peggy.v1.BridgeValidator"; + value: Uint8Array; +} +/** BridgeValidator represents a validator's ETH address and its power */ +export interface BridgeValidatorAmino { + power: string; + ethereum_address: string; +} +export interface BridgeValidatorAminoMsg { + type: "/injective.peggy.v1.BridgeValidator"; + value: BridgeValidatorAmino; +} +/** + * Valset is the Ethereum Bridge Multsig Set, each peggy validator also + * maintains an ETH key to sign messages, these are used to check signatures on + * ETH because of the significant gas savings + */ +export interface Valset { + nonce: bigint; + members: BridgeValidator[]; + height: bigint; + rewardAmount: string; + /** the reward token in it's Ethereum hex address representation */ + rewardToken: string; +} +export interface ValsetProtoMsg { + typeUrl: "/injective.peggy.v1.Valset"; + value: Uint8Array; +} +/** + * Valset is the Ethereum Bridge Multsig Set, each peggy validator also + * maintains an ETH key to sign messages, these are used to check signatures on + * ETH because of the significant gas savings + */ +export interface ValsetAmino { + nonce: string; + members: BridgeValidatorAmino[]; + height: string; + reward_amount: string; + /** the reward token in it's Ethereum hex address representation */ + reward_token: string; +} +export interface ValsetAminoMsg { + type: "/injective.peggy.v1.Valset"; + value: ValsetAmino; +} +/** + * LastObservedEthereumBlockHeight stores the last observed + * Ethereum block height along with the Cosmos block height that + * it was observed at. These two numbers can be used to project + * outward and always produce batches with timeouts in the future + * even if no Ethereum block height has been relayed for a long time + */ +export interface LastObservedEthereumBlockHeight { + cosmosBlockHeight: bigint; + ethereumBlockHeight: bigint; +} +export interface LastObservedEthereumBlockHeightProtoMsg { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight"; + value: Uint8Array; +} +/** + * LastObservedEthereumBlockHeight stores the last observed + * Ethereum block height along with the Cosmos block height that + * it was observed at. These two numbers can be used to project + * outward and always produce batches with timeouts in the future + * even if no Ethereum block height has been relayed for a long time + */ +export interface LastObservedEthereumBlockHeightAmino { + cosmos_block_height: string; + ethereum_block_height: string; +} +export interface LastObservedEthereumBlockHeightAminoMsg { + type: "/injective.peggy.v1.LastObservedEthereumBlockHeight"; + value: LastObservedEthereumBlockHeightAmino; +} +/** LastClaimEvent stores last claim event details of validator. */ +export interface LastClaimEvent { + ethereumEventNonce: bigint; + ethereumEventHeight: bigint; +} +export interface LastClaimEventProtoMsg { + typeUrl: "/injective.peggy.v1.LastClaimEvent"; + value: Uint8Array; +} +/** LastClaimEvent stores last claim event details of validator. */ +export interface LastClaimEventAmino { + ethereum_event_nonce: string; + ethereum_event_height: string; +} +export interface LastClaimEventAminoMsg { + type: "/injective.peggy.v1.LastClaimEvent"; + value: LastClaimEventAmino; +} +/** + * This records the relationship between an ERC20 token and the denom + * of the corresponding Cosmos originated asset + */ +export interface ERC20ToDenom { + erc20: string; + denom: string; +} +export interface ERC20ToDenomProtoMsg { + typeUrl: "/injective.peggy.v1.ERC20ToDenom"; + value: Uint8Array; +} +/** + * This records the relationship between an ERC20 token and the denom + * of the corresponding Cosmos originated asset + */ +export interface ERC20ToDenomAmino { + erc20: string; + denom: string; +} +export interface ERC20ToDenomAminoMsg { + type: "/injective.peggy.v1.ERC20ToDenom"; + value: ERC20ToDenomAmino; +} +function createBaseBridgeValidator(): BridgeValidator { + return { + power: BigInt(0), + ethereumAddress: "" + }; +} +export const BridgeValidator = { + typeUrl: "/injective.peggy.v1.BridgeValidator", + is(o: any): o is BridgeValidator { + return o && (o.$typeUrl === BridgeValidator.typeUrl || typeof o.power === "bigint" && typeof o.ethereumAddress === "string"); + }, + isAmino(o: any): o is BridgeValidatorAmino { + return o && (o.$typeUrl === BridgeValidator.typeUrl || typeof o.power === "bigint" && typeof o.ethereum_address === "string"); + }, + encode(message: BridgeValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.power !== BigInt(0)) { + writer.uint32(8).uint64(message.power); + } + if (message.ethereumAddress !== "") { + writer.uint32(18).string(message.ethereumAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BridgeValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBridgeValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.power = reader.uint64(); + break; + case 2: + message.ethereumAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BridgeValidator { + const message = createBaseBridgeValidator(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + message.ethereumAddress = object.ethereumAddress ?? ""; + return message; + }, + fromAmino(object: BridgeValidatorAmino): BridgeValidator { + const message = createBaseBridgeValidator(); + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.ethereum_address !== undefined && object.ethereum_address !== null) { + message.ethereumAddress = object.ethereum_address; + } + return message; + }, + toAmino(message: BridgeValidator): BridgeValidatorAmino { + const obj: any = {}; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + obj.ethereum_address = message.ethereumAddress === "" ? undefined : message.ethereumAddress; + return obj; + }, + fromAminoMsg(object: BridgeValidatorAminoMsg): BridgeValidator { + return BridgeValidator.fromAmino(object.value); + }, + fromProtoMsg(message: BridgeValidatorProtoMsg): BridgeValidator { + return BridgeValidator.decode(message.value); + }, + toProto(message: BridgeValidator): Uint8Array { + return BridgeValidator.encode(message).finish(); + }, + toProtoMsg(message: BridgeValidator): BridgeValidatorProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BridgeValidator", + value: BridgeValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BridgeValidator.typeUrl, BridgeValidator); +function createBaseValset(): Valset { + return { + nonce: BigInt(0), + members: [], + height: BigInt(0), + rewardAmount: "", + rewardToken: "" + }; +} +export const Valset = { + typeUrl: "/injective.peggy.v1.Valset", + is(o: any): o is Valset { + return o && (o.$typeUrl === Valset.typeUrl || typeof o.nonce === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.is(o.members[0])) && typeof o.height === "bigint" && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string"); + }, + isAmino(o: any): o is ValsetAmino { + return o && (o.$typeUrl === Valset.typeUrl || typeof o.nonce === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.isAmino(o.members[0])) && typeof o.height === "bigint" && typeof o.reward_amount === "string" && typeof o.reward_token === "string"); + }, + encode(message: Valset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + for (const v of message.members) { + BridgeValidator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + if (message.rewardAmount !== "") { + writer.uint32(34).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(42).string(message.rewardToken); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Valset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.members.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 3: + message.height = reader.uint64(); + break; + case 4: + message.rewardAmount = reader.string(); + break; + case 5: + message.rewardToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Valset { + const message = createBaseValset(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.members = object.members?.map(e => BridgeValidator.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + return message; + }, + fromAmino(object: ValsetAmino): Valset { + const message = createBaseValset(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + message.members = object.members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + return message; + }, + toAmino(message: Valset): ValsetAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + if (message.members) { + obj.members = message.members.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + return obj; + }, + fromAminoMsg(object: ValsetAminoMsg): Valset { + return Valset.fromAmino(object.value); + }, + fromProtoMsg(message: ValsetProtoMsg): Valset { + return Valset.decode(message.value); + }, + toProto(message: Valset): Uint8Array { + return Valset.encode(message).finish(); + }, + toProtoMsg(message: Valset): ValsetProtoMsg { + return { + typeUrl: "/injective.peggy.v1.Valset", + value: Valset.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Valset.typeUrl, Valset); +function createBaseLastObservedEthereumBlockHeight(): LastObservedEthereumBlockHeight { + return { + cosmosBlockHeight: BigInt(0), + ethereumBlockHeight: BigInt(0) + }; +} +export const LastObservedEthereumBlockHeight = { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight", + is(o: any): o is LastObservedEthereumBlockHeight { + return o && (o.$typeUrl === LastObservedEthereumBlockHeight.typeUrl || typeof o.cosmosBlockHeight === "bigint" && typeof o.ethereumBlockHeight === "bigint"); + }, + isAmino(o: any): o is LastObservedEthereumBlockHeightAmino { + return o && (o.$typeUrl === LastObservedEthereumBlockHeight.typeUrl || typeof o.cosmos_block_height === "bigint" && typeof o.ethereum_block_height === "bigint"); + }, + encode(message: LastObservedEthereumBlockHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cosmosBlockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.cosmosBlockHeight); + } + if (message.ethereumBlockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.ethereumBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastObservedEthereumBlockHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastObservedEthereumBlockHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmosBlockHeight = reader.uint64(); + break; + case 2: + message.ethereumBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastObservedEthereumBlockHeight { + const message = createBaseLastObservedEthereumBlockHeight(); + message.cosmosBlockHeight = object.cosmosBlockHeight !== undefined && object.cosmosBlockHeight !== null ? BigInt(object.cosmosBlockHeight.toString()) : BigInt(0); + message.ethereumBlockHeight = object.ethereumBlockHeight !== undefined && object.ethereumBlockHeight !== null ? BigInt(object.ethereumBlockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastObservedEthereumBlockHeightAmino): LastObservedEthereumBlockHeight { + const message = createBaseLastObservedEthereumBlockHeight(); + if (object.cosmos_block_height !== undefined && object.cosmos_block_height !== null) { + message.cosmosBlockHeight = BigInt(object.cosmos_block_height); + } + if (object.ethereum_block_height !== undefined && object.ethereum_block_height !== null) { + message.ethereumBlockHeight = BigInt(object.ethereum_block_height); + } + return message; + }, + toAmino(message: LastObservedEthereumBlockHeight): LastObservedEthereumBlockHeightAmino { + const obj: any = {}; + obj.cosmos_block_height = message.cosmosBlockHeight !== BigInt(0) ? message.cosmosBlockHeight?.toString() : undefined; + obj.ethereum_block_height = message.ethereumBlockHeight !== BigInt(0) ? message.ethereumBlockHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastObservedEthereumBlockHeightAminoMsg): LastObservedEthereumBlockHeight { + return LastObservedEthereumBlockHeight.fromAmino(object.value); + }, + fromProtoMsg(message: LastObservedEthereumBlockHeightProtoMsg): LastObservedEthereumBlockHeight { + return LastObservedEthereumBlockHeight.decode(message.value); + }, + toProto(message: LastObservedEthereumBlockHeight): Uint8Array { + return LastObservedEthereumBlockHeight.encode(message).finish(); + }, + toProtoMsg(message: LastObservedEthereumBlockHeight): LastObservedEthereumBlockHeightProtoMsg { + return { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight", + value: LastObservedEthereumBlockHeight.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastObservedEthereumBlockHeight.typeUrl, LastObservedEthereumBlockHeight); +function createBaseLastClaimEvent(): LastClaimEvent { + return { + ethereumEventNonce: BigInt(0), + ethereumEventHeight: BigInt(0) + }; +} +export const LastClaimEvent = { + typeUrl: "/injective.peggy.v1.LastClaimEvent", + is(o: any): o is LastClaimEvent { + return o && (o.$typeUrl === LastClaimEvent.typeUrl || typeof o.ethereumEventNonce === "bigint" && typeof o.ethereumEventHeight === "bigint"); + }, + isAmino(o: any): o is LastClaimEventAmino { + return o && (o.$typeUrl === LastClaimEvent.typeUrl || typeof o.ethereum_event_nonce === "bigint" && typeof o.ethereum_event_height === "bigint"); + }, + encode(message: LastClaimEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethereumEventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.ethereumEventNonce); + } + if (message.ethereumEventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.ethereumEventHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastClaimEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastClaimEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethereumEventNonce = reader.uint64(); + break; + case 2: + message.ethereumEventHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastClaimEvent { + const message = createBaseLastClaimEvent(); + message.ethereumEventNonce = object.ethereumEventNonce !== undefined && object.ethereumEventNonce !== null ? BigInt(object.ethereumEventNonce.toString()) : BigInt(0); + message.ethereumEventHeight = object.ethereumEventHeight !== undefined && object.ethereumEventHeight !== null ? BigInt(object.ethereumEventHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastClaimEventAmino): LastClaimEvent { + const message = createBaseLastClaimEvent(); + if (object.ethereum_event_nonce !== undefined && object.ethereum_event_nonce !== null) { + message.ethereumEventNonce = BigInt(object.ethereum_event_nonce); + } + if (object.ethereum_event_height !== undefined && object.ethereum_event_height !== null) { + message.ethereumEventHeight = BigInt(object.ethereum_event_height); + } + return message; + }, + toAmino(message: LastClaimEvent): LastClaimEventAmino { + const obj: any = {}; + obj.ethereum_event_nonce = message.ethereumEventNonce !== BigInt(0) ? message.ethereumEventNonce?.toString() : undefined; + obj.ethereum_event_height = message.ethereumEventHeight !== BigInt(0) ? message.ethereumEventHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastClaimEventAminoMsg): LastClaimEvent { + return LastClaimEvent.fromAmino(object.value); + }, + fromProtoMsg(message: LastClaimEventProtoMsg): LastClaimEvent { + return LastClaimEvent.decode(message.value); + }, + toProto(message: LastClaimEvent): Uint8Array { + return LastClaimEvent.encode(message).finish(); + }, + toProtoMsg(message: LastClaimEvent): LastClaimEventProtoMsg { + return { + typeUrl: "/injective.peggy.v1.LastClaimEvent", + value: LastClaimEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastClaimEvent.typeUrl, LastClaimEvent); +function createBaseERC20ToDenom(): ERC20ToDenom { + return { + erc20: "", + denom: "" + }; +} +export const ERC20ToDenom = { + typeUrl: "/injective.peggy.v1.ERC20ToDenom", + is(o: any): o is ERC20ToDenom { + return o && (o.$typeUrl === ERC20ToDenom.typeUrl || typeof o.erc20 === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is ERC20ToDenomAmino { + return o && (o.$typeUrl === ERC20ToDenom.typeUrl || typeof o.erc20 === "string" && typeof o.denom === "string"); + }, + encode(message: ERC20ToDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ERC20ToDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseERC20ToDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ERC20ToDenom { + const message = createBaseERC20ToDenom(); + message.erc20 = object.erc20 ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: ERC20ToDenomAmino): ERC20ToDenom { + const message = createBaseERC20ToDenom(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: ERC20ToDenom): ERC20ToDenomAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: ERC20ToDenomAminoMsg): ERC20ToDenom { + return ERC20ToDenom.fromAmino(object.value); + }, + fromProtoMsg(message: ERC20ToDenomProtoMsg): ERC20ToDenom { + return ERC20ToDenom.decode(message.value); + }, + toProto(message: ERC20ToDenom): Uint8Array { + return ERC20ToDenom.encode(message).finish(); + }, + toProtoMsg(message: ERC20ToDenom): ERC20ToDenomProtoMsg { + return { + typeUrl: "/injective.peggy.v1.ERC20ToDenom", + value: ERC20ToDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ERC20ToDenom.typeUrl, ERC20ToDenom); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/events.ts b/libs/injective-query/src/injective/permissions/v1beta1/events.ts new file mode 100644 index 00000000..0b4fbba0 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/events.ts @@ -0,0 +1,102 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventSetVoucher { + addr: string; + voucher: Coin; +} +export interface EventSetVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher"; + value: Uint8Array; +} +export interface EventSetVoucherAmino { + addr: string; + voucher: CoinAmino; +} +export interface EventSetVoucherAminoMsg { + type: "/injective.permissions.v1beta1.EventSetVoucher"; + value: EventSetVoucherAmino; +} +function createBaseEventSetVoucher(): EventSetVoucher { + return { + addr: "", + voucher: Coin.fromPartial({}) + }; +} +export const EventSetVoucher = { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher", + is(o: any): o is EventSetVoucher { + return o && (o.$typeUrl === EventSetVoucher.typeUrl || typeof o.addr === "string" && Coin.is(o.voucher)); + }, + isAmino(o: any): o is EventSetVoucherAmino { + return o && (o.$typeUrl === EventSetVoucher.typeUrl || typeof o.addr === "string" && Coin.isAmino(o.voucher)); + }, + encode(message: EventSetVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addr !== "") { + writer.uint32(10).string(message.addr); + } + if (message.voucher !== undefined) { + Coin.encode(message.voucher, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addr = reader.string(); + break; + case 2: + message.voucher = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetVoucher { + const message = createBaseEventSetVoucher(); + message.addr = object.addr ?? ""; + message.voucher = object.voucher !== undefined && object.voucher !== null ? Coin.fromPartial(object.voucher) : undefined; + return message; + }, + fromAmino(object: EventSetVoucherAmino): EventSetVoucher { + const message = createBaseEventSetVoucher(); + if (object.addr !== undefined && object.addr !== null) { + message.addr = object.addr; + } + if (object.voucher !== undefined && object.voucher !== null) { + message.voucher = Coin.fromAmino(object.voucher); + } + return message; + }, + toAmino(message: EventSetVoucher): EventSetVoucherAmino { + const obj: any = {}; + obj.addr = message.addr === "" ? undefined : message.addr; + obj.voucher = message.voucher ? Coin.toAmino(message.voucher) : undefined; + return obj; + }, + fromAminoMsg(object: EventSetVoucherAminoMsg): EventSetVoucher { + return EventSetVoucher.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetVoucherProtoMsg): EventSetVoucher { + return EventSetVoucher.decode(message.value); + }, + toProto(message: EventSetVoucher): Uint8Array { + return EventSetVoucher.encode(message).finish(); + }, + toProtoMsg(message: EventSetVoucher): EventSetVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher", + value: EventSetVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetVoucher.typeUrl, EventSetVoucher); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/genesis.ts b/libs/injective-query/src/injective/permissions/v1beta1/genesis.ts new file mode 100644 index 00000000..3920fd81 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/genesis.ts @@ -0,0 +1,109 @@ +import { Params, ParamsAmino } from "./params"; +import { Namespace, NamespaceAmino } from "./permissions"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the permissions module's genesis state. */ +export interface GenesisState { + /** params defines the parameters of the module. */ + params: Params; + namespaces: Namespace[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.permissions.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the permissions module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the parameters of the module. */ + params: ParamsAmino; + namespaces: NamespaceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.permissions.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + namespaces: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.permissions.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.is(o.namespaces[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.isAmino(o.namespaces[0]))); + }, + 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.namespaces) { + Namespace.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.namespaces.push(Namespace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.namespaces = object.namespaces?.map(e => Namespace.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.namespaces = object.namespaces?.map(e => Namespace.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.namespaces) { + obj.namespaces = message.namespaces.map(e => e ? Namespace.toAmino(e) : undefined); + } else { + obj.namespaces = message.namespaces; + } + 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: "/injective.permissions.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/params.ts b/libs/injective-query/src/injective/permissions/v1beta1/params.ts new file mode 100644 index 00000000..24aa6bb5 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/params.ts @@ -0,0 +1,97 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Params defines the parameters for the permissions module. */ +export interface Params { + wasmHookQueryMaxGas: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the permissions module. */ +export interface ParamsAmino { + wasm_hook_query_max_gas: string; +} +export interface ParamsAminoMsg { + type: "permissions/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + wasmHookQueryMaxGas: BigInt(0) + }; +} +export const Params = { + typeUrl: "/injective.permissions.v1beta1.Params", + aminoType: "permissions/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.wasmHookQueryMaxGas === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.wasm_hook_query_max_gas === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.wasmHookQueryMaxGas !== BigInt(0)) { + writer.uint32(8).uint64(message.wasmHookQueryMaxGas); + } + 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.wasmHookQueryMaxGas = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.wasmHookQueryMaxGas = object.wasmHookQueryMaxGas !== undefined && object.wasmHookQueryMaxGas !== null ? BigInt(object.wasmHookQueryMaxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.wasm_hook_query_max_gas !== undefined && object.wasm_hook_query_max_gas !== null) { + message.wasmHookQueryMaxGas = BigInt(object.wasm_hook_query_max_gas); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.wasm_hook_query_max_gas = message.wasmHookQueryMaxGas !== BigInt(0) ? message.wasmHookQueryMaxGas?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "permissions/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: "/injective.permissions.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/permissions.ts b/libs/injective-query/src/injective/permissions/v1beta1/permissions.ts new file mode 100644 index 00000000..6cd42f27 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/permissions.ts @@ -0,0 +1,709 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** each Action enum value should be a power of two */ +export enum Action { + UNSPECIFIED = 0, + MINT = 1, + RECEIVE = 2, + BURN = 4, + UNRECOGNIZED = -1, +} +export const ActionAmino = Action; +export function actionFromJSON(object: any): Action { + switch (object) { + case 0: + case "UNSPECIFIED": + return Action.UNSPECIFIED; + case 1: + case "MINT": + return Action.MINT; + case 2: + case "RECEIVE": + return Action.RECEIVE; + case 4: + case "BURN": + return Action.BURN; + case -1: + case "UNRECOGNIZED": + default: + return Action.UNRECOGNIZED; + } +} +export function actionToJSON(object: Action): string { + switch (object) { + case Action.UNSPECIFIED: + return "UNSPECIFIED"; + case Action.MINT: + return "MINT"; + case Action.RECEIVE: + return "RECEIVE"; + case Action.BURN: + return "BURN"; + case Action.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Namespace defines a permissions namespace */ +export interface Namespace { + /** tokenfactory denom to which this namespace applies to */ + denom: string; + /** address of smart contract to apply code-based restrictions */ + wasmHook: string; + mintsPaused: boolean; + sendsPaused: boolean; + burnsPaused: boolean; + /** permissions for each role */ + rolePermissions: Role[]; + addressRoles: AddressRoles[]; +} +export interface NamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Namespace"; + value: Uint8Array; +} +/** Namespace defines a permissions namespace */ +export interface NamespaceAmino { + /** tokenfactory denom to which this namespace applies to */ + denom: string; + /** address of smart contract to apply code-based restrictions */ + wasm_hook: string; + mints_paused: boolean; + sends_paused: boolean; + burns_paused: boolean; + /** permissions for each role */ + role_permissions: RoleAmino[]; + address_roles: AddressRolesAmino[]; +} +export interface NamespaceAminoMsg { + type: "/injective.permissions.v1beta1.Namespace"; + value: NamespaceAmino; +} +export interface AddressRoles { + address: string; + roles: string[]; +} +export interface AddressRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.AddressRoles"; + value: Uint8Array; +} +export interface AddressRolesAmino { + address: string; + roles: string[]; +} +export interface AddressRolesAminoMsg { + type: "/injective.permissions.v1beta1.AddressRoles"; + value: AddressRolesAmino; +} +/** Role is only used for storage */ +export interface Role { + role: string; + permissions: number; +} +export interface RoleProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Role"; + value: Uint8Array; +} +/** Role is only used for storage */ +export interface RoleAmino { + role: string; + permissions: number; +} +export interface RoleAminoMsg { + type: "/injective.permissions.v1beta1.Role"; + value: RoleAmino; +} +/** used in storage */ +export interface RoleIDs { + roleIds: number[]; +} +export interface RoleIDsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.RoleIDs"; + value: Uint8Array; +} +/** used in storage */ +export interface RoleIDsAmino { + role_ids: number[]; +} +export interface RoleIDsAminoMsg { + type: "/injective.permissions.v1beta1.RoleIDs"; + value: RoleIDsAmino; +} +export interface Voucher { + coins: Coin[]; +} +export interface VoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Voucher"; + value: Uint8Array; +} +export interface VoucherAmino { + coins: CoinAmino[]; +} +export interface VoucherAminoMsg { + type: "/injective.permissions.v1beta1.Voucher"; + value: VoucherAmino; +} +export interface AddressVoucher { + address: string; + voucher?: Voucher; +} +export interface AddressVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher"; + value: Uint8Array; +} +export interface AddressVoucherAmino { + address: string; + voucher?: VoucherAmino; +} +export interface AddressVoucherAminoMsg { + type: "/injective.permissions.v1beta1.AddressVoucher"; + value: AddressVoucherAmino; +} +function createBaseNamespace(): Namespace { + return { + denom: "", + wasmHook: "", + mintsPaused: false, + sendsPaused: false, + burnsPaused: false, + rolePermissions: [], + addressRoles: [] + }; +} +export const Namespace = { + typeUrl: "/injective.permissions.v1beta1.Namespace", + is(o: any): o is Namespace { + return o && (o.$typeUrl === Namespace.typeUrl || typeof o.denom === "string" && typeof o.wasmHook === "string" && typeof o.mintsPaused === "boolean" && typeof o.sendsPaused === "boolean" && typeof o.burnsPaused === "boolean" && Array.isArray(o.rolePermissions) && (!o.rolePermissions.length || Role.is(o.rolePermissions[0])) && Array.isArray(o.addressRoles) && (!o.addressRoles.length || AddressRoles.is(o.addressRoles[0]))); + }, + isAmino(o: any): o is NamespaceAmino { + return o && (o.$typeUrl === Namespace.typeUrl || typeof o.denom === "string" && typeof o.wasm_hook === "string" && typeof o.mints_paused === "boolean" && typeof o.sends_paused === "boolean" && typeof o.burns_paused === "boolean" && Array.isArray(o.role_permissions) && (!o.role_permissions.length || Role.isAmino(o.role_permissions[0])) && Array.isArray(o.address_roles) && (!o.address_roles.length || AddressRoles.isAmino(o.address_roles[0]))); + }, + encode(message: Namespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.wasmHook !== "") { + writer.uint32(18).string(message.wasmHook); + } + if (message.mintsPaused === true) { + writer.uint32(24).bool(message.mintsPaused); + } + if (message.sendsPaused === true) { + writer.uint32(32).bool(message.sendsPaused); + } + if (message.burnsPaused === true) { + writer.uint32(40).bool(message.burnsPaused); + } + for (const v of message.rolePermissions) { + Role.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.addressRoles) { + AddressRoles.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Namespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.wasmHook = reader.string(); + break; + case 3: + message.mintsPaused = reader.bool(); + break; + case 4: + message.sendsPaused = reader.bool(); + break; + case 5: + message.burnsPaused = reader.bool(); + break; + case 6: + message.rolePermissions.push(Role.decode(reader, reader.uint32())); + break; + case 7: + message.addressRoles.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Namespace { + const message = createBaseNamespace(); + message.denom = object.denom ?? ""; + message.wasmHook = object.wasmHook ?? ""; + message.mintsPaused = object.mintsPaused ?? false; + message.sendsPaused = object.sendsPaused ?? false; + message.burnsPaused = object.burnsPaused ?? false; + message.rolePermissions = object.rolePermissions?.map(e => Role.fromPartial(e)) || []; + message.addressRoles = object.addressRoles?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: NamespaceAmino): Namespace { + const message = createBaseNamespace(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.wasm_hook !== undefined && object.wasm_hook !== null) { + message.wasmHook = object.wasm_hook; + } + if (object.mints_paused !== undefined && object.mints_paused !== null) { + message.mintsPaused = object.mints_paused; + } + if (object.sends_paused !== undefined && object.sends_paused !== null) { + message.sendsPaused = object.sends_paused; + } + if (object.burns_paused !== undefined && object.burns_paused !== null) { + message.burnsPaused = object.burns_paused; + } + message.rolePermissions = object.role_permissions?.map(e => Role.fromAmino(e)) || []; + message.addressRoles = object.address_roles?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: Namespace): NamespaceAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.wasm_hook = message.wasmHook === "" ? undefined : message.wasmHook; + obj.mints_paused = message.mintsPaused === false ? undefined : message.mintsPaused; + obj.sends_paused = message.sendsPaused === false ? undefined : message.sendsPaused; + obj.burns_paused = message.burnsPaused === false ? undefined : message.burnsPaused; + if (message.rolePermissions) { + obj.role_permissions = message.rolePermissions.map(e => e ? Role.toAmino(e) : undefined); + } else { + obj.role_permissions = message.rolePermissions; + } + if (message.addressRoles) { + obj.address_roles = message.addressRoles.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles = message.addressRoles; + } + return obj; + }, + fromAminoMsg(object: NamespaceAminoMsg): Namespace { + return Namespace.fromAmino(object.value); + }, + fromProtoMsg(message: NamespaceProtoMsg): Namespace { + return Namespace.decode(message.value); + }, + toProto(message: Namespace): Uint8Array { + return Namespace.encode(message).finish(); + }, + toProtoMsg(message: Namespace): NamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Namespace", + value: Namespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Namespace.typeUrl, Namespace); +function createBaseAddressRoles(): AddressRoles { + return { + address: "", + roles: [] + }; +} +export const AddressRoles = { + typeUrl: "/injective.permissions.v1beta1.AddressRoles", + is(o: any): o is AddressRoles { + return o && (o.$typeUrl === AddressRoles.typeUrl || typeof o.address === "string" && Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + isAmino(o: any): o is AddressRolesAmino { + return o && (o.$typeUrl === AddressRoles.typeUrl || typeof o.address === "string" && Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + encode(message: AddressRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.roles) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.roles.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AddressRoles { + const message = createBaseAddressRoles(); + message.address = object.address ?? ""; + message.roles = object.roles?.map(e => e) || []; + return message; + }, + fromAmino(object: AddressRolesAmino): AddressRoles { + const message = createBaseAddressRoles(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.roles = object.roles?.map(e => e) || []; + return message; + }, + toAmino(message: AddressRoles): AddressRolesAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.roles) { + obj.roles = message.roles.map(e => e); + } else { + obj.roles = message.roles; + } + return obj; + }, + fromAminoMsg(object: AddressRolesAminoMsg): AddressRoles { + return AddressRoles.fromAmino(object.value); + }, + fromProtoMsg(message: AddressRolesProtoMsg): AddressRoles { + return AddressRoles.decode(message.value); + }, + toProto(message: AddressRoles): Uint8Array { + return AddressRoles.encode(message).finish(); + }, + toProtoMsg(message: AddressRoles): AddressRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.AddressRoles", + value: AddressRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressRoles.typeUrl, AddressRoles); +function createBaseRole(): Role { + return { + role: "", + permissions: 0 + }; +} +export const Role = { + typeUrl: "/injective.permissions.v1beta1.Role", + is(o: any): o is Role { + return o && (o.$typeUrl === Role.typeUrl || typeof o.role === "string" && typeof o.permissions === "number"); + }, + isAmino(o: any): o is RoleAmino { + return o && (o.$typeUrl === Role.typeUrl || typeof o.role === "string" && typeof o.permissions === "number"); + }, + encode(message: Role, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.role !== "") { + writer.uint32(10).string(message.role); + } + if (message.permissions !== 0) { + writer.uint32(16).uint32(message.permissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Role { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRole(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Role { + const message = createBaseRole(); + message.role = object.role ?? ""; + message.permissions = object.permissions ?? 0; + return message; + }, + fromAmino(object: RoleAmino): Role { + const message = createBaseRole(); + if (object.role !== undefined && object.role !== null) { + message.role = object.role; + } + if (object.permissions !== undefined && object.permissions !== null) { + message.permissions = object.permissions; + } + return message; + }, + toAmino(message: Role): RoleAmino { + const obj: any = {}; + obj.role = message.role === "" ? undefined : message.role; + obj.permissions = message.permissions === 0 ? undefined : message.permissions; + return obj; + }, + fromAminoMsg(object: RoleAminoMsg): Role { + return Role.fromAmino(object.value); + }, + fromProtoMsg(message: RoleProtoMsg): Role { + return Role.decode(message.value); + }, + toProto(message: Role): Uint8Array { + return Role.encode(message).finish(); + }, + toProtoMsg(message: Role): RoleProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Role", + value: Role.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Role.typeUrl, Role); +function createBaseRoleIDs(): RoleIDs { + return { + roleIds: [] + }; +} +export const RoleIDs = { + typeUrl: "/injective.permissions.v1beta1.RoleIDs", + is(o: any): o is RoleIDs { + return o && (o.$typeUrl === RoleIDs.typeUrl || Array.isArray(o.roleIds) && (!o.roleIds.length || typeof o.roleIds[0] === "number")); + }, + isAmino(o: any): o is RoleIDsAmino { + return o && (o.$typeUrl === RoleIDs.typeUrl || Array.isArray(o.role_ids) && (!o.role_ids.length || typeof o.role_ids[0] === "number")); + }, + encode(message: RoleIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.roleIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RoleIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRoleIDs(); + 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.roleIds.push(reader.uint32()); + } + } else { + message.roleIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RoleIDs { + const message = createBaseRoleIDs(); + message.roleIds = object.roleIds?.map(e => e) || []; + return message; + }, + fromAmino(object: RoleIDsAmino): RoleIDs { + const message = createBaseRoleIDs(); + message.roleIds = object.role_ids?.map(e => e) || []; + return message; + }, + toAmino(message: RoleIDs): RoleIDsAmino { + const obj: any = {}; + if (message.roleIds) { + obj.role_ids = message.roleIds.map(e => e); + } else { + obj.role_ids = message.roleIds; + } + return obj; + }, + fromAminoMsg(object: RoleIDsAminoMsg): RoleIDs { + return RoleIDs.fromAmino(object.value); + }, + fromProtoMsg(message: RoleIDsProtoMsg): RoleIDs { + return RoleIDs.decode(message.value); + }, + toProto(message: RoleIDs): Uint8Array { + return RoleIDs.encode(message).finish(); + }, + toProtoMsg(message: RoleIDs): RoleIDsProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.RoleIDs", + value: RoleIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RoleIDs.typeUrl, RoleIDs); +function createBaseVoucher(): Voucher { + return { + coins: [] + }; +} +export const Voucher = { + typeUrl: "/injective.permissions.v1beta1.Voucher", + is(o: any): o is Voucher { + return o && (o.$typeUrl === Voucher.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is VoucherAmino { + return o && (o.$typeUrl === Voucher.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Voucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Voucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Voucher { + const message = createBaseVoucher(); + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: VoucherAmino): Voucher { + const message = createBaseVoucher(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Voucher): VoucherAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: VoucherAminoMsg): Voucher { + return Voucher.fromAmino(object.value); + }, + fromProtoMsg(message: VoucherProtoMsg): Voucher { + return Voucher.decode(message.value); + }, + toProto(message: Voucher): Uint8Array { + return Voucher.encode(message).finish(); + }, + toProtoMsg(message: Voucher): VoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Voucher", + value: Voucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Voucher.typeUrl, Voucher); +function createBaseAddressVoucher(): AddressVoucher { + return { + address: "", + voucher: undefined + }; +} +export const AddressVoucher = { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher", + is(o: any): o is AddressVoucher { + return o && (o.$typeUrl === AddressVoucher.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is AddressVoucherAmino { + return o && (o.$typeUrl === AddressVoucher.typeUrl || typeof o.address === "string"); + }, + encode(message: AddressVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.voucher !== undefined) { + Voucher.encode(message.voucher, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.voucher = Voucher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AddressVoucher { + const message = createBaseAddressVoucher(); + message.address = object.address ?? ""; + message.voucher = object.voucher !== undefined && object.voucher !== null ? Voucher.fromPartial(object.voucher) : undefined; + return message; + }, + fromAmino(object: AddressVoucherAmino): AddressVoucher { + const message = createBaseAddressVoucher(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.voucher !== undefined && object.voucher !== null) { + message.voucher = Voucher.fromAmino(object.voucher); + } + return message; + }, + toAmino(message: AddressVoucher): AddressVoucherAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.voucher = message.voucher ? Voucher.toAmino(message.voucher) : undefined; + return obj; + }, + fromAminoMsg(object: AddressVoucherAminoMsg): AddressVoucher { + return AddressVoucher.fromAmino(object.value); + }, + fromProtoMsg(message: AddressVoucherProtoMsg): AddressVoucher { + return AddressVoucher.decode(message.value); + }, + toProto(message: AddressVoucher): Uint8Array { + return AddressVoucher.encode(message).finish(); + }, + toProtoMsg(message: AddressVoucher): AddressVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher", + value: AddressVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressVoucher.typeUrl, AddressVoucher); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/permissions/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..39ccc3f6 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/query.rpc.func.ts @@ -0,0 +1,69 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetAllNamespaces = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllNamespacesRequest.encode, + decode: QueryAllNamespacesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AllNamespaces", + clientResolver +}); +export const useGetAllNamespaces = buildUseQuery({ + builderQueryFn: createGetAllNamespaces, + queryKeyPrefix: "AllNamespacesQuery" +}); +export const createGetNamespaceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryNamespaceByDenomRequest.encode, + decode: QueryNamespaceByDenomResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "NamespaceByDenom", + clientResolver +}); +export const useGetNamespaceByDenom = buildUseQuery({ + builderQueryFn: createGetNamespaceByDenom, + queryKeyPrefix: "NamespaceByDenomQuery" +}); +export const createGetAddressRoles = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressRolesRequest.encode, + decode: QueryAddressRolesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressRoles", + clientResolver +}); +export const useGetAddressRoles = buildUseQuery({ + builderQueryFn: createGetAddressRoles, + queryKeyPrefix: "AddressRolesQuery" +}); +export const createGetAddressesByRole = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressesByRoleRequest.encode, + decode: QueryAddressesByRoleResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressesByRole", + clientResolver +}); +export const useGetAddressesByRole = buildUseQuery({ + builderQueryFn: createGetAddressesByRole, + queryKeyPrefix: "AddressesByRoleQuery" +}); +export const createGetVouchersForAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVouchersForAddressRequest.encode, + decode: QueryVouchersForAddressResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "VouchersForAddress", + clientResolver +}); +export const useGetVouchersForAddress = buildUseQuery({ + builderQueryFn: createGetVouchersForAddress, + queryKeyPrefix: "VouchersForAddressQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/query.ts b/libs/injective-query/src/injective/permissions/v1beta1/query.ts new file mode 100644 index 00000000..adce6867 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/query.ts @@ -0,0 +1,1084 @@ +import { Params, ParamsAmino } from "./params"; +import { Namespace, NamespaceAmino } from "./permissions"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/injective.permissions.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: "/injective.permissions.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryAllNamespacesRequest is the request type for the Query/AllNamespaces RPC + * method. + */ +export interface QueryAllNamespacesRequest {} +export interface QueryAllNamespacesRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest"; + value: Uint8Array; +} +/** + * QueryAllNamespacesRequest is the request type for the Query/AllNamespaces RPC + * method. + */ +export interface QueryAllNamespacesRequestAmino {} +export interface QueryAllNamespacesRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAllNamespacesRequest"; + value: QueryAllNamespacesRequestAmino; +} +/** + * QueryAllNamespacesResponse is the response type for the Query/AllNamespaces + * RPC method. + */ +export interface QueryAllNamespacesResponse { + namespaces: Namespace[]; +} +export interface QueryAllNamespacesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse"; + value: Uint8Array; +} +/** + * QueryAllNamespacesResponse is the response type for the Query/AllNamespaces + * RPC method. + */ +export interface QueryAllNamespacesResponseAmino { + namespaces: NamespaceAmino[]; +} +export interface QueryAllNamespacesResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAllNamespacesResponse"; + value: QueryAllNamespacesResponseAmino; +} +/** + * QueryNamespaceByDenomRequest is the request type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomRequest { + denom: string; + includeRoles: boolean; +} +export interface QueryNamespaceByDenomRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest"; + value: Uint8Array; +} +/** + * QueryNamespaceByDenomRequest is the request type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomRequestAmino { + denom: string; + include_roles: boolean; +} +export interface QueryNamespaceByDenomRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest"; + value: QueryNamespaceByDenomRequestAmino; +} +/** + * QueryNamespaceByDenomResponse is the response type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomResponse { + namespace?: Namespace; +} +export interface QueryNamespaceByDenomResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse"; + value: Uint8Array; +} +/** + * QueryNamespaceByDenomResponse is the response type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomResponseAmino { + namespace?: NamespaceAmino; +} +export interface QueryNamespaceByDenomResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse"; + value: QueryNamespaceByDenomResponseAmino; +} +/** + * QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole + * RPC method. + */ +export interface QueryAddressesByRoleRequest { + denom: string; + role: string; +} +export interface QueryAddressesByRoleRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest"; + value: Uint8Array; +} +/** + * QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole + * RPC method. + */ +export interface QueryAddressesByRoleRequestAmino { + denom: string; + role: string; +} +export interface QueryAddressesByRoleRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest"; + value: QueryAddressesByRoleRequestAmino; +} +/** + * QueryAddressesByRoleResponse is the response type for the + * Query/AddressesByRole RPC method. + */ +export interface QueryAddressesByRoleResponse { + addresses: string[]; +} +export interface QueryAddressesByRoleResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse"; + value: Uint8Array; +} +/** + * QueryAddressesByRoleResponse is the response type for the + * Query/AddressesByRole RPC method. + */ +export interface QueryAddressesByRoleResponseAmino { + addresses: string[]; +} +export interface QueryAddressesByRoleResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse"; + value: QueryAddressesByRoleResponseAmino; +} +export interface QueryAddressRolesRequest { + denom: string; + address: string; +} +export interface QueryAddressRolesRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest"; + value: Uint8Array; +} +export interface QueryAddressRolesRequestAmino { + denom: string; + address: string; +} +export interface QueryAddressRolesRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressRolesRequest"; + value: QueryAddressRolesRequestAmino; +} +export interface QueryAddressRolesResponse { + roles: string[]; +} +export interface QueryAddressRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse"; + value: Uint8Array; +} +export interface QueryAddressRolesResponseAmino { + roles: string[]; +} +export interface QueryAddressRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressRolesResponse"; + value: QueryAddressRolesResponseAmino; +} +export interface QueryVouchersForAddressRequest { + address: string; +} +export interface QueryVouchersForAddressRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest"; + value: Uint8Array; +} +export interface QueryVouchersForAddressRequestAmino { + address: string; +} +export interface QueryVouchersForAddressRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest"; + value: QueryVouchersForAddressRequestAmino; +} +export interface QueryVouchersForAddressResponse { + vouchers: Coin[]; +} +export interface QueryVouchersForAddressResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse"; + value: Uint8Array; +} +export interface QueryVouchersForAddressResponseAmino { + vouchers: CoinAmino[]; +} +export interface QueryVouchersForAddressResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse"; + value: QueryVouchersForAddressResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryAllNamespacesRequest(): QueryAllNamespacesRequest { + return {}; +} +export const QueryAllNamespacesRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest", + is(o: any): o is QueryAllNamespacesRequest { + return o && o.$typeUrl === QueryAllNamespacesRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllNamespacesRequestAmino { + return o && o.$typeUrl === QueryAllNamespacesRequest.typeUrl; + }, + encode(_: QueryAllNamespacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllNamespacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNamespacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryAllNamespacesRequest { + const message = createBaseQueryAllNamespacesRequest(); + return message; + }, + fromAmino(_: QueryAllNamespacesRequestAmino): QueryAllNamespacesRequest { + const message = createBaseQueryAllNamespacesRequest(); + return message; + }, + toAmino(_: QueryAllNamespacesRequest): QueryAllNamespacesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllNamespacesRequestAminoMsg): QueryAllNamespacesRequest { + return QueryAllNamespacesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllNamespacesRequestProtoMsg): QueryAllNamespacesRequest { + return QueryAllNamespacesRequest.decode(message.value); + }, + toProto(message: QueryAllNamespacesRequest): Uint8Array { + return QueryAllNamespacesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllNamespacesRequest): QueryAllNamespacesRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest", + value: QueryAllNamespacesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllNamespacesRequest.typeUrl, QueryAllNamespacesRequest); +function createBaseQueryAllNamespacesResponse(): QueryAllNamespacesResponse { + return { + namespaces: [] + }; +} +export const QueryAllNamespacesResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse", + is(o: any): o is QueryAllNamespacesResponse { + return o && (o.$typeUrl === QueryAllNamespacesResponse.typeUrl || Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.is(o.namespaces[0]))); + }, + isAmino(o: any): o is QueryAllNamespacesResponseAmino { + return o && (o.$typeUrl === QueryAllNamespacesResponse.typeUrl || Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.isAmino(o.namespaces[0]))); + }, + encode(message: QueryAllNamespacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.namespaces) { + Namespace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllNamespacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNamespacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespaces.push(Namespace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAllNamespacesResponse { + const message = createBaseQueryAllNamespacesResponse(); + message.namespaces = object.namespaces?.map(e => Namespace.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllNamespacesResponseAmino): QueryAllNamespacesResponse { + const message = createBaseQueryAllNamespacesResponse(); + message.namespaces = object.namespaces?.map(e => Namespace.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllNamespacesResponse): QueryAllNamespacesResponseAmino { + const obj: any = {}; + if (message.namespaces) { + obj.namespaces = message.namespaces.map(e => e ? Namespace.toAmino(e) : undefined); + } else { + obj.namespaces = message.namespaces; + } + return obj; + }, + fromAminoMsg(object: QueryAllNamespacesResponseAminoMsg): QueryAllNamespacesResponse { + return QueryAllNamespacesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllNamespacesResponseProtoMsg): QueryAllNamespacesResponse { + return QueryAllNamespacesResponse.decode(message.value); + }, + toProto(message: QueryAllNamespacesResponse): Uint8Array { + return QueryAllNamespacesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllNamespacesResponse): QueryAllNamespacesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse", + value: QueryAllNamespacesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllNamespacesResponse.typeUrl, QueryAllNamespacesResponse); +function createBaseQueryNamespaceByDenomRequest(): QueryNamespaceByDenomRequest { + return { + denom: "", + includeRoles: false + }; +} +export const QueryNamespaceByDenomRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest", + is(o: any): o is QueryNamespaceByDenomRequest { + return o && (o.$typeUrl === QueryNamespaceByDenomRequest.typeUrl || typeof o.denom === "string" && typeof o.includeRoles === "boolean"); + }, + isAmino(o: any): o is QueryNamespaceByDenomRequestAmino { + return o && (o.$typeUrl === QueryNamespaceByDenomRequest.typeUrl || typeof o.denom === "string" && typeof o.include_roles === "boolean"); + }, + encode(message: QueryNamespaceByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.includeRoles === true) { + writer.uint32(16).bool(message.includeRoles); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNamespaceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNamespaceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.includeRoles = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryNamespaceByDenomRequest { + const message = createBaseQueryNamespaceByDenomRequest(); + message.denom = object.denom ?? ""; + message.includeRoles = object.includeRoles ?? false; + return message; + }, + fromAmino(object: QueryNamespaceByDenomRequestAmino): QueryNamespaceByDenomRequest { + const message = createBaseQueryNamespaceByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.include_roles !== undefined && object.include_roles !== null) { + message.includeRoles = object.include_roles; + } + return message; + }, + toAmino(message: QueryNamespaceByDenomRequest): QueryNamespaceByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.include_roles = message.includeRoles === false ? undefined : message.includeRoles; + return obj; + }, + fromAminoMsg(object: QueryNamespaceByDenomRequestAminoMsg): QueryNamespaceByDenomRequest { + return QueryNamespaceByDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNamespaceByDenomRequestProtoMsg): QueryNamespaceByDenomRequest { + return QueryNamespaceByDenomRequest.decode(message.value); + }, + toProto(message: QueryNamespaceByDenomRequest): Uint8Array { + return QueryNamespaceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNamespaceByDenomRequest): QueryNamespaceByDenomRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest", + value: QueryNamespaceByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNamespaceByDenomRequest.typeUrl, QueryNamespaceByDenomRequest); +function createBaseQueryNamespaceByDenomResponse(): QueryNamespaceByDenomResponse { + return { + namespace: undefined + }; +} +export const QueryNamespaceByDenomResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse", + is(o: any): o is QueryNamespaceByDenomResponse { + return o && o.$typeUrl === QueryNamespaceByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QueryNamespaceByDenomResponseAmino { + return o && o.$typeUrl === QueryNamespaceByDenomResponse.typeUrl; + }, + encode(message: QueryNamespaceByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.namespace !== undefined) { + Namespace.encode(message.namespace, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNamespaceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNamespaceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespace = Namespace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryNamespaceByDenomResponse { + const message = createBaseQueryNamespaceByDenomResponse(); + message.namespace = object.namespace !== undefined && object.namespace !== null ? Namespace.fromPartial(object.namespace) : undefined; + return message; + }, + fromAmino(object: QueryNamespaceByDenomResponseAmino): QueryNamespaceByDenomResponse { + const message = createBaseQueryNamespaceByDenomResponse(); + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = Namespace.fromAmino(object.namespace); + } + return message; + }, + toAmino(message: QueryNamespaceByDenomResponse): QueryNamespaceByDenomResponseAmino { + const obj: any = {}; + obj.namespace = message.namespace ? Namespace.toAmino(message.namespace) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNamespaceByDenomResponseAminoMsg): QueryNamespaceByDenomResponse { + return QueryNamespaceByDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNamespaceByDenomResponseProtoMsg): QueryNamespaceByDenomResponse { + return QueryNamespaceByDenomResponse.decode(message.value); + }, + toProto(message: QueryNamespaceByDenomResponse): Uint8Array { + return QueryNamespaceByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNamespaceByDenomResponse): QueryNamespaceByDenomResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse", + value: QueryNamespaceByDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNamespaceByDenomResponse.typeUrl, QueryNamespaceByDenomResponse); +function createBaseQueryAddressesByRoleRequest(): QueryAddressesByRoleRequest { + return { + denom: "", + role: "" + }; +} +export const QueryAddressesByRoleRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest", + is(o: any): o is QueryAddressesByRoleRequest { + return o && (o.$typeUrl === QueryAddressesByRoleRequest.typeUrl || typeof o.denom === "string" && typeof o.role === "string"); + }, + isAmino(o: any): o is QueryAddressesByRoleRequestAmino { + return o && (o.$typeUrl === QueryAddressesByRoleRequest.typeUrl || typeof o.denom === "string" && typeof o.role === "string"); + }, + encode(message: QueryAddressesByRoleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.role !== "") { + writer.uint32(18).string(message.role); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressesByRoleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressesByRoleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.role = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressesByRoleRequest { + const message = createBaseQueryAddressesByRoleRequest(); + message.denom = object.denom ?? ""; + message.role = object.role ?? ""; + return message; + }, + fromAmino(object: QueryAddressesByRoleRequestAmino): QueryAddressesByRoleRequest { + const message = createBaseQueryAddressesByRoleRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.role !== undefined && object.role !== null) { + message.role = object.role; + } + return message; + }, + toAmino(message: QueryAddressesByRoleRequest): QueryAddressesByRoleRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.role = message.role === "" ? undefined : message.role; + return obj; + }, + fromAminoMsg(object: QueryAddressesByRoleRequestAminoMsg): QueryAddressesByRoleRequest { + return QueryAddressesByRoleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressesByRoleRequestProtoMsg): QueryAddressesByRoleRequest { + return QueryAddressesByRoleRequest.decode(message.value); + }, + toProto(message: QueryAddressesByRoleRequest): Uint8Array { + return QueryAddressesByRoleRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressesByRoleRequest): QueryAddressesByRoleRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest", + value: QueryAddressesByRoleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressesByRoleRequest.typeUrl, QueryAddressesByRoleRequest); +function createBaseQueryAddressesByRoleResponse(): QueryAddressesByRoleResponse { + return { + addresses: [] + }; +} +export const QueryAddressesByRoleResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse", + is(o: any): o is QueryAddressesByRoleResponse { + return o && (o.$typeUrl === QueryAddressesByRoleResponse.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is QueryAddressesByRoleResponseAmino { + return o && (o.$typeUrl === QueryAddressesByRoleResponse.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: QueryAddressesByRoleResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressesByRoleResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressesByRoleResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressesByRoleResponse { + const message = createBaseQueryAddressesByRoleResponse(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAddressesByRoleResponseAmino): QueryAddressesByRoleResponse { + const message = createBaseQueryAddressesByRoleResponse(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAddressesByRoleResponse): QueryAddressesByRoleResponseAmino { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: QueryAddressesByRoleResponseAminoMsg): QueryAddressesByRoleResponse { + return QueryAddressesByRoleResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressesByRoleResponseProtoMsg): QueryAddressesByRoleResponse { + return QueryAddressesByRoleResponse.decode(message.value); + }, + toProto(message: QueryAddressesByRoleResponse): Uint8Array { + return QueryAddressesByRoleResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressesByRoleResponse): QueryAddressesByRoleResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse", + value: QueryAddressesByRoleResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressesByRoleResponse.typeUrl, QueryAddressesByRoleResponse); +function createBaseQueryAddressRolesRequest(): QueryAddressRolesRequest { + return { + denom: "", + address: "" + }; +} +export const QueryAddressRolesRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest", + is(o: any): o is QueryAddressRolesRequest { + return o && (o.$typeUrl === QueryAddressRolesRequest.typeUrl || typeof o.denom === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAddressRolesRequestAmino { + return o && (o.$typeUrl === QueryAddressRolesRequest.typeUrl || typeof o.denom === "string" && typeof o.address === "string"); + }, + encode(message: QueryAddressRolesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressRolesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressRolesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressRolesRequest { + const message = createBaseQueryAddressRolesRequest(); + message.denom = object.denom ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAddressRolesRequestAmino): QueryAddressRolesRequest { + const message = createBaseQueryAddressRolesRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAddressRolesRequest): QueryAddressRolesRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAddressRolesRequestAminoMsg): QueryAddressRolesRequest { + return QueryAddressRolesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressRolesRequestProtoMsg): QueryAddressRolesRequest { + return QueryAddressRolesRequest.decode(message.value); + }, + toProto(message: QueryAddressRolesRequest): Uint8Array { + return QueryAddressRolesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressRolesRequest): QueryAddressRolesRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest", + value: QueryAddressRolesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressRolesRequest.typeUrl, QueryAddressRolesRequest); +function createBaseQueryAddressRolesResponse(): QueryAddressRolesResponse { + return { + roles: [] + }; +} +export const QueryAddressRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse", + is(o: any): o is QueryAddressRolesResponse { + return o && (o.$typeUrl === QueryAddressRolesResponse.typeUrl || Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + isAmino(o: any): o is QueryAddressRolesResponseAmino { + return o && (o.$typeUrl === QueryAddressRolesResponse.typeUrl || Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + encode(message: QueryAddressRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.roles) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roles.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressRolesResponse { + const message = createBaseQueryAddressRolesResponse(); + message.roles = object.roles?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAddressRolesResponseAmino): QueryAddressRolesResponse { + const message = createBaseQueryAddressRolesResponse(); + message.roles = object.roles?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAddressRolesResponse): QueryAddressRolesResponseAmino { + const obj: any = {}; + if (message.roles) { + obj.roles = message.roles.map(e => e); + } else { + obj.roles = message.roles; + } + return obj; + }, + fromAminoMsg(object: QueryAddressRolesResponseAminoMsg): QueryAddressRolesResponse { + return QueryAddressRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressRolesResponseProtoMsg): QueryAddressRolesResponse { + return QueryAddressRolesResponse.decode(message.value); + }, + toProto(message: QueryAddressRolesResponse): Uint8Array { + return QueryAddressRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressRolesResponse): QueryAddressRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse", + value: QueryAddressRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressRolesResponse.typeUrl, QueryAddressRolesResponse); +function createBaseQueryVouchersForAddressRequest(): QueryVouchersForAddressRequest { + return { + address: "" + }; +} +export const QueryVouchersForAddressRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest", + is(o: any): o is QueryVouchersForAddressRequest { + return o && (o.$typeUrl === QueryVouchersForAddressRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryVouchersForAddressRequestAmino { + return o && (o.$typeUrl === QueryVouchersForAddressRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryVouchersForAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVouchersForAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVouchersForAddressRequest(); + 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: DeepPartial): QueryVouchersForAddressRequest { + const message = createBaseQueryVouchersForAddressRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryVouchersForAddressRequestAmino): QueryVouchersForAddressRequest { + const message = createBaseQueryVouchersForAddressRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryVouchersForAddressRequest): QueryVouchersForAddressRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryVouchersForAddressRequestAminoMsg): QueryVouchersForAddressRequest { + return QueryVouchersForAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVouchersForAddressRequestProtoMsg): QueryVouchersForAddressRequest { + return QueryVouchersForAddressRequest.decode(message.value); + }, + toProto(message: QueryVouchersForAddressRequest): Uint8Array { + return QueryVouchersForAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVouchersForAddressRequest): QueryVouchersForAddressRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest", + value: QueryVouchersForAddressRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVouchersForAddressRequest.typeUrl, QueryVouchersForAddressRequest); +function createBaseQueryVouchersForAddressResponse(): QueryVouchersForAddressResponse { + return { + vouchers: [] + }; +} +export const QueryVouchersForAddressResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse", + is(o: any): o is QueryVouchersForAddressResponse { + return o && (o.$typeUrl === QueryVouchersForAddressResponse.typeUrl || Array.isArray(o.vouchers) && (!o.vouchers.length || Coin.is(o.vouchers[0]))); + }, + isAmino(o: any): o is QueryVouchersForAddressResponseAmino { + return o && (o.$typeUrl === QueryVouchersForAddressResponse.typeUrl || Array.isArray(o.vouchers) && (!o.vouchers.length || Coin.isAmino(o.vouchers[0]))); + }, + encode(message: QueryVouchersForAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.vouchers) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVouchersForAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVouchersForAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vouchers.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryVouchersForAddressResponse { + const message = createBaseQueryVouchersForAddressResponse(); + message.vouchers = object.vouchers?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryVouchersForAddressResponseAmino): QueryVouchersForAddressResponse { + const message = createBaseQueryVouchersForAddressResponse(); + message.vouchers = object.vouchers?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryVouchersForAddressResponse): QueryVouchersForAddressResponseAmino { + const obj: any = {}; + if (message.vouchers) { + obj.vouchers = message.vouchers.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.vouchers = message.vouchers; + } + return obj; + }, + fromAminoMsg(object: QueryVouchersForAddressResponseAminoMsg): QueryVouchersForAddressResponse { + return QueryVouchersForAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVouchersForAddressResponseProtoMsg): QueryVouchersForAddressResponse { + return QueryVouchersForAddressResponse.decode(message.value); + }, + toProto(message: QueryVouchersForAddressResponse): Uint8Array { + return QueryVouchersForAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVouchersForAddressResponse): QueryVouchersForAddressResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse", + value: QueryVouchersForAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVouchersForAddressResponse.typeUrl, QueryVouchersForAddressResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/permissions/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..982223c8 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/tx.rpc.func.ts @@ -0,0 +1,67 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createCreateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateNamespace.typeUrl, + encoders: toEncoders(MsgCreateNamespace), + converters: toConverters(MsgCreateNamespace) +}); +export const useCreateNamespace = buildUseMutation({ + builderMutationFn: createCreateNamespace +}); +export const createDeleteNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeleteNamespace.typeUrl, + encoders: toEncoders(MsgDeleteNamespace), + converters: toConverters(MsgDeleteNamespace) +}); +export const useDeleteNamespace = buildUseMutation({ + builderMutationFn: createDeleteNamespace +}); +export const createUpdateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespace.typeUrl, + encoders: toEncoders(MsgUpdateNamespace), + converters: toConverters(MsgUpdateNamespace) +}); +export const useUpdateNamespace = buildUseMutation({ + builderMutationFn: createUpdateNamespace +}); +export const createUpdateNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespaceRoles.typeUrl, + encoders: toEncoders(MsgUpdateNamespaceRoles), + converters: toConverters(MsgUpdateNamespaceRoles) +}); +export const useUpdateNamespaceRoles = buildUseMutation({ + builderMutationFn: createUpdateNamespaceRoles +}); +export const createRevokeNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeNamespaceRoles.typeUrl, + encoders: toEncoders(MsgRevokeNamespaceRoles), + converters: toConverters(MsgRevokeNamespaceRoles) +}); +export const useRevokeNamespaceRoles = buildUseMutation({ + builderMutationFn: createRevokeNamespaceRoles +}); +export const createClaimVoucher = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClaimVoucher.typeUrl, + encoders: toEncoders(MsgClaimVoucher), + converters: toConverters(MsgClaimVoucher) +}); +export const useClaimVoucher = buildUseMutation({ + builderMutationFn: createClaimVoucher +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/permissions/v1beta1/tx.ts b/libs/injective-query/src/injective/permissions/v1beta1/tx.ts new file mode 100644 index 00000000..e3dc4630 --- /dev/null +++ b/libs/injective-query/src/injective/permissions/v1beta1/tx.ts @@ -0,0 +1,1682 @@ +import { Params, ParamsAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { Namespace, NamespaceAmino, Role, RoleAmino, AddressRoles, AddressRolesAmino } from "./permissions"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the permissions parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the permissions parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "permissions/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgCreateNamespace { + sender: string; + namespace: Namespace; +} +export interface MsgCreateNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace"; + value: Uint8Array; +} +export interface MsgCreateNamespaceAmino { + sender: string; + namespace: NamespaceAmino; +} +export interface MsgCreateNamespaceAminoMsg { + type: "permissions/MsgCreateNamespace"; + value: MsgCreateNamespaceAmino; +} +export interface MsgCreateNamespaceResponse {} +export interface MsgCreateNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse"; + value: Uint8Array; +} +export interface MsgCreateNamespaceResponseAmino {} +export interface MsgCreateNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse"; + value: MsgCreateNamespaceResponseAmino; +} +export interface MsgDeleteNamespace { + sender: string; + namespaceDenom: string; +} +export interface MsgDeleteNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace"; + value: Uint8Array; +} +export interface MsgDeleteNamespaceAmino { + sender: string; + namespace_denom: string; +} +export interface MsgDeleteNamespaceAminoMsg { + type: "permissions/MsgDeleteNamespace"; + value: MsgDeleteNamespaceAmino; +} +export interface MsgDeleteNamespaceResponse {} +export interface MsgDeleteNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse"; + value: Uint8Array; +} +export interface MsgDeleteNamespaceResponseAmino {} +export interface MsgDeleteNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse"; + value: MsgDeleteNamespaceResponseAmino; +} +export interface MsgUpdateNamespace { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** address of smart contract to apply code-based restrictions */ + wasmHook?: MsgUpdateNamespace_MsgSetWasmHook; + mintsPaused?: MsgUpdateNamespace_MsgSetMintsPaused; + sendsPaused?: MsgUpdateNamespace_MsgSetSendsPaused; + burnsPaused?: MsgUpdateNamespace_MsgSetBurnsPaused; +} +export interface MsgUpdateNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** address of smart contract to apply code-based restrictions */ + wasm_hook?: MsgUpdateNamespace_MsgSetWasmHookAmino; + mints_paused?: MsgUpdateNamespace_MsgSetMintsPausedAmino; + sends_paused?: MsgUpdateNamespace_MsgSetSendsPausedAmino; + burns_paused?: MsgUpdateNamespace_MsgSetBurnsPausedAmino; +} +export interface MsgUpdateNamespaceAminoMsg { + type: "permissions/MsgUpdateNamespace"; + value: MsgUpdateNamespaceAmino; +} +export interface MsgUpdateNamespace_MsgSetWasmHook { + newValue: string; +} +export interface MsgUpdateNamespace_MsgSetWasmHookProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetWasmHookAmino { + new_value: string; +} +export interface MsgUpdateNamespace_MsgSetWasmHookAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetWasmHook"; + value: MsgUpdateNamespace_MsgSetWasmHookAmino; +} +export interface MsgUpdateNamespace_MsgSetMintsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetMintsPaused"; + value: MsgUpdateNamespace_MsgSetMintsPausedAmino; +} +export interface MsgUpdateNamespace_MsgSetSendsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetSendsPaused"; + value: MsgUpdateNamespace_MsgSetSendsPausedAmino; +} +export interface MsgUpdateNamespace_MsgSetBurnsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetBurnsPaused"; + value: MsgUpdateNamespace_MsgSetBurnsPausedAmino; +} +export interface MsgUpdateNamespaceResponse {} +export interface MsgUpdateNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceResponseAmino {} +export interface MsgUpdateNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse"; + value: MsgUpdateNamespaceResponseAmino; +} +export interface MsgUpdateNamespaceRoles { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** new role definitions or updated permissions for existing roles */ + rolePermissions: Role[]; + /** new addresses to add or new roles for existing addresses to */ + addressRoles: AddressRoles[]; +} +export interface MsgUpdateNamespaceRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceRolesAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** new role definitions or updated permissions for existing roles */ + role_permissions: RoleAmino[]; + /** new addresses to add or new roles for existing addresses to */ + address_roles: AddressRolesAmino[]; +} +export interface MsgUpdateNamespaceRolesAminoMsg { + type: "permissions/MsgUpdateNamespaceRoles"; + value: MsgUpdateNamespaceRolesAmino; +} +export interface MsgUpdateNamespaceRolesResponse {} +export interface MsgUpdateNamespaceRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceRolesResponseAmino {} +export interface MsgUpdateNamespaceRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse"; + value: MsgUpdateNamespaceRolesResponseAmino; +} +export interface MsgRevokeNamespaceRoles { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** {"address" => array of roles to revoke from this address} */ + addressRolesToRevoke: AddressRoles[]; +} +export interface MsgRevokeNamespaceRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles"; + value: Uint8Array; +} +export interface MsgRevokeNamespaceRolesAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** {"address" => array of roles to revoke from this address} */ + address_roles_to_revoke: AddressRolesAmino[]; +} +export interface MsgRevokeNamespaceRolesAminoMsg { + type: "permissions/MsgRevokeNamespaceRoles"; + value: MsgRevokeNamespaceRolesAmino; +} +export interface MsgRevokeNamespaceRolesResponse {} +export interface MsgRevokeNamespaceRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse"; + value: Uint8Array; +} +export interface MsgRevokeNamespaceRolesResponseAmino {} +export interface MsgRevokeNamespaceRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse"; + value: MsgRevokeNamespaceRolesResponseAmino; +} +export interface MsgClaimVoucher { + sender: string; + denom: string; +} +export interface MsgClaimVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher"; + value: Uint8Array; +} +export interface MsgClaimVoucherAmino { + sender: string; + denom: string; +} +export interface MsgClaimVoucherAminoMsg { + type: "permissions/MsgClaimVoucher"; + value: MsgClaimVoucherAmino; +} +export interface MsgClaimVoucherResponse {} +export interface MsgClaimVoucherResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse"; + value: Uint8Array; +} +export interface MsgClaimVoucherResponseAmino {} +export interface MsgClaimVoucherResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgClaimVoucherResponse"; + value: MsgClaimVoucherResponseAmino; +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParams", + aminoType: "permissions/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "permissions/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: "/injective.permissions.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgCreateNamespace(): MsgCreateNamespace { + return { + sender: "", + namespace: Namespace.fromPartial({}) + }; +} +export const MsgCreateNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace", + aminoType: "permissions/MsgCreateNamespace", + is(o: any): o is MsgCreateNamespace { + return o && (o.$typeUrl === MsgCreateNamespace.typeUrl || typeof o.sender === "string" && Namespace.is(o.namespace)); + }, + isAmino(o: any): o is MsgCreateNamespaceAmino { + return o && (o.$typeUrl === MsgCreateNamespace.typeUrl || typeof o.sender === "string" && Namespace.isAmino(o.namespace)); + }, + encode(message: MsgCreateNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespace !== undefined) { + Namespace.encode(message.namespace, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespace = Namespace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateNamespace { + const message = createBaseMsgCreateNamespace(); + message.sender = object.sender ?? ""; + message.namespace = object.namespace !== undefined && object.namespace !== null ? Namespace.fromPartial(object.namespace) : undefined; + return message; + }, + fromAmino(object: MsgCreateNamespaceAmino): MsgCreateNamespace { + const message = createBaseMsgCreateNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = Namespace.fromAmino(object.namespace); + } + return message; + }, + toAmino(message: MsgCreateNamespace): MsgCreateNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace = message.namespace ? Namespace.toAmino(message.namespace) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateNamespaceAminoMsg): MsgCreateNamespace { + return MsgCreateNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateNamespace): MsgCreateNamespaceAminoMsg { + return { + type: "permissions/MsgCreateNamespace", + value: MsgCreateNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateNamespaceProtoMsg): MsgCreateNamespace { + return MsgCreateNamespace.decode(message.value); + }, + toProto(message: MsgCreateNamespace): Uint8Array { + return MsgCreateNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateNamespace): MsgCreateNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace", + value: MsgCreateNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateNamespace.typeUrl, MsgCreateNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateNamespace.aminoType, MsgCreateNamespace.typeUrl); +function createBaseMsgCreateNamespaceResponse(): MsgCreateNamespaceResponse { + return {}; +} +export const MsgCreateNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse", + is(o: any): o is MsgCreateNamespaceResponse { + return o && o.$typeUrl === MsgCreateNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateNamespaceResponseAmino { + return o && o.$typeUrl === MsgCreateNamespaceResponse.typeUrl; + }, + encode(_: MsgCreateNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateNamespaceResponse { + const message = createBaseMsgCreateNamespaceResponse(); + return message; + }, + fromAmino(_: MsgCreateNamespaceResponseAmino): MsgCreateNamespaceResponse { + const message = createBaseMsgCreateNamespaceResponse(); + return message; + }, + toAmino(_: MsgCreateNamespaceResponse): MsgCreateNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateNamespaceResponseAminoMsg): MsgCreateNamespaceResponse { + return MsgCreateNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateNamespaceResponseProtoMsg): MsgCreateNamespaceResponse { + return MsgCreateNamespaceResponse.decode(message.value); + }, + toProto(message: MsgCreateNamespaceResponse): Uint8Array { + return MsgCreateNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateNamespaceResponse): MsgCreateNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse", + value: MsgCreateNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateNamespaceResponse.typeUrl, MsgCreateNamespaceResponse); +function createBaseMsgDeleteNamespace(): MsgDeleteNamespace { + return { + sender: "", + namespaceDenom: "" + }; +} +export const MsgDeleteNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace", + aminoType: "permissions/MsgDeleteNamespace", + is(o: any): o is MsgDeleteNamespace { + return o && (o.$typeUrl === MsgDeleteNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string"); + }, + isAmino(o: any): o is MsgDeleteNamespaceAmino { + return o && (o.$typeUrl === MsgDeleteNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string"); + }, + encode(message: MsgDeleteNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeleteNamespace { + const message = createBaseMsgDeleteNamespace(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + return message; + }, + fromAmino(object: MsgDeleteNamespaceAmino): MsgDeleteNamespace { + const message = createBaseMsgDeleteNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + return message; + }, + toAmino(message: MsgDeleteNamespace): MsgDeleteNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + return obj; + }, + fromAminoMsg(object: MsgDeleteNamespaceAminoMsg): MsgDeleteNamespace { + return MsgDeleteNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeleteNamespace): MsgDeleteNamespaceAminoMsg { + return { + type: "permissions/MsgDeleteNamespace", + value: MsgDeleteNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDeleteNamespaceProtoMsg): MsgDeleteNamespace { + return MsgDeleteNamespace.decode(message.value); + }, + toProto(message: MsgDeleteNamespace): Uint8Array { + return MsgDeleteNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteNamespace): MsgDeleteNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace", + value: MsgDeleteNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeleteNamespace.typeUrl, MsgDeleteNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeleteNamespace.aminoType, MsgDeleteNamespace.typeUrl); +function createBaseMsgDeleteNamespaceResponse(): MsgDeleteNamespaceResponse { + return {}; +} +export const MsgDeleteNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse", + is(o: any): o is MsgDeleteNamespaceResponse { + return o && o.$typeUrl === MsgDeleteNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgDeleteNamespaceResponseAmino { + return o && o.$typeUrl === MsgDeleteNamespaceResponse.typeUrl; + }, + encode(_: MsgDeleteNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDeleteNamespaceResponse { + const message = createBaseMsgDeleteNamespaceResponse(); + return message; + }, + fromAmino(_: MsgDeleteNamespaceResponseAmino): MsgDeleteNamespaceResponse { + const message = createBaseMsgDeleteNamespaceResponse(); + return message; + }, + toAmino(_: MsgDeleteNamespaceResponse): MsgDeleteNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeleteNamespaceResponseAminoMsg): MsgDeleteNamespaceResponse { + return MsgDeleteNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeleteNamespaceResponseProtoMsg): MsgDeleteNamespaceResponse { + return MsgDeleteNamespaceResponse.decode(message.value); + }, + toProto(message: MsgDeleteNamespaceResponse): Uint8Array { + return MsgDeleteNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteNamespaceResponse): MsgDeleteNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse", + value: MsgDeleteNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeleteNamespaceResponse.typeUrl, MsgDeleteNamespaceResponse); +function createBaseMsgUpdateNamespace(): MsgUpdateNamespace { + return { + sender: "", + namespaceDenom: "", + wasmHook: undefined, + mintsPaused: undefined, + sendsPaused: undefined, + burnsPaused: undefined + }; +} +export const MsgUpdateNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace", + aminoType: "permissions/MsgUpdateNamespace", + is(o: any): o is MsgUpdateNamespace { + return o && (o.$typeUrl === MsgUpdateNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string"); + }, + isAmino(o: any): o is MsgUpdateNamespaceAmino { + return o && (o.$typeUrl === MsgUpdateNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string"); + }, + encode(message: MsgUpdateNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + if (message.wasmHook !== undefined) { + MsgUpdateNamespace_MsgSetWasmHook.encode(message.wasmHook, writer.uint32(26).fork()).ldelim(); + } + if (message.mintsPaused !== undefined) { + MsgUpdateNamespace_MsgSetMintsPaused.encode(message.mintsPaused, writer.uint32(34).fork()).ldelim(); + } + if (message.sendsPaused !== undefined) { + MsgUpdateNamespace_MsgSetSendsPaused.encode(message.sendsPaused, writer.uint32(42).fork()).ldelim(); + } + if (message.burnsPaused !== undefined) { + MsgUpdateNamespace_MsgSetBurnsPaused.encode(message.burnsPaused, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.wasmHook = MsgUpdateNamespace_MsgSetWasmHook.decode(reader, reader.uint32()); + break; + case 4: + message.mintsPaused = MsgUpdateNamespace_MsgSetMintsPaused.decode(reader, reader.uint32()); + break; + case 5: + message.sendsPaused = MsgUpdateNamespace_MsgSetSendsPaused.decode(reader, reader.uint32()); + break; + case 6: + message.burnsPaused = MsgUpdateNamespace_MsgSetBurnsPaused.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace { + const message = createBaseMsgUpdateNamespace(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.wasmHook = object.wasmHook !== undefined && object.wasmHook !== null ? MsgUpdateNamespace_MsgSetWasmHook.fromPartial(object.wasmHook) : undefined; + message.mintsPaused = object.mintsPaused !== undefined && object.mintsPaused !== null ? MsgUpdateNamespace_MsgSetMintsPaused.fromPartial(object.mintsPaused) : undefined; + message.sendsPaused = object.sendsPaused !== undefined && object.sendsPaused !== null ? MsgUpdateNamespace_MsgSetSendsPaused.fromPartial(object.sendsPaused) : undefined; + message.burnsPaused = object.burnsPaused !== undefined && object.burnsPaused !== null ? MsgUpdateNamespace_MsgSetBurnsPaused.fromPartial(object.burnsPaused) : undefined; + return message; + }, + fromAmino(object: MsgUpdateNamespaceAmino): MsgUpdateNamespace { + const message = createBaseMsgUpdateNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + if (object.wasm_hook !== undefined && object.wasm_hook !== null) { + message.wasmHook = MsgUpdateNamespace_MsgSetWasmHook.fromAmino(object.wasm_hook); + } + if (object.mints_paused !== undefined && object.mints_paused !== null) { + message.mintsPaused = MsgUpdateNamespace_MsgSetMintsPaused.fromAmino(object.mints_paused); + } + if (object.sends_paused !== undefined && object.sends_paused !== null) { + message.sendsPaused = MsgUpdateNamespace_MsgSetSendsPaused.fromAmino(object.sends_paused); + } + if (object.burns_paused !== undefined && object.burns_paused !== null) { + message.burnsPaused = MsgUpdateNamespace_MsgSetBurnsPaused.fromAmino(object.burns_paused); + } + return message; + }, + toAmino(message: MsgUpdateNamespace): MsgUpdateNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + obj.wasm_hook = message.wasmHook ? MsgUpdateNamespace_MsgSetWasmHook.toAmino(message.wasmHook) : undefined; + obj.mints_paused = message.mintsPaused ? MsgUpdateNamespace_MsgSetMintsPaused.toAmino(message.mintsPaused) : undefined; + obj.sends_paused = message.sendsPaused ? MsgUpdateNamespace_MsgSetSendsPaused.toAmino(message.sendsPaused) : undefined; + obj.burns_paused = message.burnsPaused ? MsgUpdateNamespace_MsgSetBurnsPaused.toAmino(message.burnsPaused) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceAminoMsg): MsgUpdateNamespace { + return MsgUpdateNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateNamespace): MsgUpdateNamespaceAminoMsg { + return { + type: "permissions/MsgUpdateNamespace", + value: MsgUpdateNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateNamespaceProtoMsg): MsgUpdateNamespace { + return MsgUpdateNamespace.decode(message.value); + }, + toProto(message: MsgUpdateNamespace): Uint8Array { + return MsgUpdateNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace): MsgUpdateNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace", + value: MsgUpdateNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace.typeUrl, MsgUpdateNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateNamespace.aminoType, MsgUpdateNamespace.typeUrl); +function createBaseMsgUpdateNamespace_MsgSetWasmHook(): MsgUpdateNamespace_MsgSetWasmHook { + return { + newValue: "" + }; +} +export const MsgUpdateNamespace_MsgSetWasmHook = { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook", + is(o: any): o is MsgUpdateNamespace_MsgSetWasmHook { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetWasmHook.typeUrl || typeof o.newValue === "string"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetWasmHookAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetWasmHook.typeUrl || typeof o.new_value === "string"); + }, + encode(message: MsgUpdateNamespace_MsgSetWasmHook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue !== "") { + writer.uint32(10).string(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetWasmHook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetWasmHook { + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + message.newValue = object.newValue ?? ""; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetWasmHookAmino): MsgUpdateNamespace_MsgSetWasmHook { + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetWasmHook): MsgUpdateNamespace_MsgSetWasmHookAmino { + const obj: any = {}; + obj.new_value = message.newValue === "" ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetWasmHookAminoMsg): MsgUpdateNamespace_MsgSetWasmHook { + return MsgUpdateNamespace_MsgSetWasmHook.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetWasmHookProtoMsg): MsgUpdateNamespace_MsgSetWasmHook { + return MsgUpdateNamespace_MsgSetWasmHook.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetWasmHook): Uint8Array { + return MsgUpdateNamespace_MsgSetWasmHook.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetWasmHook): MsgUpdateNamespace_MsgSetWasmHookProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook", + value: MsgUpdateNamespace_MsgSetWasmHook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetWasmHook.typeUrl, MsgUpdateNamespace_MsgSetWasmHook); +function createBaseMsgUpdateNamespace_MsgSetMintsPaused(): MsgUpdateNamespace_MsgSetMintsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetMintsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetMintsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetMintsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetMintsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetMintsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetMintsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetMintsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetMintsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetMintsPausedAmino): MsgUpdateNamespace_MsgSetMintsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetMintsPaused): MsgUpdateNamespace_MsgSetMintsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetMintsPausedAminoMsg): MsgUpdateNamespace_MsgSetMintsPaused { + return MsgUpdateNamespace_MsgSetMintsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetMintsPausedProtoMsg): MsgUpdateNamespace_MsgSetMintsPaused { + return MsgUpdateNamespace_MsgSetMintsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetMintsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetMintsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetMintsPaused): MsgUpdateNamespace_MsgSetMintsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused", + value: MsgUpdateNamespace_MsgSetMintsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetMintsPaused.typeUrl, MsgUpdateNamespace_MsgSetMintsPaused); +function createBaseMsgUpdateNamespace_MsgSetSendsPaused(): MsgUpdateNamespace_MsgSetSendsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetSendsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetSendsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetSendsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetSendsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetSendsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetSendsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetSendsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetSendsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetSendsPausedAmino): MsgUpdateNamespace_MsgSetSendsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetSendsPaused): MsgUpdateNamespace_MsgSetSendsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetSendsPausedAminoMsg): MsgUpdateNamespace_MsgSetSendsPaused { + return MsgUpdateNamespace_MsgSetSendsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetSendsPausedProtoMsg): MsgUpdateNamespace_MsgSetSendsPaused { + return MsgUpdateNamespace_MsgSetSendsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetSendsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetSendsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetSendsPaused): MsgUpdateNamespace_MsgSetSendsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused", + value: MsgUpdateNamespace_MsgSetSendsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetSendsPaused.typeUrl, MsgUpdateNamespace_MsgSetSendsPaused); +function createBaseMsgUpdateNamespace_MsgSetBurnsPaused(): MsgUpdateNamespace_MsgSetBurnsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetBurnsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetBurnsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetBurnsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetBurnsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetBurnsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetBurnsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetBurnsPausedAmino): MsgUpdateNamespace_MsgSetBurnsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetBurnsPaused): MsgUpdateNamespace_MsgSetBurnsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetBurnsPausedAminoMsg): MsgUpdateNamespace_MsgSetBurnsPaused { + return MsgUpdateNamespace_MsgSetBurnsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg): MsgUpdateNamespace_MsgSetBurnsPaused { + return MsgUpdateNamespace_MsgSetBurnsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetBurnsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetBurnsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetBurnsPaused): MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused", + value: MsgUpdateNamespace_MsgSetBurnsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl, MsgUpdateNamespace_MsgSetBurnsPaused); +function createBaseMsgUpdateNamespaceResponse(): MsgUpdateNamespaceResponse { + return {}; +} +export const MsgUpdateNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse", + is(o: any): o is MsgUpdateNamespaceResponse { + return o && o.$typeUrl === MsgUpdateNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateNamespaceResponseAmino { + return o && o.$typeUrl === MsgUpdateNamespaceResponse.typeUrl; + }, + encode(_: MsgUpdateNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateNamespaceResponse { + const message = createBaseMsgUpdateNamespaceResponse(); + return message; + }, + fromAmino(_: MsgUpdateNamespaceResponseAmino): MsgUpdateNamespaceResponse { + const message = createBaseMsgUpdateNamespaceResponse(); + return message; + }, + toAmino(_: MsgUpdateNamespaceResponse): MsgUpdateNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceResponseAminoMsg): MsgUpdateNamespaceResponse { + return MsgUpdateNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespaceResponseProtoMsg): MsgUpdateNamespaceResponse { + return MsgUpdateNamespaceResponse.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceResponse): Uint8Array { + return MsgUpdateNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceResponse): MsgUpdateNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse", + value: MsgUpdateNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceResponse.typeUrl, MsgUpdateNamespaceResponse); +function createBaseMsgUpdateNamespaceRoles(): MsgUpdateNamespaceRoles { + return { + sender: "", + namespaceDenom: "", + rolePermissions: [], + addressRoles: [] + }; +} +export const MsgUpdateNamespaceRoles = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles", + aminoType: "permissions/MsgUpdateNamespaceRoles", + is(o: any): o is MsgUpdateNamespaceRoles { + return o && (o.$typeUrl === MsgUpdateNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string" && Array.isArray(o.rolePermissions) && (!o.rolePermissions.length || Role.is(o.rolePermissions[0])) && Array.isArray(o.addressRoles) && (!o.addressRoles.length || AddressRoles.is(o.addressRoles[0]))); + }, + isAmino(o: any): o is MsgUpdateNamespaceRolesAmino { + return o && (o.$typeUrl === MsgUpdateNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string" && Array.isArray(o.role_permissions) && (!o.role_permissions.length || Role.isAmino(o.role_permissions[0])) && Array.isArray(o.address_roles) && (!o.address_roles.length || AddressRoles.isAmino(o.address_roles[0]))); + }, + encode(message: MsgUpdateNamespaceRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + for (const v of message.rolePermissions) { + Role.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.addressRoles) { + AddressRoles.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.rolePermissions.push(Role.decode(reader, reader.uint32())); + break; + case 4: + message.addressRoles.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespaceRoles { + const message = createBaseMsgUpdateNamespaceRoles(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.rolePermissions = object.rolePermissions?.map(e => Role.fromPartial(e)) || []; + message.addressRoles = object.addressRoles?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateNamespaceRolesAmino): MsgUpdateNamespaceRoles { + const message = createBaseMsgUpdateNamespaceRoles(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + message.rolePermissions = object.role_permissions?.map(e => Role.fromAmino(e)) || []; + message.addressRoles = object.address_roles?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + if (message.rolePermissions) { + obj.role_permissions = message.rolePermissions.map(e => e ? Role.toAmino(e) : undefined); + } else { + obj.role_permissions = message.rolePermissions; + } + if (message.addressRoles) { + obj.address_roles = message.addressRoles.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles = message.addressRoles; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceRolesAminoMsg): MsgUpdateNamespaceRoles { + return MsgUpdateNamespaceRoles.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesAminoMsg { + return { + type: "permissions/MsgUpdateNamespaceRoles", + value: MsgUpdateNamespaceRoles.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateNamespaceRolesProtoMsg): MsgUpdateNamespaceRoles { + return MsgUpdateNamespaceRoles.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceRoles): Uint8Array { + return MsgUpdateNamespaceRoles.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles", + value: MsgUpdateNamespaceRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceRoles.typeUrl, MsgUpdateNamespaceRoles); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateNamespaceRoles.aminoType, MsgUpdateNamespaceRoles.typeUrl); +function createBaseMsgUpdateNamespaceRolesResponse(): MsgUpdateNamespaceRolesResponse { + return {}; +} +export const MsgUpdateNamespaceRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse", + is(o: any): o is MsgUpdateNamespaceRolesResponse { + return o && o.$typeUrl === MsgUpdateNamespaceRolesResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateNamespaceRolesResponseAmino { + return o && o.$typeUrl === MsgUpdateNamespaceRolesResponse.typeUrl; + }, + encode(_: MsgUpdateNamespaceRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateNamespaceRolesResponse { + const message = createBaseMsgUpdateNamespaceRolesResponse(); + return message; + }, + fromAmino(_: MsgUpdateNamespaceRolesResponseAmino): MsgUpdateNamespaceRolesResponse { + const message = createBaseMsgUpdateNamespaceRolesResponse(); + return message; + }, + toAmino(_: MsgUpdateNamespaceRolesResponse): MsgUpdateNamespaceRolesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceRolesResponseAminoMsg): MsgUpdateNamespaceRolesResponse { + return MsgUpdateNamespaceRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespaceRolesResponseProtoMsg): MsgUpdateNamespaceRolesResponse { + return MsgUpdateNamespaceRolesResponse.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceRolesResponse): Uint8Array { + return MsgUpdateNamespaceRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceRolesResponse): MsgUpdateNamespaceRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse", + value: MsgUpdateNamespaceRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceRolesResponse.typeUrl, MsgUpdateNamespaceRolesResponse); +function createBaseMsgRevokeNamespaceRoles(): MsgRevokeNamespaceRoles { + return { + sender: "", + namespaceDenom: "", + addressRolesToRevoke: [] + }; +} +export const MsgRevokeNamespaceRoles = { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles", + aminoType: "permissions/MsgRevokeNamespaceRoles", + is(o: any): o is MsgRevokeNamespaceRoles { + return o && (o.$typeUrl === MsgRevokeNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string" && Array.isArray(o.addressRolesToRevoke) && (!o.addressRolesToRevoke.length || AddressRoles.is(o.addressRolesToRevoke[0]))); + }, + isAmino(o: any): o is MsgRevokeNamespaceRolesAmino { + return o && (o.$typeUrl === MsgRevokeNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string" && Array.isArray(o.address_roles_to_revoke) && (!o.address_roles_to_revoke.length || AddressRoles.isAmino(o.address_roles_to_revoke[0]))); + }, + encode(message: MsgRevokeNamespaceRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + for (const v of message.addressRolesToRevoke) { + AddressRoles.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeNamespaceRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeNamespaceRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.addressRolesToRevoke.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeNamespaceRoles { + const message = createBaseMsgRevokeNamespaceRoles(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.addressRolesToRevoke = object.addressRolesToRevoke?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRevokeNamespaceRolesAmino): MsgRevokeNamespaceRoles { + const message = createBaseMsgRevokeNamespaceRoles(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + message.addressRolesToRevoke = object.address_roles_to_revoke?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + if (message.addressRolesToRevoke) { + obj.address_roles_to_revoke = message.addressRolesToRevoke.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles_to_revoke = message.addressRolesToRevoke; + } + return obj; + }, + fromAminoMsg(object: MsgRevokeNamespaceRolesAminoMsg): MsgRevokeNamespaceRoles { + return MsgRevokeNamespaceRoles.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesAminoMsg { + return { + type: "permissions/MsgRevokeNamespaceRoles", + value: MsgRevokeNamespaceRoles.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeNamespaceRolesProtoMsg): MsgRevokeNamespaceRoles { + return MsgRevokeNamespaceRoles.decode(message.value); + }, + toProto(message: MsgRevokeNamespaceRoles): Uint8Array { + return MsgRevokeNamespaceRoles.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles", + value: MsgRevokeNamespaceRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeNamespaceRoles.typeUrl, MsgRevokeNamespaceRoles); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeNamespaceRoles.aminoType, MsgRevokeNamespaceRoles.typeUrl); +function createBaseMsgRevokeNamespaceRolesResponse(): MsgRevokeNamespaceRolesResponse { + return {}; +} +export const MsgRevokeNamespaceRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse", + is(o: any): o is MsgRevokeNamespaceRolesResponse { + return o && o.$typeUrl === MsgRevokeNamespaceRolesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeNamespaceRolesResponseAmino { + return o && o.$typeUrl === MsgRevokeNamespaceRolesResponse.typeUrl; + }, + encode(_: MsgRevokeNamespaceRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeNamespaceRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeNamespaceRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeNamespaceRolesResponse { + const message = createBaseMsgRevokeNamespaceRolesResponse(); + return message; + }, + fromAmino(_: MsgRevokeNamespaceRolesResponseAmino): MsgRevokeNamespaceRolesResponse { + const message = createBaseMsgRevokeNamespaceRolesResponse(); + return message; + }, + toAmino(_: MsgRevokeNamespaceRolesResponse): MsgRevokeNamespaceRolesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeNamespaceRolesResponseAminoMsg): MsgRevokeNamespaceRolesResponse { + return MsgRevokeNamespaceRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRevokeNamespaceRolesResponseProtoMsg): MsgRevokeNamespaceRolesResponse { + return MsgRevokeNamespaceRolesResponse.decode(message.value); + }, + toProto(message: MsgRevokeNamespaceRolesResponse): Uint8Array { + return MsgRevokeNamespaceRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeNamespaceRolesResponse): MsgRevokeNamespaceRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse", + value: MsgRevokeNamespaceRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeNamespaceRolesResponse.typeUrl, MsgRevokeNamespaceRolesResponse); +function createBaseMsgClaimVoucher(): MsgClaimVoucher { + return { + sender: "", + denom: "" + }; +} +export const MsgClaimVoucher = { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher", + aminoType: "permissions/MsgClaimVoucher", + is(o: any): o is MsgClaimVoucher { + return o && (o.$typeUrl === MsgClaimVoucher.typeUrl || typeof o.sender === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is MsgClaimVoucherAmino { + return o && (o.$typeUrl === MsgClaimVoucher.typeUrl || typeof o.sender === "string" && typeof o.denom === "string"); + }, + encode(message: MsgClaimVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaimVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimVoucher(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgClaimVoucher { + const message = createBaseMsgClaimVoucher(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: MsgClaimVoucherAmino): MsgClaimVoucher { + const message = createBaseMsgClaimVoucher(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: MsgClaimVoucher): MsgClaimVoucherAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: MsgClaimVoucherAminoMsg): MsgClaimVoucher { + return MsgClaimVoucher.fromAmino(object.value); + }, + toAminoMsg(message: MsgClaimVoucher): MsgClaimVoucherAminoMsg { + return { + type: "permissions/MsgClaimVoucher", + value: MsgClaimVoucher.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClaimVoucherProtoMsg): MsgClaimVoucher { + return MsgClaimVoucher.decode(message.value); + }, + toProto(message: MsgClaimVoucher): Uint8Array { + return MsgClaimVoucher.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimVoucher): MsgClaimVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher", + value: MsgClaimVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClaimVoucher.typeUrl, MsgClaimVoucher); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClaimVoucher.aminoType, MsgClaimVoucher.typeUrl); +function createBaseMsgClaimVoucherResponse(): MsgClaimVoucherResponse { + return {}; +} +export const MsgClaimVoucherResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse", + is(o: any): o is MsgClaimVoucherResponse { + return o && o.$typeUrl === MsgClaimVoucherResponse.typeUrl; + }, + isAmino(o: any): o is MsgClaimVoucherResponseAmino { + return o && o.$typeUrl === MsgClaimVoucherResponse.typeUrl; + }, + encode(_: MsgClaimVoucherResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaimVoucherResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimVoucherResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgClaimVoucherResponse { + const message = createBaseMsgClaimVoucherResponse(); + return message; + }, + fromAmino(_: MsgClaimVoucherResponseAmino): MsgClaimVoucherResponse { + const message = createBaseMsgClaimVoucherResponse(); + return message; + }, + toAmino(_: MsgClaimVoucherResponse): MsgClaimVoucherResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClaimVoucherResponseAminoMsg): MsgClaimVoucherResponse { + return MsgClaimVoucherResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClaimVoucherResponseProtoMsg): MsgClaimVoucherResponse { + return MsgClaimVoucherResponse.decode(message.value); + }, + toProto(message: MsgClaimVoucherResponse): Uint8Array { + return MsgClaimVoucherResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimVoucherResponse): MsgClaimVoucherResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse", + value: MsgClaimVoucherResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClaimVoucherResponse.typeUrl, MsgClaimVoucherResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/stream/v1beta1/query.ts b/libs/injective-query/src/injective/stream/v1beta1/query.ts new file mode 100644 index 00000000..9bdabccf --- /dev/null +++ b/libs/injective-query/src/injective/stream/v1beta1/query.ts @@ -0,0 +1,2870 @@ +import { Level, LevelAmino, Deposit, DepositAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, PositionDelta, PositionDeltaAmino } from "../../exchange/v1beta1/exchange"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OrderUpdateStatus { + Unspecified = 0, + Booked = 1, + Matched = 2, + Cancelled = 3, + UNRECOGNIZED = -1, +} +export const OrderUpdateStatusAmino = OrderUpdateStatus; +export function orderUpdateStatusFromJSON(object: any): OrderUpdateStatus { + switch (object) { + case 0: + case "Unspecified": + return OrderUpdateStatus.Unspecified; + case 1: + case "Booked": + return OrderUpdateStatus.Booked; + case 2: + case "Matched": + return OrderUpdateStatus.Matched; + case 3: + case "Cancelled": + return OrderUpdateStatus.Cancelled; + case -1: + case "UNRECOGNIZED": + default: + return OrderUpdateStatus.UNRECOGNIZED; + } +} +export function orderUpdateStatusToJSON(object: OrderUpdateStatus): string { + switch (object) { + case OrderUpdateStatus.Unspecified: + return "Unspecified"; + case OrderUpdateStatus.Booked: + return "Booked"; + case OrderUpdateStatus.Matched: + return "Matched"; + case OrderUpdateStatus.Cancelled: + return "Cancelled"; + case OrderUpdateStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface StreamRequest { + bankBalancesFilter?: BankBalancesFilter; + subaccountDepositsFilter?: SubaccountDepositsFilter; + spotTradesFilter?: TradesFilter; + derivativeTradesFilter?: TradesFilter; + spotOrdersFilter?: OrdersFilter; + derivativeOrdersFilter?: OrdersFilter; + spotOrderbooksFilter?: OrderbookFilter; + derivativeOrderbooksFilter?: OrderbookFilter; + positionsFilter?: PositionsFilter; + oraclePriceFilter?: OraclePriceFilter; +} +export interface StreamRequestProtoMsg { + typeUrl: "/injective.stream.v1beta1.StreamRequest"; + value: Uint8Array; +} +export interface StreamRequestAmino { + bank_balances_filter?: BankBalancesFilterAmino; + subaccount_deposits_filter?: SubaccountDepositsFilterAmino; + spot_trades_filter?: TradesFilterAmino; + derivative_trades_filter?: TradesFilterAmino; + spot_orders_filter?: OrdersFilterAmino; + derivative_orders_filter?: OrdersFilterAmino; + spot_orderbooks_filter?: OrderbookFilterAmino; + derivative_orderbooks_filter?: OrderbookFilterAmino; + positions_filter?: PositionsFilterAmino; + oracle_price_filter?: OraclePriceFilterAmino; +} +export interface StreamRequestAminoMsg { + type: "/injective.stream.v1beta1.StreamRequest"; + value: StreamRequestAmino; +} +export interface StreamResponse { + blockHeight: bigint; + blockTime: bigint; + bankBalances: BankBalance[]; + subaccountDeposits: SubaccountDeposits[]; + spotTrades: SpotTrade[]; + derivativeTrades: DerivativeTrade[]; + spotOrders: SpotOrderUpdate[]; + derivativeOrders: DerivativeOrderUpdate[]; + spotOrderbookUpdates: OrderbookUpdate[]; + derivativeOrderbookUpdates: OrderbookUpdate[]; + positions: Position[]; + oraclePrices: OraclePrice[]; +} +export interface StreamResponseProtoMsg { + typeUrl: "/injective.stream.v1beta1.StreamResponse"; + value: Uint8Array; +} +export interface StreamResponseAmino { + block_height: string; + block_time: string; + bank_balances: BankBalanceAmino[]; + subaccount_deposits: SubaccountDepositsAmino[]; + spot_trades: SpotTradeAmino[]; + derivative_trades: DerivativeTradeAmino[]; + spot_orders: SpotOrderUpdateAmino[]; + derivative_orders: DerivativeOrderUpdateAmino[]; + spot_orderbook_updates: OrderbookUpdateAmino[]; + derivative_orderbook_updates: OrderbookUpdateAmino[]; + positions: PositionAmino[]; + oracle_prices: OraclePriceAmino[]; +} +export interface StreamResponseAminoMsg { + type: "/injective.stream.v1beta1.StreamResponse"; + value: StreamResponseAmino; +} +export interface OrderbookUpdate { + seq: bigint; + orderbook?: Orderbook; +} +export interface OrderbookUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate"; + value: Uint8Array; +} +export interface OrderbookUpdateAmino { + seq: string; + orderbook?: OrderbookAmino; +} +export interface OrderbookUpdateAminoMsg { + type: "/injective.stream.v1beta1.OrderbookUpdate"; + value: OrderbookUpdateAmino; +} +export interface Orderbook { + marketId: string; + buyLevels: Level[]; + sellLevels: Level[]; +} +export interface OrderbookProtoMsg { + typeUrl: "/injective.stream.v1beta1.Orderbook"; + value: Uint8Array; +} +export interface OrderbookAmino { + market_id: string; + buy_levels: LevelAmino[]; + sell_levels: LevelAmino[]; +} +export interface OrderbookAminoMsg { + type: "/injective.stream.v1beta1.Orderbook"; + value: OrderbookAmino; +} +export interface BankBalance { + account: string; + balances: Coin[]; +} +export interface BankBalanceProtoMsg { + typeUrl: "/injective.stream.v1beta1.BankBalance"; + value: Uint8Array; +} +export interface BankBalanceAmino { + account: string; + balances: CoinAmino[]; +} +export interface BankBalanceAminoMsg { + type: "/injective.stream.v1beta1.BankBalance"; + value: BankBalanceAmino; +} +export interface SubaccountDeposits { + subaccountId: string; + deposits: SubaccountDeposit[]; +} +export interface SubaccountDepositsProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits"; + value: Uint8Array; +} +export interface SubaccountDepositsAmino { + subaccount_id: string; + deposits: SubaccountDepositAmino[]; +} +export interface SubaccountDepositsAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDeposits"; + value: SubaccountDepositsAmino; +} +export interface SubaccountDeposit { + denom: string; + deposit: Deposit; +} +export interface SubaccountDepositProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit"; + value: Uint8Array; +} +export interface SubaccountDepositAmino { + denom: string; + deposit: DepositAmino; +} +export interface SubaccountDepositAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDeposit"; + value: SubaccountDepositAmino; +} +export interface SpotOrderUpdate { + status: OrderUpdateStatus; + orderHash: Uint8Array; + cid: string; + order?: SpotOrder; +} +export interface SpotOrderUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate"; + value: Uint8Array; +} +export interface SpotOrderUpdateAmino { + status: OrderUpdateStatus; + order_hash: string; + cid: string; + order?: SpotOrderAmino; +} +export interface SpotOrderUpdateAminoMsg { + type: "/injective.stream.v1beta1.SpotOrderUpdate"; + value: SpotOrderUpdateAmino; +} +export interface SpotOrder { + marketId: string; + order: SpotLimitOrder; +} +export interface SpotOrderProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotOrder"; + value: Uint8Array; +} +export interface SpotOrderAmino { + market_id: string; + order: SpotLimitOrderAmino; +} +export interface SpotOrderAminoMsg { + type: "/injective.stream.v1beta1.SpotOrder"; + value: SpotOrderAmino; +} +export interface DerivativeOrderUpdate { + status: OrderUpdateStatus; + orderHash: Uint8Array; + cid: string; + order?: DerivativeOrder; +} +export interface DerivativeOrderUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate"; + value: Uint8Array; +} +export interface DerivativeOrderUpdateAmino { + status: OrderUpdateStatus; + order_hash: string; + cid: string; + order?: DerivativeOrderAmino; +} +export interface DerivativeOrderUpdateAminoMsg { + type: "/injective.stream.v1beta1.DerivativeOrderUpdate"; + value: DerivativeOrderUpdateAmino; +} +export interface DerivativeOrder { + marketId: string; + order: DerivativeLimitOrder; + isMarket: boolean; +} +export interface DerivativeOrderProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder"; + value: Uint8Array; +} +export interface DerivativeOrderAmino { + market_id: string; + order: DerivativeLimitOrderAmino; + is_market: boolean; +} +export interface DerivativeOrderAminoMsg { + type: "/injective.stream.v1beta1.DerivativeOrder"; + value: DerivativeOrderAmino; +} +export interface Position { + marketId: string; + subaccountId: string; + isLong: boolean; + quantity: string; + entryPrice: string; + margin: string; + cumulativeFundingEntry: string; +} +export interface PositionProtoMsg { + typeUrl: "/injective.stream.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + market_id: string; + subaccount_id: string; + isLong: boolean; + quantity: string; + entry_price: string; + margin: string; + cumulative_funding_entry: string; +} +export interface PositionAminoMsg { + type: "/injective.stream.v1beta1.Position"; + value: PositionAmino; +} +export interface OraclePrice { + symbol: string; + price: string; + type: string; +} +export interface OraclePriceProtoMsg { + typeUrl: "/injective.stream.v1beta1.OraclePrice"; + value: Uint8Array; +} +export interface OraclePriceAmino { + symbol: string; + price: string; + type: string; +} +export interface OraclePriceAminoMsg { + type: "/injective.stream.v1beta1.OraclePrice"; + value: OraclePriceAmino; +} +export interface SpotTrade { + marketId: string; + isBuy: boolean; + executionType: string; + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccountId: string; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: string; + cid: string; + tradeId: string; +} +export interface SpotTradeProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotTrade"; + value: Uint8Array; +} +export interface SpotTradeAmino { + market_id: string; + is_buy: boolean; + executionType: string; + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccount_id: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + trade_id: string; +} +export interface SpotTradeAminoMsg { + type: "/injective.stream.v1beta1.SpotTrade"; + value: SpotTradeAmino; +} +export interface DerivativeTrade { + marketId: string; + isBuy: boolean; + executionType: string; + subaccountId: string; + positionDelta?: PositionDelta; + payout: string; + fee: string; + orderHash: string; + feeRecipientAddress?: string; + cid: string; + tradeId: string; +} +export interface DerivativeTradeProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade"; + value: Uint8Array; +} +export interface DerivativeTradeAmino { + market_id: string; + is_buy: boolean; + executionType: string; + subaccount_id: string; + position_delta?: PositionDeltaAmino; + payout: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + trade_id: string; +} +export interface DerivativeTradeAminoMsg { + type: "/injective.stream.v1beta1.DerivativeTrade"; + value: DerivativeTradeAmino; +} +export interface TradesFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface TradesFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.TradesFilter"; + value: Uint8Array; +} +export interface TradesFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface TradesFilterAminoMsg { + type: "/injective.stream.v1beta1.TradesFilter"; + value: TradesFilterAmino; +} +export interface PositionsFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface PositionsFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.PositionsFilter"; + value: Uint8Array; +} +export interface PositionsFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface PositionsFilterAminoMsg { + type: "/injective.stream.v1beta1.PositionsFilter"; + value: PositionsFilterAmino; +} +export interface OrdersFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface OrdersFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrdersFilter"; + value: Uint8Array; +} +export interface OrdersFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface OrdersFilterAminoMsg { + type: "/injective.stream.v1beta1.OrdersFilter"; + value: OrdersFilterAmino; +} +export interface OrderbookFilter { + marketIds: string[]; +} +export interface OrderbookFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter"; + value: Uint8Array; +} +export interface OrderbookFilterAmino { + market_ids: string[]; +} +export interface OrderbookFilterAminoMsg { + type: "/injective.stream.v1beta1.OrderbookFilter"; + value: OrderbookFilterAmino; +} +export interface BankBalancesFilter { + accounts: string[]; +} +export interface BankBalancesFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter"; + value: Uint8Array; +} +export interface BankBalancesFilterAmino { + accounts: string[]; +} +export interface BankBalancesFilterAminoMsg { + type: "/injective.stream.v1beta1.BankBalancesFilter"; + value: BankBalancesFilterAmino; +} +export interface SubaccountDepositsFilter { + subaccountIds: string[]; +} +export interface SubaccountDepositsFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter"; + value: Uint8Array; +} +export interface SubaccountDepositsFilterAmino { + subaccount_ids: string[]; +} +export interface SubaccountDepositsFilterAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDepositsFilter"; + value: SubaccountDepositsFilterAmino; +} +export interface OraclePriceFilter { + symbol: string[]; +} +export interface OraclePriceFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter"; + value: Uint8Array; +} +export interface OraclePriceFilterAmino { + symbol: string[]; +} +export interface OraclePriceFilterAminoMsg { + type: "/injective.stream.v1beta1.OraclePriceFilter"; + value: OraclePriceFilterAmino; +} +function createBaseStreamRequest(): StreamRequest { + return { + bankBalancesFilter: undefined, + subaccountDepositsFilter: undefined, + spotTradesFilter: undefined, + derivativeTradesFilter: undefined, + spotOrdersFilter: undefined, + derivativeOrdersFilter: undefined, + spotOrderbooksFilter: undefined, + derivativeOrderbooksFilter: undefined, + positionsFilter: undefined, + oraclePriceFilter: undefined + }; +} +export const StreamRequest = { + typeUrl: "/injective.stream.v1beta1.StreamRequest", + is(o: any): o is StreamRequest { + return o && o.$typeUrl === StreamRequest.typeUrl; + }, + isAmino(o: any): o is StreamRequestAmino { + return o && o.$typeUrl === StreamRequest.typeUrl; + }, + encode(message: StreamRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bankBalancesFilter !== undefined) { + BankBalancesFilter.encode(message.bankBalancesFilter, writer.uint32(10).fork()).ldelim(); + } + if (message.subaccountDepositsFilter !== undefined) { + SubaccountDepositsFilter.encode(message.subaccountDepositsFilter, writer.uint32(18).fork()).ldelim(); + } + if (message.spotTradesFilter !== undefined) { + TradesFilter.encode(message.spotTradesFilter, writer.uint32(26).fork()).ldelim(); + } + if (message.derivativeTradesFilter !== undefined) { + TradesFilter.encode(message.derivativeTradesFilter, writer.uint32(34).fork()).ldelim(); + } + if (message.spotOrdersFilter !== undefined) { + OrdersFilter.encode(message.spotOrdersFilter, writer.uint32(42).fork()).ldelim(); + } + if (message.derivativeOrdersFilter !== undefined) { + OrdersFilter.encode(message.derivativeOrdersFilter, writer.uint32(50).fork()).ldelim(); + } + if (message.spotOrderbooksFilter !== undefined) { + OrderbookFilter.encode(message.spotOrderbooksFilter, writer.uint32(58).fork()).ldelim(); + } + if (message.derivativeOrderbooksFilter !== undefined) { + OrderbookFilter.encode(message.derivativeOrderbooksFilter, writer.uint32(66).fork()).ldelim(); + } + if (message.positionsFilter !== undefined) { + PositionsFilter.encode(message.positionsFilter, writer.uint32(74).fork()).ldelim(); + } + if (message.oraclePriceFilter !== undefined) { + OraclePriceFilter.encode(message.oraclePriceFilter, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bankBalancesFilter = BankBalancesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountDepositsFilter = SubaccountDepositsFilter.decode(reader, reader.uint32()); + break; + case 3: + message.spotTradesFilter = TradesFilter.decode(reader, reader.uint32()); + break; + case 4: + message.derivativeTradesFilter = TradesFilter.decode(reader, reader.uint32()); + break; + case 5: + message.spotOrdersFilter = OrdersFilter.decode(reader, reader.uint32()); + break; + case 6: + message.derivativeOrdersFilter = OrdersFilter.decode(reader, reader.uint32()); + break; + case 7: + message.spotOrderbooksFilter = OrderbookFilter.decode(reader, reader.uint32()); + break; + case 8: + message.derivativeOrderbooksFilter = OrderbookFilter.decode(reader, reader.uint32()); + break; + case 9: + message.positionsFilter = PositionsFilter.decode(reader, reader.uint32()); + break; + case 10: + message.oraclePriceFilter = OraclePriceFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StreamRequest { + const message = createBaseStreamRequest(); + message.bankBalancesFilter = object.bankBalancesFilter !== undefined && object.bankBalancesFilter !== null ? BankBalancesFilter.fromPartial(object.bankBalancesFilter) : undefined; + message.subaccountDepositsFilter = object.subaccountDepositsFilter !== undefined && object.subaccountDepositsFilter !== null ? SubaccountDepositsFilter.fromPartial(object.subaccountDepositsFilter) : undefined; + message.spotTradesFilter = object.spotTradesFilter !== undefined && object.spotTradesFilter !== null ? TradesFilter.fromPartial(object.spotTradesFilter) : undefined; + message.derivativeTradesFilter = object.derivativeTradesFilter !== undefined && object.derivativeTradesFilter !== null ? TradesFilter.fromPartial(object.derivativeTradesFilter) : undefined; + message.spotOrdersFilter = object.spotOrdersFilter !== undefined && object.spotOrdersFilter !== null ? OrdersFilter.fromPartial(object.spotOrdersFilter) : undefined; + message.derivativeOrdersFilter = object.derivativeOrdersFilter !== undefined && object.derivativeOrdersFilter !== null ? OrdersFilter.fromPartial(object.derivativeOrdersFilter) : undefined; + message.spotOrderbooksFilter = object.spotOrderbooksFilter !== undefined && object.spotOrderbooksFilter !== null ? OrderbookFilter.fromPartial(object.spotOrderbooksFilter) : undefined; + message.derivativeOrderbooksFilter = object.derivativeOrderbooksFilter !== undefined && object.derivativeOrderbooksFilter !== null ? OrderbookFilter.fromPartial(object.derivativeOrderbooksFilter) : undefined; + message.positionsFilter = object.positionsFilter !== undefined && object.positionsFilter !== null ? PositionsFilter.fromPartial(object.positionsFilter) : undefined; + message.oraclePriceFilter = object.oraclePriceFilter !== undefined && object.oraclePriceFilter !== null ? OraclePriceFilter.fromPartial(object.oraclePriceFilter) : undefined; + return message; + }, + fromAmino(object: StreamRequestAmino): StreamRequest { + const message = createBaseStreamRequest(); + if (object.bank_balances_filter !== undefined && object.bank_balances_filter !== null) { + message.bankBalancesFilter = BankBalancesFilter.fromAmino(object.bank_balances_filter); + } + if (object.subaccount_deposits_filter !== undefined && object.subaccount_deposits_filter !== null) { + message.subaccountDepositsFilter = SubaccountDepositsFilter.fromAmino(object.subaccount_deposits_filter); + } + if (object.spot_trades_filter !== undefined && object.spot_trades_filter !== null) { + message.spotTradesFilter = TradesFilter.fromAmino(object.spot_trades_filter); + } + if (object.derivative_trades_filter !== undefined && object.derivative_trades_filter !== null) { + message.derivativeTradesFilter = TradesFilter.fromAmino(object.derivative_trades_filter); + } + if (object.spot_orders_filter !== undefined && object.spot_orders_filter !== null) { + message.spotOrdersFilter = OrdersFilter.fromAmino(object.spot_orders_filter); + } + if (object.derivative_orders_filter !== undefined && object.derivative_orders_filter !== null) { + message.derivativeOrdersFilter = OrdersFilter.fromAmino(object.derivative_orders_filter); + } + if (object.spot_orderbooks_filter !== undefined && object.spot_orderbooks_filter !== null) { + message.spotOrderbooksFilter = OrderbookFilter.fromAmino(object.spot_orderbooks_filter); + } + if (object.derivative_orderbooks_filter !== undefined && object.derivative_orderbooks_filter !== null) { + message.derivativeOrderbooksFilter = OrderbookFilter.fromAmino(object.derivative_orderbooks_filter); + } + if (object.positions_filter !== undefined && object.positions_filter !== null) { + message.positionsFilter = PositionsFilter.fromAmino(object.positions_filter); + } + if (object.oracle_price_filter !== undefined && object.oracle_price_filter !== null) { + message.oraclePriceFilter = OraclePriceFilter.fromAmino(object.oracle_price_filter); + } + return message; + }, + toAmino(message: StreamRequest): StreamRequestAmino { + const obj: any = {}; + obj.bank_balances_filter = message.bankBalancesFilter ? BankBalancesFilter.toAmino(message.bankBalancesFilter) : undefined; + obj.subaccount_deposits_filter = message.subaccountDepositsFilter ? SubaccountDepositsFilter.toAmino(message.subaccountDepositsFilter) : undefined; + obj.spot_trades_filter = message.spotTradesFilter ? TradesFilter.toAmino(message.spotTradesFilter) : undefined; + obj.derivative_trades_filter = message.derivativeTradesFilter ? TradesFilter.toAmino(message.derivativeTradesFilter) : undefined; + obj.spot_orders_filter = message.spotOrdersFilter ? OrdersFilter.toAmino(message.spotOrdersFilter) : undefined; + obj.derivative_orders_filter = message.derivativeOrdersFilter ? OrdersFilter.toAmino(message.derivativeOrdersFilter) : undefined; + obj.spot_orderbooks_filter = message.spotOrderbooksFilter ? OrderbookFilter.toAmino(message.spotOrderbooksFilter) : undefined; + obj.derivative_orderbooks_filter = message.derivativeOrderbooksFilter ? OrderbookFilter.toAmino(message.derivativeOrderbooksFilter) : undefined; + obj.positions_filter = message.positionsFilter ? PositionsFilter.toAmino(message.positionsFilter) : undefined; + obj.oracle_price_filter = message.oraclePriceFilter ? OraclePriceFilter.toAmino(message.oraclePriceFilter) : undefined; + return obj; + }, + fromAminoMsg(object: StreamRequestAminoMsg): StreamRequest { + return StreamRequest.fromAmino(object.value); + }, + fromProtoMsg(message: StreamRequestProtoMsg): StreamRequest { + return StreamRequest.decode(message.value); + }, + toProto(message: StreamRequest): Uint8Array { + return StreamRequest.encode(message).finish(); + }, + toProtoMsg(message: StreamRequest): StreamRequestProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.StreamRequest", + value: StreamRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StreamRequest.typeUrl, StreamRequest); +function createBaseStreamResponse(): StreamResponse { + return { + blockHeight: BigInt(0), + blockTime: BigInt(0), + bankBalances: [], + subaccountDeposits: [], + spotTrades: [], + derivativeTrades: [], + spotOrders: [], + derivativeOrders: [], + spotOrderbookUpdates: [], + derivativeOrderbookUpdates: [], + positions: [], + oraclePrices: [] + }; +} +export const StreamResponse = { + typeUrl: "/injective.stream.v1beta1.StreamResponse", + is(o: any): o is StreamResponse { + return o && (o.$typeUrl === StreamResponse.typeUrl || typeof o.blockHeight === "bigint" && typeof o.blockTime === "bigint" && Array.isArray(o.bankBalances) && (!o.bankBalances.length || BankBalance.is(o.bankBalances[0])) && Array.isArray(o.subaccountDeposits) && (!o.subaccountDeposits.length || SubaccountDeposits.is(o.subaccountDeposits[0])) && Array.isArray(o.spotTrades) && (!o.spotTrades.length || SpotTrade.is(o.spotTrades[0])) && Array.isArray(o.derivativeTrades) && (!o.derivativeTrades.length || DerivativeTrade.is(o.derivativeTrades[0])) && Array.isArray(o.spotOrders) && (!o.spotOrders.length || SpotOrderUpdate.is(o.spotOrders[0])) && Array.isArray(o.derivativeOrders) && (!o.derivativeOrders.length || DerivativeOrderUpdate.is(o.derivativeOrders[0])) && Array.isArray(o.spotOrderbookUpdates) && (!o.spotOrderbookUpdates.length || OrderbookUpdate.is(o.spotOrderbookUpdates[0])) && Array.isArray(o.derivativeOrderbookUpdates) && (!o.derivativeOrderbookUpdates.length || OrderbookUpdate.is(o.derivativeOrderbookUpdates[0])) && Array.isArray(o.positions) && (!o.positions.length || Position.is(o.positions[0])) && Array.isArray(o.oraclePrices) && (!o.oraclePrices.length || OraclePrice.is(o.oraclePrices[0]))); + }, + isAmino(o: any): o is StreamResponseAmino { + return o && (o.$typeUrl === StreamResponse.typeUrl || typeof o.block_height === "bigint" && typeof o.block_time === "bigint" && Array.isArray(o.bank_balances) && (!o.bank_balances.length || BankBalance.isAmino(o.bank_balances[0])) && Array.isArray(o.subaccount_deposits) && (!o.subaccount_deposits.length || SubaccountDeposits.isAmino(o.subaccount_deposits[0])) && Array.isArray(o.spot_trades) && (!o.spot_trades.length || SpotTrade.isAmino(o.spot_trades[0])) && Array.isArray(o.derivative_trades) && (!o.derivative_trades.length || DerivativeTrade.isAmino(o.derivative_trades[0])) && Array.isArray(o.spot_orders) && (!o.spot_orders.length || SpotOrderUpdate.isAmino(o.spot_orders[0])) && Array.isArray(o.derivative_orders) && (!o.derivative_orders.length || DerivativeOrderUpdate.isAmino(o.derivative_orders[0])) && Array.isArray(o.spot_orderbook_updates) && (!o.spot_orderbook_updates.length || OrderbookUpdate.isAmino(o.spot_orderbook_updates[0])) && Array.isArray(o.derivative_orderbook_updates) && (!o.derivative_orderbook_updates.length || OrderbookUpdate.isAmino(o.derivative_orderbook_updates[0])) && Array.isArray(o.positions) && (!o.positions.length || Position.isAmino(o.positions[0])) && Array.isArray(o.oracle_prices) && (!o.oracle_prices.length || OraclePrice.isAmino(o.oracle_prices[0]))); + }, + encode(message: StreamResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.blockHeight); + } + if (message.blockTime !== BigInt(0)) { + writer.uint32(16).int64(message.blockTime); + } + for (const v of message.bankBalances) { + BankBalance.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.subaccountDeposits) { + SubaccountDeposits.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.spotTrades) { + SpotTrade.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.derivativeTrades) { + DerivativeTrade.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.spotOrders) { + SpotOrderUpdate.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.derivativeOrders) { + DerivativeOrderUpdate.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.spotOrderbookUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.derivativeOrderbookUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(82).fork()).ldelim(); + } + for (const v of message.positions) { + Position.encode(v!, writer.uint32(90).fork()).ldelim(); + } + for (const v of message.oraclePrices) { + OraclePrice.encode(v!, writer.uint32(98).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.blockTime = reader.int64(); + break; + case 3: + message.bankBalances.push(BankBalance.decode(reader, reader.uint32())); + break; + case 4: + message.subaccountDeposits.push(SubaccountDeposits.decode(reader, reader.uint32())); + break; + case 5: + message.spotTrades.push(SpotTrade.decode(reader, reader.uint32())); + break; + case 6: + message.derivativeTrades.push(DerivativeTrade.decode(reader, reader.uint32())); + break; + case 7: + message.spotOrders.push(SpotOrderUpdate.decode(reader, reader.uint32())); + break; + case 8: + message.derivativeOrders.push(DerivativeOrderUpdate.decode(reader, reader.uint32())); + break; + case 9: + message.spotOrderbookUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 10: + message.derivativeOrderbookUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 11: + message.positions.push(Position.decode(reader, reader.uint32())); + break; + case 12: + message.oraclePrices.push(OraclePrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StreamResponse { + const message = createBaseStreamResponse(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.blockTime = object.blockTime !== undefined && object.blockTime !== null ? BigInt(object.blockTime.toString()) : BigInt(0); + message.bankBalances = object.bankBalances?.map(e => BankBalance.fromPartial(e)) || []; + message.subaccountDeposits = object.subaccountDeposits?.map(e => SubaccountDeposits.fromPartial(e)) || []; + message.spotTrades = object.spotTrades?.map(e => SpotTrade.fromPartial(e)) || []; + message.derivativeTrades = object.derivativeTrades?.map(e => DerivativeTrade.fromPartial(e)) || []; + message.spotOrders = object.spotOrders?.map(e => SpotOrderUpdate.fromPartial(e)) || []; + message.derivativeOrders = object.derivativeOrders?.map(e => DerivativeOrderUpdate.fromPartial(e)) || []; + message.spotOrderbookUpdates = object.spotOrderbookUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.derivativeOrderbookUpdates = object.derivativeOrderbookUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.positions = object.positions?.map(e => Position.fromPartial(e)) || []; + message.oraclePrices = object.oraclePrices?.map(e => OraclePrice.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StreamResponseAmino): StreamResponse { + const message = createBaseStreamResponse(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.block_time !== undefined && object.block_time !== null) { + message.blockTime = BigInt(object.block_time); + } + message.bankBalances = object.bank_balances?.map(e => BankBalance.fromAmino(e)) || []; + message.subaccountDeposits = object.subaccount_deposits?.map(e => SubaccountDeposits.fromAmino(e)) || []; + message.spotTrades = object.spot_trades?.map(e => SpotTrade.fromAmino(e)) || []; + message.derivativeTrades = object.derivative_trades?.map(e => DerivativeTrade.fromAmino(e)) || []; + message.spotOrders = object.spot_orders?.map(e => SpotOrderUpdate.fromAmino(e)) || []; + message.derivativeOrders = object.derivative_orders?.map(e => DerivativeOrderUpdate.fromAmino(e)) || []; + message.spotOrderbookUpdates = object.spot_orderbook_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.derivativeOrderbookUpdates = object.derivative_orderbook_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.positions = object.positions?.map(e => Position.fromAmino(e)) || []; + message.oraclePrices = object.oracle_prices?.map(e => OraclePrice.fromAmino(e)) || []; + return message; + }, + toAmino(message: StreamResponse): StreamResponseAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.block_time = message.blockTime !== BigInt(0) ? message.blockTime?.toString() : undefined; + if (message.bankBalances) { + obj.bank_balances = message.bankBalances.map(e => e ? BankBalance.toAmino(e) : undefined); + } else { + obj.bank_balances = message.bankBalances; + } + if (message.subaccountDeposits) { + obj.subaccount_deposits = message.subaccountDeposits.map(e => e ? SubaccountDeposits.toAmino(e) : undefined); + } else { + obj.subaccount_deposits = message.subaccountDeposits; + } + if (message.spotTrades) { + obj.spot_trades = message.spotTrades.map(e => e ? SpotTrade.toAmino(e) : undefined); + } else { + obj.spot_trades = message.spotTrades; + } + if (message.derivativeTrades) { + obj.derivative_trades = message.derivativeTrades.map(e => e ? DerivativeTrade.toAmino(e) : undefined); + } else { + obj.derivative_trades = message.derivativeTrades; + } + if (message.spotOrders) { + obj.spot_orders = message.spotOrders.map(e => e ? SpotOrderUpdate.toAmino(e) : undefined); + } else { + obj.spot_orders = message.spotOrders; + } + if (message.derivativeOrders) { + obj.derivative_orders = message.derivativeOrders.map(e => e ? DerivativeOrderUpdate.toAmino(e) : undefined); + } else { + obj.derivative_orders = message.derivativeOrders; + } + if (message.spotOrderbookUpdates) { + obj.spot_orderbook_updates = message.spotOrderbookUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.spot_orderbook_updates = message.spotOrderbookUpdates; + } + if (message.derivativeOrderbookUpdates) { + obj.derivative_orderbook_updates = message.derivativeOrderbookUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.derivative_orderbook_updates = message.derivativeOrderbookUpdates; + } + if (message.positions) { + obj.positions = message.positions.map(e => e ? Position.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + if (message.oraclePrices) { + obj.oracle_prices = message.oraclePrices.map(e => e ? OraclePrice.toAmino(e) : undefined); + } else { + obj.oracle_prices = message.oraclePrices; + } + return obj; + }, + fromAminoMsg(object: StreamResponseAminoMsg): StreamResponse { + return StreamResponse.fromAmino(object.value); + }, + fromProtoMsg(message: StreamResponseProtoMsg): StreamResponse { + return StreamResponse.decode(message.value); + }, + toProto(message: StreamResponse): Uint8Array { + return StreamResponse.encode(message).finish(); + }, + toProtoMsg(message: StreamResponse): StreamResponseProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.StreamResponse", + value: StreamResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StreamResponse.typeUrl, StreamResponse); +function createBaseOrderbookUpdate(): OrderbookUpdate { + return { + seq: BigInt(0), + orderbook: undefined + }; +} +export const OrderbookUpdate = { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate", + is(o: any): o is OrderbookUpdate { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + isAmino(o: any): o is OrderbookUpdateAmino { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + encode(message: OrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seq !== BigInt(0)) { + writer.uint32(8).uint64(message.seq); + } + if (message.orderbook !== undefined) { + Orderbook.encode(message.orderbook, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seq = reader.uint64(); + break; + case 2: + message.orderbook = Orderbook.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + message.seq = object.seq !== undefined && object.seq !== null ? BigInt(object.seq.toString()) : BigInt(0); + message.orderbook = object.orderbook !== undefined && object.orderbook !== null ? Orderbook.fromPartial(object.orderbook) : undefined; + return message; + }, + fromAmino(object: OrderbookUpdateAmino): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + if (object.seq !== undefined && object.seq !== null) { + message.seq = BigInt(object.seq); + } + if (object.orderbook !== undefined && object.orderbook !== null) { + message.orderbook = Orderbook.fromAmino(object.orderbook); + } + return message; + }, + toAmino(message: OrderbookUpdate): OrderbookUpdateAmino { + const obj: any = {}; + obj.seq = message.seq !== BigInt(0) ? message.seq?.toString() : undefined; + obj.orderbook = message.orderbook ? Orderbook.toAmino(message.orderbook) : undefined; + return obj; + }, + fromAminoMsg(object: OrderbookUpdateAminoMsg): OrderbookUpdate { + return OrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookUpdateProtoMsg): OrderbookUpdate { + return OrderbookUpdate.decode(message.value); + }, + toProto(message: OrderbookUpdate): Uint8Array { + return OrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: OrderbookUpdate): OrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate", + value: OrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookUpdate.typeUrl, OrderbookUpdate); +function createBaseOrderbook(): Orderbook { + return { + marketId: "", + buyLevels: [], + sellLevels: [] + }; +} +export const Orderbook = { + typeUrl: "/injective.stream.v1beta1.Orderbook", + is(o: any): o is Orderbook { + return o && (o.$typeUrl === Orderbook.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyLevels) && (!o.buyLevels.length || Level.is(o.buyLevels[0])) && Array.isArray(o.sellLevels) && (!o.sellLevels.length || Level.is(o.sellLevels[0]))); + }, + isAmino(o: any): o is OrderbookAmino { + return o && (o.$typeUrl === Orderbook.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_levels) && (!o.buy_levels.length || Level.isAmino(o.buy_levels[0])) && Array.isArray(o.sell_levels) && (!o.sell_levels.length || Level.isAmino(o.sell_levels[0]))); + }, + encode(message: Orderbook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyLevels) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellLevels) { + Level.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Orderbook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyLevels.push(Level.decode(reader, reader.uint32())); + break; + case 3: + message.sellLevels.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Orderbook { + const message = createBaseOrderbook(); + message.marketId = object.marketId ?? ""; + message.buyLevels = object.buyLevels?.map(e => Level.fromPartial(e)) || []; + message.sellLevels = object.sellLevels?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OrderbookAmino): Orderbook { + const message = createBaseOrderbook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyLevels = object.buy_levels?.map(e => Level.fromAmino(e)) || []; + message.sellLevels = object.sell_levels?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: Orderbook): OrderbookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyLevels) { + obj.buy_levels = message.buyLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buy_levels = message.buyLevels; + } + if (message.sellLevels) { + obj.sell_levels = message.sellLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sell_levels = message.sellLevels; + } + return obj; + }, + fromAminoMsg(object: OrderbookAminoMsg): Orderbook { + return Orderbook.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookProtoMsg): Orderbook { + return Orderbook.decode(message.value); + }, + toProto(message: Orderbook): Uint8Array { + return Orderbook.encode(message).finish(); + }, + toProtoMsg(message: Orderbook): OrderbookProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.Orderbook", + value: Orderbook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Orderbook.typeUrl, Orderbook); +function createBaseBankBalance(): BankBalance { + return { + account: "", + balances: [] + }; +} +export const BankBalance = { + typeUrl: "/injective.stream.v1beta1.BankBalance", + is(o: any): o is BankBalance { + return o && (o.$typeUrl === BankBalance.typeUrl || typeof o.account === "string" && Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is BankBalanceAmino { + return o && (o.$typeUrl === BankBalance.typeUrl || typeof o.account === "string" && Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: BankBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BankBalance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBankBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BankBalance { + const message = createBaseBankBalance(); + message.account = object.account ?? ""; + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BankBalanceAmino): BankBalance { + const message = createBaseBankBalance(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: BankBalance): BankBalanceAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + return obj; + }, + fromAminoMsg(object: BankBalanceAminoMsg): BankBalance { + return BankBalance.fromAmino(object.value); + }, + fromProtoMsg(message: BankBalanceProtoMsg): BankBalance { + return BankBalance.decode(message.value); + }, + toProto(message: BankBalance): Uint8Array { + return BankBalance.encode(message).finish(); + }, + toProtoMsg(message: BankBalance): BankBalanceProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.BankBalance", + value: BankBalance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BankBalance.typeUrl, BankBalance); +function createBaseSubaccountDeposits(): SubaccountDeposits { + return { + subaccountId: "", + deposits: [] + }; +} +export const SubaccountDeposits = { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits", + is(o: any): o is SubaccountDeposits { + return o && (o.$typeUrl === SubaccountDeposits.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is SubaccountDepositsAmino { + return o && (o.$typeUrl === SubaccountDeposits.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.isAmino(o.deposits[0]))); + }, + encode(message: SubaccountDeposits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.deposits) { + SubaccountDeposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.deposits.push(SubaccountDeposit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposits { + const message = createBaseSubaccountDeposits(); + message.subaccountId = object.subaccountId ?? ""; + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SubaccountDepositsAmino): SubaccountDeposits { + const message = createBaseSubaccountDeposits(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: SubaccountDeposits): SubaccountDepositsAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? SubaccountDeposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + return obj; + }, + fromAminoMsg(object: SubaccountDepositsAminoMsg): SubaccountDeposits { + return SubaccountDeposits.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositsProtoMsg): SubaccountDeposits { + return SubaccountDeposits.decode(message.value); + }, + toProto(message: SubaccountDeposits): Uint8Array { + return SubaccountDeposits.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposits): SubaccountDepositsProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits", + value: SubaccountDeposits.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposits.typeUrl, SubaccountDeposits); +function createBaseSubaccountDeposit(): SubaccountDeposit { + return { + denom: "", + deposit: Deposit.fromPartial({}) + }; +} +export const SubaccountDeposit = { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit", + is(o: any): o is SubaccountDeposit { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || typeof o.denom === "string" && Deposit.is(o.deposit)); + }, + isAmino(o: any): o is SubaccountDepositAmino { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || typeof o.denom === "string" && Deposit.isAmino(o.deposit)); + }, + encode(message: SubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + message.denom = object.denom ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: SubaccountDepositAmino): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: SubaccountDeposit): SubaccountDepositAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountDepositAminoMsg): SubaccountDeposit { + return SubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositProtoMsg): SubaccountDeposit { + return SubaccountDeposit.decode(message.value); + }, + toProto(message: SubaccountDeposit): Uint8Array { + return SubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposit): SubaccountDepositProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit", + value: SubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposit.typeUrl, SubaccountDeposit); +function createBaseSpotOrderUpdate(): SpotOrderUpdate { + return { + status: 0, + orderHash: new Uint8Array(), + cid: "", + order: undefined + }; +} +export const SpotOrderUpdate = { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate", + is(o: any): o is SpotOrderUpdate { + return o && (o.$typeUrl === SpotOrderUpdate.typeUrl || isSet(o.status) && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is SpotOrderUpdateAmino { + return o && (o.$typeUrl === SpotOrderUpdate.typeUrl || isSet(o.status) && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: SpotOrderUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrderUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrderUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + case 2: + message.orderHash = reader.bytes(); + break; + case 3: + message.cid = reader.string(); + break; + case 4: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrderUpdate { + const message = createBaseSpotOrderUpdate(); + message.status = object.status ?? 0; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.cid = object.cid ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: SpotOrderUpdateAmino): SpotOrderUpdate { + const message = createBaseSpotOrderUpdate(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: SpotOrderUpdate): SpotOrderUpdateAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: SpotOrderUpdateAminoMsg): SpotOrderUpdate { + return SpotOrderUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderUpdateProtoMsg): SpotOrderUpdate { + return SpotOrderUpdate.decode(message.value); + }, + toProto(message: SpotOrderUpdate): Uint8Array { + return SpotOrderUpdate.encode(message).finish(); + }, + toProtoMsg(message: SpotOrderUpdate): SpotOrderUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate", + value: SpotOrderUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrderUpdate.typeUrl, SpotOrderUpdate); +function createBaseSpotOrder(): SpotOrder { + return { + marketId: "", + order: SpotLimitOrder.fromPartial({}) + }; +} +export const SpotOrder = { + typeUrl: "/injective.stream.v1beta1.SpotOrder", + is(o: any): o is SpotOrder { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.marketId === "string" && SpotLimitOrder.is(o.order)); + }, + isAmino(o: any): o is SpotOrderAmino { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.market_id === "string" && SpotLimitOrder.isAmino(o.order)); + }, + encode(message: SpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + SpotLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = SpotLimitOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrder { + const message = createBaseSpotOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotLimitOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: SpotOrderAmino): SpotOrder { + const message = createBaseSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotLimitOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: SpotOrder): SpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? SpotLimitOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: SpotOrderAminoMsg): SpotOrder { + return SpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderProtoMsg): SpotOrder { + return SpotOrder.decode(message.value); + }, + toProto(message: SpotOrder): Uint8Array { + return SpotOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotOrder): SpotOrderProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotOrder", + value: SpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrder.typeUrl, SpotOrder); +function createBaseDerivativeOrderUpdate(): DerivativeOrderUpdate { + return { + status: 0, + orderHash: new Uint8Array(), + cid: "", + order: undefined + }; +} +export const DerivativeOrderUpdate = { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate", + is(o: any): o is DerivativeOrderUpdate { + return o && (o.$typeUrl === DerivativeOrderUpdate.typeUrl || isSet(o.status) && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is DerivativeOrderUpdateAmino { + return o && (o.$typeUrl === DerivativeOrderUpdate.typeUrl || isSet(o.status) && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: DerivativeOrderUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrderUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrderUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + case 2: + message.orderHash = reader.bytes(); + break; + case 3: + message.cid = reader.string(); + break; + case 4: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrderUpdate { + const message = createBaseDerivativeOrderUpdate(); + message.status = object.status ?? 0; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.cid = object.cid ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: DerivativeOrderUpdateAmino): DerivativeOrderUpdate { + const message = createBaseDerivativeOrderUpdate(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: DerivativeOrderUpdate): DerivativeOrderUpdateAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeOrderUpdateAminoMsg): DerivativeOrderUpdate { + return DerivativeOrderUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderUpdateProtoMsg): DerivativeOrderUpdate { + return DerivativeOrderUpdate.decode(message.value); + }, + toProto(message: DerivativeOrderUpdate): Uint8Array { + return DerivativeOrderUpdate.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrderUpdate): DerivativeOrderUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate", + value: DerivativeOrderUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrderUpdate.typeUrl, DerivativeOrderUpdate); +function createBaseDerivativeOrder(): DerivativeOrder { + return { + marketId: "", + order: DerivativeLimitOrder.fromPartial({}), + isMarket: false + }; +} +export const DerivativeOrder = { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder", + is(o: any): o is DerivativeOrder { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.marketId === "string" && DerivativeLimitOrder.is(o.order) && typeof o.isMarket === "boolean"); + }, + isAmino(o: any): o is DerivativeOrderAmino { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.market_id === "string" && DerivativeLimitOrder.isAmino(o.order) && typeof o.is_market === "boolean"); + }, + encode(message: DerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.isMarket === true) { + writer.uint32(24).bool(message.isMarket); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 3: + message.isMarket = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrder { + const message = createBaseDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeLimitOrder.fromPartial(object.order) : undefined; + message.isMarket = object.isMarket ?? false; + return message; + }, + fromAmino(object: DerivativeOrderAmino): DerivativeOrder { + const message = createBaseDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeLimitOrder.fromAmino(object.order); + } + if (object.is_market !== undefined && object.is_market !== null) { + message.isMarket = object.is_market; + } + return message; + }, + toAmino(message: DerivativeOrder): DerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeLimitOrder.toAmino(message.order) : undefined; + obj.is_market = message.isMarket === false ? undefined : message.isMarket; + return obj; + }, + fromAminoMsg(object: DerivativeOrderAminoMsg): DerivativeOrder { + return DerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderProtoMsg): DerivativeOrder { + return DerivativeOrder.decode(message.value); + }, + toProto(message: DerivativeOrder): Uint8Array { + return DerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrder): DerivativeOrderProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder", + value: DerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrder.typeUrl, DerivativeOrder); +function createBasePosition(): Position { + return { + marketId: "", + subaccountId: "", + isLong: false, + quantity: "", + entryPrice: "", + margin: "", + cumulativeFundingEntry: "" + }; +} +export const Position = { + typeUrl: "/injective.stream.v1beta1.Position", + is(o: any): o is Position { + return o && (o.$typeUrl === Position.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.margin === "string" && typeof o.cumulativeFundingEntry === "string"); + }, + isAmino(o: any): o is PositionAmino { + return o && (o.$typeUrl === Position.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.margin === "string" && typeof o.cumulative_funding_entry === "string"); + }, + encode(message: Position, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.isLong === true) { + writer.uint32(24).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(42).string(message.entryPrice); + } + if (message.margin !== "") { + writer.uint32(50).string(message.margin); + } + if (message.cumulativeFundingEntry !== "") { + writer.uint32(58).string(message.cumulativeFundingEntry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Position { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.isLong = reader.bool(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.entryPrice = reader.string(); + break; + case 6: + message.margin = reader.string(); + break; + case 7: + message.cumulativeFundingEntry = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Position { + const message = createBasePosition(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.margin = object.margin ?? ""; + message.cumulativeFundingEntry = object.cumulativeFundingEntry ?? ""; + return message; + }, + fromAmino(object: PositionAmino): Position { + const message = createBasePosition(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.isLong !== undefined && object.isLong !== null) { + message.isLong = object.isLong; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.cumulative_funding_entry !== undefined && object.cumulative_funding_entry !== null) { + message.cumulativeFundingEntry = object.cumulative_funding_entry; + } + return message; + }, + toAmino(message: Position): PositionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.isLong = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.cumulative_funding_entry = message.cumulativeFundingEntry === "" ? undefined : message.cumulativeFundingEntry; + return obj; + }, + fromAminoMsg(object: PositionAminoMsg): Position { + return Position.fromAmino(object.value); + }, + fromProtoMsg(message: PositionProtoMsg): Position { + return Position.decode(message.value); + }, + toProto(message: Position): Uint8Array { + return Position.encode(message).finish(); + }, + toProtoMsg(message: Position): PositionProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.Position", + value: Position.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Position.typeUrl, Position); +function createBaseOraclePrice(): OraclePrice { + return { + symbol: "", + price: "", + type: "" + }; +} +export const OraclePrice = { + typeUrl: "/injective.stream.v1beta1.OraclePrice", + is(o: any): o is OraclePrice { + return o && (o.$typeUrl === OraclePrice.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.type === "string"); + }, + isAmino(o: any): o is OraclePriceAmino { + return o && (o.$typeUrl === OraclePrice.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.type === "string"); + }, + encode(message: OraclePrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OraclePrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOraclePrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OraclePrice { + const message = createBaseOraclePrice(); + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: OraclePriceAmino): OraclePrice { + const message = createBaseOraclePrice(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: OraclePrice): OraclePriceAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: OraclePriceAminoMsg): OraclePrice { + return OraclePrice.fromAmino(object.value); + }, + fromProtoMsg(message: OraclePriceProtoMsg): OraclePrice { + return OraclePrice.decode(message.value); + }, + toProto(message: OraclePrice): Uint8Array { + return OraclePrice.encode(message).finish(); + }, + toProtoMsg(message: OraclePrice): OraclePriceProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OraclePrice", + value: OraclePrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OraclePrice.typeUrl, OraclePrice); +function createBaseSpotTrade(): SpotTrade { + return { + marketId: "", + isBuy: false, + executionType: "", + quantity: "", + price: "", + subaccountId: "", + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "", + tradeId: "" + }; +} +export const SpotTrade = { + typeUrl: "/injective.stream.v1beta1.SpotTrade", + is(o: any): o is SpotTrade { + return o && (o.$typeUrl === SpotTrade.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.executionType === "string" && typeof o.quantity === "string" && typeof o.price === "string" && typeof o.subaccountId === "string" && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string" && typeof o.tradeId === "string"); + }, + isAmino(o: any): o is SpotTradeAmino { + return o && (o.$typeUrl === SpotTrade.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.executionType === "string" && typeof o.quantity === "string" && typeof o.price === "string" && typeof o.subaccount_id === "string" && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string" && typeof o.trade_id === "string"); + }, + encode(message: SpotTrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== "") { + writer.uint32(26).string(message.executionType); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(42).string(message.price); + } + if (message.subaccountId !== "") { + writer.uint32(50).string(message.subaccountId); + } + if (message.fee !== "") { + writer.uint32(58).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(66).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(74).string(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(82).string(message.cid); + } + if (message.tradeId !== "") { + writer.uint32(90).string(message.tradeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotTrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotTrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = reader.string(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.price = reader.string(); + break; + case 6: + message.subaccountId = reader.string(); + break; + case 7: + message.fee = reader.string(); + break; + case 8: + message.orderHash = reader.bytes(); + break; + case 9: + message.feeRecipientAddress = reader.string(); + break; + case 10: + message.cid = reader.string(); + break; + case 11: + message.tradeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotTrade { + const message = createBaseSpotTrade(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? ""; + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.tradeId = object.tradeId ?? ""; + return message; + }, + fromAmino(object: SpotTradeAmino): SpotTrade { + const message = createBaseSpotTrade(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = object.fee_recipient_address; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.trade_id !== undefined && object.trade_id !== null) { + message.tradeId = object.trade_id; + } + return message; + }, + toAmino(message: SpotTrade): SpotTradeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === "" ? undefined : message.executionType; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress === null ? undefined : message.feeRecipientAddress; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.trade_id = message.tradeId === "" ? undefined : message.tradeId; + return obj; + }, + fromAminoMsg(object: SpotTradeAminoMsg): SpotTrade { + return SpotTrade.fromAmino(object.value); + }, + fromProtoMsg(message: SpotTradeProtoMsg): SpotTrade { + return SpotTrade.decode(message.value); + }, + toProto(message: SpotTrade): Uint8Array { + return SpotTrade.encode(message).finish(); + }, + toProtoMsg(message: SpotTrade): SpotTradeProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotTrade", + value: SpotTrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotTrade.typeUrl, SpotTrade); +function createBaseDerivativeTrade(): DerivativeTrade { + return { + marketId: "", + isBuy: false, + executionType: "", + subaccountId: "", + positionDelta: undefined, + payout: "", + fee: "", + orderHash: "", + feeRecipientAddress: undefined, + cid: "", + tradeId: "" + }; +} +export const DerivativeTrade = { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade", + is(o: any): o is DerivativeTrade { + return o && (o.$typeUrl === DerivativeTrade.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.executionType === "string" && typeof o.subaccountId === "string" && typeof o.payout === "string" && typeof o.fee === "string" && typeof o.orderHash === "string" && typeof o.cid === "string" && typeof o.tradeId === "string"); + }, + isAmino(o: any): o is DerivativeTradeAmino { + return o && (o.$typeUrl === DerivativeTrade.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.executionType === "string" && typeof o.subaccount_id === "string" && typeof o.payout === "string" && typeof o.fee === "string" && typeof o.order_hash === "string" && typeof o.cid === "string" && typeof o.trade_id === "string"); + }, + encode(message: DerivativeTrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== "") { + writer.uint32(26).string(message.executionType); + } + if (message.subaccountId !== "") { + writer.uint32(34).string(message.subaccountId); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(42).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(50).string(message.payout); + } + if (message.fee !== "") { + writer.uint32(58).string(message.fee); + } + if (message.orderHash !== "") { + writer.uint32(66).string(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(74).string(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(82).string(message.cid); + } + if (message.tradeId !== "") { + writer.uint32(90).string(message.tradeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeTrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeTrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = reader.string(); + break; + case 4: + message.subaccountId = reader.string(); + break; + case 5: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 6: + message.payout = reader.string(); + break; + case 7: + message.fee = reader.string(); + break; + case 8: + message.orderHash = reader.string(); + break; + case 9: + message.feeRecipientAddress = reader.string(); + break; + case 10: + message.cid = reader.string(); + break; + case 11: + message.tradeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeTrade { + const message = createBaseDerivativeTrade(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? ""; + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.tradeId = object.tradeId ?? ""; + return message; + }, + fromAmino(object: DerivativeTradeAmino): DerivativeTrade { + const message = createBaseDerivativeTrade(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = object.fee_recipient_address; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.trade_id !== undefined && object.trade_id !== null) { + message.tradeId = object.trade_id; + } + return message; + }, + toAmino(message: DerivativeTrade): DerivativeTradeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === "" ? undefined : message.executionType; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.fee_recipient_address = message.feeRecipientAddress === null ? undefined : message.feeRecipientAddress; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.trade_id = message.tradeId === "" ? undefined : message.tradeId; + return obj; + }, + fromAminoMsg(object: DerivativeTradeAminoMsg): DerivativeTrade { + return DerivativeTrade.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeTradeProtoMsg): DerivativeTrade { + return DerivativeTrade.decode(message.value); + }, + toProto(message: DerivativeTrade): Uint8Array { + return DerivativeTrade.encode(message).finish(); + }, + toProtoMsg(message: DerivativeTrade): DerivativeTradeProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade", + value: DerivativeTrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeTrade.typeUrl, DerivativeTrade); +function createBaseTradesFilter(): TradesFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const TradesFilter = { + typeUrl: "/injective.stream.v1beta1.TradesFilter", + is(o: any): o is TradesFilter { + return o && (o.$typeUrl === TradesFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is TradesFilterAmino { + return o && (o.$typeUrl === TradesFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: TradesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradesFilter { + const message = createBaseTradesFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: TradesFilterAmino): TradesFilter { + const message = createBaseTradesFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: TradesFilter): TradesFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: TradesFilterAminoMsg): TradesFilter { + return TradesFilter.fromAmino(object.value); + }, + fromProtoMsg(message: TradesFilterProtoMsg): TradesFilter { + return TradesFilter.decode(message.value); + }, + toProto(message: TradesFilter): Uint8Array { + return TradesFilter.encode(message).finish(); + }, + toProtoMsg(message: TradesFilter): TradesFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.TradesFilter", + value: TradesFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradesFilter.typeUrl, TradesFilter); +function createBasePositionsFilter(): PositionsFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const PositionsFilter = { + typeUrl: "/injective.stream.v1beta1.PositionsFilter", + is(o: any): o is PositionsFilter { + return o && (o.$typeUrl === PositionsFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is PositionsFilterAmino { + return o && (o.$typeUrl === PositionsFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: PositionsFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionsFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PositionsFilter { + const message = createBasePositionsFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: PositionsFilterAmino): PositionsFilter { + const message = createBasePositionsFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: PositionsFilter): PositionsFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: PositionsFilterAminoMsg): PositionsFilter { + return PositionsFilter.fromAmino(object.value); + }, + fromProtoMsg(message: PositionsFilterProtoMsg): PositionsFilter { + return PositionsFilter.decode(message.value); + }, + toProto(message: PositionsFilter): Uint8Array { + return PositionsFilter.encode(message).finish(); + }, + toProtoMsg(message: PositionsFilter): PositionsFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.PositionsFilter", + value: PositionsFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PositionsFilter.typeUrl, PositionsFilter); +function createBaseOrdersFilter(): OrdersFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const OrdersFilter = { + typeUrl: "/injective.stream.v1beta1.OrdersFilter", + is(o: any): o is OrdersFilter { + return o && (o.$typeUrl === OrdersFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is OrdersFilterAmino { + return o && (o.$typeUrl === OrdersFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: OrdersFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrdersFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrdersFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrdersFilter { + const message = createBaseOrdersFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: OrdersFilterAmino): OrdersFilter { + const message = createBaseOrdersFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: OrdersFilter): OrdersFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: OrdersFilterAminoMsg): OrdersFilter { + return OrdersFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OrdersFilterProtoMsg): OrdersFilter { + return OrdersFilter.decode(message.value); + }, + toProto(message: OrdersFilter): Uint8Array { + return OrdersFilter.encode(message).finish(); + }, + toProtoMsg(message: OrdersFilter): OrdersFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrdersFilter", + value: OrdersFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrdersFilter.typeUrl, OrdersFilter); +function createBaseOrderbookFilter(): OrderbookFilter { + return { + marketIds: [] + }; +} +export const OrderbookFilter = { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter", + is(o: any): o is OrderbookFilter { + return o && (o.$typeUrl === OrderbookFilter.typeUrl || Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is OrderbookFilterAmino { + return o && (o.$typeUrl === OrderbookFilter.typeUrl || Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: OrderbookFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookFilter { + const message = createBaseOrderbookFilter(); + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: OrderbookFilterAmino): OrderbookFilter { + const message = createBaseOrderbookFilter(); + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: OrderbookFilter): OrderbookFilterAmino { + const obj: any = {}; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: OrderbookFilterAminoMsg): OrderbookFilter { + return OrderbookFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookFilterProtoMsg): OrderbookFilter { + return OrderbookFilter.decode(message.value); + }, + toProto(message: OrderbookFilter): Uint8Array { + return OrderbookFilter.encode(message).finish(); + }, + toProtoMsg(message: OrderbookFilter): OrderbookFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter", + value: OrderbookFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookFilter.typeUrl, OrderbookFilter); +function createBaseBankBalancesFilter(): BankBalancesFilter { + return { + accounts: [] + }; +} +export const BankBalancesFilter = { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter", + is(o: any): o is BankBalancesFilter { + return o && (o.$typeUrl === BankBalancesFilter.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + isAmino(o: any): o is BankBalancesFilterAmino { + return o && (o.$typeUrl === BankBalancesFilter.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + encode(message: BankBalancesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BankBalancesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBankBalancesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BankBalancesFilter { + const message = createBaseBankBalancesFilter(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + fromAmino(object: BankBalancesFilterAmino): BankBalancesFilter { + const message = createBaseBankBalancesFilter(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + toAmino(message: BankBalancesFilter): BankBalancesFilterAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: BankBalancesFilterAminoMsg): BankBalancesFilter { + return BankBalancesFilter.fromAmino(object.value); + }, + fromProtoMsg(message: BankBalancesFilterProtoMsg): BankBalancesFilter { + return BankBalancesFilter.decode(message.value); + }, + toProto(message: BankBalancesFilter): Uint8Array { + return BankBalancesFilter.encode(message).finish(); + }, + toProtoMsg(message: BankBalancesFilter): BankBalancesFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter", + value: BankBalancesFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BankBalancesFilter.typeUrl, BankBalancesFilter); +function createBaseSubaccountDepositsFilter(): SubaccountDepositsFilter { + return { + subaccountIds: [] + }; +} +export const SubaccountDepositsFilter = { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter", + is(o: any): o is SubaccountDepositsFilter { + return o && (o.$typeUrl === SubaccountDepositsFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string")); + }, + isAmino(o: any): o is SubaccountDepositsFilterAmino { + return o && (o.$typeUrl === SubaccountDepositsFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string")); + }, + encode(message: SubaccountDepositsFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDepositsFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDepositsFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDepositsFilter { + const message = createBaseSubaccountDepositsFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + return message; + }, + fromAmino(object: SubaccountDepositsFilterAmino): SubaccountDepositsFilter { + const message = createBaseSubaccountDepositsFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + return message; + }, + toAmino(message: SubaccountDepositsFilter): SubaccountDepositsFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + return obj; + }, + fromAminoMsg(object: SubaccountDepositsFilterAminoMsg): SubaccountDepositsFilter { + return SubaccountDepositsFilter.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositsFilterProtoMsg): SubaccountDepositsFilter { + return SubaccountDepositsFilter.decode(message.value); + }, + toProto(message: SubaccountDepositsFilter): Uint8Array { + return SubaccountDepositsFilter.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDepositsFilter): SubaccountDepositsFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter", + value: SubaccountDepositsFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDepositsFilter.typeUrl, SubaccountDepositsFilter); +function createBaseOraclePriceFilter(): OraclePriceFilter { + return { + symbol: [] + }; +} +export const OraclePriceFilter = { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter", + is(o: any): o is OraclePriceFilter { + return o && (o.$typeUrl === OraclePriceFilter.typeUrl || Array.isArray(o.symbol) && (!o.symbol.length || typeof o.symbol[0] === "string")); + }, + isAmino(o: any): o is OraclePriceFilterAmino { + return o && (o.$typeUrl === OraclePriceFilter.typeUrl || Array.isArray(o.symbol) && (!o.symbol.length || typeof o.symbol[0] === "string")); + }, + encode(message: OraclePriceFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.symbol) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OraclePriceFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOraclePriceFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OraclePriceFilter { + const message = createBaseOraclePriceFilter(); + message.symbol = object.symbol?.map(e => e) || []; + return message; + }, + fromAmino(object: OraclePriceFilterAmino): OraclePriceFilter { + const message = createBaseOraclePriceFilter(); + message.symbol = object.symbol?.map(e => e) || []; + return message; + }, + toAmino(message: OraclePriceFilter): OraclePriceFilterAmino { + const obj: any = {}; + if (message.symbol) { + obj.symbol = message.symbol.map(e => e); + } else { + obj.symbol = message.symbol; + } + return obj; + }, + fromAminoMsg(object: OraclePriceFilterAminoMsg): OraclePriceFilter { + return OraclePriceFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OraclePriceFilterProtoMsg): OraclePriceFilter { + return OraclePriceFilter.decode(message.value); + }, + toProto(message: OraclePriceFilter): Uint8Array { + return OraclePriceFilter.encode(message).finish(); + }, + toProtoMsg(message: OraclePriceFilter): OraclePriceFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter", + value: OraclePriceFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OraclePriceFilter.typeUrl, OraclePriceFilter); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/authorityMetadata.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/authorityMetadata.ts new file mode 100644 index 00000000..4497aa5e --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/authorityMetadata.ts @@ -0,0 +1,99 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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 injective address */ + admin: string; +} +export interface DenomAuthorityMetadataProtoMsg { + typeUrl: "/injective.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 injective address */ + admin: string; +} +export interface DenomAuthorityMetadataAminoMsg { + type: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata"; + value: DenomAuthorityMetadataAmino; +} +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + admin: "" + }; +} +export const DenomAuthorityMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata", + is(o: any): o is DenomAuthorityMetadata { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + isAmino(o: any): o is DenomAuthorityMetadataAmino { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: DenomAuthorityMetadataProtoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.decode(message.value); + }, + toProto(message: DenomAuthorityMetadata): Uint8Array { + return DenomAuthorityMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata", + value: DenomAuthorityMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomAuthorityMetadata.typeUrl, DenomAuthorityMetadata); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/events.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/events.ts new file mode 100644 index 00000000..38852b9d --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/events.ts @@ -0,0 +1,495 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Metadata, MetadataAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventCreateTFDenom { + account: string; + denom: string; +} +export interface EventCreateTFDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom"; + value: Uint8Array; +} +export interface EventCreateTFDenomAmino { + account: string; + denom: string; +} +export interface EventCreateTFDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventCreateTFDenom"; + value: EventCreateTFDenomAmino; +} +export interface EventMintTFDenom { + recipientAddress: string; + amount: Coin; +} +export interface EventMintTFDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom"; + value: Uint8Array; +} +export interface EventMintTFDenomAmino { + recipient_address: string; + amount: CoinAmino; +} +export interface EventMintTFDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventMintTFDenom"; + value: EventMintTFDenomAmino; +} +export interface EventBurnDenom { + burnerAddress: string; + amount: Coin; +} +export interface EventBurnDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom"; + value: Uint8Array; +} +export interface EventBurnDenomAmino { + burner_address: string; + amount: CoinAmino; +} +export interface EventBurnDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventBurnDenom"; + value: EventBurnDenomAmino; +} +export interface EventChangeTFAdmin { + denom: string; + newAdminAddress: string; +} +export interface EventChangeTFAdminProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin"; + value: Uint8Array; +} +export interface EventChangeTFAdminAmino { + denom: string; + new_admin_address: string; +} +export interface EventChangeTFAdminAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin"; + value: EventChangeTFAdminAmino; +} +export interface EventSetTFDenomMetadata { + denom: string; + metadata: Metadata; +} +export interface EventSetTFDenomMetadataProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata"; + value: Uint8Array; +} +export interface EventSetTFDenomMetadataAmino { + denom: string; + metadata: MetadataAmino; +} +export interface EventSetTFDenomMetadataAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata"; + value: EventSetTFDenomMetadataAmino; +} +function createBaseEventCreateTFDenom(): EventCreateTFDenom { + return { + account: "", + denom: "" + }; +} +export const EventCreateTFDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom", + is(o: any): o is EventCreateTFDenom { + return o && (o.$typeUrl === EventCreateTFDenom.typeUrl || typeof o.account === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is EventCreateTFDenomAmino { + return o && (o.$typeUrl === EventCreateTFDenom.typeUrl || typeof o.account === "string" && typeof o.denom === "string"); + }, + encode(message: EventCreateTFDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateTFDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateTFDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCreateTFDenom { + const message = createBaseEventCreateTFDenom(); + message.account = object.account ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: EventCreateTFDenomAmino): EventCreateTFDenom { + const message = createBaseEventCreateTFDenom(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: EventCreateTFDenom): EventCreateTFDenomAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: EventCreateTFDenomAminoMsg): EventCreateTFDenom { + return EventCreateTFDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventCreateTFDenomProtoMsg): EventCreateTFDenom { + return EventCreateTFDenom.decode(message.value); + }, + toProto(message: EventCreateTFDenom): Uint8Array { + return EventCreateTFDenom.encode(message).finish(); + }, + toProtoMsg(message: EventCreateTFDenom): EventCreateTFDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom", + value: EventCreateTFDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCreateTFDenom.typeUrl, EventCreateTFDenom); +function createBaseEventMintTFDenom(): EventMintTFDenom { + return { + recipientAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventMintTFDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom", + is(o: any): o is EventMintTFDenom { + return o && (o.$typeUrl === EventMintTFDenom.typeUrl || typeof o.recipientAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventMintTFDenomAmino { + return o && (o.$typeUrl === EventMintTFDenom.typeUrl || typeof o.recipient_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventMintTFDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.recipientAddress !== "") { + writer.uint32(10).string(message.recipientAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventMintTFDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMintTFDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipientAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventMintTFDenom { + const message = createBaseEventMintTFDenom(); + message.recipientAddress = object.recipientAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventMintTFDenomAmino): EventMintTFDenom { + const message = createBaseEventMintTFDenom(); + if (object.recipient_address !== undefined && object.recipient_address !== null) { + message.recipientAddress = object.recipient_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventMintTFDenom): EventMintTFDenomAmino { + const obj: any = {}; + obj.recipient_address = message.recipientAddress === "" ? undefined : message.recipientAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventMintTFDenomAminoMsg): EventMintTFDenom { + return EventMintTFDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventMintTFDenomProtoMsg): EventMintTFDenom { + return EventMintTFDenom.decode(message.value); + }, + toProto(message: EventMintTFDenom): Uint8Array { + return EventMintTFDenom.encode(message).finish(); + }, + toProtoMsg(message: EventMintTFDenom): EventMintTFDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom", + value: EventMintTFDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventMintTFDenom.typeUrl, EventMintTFDenom); +function createBaseEventBurnDenom(): EventBurnDenom { + return { + burnerAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventBurnDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom", + is(o: any): o is EventBurnDenom { + return o && (o.$typeUrl === EventBurnDenom.typeUrl || typeof o.burnerAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventBurnDenomAmino { + return o && (o.$typeUrl === EventBurnDenom.typeUrl || typeof o.burner_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventBurnDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.burnerAddress !== "") { + writer.uint32(10).string(message.burnerAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBurnDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBurnDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burnerAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBurnDenom { + const message = createBaseEventBurnDenom(); + message.burnerAddress = object.burnerAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventBurnDenomAmino): EventBurnDenom { + const message = createBaseEventBurnDenom(); + if (object.burner_address !== undefined && object.burner_address !== null) { + message.burnerAddress = object.burner_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventBurnDenom): EventBurnDenomAmino { + const obj: any = {}; + obj.burner_address = message.burnerAddress === "" ? undefined : message.burnerAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventBurnDenomAminoMsg): EventBurnDenom { + return EventBurnDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventBurnDenomProtoMsg): EventBurnDenom { + return EventBurnDenom.decode(message.value); + }, + toProto(message: EventBurnDenom): Uint8Array { + return EventBurnDenom.encode(message).finish(); + }, + toProtoMsg(message: EventBurnDenom): EventBurnDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom", + value: EventBurnDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBurnDenom.typeUrl, EventBurnDenom); +function createBaseEventChangeTFAdmin(): EventChangeTFAdmin { + return { + denom: "", + newAdminAddress: "" + }; +} +export const EventChangeTFAdmin = { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin", + is(o: any): o is EventChangeTFAdmin { + return o && (o.$typeUrl === EventChangeTFAdmin.typeUrl || typeof o.denom === "string" && typeof o.newAdminAddress === "string"); + }, + isAmino(o: any): o is EventChangeTFAdminAmino { + return o && (o.$typeUrl === EventChangeTFAdmin.typeUrl || typeof o.denom === "string" && typeof o.new_admin_address === "string"); + }, + encode(message: EventChangeTFAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.newAdminAddress !== "") { + writer.uint32(18).string(message.newAdminAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventChangeTFAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventChangeTFAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.newAdminAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventChangeTFAdmin { + const message = createBaseEventChangeTFAdmin(); + message.denom = object.denom ?? ""; + message.newAdminAddress = object.newAdminAddress ?? ""; + return message; + }, + fromAmino(object: EventChangeTFAdminAmino): EventChangeTFAdmin { + const message = createBaseEventChangeTFAdmin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin_address !== undefined && object.new_admin_address !== null) { + message.newAdminAddress = object.new_admin_address; + } + return message; + }, + toAmino(message: EventChangeTFAdmin): EventChangeTFAdminAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.new_admin_address = message.newAdminAddress === "" ? undefined : message.newAdminAddress; + return obj; + }, + fromAminoMsg(object: EventChangeTFAdminAminoMsg): EventChangeTFAdmin { + return EventChangeTFAdmin.fromAmino(object.value); + }, + fromProtoMsg(message: EventChangeTFAdminProtoMsg): EventChangeTFAdmin { + return EventChangeTFAdmin.decode(message.value); + }, + toProto(message: EventChangeTFAdmin): Uint8Array { + return EventChangeTFAdmin.encode(message).finish(); + }, + toProtoMsg(message: EventChangeTFAdmin): EventChangeTFAdminProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin", + value: EventChangeTFAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventChangeTFAdmin.typeUrl, EventChangeTFAdmin); +function createBaseEventSetTFDenomMetadata(): EventSetTFDenomMetadata { + return { + denom: "", + metadata: Metadata.fromPartial({}) + }; +} +export const EventSetTFDenomMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata", + is(o: any): o is EventSetTFDenomMetadata { + return o && (o.$typeUrl === EventSetTFDenomMetadata.typeUrl || typeof o.denom === "string" && Metadata.is(o.metadata)); + }, + isAmino(o: any): o is EventSetTFDenomMetadataAmino { + return o && (o.$typeUrl === EventSetTFDenomMetadata.typeUrl || typeof o.denom === "string" && Metadata.isAmino(o.metadata)); + }, + encode(message: EventSetTFDenomMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetTFDenomMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetTFDenomMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetTFDenomMetadata { + const message = createBaseEventSetTFDenomMetadata(); + message.denom = object.denom ?? ""; + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: EventSetTFDenomMetadataAmino): EventSetTFDenomMetadata { + const message = createBaseEventSetTFDenomMetadata(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: EventSetTFDenomMetadata): EventSetTFDenomMetadataAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: EventSetTFDenomMetadataAminoMsg): EventSetTFDenomMetadata { + return EventSetTFDenomMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetTFDenomMetadataProtoMsg): EventSetTFDenomMetadata { + return EventSetTFDenomMetadata.decode(message.value); + }, + toProto(message: EventSetTFDenomMetadata): Uint8Array { + return EventSetTFDenomMetadata.encode(message).finish(); + }, + toProtoMsg(message: EventSetTFDenomMetadata): EventSetTFDenomMetadataProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata", + value: EventSetTFDenomMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetTFDenomMetadata.typeUrl, EventSetTFDenomMetadata); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/genesis.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/genesis.ts new file mode 100644 index 00000000..13aeef22 --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/genesis.ts @@ -0,0 +1,259 @@ +import { Params, ParamsAmino } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisState { + /** params defines the parameters of the module. */ + params: Params; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the parameters of the module. */ + params: ParamsAmino; + factory_denoms: GenesisDenomAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.tokenfactory.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** + * 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; + name: string; + symbol: string; + decimals: number; +} +export interface GenesisDenomProtoMsg { + typeUrl: "/injective.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; + name: string; + symbol: string; + decimals: number; +} +export interface GenesisDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.GenesisDenom"; + value: GenesisDenomAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + factoryDenoms: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.factoryDenoms) && (!o.factoryDenoms.length || GenesisDenom.is(o.factoryDenoms[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.factory_denoms) && (!o.factory_denoms.length || GenesisDenom.isAmino(o.factory_denoms[0]))); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: "", + authorityMetadata: DenomAuthorityMetadata.fromPartial({}), + name: "", + symbol: "", + decimals: 0 + }; +} +export const GenesisDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisDenom", + is(o: any): o is GenesisDenom { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.is(o.authorityMetadata) && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + isAmino(o: any): o is GenesisDenomAmino { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.isAmino(o.authority_metadata) && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + 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(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(34).string(message.symbol); + } + if (message.decimals !== 0) { + writer.uint32(40).uint32(message.decimals); + } + 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; + case 3: + message.name = reader.string(); + break; + case 4: + message.symbol = reader.string(); + break; + case 5: + message.decimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals ?? 0; + 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); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = object.decimals; + } + 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; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals === 0 ? undefined : message.decimals; + return obj; + }, + fromAminoMsg(object: GenesisDenomAminoMsg): GenesisDenom { + return GenesisDenom.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisDenomProtoMsg): GenesisDenom { + return GenesisDenom.decode(message.value); + }, + toProto(message: GenesisDenom): Uint8Array { + return GenesisDenom.encode(message).finish(); + }, + toProtoMsg(message: GenesisDenom): GenesisDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisDenom", + value: GenesisDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisDenom.typeUrl, GenesisDenom); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/params.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/params.ts new file mode 100644 index 00000000..bb4a1ef3 --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/params.ts @@ -0,0 +1,100 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Params defines the parameters for the tokenfactory module. */ +export interface Params { + denomCreationFee: Coin[]; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsAmino { + denom_creation_fee: CoinAmino[]; +} +export interface ParamsAminoMsg { + type: "injective/tokenfactory/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + denomCreationFee: [] + }; +} +export const Params = { + typeUrl: "/injective.tokenfactory.v1beta1.Params", + aminoType: "injective/tokenfactory/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denomCreationFee) && (!o.denomCreationFee.length || Coin.is(o.denomCreationFee[0]))); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denom_creation_fee) && (!o.denom_creation_fee.length || Coin.isAmino(o.denom_creation_fee[0]))); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomCreationFee) { + Coin.encode(v!, 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.denomCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denom_creation_fee?.map(e => Coin.fromAmino(e)) || []; + 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; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "injective/tokenfactory/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: "/injective.tokenfactory.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/query.rpc.func.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..ee166ccb --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/query.rpc.func.ts @@ -0,0 +1,47 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "Params", + clientResolver +}); +export const useGetParams = buildUseQuery({ + builderQueryFn: createGetParams, + queryKeyPrefix: "ParamsQuery" +}); +export const createGetDenomAuthorityMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomAuthorityMetadataRequest.encode, + decode: QueryDenomAuthorityMetadataResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomAuthorityMetadata", + clientResolver +}); +export const useGetDenomAuthorityMetadata = buildUseQuery({ + builderQueryFn: createGetDenomAuthorityMetadata, + queryKeyPrefix: "DenomAuthorityMetadataQuery" +}); +export const createGetDenomsFromCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsFromCreatorRequest.encode, + decode: QueryDenomsFromCreatorResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomsFromCreator", + clientResolver +}); +export const useGetDenomsFromCreator = buildUseQuery({ + builderQueryFn: createGetDenomsFromCreator, + queryKeyPrefix: "DenomsFromCreatorQuery" +}); +export const createGetTokenfactoryModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "TokenfactoryModuleState", + clientResolver +}); +export const useGetTokenfactoryModuleState = buildUseQuery({ + builderQueryFn: createGetTokenfactoryModuleState, + queryKeyPrefix: "TokenfactoryModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/query.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/query.ts new file mode 100644 index 00000000..3a0d5408 --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/query.ts @@ -0,0 +1,714 @@ +import { Params, ParamsAmino } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino } from "./authorityMetadata"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/injective.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: "/injective.tokenfactory.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequest { + creator: string; + subDenom: string; +} +export interface QueryDenomAuthorityMetadataRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestAmino { + creator: string; + sub_denom: string; +} +export interface QueryDenomAuthorityMetadataRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; + value: QueryDenomAuthorityMetadataRequestAmino; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata; +} +export interface QueryDenomAuthorityMetadataResponseProtoMsg { + typeUrl: "/injective.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: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse"; + value: QueryDenomAuthorityMetadataResponseAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestAmino { + creator: string; +} +export interface QueryDenomsFromCreatorRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; + value: QueryDenomsFromCreatorRequestAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseAmino { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; + value: QueryDenomsFromCreatorResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + creator: "", + subDenom: "" + }; +} +export const QueryDenomAuthorityMetadataRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + is(o: any): o is QueryDenomAuthorityMetadataRequest { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.creator === "string" && typeof o.subDenom === "string"); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.creator === "string" && typeof o.sub_denom === "string"); + }, + encode(message: QueryDenomAuthorityMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.subDenom !== "") { + writer.uint32(18).string(message.subDenom); + } + 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.creator = reader.string(); + break; + case 2: + message.subDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.creator = object.creator ?? ""; + message.subDenom = object.subDenom ?? ""; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.sub_denom !== undefined && object.sub_denom !== null) { + message.subDenom = object.sub_denom; + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.sub_denom = message.subDenom === "" ? undefined : message.subDenom; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataRequestAminoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataRequestProtoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataRequest): Uint8Array { + return QueryDenomAuthorityMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + value: QueryDenomAuthorityMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataRequest.typeUrl, QueryDenomAuthorityMetadataRequest); +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const QueryDenomAuthorityMetadataResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + is(o: any): o is QueryDenomAuthorityMetadataResponse { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.is(o.authorityMetadata)); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.isAmino(o.authority_metadata)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataResponseProtoMsg): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataResponse): Uint8Array { + return QueryDenomAuthorityMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + value: QueryDenomAuthorityMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataResponse.typeUrl, QueryDenomAuthorityMetadataResponse); +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: "" + }; +} +export const QueryDenomsFromCreatorRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + is(o: any): o is QueryDenomsFromCreatorRequest { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + isAmino(o: any): o is QueryDenomsFromCreatorRequestAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomsFromCreatorRequestProtoMsg): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorRequest): Uint8Array { + return QueryDenomsFromCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + value: QueryDenomsFromCreatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorRequest.typeUrl, QueryDenomsFromCreatorRequest); +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [] + }; +} +export const QueryDenomsFromCreatorResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + is(o: any): o is QueryDenomsFromCreatorResponse { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QueryDenomsFromCreatorResponseAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomsFromCreatorResponseProtoMsg): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorResponse): Uint8Array { + return QueryDenomsFromCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + value: QueryDenomsFromCreatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorResponse.typeUrl, QueryDenomsFromCreatorResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..c2807829 --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts @@ -0,0 +1,58 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; +export const createCreateDenom = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDenom.typeUrl, + encoders: toEncoders(MsgCreateDenom), + converters: toConverters(MsgCreateDenom) +}); +export const useCreateDenom = buildUseMutation({ + builderMutationFn: createCreateDenom +}); +export const createMint = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMint.typeUrl, + encoders: toEncoders(MsgMint), + converters: toConverters(MsgMint) +}); +export const useMint = buildUseMutation({ + builderMutationFn: createMint +}); +export const createBurn = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBurn.typeUrl, + encoders: toEncoders(MsgBurn), + converters: toConverters(MsgBurn) +}); +export const useBurn = buildUseMutation({ + builderMutationFn: createBurn +}); +export const createChangeAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChangeAdmin.typeUrl, + encoders: toEncoders(MsgChangeAdmin), + converters: toConverters(MsgChangeAdmin) +}); +export const useChangeAdmin = buildUseMutation({ + builderMutationFn: createChangeAdmin +}); +export const createSetDenomMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetDenomMetadata.typeUrl, + encoders: toEncoders(MsgSetDenomMetadata), + converters: toConverters(MsgSetDenomMetadata) +}); +export const useSetDenomMetadata = buildUseMutation({ + builderMutationFn: createSetDenomMetadata +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.ts b/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.ts new file mode 100644 index 00000000..707eeec0 --- /dev/null +++ b/libs/injective-query/src/injective/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,1208 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Metadata, MetadataAmino, Params, ParamsAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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; + name: string; + symbol: string; + decimals: number; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: "/injective.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; + name: string; + symbol: string; + decimals: number; +} +export interface MsgCreateDenomAminoMsg { + type: "injective/tokenfactory/create-denom"; + value: MsgCreateDenomAmino; +} +/** + * 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: "/injective.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: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse"; + value: MsgCreateDenomResponseAmino; +} +/** + * 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; +} +export interface MsgMintProtoMsg { + typeUrl: "/injective.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; +} +export interface MsgMintAminoMsg { + type: "injective/tokenfactory/mint"; + value: MsgMintAmino; +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse"; + value: Uint8Array; +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgMintResponse"; + value: MsgMintResponseAmino; +} +/** + * 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; +} +export interface MsgBurnProtoMsg { + typeUrl: "/injective.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; +} +export interface MsgBurnAminoMsg { + type: "injective/tokenfactory/burn"; + value: MsgBurnAmino; +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse"; + value: Uint8Array; +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgBurnResponse"; + value: MsgBurnResponseAmino; +} +/** + * 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: "/injective.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: "injective/tokenfactory/change-admin"; + value: MsgChangeAdminAmino; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse"; + value: Uint8Array; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse"; + value: MsgChangeAdminResponseAmino; +} +/** + * 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: "/injective.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: "injective/tokenfactory/set-denom-metadata"; + value: MsgSetDenomMetadataAmino; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; + value: Uint8Array; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseAmino {} +export interface MsgSetDenomMetadataResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; + value: MsgSetDenomMetadataResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the tokenfactory parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the tokenfactory parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "injective/tokenfactory/update-params"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: "", + subdenom: "", + name: "", + symbol: "", + decimals: 0 + }; +} +export const MsgCreateDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenom", + aminoType: "injective/tokenfactory/create-denom", + is(o: any): o is MsgCreateDenom { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + isAmino(o: any): o is MsgCreateDenomAmino { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + 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); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(34).string(message.symbol); + } + if (message.decimals !== 0) { + writer.uint32(40).uint32(message.decimals); + } + 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; + case 3: + message.name = reader.string(); + break; + case 4: + message.symbol = reader.string(); + break; + case 5: + message.decimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.subdenom = object.subdenom ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals ?? 0; + 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; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = object.decimals; + } + return message; + }, + toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subdenom = message.subdenom === "" ? undefined : message.subdenom; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals === 0 ? undefined : message.decimals; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenom): MsgCreateDenomAminoMsg { + return { + type: "injective/tokenfactory/create-denom", + 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: "/injective.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDenom.typeUrl, MsgCreateDenom); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDenom.aminoType, MsgCreateDenom.typeUrl); +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: "" + }; +} +export const MsgCreateDenomResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse", + is(o: any): o is MsgCreateDenomResponse { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.newTokenDenom === "string"); + }, + isAmino(o: any): o is MsgCreateDenomResponseAmino { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.new_token_denom === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: MsgCreateDenomResponseProtoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse", + value: MsgCreateDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDenomResponse.typeUrl, MsgCreateDenomResponse); +function createBaseMsgMint(): MsgMint { + return { + sender: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgMint = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMint", + aminoType: "injective/tokenfactory/mint", + is(o: any): o is MsgMint { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgMintAmino { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + toAminoMsg(message: MsgMint): MsgMintAminoMsg { + return { + type: "injective/tokenfactory/mint", + 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: "/injective.tokenfactory.v1beta1.MsgMint", + value: MsgMint.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMint.typeUrl, MsgMint); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMint.aminoType, MsgMint.typeUrl); +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse", + is(o: any): o is MsgMintResponse { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isAmino(o: any): o is MsgMintResponseAmino { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgMintResponseProtoMsg): MsgMintResponse { + return MsgMintResponse.decode(message.value); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse", + value: MsgMintResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMintResponse.typeUrl, MsgMintResponse); +function createBaseMsgBurn(): MsgBurn { + return { + sender: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBurn = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurn", + aminoType: "injective/tokenfactory/burn", + is(o: any): o is MsgBurn { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgBurnAmino { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurn): MsgBurnAminoMsg { + return { + type: "injective/tokenfactory/burn", + 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: "/injective.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBurn.typeUrl, MsgBurn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBurn.aminoType, MsgBurn.typeUrl); +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse", + is(o: any): o is MsgBurnResponse { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isAmino(o: any): o is MsgBurnResponseAmino { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg): MsgBurnResponse { + return MsgBurnResponse.decode(message.value); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse", + value: MsgBurnResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBurnResponse.typeUrl, MsgBurnResponse); +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: "", + denom: "", + newAdmin: "" + }; +} +export const MsgChangeAdmin = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdmin", + aminoType: "injective/tokenfactory/change-admin", + is(o: any): o is MsgChangeAdmin { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgChangeAdminAmino { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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: "injective/tokenfactory/change-admin", + 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: "/injective.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChangeAdmin.typeUrl, MsgChangeAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChangeAdmin.aminoType, MsgChangeAdmin.typeUrl); +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} +export const MsgChangeAdminResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse", + is(o: any): o is MsgChangeAdminResponse { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgChangeAdminResponseAmino { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgChangeAdminResponseProtoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value); + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse", + value: MsgChangeAdminResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChangeAdminResponse.typeUrl, MsgChangeAdminResponse); +function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { + return { + sender: "", + metadata: Metadata.fromPartial({}) + }; +} +export const MsgSetDenomMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata", + aminoType: "injective/tokenfactory/set-denom-metadata", + is(o: any): o is MsgSetDenomMetadata { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.is(o.metadata)); + }, + isAmino(o: any): o is MsgSetDenomMetadataAmino { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.isAmino(o.metadata)); + }, + 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: DeepPartial): 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: "injective/tokenfactory/set-denom-metadata", + 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: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomMetadata.typeUrl, MsgSetDenomMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomMetadata.aminoType, MsgSetDenomMetadata.typeUrl); +function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { + return {}; +} +export const MsgSetDenomMetadataResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + is(o: any): o is MsgSetDenomMetadataResponse { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDenomMetadataResponseAmino { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgSetDenomMetadataResponseProtoMsg): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.decode(message.value); + }, + toProto(message: MsgSetDenomMetadataResponse): Uint8Array { + return MsgSetDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + value: MsgSetDenomMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomMetadataResponse.typeUrl, MsgSetDenomMetadataResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParams", + aminoType: "injective/tokenfactory/update-params", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "injective/tokenfactory/update-params", + 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: "/injective.tokenfactory.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/types/v1beta1/account.ts b/libs/injective-query/src/injective/types/v1beta1/account.ts new file mode 100644 index 00000000..08000833 --- /dev/null +++ b/libs/injective-query/src/injective/types/v1beta1/account.ts @@ -0,0 +1,110 @@ +import { BaseAccount, BaseAccountAmino } from "../../../cosmos/auth/v1beta1/auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * EthAccount implements the authtypes.AccountI interface and embeds an + * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. + */ +export interface EthAccount { + baseAccount?: BaseAccount; + codeHash: Uint8Array; +} +export interface EthAccountProtoMsg { + typeUrl: "/injective.types.v1beta1.EthAccount"; + value: Uint8Array; +} +/** + * EthAccount implements the authtypes.AccountI interface and embeds an + * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. + */ +export interface EthAccountAmino { + base_account?: BaseAccountAmino; + code_hash: string; +} +export interface EthAccountAminoMsg { + type: "/injective.types.v1beta1.EthAccount"; + value: EthAccountAmino; +} +function createBaseEthAccount(): EthAccount { + return { + baseAccount: undefined, + codeHash: new Uint8Array() + }; +} +export const EthAccount = { + typeUrl: "/injective.types.v1beta1.EthAccount", + is(o: any): o is EthAccount { + return o && (o.$typeUrl === EthAccount.typeUrl || o.codeHash instanceof Uint8Array || typeof o.codeHash === "string"); + }, + isAmino(o: any): o is EthAccountAmino { + return o && (o.$typeUrl === EthAccount.typeUrl || o.code_hash instanceof Uint8Array || typeof o.code_hash === "string"); + }, + encode(message: EthAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.codeHash.length !== 0) { + writer.uint32(18).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EthAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEthAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EthAccount { + const message = createBaseEthAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: EthAccountAmino): EthAccount { + const message = createBaseEthAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: EthAccount): EthAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: EthAccountAminoMsg): EthAccount { + return EthAccount.fromAmino(object.value); + }, + fromProtoMsg(message: EthAccountProtoMsg): EthAccount { + return EthAccount.decode(message.value); + }, + toProto(message: EthAccount): Uint8Array { + return EthAccount.encode(message).finish(); + }, + toProtoMsg(message: EthAccount): EthAccountProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.EthAccount", + value: EthAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EthAccount.typeUrl, EthAccount); \ No newline at end of file diff --git a/libs/injective-query/src/injective/types/v1beta1/tx_ext.ts b/libs/injective-query/src/injective/types/v1beta1/tx_ext.ts new file mode 100644 index 00000000..ac7f44f2 --- /dev/null +++ b/libs/injective-query/src/injective/types/v1beta1/tx_ext.ts @@ -0,0 +1,139 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface ExtensionOptionsWeb3Tx { + /** + * typedDataChainID used only in EIP712 Domain and should match + * Ethereum network ID in a Web3 provider (e.g. Metamask). + */ + typedDataChainID: bigint; + /** + * feePayer is an account address for the fee payer. It will be validated + * during EIP712 signature checking. + */ + feePayer: string; + /** + * feePayerSig is a signature data from the fee paying account, + * allows to perform fee delegation when using EIP712 Domain. + */ + feePayerSig: Uint8Array; +} +export interface ExtensionOptionsWeb3TxProtoMsg { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx"; + value: Uint8Array; +} +export interface ExtensionOptionsWeb3TxAmino { + /** + * typedDataChainID used only in EIP712 Domain and should match + * Ethereum network ID in a Web3 provider (e.g. Metamask). + */ + typedDataChainID: string; + /** + * feePayer is an account address for the fee payer. It will be validated + * during EIP712 signature checking. + */ + feePayer: string; + /** + * feePayerSig is a signature data from the fee paying account, + * allows to perform fee delegation when using EIP712 Domain. + */ + feePayerSig: string; +} +export interface ExtensionOptionsWeb3TxAminoMsg { + type: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx"; + value: ExtensionOptionsWeb3TxAmino; +} +function createBaseExtensionOptionsWeb3Tx(): ExtensionOptionsWeb3Tx { + return { + typedDataChainID: BigInt(0), + feePayer: "", + feePayerSig: new Uint8Array() + }; +} +export const ExtensionOptionsWeb3Tx = { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx", + is(o: any): o is ExtensionOptionsWeb3Tx { + return o && (o.$typeUrl === ExtensionOptionsWeb3Tx.typeUrl || typeof o.typedDataChainID === "bigint" && typeof o.feePayer === "string" && (o.feePayerSig instanceof Uint8Array || typeof o.feePayerSig === "string")); + }, + isAmino(o: any): o is ExtensionOptionsWeb3TxAmino { + return o && (o.$typeUrl === ExtensionOptionsWeb3Tx.typeUrl || typeof o.typedDataChainID === "bigint" && typeof o.feePayer === "string" && (o.feePayerSig instanceof Uint8Array || typeof o.feePayerSig === "string")); + }, + encode(message: ExtensionOptionsWeb3Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.typedDataChainID !== BigInt(0)) { + writer.uint32(8).uint64(message.typedDataChainID); + } + if (message.feePayer !== "") { + writer.uint32(18).string(message.feePayer); + } + if (message.feePayerSig.length !== 0) { + writer.uint32(26).bytes(message.feePayerSig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionOptionsWeb3Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionOptionsWeb3Tx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typedDataChainID = reader.uint64(); + break; + case 2: + message.feePayer = reader.string(); + break; + case 3: + message.feePayerSig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionOptionsWeb3Tx { + const message = createBaseExtensionOptionsWeb3Tx(); + message.typedDataChainID = object.typedDataChainID !== undefined && object.typedDataChainID !== null ? BigInt(object.typedDataChainID.toString()) : BigInt(0); + message.feePayer = object.feePayer ?? ""; + message.feePayerSig = object.feePayerSig ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtensionOptionsWeb3TxAmino): ExtensionOptionsWeb3Tx { + const message = createBaseExtensionOptionsWeb3Tx(); + if (object.typedDataChainID !== undefined && object.typedDataChainID !== null) { + message.typedDataChainID = BigInt(object.typedDataChainID); + } + if (object.feePayer !== undefined && object.feePayer !== null) { + message.feePayer = object.feePayer; + } + if (object.feePayerSig !== undefined && object.feePayerSig !== null) { + message.feePayerSig = bytesFromBase64(object.feePayerSig); + } + return message; + }, + toAmino(message: ExtensionOptionsWeb3Tx): ExtensionOptionsWeb3TxAmino { + const obj: any = {}; + obj.typedDataChainID = message.typedDataChainID !== BigInt(0) ? message.typedDataChainID?.toString() : undefined; + obj.feePayer = message.feePayer === "" ? undefined : message.feePayer; + obj.feePayerSig = message.feePayerSig ? base64FromBytes(message.feePayerSig) : undefined; + return obj; + }, + fromAminoMsg(object: ExtensionOptionsWeb3TxAminoMsg): ExtensionOptionsWeb3Tx { + return ExtensionOptionsWeb3Tx.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionOptionsWeb3TxProtoMsg): ExtensionOptionsWeb3Tx { + return ExtensionOptionsWeb3Tx.decode(message.value); + }, + toProto(message: ExtensionOptionsWeb3Tx): Uint8Array { + return ExtensionOptionsWeb3Tx.encode(message).finish(); + }, + toProtoMsg(message: ExtensionOptionsWeb3Tx): ExtensionOptionsWeb3TxProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx", + value: ExtensionOptionsWeb3Tx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionOptionsWeb3Tx.typeUrl, ExtensionOptionsWeb3Tx); \ No newline at end of file diff --git a/libs/injective-query/src/injective/types/v1beta1/tx_response.ts b/libs/injective-query/src/injective/types/v1beta1/tx_response.ts new file mode 100644 index 00000000..14002e46 --- /dev/null +++ b/libs/injective-query/src/injective/types/v1beta1/tx_response.ts @@ -0,0 +1,197 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * base header ak message type, we can cast the bytes into corresponding message + * response type + */ +export interface TxResponseGenericMessage { + header: string; + data: Uint8Array; +} +export interface TxResponseGenericMessageProtoMsg { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage"; + value: Uint8Array; +} +/** + * base header ak message type, we can cast the bytes into corresponding message + * response type + */ +export interface TxResponseGenericMessageAmino { + header: string; + data: string; +} +export interface TxResponseGenericMessageAminoMsg { + type: "/injective.types.v1beta1.TxResponseGenericMessage"; + value: TxResponseGenericMessageAmino; +} +/** improvised message to unpack length prefixed messages in tx response data */ +export interface TxResponseData { + messages: TxResponseGenericMessage[]; +} +export interface TxResponseDataProtoMsg { + typeUrl: "/injective.types.v1beta1.TxResponseData"; + value: Uint8Array; +} +/** improvised message to unpack length prefixed messages in tx response data */ +export interface TxResponseDataAmino { + messages: TxResponseGenericMessageAmino[]; +} +export interface TxResponseDataAminoMsg { + type: "/injective.types.v1beta1.TxResponseData"; + value: TxResponseDataAmino; +} +function createBaseTxResponseGenericMessage(): TxResponseGenericMessage { + return { + header: "", + data: new Uint8Array() + }; +} +export const TxResponseGenericMessage = { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage", + is(o: any): o is TxResponseGenericMessage { + return o && (o.$typeUrl === TxResponseGenericMessage.typeUrl || typeof o.header === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is TxResponseGenericMessageAmino { + return o && (o.$typeUrl === TxResponseGenericMessage.typeUrl || typeof o.header === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: TxResponseGenericMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== "") { + writer.uint32(10).string(message.header); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponseGenericMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponseGenericMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponseGenericMessage { + const message = createBaseTxResponseGenericMessage(); + message.header = object.header ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxResponseGenericMessageAmino): TxResponseGenericMessage { + const message = createBaseTxResponseGenericMessage(); + if (object.header !== undefined && object.header !== null) { + message.header = object.header; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: TxResponseGenericMessage): TxResponseGenericMessageAmino { + const obj: any = {}; + obj.header = message.header === "" ? undefined : message.header; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: TxResponseGenericMessageAminoMsg): TxResponseGenericMessage { + return TxResponseGenericMessage.fromAmino(object.value); + }, + fromProtoMsg(message: TxResponseGenericMessageProtoMsg): TxResponseGenericMessage { + return TxResponseGenericMessage.decode(message.value); + }, + toProto(message: TxResponseGenericMessage): Uint8Array { + return TxResponseGenericMessage.encode(message).finish(); + }, + toProtoMsg(message: TxResponseGenericMessage): TxResponseGenericMessageProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage", + value: TxResponseGenericMessage.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponseGenericMessage.typeUrl, TxResponseGenericMessage); +function createBaseTxResponseData(): TxResponseData { + return { + messages: [] + }; +} +export const TxResponseData = { + typeUrl: "/injective.types.v1beta1.TxResponseData", + is(o: any): o is TxResponseData { + return o && (o.$typeUrl === TxResponseData.typeUrl || Array.isArray(o.messages) && (!o.messages.length || TxResponseGenericMessage.is(o.messages[0]))); + }, + isAmino(o: any): o is TxResponseDataAmino { + return o && (o.$typeUrl === TxResponseData.typeUrl || Array.isArray(o.messages) && (!o.messages.length || TxResponseGenericMessage.isAmino(o.messages[0]))); + }, + encode(message: TxResponseData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + TxResponseGenericMessage.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponseData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponseData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(TxResponseGenericMessage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponseData { + const message = createBaseTxResponseData(); + message.messages = object.messages?.map(e => TxResponseGenericMessage.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxResponseDataAmino): TxResponseData { + const message = createBaseTxResponseData(); + message.messages = object.messages?.map(e => TxResponseGenericMessage.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxResponseData): TxResponseDataAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? TxResponseGenericMessage.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + return obj; + }, + fromAminoMsg(object: TxResponseDataAminoMsg): TxResponseData { + return TxResponseData.fromAmino(object.value); + }, + fromProtoMsg(message: TxResponseDataProtoMsg): TxResponseData { + return TxResponseData.decode(message.value); + }, + toProto(message: TxResponseData): Uint8Array { + return TxResponseData.encode(message).finish(); + }, + toProtoMsg(message: TxResponseData): TxResponseDataProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.TxResponseData", + value: TxResponseData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponseData.typeUrl, TxResponseData); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/events.ts b/libs/injective-query/src/injective/wasmx/v1/events.ts new file mode 100644 index 00000000..b579a219 --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/events.ts @@ -0,0 +1,396 @@ +import { FundingMode } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventContractExecution { + contractAddress: string; + response: Uint8Array; + otherError: string; + executionError: string; +} +export interface EventContractExecutionProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractExecution"; + value: Uint8Array; +} +export interface EventContractExecutionAmino { + contract_address: string; + response: string; + other_error: string; + execution_error: string; +} +export interface EventContractExecutionAminoMsg { + type: "/injective.wasmx.v1.EventContractExecution"; + value: EventContractExecutionAmino; +} +export interface EventContractRegistered { + contractAddress: string; + gasPrice: bigint; + shouldPinContract: boolean; + isMigrationAllowed: boolean; + codeId: bigint; + adminAddress: string; + granterAddress: string; + fundingMode: FundingMode; +} +export interface EventContractRegisteredProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractRegistered"; + value: Uint8Array; +} +export interface EventContractRegisteredAmino { + contract_address: string; + gas_price: string; + should_pin_contract: boolean; + is_migration_allowed: boolean; + code_id: string; + admin_address: string; + granter_address: string; + funding_mode: FundingMode; +} +export interface EventContractRegisteredAminoMsg { + type: "/injective.wasmx.v1.EventContractRegistered"; + value: EventContractRegisteredAmino; +} +export interface EventContractDeregistered { + contractAddress: string; +} +export interface EventContractDeregisteredProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered"; + value: Uint8Array; +} +export interface EventContractDeregisteredAmino { + contract_address: string; +} +export interface EventContractDeregisteredAminoMsg { + type: "/injective.wasmx.v1.EventContractDeregistered"; + value: EventContractDeregisteredAmino; +} +function createBaseEventContractExecution(): EventContractExecution { + return { + contractAddress: "", + response: new Uint8Array(), + otherError: "", + executionError: "" + }; +} +export const EventContractExecution = { + typeUrl: "/injective.wasmx.v1.EventContractExecution", + is(o: any): o is EventContractExecution { + return o && (o.$typeUrl === EventContractExecution.typeUrl || typeof o.contractAddress === "string" && (o.response instanceof Uint8Array || typeof o.response === "string") && typeof o.otherError === "string" && typeof o.executionError === "string"); + }, + isAmino(o: any): o is EventContractExecutionAmino { + return o && (o.$typeUrl === EventContractExecution.typeUrl || typeof o.contract_address === "string" && (o.response instanceof Uint8Array || typeof o.response === "string") && typeof o.other_error === "string" && typeof o.execution_error === "string"); + }, + encode(message: EventContractExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.response.length !== 0) { + writer.uint32(18).bytes(message.response); + } + if (message.otherError !== "") { + writer.uint32(26).string(message.otherError); + } + if (message.executionError !== "") { + writer.uint32(34).string(message.executionError); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.response = reader.bytes(); + break; + case 3: + message.otherError = reader.string(); + break; + case 4: + message.executionError = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractExecution { + const message = createBaseEventContractExecution(); + message.contractAddress = object.contractAddress ?? ""; + message.response = object.response ?? new Uint8Array(); + message.otherError = object.otherError ?? ""; + message.executionError = object.executionError ?? ""; + return message; + }, + fromAmino(object: EventContractExecutionAmino): EventContractExecution { + const message = createBaseEventContractExecution(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.response !== undefined && object.response !== null) { + message.response = bytesFromBase64(object.response); + } + if (object.other_error !== undefined && object.other_error !== null) { + message.otherError = object.other_error; + } + if (object.execution_error !== undefined && object.execution_error !== null) { + message.executionError = object.execution_error; + } + return message; + }, + toAmino(message: EventContractExecution): EventContractExecutionAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.response = message.response ? base64FromBytes(message.response) : undefined; + obj.other_error = message.otherError === "" ? undefined : message.otherError; + obj.execution_error = message.executionError === "" ? undefined : message.executionError; + return obj; + }, + fromAminoMsg(object: EventContractExecutionAminoMsg): EventContractExecution { + return EventContractExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractExecutionProtoMsg): EventContractExecution { + return EventContractExecution.decode(message.value); + }, + toProto(message: EventContractExecution): Uint8Array { + return EventContractExecution.encode(message).finish(); + }, + toProtoMsg(message: EventContractExecution): EventContractExecutionProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractExecution", + value: EventContractExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractExecution.typeUrl, EventContractExecution); +function createBaseEventContractRegistered(): EventContractRegistered { + return { + contractAddress: "", + gasPrice: BigInt(0), + shouldPinContract: false, + isMigrationAllowed: false, + codeId: BigInt(0), + adminAddress: "", + granterAddress: "", + fundingMode: 0 + }; +} +export const EventContractRegistered = { + typeUrl: "/injective.wasmx.v1.EventContractRegistered", + is(o: any): o is EventContractRegistered { + return o && (o.$typeUrl === EventContractRegistered.typeUrl || typeof o.contractAddress === "string" && typeof o.gasPrice === "bigint" && typeof o.shouldPinContract === "boolean" && typeof o.isMigrationAllowed === "boolean" && typeof o.codeId === "bigint" && typeof o.adminAddress === "string" && typeof o.granterAddress === "string" && isSet(o.fundingMode)); + }, + isAmino(o: any): o is EventContractRegisteredAmino { + return o && (o.$typeUrl === EventContractRegistered.typeUrl || typeof o.contract_address === "string" && typeof o.gas_price === "bigint" && typeof o.should_pin_contract === "boolean" && typeof o.is_migration_allowed === "boolean" && typeof o.code_id === "bigint" && typeof o.admin_address === "string" && typeof o.granter_address === "string" && isSet(o.funding_mode)); + }, + encode(message: EventContractRegistered, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(24).uint64(message.gasPrice); + } + if (message.shouldPinContract === true) { + writer.uint32(32).bool(message.shouldPinContract); + } + if (message.isMigrationAllowed === true) { + writer.uint32(40).bool(message.isMigrationAllowed); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(48).uint64(message.codeId); + } + if (message.adminAddress !== "") { + writer.uint32(58).string(message.adminAddress); + } + if (message.granterAddress !== "") { + writer.uint32(66).string(message.granterAddress); + } + if (message.fundingMode !== 0) { + writer.uint32(72).int32(message.fundingMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractRegistered { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractRegistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 3: + message.gasPrice = reader.uint64(); + break; + case 4: + message.shouldPinContract = reader.bool(); + break; + case 5: + message.isMigrationAllowed = reader.bool(); + break; + case 6: + message.codeId = reader.uint64(); + break; + case 7: + message.adminAddress = reader.string(); + break; + case 8: + message.granterAddress = reader.string(); + break; + case 9: + message.fundingMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractRegistered { + const message = createBaseEventContractRegistered(); + message.contractAddress = object.contractAddress ?? ""; + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.shouldPinContract = object.shouldPinContract ?? false; + message.isMigrationAllowed = object.isMigrationAllowed ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? ""; + message.granterAddress = object.granterAddress ?? ""; + message.fundingMode = object.fundingMode ?? 0; + return message; + }, + fromAmino(object: EventContractRegisteredAmino): EventContractRegistered { + const message = createBaseEventContractRegistered(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.should_pin_contract !== undefined && object.should_pin_contract !== null) { + message.shouldPinContract = object.should_pin_contract; + } + if (object.is_migration_allowed !== undefined && object.is_migration_allowed !== null) { + message.isMigrationAllowed = object.is_migration_allowed; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.funding_mode !== undefined && object.funding_mode !== null) { + message.fundingMode = object.funding_mode; + } + return message; + }, + toAmino(message: EventContractRegistered): EventContractRegisteredAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.should_pin_contract = message.shouldPinContract === false ? undefined : message.shouldPinContract; + obj.is_migration_allowed = message.isMigrationAllowed === false ? undefined : message.isMigrationAllowed; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === "" ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === "" ? undefined : message.granterAddress; + obj.funding_mode = message.fundingMode === 0 ? undefined : message.fundingMode; + return obj; + }, + fromAminoMsg(object: EventContractRegisteredAminoMsg): EventContractRegistered { + return EventContractRegistered.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractRegisteredProtoMsg): EventContractRegistered { + return EventContractRegistered.decode(message.value); + }, + toProto(message: EventContractRegistered): Uint8Array { + return EventContractRegistered.encode(message).finish(); + }, + toProtoMsg(message: EventContractRegistered): EventContractRegisteredProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractRegistered", + value: EventContractRegistered.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractRegistered.typeUrl, EventContractRegistered); +function createBaseEventContractDeregistered(): EventContractDeregistered { + return { + contractAddress: "" + }; +} +export const EventContractDeregistered = { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered", + is(o: any): o is EventContractDeregistered { + return o && (o.$typeUrl === EventContractDeregistered.typeUrl || typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is EventContractDeregisteredAmino { + return o && (o.$typeUrl === EventContractDeregistered.typeUrl || typeof o.contract_address === "string"); + }, + encode(message: EventContractDeregistered, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractDeregistered { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractDeregistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractDeregistered { + const message = createBaseEventContractDeregistered(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: EventContractDeregisteredAmino): EventContractDeregistered { + const message = createBaseEventContractDeregistered(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: EventContractDeregistered): EventContractDeregisteredAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: EventContractDeregisteredAminoMsg): EventContractDeregistered { + return EventContractDeregistered.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractDeregisteredProtoMsg): EventContractDeregistered { + return EventContractDeregistered.decode(message.value); + }, + toProto(message: EventContractDeregistered): Uint8Array { + return EventContractDeregistered.encode(message).finish(); + }, + toProtoMsg(message: EventContractDeregistered): EventContractDeregisteredProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered", + value: EventContractDeregistered.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractDeregistered.typeUrl, EventContractDeregistered); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/genesis.ts b/libs/injective-query/src/injective/wasmx/v1/genesis.ts new file mode 100644 index 00000000..ffe48f34 --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/genesis.ts @@ -0,0 +1,214 @@ +import { RegisteredContract, RegisteredContractAmino, Params, ParamsAmino } from "./wasmx"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface RegisteredContractWithAddress { + address: string; + registeredContract?: RegisteredContract; +} +export interface RegisteredContractWithAddressProtoMsg { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress"; + value: Uint8Array; +} +export interface RegisteredContractWithAddressAmino { + address: string; + registered_contract?: RegisteredContractAmino; +} +export interface RegisteredContractWithAddressAminoMsg { + type: "/injective.wasmx.v1.RegisteredContractWithAddress"; + value: RegisteredContractWithAddressAmino; +} +/** GenesisState defines the wasmx module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to wasmx. */ + params: Params; + /** + * registered_contracts is an array containing the genesis registered + * contracts + */ + registeredContracts: RegisteredContractWithAddress[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.wasmx.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the wasmx module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to wasmx. */ + params: ParamsAmino; + /** + * registered_contracts is an array containing the genesis registered + * contracts + */ + registered_contracts: RegisteredContractWithAddressAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.wasmx.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseRegisteredContractWithAddress(): RegisteredContractWithAddress { + return { + address: "", + registeredContract: undefined + }; +} +export const RegisteredContractWithAddress = { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress", + is(o: any): o is RegisteredContractWithAddress { + return o && (o.$typeUrl === RegisteredContractWithAddress.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is RegisteredContractWithAddressAmino { + return o && (o.$typeUrl === RegisteredContractWithAddress.typeUrl || typeof o.address === "string"); + }, + encode(message: RegisteredContractWithAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.registeredContract !== undefined) { + RegisteredContract.encode(message.registeredContract, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredContractWithAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisteredContractWithAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.registeredContract = RegisteredContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RegisteredContractWithAddress { + const message = createBaseRegisteredContractWithAddress(); + message.address = object.address ?? ""; + message.registeredContract = object.registeredContract !== undefined && object.registeredContract !== null ? RegisteredContract.fromPartial(object.registeredContract) : undefined; + return message; + }, + fromAmino(object: RegisteredContractWithAddressAmino): RegisteredContractWithAddress { + const message = createBaseRegisteredContractWithAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.registered_contract !== undefined && object.registered_contract !== null) { + message.registeredContract = RegisteredContract.fromAmino(object.registered_contract); + } + return message; + }, + toAmino(message: RegisteredContractWithAddress): RegisteredContractWithAddressAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.registered_contract = message.registeredContract ? RegisteredContract.toAmino(message.registeredContract) : undefined; + return obj; + }, + fromAminoMsg(object: RegisteredContractWithAddressAminoMsg): RegisteredContractWithAddress { + return RegisteredContractWithAddress.fromAmino(object.value); + }, + fromProtoMsg(message: RegisteredContractWithAddressProtoMsg): RegisteredContractWithAddress { + return RegisteredContractWithAddress.decode(message.value); + }, + toProto(message: RegisteredContractWithAddress): Uint8Array { + return RegisteredContractWithAddress.encode(message).finish(); + }, + toProtoMsg(message: RegisteredContractWithAddress): RegisteredContractWithAddressProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress", + value: RegisteredContractWithAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RegisteredContractWithAddress.typeUrl, RegisteredContractWithAddress); +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + registeredContracts: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.wasmx.v1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.registeredContracts) && (!o.registeredContracts.length || RegisteredContractWithAddress.is(o.registeredContracts[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.registered_contracts) && (!o.registered_contracts.length || RegisteredContractWithAddress.isAmino(o.registered_contracts[0]))); + }, + 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.registeredContracts) { + RegisteredContractWithAddress.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.registeredContracts.push(RegisteredContractWithAddress.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.registeredContracts = object.registeredContracts?.map(e => RegisteredContractWithAddress.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.registeredContracts = object.registered_contracts?.map(e => RegisteredContractWithAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.registeredContracts) { + obj.registered_contracts = message.registeredContracts.map(e => e ? RegisteredContractWithAddress.toAmino(e) : undefined); + } else { + obj.registered_contracts = message.registeredContracts; + } + 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: "/injective.wasmx.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/proposal.ts b/libs/injective-query/src/injective/wasmx/v1/proposal.ts new file mode 100644 index 00000000..7b8680f3 --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/proposal.ts @@ -0,0 +1,769 @@ +import { StoreCodeProposal, StoreCodeProposalAmino } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum FundingMode { + Unspecified = 0, + SelfFunded = 1, + GrantOnly = 2, + Dual = 3, + UNRECOGNIZED = -1, +} +export const FundingModeAmino = FundingMode; +export function fundingModeFromJSON(object: any): FundingMode { + switch (object) { + case 0: + case "Unspecified": + return FundingMode.Unspecified; + case 1: + case "SelfFunded": + return FundingMode.SelfFunded; + case 2: + case "GrantOnly": + return FundingMode.GrantOnly; + case 3: + case "Dual": + return FundingMode.Dual; + case -1: + case "UNRECOGNIZED": + default: + return FundingMode.UNRECOGNIZED; + } +} +export function fundingModeToJSON(object: FundingMode): string { + switch (object) { + case FundingMode.Unspecified: + return "Unspecified"; + case FundingMode.SelfFunded: + return "SelfFunded"; + case FundingMode.GrantOnly: + return "GrantOnly"; + case FundingMode.Dual: + return "Dual"; + case FundingMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface ContractRegistrationRequestProposal { + title: string; + description: string; + contractRegistrationRequest: ContractRegistrationRequest; +} +export interface ContractRegistrationRequestProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal"; + value: Uint8Array; +} +export interface ContractRegistrationRequestProposalAmino { + title: string; + description: string; + contract_registration_request: ContractRegistrationRequestAmino; +} +export interface ContractRegistrationRequestProposalAminoMsg { + type: "wasmx/ContractRegistrationRequestProposal"; + value: ContractRegistrationRequestProposalAmino; +} +export interface BatchContractRegistrationRequestProposal { + title: string; + description: string; + contractRegistrationRequests: ContractRegistrationRequest[]; +} +export interface BatchContractRegistrationRequestProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal"; + value: Uint8Array; +} +export interface BatchContractRegistrationRequestProposalAmino { + title: string; + description: string; + contract_registration_requests: ContractRegistrationRequestAmino[]; +} +export interface BatchContractRegistrationRequestProposalAminoMsg { + type: "wasmx/BatchContractRegistrationRequestProposal"; + value: BatchContractRegistrationRequestProposalAmino; +} +export interface BatchContractDeregistrationProposal { + title: string; + description: string; + contracts: string[]; +} +export interface BatchContractDeregistrationProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal"; + value: Uint8Array; +} +export interface BatchContractDeregistrationProposalAmino { + title: string; + description: string; + contracts: string[]; +} +export interface BatchContractDeregistrationProposalAminoMsg { + type: "wasmx/BatchContractDeregistrationProposal"; + value: BatchContractDeregistrationProposalAmino; +} +export interface ContractRegistrationRequest { + /** Unique Identifier for contract instance to be registered. */ + contractAddress: string; + /** Maximum gas to be used for the smart contract execution. */ + gasLimit: bigint; + /** gas price to be used for the smart contract execution. */ + gasPrice: bigint; + shouldPinContract: boolean; + /** + * if true contract owner can update it, if false only current code_id will be + * allowed to be executed + */ + isMigrationAllowed: boolean; + /** + * code_id of the contract being registered - will be verified upon every + * execution but only if is_migration_allowed is false + */ + codeId: bigint; + /** + * Optional address of admin account (that will be allowed to pause or update + * contract params) + */ + adminAddress: string; + /** + * Optional address of the contract that grants fees. Must be set if + * funding_mode is other than SelfFunded + */ + granterAddress: string; + /** Specifies how the contract will fund its execution */ + fundingMode: FundingMode; +} +export interface ContractRegistrationRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest"; + value: Uint8Array; +} +export interface ContractRegistrationRequestAmino { + /** Unique Identifier for contract instance to be registered. */ + contract_address: string; + /** Maximum gas to be used for the smart contract execution. */ + gas_limit: string; + /** gas price to be used for the smart contract execution. */ + gas_price: string; + should_pin_contract: boolean; + /** + * if true contract owner can update it, if false only current code_id will be + * allowed to be executed + */ + is_migration_allowed: boolean; + /** + * code_id of the contract being registered - will be verified upon every + * execution but only if is_migration_allowed is false + */ + code_id: string; + /** + * Optional address of admin account (that will be allowed to pause or update + * contract params) + */ + admin_address: string; + /** + * Optional address of the contract that grants fees. Must be set if + * funding_mode is other than SelfFunded + */ + granter_address: string; + /** Specifies how the contract will fund its execution */ + funding_mode: FundingMode; +} +export interface ContractRegistrationRequestAminoMsg { + type: "/injective.wasmx.v1.ContractRegistrationRequest"; + value: ContractRegistrationRequestAmino; +} +export interface BatchStoreCodeProposal { + title: string; + description: string; + proposals: StoreCodeProposal[]; +} +export interface BatchStoreCodeProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal"; + value: Uint8Array; +} +export interface BatchStoreCodeProposalAmino { + title: string; + description: string; + proposals: StoreCodeProposalAmino[]; +} +export interface BatchStoreCodeProposalAminoMsg { + type: "wasmx/BatchStoreCodeProposal"; + value: BatchStoreCodeProposalAmino; +} +function createBaseContractRegistrationRequestProposal(): ContractRegistrationRequestProposal { + return { + title: "", + description: "", + contractRegistrationRequest: ContractRegistrationRequest.fromPartial({}) + }; +} +export const ContractRegistrationRequestProposal = { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal", + aminoType: "wasmx/ContractRegistrationRequestProposal", + is(o: any): o is ContractRegistrationRequestProposal { + return o && (o.$typeUrl === ContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && ContractRegistrationRequest.is(o.contractRegistrationRequest)); + }, + isAmino(o: any): o is ContractRegistrationRequestProposalAmino { + return o && (o.$typeUrl === ContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && ContractRegistrationRequest.isAmino(o.contract_registration_request)); + }, + encode(message: ContractRegistrationRequestProposal, 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.contractRegistrationRequest !== undefined) { + ContractRegistrationRequest.encode(message.contractRegistrationRequest, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractRegistrationRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractRegistrationRequestProposal(); + 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.contractRegistrationRequest = ContractRegistrationRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractRegistrationRequestProposal { + const message = createBaseContractRegistrationRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractRegistrationRequest = object.contractRegistrationRequest !== undefined && object.contractRegistrationRequest !== null ? ContractRegistrationRequest.fromPartial(object.contractRegistrationRequest) : undefined; + return message; + }, + fromAmino(object: ContractRegistrationRequestProposalAmino): ContractRegistrationRequestProposal { + const message = createBaseContractRegistrationRequestProposal(); + 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_registration_request !== undefined && object.contract_registration_request !== null) { + message.contractRegistrationRequest = ContractRegistrationRequest.fromAmino(object.contract_registration_request); + } + return message; + }, + toAmino(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract_registration_request = message.contractRegistrationRequest ? ContractRegistrationRequest.toAmino(message.contractRegistrationRequest) : undefined; + return obj; + }, + fromAminoMsg(object: ContractRegistrationRequestProposalAminoMsg): ContractRegistrationRequestProposal { + return ContractRegistrationRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalAminoMsg { + return { + type: "wasmx/ContractRegistrationRequestProposal", + value: ContractRegistrationRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ContractRegistrationRequestProposalProtoMsg): ContractRegistrationRequestProposal { + return ContractRegistrationRequestProposal.decode(message.value); + }, + toProto(message: ContractRegistrationRequestProposal): Uint8Array { + return ContractRegistrationRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal", + value: ContractRegistrationRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractRegistrationRequestProposal.typeUrl, ContractRegistrationRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractRegistrationRequestProposal.aminoType, ContractRegistrationRequestProposal.typeUrl); +function createBaseBatchContractRegistrationRequestProposal(): BatchContractRegistrationRequestProposal { + return { + title: "", + description: "", + contractRegistrationRequests: [] + }; +} +export const BatchContractRegistrationRequestProposal = { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal", + aminoType: "wasmx/BatchContractRegistrationRequestProposal", + is(o: any): o is BatchContractRegistrationRequestProposal { + return o && (o.$typeUrl === BatchContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contractRegistrationRequests) && (!o.contractRegistrationRequests.length || ContractRegistrationRequest.is(o.contractRegistrationRequests[0]))); + }, + isAmino(o: any): o is BatchContractRegistrationRequestProposalAmino { + return o && (o.$typeUrl === BatchContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contract_registration_requests) && (!o.contract_registration_requests.length || ContractRegistrationRequest.isAmino(o.contract_registration_requests[0]))); + }, + encode(message: BatchContractRegistrationRequestProposal, 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.contractRegistrationRequests) { + ContractRegistrationRequest.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchContractRegistrationRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchContractRegistrationRequestProposal(); + 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.contractRegistrationRequests.push(ContractRegistrationRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchContractRegistrationRequestProposal { + const message = createBaseBatchContractRegistrationRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractRegistrationRequests = object.contractRegistrationRequests?.map(e => ContractRegistrationRequest.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchContractRegistrationRequestProposalAmino): BatchContractRegistrationRequestProposal { + const message = createBaseBatchContractRegistrationRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contractRegistrationRequests = object.contract_registration_requests?.map(e => ContractRegistrationRequest.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contractRegistrationRequests) { + obj.contract_registration_requests = message.contractRegistrationRequests.map(e => e ? ContractRegistrationRequest.toAmino(e) : undefined); + } else { + obj.contract_registration_requests = message.contractRegistrationRequests; + } + return obj; + }, + fromAminoMsg(object: BatchContractRegistrationRequestProposalAminoMsg): BatchContractRegistrationRequestProposal { + return BatchContractRegistrationRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalAminoMsg { + return { + type: "wasmx/BatchContractRegistrationRequestProposal", + value: BatchContractRegistrationRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchContractRegistrationRequestProposalProtoMsg): BatchContractRegistrationRequestProposal { + return BatchContractRegistrationRequestProposal.decode(message.value); + }, + toProto(message: BatchContractRegistrationRequestProposal): Uint8Array { + return BatchContractRegistrationRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal", + value: BatchContractRegistrationRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchContractRegistrationRequestProposal.typeUrl, BatchContractRegistrationRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchContractRegistrationRequestProposal.aminoType, BatchContractRegistrationRequestProposal.typeUrl); +function createBaseBatchContractDeregistrationProposal(): BatchContractDeregistrationProposal { + return { + title: "", + description: "", + contracts: [] + }; +} +export const BatchContractDeregistrationProposal = { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal", + aminoType: "wasmx/BatchContractDeregistrationProposal", + is(o: any): o is BatchContractDeregistrationProposal { + return o && (o.$typeUrl === BatchContractDeregistrationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isAmino(o: any): o is BatchContractDeregistrationProposalAmino { + return o && (o.$typeUrl === BatchContractDeregistrationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + encode(message: BatchContractDeregistrationProposal, 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.contracts) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchContractDeregistrationProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchContractDeregistrationProposal(); + 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.contracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchContractDeregistrationProposal { + const message = createBaseBatchContractDeregistrationProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contracts = object.contracts?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchContractDeregistrationProposalAmino): BatchContractDeregistrationProposal { + const message = createBaseBatchContractDeregistrationProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contracts = object.contracts?.map(e => e) || []; + return message; + }, + toAmino(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } + return obj; + }, + fromAminoMsg(object: BatchContractDeregistrationProposalAminoMsg): BatchContractDeregistrationProposal { + return BatchContractDeregistrationProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalAminoMsg { + return { + type: "wasmx/BatchContractDeregistrationProposal", + value: BatchContractDeregistrationProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchContractDeregistrationProposalProtoMsg): BatchContractDeregistrationProposal { + return BatchContractDeregistrationProposal.decode(message.value); + }, + toProto(message: BatchContractDeregistrationProposal): Uint8Array { + return BatchContractDeregistrationProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal", + value: BatchContractDeregistrationProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchContractDeregistrationProposal.typeUrl, BatchContractDeregistrationProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchContractDeregistrationProposal.aminoType, BatchContractDeregistrationProposal.typeUrl); +function createBaseContractRegistrationRequest(): ContractRegistrationRequest { + return { + contractAddress: "", + gasLimit: BigInt(0), + gasPrice: BigInt(0), + shouldPinContract: false, + isMigrationAllowed: false, + codeId: BigInt(0), + adminAddress: "", + granterAddress: "", + fundingMode: 0 + }; +} +export const ContractRegistrationRequest = { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest", + is(o: any): o is ContractRegistrationRequest { + return o && (o.$typeUrl === ContractRegistrationRequest.typeUrl || typeof o.contractAddress === "string" && typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint" && typeof o.shouldPinContract === "boolean" && typeof o.isMigrationAllowed === "boolean" && typeof o.codeId === "bigint" && typeof o.adminAddress === "string" && typeof o.granterAddress === "string" && isSet(o.fundingMode)); + }, + isAmino(o: any): o is ContractRegistrationRequestAmino { + return o && (o.$typeUrl === ContractRegistrationRequest.typeUrl || typeof o.contract_address === "string" && typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint" && typeof o.should_pin_contract === "boolean" && typeof o.is_migration_allowed === "boolean" && typeof o.code_id === "bigint" && typeof o.admin_address === "string" && typeof o.granter_address === "string" && isSet(o.funding_mode)); + }, + encode(message: ContractRegistrationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(24).uint64(message.gasPrice); + } + if (message.shouldPinContract === true) { + writer.uint32(32).bool(message.shouldPinContract); + } + if (message.isMigrationAllowed === true) { + writer.uint32(40).bool(message.isMigrationAllowed); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(48).uint64(message.codeId); + } + if (message.adminAddress !== "") { + writer.uint32(58).string(message.adminAddress); + } + if (message.granterAddress !== "") { + writer.uint32(66).string(message.granterAddress); + } + if (message.fundingMode !== 0) { + writer.uint32(72).int32(message.fundingMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractRegistrationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractRegistrationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.gasPrice = reader.uint64(); + break; + case 4: + message.shouldPinContract = reader.bool(); + break; + case 5: + message.isMigrationAllowed = reader.bool(); + break; + case 6: + message.codeId = reader.uint64(); + break; + case 7: + message.adminAddress = reader.string(); + break; + case 8: + message.granterAddress = reader.string(); + break; + case 9: + message.fundingMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractRegistrationRequest { + const message = createBaseContractRegistrationRequest(); + message.contractAddress = object.contractAddress ?? ""; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.shouldPinContract = object.shouldPinContract ?? false; + message.isMigrationAllowed = object.isMigrationAllowed ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? ""; + message.granterAddress = object.granterAddress ?? ""; + message.fundingMode = object.fundingMode ?? 0; + return message; + }, + fromAmino(object: ContractRegistrationRequestAmino): ContractRegistrationRequest { + const message = createBaseContractRegistrationRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.should_pin_contract !== undefined && object.should_pin_contract !== null) { + message.shouldPinContract = object.should_pin_contract; + } + if (object.is_migration_allowed !== undefined && object.is_migration_allowed !== null) { + message.isMigrationAllowed = object.is_migration_allowed; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.funding_mode !== undefined && object.funding_mode !== null) { + message.fundingMode = object.funding_mode; + } + return message; + }, + toAmino(message: ContractRegistrationRequest): ContractRegistrationRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.should_pin_contract = message.shouldPinContract === false ? undefined : message.shouldPinContract; + obj.is_migration_allowed = message.isMigrationAllowed === false ? undefined : message.isMigrationAllowed; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === "" ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === "" ? undefined : message.granterAddress; + obj.funding_mode = message.fundingMode === 0 ? undefined : message.fundingMode; + return obj; + }, + fromAminoMsg(object: ContractRegistrationRequestAminoMsg): ContractRegistrationRequest { + return ContractRegistrationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ContractRegistrationRequestProtoMsg): ContractRegistrationRequest { + return ContractRegistrationRequest.decode(message.value); + }, + toProto(message: ContractRegistrationRequest): Uint8Array { + return ContractRegistrationRequest.encode(message).finish(); + }, + toProtoMsg(message: ContractRegistrationRequest): ContractRegistrationRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest", + value: ContractRegistrationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractRegistrationRequest.typeUrl, ContractRegistrationRequest); +function createBaseBatchStoreCodeProposal(): BatchStoreCodeProposal { + return { + title: "", + description: "", + proposals: [] + }; +} +export const BatchStoreCodeProposal = { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal", + aminoType: "wasmx/BatchStoreCodeProposal", + is(o: any): o is BatchStoreCodeProposal { + return o && (o.$typeUrl === BatchStoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || StoreCodeProposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is BatchStoreCodeProposalAmino { + return o && (o.$typeUrl === BatchStoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || StoreCodeProposal.isAmino(o.proposals[0]))); + }, + encode(message: BatchStoreCodeProposal, 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.proposals) { + StoreCodeProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchStoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchStoreCodeProposal(); + 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.proposals.push(StoreCodeProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchStoreCodeProposal { + const message = createBaseBatchStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.proposals = object.proposals?.map(e => StoreCodeProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchStoreCodeProposalAmino): BatchStoreCodeProposal { + const message = createBaseBatchStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.proposals = object.proposals?.map(e => StoreCodeProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchStoreCodeProposal): BatchStoreCodeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? StoreCodeProposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + return obj; + }, + fromAminoMsg(object: BatchStoreCodeProposalAminoMsg): BatchStoreCodeProposal { + return BatchStoreCodeProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchStoreCodeProposal): BatchStoreCodeProposalAminoMsg { + return { + type: "wasmx/BatchStoreCodeProposal", + value: BatchStoreCodeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchStoreCodeProposalProtoMsg): BatchStoreCodeProposal { + return BatchStoreCodeProposal.decode(message.value); + }, + toProto(message: BatchStoreCodeProposal): Uint8Array { + return BatchStoreCodeProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchStoreCodeProposal): BatchStoreCodeProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal", + value: BatchStoreCodeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchStoreCodeProposal.typeUrl, BatchStoreCodeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchStoreCodeProposal.aminoType, BatchStoreCodeProposal.typeUrl); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/query.rpc.func.ts b/libs/injective-query/src/injective/wasmx/v1/query.rpc.func.ts new file mode 100644 index 00000000..4063059e --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/query.rpc.func.ts @@ -0,0 +1,36 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { buildUseQuery } from "../../../react-query"; +import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetWasmxParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmxParamsRequest.encode, + decode: QueryWasmxParamsResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxParams", + clientResolver +}); +export const useGetWasmxParams = buildUseQuery({ + builderQueryFn: createGetWasmxParams, + queryKeyPrefix: "WasmxParamsQuery" +}); +export const createGetContractRegistrationInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractRegistrationInfoRequest.encode, + decode: QueryContractRegistrationInfoResponse.decode, + service: "injective.wasmx.v1.Query", + method: "ContractRegistrationInfo", + clientResolver +}); +export const useGetContractRegistrationInfo = buildUseQuery({ + builderQueryFn: createGetContractRegistrationInfo, + queryKeyPrefix: "ContractRegistrationInfoQuery" +}); +export const createGetWasmxModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxModuleState", + clientResolver +}); +export const useGetWasmxModuleState = buildUseQuery({ + builderQueryFn: createGetWasmxModuleState, + queryKeyPrefix: "WasmxModuleStateQuery" +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/query.ts b/libs/injective-query/src/injective/wasmx/v1/query.ts new file mode 100644 index 00000000..002a060c --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/query.ts @@ -0,0 +1,509 @@ +import { Params, ParamsAmino, RegisteredContract, RegisteredContractAmino } from "./wasmx"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsRequest {} +export interface QueryWasmxParamsRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest"; + value: Uint8Array; +} +/** + * QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsRequestAmino {} +export interface QueryWasmxParamsRequestAminoMsg { + type: "/injective.wasmx.v1.QueryWasmxParamsRequest"; + value: QueryWasmxParamsRequestAmino; +} +/** + * QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsResponse { + params: Params; +} +export interface QueryWasmxParamsResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse"; + value: Uint8Array; +} +/** + * QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryWasmxParamsResponseAminoMsg { + type: "/injective.wasmx.v1.QueryWasmxParamsResponse"; + value: QueryWasmxParamsResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.wasmx.v1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.wasmx.v1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +/** Contract registration info */ +export interface QueryContractRegistrationInfoRequest { + contractAddress: string; +} +export interface QueryContractRegistrationInfoRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest"; + value: Uint8Array; +} +/** Contract registration info */ +export interface QueryContractRegistrationInfoRequestAmino { + contract_address: string; +} +export interface QueryContractRegistrationInfoRequestAminoMsg { + type: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest"; + value: QueryContractRegistrationInfoRequestAmino; +} +export interface QueryContractRegistrationInfoResponse { + contract?: RegisteredContract; +} +export interface QueryContractRegistrationInfoResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse"; + value: Uint8Array; +} +export interface QueryContractRegistrationInfoResponseAmino { + contract?: RegisteredContractAmino; +} +export interface QueryContractRegistrationInfoResponseAminoMsg { + type: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse"; + value: QueryContractRegistrationInfoResponseAmino; +} +function createBaseQueryWasmxParamsRequest(): QueryWasmxParamsRequest { + return {}; +} +export const QueryWasmxParamsRequest = { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest", + is(o: any): o is QueryWasmxParamsRequest { + return o && o.$typeUrl === QueryWasmxParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryWasmxParamsRequestAmino { + return o && o.$typeUrl === QueryWasmxParamsRequest.typeUrl; + }, + encode(_: QueryWasmxParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmxParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmxParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryWasmxParamsRequest { + const message = createBaseQueryWasmxParamsRequest(); + return message; + }, + fromAmino(_: QueryWasmxParamsRequestAmino): QueryWasmxParamsRequest { + const message = createBaseQueryWasmxParamsRequest(); + return message; + }, + toAmino(_: QueryWasmxParamsRequest): QueryWasmxParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryWasmxParamsRequestAminoMsg): QueryWasmxParamsRequest { + return QueryWasmxParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryWasmxParamsRequestProtoMsg): QueryWasmxParamsRequest { + return QueryWasmxParamsRequest.decode(message.value); + }, + toProto(message: QueryWasmxParamsRequest): Uint8Array { + return QueryWasmxParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmxParamsRequest): QueryWasmxParamsRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest", + value: QueryWasmxParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmxParamsRequest.typeUrl, QueryWasmxParamsRequest); +function createBaseQueryWasmxParamsResponse(): QueryWasmxParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryWasmxParamsResponse = { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse", + is(o: any): o is QueryWasmxParamsResponse { + return o && (o.$typeUrl === QueryWasmxParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryWasmxParamsResponseAmino { + return o && (o.$typeUrl === QueryWasmxParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryWasmxParamsResponse, 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): QueryWasmxParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmxParamsResponse(); + 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: DeepPartial): QueryWasmxParamsResponse { + const message = createBaseQueryWasmxParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryWasmxParamsResponseAmino): QueryWasmxParamsResponse { + const message = createBaseQueryWasmxParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryWasmxParamsResponse): QueryWasmxParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryWasmxParamsResponseAminoMsg): QueryWasmxParamsResponse { + return QueryWasmxParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryWasmxParamsResponseProtoMsg): QueryWasmxParamsResponse { + return QueryWasmxParamsResponse.decode(message.value); + }, + toProto(message: QueryWasmxParamsResponse): Uint8Array { + return QueryWasmxParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmxParamsResponse): QueryWasmxParamsResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse", + value: QueryWasmxParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmxParamsResponse.typeUrl, QueryWasmxParamsResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryContractRegistrationInfoRequest(): QueryContractRegistrationInfoRequest { + return { + contractAddress: "" + }; +} +export const QueryContractRegistrationInfoRequest = { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest", + is(o: any): o is QueryContractRegistrationInfoRequest { + return o && (o.$typeUrl === QueryContractRegistrationInfoRequest.typeUrl || typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryContractRegistrationInfoRequestAmino { + return o && (o.$typeUrl === QueryContractRegistrationInfoRequest.typeUrl || typeof o.contract_address === "string"); + }, + encode(message: QueryContractRegistrationInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractRegistrationInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractRegistrationInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractRegistrationInfoRequest { + const message = createBaseQueryContractRegistrationInfoRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryContractRegistrationInfoRequestAmino): QueryContractRegistrationInfoRequest { + const message = createBaseQueryContractRegistrationInfoRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryContractRegistrationInfoRequest): QueryContractRegistrationInfoRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryContractRegistrationInfoRequestAminoMsg): QueryContractRegistrationInfoRequest { + return QueryContractRegistrationInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractRegistrationInfoRequestProtoMsg): QueryContractRegistrationInfoRequest { + return QueryContractRegistrationInfoRequest.decode(message.value); + }, + toProto(message: QueryContractRegistrationInfoRequest): Uint8Array { + return QueryContractRegistrationInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractRegistrationInfoRequest): QueryContractRegistrationInfoRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest", + value: QueryContractRegistrationInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractRegistrationInfoRequest.typeUrl, QueryContractRegistrationInfoRequest); +function createBaseQueryContractRegistrationInfoResponse(): QueryContractRegistrationInfoResponse { + return { + contract: undefined + }; +} +export const QueryContractRegistrationInfoResponse = { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse", + is(o: any): o is QueryContractRegistrationInfoResponse { + return o && o.$typeUrl === QueryContractRegistrationInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryContractRegistrationInfoResponseAmino { + return o && o.$typeUrl === QueryContractRegistrationInfoResponse.typeUrl; + }, + encode(message: QueryContractRegistrationInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contract !== undefined) { + RegisteredContract.encode(message.contract, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractRegistrationInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractRegistrationInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contract = RegisteredContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractRegistrationInfoResponse { + const message = createBaseQueryContractRegistrationInfoResponse(); + message.contract = object.contract !== undefined && object.contract !== null ? RegisteredContract.fromPartial(object.contract) : undefined; + return message; + }, + fromAmino(object: QueryContractRegistrationInfoResponseAmino): QueryContractRegistrationInfoResponse { + const message = createBaseQueryContractRegistrationInfoResponse(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = RegisteredContract.fromAmino(object.contract); + } + return message; + }, + toAmino(message: QueryContractRegistrationInfoResponse): QueryContractRegistrationInfoResponseAmino { + const obj: any = {}; + obj.contract = message.contract ? RegisteredContract.toAmino(message.contract) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractRegistrationInfoResponseAminoMsg): QueryContractRegistrationInfoResponse { + return QueryContractRegistrationInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractRegistrationInfoResponseProtoMsg): QueryContractRegistrationInfoResponse { + return QueryContractRegistrationInfoResponse.decode(message.value); + }, + toProto(message: QueryContractRegistrationInfoResponse): Uint8Array { + return QueryContractRegistrationInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractRegistrationInfoResponse): QueryContractRegistrationInfoResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse", + value: QueryContractRegistrationInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractRegistrationInfoResponse.typeUrl, QueryContractRegistrationInfoResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/tx.rpc.func.ts b/libs/injective-query/src/injective/wasmx/v1/tx.rpc.func.ts new file mode 100644 index 00000000..2769640d --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/tx.rpc.func.ts @@ -0,0 +1,58 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { buildUseMutation } from "../../../react-query"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; +export const createUpdateRegistryContractParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContract.typeUrl, + encoders: toEncoders(MsgUpdateContract), + converters: toConverters(MsgUpdateContract) +}); +export const useUpdateRegistryContractParams = buildUseMutation({ + builderMutationFn: createUpdateRegistryContractParams +}); +export const createActivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateContract.typeUrl, + encoders: toEncoders(MsgActivateContract), + converters: toConverters(MsgActivateContract) +}); +export const useActivateRegistryContract = buildUseMutation({ + builderMutationFn: createActivateRegistryContract +}); +export const createDeactivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeactivateContract.typeUrl, + encoders: toEncoders(MsgDeactivateContract), + converters: toConverters(MsgDeactivateContract) +}); +export const useDeactivateRegistryContract = buildUseMutation({ + builderMutationFn: createDeactivateRegistryContract +}); +export const createExecuteContractCompat = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContractCompat.typeUrl, + encoders: toEncoders(MsgExecuteContractCompat), + converters: toConverters(MsgExecuteContractCompat) +}); +export const useExecuteContractCompat = buildUseMutation({ + builderMutationFn: createExecuteContractCompat +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const useUpdateParams = buildUseMutation({ + builderMutationFn: createUpdateParams +}); +export const createRegisterContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRegisterContract.typeUrl, + encoders: toEncoders(MsgRegisterContract), + converters: toConverters(MsgRegisterContract) +}); +export const useRegisterContract = buildUseMutation({ + builderMutationFn: createRegisterContract +}); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/tx.ts b/libs/injective-query/src/injective/wasmx/v1/tx.ts new file mode 100644 index 00000000..a8b9a574 --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/tx.ts @@ -0,0 +1,1174 @@ +import { Params, ParamsAmino } from "./wasmx"; +import { ContractRegistrationRequest, ContractRegistrationRequestAmino } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgExecuteContractCompat submits the given message data to a smart contract, + * compatible with EIP712 + */ +export interface MsgExecuteContractCompat { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: string; + /** Funds coins that are transferred to the contract on execution */ + funds: string; +} +export interface MsgExecuteContractCompatProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat"; + value: Uint8Array; +} +/** + * MsgExecuteContractCompat submits the given message data to a smart contract, + * compatible with EIP712 + */ +export interface MsgExecuteContractCompatAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: string; + /** Funds coins that are transferred to the contract on execution */ + funds: string; +} +export interface MsgExecuteContractCompatAminoMsg { + type: "wasmx/MsgExecuteContractCompat"; + value: MsgExecuteContractCompatAmino; +} +/** MsgExecuteContractCompatResponse returns execution result data. */ +export interface MsgExecuteContractCompatResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractCompatResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse"; + value: Uint8Array; +} +/** MsgExecuteContractCompatResponse returns execution result data. */ +export interface MsgExecuteContractCompatResponseAmino { + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgExecuteContractCompatResponseAminoMsg { + type: "/injective.wasmx.v1.MsgExecuteContractCompatResponse"; + value: MsgExecuteContractCompatResponseAmino; +} +export interface MsgUpdateContract { + sender: string; + /** Unique Identifier for contract instance to be registered. */ + contractAddress: string; + /** Maximum gas to be used for the smart contract execution. */ + gasLimit: bigint; + /** gas price to be used for the smart contract execution. */ + gasPrice: bigint; + /** optional - admin account that will be allowed to perform any changes */ + adminAddress?: string; +} +export interface MsgUpdateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract"; + value: Uint8Array; +} +export interface MsgUpdateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be registered. */ + contract_address: string; + /** Maximum gas to be used for the smart contract execution. */ + gas_limit: string; + /** gas price to be used for the smart contract execution. */ + gas_price: string; + /** optional - admin account that will be allowed to perform any changes */ + admin_address?: string; +} +export interface MsgUpdateContractAminoMsg { + type: "wasmx/MsgUpdateContract"; + value: MsgUpdateContractAmino; +} +export interface MsgUpdateContractResponse {} +export interface MsgUpdateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse"; + value: Uint8Array; +} +export interface MsgUpdateContractResponseAmino {} +export interface MsgUpdateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgUpdateContractResponse"; + value: MsgUpdateContractResponseAmino; +} +export interface MsgActivateContract { + sender: string; + /** Unique Identifier for contract instance to be activated. */ + contractAddress: string; +} +export interface MsgActivateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgActivateContract"; + value: Uint8Array; +} +export interface MsgActivateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be activated. */ + contract_address: string; +} +export interface MsgActivateContractAminoMsg { + type: "wasmx/MsgActivateContract"; + value: MsgActivateContractAmino; +} +export interface MsgActivateContractResponse {} +export interface MsgActivateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse"; + value: Uint8Array; +} +export interface MsgActivateContractResponseAmino {} +export interface MsgActivateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgActivateContractResponse"; + value: MsgActivateContractResponseAmino; +} +export interface MsgDeactivateContract { + sender: string; + /** Unique Identifier for contract instance to be deactivated. */ + contractAddress: string; +} +export interface MsgDeactivateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract"; + value: Uint8Array; +} +export interface MsgDeactivateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be deactivated. */ + contract_address: string; +} +export interface MsgDeactivateContractAminoMsg { + type: "wasmx/MsgDeactivateContract"; + value: MsgDeactivateContractAmino; +} +export interface MsgDeactivateContractResponse {} +export interface MsgDeactivateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse"; + value: Uint8Array; +} +export interface MsgDeactivateContractResponseAmino {} +export interface MsgDeactivateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgDeactivateContractResponse"; + value: MsgDeactivateContractResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the wasmx parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the wasmx parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "wasmx/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.wasmx.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgRegisterContract { + sender: string; + contractRegistrationRequest: ContractRegistrationRequest; +} +export interface MsgRegisterContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract"; + value: Uint8Array; +} +export interface MsgRegisterContractAmino { + sender: string; + contract_registration_request: ContractRegistrationRequestAmino; +} +export interface MsgRegisterContractAminoMsg { + type: "wasmx/MsgRegisterContract"; + value: MsgRegisterContractAmino; +} +export interface MsgRegisterContractResponse {} +export interface MsgRegisterContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse"; + value: Uint8Array; +} +export interface MsgRegisterContractResponseAmino {} +export interface MsgRegisterContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgRegisterContractResponse"; + value: MsgRegisterContractResponseAmino; +} +function createBaseMsgExecuteContractCompat(): MsgExecuteContractCompat { + return { + sender: "", + contract: "", + msg: "", + funds: "" + }; +} +export const MsgExecuteContractCompat = { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat", + aminoType: "wasmx/MsgExecuteContractCompat", + is(o: any): o is MsgExecuteContractCompat { + return o && (o.$typeUrl === MsgExecuteContractCompat.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.msg === "string" && typeof o.funds === "string"); + }, + isAmino(o: any): o is MsgExecuteContractCompatAmino { + return o && (o.$typeUrl === MsgExecuteContractCompat.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.msg === "string" && typeof o.funds === "string"); + }, + encode(message: MsgExecuteContractCompat, 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 !== "") { + writer.uint32(26).string(message.msg); + } + if (message.funds !== "") { + writer.uint32(34).string(message.funds); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractCompat { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractCompat(); + 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.string(); + break; + case 4: + message.funds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecuteContractCompat { + const message = createBaseMsgExecuteContractCompat(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? ""; + message.funds = object.funds ?? ""; + return message; + }, + fromAmino(object: MsgExecuteContractCompatAmino): MsgExecuteContractCompat { + const message = createBaseMsgExecuteContractCompat(); + 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 = object.msg; + } + if (object.funds !== undefined && object.funds !== null) { + message.funds = object.funds; + } + return message; + }, + toAmino(message: MsgExecuteContractCompat): MsgExecuteContractCompatAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg === "" ? undefined : message.msg; + obj.funds = message.funds === "" ? undefined : message.funds; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractCompatAminoMsg): MsgExecuteContractCompat { + return MsgExecuteContractCompat.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractCompat): MsgExecuteContractCompatAminoMsg { + return { + type: "wasmx/MsgExecuteContractCompat", + value: MsgExecuteContractCompat.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractCompatProtoMsg): MsgExecuteContractCompat { + return MsgExecuteContractCompat.decode(message.value); + }, + toProto(message: MsgExecuteContractCompat): Uint8Array { + return MsgExecuteContractCompat.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractCompat): MsgExecuteContractCompatProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat", + value: MsgExecuteContractCompat.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractCompat.typeUrl, MsgExecuteContractCompat); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContractCompat.aminoType, MsgExecuteContractCompat.typeUrl); +function createBaseMsgExecuteContractCompatResponse(): MsgExecuteContractCompatResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractCompatResponse = { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse", + is(o: any): o is MsgExecuteContractCompatResponse { + return o && (o.$typeUrl === MsgExecuteContractCompatResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgExecuteContractCompatResponseAmino { + return o && (o.$typeUrl === MsgExecuteContractCompatResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: MsgExecuteContractCompatResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractCompatResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractCompatResponse(); + 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: DeepPartial): MsgExecuteContractCompatResponse { + const message = createBaseMsgExecuteContractCompatResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractCompatResponseAmino): MsgExecuteContractCompatResponse { + const message = createBaseMsgExecuteContractCompatResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractCompatResponse): MsgExecuteContractCompatResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractCompatResponseAminoMsg): MsgExecuteContractCompatResponse { + return MsgExecuteContractCompatResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExecuteContractCompatResponseProtoMsg): MsgExecuteContractCompatResponse { + return MsgExecuteContractCompatResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractCompatResponse): Uint8Array { + return MsgExecuteContractCompatResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractCompatResponse): MsgExecuteContractCompatResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse", + value: MsgExecuteContractCompatResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractCompatResponse.typeUrl, MsgExecuteContractCompatResponse); +function createBaseMsgUpdateContract(): MsgUpdateContract { + return { + sender: "", + contractAddress: "", + gasLimit: BigInt(0), + gasPrice: BigInt(0), + adminAddress: undefined + }; +} +export const MsgUpdateContract = { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract", + aminoType: "wasmx/MsgUpdateContract", + is(o: any): o is MsgUpdateContract { + return o && (o.$typeUrl === MsgUpdateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string" && typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint"); + }, + isAmino(o: any): o is MsgUpdateContractAmino { + return o && (o.$typeUrl === MsgUpdateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string" && typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint"); + }, + encode(message: MsgUpdateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(24).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(32).uint64(message.gasPrice); + } + if (message.adminAddress !== undefined) { + writer.uint32(42).string(message.adminAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.gasLimit = reader.uint64(); + break; + case 4: + message.gasPrice = reader.uint64(); + break; + case 5: + message.adminAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateContract { + const message = createBaseMsgUpdateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? undefined; + return message; + }, + fromAmino(object: MsgUpdateContractAmino): MsgUpdateContract { + const message = createBaseMsgUpdateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + return message; + }, + toAmino(message: MsgUpdateContract): MsgUpdateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.admin_address = message.adminAddress === null ? undefined : message.adminAddress; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractAminoMsg): MsgUpdateContract { + return MsgUpdateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContract): MsgUpdateContractAminoMsg { + return { + type: "wasmx/MsgUpdateContract", + value: MsgUpdateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractProtoMsg): MsgUpdateContract { + return MsgUpdateContract.decode(message.value); + }, + toProto(message: MsgUpdateContract): Uint8Array { + return MsgUpdateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContract): MsgUpdateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract", + value: MsgUpdateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContract.typeUrl, MsgUpdateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContract.aminoType, MsgUpdateContract.typeUrl); +function createBaseMsgUpdateContractResponse(): MsgUpdateContractResponse { + return {}; +} +export const MsgUpdateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse", + is(o: any): o is MsgUpdateContractResponse { + return o && o.$typeUrl === MsgUpdateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateContractResponseAmino { + return o && o.$typeUrl === MsgUpdateContractResponse.typeUrl; + }, + encode(_: MsgUpdateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateContractResponse { + const message = createBaseMsgUpdateContractResponse(); + return message; + }, + fromAmino(_: MsgUpdateContractResponseAmino): MsgUpdateContractResponse { + const message = createBaseMsgUpdateContractResponse(); + return message; + }, + toAmino(_: MsgUpdateContractResponse): MsgUpdateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractResponseAminoMsg): MsgUpdateContractResponse { + return MsgUpdateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateContractResponseProtoMsg): MsgUpdateContractResponse { + return MsgUpdateContractResponse.decode(message.value); + }, + toProto(message: MsgUpdateContractResponse): Uint8Array { + return MsgUpdateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractResponse): MsgUpdateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse", + value: MsgUpdateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractResponse.typeUrl, MsgUpdateContractResponse); +function createBaseMsgActivateContract(): MsgActivateContract { + return { + sender: "", + contractAddress: "" + }; +} +export const MsgActivateContract = { + typeUrl: "/injective.wasmx.v1.MsgActivateContract", + aminoType: "wasmx/MsgActivateContract", + is(o: any): o is MsgActivateContract { + return o && (o.$typeUrl === MsgActivateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is MsgActivateContractAmino { + return o && (o.$typeUrl === MsgActivateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string"); + }, + encode(message: MsgActivateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgActivateContract { + const message = createBaseMsgActivateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: MsgActivateContractAmino): MsgActivateContract { + const message = createBaseMsgActivateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: MsgActivateContract): MsgActivateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: MsgActivateContractAminoMsg): MsgActivateContract { + return MsgActivateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgActivateContract): MsgActivateContractAminoMsg { + return { + type: "wasmx/MsgActivateContract", + value: MsgActivateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgActivateContractProtoMsg): MsgActivateContract { + return MsgActivateContract.decode(message.value); + }, + toProto(message: MsgActivateContract): Uint8Array { + return MsgActivateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateContract): MsgActivateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgActivateContract", + value: MsgActivateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateContract.typeUrl, MsgActivateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgActivateContract.aminoType, MsgActivateContract.typeUrl); +function createBaseMsgActivateContractResponse(): MsgActivateContractResponse { + return {}; +} +export const MsgActivateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse", + is(o: any): o is MsgActivateContractResponse { + return o && o.$typeUrl === MsgActivateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgActivateContractResponseAmino { + return o && o.$typeUrl === MsgActivateContractResponse.typeUrl; + }, + encode(_: MsgActivateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgActivateContractResponse { + const message = createBaseMsgActivateContractResponse(); + return message; + }, + fromAmino(_: MsgActivateContractResponseAmino): MsgActivateContractResponse { + const message = createBaseMsgActivateContractResponse(); + return message; + }, + toAmino(_: MsgActivateContractResponse): MsgActivateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgActivateContractResponseAminoMsg): MsgActivateContractResponse { + return MsgActivateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgActivateContractResponseProtoMsg): MsgActivateContractResponse { + return MsgActivateContractResponse.decode(message.value); + }, + toProto(message: MsgActivateContractResponse): Uint8Array { + return MsgActivateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateContractResponse): MsgActivateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse", + value: MsgActivateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateContractResponse.typeUrl, MsgActivateContractResponse); +function createBaseMsgDeactivateContract(): MsgDeactivateContract { + return { + sender: "", + contractAddress: "" + }; +} +export const MsgDeactivateContract = { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract", + aminoType: "wasmx/MsgDeactivateContract", + is(o: any): o is MsgDeactivateContract { + return o && (o.$typeUrl === MsgDeactivateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is MsgDeactivateContractAmino { + return o && (o.$typeUrl === MsgDeactivateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string"); + }, + encode(message: MsgDeactivateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeactivateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeactivateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeactivateContract { + const message = createBaseMsgDeactivateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: MsgDeactivateContractAmino): MsgDeactivateContract { + const message = createBaseMsgDeactivateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: MsgDeactivateContract): MsgDeactivateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: MsgDeactivateContractAminoMsg): MsgDeactivateContract { + return MsgDeactivateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeactivateContract): MsgDeactivateContractAminoMsg { + return { + type: "wasmx/MsgDeactivateContract", + value: MsgDeactivateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDeactivateContractProtoMsg): MsgDeactivateContract { + return MsgDeactivateContract.decode(message.value); + }, + toProto(message: MsgDeactivateContract): Uint8Array { + return MsgDeactivateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgDeactivateContract): MsgDeactivateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract", + value: MsgDeactivateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeactivateContract.typeUrl, MsgDeactivateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeactivateContract.aminoType, MsgDeactivateContract.typeUrl); +function createBaseMsgDeactivateContractResponse(): MsgDeactivateContractResponse { + return {}; +} +export const MsgDeactivateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse", + is(o: any): o is MsgDeactivateContractResponse { + return o && o.$typeUrl === MsgDeactivateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgDeactivateContractResponseAmino { + return o && o.$typeUrl === MsgDeactivateContractResponse.typeUrl; + }, + encode(_: MsgDeactivateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeactivateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeactivateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDeactivateContractResponse { + const message = createBaseMsgDeactivateContractResponse(); + return message; + }, + fromAmino(_: MsgDeactivateContractResponseAmino): MsgDeactivateContractResponse { + const message = createBaseMsgDeactivateContractResponse(); + return message; + }, + toAmino(_: MsgDeactivateContractResponse): MsgDeactivateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeactivateContractResponseAminoMsg): MsgDeactivateContractResponse { + return MsgDeactivateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeactivateContractResponseProtoMsg): MsgDeactivateContractResponse { + return MsgDeactivateContractResponse.decode(message.value); + }, + toProto(message: MsgDeactivateContractResponse): Uint8Array { + return MsgDeactivateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeactivateContractResponse): MsgDeactivateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse", + value: MsgDeactivateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeactivateContractResponse.typeUrl, MsgDeactivateContractResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.wasmx.v1.MsgUpdateParams", + aminoType: "wasmx/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "wasmx/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: "/injective.wasmx.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgRegisterContract(): MsgRegisterContract { + return { + sender: "", + contractRegistrationRequest: ContractRegistrationRequest.fromPartial({}) + }; +} +export const MsgRegisterContract = { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract", + aminoType: "wasmx/MsgRegisterContract", + is(o: any): o is MsgRegisterContract { + return o && (o.$typeUrl === MsgRegisterContract.typeUrl || typeof o.sender === "string" && ContractRegistrationRequest.is(o.contractRegistrationRequest)); + }, + isAmino(o: any): o is MsgRegisterContractAmino { + return o && (o.$typeUrl === MsgRegisterContract.typeUrl || typeof o.sender === "string" && ContractRegistrationRequest.isAmino(o.contract_registration_request)); + }, + encode(message: MsgRegisterContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractRegistrationRequest !== undefined) { + ContractRegistrationRequest.encode(message.contractRegistrationRequest, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractRegistrationRequest = ContractRegistrationRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRegisterContract { + const message = createBaseMsgRegisterContract(); + message.sender = object.sender ?? ""; + message.contractRegistrationRequest = object.contractRegistrationRequest !== undefined && object.contractRegistrationRequest !== null ? ContractRegistrationRequest.fromPartial(object.contractRegistrationRequest) : undefined; + return message; + }, + fromAmino(object: MsgRegisterContractAmino): MsgRegisterContract { + const message = createBaseMsgRegisterContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_registration_request !== undefined && object.contract_registration_request !== null) { + message.contractRegistrationRequest = ContractRegistrationRequest.fromAmino(object.contract_registration_request); + } + return message; + }, + toAmino(message: MsgRegisterContract): MsgRegisterContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_registration_request = message.contractRegistrationRequest ? ContractRegistrationRequest.toAmino(message.contractRegistrationRequest) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRegisterContractAminoMsg): MsgRegisterContract { + return MsgRegisterContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgRegisterContract): MsgRegisterContractAminoMsg { + return { + type: "wasmx/MsgRegisterContract", + value: MsgRegisterContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRegisterContractProtoMsg): MsgRegisterContract { + return MsgRegisterContract.decode(message.value); + }, + toProto(message: MsgRegisterContract): Uint8Array { + return MsgRegisterContract.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterContract): MsgRegisterContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract", + value: MsgRegisterContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRegisterContract.typeUrl, MsgRegisterContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterContract.aminoType, MsgRegisterContract.typeUrl); +function createBaseMsgRegisterContractResponse(): MsgRegisterContractResponse { + return {}; +} +export const MsgRegisterContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse", + is(o: any): o is MsgRegisterContractResponse { + return o && o.$typeUrl === MsgRegisterContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgRegisterContractResponseAmino { + return o && o.$typeUrl === MsgRegisterContractResponse.typeUrl; + }, + encode(_: MsgRegisterContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRegisterContractResponse { + const message = createBaseMsgRegisterContractResponse(); + return message; + }, + fromAmino(_: MsgRegisterContractResponseAmino): MsgRegisterContractResponse { + const message = createBaseMsgRegisterContractResponse(); + return message; + }, + toAmino(_: MsgRegisterContractResponse): MsgRegisterContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterContractResponseAminoMsg): MsgRegisterContractResponse { + return MsgRegisterContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterContractResponseProtoMsg): MsgRegisterContractResponse { + return MsgRegisterContractResponse.decode(message.value); + }, + toProto(message: MsgRegisterContractResponse): Uint8Array { + return MsgRegisterContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterContractResponse): MsgRegisterContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse", + value: MsgRegisterContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRegisterContractResponse.typeUrl, MsgRegisterContractResponse); \ No newline at end of file diff --git a/libs/injective-query/src/injective/wasmx/v1/wasmx.ts b/libs/injective-query/src/injective/wasmx/v1/wasmx.ts new file mode 100644 index 00000000..3cb66691 --- /dev/null +++ b/libs/injective-query/src/injective/wasmx/v1/wasmx.ts @@ -0,0 +1,379 @@ +import { AccessConfig, AccessConfigAmino } from "../../../cosmwasm/wasm/v1/types"; +import { FundingMode } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** + * Set the status to active to indicate that contracts can be executed in + * begin blocker. + */ + isExecutionEnabled: boolean; + /** + * Maximum aggregate total gas to be used for the contract executions in the + * BeginBlocker. + */ + maxBeginBlockTotalGas: bigint; + /** + * the maximum gas limit each individual contract can consume in the + * BeginBlocker. + */ + maxContractGasLimit: bigint; + /** + * min_gas_price defines the minimum gas price the contracts must pay to be + * executed in the BeginBlocker. + */ + minGasPrice: bigint; + registerContractAccess: AccessConfig; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.wasmx.v1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * Set the status to active to indicate that contracts can be executed in + * begin blocker. + */ + is_execution_enabled: boolean; + /** + * Maximum aggregate total gas to be used for the contract executions in the + * BeginBlocker. + */ + max_begin_block_total_gas: string; + /** + * the maximum gas limit each individual contract can consume in the + * BeginBlocker. + */ + max_contract_gas_limit: string; + /** + * min_gas_price defines the minimum gas price the contracts must pay to be + * executed in the BeginBlocker. + */ + min_gas_price: string; + register_contract_access: AccessConfigAmino; +} +export interface ParamsAminoMsg { + type: "wasmx/Params"; + value: ParamsAmino; +} +export interface RegisteredContract { + /** limit of gas per BB execution */ + gasLimit: bigint; + /** gas price that contract is willing to pay for execution in BeginBlocker */ + gasPrice: bigint; + /** is contract currently active */ + isExecutable: boolean; + /** + * code_id that is allowed to be executed (to prevent malicious updates) - if + * nil/0 any code_id can be executed + */ + codeId?: bigint; + /** optional - admin addr that is allowed to update contract data */ + adminAddress?: string; + /** + * Optional: address of the contract granting fee + * Must be set if fund_mode is GrantOnly + */ + granterAddress?: string; + /** funding mode */ + fundMode: FundingMode; +} +export interface RegisteredContractProtoMsg { + typeUrl: "/injective.wasmx.v1.RegisteredContract"; + value: Uint8Array; +} +export interface RegisteredContractAmino { + /** limit of gas per BB execution */ + gas_limit: string; + /** gas price that contract is willing to pay for execution in BeginBlocker */ + gas_price: string; + /** is contract currently active */ + is_executable: boolean; + /** + * code_id that is allowed to be executed (to prevent malicious updates) - if + * nil/0 any code_id can be executed + */ + code_id?: string; + /** optional - admin addr that is allowed to update contract data */ + admin_address?: string; + /** + * Optional: address of the contract granting fee + * Must be set if fund_mode is GrantOnly + */ + granter_address?: string; + /** funding mode */ + fund_mode: FundingMode; +} +export interface RegisteredContractAminoMsg { + type: "/injective.wasmx.v1.RegisteredContract"; + value: RegisteredContractAmino; +} +function createBaseParams(): Params { + return { + isExecutionEnabled: false, + maxBeginBlockTotalGas: BigInt(0), + maxContractGasLimit: BigInt(0), + minGasPrice: BigInt(0), + registerContractAccess: AccessConfig.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/injective.wasmx.v1.Params", + aminoType: "wasmx/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.isExecutionEnabled === "boolean" && typeof o.maxBeginBlockTotalGas === "bigint" && typeof o.maxContractGasLimit === "bigint" && typeof o.minGasPrice === "bigint" && AccessConfig.is(o.registerContractAccess)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.is_execution_enabled === "boolean" && typeof o.max_begin_block_total_gas === "bigint" && typeof o.max_contract_gas_limit === "bigint" && typeof o.min_gas_price === "bigint" && AccessConfig.isAmino(o.register_contract_access)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isExecutionEnabled === true) { + writer.uint32(8).bool(message.isExecutionEnabled); + } + if (message.maxBeginBlockTotalGas !== BigInt(0)) { + writer.uint32(16).uint64(message.maxBeginBlockTotalGas); + } + if (message.maxContractGasLimit !== BigInt(0)) { + writer.uint32(24).uint64(message.maxContractGasLimit); + } + if (message.minGasPrice !== BigInt(0)) { + writer.uint32(32).uint64(message.minGasPrice); + } + if (message.registerContractAccess !== undefined) { + AccessConfig.encode(message.registerContractAccess, writer.uint32(42).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.isExecutionEnabled = reader.bool(); + break; + case 2: + message.maxBeginBlockTotalGas = reader.uint64(); + break; + case 3: + message.maxContractGasLimit = reader.uint64(); + break; + case 4: + message.minGasPrice = reader.uint64(); + break; + case 5: + message.registerContractAccess = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.isExecutionEnabled = object.isExecutionEnabled ?? false; + message.maxBeginBlockTotalGas = object.maxBeginBlockTotalGas !== undefined && object.maxBeginBlockTotalGas !== null ? BigInt(object.maxBeginBlockTotalGas.toString()) : BigInt(0); + message.maxContractGasLimit = object.maxContractGasLimit !== undefined && object.maxContractGasLimit !== null ? BigInt(object.maxContractGasLimit.toString()) : BigInt(0); + message.minGasPrice = object.minGasPrice !== undefined && object.minGasPrice !== null ? BigInt(object.minGasPrice.toString()) : BigInt(0); + message.registerContractAccess = object.registerContractAccess !== undefined && object.registerContractAccess !== null ? AccessConfig.fromPartial(object.registerContractAccess) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.is_execution_enabled !== undefined && object.is_execution_enabled !== null) { + message.isExecutionEnabled = object.is_execution_enabled; + } + if (object.max_begin_block_total_gas !== undefined && object.max_begin_block_total_gas !== null) { + message.maxBeginBlockTotalGas = BigInt(object.max_begin_block_total_gas); + } + if (object.max_contract_gas_limit !== undefined && object.max_contract_gas_limit !== null) { + message.maxContractGasLimit = BigInt(object.max_contract_gas_limit); + } + if (object.min_gas_price !== undefined && object.min_gas_price !== null) { + message.minGasPrice = BigInt(object.min_gas_price); + } + if (object.register_contract_access !== undefined && object.register_contract_access !== null) { + message.registerContractAccess = AccessConfig.fromAmino(object.register_contract_access); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.is_execution_enabled = message.isExecutionEnabled === false ? undefined : message.isExecutionEnabled; + obj.max_begin_block_total_gas = message.maxBeginBlockTotalGas !== BigInt(0) ? message.maxBeginBlockTotalGas?.toString() : undefined; + obj.max_contract_gas_limit = message.maxContractGasLimit !== BigInt(0) ? message.maxContractGasLimit?.toString() : undefined; + obj.min_gas_price = message.minGasPrice !== BigInt(0) ? message.minGasPrice?.toString() : undefined; + obj.register_contract_access = message.registerContractAccess ? AccessConfig.toAmino(message.registerContractAccess) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "wasmx/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: "/injective.wasmx.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseRegisteredContract(): RegisteredContract { + return { + gasLimit: BigInt(0), + gasPrice: BigInt(0), + isExecutable: false, + codeId: undefined, + adminAddress: undefined, + granterAddress: undefined, + fundMode: 0 + }; +} +export const RegisteredContract = { + typeUrl: "/injective.wasmx.v1.RegisteredContract", + is(o: any): o is RegisteredContract { + return o && (o.$typeUrl === RegisteredContract.typeUrl || typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint" && typeof o.isExecutable === "boolean" && isSet(o.fundMode)); + }, + isAmino(o: any): o is RegisteredContractAmino { + return o && (o.$typeUrl === RegisteredContract.typeUrl || typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint" && typeof o.is_executable === "boolean" && isSet(o.fund_mode)); + }, + encode(message: RegisteredContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasLimit !== BigInt(0)) { + writer.uint32(8).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(16).uint64(message.gasPrice); + } + if (message.isExecutable === true) { + writer.uint32(24).bool(message.isExecutable); + } + if (message.codeId !== undefined) { + writer.uint32(32).uint64(message.codeId); + } + if (message.adminAddress !== undefined) { + writer.uint32(42).string(message.adminAddress); + } + if (message.granterAddress !== undefined) { + writer.uint32(50).string(message.granterAddress); + } + if (message.fundMode !== 0) { + writer.uint32(56).int32(message.fundMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisteredContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasLimit = reader.uint64(); + break; + case 2: + message.gasPrice = reader.uint64(); + break; + case 3: + message.isExecutable = reader.bool(); + break; + case 4: + message.codeId = reader.uint64(); + break; + case 5: + message.adminAddress = reader.string(); + break; + case 6: + message.granterAddress = reader.string(); + break; + case 7: + message.fundMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RegisteredContract { + const message = createBaseRegisteredContract(); + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.isExecutable = object.isExecutable ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : undefined; + message.adminAddress = object.adminAddress ?? undefined; + message.granterAddress = object.granterAddress ?? undefined; + message.fundMode = object.fundMode ?? 0; + return message; + }, + fromAmino(object: RegisteredContractAmino): RegisteredContract { + const message = createBaseRegisteredContract(); + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.is_executable !== undefined && object.is_executable !== null) { + message.isExecutable = object.is_executable; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.fund_mode !== undefined && object.fund_mode !== null) { + message.fundMode = object.fund_mode; + } + return message; + }, + toAmino(message: RegisteredContract): RegisteredContractAmino { + const obj: any = {}; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.is_executable = message.isExecutable === false ? undefined : message.isExecutable; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === null ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === null ? undefined : message.granterAddress; + obj.fund_mode = message.fundMode === 0 ? undefined : message.fundMode; + return obj; + }, + fromAminoMsg(object: RegisteredContractAminoMsg): RegisteredContract { + return RegisteredContract.fromAmino(object.value); + }, + fromProtoMsg(message: RegisteredContractProtoMsg): RegisteredContract { + return RegisteredContract.decode(message.value); + }, + toProto(message: RegisteredContract): Uint8Array { + return RegisteredContract.encode(message).finish(); + }, + toProtoMsg(message: RegisteredContract): RegisteredContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.RegisteredContract", + value: RegisteredContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RegisteredContract.typeUrl, RegisteredContract); \ No newline at end of file diff --git a/libs/injective-query/src/react-query.ts b/libs/injective-query/src/react-query.ts new file mode 100644 index 00000000..99221124 --- /dev/null +++ b/libs/injective-query/src/react-query.ts @@ -0,0 +1,185 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + + import { getRpcClient } from './extern' +import { + isRpc, + Rpc, +} from './helpers' +import { + ITxArgs, + ISigningClient, + StdFee, + DeliverTxResponse, + SigningClientResolver, + RpcResolver, + isISigningClient +} from './helper-func-types' +import { + useQuery, + useQueryClient, + UseQueryOptions, + useMutation, + UseMutationOptions, + QueryKey, +} from '@tanstack/react-query'; + +import { HttpEndpoint } from "@interchainjs/types"; +import { Rpc as ProtobufRpcClient } from "./helpers"; + +export const DEFAULT_RPC_CLIENT_QUERY_KEY = 'rpcClient'; +export const DEFAULT_RPC_ENDPOINT_QUERY_KEY = 'rpcEndPoint'; +export const DEFAULT_SIGNING_CLIENT_QUERY_KEY = 'signingClient'; + +export interface CacheResolver { + rpcEndpoint?: string | HttpEndpoint; + clientQueryKey?: string; +} + +export function isCacheResolver(resolver: unknown) : resolver is CacheResolver { + return resolver !== null && resolver !== undefined && (resolver as CacheResolver).rpcEndpoint !== undefined && (resolver as CacheResolver).clientQueryKey !== undefined; +} + +export interface ReactQueryParams { + options?: UseQueryOptions; +} + +export interface UseRpcClientQuery extends ReactQueryParams { + clientResolver?: CacheResolver; +} + + +export interface UseRpcEndpointQuery extends ReactQueryParams { + getter: () => Promise; + rpcEndPointKey?: string; +} + +export const useRpcEndpoint = ({ + getter, + options, + rpcEndPointKey, +}: UseRpcEndpointQuery) => { + const key = rpcEndPointKey || DEFAULT_RPC_ENDPOINT_QUERY_KEY; + return useQuery([key, getter], async () => { + return await getter(); + }, options); +}; + +export const useRpcClient = ({ + options, + clientResolver +}: UseRpcClientQuery) => { + const queryClient = useQueryClient({ + context: options?.context + }); + + const key = clientResolver?.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + return useQuery([key, clientResolver?.rpcEndpoint], async () => { + if(!clientResolver?.rpcEndpoint) { + throw new Error('rpcEndpoint is required'); + } + + const client = await getRpcClient(clientResolver.rpcEndpoint); + if(!client) { + throw new Error('Failed to connect to rpc client'); + } + + queryClient.setQueryData([key], client); + + return client; + }, options); +}; + +export interface UseQueryBuilderOptions { + builderQueryFn: (clientResolver?: RpcResolver) => (request: TReq) => Promise, + queryKeyPrefix: string, +} + + +export function buildUseQuery(opts: UseQueryBuilderOptions) { + return ({ + request, + options, + clientResolver, + customizedQueryKey, + }: UseQueryParams) => { + const queryClient = useQueryClient({ + context: options?.context + }); + + let rpcResolver: RpcResolver | undefined; + + if(isRpc(clientResolver)) { + rpcResolver = clientResolver; + } else if(isCacheResolver(clientResolver)) { + const key = clientResolver.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint ? [key, clientResolver.rpcEndpoint] : [key]; + rpcResolver = queryClient.getQueryData(queryKey); + + if(!rpcResolver && clientResolver.rpcEndpoint) { + rpcResolver = clientResolver.rpcEndpoint; + } + } else { + rpcResolver = clientResolver; + } + + const queryFn = opts.builderQueryFn(rpcResolver); + return useQuery(customizedQueryKey || [opts.queryKeyPrefix, request], () => queryFn(request), options); + }; +} + +export interface UseQueryParams extends ReactQueryParams { + request: TReq; + clientResolver?: CacheResolver | RpcResolver; + customizedQueryKey?: QueryKey +} + +export interface ReactMutationParams { + options?: UseMutationOptions; + clientResolver?: CacheResolver | SigningClientResolver; +} + + +export interface UseMutationBuilderOptions { + builderMutationFn: (clientResolver?: SigningClientResolver) => ( + signerAddress: string, + message: TMsg, + fee: StdFee | 'auto', + memo: string + ) => Promise, +} + + +export function buildUseMutation(opts: UseMutationBuilderOptions) { + return ({ + options, + clientResolver + }: ReactMutationParams>) => { + const queryClient = useQueryClient({ + context: options?.context + }); + + let signingClientResolver: SigningClientResolver | undefined; + + if(isISigningClient(clientResolver)) { + signingClientResolver = clientResolver; + } else if(isCacheResolver(clientResolver)) { + const key = clientResolver.clientQueryKey || DEFAULT_SIGNING_CLIENT_QUERY_KEY; + const queryKey = clientResolver.rpcEndpoint ? [key, clientResolver.rpcEndpoint] : [key]; + signingClientResolver = queryClient.getQueryData(queryKey); + } else { + clientResolver = clientResolver; + } + + const mutationFn = opts.builderMutationFn(signingClientResolver); + + return useMutation>( + (reqData: ITxArgs) => mutationFn(reqData.signerAddress, reqData.message, reqData.fee, reqData.memo), + options as Omit, unknown>, "mutationFn"> + ); + }; +} diff --git a/libs/injective-query/src/registry.ts b/libs/injective-query/src/registry.ts new file mode 100644 index 00000000..d78fce75 --- /dev/null +++ b/libs/injective-query/src/registry.ts @@ -0,0 +1,218 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + +import { BinaryReader } from "./binary"; +import { Any, AnyAmino } from "./google/protobuf/any"; +import { IProtoType, TelescopeGeneratedCodec } from "./types"; + +export class GlobalDecoderRegistry { + static registry: { + [key: string]: TelescopeGeneratedCodec; + } = {}; + + static aminoProtoMapping: { + [key: string]: string; + } = {}; + + static registerAminoProtoMapping(aminoType: string, typeUrl: string) { + GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl; + } + + static register( + key: string, + decoder: TelescopeGeneratedCodec + ) { + GlobalDecoderRegistry.registry[key] = decoder; + } + static getDecoder( + key: string + ): TelescopeGeneratedCodec { + return GlobalDecoderRegistry.registry[key]; + } + static getDecoderByInstance( + obj: unknown + ): TelescopeGeneratedCodec | null { + if (obj === undefined || obj === null) { + return null; + } + const protoType = obj as IProtoType; + + if (protoType.$typeUrl) { + return GlobalDecoderRegistry.getDecoder( + protoType.$typeUrl + ); + } + + for (const key in GlobalDecoderRegistry.registry) { + if ( + Object.prototype.hasOwnProperty.call( + GlobalDecoderRegistry.registry, + key + ) + ) { + const element = GlobalDecoderRegistry.registry[key]; + + if (element.is!(obj)) { + return element; + } + + if (element.isSDK && element.isSDK(obj)) { + return element; + } + + if (element.isAmino && element.isAmino(obj)) { + return element; + } + } + } + + return null; + } + static getDecoderByAminoType( + type: string + ): TelescopeGeneratedCodec | null { + if (type === undefined || type === null) { + return null; + } + + const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type]; + + if (!typeUrl) { + return null; + } + + return GlobalDecoderRegistry.getDecoder(typeUrl); + } + static wrapAny(obj: unknown): Any { + if(Any.is(obj)){ + return obj; + } + + const decoder = getDecoderByInstance(obj); + + return { + typeUrl: decoder.typeUrl, + value: decoder.encode(obj).finish(), + }; + } + static unwrapAny(input: BinaryReader | Uint8Array | Any) { + let data; + + if (Any.is(input)) { + data = input; + } else { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + + data = Any.decode(reader, reader.uint32()); + } + + const decoder = GlobalDecoderRegistry.getDecoder( + data.typeUrl + ); + + if (!decoder) { + return data; + } + + return decoder.decode(data.value); + } + static fromJSON(object: any): T { + const decoder = getDecoderByInstance(object); + return decoder.fromJSON!(object); + } + static toJSON(message: T): any { + const decoder = getDecoderByInstance(message); + return decoder.toJSON!(message); + } + static fromPartial(object: unknown): T { + const decoder = getDecoderByInstance(object); + return decoder ? decoder.fromPartial(object) : (object as T); + } + static fromSDK(object: SDK): T { + const decoder = getDecoderByInstance(object); + return decoder.fromSDK!(object); + } + static fromSDKJSON(object: any): SDK { + const decoder = getDecoderByInstance(object); + return decoder.fromSDKJSON!(object); + } + static toSDK(object: T): SDK { + const decoder = getDecoderByInstance(object); + return decoder.toSDK!(object); + } + static fromAmino(object: Amino): T { + const decoder = getDecoderByInstance(object); + return decoder.fromAmino!(object); + } + static fromAminoMsg(object: AnyAmino): T { + const decoder = GlobalDecoderRegistry.getDecoderByAminoType< + T, + unknown, + Amino + >(object.type); + + if (!decoder) { + throw new Error(`There's no decoder for the amino type ${object.type}`); + } + + return decoder.fromAminoMsg!(object); + } + static toAmino(object: T): Amino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAmino!(data); + } + static toAminoMsg(object: T): AnyAmino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAminoMsg!(data); + } +} + +function getDecoderByInstance( + obj: unknown +): TelescopeGeneratedCodec { + const decoder = GlobalDecoderRegistry.getDecoderByInstance( + obj + ); + + if (!decoder) { + throw new Error( + `There's no decoder for the instance ${JSON.stringify(obj)}` + ); + } + + return decoder; +} + +GlobalDecoderRegistry.register(Any.typeUrl, Any); diff --git a/libs/injective-query/src/tendermint/abci/types.ts b/libs/injective-query/src/tendermint/abci/types.ts new file mode 100644 index 00000000..4759afd1 --- /dev/null +++ b/libs/injective-query/src/tendermint/abci/types.ts @@ -0,0 +1,6283 @@ +import { Timestamp } from "../../google/protobuf/timestamp"; +import { ConsensusParams, ConsensusParamsAmino } from "../types/params"; +import { ProofOps, ProofOpsAmino } from "../crypto/proof"; +import { PublicKey, PublicKeyAmino } from "../crypto/keys"; +import { BlockIDFlag } from "../types/validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} +export const CheckTxTypeAmino = CheckTxType; +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + case CheckTxType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} +export const ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result; +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + case ResponseOfferSnapshot_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} +export const ResponseApplySnapshotChunk_ResultAmino = ResponseApplySnapshotChunk_Result; +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +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_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 MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { + switch (object) { + case 0: + case "UNKNOWN": + return MisbehaviorType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return MisbehaviorType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return MisbehaviorType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return MisbehaviorType.UNRECOGNIZED; + } +} +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { + switch (object) { + case MisbehaviorType.UNKNOWN: + return "UNKNOWN"; + case MisbehaviorType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case MisbehaviorType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + case MisbehaviorType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Request { + echo?: RequestEcho; + flush?: RequestFlush; + info?: RequestInfo; + initChain?: RequestInitChain; + query?: RequestQuery; + checkTx?: RequestCheckTx; + 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"; + value: Uint8Array; +} +export interface RequestAmino { + echo?: RequestEchoAmino; + flush?: RequestFlushAmino; + info?: RequestInfoAmino; + init_chain?: RequestInitChainAmino; + query?: RequestQueryAmino; + check_tx?: RequestCheckTxAmino; + 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"; + value: RequestAmino; +} +export interface RequestEcho { + message: string; +} +export interface RequestEchoProtoMsg { + typeUrl: "/tendermint.abci.RequestEcho"; + value: Uint8Array; +} +export interface RequestEchoAmino { + message: string; +} +export interface RequestEchoAminoMsg { + type: "/tendermint.abci.RequestEcho"; + value: RequestEchoAmino; +} +export interface RequestFlush {} +export interface RequestFlushProtoMsg { + typeUrl: "/tendermint.abci.RequestFlush"; + value: Uint8Array; +} +export interface RequestFlushAmino {} +export interface RequestFlushAminoMsg { + type: "/tendermint.abci.RequestFlush"; + value: RequestFlushAmino; +} +export interface RequestInfo { + version: string; + blockVersion: bigint; + p2pVersion: bigint; + abciVersion: string; +} +export interface RequestInfoProtoMsg { + typeUrl: "/tendermint.abci.RequestInfo"; + value: Uint8Array; +} +export interface RequestInfoAmino { + version: string; + block_version: string; + p2p_version: string; + abci_version: string; +} +export interface RequestInfoAminoMsg { + type: "/tendermint.abci.RequestInfo"; + value: RequestInfoAmino; +} +export interface RequestInitChain { + time: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: bigint; +} +export interface RequestInitChainProtoMsg { + typeUrl: "/tendermint.abci.RequestInitChain"; + value: Uint8Array; +} +export interface RequestInitChainAmino { + time: string; + chain_id: string; + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_state_bytes: string; + initial_height: string; +} +export interface RequestInitChainAminoMsg { + type: "/tendermint.abci.RequestInitChain"; + value: RequestInitChainAmino; +} +export interface RequestQuery { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +export interface RequestQueryProtoMsg { + typeUrl: "/tendermint.abci.RequestQuery"; + value: Uint8Array; +} +export interface RequestQueryAmino { + data: string; + path: string; + height: string; + prove: boolean; +} +export interface RequestQueryAminoMsg { + type: "/tendermint.abci.RequestQuery"; + value: RequestQueryAmino; +} +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestCheckTxProtoMsg { + typeUrl: "/tendermint.abci.RequestCheckTx"; + value: Uint8Array; +} +export interface RequestCheckTxAmino { + tx: string; + type: CheckTxType; +} +export interface RequestCheckTxAminoMsg { + type: "/tendermint.abci.RequestCheckTx"; + value: RequestCheckTxAmino; +} +export interface RequestCommit {} +export interface RequestCommitProtoMsg { + typeUrl: "/tendermint.abci.RequestCommit"; + value: Uint8Array; +} +export interface RequestCommitAmino {} +export interface RequestCommitAminoMsg { + type: "/tendermint.abci.RequestCommit"; + value: RequestCommitAmino; +} +/** lists available snapshots */ +export interface RequestListSnapshots {} +export interface RequestListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.RequestListSnapshots"; + value: Uint8Array; +} +/** lists available snapshots */ +export interface RequestListSnapshotsAmino {} +export interface RequestListSnapshotsAminoMsg { + type: "/tendermint.abci.RequestListSnapshots"; + value: RequestListSnapshotsAmino; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} +export interface RequestOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.RequestOfferSnapshot"; + value: Uint8Array; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotAmino { + /** snapshot offered by peers */ + snapshot?: SnapshotAmino; + /** light client-verified app hash for snapshot height */ + app_hash: string; +} +export interface RequestOfferSnapshotAminoMsg { + type: "/tendermint.abci.RequestOfferSnapshot"; + value: RequestOfferSnapshotAmino; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: bigint; + format: number; + chunk: number; +} +export interface RequestLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkAmino { + height: string; + format: number; + chunk: number; +} +export interface RequestLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: RequestLoadSnapshotChunkAmino; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface RequestApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; + value: Uint8Array; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkAmino { + index: number; + chunk: string; + sender: string; +} +export interface RequestApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestApplySnapshotChunk"; + value: RequestApplySnapshotChunkAmino; +} +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 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; +} +/** 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; +} +/** 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; +} +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 Response { + exception?: ResponseException; + echo?: ResponseEcho; + flush?: ResponseFlush; + info?: ResponseInfo; + initChain?: ResponseInitChain; + query?: ResponseQuery; + checkTx?: ResponseCheckTx; + 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"; + value: Uint8Array; +} +export interface ResponseAmino { + exception?: ResponseExceptionAmino; + echo?: ResponseEchoAmino; + flush?: ResponseFlushAmino; + info?: ResponseInfoAmino; + init_chain?: ResponseInitChainAmino; + query?: ResponseQueryAmino; + check_tx?: ResponseCheckTxAmino; + 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"; + value: ResponseAmino; +} +/** nondeterministic */ +export interface ResponseException { + error: string; +} +export interface ResponseExceptionProtoMsg { + typeUrl: "/tendermint.abci.ResponseException"; + value: Uint8Array; +} +/** nondeterministic */ +export interface ResponseExceptionAmino { + error: string; +} +export interface ResponseExceptionAminoMsg { + type: "/tendermint.abci.ResponseException"; + value: ResponseExceptionAmino; +} +export interface ResponseEcho { + message: string; +} +export interface ResponseEchoProtoMsg { + typeUrl: "/tendermint.abci.ResponseEcho"; + value: Uint8Array; +} +export interface ResponseEchoAmino { + message: string; +} +export interface ResponseEchoAminoMsg { + type: "/tendermint.abci.ResponseEcho"; + value: ResponseEchoAmino; +} +export interface ResponseFlush {} +export interface ResponseFlushProtoMsg { + typeUrl: "/tendermint.abci.ResponseFlush"; + value: Uint8Array; +} +export interface ResponseFlushAmino {} +export interface ResponseFlushAminoMsg { + type: "/tendermint.abci.ResponseFlush"; + value: ResponseFlushAmino; +} +export interface ResponseInfo { + data: string; + version: string; + appVersion: bigint; + lastBlockHeight: bigint; + lastBlockAppHash: Uint8Array; +} +export interface ResponseInfoProtoMsg { + typeUrl: "/tendermint.abci.ResponseInfo"; + value: Uint8Array; +} +export interface ResponseInfoAmino { + data: string; + version: string; + app_version: string; + last_block_height: string; + last_block_app_hash: string; +} +export interface ResponseInfoAminoMsg { + type: "/tendermint.abci.ResponseInfo"; + value: ResponseInfoAmino; +} +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} +export interface ResponseInitChainProtoMsg { + typeUrl: "/tendermint.abci.ResponseInitChain"; + value: Uint8Array; +} +export interface ResponseInitChainAmino { + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_hash: string; +} +export interface ResponseInitChainAminoMsg { + type: "/tendermint.abci.ResponseInitChain"; + value: ResponseInitChainAmino; +} +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: bigint; + codespace: string; +} +export interface ResponseQueryProtoMsg { + typeUrl: "/tendermint.abci.ResponseQuery"; + value: Uint8Array; +} +export interface ResponseQueryAmino { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: string; + key: string; + value: string; + proof_ops?: ProofOpsAmino; + height: string; + codespace: string; +} +export interface ResponseQueryAminoMsg { + type: "/tendermint.abci.ResponseQuery"; + value: ResponseQueryAmino; +} +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: bigint; + gasUsed: bigint; + events: Event[]; + codespace: string; +} +export interface ResponseCheckTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseCheckTx"; + value: Uint8Array; +} +export interface ResponseCheckTxAmino { + code: number; + data: string; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gas_wanted: string; + gas_used: string; + events: EventAmino[]; + codespace: string; +} +export interface ResponseCheckTxAminoMsg { + type: "/tendermint.abci.ResponseCheckTx"; + value: ResponseCheckTxAmino; +} +export interface ResponseCommit { + retainHeight: bigint; +} +export interface ResponseCommitProtoMsg { + typeUrl: "/tendermint.abci.ResponseCommit"; + value: Uint8Array; +} +export interface ResponseCommitAmino { + retain_height: string; +} +export interface ResponseCommitAminoMsg { + type: "/tendermint.abci.ResponseCommit"; + value: ResponseCommitAmino; +} +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} +export interface ResponseListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.ResponseListSnapshots"; + value: Uint8Array; +} +export interface ResponseListSnapshotsAmino { + snapshots: SnapshotAmino[]; +} +export interface ResponseListSnapshotsAminoMsg { + type: "/tendermint.abci.ResponseListSnapshots"; + value: ResponseListSnapshotsAmino; +} +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; + value: Uint8Array; +} +export interface ResponseOfferSnapshotAmino { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotAminoMsg { + type: "/tendermint.abci.ResponseOfferSnapshot"; + value: ResponseOfferSnapshotAmino; +} +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} +export interface ResponseLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: Uint8Array; +} +export interface ResponseLoadSnapshotChunkAmino { + chunk: string; +} +export interface ResponseLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: ResponseLoadSnapshotChunkAmino; +} +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} +export interface ResponseApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: Uint8Array; +} +export interface ResponseApplySnapshotChunkAmino { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetch_chunks: number[]; + /** Chunk senders to reject and ban */ + reject_senders: string[]; +} +export interface ResponseApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: ResponseApplySnapshotChunkAmino; +} +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; + value: Uint8Array; +} +export interface ResponsePrepareProposalAmino { + txs: string[]; +} +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; + value: Uint8Array; +} +export interface ResponseProcessProposalAmino { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; +} +export interface ResponseExtendVote { + voteExtension: Uint8Array; +} +export interface ResponseExtendVoteProtoMsg { + typeUrl: "/tendermint.abci.ResponseExtendVote"; + value: Uint8Array; +} +export interface ResponseExtendVoteAmino { + vote_extension: string; +} +export interface ResponseExtendVoteAminoMsg { + type: "/tendermint.abci.ResponseExtendVote"; + value: ResponseExtendVoteAmino; +} +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 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 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; +} +/** + * 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; +} +/** + * Event allows application developers to attach additional information to + * ResponseFinalizeBlock and ResponseCheckTx. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string; + attributes: EventAttribute[]; +} +export interface EventProtoMsg { + typeUrl: "/tendermint.abci.Event"; + value: Uint8Array; +} +/** + * Event allows application developers to attach additional information to + * ResponseFinalizeBlock and ResponseCheckTx. + * Later, transactions may be queried using these events. + */ +export interface EventAmino { + type: string; + attributes: EventAttributeAmino[]; +} +export interface EventAminoMsg { + type: "/tendermint.abci.Event"; + value: EventAmino; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: string; + value: string; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeProtoMsg { + typeUrl: "/tendermint.abci.EventAttribute"; + value: Uint8Array; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeAmino { + key: string; + value: string; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeAminoMsg { + type: "/tendermint.abci.EventAttribute"; + value: EventAttributeAmino; +} +/** + * 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; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: bigint; + index: number; + tx: Uint8Array; + result: ExecTxResult; +} +export interface TxResultProtoMsg { + typeUrl: "/tendermint.abci.TxResult"; + value: Uint8Array; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultAmino { + height: string; + index: number; + tx: string; + result: ExecTxResultAmino; +} +export interface TxResultAminoMsg { + type: "/tendermint.abci.TxResult"; + value: TxResultAmino; +} +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.abci.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + /** The first 20 bytes of SHA256(public key) */ + address: string; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.abci.Validator"; + value: ValidatorAmino; +} +export interface ValidatorUpdate { + pubKey: PublicKey; + power: bigint; +} +export interface ValidatorUpdateProtoMsg { + typeUrl: "/tendermint.abci.ValidatorUpdate"; + value: Uint8Array; +} +export interface ValidatorUpdateAmino { + pub_key: PublicKeyAmino; + power: string; +} +export interface ValidatorUpdateAminoMsg { + type: "/tendermint.abci.ValidatorUpdate"; + value: ValidatorUpdateAmino; +} +export interface VoteInfo { + validator: Validator; + blockIdFlag: BlockIDFlag; +} +export interface VoteInfoProtoMsg { + typeUrl: "/tendermint.abci.VoteInfo"; + value: Uint8Array; +} +export interface VoteInfoAmino { + validator: ValidatorAmino; + block_id_flag: BlockIDFlag; +} +export interface VoteInfoAminoMsg { + type: "/tendermint.abci.VoteInfo"; + value: VoteInfoAmino; +} +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 Misbehavior { + type: MisbehaviorType; + /** The offending validator */ + validator: Validator; + /** The height when the offense occurred */ + height: bigint; + /** The corresponding time where the offense occurred */ + time: Date; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: bigint; +} +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; + value: Uint8Array; +} +export interface MisbehaviorAmino { + type: MisbehaviorType; + /** The offending validator */ + validator: ValidatorAmino; + /** The height when the offense occurred */ + height: string; + /** The corresponding time where the offense occurred */ + time: string; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + total_voting_power: string; +} +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; +} +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: bigint; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} +export interface SnapshotProtoMsg { + typeUrl: "/tendermint.abci.Snapshot"; + value: Uint8Array; +} +export interface SnapshotAmino { + /** The height at which the snapshot was taken */ + height: string; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: string; + /** Arbitrary application metadata */ + metadata: string; +} +export interface SnapshotAminoMsg { + type: "/tendermint.abci.Snapshot"; + value: SnapshotAmino; +} +function createBaseRequest(): Request { + return { + 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 Request = { + typeUrl: "/tendermint.abci.Request", + is(o: any): o is Request { + return o && o.$typeUrl === Request.typeUrl; + }, + isAmino(o: any): o is RequestAmino { + return o && o.$typeUrl === Request.typeUrl; + }, + encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).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.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.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 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Request { + const message = createBaseRequest(); + 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.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.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : 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 { + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + 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.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + 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 { + const obj: any = {}; + 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.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; + obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; + obj.check_tx = message.checkTx ? RequestCheckTx.toAmino(message.checkTx) : 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 { + return Request.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProtoMsg): Request { + return Request.decode(message.value); + }, + toProto(message: Request): Uint8Array { + return Request.encode(message).finish(); + }, + toProtoMsg(message: Request): RequestProtoMsg { + return { + typeUrl: "/tendermint.abci.Request", + value: Request.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Request.typeUrl, Request); +function createBaseRequestEcho(): RequestEcho { + return { + message: "" + }; +} +export const RequestEcho = { + typeUrl: "/tendermint.abci.RequestEcho", + is(o: any): o is RequestEcho { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is RequestEchoAmino { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestEcho { + const message = createBaseRequestEcho(); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: RequestEchoAmino): RequestEcho { + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: RequestEcho): RequestEchoAmino { + const obj: any = {}; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { + return RequestEcho.fromAmino(object.value); + }, + fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { + return RequestEcho.decode(message.value); + }, + toProto(message: RequestEcho): Uint8Array { + return RequestEcho.encode(message).finish(); + }, + toProtoMsg(message: RequestEcho): RequestEchoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestEcho", + value: RequestEcho.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestEcho.typeUrl, RequestEcho); +function createBaseRequestFlush(): RequestFlush { + return {}; +} +export const RequestFlush = { + typeUrl: "/tendermint.abci.RequestFlush", + is(o: any): o is RequestFlush { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + isAmino(o: any): o is RequestFlushAmino { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + fromAmino(_: RequestFlushAmino): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + toAmino(_: RequestFlush): RequestFlushAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { + return RequestFlush.fromAmino(object.value); + }, + fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { + return RequestFlush.decode(message.value); + }, + toProto(message: RequestFlush): Uint8Array { + return RequestFlush.encode(message).finish(); + }, + toProtoMsg(message: RequestFlush): RequestFlushProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestFlush", + value: RequestFlush.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestFlush.typeUrl, RequestFlush); +function createBaseRequestInfo(): RequestInfo { + return { + version: "", + blockVersion: BigInt(0), + p2pVersion: BigInt(0), + abciVersion: "" + }; +} +export const RequestInfo = { + typeUrl: "/tendermint.abci.RequestInfo", + is(o: any): o is RequestInfo { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.blockVersion === "bigint" && typeof o.p2pVersion === "bigint" && typeof o.abciVersion === "string"); + }, + isAmino(o: any): o is RequestInfoAmino { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.block_version === "bigint" && typeof o.p2p_version === "bigint" && typeof o.abci_version === "string"); + }, + encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.blockVersion !== BigInt(0)) { + writer.uint32(16).uint64(message.blockVersion); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + case 4: + message.abciVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestInfo { + const message = createBaseRequestInfo(); + 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 { + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + 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 { + const obj: any = {}; + 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 { + return RequestInfo.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { + return RequestInfo.decode(message.value); + }, + toProto(message: RequestInfo): Uint8Array { + return RequestInfo.encode(message).finish(); + }, + toProtoMsg(message: RequestInfo): RequestInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInfo", + value: RequestInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestInfo.typeUrl, RequestInfo); +function createBaseRequestInitChain(): RequestInitChain { + return { + time: new Date(), + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: BigInt(0) + }; +} +export const RequestInitChain = { + typeUrl: "/tendermint.abci.RequestInitChain", + is(o: any): o is RequestInitChain { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.is(o.time) && typeof o.chainId === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appStateBytes instanceof Uint8Array || typeof o.appStateBytes === "string") && typeof o.initialHeight === "bigint"); + }, + isAmino(o: any): o is RequestInitChainAmino { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.isAmino(o.time) && typeof o.chain_id === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_state_bytes instanceof Uint8Array || typeof o.app_state_bytes === "string") && typeof o.initial_height === "bigint"); + }, + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (message.initialHeight !== BigInt(0)) { + writer.uint32(48).int64(message.initialHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestInitChain { + const message = createBaseRequestInitChain(); + message.time = object.time ?? undefined; + message.chainId = object.chainId ?? ""; + message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; + message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appStateBytes = object.appStateBytes ?? new Uint8Array(); + message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? BigInt(object.initialHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RequestInitChainAmino): RequestInitChain { + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + 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_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; + }, + toAmino(message: RequestInitChain): RequestInitChainAmino { + const obj: any = {}; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + 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_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; + obj.initial_height = message.initialHeight !== BigInt(0) ? message.initialHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { + return RequestInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { + return RequestInitChain.decode(message.value); + }, + toProto(message: RequestInitChain): Uint8Array { + return RequestInitChain.encode(message).finish(); + }, + toProtoMsg(message: RequestInitChain): RequestInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInitChain", + value: RequestInitChain.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestInitChain.typeUrl, RequestInitChain); +function createBaseRequestQuery(): RequestQuery { + return { + data: new Uint8Array(), + path: "", + height: BigInt(0), + prove: false + }; +} +export const RequestQuery = { + typeUrl: "/tendermint.abci.RequestQuery", + is(o: any): o is RequestQuery { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + isAmino(o: any): o is RequestQueryAmino { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + encode(message: RequestQuery, 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): RequestQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestQuery(); + 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: DeepPartial): RequestQuery { + const message = createBaseRequestQuery(); + 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: RequestQueryAmino): RequestQuery { + const message = createBaseRequestQuery(); + 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: RequestQuery): RequestQueryAmino { + 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: RequestQueryAminoMsg): RequestQuery { + return RequestQuery.fromAmino(object.value); + }, + fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { + return RequestQuery.decode(message.value); + }, + toProto(message: RequestQuery): Uint8Array { + return RequestQuery.encode(message).finish(); + }, + toProtoMsg(message: RequestQuery): RequestQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestQuery", + value: RequestQuery.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestQuery.typeUrl, RequestQuery); +function createBaseRequestCheckTx(): RequestCheckTx { + return { + tx: new Uint8Array(), + type: 0 + }; +} +export const RequestCheckTx = { + typeUrl: "/tendermint.abci.RequestCheckTx", + is(o: any): o is RequestCheckTx { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + isAmino(o: any): o is RequestCheckTxAmino { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + 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: DeepPartial): 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; + return obj; + }, + fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { + return RequestCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { + return RequestCheckTx.decode(message.value); + }, + toProto(message: RequestCheckTx): Uint8Array { + return RequestCheckTx.encode(message).finish(); + }, + toProtoMsg(message: RequestCheckTx): RequestCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCheckTx", + value: RequestCheckTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestCheckTx.typeUrl, RequestCheckTx); +function createBaseRequestCommit(): RequestCommit { + return {}; +} +export const RequestCommit = { + typeUrl: "/tendermint.abci.RequestCommit", + is(o: any): o is RequestCommit { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + isAmino(o: any): o is RequestCommitAmino { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + fromAmino(_: RequestCommitAmino): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + toAmino(_: RequestCommit): RequestCommitAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { + return RequestCommit.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { + return RequestCommit.decode(message.value); + }, + toProto(message: RequestCommit): Uint8Array { + return RequestCommit.encode(message).finish(); + }, + toProtoMsg(message: RequestCommit): RequestCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCommit", + value: RequestCommit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestCommit.typeUrl, RequestCommit); +function createBaseRequestListSnapshots(): RequestListSnapshots { + return {}; +} +export const RequestListSnapshots = { + typeUrl: "/tendermint.abci.RequestListSnapshots", + is(o: any): o is RequestListSnapshots { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + isAmino(o: any): o is RequestListSnapshotsAmino { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { + return RequestListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { + return RequestListSnapshots.decode(message.value); + }, + toProto(message: RequestListSnapshots): Uint8Array { + return RequestListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: RequestListSnapshots): RequestListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestListSnapshots", + value: RequestListSnapshots.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestListSnapshots.typeUrl, RequestListSnapshots); +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { + snapshot: undefined, + appHash: new Uint8Array() + }; +} +export const RequestOfferSnapshot = { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + is(o: any): o is RequestOfferSnapshot { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.appHash instanceof Uint8Array || typeof o.appHash === "string"); + }, + isAmino(o: any): o is RequestOfferSnapshotAmino { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.app_hash instanceof Uint8Array || typeof o.app_hash === "string"); + }, + encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + message.snapshot = object.snapshot !== undefined && object.snapshot !== null ? Snapshot.fromPartial(object.snapshot) : undefined; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; + }, + toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { + const obj: any = {}; + obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.decode(message.value); + }, + toProto(message: RequestOfferSnapshot): Uint8Array { + return RequestOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: RequestOfferSnapshot): RequestOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + value: RequestOfferSnapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestOfferSnapshot.typeUrl, RequestOfferSnapshot); +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { + height: BigInt(0), + format: 0, + chunk: 0 + }; +} +export const RequestLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + is(o: any): o is RequestLoadSnapshotChunk { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + isAmino(o: any): o is RequestLoadSnapshotChunkAmino { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + encode(message: RequestLoadSnapshotChunk, 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.chunk !== 0) { + writer.uint32(24).uint32(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestLoadSnapshotChunk(); + 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.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.format = object.format ?? 0; + message.chunk = object.chunk ?? 0; + return message; + }, + fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + 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.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; + }, + toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunk = message.chunk === 0 ? undefined : message.chunk; + return obj; + }, + fromAminoMsg(object: RequestLoadSnapshotChunkAminoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestLoadSnapshotChunkProtoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.decode(message.value); + }, + toProto(message: RequestLoadSnapshotChunk): Uint8Array { + return RequestLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + value: RequestLoadSnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestLoadSnapshotChunk.typeUrl, RequestLoadSnapshotChunk); +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { + index: 0, + chunk: new Uint8Array(), + sender: "" + }; +} +export const RequestApplySnapshotChunk = { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + is(o: any): o is RequestApplySnapshotChunk { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + isAmino(o: any): o is RequestApplySnapshotChunkAmino { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + message.index = object.index ?? 0; + message.chunk = object.chunk ?? new Uint8Array(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: RequestApplySnapshotChunkAminoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestApplySnapshotChunkProtoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.decode(message.value); + }, + toProto(message: RequestApplySnapshotChunk): Uint8Array { + return RequestApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + value: RequestApplySnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestApplySnapshotChunk.typeUrl, RequestApplySnapshotChunk); +function createBaseRequestPrepareProposal(): RequestPrepareProposal { + return { + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + is(o: any): o is RequestPrepareProposal { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.maxTxBytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.is(o.localLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestPrepareProposalAmino { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.max_tx_bytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.isAmino(o.local_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); + } + for (const v of message.txs) { + writer.uint32(18).bytes(v!); + } + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + 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): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = reader.int64(); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: RequestPrepareProposalAmino): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); + } + 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); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + 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: RequestPrepareProposal): RequestPrepareProposalAmino { + const obj: any = {}; + 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: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); + }, + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestPrepareProposal.typeUrl, RequestPrepareProposal); +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + is(o: any): o is RequestProcessProposal { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.proposedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestProcessProposalAmino { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: RequestProcessProposal): RequestProcessProposalAmino { + const obj: any = {}; + 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: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); + }, + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestProcessProposal.typeUrl, RequestProcessProposal); +function createBaseRequestExtendVote(): RequestExtendVote { + return { + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestExtendVote = { + typeUrl: "/tendermint.abci.RequestExtendVote", + is(o: any): o is RequestExtendVote { + return o && (o.$typeUrl === RequestExtendVote.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.proposedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestExtendVoteAmino { + return o && (o.$typeUrl === RequestExtendVote.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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): RequestExtendVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestExtendVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: RequestExtendVote): RequestExtendVoteAmino { + const obj: any = {}; + 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: RequestExtendVoteAminoMsg): RequestExtendVote { + return RequestExtendVote.fromAmino(object.value); + }, + fromProtoMsg(message: RequestExtendVoteProtoMsg): RequestExtendVote { + return RequestExtendVote.decode(message.value); + }, + toProto(message: RequestExtendVote): Uint8Array { + return RequestExtendVote.encode(message).finish(); + }, + toProtoMsg(message: RequestExtendVote): RequestExtendVoteProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestExtendVote", + value: RequestExtendVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestExtendVote.typeUrl, RequestExtendVote); +function createBaseRequestVerifyVoteExtension(): RequestVerifyVoteExtension { + return { + hash: new Uint8Array(), + validatorAddress: new Uint8Array(), + height: BigInt(0), + voteExtension: new Uint8Array() + }; +} +export const RequestVerifyVoteExtension = { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + is(o: any): o is RequestVerifyVoteExtension { + return o && (o.$typeUrl === RequestVerifyVoteExtension.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && typeof o.height === "bigint" && (o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string")); + }, + isAmino(o: any): o is RequestVerifyVoteExtensionAmino { + return o && (o.$typeUrl === RequestVerifyVoteExtension.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.height === "bigint" && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string")); + }, + 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): RequestVerifyVoteExtension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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(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(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: RequestVerifyVoteExtensionAminoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.fromAmino(object.value); + }, + fromProtoMsg(message: RequestVerifyVoteExtensionProtoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.decode(message.value); + }, + toProto(message: RequestVerifyVoteExtension): Uint8Array { + return RequestVerifyVoteExtension.encode(message).finish(); + }, + toProtoMsg(message: RequestVerifyVoteExtension): RequestVerifyVoteExtensionProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + value: RequestVerifyVoteExtension.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestVerifyVoteExtension.typeUrl, RequestVerifyVoteExtension); +function createBaseRequestFinalizeBlock(): RequestFinalizeBlock { + return { + txs: [], + decidedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestFinalizeBlock = { + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + is(o: any): o is RequestFinalizeBlock { + return o && (o.$typeUrl === RequestFinalizeBlock.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.decidedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestFinalizeBlockAmino { + return o && (o.$typeUrl === RequestFinalizeBlock.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.decided_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestFinalizeBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.decidedLastCommit !== undefined) { + CommitInfo.encode(message.decidedLastCommit, 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): RequestFinalizeBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFinalizeBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.decidedLastCommit = 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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); + } + 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: RequestFinalizeBlock): RequestFinalizeBlockAmino { + const obj: any = {}; + 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: RequestFinalizeBlockAminoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.fromAmino(object.value); + }, + fromProtoMsg(message: RequestFinalizeBlockProtoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.decode(message.value); + }, + toProto(message: RequestFinalizeBlock): Uint8Array { + return RequestFinalizeBlock.encode(message).finish(); + }, + toProtoMsg(message: RequestFinalizeBlock): RequestFinalizeBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + value: RequestFinalizeBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestFinalizeBlock.typeUrl, RequestFinalizeBlock); +function createBaseResponse(): Response { + return { + 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 Response = { + typeUrl: "/tendermint.abci.Response", + is(o: any): o is Response { + return o && o.$typeUrl === Response.typeUrl; + }, + isAmino(o: any): o is ResponseAmino { + return o && o.$typeUrl === Response.typeUrl; + }, + 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.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): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: ResponseAmino): Response { + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + 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 = ResponseInfo.fromAmino(object.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: ResponseAminoMsg): Response { + return Response.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseProtoMsg): Response { + return Response.decode(message.value); + }, + toProto(message: Response): Uint8Array { + return Response.encode(message).finish(); + }, + toProtoMsg(message: Response): ResponseProtoMsg { + return { + typeUrl: "/tendermint.abci.Response", + value: Response.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Response.typeUrl, Response); +function createBaseResponseException(): ResponseException { + return { + error: "" + }; +} +export const ResponseException = { + typeUrl: "/tendermint.abci.ResponseException", + is(o: any): o is ResponseException { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + isAmino(o: any): o is ResponseExceptionAmino { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + 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): ResponseException { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseException(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; + return message; + }, + fromAmino(object: ResponseExceptionAmino): ResponseException { + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: ResponseException): ResponseExceptionAmino { + const obj: any = {}; + obj.error = message.error === "" ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { + return ResponseException.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { + return ResponseException.decode(message.value); + }, + toProto(message: ResponseException): Uint8Array { + return ResponseException.encode(message).finish(); + }, + toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseException", + value: ResponseException.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseException.typeUrl, ResponseException); +function createBaseResponseEcho(): ResponseEcho { + return { + message: "" + }; +} +export const ResponseEcho = { + typeUrl: "/tendermint.abci.ResponseEcho", + is(o: any): o is ResponseEcho { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is ResponseEchoAmino { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + } + 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseEcho.typeUrl, ResponseEcho); +function createBaseResponseFlush(): ResponseFlush { + return {}; +} +export const ResponseFlush = { + typeUrl: "/tendermint.abci.ResponseFlush", + is(o: any): o is ResponseFlush { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + isAmino(o: any): o is ResponseFlushAmino { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + 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; + } + } + return message; + }, + fromPartial(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseFlush.typeUrl, ResponseFlush); +function createBaseResponseInfo(): ResponseInfo { + return { + data: "", + version: "", + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), + lastBlockAppHash: new Uint8Array() + }; +} +export const ResponseInfo = { + typeUrl: "/tendermint.abci.ResponseInfo", + is(o: any): o is ResponseInfo { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.appVersion === "bigint" && typeof o.lastBlockHeight === "bigint" && (o.lastBlockAppHash instanceof Uint8Array || typeof o.lastBlockAppHash === "string")); + }, + isAmino(o: any): o is ResponseInfoAmino { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.app_version === "bigint" && typeof o.last_block_height === "bigint" && (o.last_block_app_hash instanceof Uint8Array || typeof o.last_block_app_hash === "string")); + }, + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.appVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.appVersion); + } + if (message.lastBlockHeight !== BigInt(0)) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); + } + return writer; + }, + 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 = createBaseResponseInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: ResponseInfoAmino): ResponseInfo { + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + 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: ResponseInfo): ResponseInfoAmino { + 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; + return obj; + }, + fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { + return ResponseInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { + return ResponseInfo.decode(message.value); + }, + toProto(message: ResponseInfo): Uint8Array { + return ResponseInfo.encode(message).finish(); + }, + toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInfo", + value: ResponseInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseInfo.typeUrl, ResponseInfo); +function createBaseResponseInitChain(): ResponseInitChain { + return { + consensusParams: undefined, + validators: [], + appHash: new Uint8Array() + }; +} +export const ResponseInitChain = { + typeUrl: "/tendermint.abci.ResponseInitChain", + is(o: any): o is ResponseInitChain { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appHash instanceof Uint8Array || typeof o.appHash === "string")); + }, + isAmino(o: any): o is ResponseInitChainAmino { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, + 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): ResponseInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInitChain(); + 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(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: 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.validators = message.validators; + } + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { + return ResponseInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { + return ResponseInitChain.decode(message.value); + }, + toProto(message: ResponseInitChain): Uint8Array { + return ResponseInitChain.encode(message).finish(); + }, + toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInitChain", + value: ResponseInitChain.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseInitChain.typeUrl, ResponseInitChain); +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: "", + info: "", + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: BigInt(0), + codespace: "" + }; +} +export const ResponseQuery = { + typeUrl: "/tendermint.abci.ResponseQuery", + is(o: any): o is ResponseQuery { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseQueryAmino { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + encode(message: ResponseQuery, 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): ResponseQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseQuery(); + 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: DeepPartial): 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 ?? ""; + 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); + } + 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: ResponseQuery): ResponseQueryAmino { + 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: ResponseQueryAminoMsg): ResponseQuery { + return ResponseQuery.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { + return ResponseQuery.decode(message.value); + }, + toProto(message: ResponseQuery): Uint8Array { + return ResponseQuery.encode(message).finish(); + }, + toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseQuery", + value: ResponseQuery.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseQuery.typeUrl, ResponseQuery); +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: "" + }; +} +export const ResponseCheckTx = { + typeUrl: "/tendermint.abci.ResponseCheckTx", + is(o: any): o is ResponseCheckTx { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseCheckTxAmino { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string"); + }, + encode(message: ResponseCheckTx, 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): ResponseCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCheckTx(); + 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: DeepPartial): 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: 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: ResponseCheckTx): ResponseCheckTxAmino { + 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: ResponseCheckTxAminoMsg): ResponseCheckTx { + return ResponseCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { + return ResponseCheckTx.decode(message.value); + }, + toProto(message: ResponseCheckTx): Uint8Array { + return ResponseCheckTx.encode(message).finish(); + }, + toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCheckTx", + value: ResponseCheckTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseCheckTx.typeUrl, ResponseCheckTx); +function createBaseResponseCommit(): ResponseCommit { + return { + retainHeight: BigInt(0) + }; +} +export const ResponseCommit = { + typeUrl: "/tendermint.abci.ResponseCommit", + is(o: any): o is ResponseCommit { + return o && (o.$typeUrl === ResponseCommit.typeUrl || typeof o.retainHeight === "bigint"); + }, + isAmino(o: any): o is ResponseCommitAmino { + return o && (o.$typeUrl === ResponseCommit.typeUrl || typeof o.retain_height === "bigint"); + }, + encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.retainHeight !== BigInt(0)) { + writer.uint32(24).int64(message.retainHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseCommit { + const message = createBaseResponseCommit(); + 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.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; + }, + toAmino(message: ResponseCommit): ResponseCommitAmino { + const obj: any = {}; + obj.retain_height = message.retainHeight !== BigInt(0) ? message.retainHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { + return ResponseCommit.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { + return ResponseCommit.decode(message.value); + }, + toProto(message: ResponseCommit): Uint8Array { + return ResponseCommit.encode(message).finish(); + }, + toProtoMsg(message: ResponseCommit): ResponseCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCommit", + value: ResponseCommit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseCommit.typeUrl, ResponseCommit); +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { + snapshots: [] + }; +} +export const ResponseListSnapshots = { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + is(o: any): o is ResponseListSnapshots { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.is(o.snapshots[0]))); + }, + isAmino(o: any): o is ResponseListSnapshotsAmino { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.isAmino(o.snapshots[0]))); + }, + encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; + }, + toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map(e => e ? Snapshot.toAmino(e) : undefined); + } else { + obj.snapshots = message.snapshots; + } + return obj; + }, + fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { + return ResponseListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { + return ResponseListSnapshots.decode(message.value); + }, + toProto(message: ResponseListSnapshots): Uint8Array { + return ResponseListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: ResponseListSnapshots): ResponseListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + value: ResponseListSnapshots.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseListSnapshots.typeUrl, ResponseListSnapshots); +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { + result: 0 + }; +} +export const ResponseOfferSnapshot = { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + is(o: any): o is ResponseOfferSnapshot { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is ResponseOfferSnapshotAmino { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseOfferSnapshot(); + 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: DeepPartial): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.decode(message.value); + }, + toProto(message: ResponseOfferSnapshot): Uint8Array { + return ResponseOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: ResponseOfferSnapshot): ResponseOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + value: ResponseOfferSnapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseOfferSnapshot.typeUrl, ResponseOfferSnapshot); +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { + chunk: new Uint8Array() + }; +} +export const ResponseLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + is(o: any): o is ResponseLoadSnapshotChunk { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + isAmino(o: any): o is ResponseLoadSnapshotChunkAmino { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chunk.length !== 0) { + writer.uint32(10).bytes(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + message.chunk = object.chunk ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; + }, + toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { + const obj: any = {}; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseLoadSnapshotChunkProtoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.decode(message.value); + }, + toProto(message: ResponseLoadSnapshotChunk): Uint8Array { + return ResponseLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + value: ResponseLoadSnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseLoadSnapshotChunk.typeUrl, ResponseLoadSnapshotChunk); +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { + result: 0, + refetchChunks: [], + rejectSenders: [] + }; +} +export const ResponseApplySnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + is(o: any): o is ResponseApplySnapshotChunk { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetchChunks) && (!o.refetchChunks.length || typeof o.refetchChunks[0] === "number") && Array.isArray(o.rejectSenders) && (!o.rejectSenders.length || typeof o.rejectSenders[0] === "string")); + }, + isAmino(o: any): o is ResponseApplySnapshotChunkAmino { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetch_chunks) && (!o.refetch_chunks.length || typeof o.refetch_chunks[0] === "number") && Array.isArray(o.reject_senders) && (!o.reject_senders.length || typeof o.reject_senders[0] === "string")); + }, + encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + message.result = object.result ?? 0; + message.refetchChunks = object.refetchChunks?.map(e => e) || []; + message.rejectSenders = object.rejectSenders?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; + }, + toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + if (message.refetchChunks) { + obj.refetch_chunks = message.refetchChunks.map(e => e); + } else { + obj.refetch_chunks = message.refetchChunks; + } + if (message.rejectSenders) { + obj.reject_senders = message.rejectSenders.map(e => e); + } else { + obj.reject_senders = message.rejectSenders; + } + return obj; + }, + fromAminoMsg(object: ResponseApplySnapshotChunkAminoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseApplySnapshotChunkProtoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.decode(message.value); + }, + toProto(message: ResponseApplySnapshotChunk): Uint8Array { + return ResponseApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + value: ResponseApplySnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseApplySnapshotChunk.typeUrl, ResponseApplySnapshotChunk); +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { + return { + txs: [] + }; +} +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + is(o: any): o is ResponsePrepareProposal { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is ResponsePrepareProposalAmino { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponsePrepareProposal.typeUrl, ResponsePrepareProposal); +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + is(o: any): o is ResponseProcessProposal { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + isAmino(o: any): o is ResponseProcessProposalAmino { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseProcessProposal.typeUrl, ResponseProcessProposal); +function createBaseResponseExtendVote(): ResponseExtendVote { + return { + voteExtension: new Uint8Array() + }; +} +export const ResponseExtendVote = { + typeUrl: "/tendermint.abci.ResponseExtendVote", + is(o: any): o is ResponseExtendVote { + return o && (o.$typeUrl === ResponseExtendVote.typeUrl || o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string"); + }, + isAmino(o: any): o is ResponseExtendVoteAmino { + return o && (o.$typeUrl === ResponseExtendVote.typeUrl || o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseExtendVote.typeUrl, ResponseExtendVote); +function createBaseResponseVerifyVoteExtension(): ResponseVerifyVoteExtension { + return { + status: 0 + }; +} +export const ResponseVerifyVoteExtension = { + typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension", + is(o: any): o is ResponseVerifyVoteExtension { + return o && (o.$typeUrl === ResponseVerifyVoteExtension.typeUrl || isSet(o.status)); + }, + isAmino(o: any): o is ResponseVerifyVoteExtensionAmino { + return o && (o.$typeUrl === ResponseVerifyVoteExtension.typeUrl || isSet(o.status)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseVerifyVoteExtension.typeUrl, ResponseVerifyVoteExtension); +function createBaseResponseFinalizeBlock(): ResponseFinalizeBlock { + return { + events: [], + txResults: [], + validatorUpdates: [], + consensusParamUpdates: undefined, + appHash: new Uint8Array() + }; +} +export const ResponseFinalizeBlock = { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + is(o: any): o is ResponseFinalizeBlock { + return o && (o.$typeUrl === ResponseFinalizeBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && Array.isArray(o.txResults) && (!o.txResults.length || ExecTxResult.is(o.txResults[0])) && Array.isArray(o.validatorUpdates) && (!o.validatorUpdates.length || ValidatorUpdate.is(o.validatorUpdates[0])) && (o.appHash instanceof Uint8Array || typeof o.appHash === "string")); + }, + isAmino(o: any): o is ResponseFinalizeBlockAmino { + return o && (o.$typeUrl === ResponseFinalizeBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && Array.isArray(o.tx_results) && (!o.tx_results.length || ExecTxResult.isAmino(o.tx_results[0])) && Array.isArray(o.validator_updates) && (!o.validator_updates.length || ValidatorUpdate.isAmino(o.validator_updates[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, + 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.appHash.length !== 0) { + writer.uint32(42).bytes(message.appHash); + } + return writer; + }, + 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 = createBaseResponseFinalizeBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 2: + message.txResults.push(ExecTxResult.decode(reader, reader.uint32())); + break; + case 3: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 4: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 5: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 (message.txResults) { + obj.tx_results = message.txResults.map(e => e ? ExecTxResult.toAmino(e) : undefined); + } else { + obj.tx_results = message.txResults; + } + 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.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseFinalizeBlockAminoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseFinalizeBlockProtoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.decode(message.value); + }, + toProto(message: ResponseFinalizeBlock): Uint8Array { + return ResponseFinalizeBlock.encode(message).finish(); + }, + toProtoMsg(message: ResponseFinalizeBlock): ResponseFinalizeBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + value: ResponseFinalizeBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseFinalizeBlock.typeUrl, ResponseFinalizeBlock); +function createBaseCommitInfo(): CommitInfo { + return { + round: 0, + votes: [] + }; +} +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + is(o: any): o is CommitInfo { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.is(o.votes[0]))); + }, + isAmino(o: any): o is CommitInfoAmino { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.isAmino(o.votes[0]))); + }, + encode(message: CommitInfo, 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(); + } + 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.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + return message; + }, + 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: CommitInfo): CommitInfoAmino { + 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); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); + }, + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); + }, + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); + }, + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommitInfo.typeUrl, CommitInfo); +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { + return { + round: 0, + votes: [] + }; +} +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + is(o: any): o is ExtendedCommitInfo { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.is(o.votes[0]))); + }, + isAmino(o: any): o is ExtendedCommitInfoAmino { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.isAmino(o.votes[0]))); + }, + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + 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 = createBaseExtendedCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; + return message; + }, + 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 ? ExtendedVoteInfo.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); + }, + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommitInfo.typeUrl, ExtendedCommitInfo); +function createBaseEvent(): Event { + return { + type: "", + attributes: [] + }; +} +export const Event = { + typeUrl: "/tendermint.abci.Event", + is(o: any): o is Event { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.is(o.attributes[0]))); + }, + isAmino(o: any): o is EventAmino { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.isAmino(o.attributes[0]))); + }, + encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Event { + const message = createBaseEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAmino): Event { + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: Event): EventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? EventAttribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: EventAminoMsg): Event { + return Event.fromAmino(object.value); + }, + fromProtoMsg(message: EventProtoMsg): Event { + return Event.decode(message.value); + }, + toProto(message: Event): Uint8Array { + return Event.encode(message).finish(); + }, + toProtoMsg(message: Event): EventProtoMsg { + return { + typeUrl: "/tendermint.abci.Event", + value: Event.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Event.typeUrl, Event); +function createBaseEventAttribute(): EventAttribute { + return { + key: "", + value: "", + index: false + }; +} +export const EventAttribute = { + typeUrl: "/tendermint.abci.EventAttribute", + is(o: any): o is EventAttribute { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + isAmino(o: any): o is EventAttributeAmino { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.index === true) { + writer.uint32(24).bool(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttribute(); + 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; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttribute { + const message = createBaseEventAttribute(); + 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 = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; + }, + toAmino(message: EventAttribute): EventAttributeAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + obj.index = message.index === false ? undefined : message.index; + return obj; + }, + fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { + return EventAttribute.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { + return EventAttribute.decode(message.value); + }, + toProto(message: EventAttribute): Uint8Array { + return EventAttribute.encode(message).finish(); + }, + toProtoMsg(message: EventAttribute): EventAttributeProtoMsg { + return { + typeUrl: "/tendermint.abci.EventAttribute", + value: EventAttribute.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttribute.typeUrl, 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", + is(o: any): o is ExecTxResult { + return o && (o.$typeUrl === ExecTxResult.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ExecTxResultAmino { + return o && (o.$typeUrl === ExecTxResult.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExecTxResult.typeUrl, ExecTxResult); +function createBaseTxResult(): TxResult { + return { + height: BigInt(0), + index: 0, + tx: new Uint8Array(), + result: ExecTxResult.fromPartial({}) + }; +} +export const TxResult = { + typeUrl: "/tendermint.abci.TxResult", + is(o: any): o is TxResult { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ExecTxResult.is(o.result)); + }, + isAmino(o: any): o is TxResultAmino { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ExecTxResult.isAmino(o.result)); + }, + encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index); + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx); + } + if (message.result !== undefined) { + ExecTxResult.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ExecTxResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResult { + const message = createBaseTxResult(); + 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 ? ExecTxResult.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: TxResultAmino): TxResult { + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ExecTxResult.fromAmino(object.result); + } + return message; + }, + toAmino(message: TxResult): TxResultAmino { + const obj: any = {}; + 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 ? ExecTxResult.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: TxResultAminoMsg): TxResult { + return TxResult.fromAmino(object.value); + }, + fromProtoMsg(message: TxResultProtoMsg): TxResult { + return TxResult.decode(message.value); + }, + toProto(message: TxResult): Uint8Array { + return TxResult.encode(message).finish(); + }, + toProtoMsg(message: TxResult): TxResultProtoMsg { + return { + typeUrl: "/tendermint.abci.TxResult", + value: TxResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResult.typeUrl, TxResult); +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + power: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.abci.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.power !== BigInt(0)) { + writer.uint32(24).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.abci.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +function createBaseValidatorUpdate(): ValidatorUpdate { + return { + pubKey: PublicKey.fromPartial({}), + power: BigInt(0) + }; +} +export const ValidatorUpdate = { + typeUrl: "/tendermint.abci.ValidatorUpdate", + is(o: any): o is ValidatorUpdate { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.is(o.pubKey) && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorUpdateAmino { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.isAmino(o.pub_key) && typeof o.power === "bigint"); + }, + encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { + return ValidatorUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { + return ValidatorUpdate.decode(message.value); + }, + toProto(message: ValidatorUpdate): Uint8Array { + return ValidatorUpdate.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdate): ValidatorUpdateProtoMsg { + return { + typeUrl: "/tendermint.abci.ValidatorUpdate", + value: ValidatorUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorUpdate.typeUrl, ValidatorUpdate); +function createBaseVoteInfo(): VoteInfo { + return { + validator: Validator.fromPartial({}), + blockIdFlag: 0 + }; +} +export const VoteInfo = { + typeUrl: "/tendermint.abci.VoteInfo", + is(o: any): o is VoteInfo { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.is(o.validator) && isSet(o.blockIdFlag)); + }, + isAmino(o: any): o is VoteInfoAmino { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.isAmino(o.validator) && isSet(o.block_id_flag)); + }, + encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.blockIdFlag !== 0) { + writer.uint32(24).int32(message.blockIdFlag); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.blockIdFlag = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VoteInfo { + const message = createBaseVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.blockIdFlag = object.blockIdFlag ?? 0; + return message; + }, + fromAmino(object: VoteInfoAmino): VoteInfo { + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + 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.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + return obj; + }, + fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { + return VoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { + return VoteInfo.decode(message.value); + }, + toProto(message: VoteInfo): Uint8Array { + return VoteInfo.encode(message).finish(); + }, + toProtoMsg(message: VoteInfo): VoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.VoteInfo", + value: VoteInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VoteInfo.typeUrl, VoteInfo); +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + voteExtension: new Uint8Array(), + extensionSignature: new Uint8Array(), + blockIdFlag: 0 + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + is(o: any): o is ExtendedVoteInfo { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.is(o.validator) && (o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string") && isSet(o.blockIdFlag)); + }, + isAmino(o: any): o is ExtendedVoteInfoAmino { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.isAmino(o.validator) && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string") && isSet(o.block_id_flag)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedVoteInfo.typeUrl, ExtendedVoteInfo); +function createBaseMisbehavior(): Misbehavior { + return { + type: 0, + validator: Validator.fromPartial({}), + height: BigInt(0), + time: new Date(), + totalVotingPower: BigInt(0) + }; +} +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + is(o: any): o is Misbehavior { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.is(o.validator) && typeof o.height === "bigint" && Timestamp.is(o.time) && typeof o.totalVotingPower === "bigint"); + }, + isAmino(o: any): o is MisbehaviorAmino { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.isAmino(o.validator) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && typeof o.total_voting_power === "bigint"); + }, + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + 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.totalVotingPower !== BigInt(0)) { + writer.uint32(40).int64(message.totalVotingPower); + } + return writer; + }, + 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 = createBaseMisbehavior(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = (reader.int32() as any); + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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); + message.time = object.time ?? undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + 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.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: Misbehavior): MisbehaviorAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); + }, + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); + }, + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); + }, + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { + return { + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Misbehavior.typeUrl, Misbehavior); +function createBaseSnapshot(): Snapshot { + return { + height: BigInt(0), + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: new Uint8Array() + }; +} +export const Snapshot = { + typeUrl: "/tendermint.abci.Snapshot", + is(o: any): o is Snapshot { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + isAmino(o: any): o is SnapshotAmino { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + 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.length !== 0) { + writer.uint32(42).bytes(message.metadata); + } + 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 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ?? new Uint8Array(); + 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 = bytesFromBase64(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 ? base64FromBytes(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotAminoMsg): Snapshot { + return Snapshot.fromAmino(object.value); + }, + fromProtoMsg(message: SnapshotProtoMsg): Snapshot { + return Snapshot.decode(message.value); + }, + toProto(message: Snapshot): Uint8Array { + return Snapshot.encode(message).finish(); + }, + toProtoMsg(message: Snapshot): SnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.Snapshot", + value: Snapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Snapshot.typeUrl, Snapshot); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/crypto/keys.ts b/libs/injective-query/src/tendermint/crypto/keys.ts new file mode 100644 index 00000000..9dc8476b --- /dev/null +++ b/libs/injective-query/src/tendermint/crypto/keys.ts @@ -0,0 +1,103 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKey { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} +export interface PublicKeyProtoMsg { + typeUrl: "/tendermint.crypto.PublicKey"; + value: Uint8Array; +} +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKeyAmino { + ed25519?: string; + secp256k1?: string; +} +export interface PublicKeyAminoMsg { + type: "/tendermint.crypto.PublicKey"; + value: PublicKeyAmino; +} +function createBasePublicKey(): PublicKey { + return { + ed25519: undefined, + secp256k1: undefined + }; +} +export const PublicKey = { + typeUrl: "/tendermint.crypto.PublicKey", + is(o: any): o is PublicKey { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + isAmino(o: any): o is PublicKeyAmino { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePublicKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; + return message; + }, + fromAmino(object: PublicKeyAmino): PublicKey { + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + toAmino(message: PublicKey): PublicKeyAmino { + const obj: any = {}; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; + return obj; + }, + fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { + return PublicKey.fromAmino(object.value); + }, + fromProtoMsg(message: PublicKeyProtoMsg): PublicKey { + return PublicKey.decode(message.value); + }, + toProto(message: PublicKey): Uint8Array { + return PublicKey.encode(message).finish(); + }, + toProtoMsg(message: PublicKey): PublicKeyProtoMsg { + return { + typeUrl: "/tendermint.crypto.PublicKey", + value: PublicKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PublicKey.typeUrl, PublicKey); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/crypto/proof.ts b/libs/injective-query/src/tendermint/crypto/proof.ts new file mode 100644 index 00000000..5f372fcf --- /dev/null +++ b/libs/injective-query/src/tendermint/crypto/proof.ts @@ -0,0 +1,555 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Proof { + total: bigint; + index: bigint; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ProofProtoMsg { + typeUrl: "/tendermint.crypto.Proof"; + value: Uint8Array; +} +export interface ProofAmino { + total: string; + index: string; + leaf_hash: string; + aunts: string[]; +} +export interface ProofAminoMsg { + type: "/tendermint.crypto.Proof"; + value: ProofAmino; +} +export interface ValueOp { + /** Encoded in ProofOp.Key. */ + key: Uint8Array; + /** To encode in ProofOp.Data */ + proof?: Proof; +} +export interface ValueOpProtoMsg { + typeUrl: "/tendermint.crypto.ValueOp"; + value: Uint8Array; +} +export interface ValueOpAmino { + /** Encoded in ProofOp.Key. */ + key: string; + /** To encode in ProofOp.Data */ + proof?: ProofAmino; +} +export interface ValueOpAminoMsg { + type: "/tendermint.crypto.ValueOp"; + value: ValueOpAmino; +} +export interface DominoOp { + key: string; + input: string; + output: string; +} +export interface DominoOpProtoMsg { + typeUrl: "/tendermint.crypto.DominoOp"; + value: Uint8Array; +} +export interface DominoOpAmino { + key: string; + input: string; + output: string; +} +export interface DominoOpAminoMsg { + type: "/tendermint.crypto.DominoOp"; + value: DominoOpAmino; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} +export interface ProofOpProtoMsg { + typeUrl: "/tendermint.crypto.ProofOp"; + value: Uint8Array; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpAmino { + type: string; + key: string; + data: string; +} +export interface ProofOpAminoMsg { + type: "/tendermint.crypto.ProofOp"; + value: ProofOpAmino; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOps { + ops: ProofOp[]; +} +export interface ProofOpsProtoMsg { + typeUrl: "/tendermint.crypto.ProofOps"; + value: Uint8Array; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsAmino { + ops: ProofOpAmino[]; +} +export interface ProofOpsAminoMsg { + type: "/tendermint.crypto.ProofOps"; + value: ProofOpsAmino; +} +function createBaseProof(): Proof { + return { + total: BigInt(0), + index: BigInt(0), + leafHash: new Uint8Array(), + aunts: [] + }; +} +export const Proof = { + typeUrl: "/tendermint.crypto.Proof", + is(o: any): o is Proof { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leafHash instanceof Uint8Array || typeof o.leafHash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + isAmino(o: any): o is ProofAmino { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leaf_hash instanceof Uint8Array || typeof o.leaf_hash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== BigInt(0)) { + writer.uint32(8).int64(message.total); + } + if (message.index !== BigInt(0)) { + writer.uint32(16).int64(message.index); + } + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); + } + for (const v of message.aunts) { + writer.uint32(34).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proof { + const message = createBaseProof(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map(e => e) || []; + return message; + }, + fromAmino(object: ProofAmino): Proof { + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Proof): ProofAmino { + const obj: any = {}; + obj.total = message.total !== BigInt(0) ? message.total?.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index?.toString() : undefined; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; + if (message.aunts) { + obj.aunts = message.aunts.map(e => base64FromBytes(e)); + } else { + obj.aunts = message.aunts; + } + return obj; + }, + fromAminoMsg(object: ProofAminoMsg): Proof { + return Proof.fromAmino(object.value); + }, + fromProtoMsg(message: ProofProtoMsg): Proof { + return Proof.decode(message.value); + }, + toProto(message: Proof): Uint8Array { + return Proof.encode(message).finish(); + }, + toProtoMsg(message: Proof): ProofProtoMsg { + return { + typeUrl: "/tendermint.crypto.Proof", + value: Proof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proof.typeUrl, Proof); +function createBaseValueOp(): ValueOp { + return { + key: new Uint8Array(), + proof: undefined + }; +} +export const ValueOp = { + typeUrl: "/tendermint.crypto.ValueOp", + is(o: any): o is ValueOp { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is ValueOpAmino { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValueOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: ValueOpAmino): ValueOp { + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: ValueOp): ValueOpAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: ValueOpAminoMsg): ValueOp { + return ValueOp.fromAmino(object.value); + }, + fromProtoMsg(message: ValueOpProtoMsg): ValueOp { + return ValueOp.decode(message.value); + }, + toProto(message: ValueOp): Uint8Array { + return ValueOp.encode(message).finish(); + }, + toProtoMsg(message: ValueOp): ValueOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ValueOp", + value: ValueOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValueOp.typeUrl, ValueOp); +function createBaseDominoOp(): DominoOp { + return { + key: "", + input: "", + output: "" + }; +} +export const DominoOp = { + typeUrl: "/tendermint.crypto.DominoOp", + is(o: any): o is DominoOp { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + isAmino(o: any): o is DominoOpAmino { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.input !== "") { + writer.uint32(18).string(message.input); + } + if (message.output !== "") { + writer.uint32(26).string(message.output); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDominoOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; + return message; + }, + fromAmino(object: DominoOpAmino): DominoOp { + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; + }, + toAmino(message: DominoOp): DominoOpAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.input = message.input === "" ? undefined : message.input; + obj.output = message.output === "" ? undefined : message.output; + return obj; + }, + fromAminoMsg(object: DominoOpAminoMsg): DominoOp { + return DominoOp.fromAmino(object.value); + }, + fromProtoMsg(message: DominoOpProtoMsg): DominoOp { + return DominoOp.decode(message.value); + }, + toProto(message: DominoOp): Uint8Array { + return DominoOp.encode(message).finish(); + }, + toProtoMsg(message: DominoOp): DominoOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.DominoOp", + value: DominoOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DominoOp.typeUrl, DominoOp); +function createBaseProofOp(): ProofOp { + return { + type: "", + key: new Uint8Array(), + data: new Uint8Array() + }; +} +export const ProofOp = { + typeUrl: "/tendermint.crypto.ProofOp", + is(o: any): o is ProofOp { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is ProofOpAmino { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: ProofOpProtoMsg): ProofOp { + return ProofOp.decode(message.value); + }, + toProto(message: ProofOp): Uint8Array { + return ProofOp.encode(message).finish(); + }, + toProtoMsg(message: ProofOp): ProofOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOp", + value: ProofOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProofOp.typeUrl, ProofOp); +function createBaseProofOps(): ProofOps { + return { + ops: [] + }; +} +export const ProofOps = { + typeUrl: "/tendermint.crypto.ProofOps", + is(o: any): o is ProofOps { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.is(o.ops[0]))); + }, + isAmino(o: any): o is ProofOpsAmino { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.isAmino(o.ops[0]))); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { + return ProofOps.decode(message.value); + }, + toProto(message: ProofOps): Uint8Array { + return ProofOps.encode(message).finish(); + }, + toProtoMsg(message: ProofOps): ProofOpsProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOps", + value: ProofOps.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProofOps.typeUrl, ProofOps); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/types/block.ts b/libs/injective-query/src/tendermint/types/block.ts new file mode 100644 index 00000000..16763b51 --- /dev/null +++ b/libs/injective-query/src/tendermint/types/block.ts @@ -0,0 +1,131 @@ +import { Header, HeaderAmino, Data, DataAmino, Commit, CommitAmino } from "./types"; +import { EvidenceList, EvidenceListAmino } from "./evidence"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Block { + header: Header; + data: Data; + evidence: EvidenceList; + lastCommit?: Commit; +} +export interface BlockProtoMsg { + typeUrl: "/tendermint.types.Block"; + value: Uint8Array; +} +export interface BlockAmino { + header: HeaderAmino; + data: DataAmino; + evidence: EvidenceListAmino; + last_commit?: CommitAmino; +} +export interface BlockAminoMsg { + type: "/tendermint.types.Block"; + value: BlockAmino; +} +function createBaseBlock(): Block { + return { + header: Header.fromPartial({}), + data: Data.fromPartial({}), + evidence: EvidenceList.fromPartial({}), + lastCommit: undefined + }; +} +export const Block = { + typeUrl: "/tendermint.types.Block", + is(o: any): o is Block { + return o && (o.$typeUrl === Block.typeUrl || Header.is(o.header) && Data.is(o.data) && EvidenceList.is(o.evidence)); + }, + isAmino(o: any): o is BlockAmino { + return o && (o.$typeUrl === Block.typeUrl || Header.isAmino(o.header) && Data.isAmino(o.data) && EvidenceList.isAmino(o.evidence)); + }, + 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: DeepPartial): 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) : undefined; + obj.data = message.data ? Data.toAmino(message.data) : undefined; + obj.evidence = message.evidence ? EvidenceList.toAmino(message.evidence) : undefined; + obj.last_commit = message.lastCommit ? Commit.toAmino(message.lastCommit) : undefined; + return obj; + }, + fromAminoMsg(object: BlockAminoMsg): Block { + return Block.fromAmino(object.value); + }, + fromProtoMsg(message: BlockProtoMsg): Block { + return Block.decode(message.value); + }, + toProto(message: Block): Uint8Array { + return Block.encode(message).finish(); + }, + toProtoMsg(message: Block): BlockProtoMsg { + return { + typeUrl: "/tendermint.types.Block", + value: Block.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Block.typeUrl, Block); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/types/evidence.ts b/libs/injective-query/src/tendermint/types/evidence.ts new file mode 100644 index 00000000..696b6c8a --- /dev/null +++ b/libs/injective-query/src/tendermint/types/evidence.ts @@ -0,0 +1,476 @@ +import { Vote, VoteAmino, LightBlock, LightBlockAmino } from "./types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Validator, ValidatorAmino } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Evidence { + duplicateVoteEvidence?: DuplicateVoteEvidence; + lightClientAttackEvidence?: LightClientAttackEvidence; +} +export interface EvidenceProtoMsg { + typeUrl: "/tendermint.types.Evidence"; + value: Uint8Array; +} +export interface EvidenceAmino { + duplicate_vote_evidence?: DuplicateVoteEvidenceAmino; + light_client_attack_evidence?: LightClientAttackEvidenceAmino; +} +export interface EvidenceAminoMsg { + type: "/tendermint.types.Evidence"; + value: EvidenceAmino; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidence { + voteA?: Vote; + voteB?: Vote; + totalVotingPower: bigint; + validatorPower: bigint; + timestamp: Date; +} +export interface DuplicateVoteEvidenceProtoMsg { + typeUrl: "/tendermint.types.DuplicateVoteEvidence"; + value: Uint8Array; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidenceAmino { + vote_a?: VoteAmino; + vote_b?: VoteAmino; + total_voting_power: string; + validator_power: string; + timestamp: string; +} +export interface DuplicateVoteEvidenceAminoMsg { + type: "/tendermint.types.DuplicateVoteEvidence"; + value: DuplicateVoteEvidenceAmino; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidence { + conflictingBlock?: LightBlock; + commonHeight: bigint; + byzantineValidators: Validator[]; + totalVotingPower: bigint; + timestamp: Date; +} +export interface LightClientAttackEvidenceProtoMsg { + typeUrl: "/tendermint.types.LightClientAttackEvidence"; + value: Uint8Array; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidenceAmino { + conflicting_block?: LightBlockAmino; + common_height: string; + byzantine_validators: ValidatorAmino[]; + total_voting_power: string; + timestamp: string; +} +export interface LightClientAttackEvidenceAminoMsg { + type: "/tendermint.types.LightClientAttackEvidence"; + value: LightClientAttackEvidenceAmino; +} +export interface EvidenceList { + evidence: Evidence[]; +} +export interface EvidenceListProtoMsg { + typeUrl: "/tendermint.types.EvidenceList"; + value: Uint8Array; +} +export interface EvidenceListAmino { + evidence: EvidenceAmino[]; +} +export interface EvidenceListAminoMsg { + type: "/tendermint.types.EvidenceList"; + value: EvidenceListAmino; +} +function createBaseEvidence(): Evidence { + return { + duplicateVoteEvidence: undefined, + lightClientAttackEvidence: undefined + }; +} +export const Evidence = { + typeUrl: "/tendermint.types.Evidence", + is(o: any): o is Evidence { + return o && o.$typeUrl === Evidence.typeUrl; + }, + isAmino(o: any): o is EvidenceAmino { + return o && o.$typeUrl === Evidence.typeUrl; + }, + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); + } + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Evidence { + const message = createBaseEvidence(); + message.duplicateVoteEvidence = object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) : undefined; + message.lightClientAttackEvidence = object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) : undefined; + return message; + }, + fromAmino(object: EvidenceAmino): Evidence { + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; + }, + toAmino(message: Evidence): EvidenceAmino { + const obj: any = {}; + obj.duplicate_vote_evidence = message.duplicateVoteEvidence ? DuplicateVoteEvidence.toAmino(message.duplicateVoteEvidence) : undefined; + obj.light_client_attack_evidence = message.lightClientAttackEvidence ? LightClientAttackEvidence.toAmino(message.lightClientAttackEvidence) : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceAminoMsg): Evidence { + return Evidence.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceProtoMsg): Evidence { + return Evidence.decode(message.value); + }, + toProto(message: Evidence): Uint8Array { + return Evidence.encode(message).finish(); + }, + toProtoMsg(message: Evidence): EvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.Evidence", + value: Evidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Evidence.typeUrl, Evidence); +function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { + return { + voteA: undefined, + voteB: undefined, + totalVotingPower: BigInt(0), + validatorPower: BigInt(0), + timestamp: new Date() + }; +} +export const DuplicateVoteEvidence = { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + is(o: any): o is DuplicateVoteEvidence { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.totalVotingPower === "bigint" && typeof o.validatorPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isAmino(o: any): o is DuplicateVoteEvidenceAmino { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.total_voting_power === "bigint" && typeof o.validator_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, + encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); + } + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + if (message.validatorPower !== BigInt(0)) { + writer.uint32(32).int64(message.validatorPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuplicateVoteEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + message.voteA = object.voteA !== undefined && object.voteA !== null ? Vote.fromPartial(object.voteA) : undefined; + message.voteB = object.voteB !== undefined && object.voteB !== null ? Vote.fromPartial(object.voteB) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.validatorPower = object.validatorPower !== undefined && object.validatorPower !== null ? BigInt(object.validatorPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { + const obj: any = {}; + obj.vote_a = message.voteA ? Vote.toAmino(message.voteA) : undefined; + obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + obj.validator_power = message.validatorPower !== BigInt(0) ? message.validatorPower?.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: DuplicateVoteEvidenceProtoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.decode(message.value); + }, + toProto(message: DuplicateVoteEvidence): Uint8Array { + return DuplicateVoteEvidence.encode(message).finish(); + }, + toProtoMsg(message: DuplicateVoteEvidence): DuplicateVoteEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + value: DuplicateVoteEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DuplicateVoteEvidence.typeUrl, DuplicateVoteEvidence); +function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { + return { + conflictingBlock: undefined, + commonHeight: BigInt(0), + byzantineValidators: [], + totalVotingPower: BigInt(0), + timestamp: new Date() + }; +} +export const LightClientAttackEvidence = { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + is(o: any): o is LightClientAttackEvidence { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.commonHeight === "bigint" && Array.isArray(o.byzantineValidators) && (!o.byzantineValidators.length || Validator.is(o.byzantineValidators[0])) && typeof o.totalVotingPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isAmino(o: any): o is LightClientAttackEvidenceAmino { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.common_height === "bigint" && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Validator.isAmino(o.byzantine_validators[0])) && typeof o.total_voting_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, + encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); + } + if (message.commonHeight !== BigInt(0)) { + writer.uint32(16).int64(message.commonHeight); + } + for (const v of message.byzantineValidators) { + Validator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(32).int64(message.totalVotingPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightClientAttackEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + message.conflictingBlock = object.conflictingBlock !== undefined && object.conflictingBlock !== null ? LightBlock.fromPartial(object.conflictingBlock) : undefined; + message.commonHeight = object.commonHeight !== undefined && object.commonHeight !== null ? BigInt(object.commonHeight.toString()) : BigInt(0); + message.byzantineValidators = object.byzantineValidators?.map(e => Validator.fromPartial(e)) || []; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { + const obj: any = {}; + obj.conflicting_block = message.conflictingBlock ? LightBlock.toAmino(message.conflictingBlock) : undefined; + obj.common_height = message.commonHeight !== BigInt(0) ? message.commonHeight?.toString() : undefined; + if (message.byzantineValidators) { + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.byzantine_validators = message.byzantineValidators; + } + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: LightClientAttackEvidenceProtoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.decode(message.value); + }, + toProto(message: LightClientAttackEvidence): Uint8Array { + return LightClientAttackEvidence.encode(message).finish(); + }, + toProtoMsg(message: LightClientAttackEvidence): LightClientAttackEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + value: LightClientAttackEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LightClientAttackEvidence.typeUrl, LightClientAttackEvidence); +function createBaseEvidenceList(): EvidenceList { + return { + evidence: [] + }; +} +export const EvidenceList = { + typeUrl: "/tendermint.types.EvidenceList", + is(o: any): o is EvidenceList { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.is(o.evidence[0]))); + }, + isAmino(o: any): o is EvidenceListAmino { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.isAmino(o.evidence[0]))); + }, + encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.evidence) { + Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EvidenceListAmino): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; + }, + toAmino(message: EvidenceList): EvidenceListAmino { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map(e => e ? Evidence.toAmino(e) : undefined); + } else { + obj.evidence = message.evidence; + } + return obj; + }, + fromAminoMsg(object: EvidenceListAminoMsg): EvidenceList { + return EvidenceList.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceListProtoMsg): EvidenceList { + return EvidenceList.decode(message.value); + }, + toProto(message: EvidenceList): Uint8Array { + return EvidenceList.encode(message).finish(); + }, + toProtoMsg(message: EvidenceList): EvidenceListProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceList", + value: EvidenceList.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EvidenceList.typeUrl, EvidenceList); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/types/params.ts b/libs/injective-query/src/tendermint/types/params.ts new file mode 100644 index 00000000..0b15190e --- /dev/null +++ b/libs/injective-query/src/tendermint/types/params.ts @@ -0,0 +1,814 @@ +import { Duration, DurationAmino } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; + abci?: ABCIParams; +} +export interface ConsensusParamsProtoMsg { + typeUrl: "/tendermint.types.ConsensusParams"; + value: Uint8Array; +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + version?: VersionParamsAmino; + abci?: ABCIParamsAmino; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.types.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: bigint; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: bigint; +} +export interface BlockParamsProtoMsg { + typeUrl: "/tendermint.types.BlockParams"; + value: Uint8Array; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + max_bytes: string; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + max_gas: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.types.BlockParams"; + value: BlockParamsAmino; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: bigint; + /** + * Max age of evidence, in time. + * + * 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). + */ + maxAgeDuration: Duration; + /** + * 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. + * Default is 1048576 or 1MB + */ + maxBytes: bigint; +} +export interface EvidenceParamsProtoMsg { + typeUrl: "/tendermint.types.EvidenceParams"; + value: Uint8Array; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsAmino { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + max_age_num_blocks: string; + /** + * Max age of evidence, in time. + * + * 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). + */ + max_age_duration: DurationAmino; + /** + * 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. + * Default is 1048576 or 1MB + */ + max_bytes: string; +} +export interface EvidenceParamsAminoMsg { + type: "/tendermint.types.EvidenceParams"; + value: EvidenceParamsAmino; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} +export interface ValidatorParamsProtoMsg { + typeUrl: "/tendermint.types.ValidatorParams"; + value: Uint8Array; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsAmino { + pub_key_types: string[]; +} +export interface ValidatorParamsAminoMsg { + type: "/tendermint.types.ValidatorParams"; + value: ValidatorParamsAmino; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + app: bigint; +} +export interface VersionParamsProtoMsg { + typeUrl: "/tendermint.types.VersionParams"; + value: Uint8Array; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsAmino { + app: string; +} +export interface VersionParamsAminoMsg { + type: "/tendermint.types.VersionParams"; + value: VersionParamsAmino; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: bigint; + blockMaxGas: bigint; +} +export interface HashedParamsProtoMsg { + typeUrl: "/tendermint.types.HashedParams"; + value: Uint8Array; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsAmino { + block_max_bytes: string; + block_max_gas: string; +} +export interface HashedParamsAminoMsg { + type: "/tendermint.types.HashedParams"; + value: HashedParamsAmino; +} +/** 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; +} +function createBaseConsensusParams(): ConsensusParams { + return { + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined, + abci: undefined + }; +} +export const ConsensusParams = { + typeUrl: "/tendermint.types.ConsensusParams", + is(o: any): o is ConsensusParams { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + isAmino(o: any): o is ConsensusParamsAmino { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + message.abci = object.abci !== undefined && object.abci !== null ? ABCIParams.fromPartial(object.abci) : 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); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + 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 { + 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.abci = message.abci ? ABCIParams.toAmino(message.abci) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { + return ConsensusParams.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { + return ConsensusParams.decode(message.value); + }, + toProto(message: ConsensusParams): Uint8Array { + return ConsensusParams.encode(message).finish(); + }, + toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ConsensusParams", + value: ConsensusParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConsensusParams.typeUrl, ConsensusParams); +function createBaseBlockParams(): BlockParams { + return { + maxBytes: BigInt(0), + maxGas: BigInt(0) + }; +} +export const BlockParams = { + typeUrl: "/tendermint.types.BlockParams", + is(o: any): o is BlockParams { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.maxBytes === "bigint" && typeof o.maxGas === "bigint"); + }, + isAmino(o: any): o is BlockParamsAmino { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.max_bytes === "bigint" && typeof o.max_gas === "bigint"); + }, + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== BigInt(0)) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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); + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { + return BlockParams.fromAmino(object.value); + }, + fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { + return BlockParams.decode(message.value); + }, + toProto(message: BlockParams): Uint8Array { + return BlockParams.encode(message).finish(); + }, + toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + return { + typeUrl: "/tendermint.types.BlockParams", + value: BlockParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockParams.typeUrl, BlockParams); +function createBaseEvidenceParams(): EvidenceParams { + return { + maxAgeNumBlocks: BigInt(0), + maxAgeDuration: Duration.fromPartial({}), + maxBytes: BigInt(0) + }; +} +export const EvidenceParams = { + typeUrl: "/tendermint.types.EvidenceParams", + is(o: any): o is EvidenceParams { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.maxAgeNumBlocks === "bigint" && Duration.is(o.maxAgeDuration) && typeof o.maxBytes === "bigint"); + }, + isAmino(o: any): o is EvidenceParamsAmino { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.max_age_num_blocks === "bigint" && Duration.isAmino(o.max_age_duration) && typeof o.max_bytes === "bigint"); + }, + encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAgeNumBlocks !== BigInt(0)) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBytes !== BigInt(0)) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0); + message.maxAgeDuration = object.maxAgeDuration !== undefined && object.maxAgeDuration !== null ? Duration.fromPartial(object.maxAgeDuration) : undefined; + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EvidenceParamsAmino): EvidenceParams { + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; + }, + toAmino(message: EvidenceParams): EvidenceParamsAmino { + const obj: any = {}; + obj.max_age_num_blocks = message.maxAgeNumBlocks !== BigInt(0) ? message.maxAgeNumBlocks?.toString() : undefined; + obj.max_age_duration = message.maxAgeDuration ? Duration.toAmino(message.maxAgeDuration) : undefined; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { + return EvidenceParams.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceParamsProtoMsg): EvidenceParams { + return EvidenceParams.decode(message.value); + }, + toProto(message: EvidenceParams): Uint8Array { + return EvidenceParams.encode(message).finish(); + }, + toProtoMsg(message: EvidenceParams): EvidenceParamsProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceParams", + value: EvidenceParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EvidenceParams.typeUrl, EvidenceParams); +function createBaseValidatorParams(): ValidatorParams { + return { + pubKeyTypes: [] + }; +} +export const ValidatorParams = { + typeUrl: "/tendermint.types.ValidatorParams", + is(o: any): o is ValidatorParams { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pubKeyTypes) && (!o.pubKeyTypes.length || typeof o.pubKeyTypes[0] === "string")); + }, + isAmino(o: any): o is ValidatorParamsAmino { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pub_key_types) && (!o.pub_key_types.length || typeof o.pub_key_types[0] === "string")); + }, + encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map(e => e) || []; + return message; + }, + fromAmino(object: ValidatorParamsAmino): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; + }, + toAmino(message: ValidatorParams): ValidatorParamsAmino { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pub_key_types = message.pubKeyTypes.map(e => e); + } else { + obj.pub_key_types = message.pubKeyTypes; + } + return obj; + }, + fromAminoMsg(object: ValidatorParamsAminoMsg): ValidatorParams { + return ValidatorParams.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorParamsProtoMsg): ValidatorParams { + return ValidatorParams.decode(message.value); + }, + toProto(message: ValidatorParams): Uint8Array { + return ValidatorParams.encode(message).finish(); + }, + toProtoMsg(message: ValidatorParams): ValidatorParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorParams", + value: ValidatorParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorParams.typeUrl, ValidatorParams); +function createBaseVersionParams(): VersionParams { + return { + app: BigInt(0) + }; +} +export const VersionParams = { + typeUrl: "/tendermint.types.VersionParams", + is(o: any): o is VersionParams { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + isAmino(o: any): o is VersionParamsAmino { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VersionParams { + const message = createBaseVersionParams(); + 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 !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: VersionParams): VersionParamsAmino { + const obj: any = {}; + obj.app = message.app !== BigInt(0) ? message.app?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { + return VersionParams.fromAmino(object.value); + }, + fromProtoMsg(message: VersionParamsProtoMsg): VersionParams { + return VersionParams.decode(message.value); + }, + toProto(message: VersionParams): Uint8Array { + return VersionParams.encode(message).finish(); + }, + toProtoMsg(message: VersionParams): VersionParamsProtoMsg { + return { + typeUrl: "/tendermint.types.VersionParams", + value: VersionParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VersionParams.typeUrl, VersionParams); +function createBaseHashedParams(): HashedParams { + return { + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0) + }; +} +export const HashedParams = { + typeUrl: "/tendermint.types.HashedParams", + is(o: any): o is HashedParams { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.blockMaxBytes === "bigint" && typeof o.blockMaxGas === "bigint"); + }, + isAmino(o: any): o is HashedParamsAmino { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.block_max_bytes === "bigint" && typeof o.block_max_gas === "bigint"); + }, + encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockMaxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (message.blockMaxGas !== BigInt(0)) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHashedParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? BigInt(object.blockMaxBytes.toString()) : BigInt(0); + message.blockMaxGas = object.blockMaxGas !== undefined && object.blockMaxGas !== null ? BigInt(object.blockMaxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HashedParamsAmino): HashedParams { + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; + }, + toAmino(message: HashedParams): HashedParamsAmino { + const obj: any = {}; + obj.block_max_bytes = message.blockMaxBytes !== BigInt(0) ? message.blockMaxBytes?.toString() : undefined; + obj.block_max_gas = message.blockMaxGas !== BigInt(0) ? message.blockMaxGas?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { + return HashedParams.fromAmino(object.value); + }, + fromProtoMsg(message: HashedParamsProtoMsg): HashedParams { + return HashedParams.decode(message.value); + }, + toProto(message: HashedParams): Uint8Array { + return HashedParams.encode(message).finish(); + }, + toProtoMsg(message: HashedParams): HashedParamsProtoMsg { + return { + typeUrl: "/tendermint.types.HashedParams", + value: HashedParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HashedParams.typeUrl, HashedParams); +function createBaseABCIParams(): ABCIParams { + return { + voteExtensionsEnableHeight: BigInt(0) + }; +} +export const ABCIParams = { + typeUrl: "/tendermint.types.ABCIParams", + is(o: any): o is ABCIParams { + return o && (o.$typeUrl === ABCIParams.typeUrl || typeof o.voteExtensionsEnableHeight === "bigint"); + }, + isAmino(o: any): o is ABCIParamsAmino { + return o && (o.$typeUrl === ABCIParams.typeUrl || typeof o.vote_extensions_enable_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ABCIParams.typeUrl, ABCIParams); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/types/types.ts b/libs/injective-query/src/tendermint/types/types.ts new file mode 100644 index 00000000..c44fd8af --- /dev/null +++ b/libs/injective-query/src/tendermint/types/types.ts @@ -0,0 +1,2157 @@ +import { Proof, ProofAmino } from "../crypto/proof"; +import { Consensus, ConsensusAmino } from "../version/types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { BlockIDFlag, ValidatorSet, ValidatorSetAmino } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1, +} +export const SignedMsgTypeAmino = SignedMsgType; +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case "SIGNED_MSG_TYPE_UNKNOWN": + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + case 1: + case "SIGNED_MSG_TYPE_PREVOTE": + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + case 2: + case "SIGNED_MSG_TYPE_PRECOMMIT": + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + case 32: + case "SIGNED_MSG_TYPE_PROPOSAL": + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + case -1: + case "UNRECOGNIZED": + default: + return SignedMsgType.UNRECOGNIZED; + } +} +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return "SIGNED_MSG_TYPE_UNKNOWN"; + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return "SIGNED_MSG_TYPE_PREVOTE"; + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return "SIGNED_MSG_TYPE_PRECOMMIT"; + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} +export interface PartSetHeaderProtoMsg { + typeUrl: "/tendermint.types.PartSetHeader"; + value: Uint8Array; +} +/** PartsetHeader */ +export interface PartSetHeaderAmino { + total: number; + hash: string; +} +export interface PartSetHeaderAminoMsg { + type: "/tendermint.types.PartSetHeader"; + value: PartSetHeaderAmino; +} +export interface Part { + index: number; + bytes: Uint8Array; + proof: Proof; +} +export interface PartProtoMsg { + typeUrl: "/tendermint.types.Part"; + value: Uint8Array; +} +export interface PartAmino { + index: number; + bytes: string; + proof: ProofAmino; +} +export interface PartAminoMsg { + type: "/tendermint.types.Part"; + value: PartAmino; +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader: PartSetHeader; +} +export interface BlockIDProtoMsg { + typeUrl: "/tendermint.types.BlockID"; + value: Uint8Array; +} +/** BlockID */ +export interface BlockIDAmino { + hash: string; + part_set_header: PartSetHeaderAmino; +} +export interface BlockIDAminoMsg { + type: "/tendermint.types.BlockID"; + value: BlockIDAmino; +} +/** Header defines the structure of a 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; + /** transactions */ + 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; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} +export interface HeaderProtoMsg { + typeUrl: "/tendermint.types.Header"; + value: Uint8Array; +} +/** Header defines the structure of a 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; + /** transactions */ + 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; + /** root hash of all results from the txs from the previous block */ + last_results_hash: string; + /** consensus info */ + evidence_hash: string; + /** original proposer of the block */ + proposer_address: string; +} +export interface HeaderAminoMsg { + type: "/tendermint.types.Header"; + value: HeaderAmino; +} +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: Uint8Array[]; +} +export interface DataProtoMsg { + typeUrl: "/tendermint.types.Data"; + value: Uint8Array; +} +/** Data contains the set of transactions included in the block */ +export interface DataAmino { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: string[]; +} +export interface DataAminoMsg { + type: "/tendermint.types.Data"; + value: DataAmino; +} +/** + * 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 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; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: bigint; + round: number; + blockId: BlockID; + signatures: CommitSig[]; +} +export interface CommitProtoMsg { + typeUrl: "/tendermint.types.Commit"; + value: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitAmino { + height: string; + round: number; + block_id: BlockIDAmino; + signatures: CommitSigAmino[]; +} +export interface CommitAminoMsg { + type: "/tendermint.types.Commit"; + value: CommitAmino; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp: Date; + signature: Uint8Array; +} +export interface CommitSigProtoMsg { + typeUrl: "/tendermint.types.CommitSig"; + value: Uint8Array; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigAmino { + block_id_flag: BlockIDFlag; + validator_address: string; + timestamp: string; + signature: string; +} +export interface CommitSigAminoMsg { + type: "/tendermint.types.CommitSig"; + value: CommitSigAmino; +} +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; +} +/** + * 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; +} +export interface Proposal { + type: SignedMsgType; + height: bigint; + round: number; + polRound: number; + blockId: BlockID; + timestamp: Date; + signature: Uint8Array; +} +export interface ProposalProtoMsg { + typeUrl: "/tendermint.types.Proposal"; + value: Uint8Array; +} +export interface ProposalAmino { + type: SignedMsgType; + height: string; + round: number; + pol_round: number; + block_id: BlockIDAmino; + timestamp: string; + signature: string; +} +export interface ProposalAminoMsg { + type: "/tendermint.types.Proposal"; + value: ProposalAmino; +} +export interface SignedHeader { + header?: Header; + commit?: Commit; +} +export interface SignedHeaderProtoMsg { + typeUrl: "/tendermint.types.SignedHeader"; + value: Uint8Array; +} +export interface SignedHeaderAmino { + header?: HeaderAmino; + commit?: CommitAmino; +} +export interface SignedHeaderAminoMsg { + type: "/tendermint.types.SignedHeader"; + value: SignedHeaderAmino; +} +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} +export interface LightBlockProtoMsg { + typeUrl: "/tendermint.types.LightBlock"; + value: Uint8Array; +} +export interface LightBlockAmino { + signed_header?: SignedHeaderAmino; + validator_set?: ValidatorSetAmino; +} +export interface LightBlockAminoMsg { + type: "/tendermint.types.LightBlock"; + value: LightBlockAmino; +} +export interface BlockMeta { + blockId: BlockID; + blockSize: bigint; + header: Header; + numTxs: bigint; +} +export interface BlockMetaProtoMsg { + typeUrl: "/tendermint.types.BlockMeta"; + value: Uint8Array; +} +export interface BlockMetaAmino { + block_id: BlockIDAmino; + block_size: string; + header: HeaderAmino; + num_txs: string; +} +export interface BlockMetaAminoMsg { + type: "/tendermint.types.BlockMeta"; + value: BlockMetaAmino; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array; + data: Uint8Array; + proof?: Proof; +} +export interface TxProofProtoMsg { + typeUrl: "/tendermint.types.TxProof"; + value: Uint8Array; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofAmino { + root_hash: string; + data: string; + proof?: ProofAmino; +} +export interface TxProofAminoMsg { + type: "/tendermint.types.TxProof"; + value: TxProofAmino; +} +function createBasePartSetHeader(): PartSetHeader { + return { + total: 0, + hash: new Uint8Array() + }; +} +export const PartSetHeader = { + typeUrl: "/tendermint.types.PartSetHeader", + is(o: any): o is PartSetHeader { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + isAmino(o: any): o is PartSetHeaderAmino { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== 0) { + writer.uint32(8).uint32(message.total); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePartSetHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: PartSetHeaderAmino): PartSetHeader { + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: PartSetHeader): PartSetHeaderAmino { + const obj: any = {}; + obj.total = message.total === 0 ? undefined : message.total; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { + return PartSetHeader.fromAmino(object.value); + }, + fromProtoMsg(message: PartSetHeaderProtoMsg): PartSetHeader { + return PartSetHeader.decode(message.value); + }, + toProto(message: PartSetHeader): Uint8Array { + return PartSetHeader.encode(message).finish(); + }, + toProtoMsg(message: PartSetHeader): PartSetHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.PartSetHeader", + value: PartSetHeader.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PartSetHeader.typeUrl, PartSetHeader); +function createBasePart(): Part { + return { + index: 0, + bytes: new Uint8Array(), + proof: Proof.fromPartial({}) + }; +} +export const Part = { + typeUrl: "/tendermint.types.Part", + is(o: any): o is Part { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.is(o.proof)); + }, + isAmino(o: any): o is PartAmino { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.isAmino(o.proof)); + }, + encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.bytes.length !== 0) { + writer.uint32(18).bytes(message.bytes); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: PartAmino): Part { + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: Part): PartAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: PartAminoMsg): Part { + return Part.fromAmino(object.value); + }, + fromProtoMsg(message: PartProtoMsg): Part { + return Part.decode(message.value); + }, + toProto(message: Part): Uint8Array { + return Part.encode(message).finish(); + }, + toProtoMsg(message: Part): PartProtoMsg { + return { + typeUrl: "/tendermint.types.Part", + value: Part.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Part.typeUrl, Part); +function createBaseBlockID(): BlockID { + return { + hash: new Uint8Array(), + partSetHeader: PartSetHeader.fromPartial({}) + }; +} +export const BlockID = { + typeUrl: "/tendermint.types.BlockID", + is(o: any): o is BlockID { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.is(o.partSetHeader)); + }, + isAmino(o: any): o is BlockIDAmino { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.isAmino(o.part_set_header)); + }, + encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = object.partSetHeader !== undefined && object.partSetHeader !== null ? PartSetHeader.fromPartial(object.partSetHeader) : undefined; + return message; + }, + fromAmino(object: BlockIDAmino): BlockID { + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; + }, + toAmino(message: BlockID): BlockIDAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; + return obj; + }, + fromAminoMsg(object: BlockIDAminoMsg): BlockID { + return BlockID.fromAmino(object.value); + }, + fromProtoMsg(message: BlockIDProtoMsg): BlockID { + return BlockID.decode(message.value); + }, + toProto(message: BlockID): Uint8Array { + return BlockID.encode(message).finish(); + }, + toProtoMsg(message: BlockID): BlockIDProtoMsg { + return { + typeUrl: "/tendermint.types.BlockID", + value: BlockID.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockID.typeUrl, BlockID); +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: new Uint8Array() + }; +} +export const Header = { + typeUrl: "/tendermint.types.Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || Consensus.is(o.version) && typeof o.chainId === "string" && typeof o.height === "bigint" && Timestamp.is(o.time) && BlockID.is(o.lastBlockId) && (o.lastCommitHash instanceof Uint8Array || typeof o.lastCommitHash === "string") && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && (o.validatorsHash instanceof Uint8Array || typeof o.validatorsHash === "string") && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.consensusHash instanceof Uint8Array || typeof o.consensusHash === "string") && (o.appHash instanceof Uint8Array || typeof o.appHash === "string") && (o.lastResultsHash instanceof Uint8Array || typeof o.lastResultsHash === "string") && (o.evidenceHash instanceof Uint8Array || typeof o.evidenceHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || Consensus.isAmino(o.version) && typeof o.chain_id === "string" && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && BlockID.isAmino(o.last_block_id) && (o.last_commit_hash instanceof Uint8Array || typeof o.last_commit_hash === "string") && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && (o.validators_hash instanceof Uint8Array || typeof o.validators_hash === "string") && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.consensus_hash instanceof Uint8Array || typeof o.consensus_hash === "string") && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string") && (o.last_results_hash instanceof Uint8Array || typeof o.last_results_hash === "string") && (o.evidence_hash instanceof Uint8Array || typeof o.evidence_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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.length !== 0) { + writer.uint32(114).bytes(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.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial
): 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 ?? new Uint8Array(); + 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 = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.version = message.version ? Consensus.toAmino(message.version) : undefined; + 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)) : undefined; + obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; + 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 ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/tendermint.types.Header", + value: Header.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Header.typeUrl, Header); +function createBaseData(): Data { + return { + txs: [] + }; +} +export const Data = { + typeUrl: "/tendermint.types.Data", + is(o: any): o is Data { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is DataAmino { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseData(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: DataAmino): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Data): DataAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: DataAminoMsg): Data { + return Data.fromAmino(object.value); + }, + fromProtoMsg(message: DataProtoMsg): Data { + return Data.decode(message.value); + }, + toProto(message: Data): Uint8Array { + return Data.encode(message).finish(); + }, + toProtoMsg(message: Data): DataProtoMsg { + return { + typeUrl: "/tendermint.types.Data", + value: Data.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Data.typeUrl, Data); +function createBaseVote(): Vote { + return { + type: 0, + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array(), + extension: new Uint8Array(), + extensionSignature: new Uint8Array() + }; +} +export const Vote = { + typeUrl: "/tendermint.types.Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && typeof o.validatorIndex === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string")); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.validator_index === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string")); + }, + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); + } + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); + } + 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 { + 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.type = (reader.int32() as any); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + 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.timestamp = object.timestamp ?? undefined; + 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 { + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + 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); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + 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 { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + 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; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + 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 { + return Vote.fromAmino(object.value); + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/tendermint.types.Vote", + value: Vote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +function createBaseCommit(): Commit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + signatures: [] + }; +} +export const Commit = { + typeUrl: "/tendermint.types.Commit", + is(o: any): o is Commit { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.is(o.signatures[0]))); + }, + isAmino(o: any): o is CommitAmino { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.isAmino(o.signatures[0]))); + }, + encode(message: Commit, 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.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommit(); + 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.signatures.push(CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Commit { + const message = createBaseCommit(); + 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.signatures = object.signatures?.map(e => CommitSig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommitAmino): Commit { + const message = createBaseCommit(); + 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.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Commit): CommitAmino { + 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.signatures) { + obj.signatures = message.signatures.map(e => e ? CommitSig.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: CommitAminoMsg): Commit { + return Commit.fromAmino(object.value); + }, + fromProtoMsg(message: CommitProtoMsg): Commit { + return Commit.decode(message.value); + }, + toProto(message: Commit): Uint8Array { + return Commit.encode(message).finish(); + }, + toProtoMsg(message: Commit): CommitProtoMsg { + return { + typeUrl: "/tendermint.types.Commit", + value: Commit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Commit.typeUrl, Commit); +function createBaseCommitSig(): CommitSig { + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const CommitSig = { + typeUrl: "/tendermint.types.CommitSig", + is(o: any): o is CommitSig { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.blockIdFlag) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is CommitSigAmino { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: CommitSig, 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); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitSig(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: CommitSigAmino): CommitSig { + const message = createBaseCommitSig(); + 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); + } + return message; + }, + toAmino(message: CommitSig): CommitSigAmino { + 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; + return obj; + }, + fromAminoMsg(object: CommitSigAminoMsg): CommitSig { + return CommitSig.fromAmino(object.value); + }, + fromProtoMsg(message: CommitSigProtoMsg): CommitSig { + return CommitSig.decode(message.value); + }, + toProto(message: CommitSig): Uint8Array { + return CommitSig.encode(message).finish(); + }, + toProtoMsg(message: CommitSig): CommitSigProtoMsg { + return { + typeUrl: "/tendermint.types.CommitSig", + value: CommitSig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommitSig.typeUrl, CommitSig); +function createBaseExtendedCommit(): ExtendedCommit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + extendedSignatures: [] + }; +} +export const ExtendedCommit = { + typeUrl: "/tendermint.types.ExtendedCommit", + is(o: any): o is ExtendedCommit { + return o && (o.$typeUrl === ExtendedCommit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Array.isArray(o.extendedSignatures) && (!o.extendedSignatures.length || ExtendedCommitSig.is(o.extendedSignatures[0]))); + }, + isAmino(o: any): o is ExtendedCommitAmino { + return o && (o.$typeUrl === ExtendedCommit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Array.isArray(o.extended_signatures) && (!o.extended_signatures.length || ExtendedCommitSig.isAmino(o.extended_signatures[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommit.typeUrl, ExtendedCommit); +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", + is(o: any): o is ExtendedCommitSig { + return o && (o.$typeUrl === ExtendedCommitSig.typeUrl || isSet(o.blockIdFlag) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string")); + }, + isAmino(o: any): o is ExtendedCommitSigAmino { + return o && (o.$typeUrl === ExtendedCommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommitSig.typeUrl, ExtendedCommitSig); +function createBaseProposal(): Proposal { + return { + type: 0, + height: BigInt(0), + round: 0, + polRound: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const Proposal = { + typeUrl: "/tendermint.types.Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.polRound === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.pol_round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(58).bytes(message.signature); + } + 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.type = (reader.int32() as any); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + 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.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + 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); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.pol_round = message.polRound === 0 ? undefined : message.polRound; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/tendermint.types.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +function createBaseSignedHeader(): SignedHeader { + return { + header: undefined, + commit: undefined + }; +} +export const SignedHeader = { + typeUrl: "/tendermint.types.SignedHeader", + is(o: any): o is SignedHeader { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + isAmino(o: any): o is SignedHeaderAmino { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignedHeader { + const message = createBaseSignedHeader(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? Commit.fromPartial(object.commit) : undefined; + return message; + }, + fromAmino(object: SignedHeaderAmino): SignedHeader { + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; + }, + toAmino(message: SignedHeader): SignedHeaderAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.commit = message.commit ? Commit.toAmino(message.commit) : undefined; + return obj; + }, + fromAminoMsg(object: SignedHeaderAminoMsg): SignedHeader { + return SignedHeader.fromAmino(object.value); + }, + fromProtoMsg(message: SignedHeaderProtoMsg): SignedHeader { + return SignedHeader.decode(message.value); + }, + toProto(message: SignedHeader): Uint8Array { + return SignedHeader.encode(message).finish(); + }, + toProtoMsg(message: SignedHeader): SignedHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.SignedHeader", + value: SignedHeader.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignedHeader.typeUrl, SignedHeader); +function createBaseLightBlock(): LightBlock { + return { + signedHeader: undefined, + validatorSet: undefined + }; +} +export const LightBlock = { + typeUrl: "/tendermint.types.LightBlock", + is(o: any): o is LightBlock { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + isAmino(o: any): o is LightBlockAmino { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; + message.validatorSet = object.validatorSet !== undefined && object.validatorSet !== null ? ValidatorSet.fromPartial(object.validatorSet) : undefined; + return message; + }, + fromAmino(object: LightBlockAmino): LightBlock { + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; + }, + toAmino(message: LightBlock): LightBlockAmino { + const obj: any = {}; + obj.signed_header = message.signedHeader ? SignedHeader.toAmino(message.signedHeader) : undefined; + obj.validator_set = message.validatorSet ? ValidatorSet.toAmino(message.validatorSet) : undefined; + return obj; + }, + fromAminoMsg(object: LightBlockAminoMsg): LightBlock { + return LightBlock.fromAmino(object.value); + }, + fromProtoMsg(message: LightBlockProtoMsg): LightBlock { + return LightBlock.decode(message.value); + }, + toProto(message: LightBlock): Uint8Array { + return LightBlock.encode(message).finish(); + }, + toProtoMsg(message: LightBlock): LightBlockProtoMsg { + return { + typeUrl: "/tendermint.types.LightBlock", + value: LightBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LightBlock.typeUrl, LightBlock); +function createBaseBlockMeta(): BlockMeta { + return { + blockId: BlockID.fromPartial({}), + blockSize: BigInt(0), + header: Header.fromPartial({}), + numTxs: BigInt(0) + }; +} +export const BlockMeta = { + typeUrl: "/tendermint.types.BlockMeta", + is(o: any): o is BlockMeta { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.is(o.blockId) && typeof o.blockSize === "bigint" && Header.is(o.header) && typeof o.numTxs === "bigint"); + }, + isAmino(o: any): o is BlockMetaAmino { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.isAmino(o.block_id) && typeof o.block_size === "bigint" && Header.isAmino(o.header) && typeof o.num_txs === "bigint"); + }, + encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (message.blockSize !== BigInt(0)) { + writer.uint32(16).int64(message.blockSize); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + } + if (message.numTxs !== BigInt(0)) { + writer.uint32(32).int64(message.numTxs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockMeta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.blockSize = object.blockSize !== undefined && object.blockSize !== null ? BigInt(object.blockSize.toString()) : BigInt(0); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.numTxs = object.numTxs !== undefined && object.numTxs !== null ? BigInt(object.numTxs.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockMetaAmino): BlockMeta { + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; + }, + toAmino(message: BlockMeta): BlockMetaAmino { + const obj: any = {}; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block_size = message.blockSize !== BigInt(0) ? message.blockSize?.toString() : undefined; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.num_txs = message.numTxs !== BigInt(0) ? message.numTxs?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { + return BlockMeta.fromAmino(object.value); + }, + fromProtoMsg(message: BlockMetaProtoMsg): BlockMeta { + return BlockMeta.decode(message.value); + }, + toProto(message: BlockMeta): Uint8Array { + return BlockMeta.encode(message).finish(); + }, + toProtoMsg(message: BlockMeta): BlockMetaProtoMsg { + return { + typeUrl: "/tendermint.types.BlockMeta", + value: BlockMeta.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockMeta.typeUrl, BlockMeta); +function createBaseTxProof(): TxProof { + return { + rootHash: new Uint8Array(), + data: new Uint8Array(), + proof: undefined + }; +} +export const TxProof = { + typeUrl: "/tendermint.types.TxProof", + is(o: any): o is TxProof { + return o && (o.$typeUrl === TxProof.typeUrl || (o.rootHash instanceof Uint8Array || typeof o.rootHash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is TxProofAmino { + return o && (o.$typeUrl === TxProof.typeUrl || (o.root_hash instanceof Uint8Array || typeof o.root_hash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: TxProofAmino): TxProof { + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: TxProof): TxProofAmino { + const obj: any = {}; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: TxProofAminoMsg): TxProof { + return TxProof.fromAmino(object.value); + }, + fromProtoMsg(message: TxProofProtoMsg): TxProof { + return TxProof.decode(message.value); + }, + toProto(message: TxProof): Uint8Array { + return TxProof.encode(message).finish(); + }, + toProtoMsg(message: TxProof): TxProofProtoMsg { + return { + typeUrl: "/tendermint.types.TxProof", + value: TxProof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxProof.typeUrl, TxProof); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/types/validator.ts b/libs/injective-query/src/tendermint/types/validator.ts new file mode 100644 index 00000000..0c652786 --- /dev/null +++ b/libs/injective-query/src/tendermint/types/validator.ts @@ -0,0 +1,389 @@ +import { PublicKey, PublicKeyAmino } from "../crypto/keys"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** 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 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; + totalVotingPower: bigint; +} +export interface ValidatorSetProtoMsg { + typeUrl: "/tendermint.types.ValidatorSet"; + value: Uint8Array; +} +export interface ValidatorSetAmino { + validators: ValidatorAmino[]; + proposer?: ValidatorAmino; + total_voting_power: string; +} +export interface ValidatorSetAminoMsg { + type: "/tendermint.types.ValidatorSet"; + value: ValidatorSetAmino; +} +export interface Validator { + address: Uint8Array; + pubKey: PublicKey; + votingPower: bigint; + proposerPriority: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.types.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + address: string; + pub_key: PublicKeyAmino; + voting_power: string; + proposer_priority: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.types.Validator"; + value: ValidatorAmino; +} +export interface SimpleValidator { + pubKey?: PublicKey; + votingPower: bigint; +} +export interface SimpleValidatorProtoMsg { + typeUrl: "/tendermint.types.SimpleValidator"; + value: Uint8Array; +} +export interface SimpleValidatorAmino { + pub_key?: PublicKeyAmino; + voting_power: string; +} +export interface SimpleValidatorAminoMsg { + type: "/tendermint.types.SimpleValidator"; + value: SimpleValidatorAmino; +} +function createBaseValidatorSet(): ValidatorSet { + return { + validators: [], + proposer: undefined, + totalVotingPower: BigInt(0) + }; +} +export const ValidatorSet = { + typeUrl: "/tendermint.types.ValidatorSet", + is(o: any): o is ValidatorSet { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])) && typeof o.totalVotingPower === "bigint"); + }, + isAmino(o: any): o is ValidatorSetAmino { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])) && typeof o.total_voting_power === "bigint"); + }, + encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.proposer = object.proposer !== undefined && object.proposer !== null ? Validator.fromPartial(object.proposer) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorSetAmino): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: ValidatorSet): ValidatorSetAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.proposer = message.proposer ? Validator.toAmino(message.proposer) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { + return ValidatorSet.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorSetProtoMsg): ValidatorSet { + return ValidatorSet.decode(message.value); + }, + toProto(message: ValidatorSet): Uint8Array { + return ValidatorSet.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSet): ValidatorSetProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorSet", + value: ValidatorSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSet.typeUrl, ValidatorSet); +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + pubKey: PublicKey.fromPartial({}), + votingPower: BigInt(0), + proposerPriority: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.types.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.is(o.pubKey) && typeof o.votingPower === "bigint" && typeof o.proposerPriority === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.isAmino(o.pub_key) && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint"); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(24).int64(message.votingPower); + } + if (message.proposerPriority !== BigInt(0)) { + writer.uint32(32).int64(message.proposerPriority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower?.toString() : undefined; + obj.proposer_priority = message.proposerPriority !== BigInt(0) ? message.proposerPriority?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +function createBaseSimpleValidator(): SimpleValidator { + return { + pubKey: undefined, + votingPower: BigInt(0) + }; +} +export const SimpleValidator = { + typeUrl: "/tendermint.types.SimpleValidator", + is(o: any): o is SimpleValidator { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.votingPower === "bigint"); + }, + isAmino(o: any): o is SimpleValidatorAmino { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.voting_power === "bigint"); + }, + encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(16).int64(message.votingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimpleValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SimpleValidatorAmino): SimpleValidator { + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; + }, + toAmino(message: SimpleValidator): SimpleValidatorAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { + return SimpleValidator.fromAmino(object.value); + }, + fromProtoMsg(message: SimpleValidatorProtoMsg): SimpleValidator { + return SimpleValidator.decode(message.value); + }, + toProto(message: SimpleValidator): Uint8Array { + return SimpleValidator.encode(message).finish(); + }, + toProtoMsg(message: SimpleValidator): SimpleValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.SimpleValidator", + value: SimpleValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimpleValidator.typeUrl, SimpleValidator); \ No newline at end of file diff --git a/libs/injective-query/src/tendermint/version/types.ts b/libs/injective-query/src/tendermint/version/types.ts new file mode 100644 index 00000000..824f3644 --- /dev/null +++ b/libs/injective-query/src/tendermint/version/types.ts @@ -0,0 +1,219 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface App { + protocol: bigint; + software: string; +} +export interface AppProtoMsg { + typeUrl: "/tendermint.version.App"; + value: Uint8Array; +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppAmino { + protocol: string; + software: string; +} +export interface AppAminoMsg { + type: "/tendermint.version.App"; + value: AppAmino; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface Consensus { + block: bigint; + app: bigint; +} +export interface ConsensusProtoMsg { + typeUrl: "/tendermint.version.Consensus"; + value: Uint8Array; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusAmino { + block: string; + app: string; +} +export interface ConsensusAminoMsg { + type: "/tendermint.version.Consensus"; + value: ConsensusAmino; +} +function createBaseApp(): App { + return { + protocol: BigInt(0), + software: "" + }; +} +export const App = { + typeUrl: "/tendermint.version.App", + is(o: any): o is App { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + isAmino(o: any): o is AppAmino { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocol !== BigInt(0)) { + writer.uint32(8).uint64(message.protocol); + } + if (message.software !== "") { + writer.uint32(18).string(message.software); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): App { + const message = createBaseApp(); + message.protocol = object.protocol !== undefined && object.protocol !== null ? BigInt(object.protocol.toString()) : BigInt(0); + message.software = object.software ?? ""; + return message; + }, + fromAmino(object: AppAmino): App { + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; + }, + toAmino(message: App): AppAmino { + const obj: any = {}; + obj.protocol = message.protocol !== BigInt(0) ? message.protocol?.toString() : undefined; + obj.software = message.software === "" ? undefined : message.software; + return obj; + }, + fromAminoMsg(object: AppAminoMsg): App { + return App.fromAmino(object.value); + }, + fromProtoMsg(message: AppProtoMsg): App { + return App.decode(message.value); + }, + toProto(message: App): Uint8Array { + return App.encode(message).finish(); + }, + toProtoMsg(message: App): AppProtoMsg { + return { + typeUrl: "/tendermint.version.App", + value: App.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(App.typeUrl, App); +function createBaseConsensus(): Consensus { + return { + block: BigInt(0), + app: BigInt(0) + }; +} +export const Consensus = { + typeUrl: "/tendermint.version.Consensus", + is(o: any): o is Consensus { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isAmino(o: any): o is ConsensusAmino { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== BigInt(0)) { + writer.uint32(8).uint64(message.block); + } + if (message.app !== BigInt(0)) { + writer.uint32(16).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Consensus { + const message = createBaseConsensus(); + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusAmino): Consensus { + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: Consensus): ConsensusAmino { + const obj: any = {}; + obj.block = message.block !== BigInt(0) ? message.block?.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusAminoMsg): Consensus { + return Consensus.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusProtoMsg): Consensus { + return Consensus.decode(message.value); + }, + toProto(message: Consensus): Uint8Array { + return Consensus.encode(message).finish(); + }, + toProtoMsg(message: Consensus): ConsensusProtoMsg { + return { + typeUrl: "/tendermint.version.Consensus", + value: Consensus.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Consensus.typeUrl, Consensus); \ No newline at end of file diff --git a/libs/injective-query/src/types.ts b/libs/injective-query/src/types.ts new file mode 100644 index 00000000..a91926e7 --- /dev/null +++ b/libs/injective-query/src/types.ts @@ -0,0 +1,155 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + +import { IBinaryReader, IBinaryWriter } from "./binary"; +import { Any } from "./google/protobuf/any"; +import { OfflineSigner } from "@interchainjs/cosmos/types/wallet"; +import { HttpEndpoint } from "@interchainjs/types"; + +export type ProtoMsg = Omit & { typeUrl: any }; + +export interface IAminoMsg { + type: any; + value: Amino; +} + +export interface IProtoType { + $typeUrl?: any; +} + +/** + * A type generated by Telescope 1.0. + */ +export interface TelescopeGeneratedCodec< + T = unknown, + SDK = unknown, + Amino = unknown +> { + readonly typeUrl: string; + readonly aminoType?: string; + is?(o: unknown): o is T; + isSDK?(o: unknown): o is SDK; + isAmino?(o: unknown): o is Amino; + encode: (message: T, writer?: IBinaryWriter | any) => IBinaryWriter | any; + decode: (input: IBinaryReader | Uint8Array | any, length?: number) => T; + fromPartial: (object: any) => T | any; + fromJSON?: (object: any) => T | any; + toJSON?: (message: T | any) => any; + fromSDK?: (sdk: SDK) => T; + fromSDKJSON?: (object: any) => SDK; + toSDK?: (message: T) => SDK; + fromAmino?: (amino: Amino) => T; + toAmino?: (message: T) => Amino; + fromAminoMsg?: (aminoMsg: IAminoMsg) => T; + toAminoMsg?: (message: T) => IAminoMsg; + toProto?: (message: T) => Uint8Array; + fromProtoMsg?: (message: ProtoMsg) => T; + toProtoMsg?: (message: T) => Any; +} + +export type TelescopeGeneratedType< + T = unknown, + SDK = unknown, + Amino = unknown +> = TelescopeGeneratedCodec; + +export type GeneratedType = TelescopeGeneratedCodec; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +export type EncodeObject = Message; + +export interface Message { + typeUrl: string; + value: T; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface TxRpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; + signAndBroadcast?( + signerAddress: string, + messages: EncodeObject[], + fee: StdFee | "auto" | number, + memo: string + ): Promise; +} + +export interface SigningClientParams { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +} diff --git a/libs/injective-query/src/utf8.ts b/libs/injective-query/src/utf8.ts new file mode 100644 index 00000000..4d16a562 --- /dev/null +++ b/libs/injective-query/src/utf8.ts @@ -0,0 +1,148 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// 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 its author, 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. + +"use strict"; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start; + if (len < 1) return ""; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/libs/injective-query/src/varint.ts b/libs/injective-query/src/varint.ts new file mode 100644 index 00000000..9df34fb2 --- /dev/null +++ b/libs/injective-query/src/varint.ts @@ -0,0 +1,488 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright 2008 Google Inc. All rights reserved. +// +// 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. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error("invalid varint"); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error("invalid varint"); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ); +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; +} diff --git a/libs/injective-query/tsconfig.esm.json b/libs/injective-query/tsconfig.esm.json new file mode 100644 index 00000000..800d7506 --- /dev/null +++ b/libs/injective-query/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "es2022", + "rootDir": "src/", + "declaration": false + } +} diff --git a/libs/injective-query/tsconfig.json b/libs/injective-query/tsconfig.json new file mode 100644 index 00000000..1a9d5696 --- /dev/null +++ b/libs/injective-query/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src/" + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"] +} diff --git a/libs/injectivejs/.eslintignore b/libs/injectivejs/.eslintignore new file mode 100644 index 00000000..838458f2 --- /dev/null +++ b/libs/injectivejs/.eslintignore @@ -0,0 +1 @@ +/dist/ \ No newline at end of file diff --git a/libs/injectivejs/CHANGELOG.md b/libs/injectivejs/CHANGELOG.md new file mode 100644 index 00000000..c7519894 --- /dev/null +++ b/libs/injectivejs/CHANGELOG.md @@ -0,0 +1,176 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.0.1-beta.36](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.35...interchainjs@0.0.1-beta.36) (2024-11-04) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.35](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.34...interchainjs@0.0.1-beta.35) (2024-11-04) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.34](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.33...interchainjs@0.0.1-beta.34) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.33](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.33...interchainjs@0.0.1-beta.33) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.33](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.32...interchainjs@0.0.1-alpha.33) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.32](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.31...interchainjs@0.0.1-alpha.32) (2024-11-01) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.31](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-alpha.30...interchainjs@0.0.1-alpha.31) (2024-10-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-alpha.30](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.30...interchainjs@0.0.1-alpha.30) (2024-10-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.30](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.29...interchainjs@0.0.1-beta.30) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.29](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.28...interchainjs@0.0.1-beta.29) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.28](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.27...interchainjs@0.0.1-beta.28) (2024-10-25) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.27](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.26...interchainjs@0.0.1-beta.27) (2024-10-23) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.26](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.25...interchainjs@0.0.1-beta.26) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.25](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.24...interchainjs@0.0.1-beta.25) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.24](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.23...interchainjs@0.0.1-beta.24) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.23](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.22...interchainjs@0.0.1-beta.23) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.22](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.21...interchainjs@0.0.1-beta.22) (2024-10-22) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.21](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.20...interchainjs@0.0.1-beta.21) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.20](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.19...interchainjs@0.0.1-beta.20) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.19](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.18...interchainjs@0.0.1-beta.19) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.18](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.17...interchainjs@0.0.1-beta.18) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.17](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.16...interchainjs@0.0.1-beta.17) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.16](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.15...interchainjs@0.0.1-beta.16) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.15](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.14...interchainjs@0.0.1-beta.15) (2024-10-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.14](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.13...interchainjs@0.0.1-beta.14) (2024-09-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.13](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.12...interchainjs@0.0.1-beta.13) (2024-09-10) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.12](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.11...interchainjs@0.0.1-beta.12) (2024-08-30) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.11](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.10...interchainjs@0.0.1-beta.11) (2024-08-27) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.10](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.9...interchainjs@0.0.1-beta.10) (2024-08-26) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.9](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.8...interchainjs@0.0.1-beta.9) (2024-08-24) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.8](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.7...interchainjs@0.0.1-beta.8) (2024-08-21) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.7](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.6...interchainjs@0.0.1-beta.7) (2024-08-19) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.6](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.5...interchainjs@0.0.1-beta.6) (2024-08-14) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.5](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.4...interchainjs@0.0.1-beta.5) (2024-08-14) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.4](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.3...interchainjs@0.0.1-beta.4) (2024-08-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.3](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.2...interchainjs@0.0.1-beta.3) (2024-08-13) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.2](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.1...interchainjs@0.0.1-beta.2) (2024-06-07) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1-beta.0...interchainjs@0.0.1-beta.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1-beta.0](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1-beta.0) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.1...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## [0.0.1](https://github.com/cosmology-tech/interchainjs/compare/interchainjs@0.0.7...interchainjs@0.0.1) (2024-04-29) + +**Note:** Version bump only for package interchainjs + +## 0.0.7 (2024-04-02) + +**Note:** Version bump only for package interchainjs diff --git a/libs/injectivejs/README.md b/libs/injectivejs/README.md new file mode 100644 index 00000000..7e697b67 --- /dev/null +++ b/libs/injectivejs/README.md @@ -0,0 +1,21 @@ +# interchainjs + +

+ +

+ +

+ + + +

+ +Functionalities(Tx, Query) generated by Telescope. + +## License + +MIT License (MIT) & Apache License + +Copyright (c) 2024 Cosmology (https://cosmology.zone/) diff --git a/libs/injectivejs/jest.starship.config.js b/libs/injectivejs/jest.starship.config.js new file mode 100644 index 00000000..c8558038 --- /dev/null +++ b/libs/injectivejs/jest.starship.config.js @@ -0,0 +1,18 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + testTimeout: 15000, + preset: 'ts-jest', + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': [ + 'ts-jest', + { + babelConfig: false, + tsconfig: 'tsconfig.json', + }, + ], + }, + transformIgnorePatterns: [`/node_modules/*`], + testRegex: '(/starship/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], +}; diff --git a/libs/injectivejs/package.json b/libs/injectivejs/package.json new file mode 100644 index 00000000..9a955b18 --- /dev/null +++ b/libs/injectivejs/package.json @@ -0,0 +1,48 @@ +{ + "name": "injectivejs", + "version": "0.0.1-beta.36", + "description": "Injectivejs is a JavaScript library for interacting with injective sdk.", + "main": "index.js", + "module": "esm/index.js", + "types": "index.d.ts", + "author": "Cosmology ", + "homepage": "https://github.com/cosmology-tech/interchainjs", + "repository": { + "type": "git", + "url": "https://github.com/cosmology-tech/interchainjs" + }, + "license": "MIT", + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "scripts": { + "copy": "copyfiles -f ../../LICENSE-MIT ../../LICENSE-Apache README.md package.json dist", + "clean": "rimraf dist/**", + "build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy", + "build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy", + "lint": "eslint . --fix", + "prepare": "npm run build" + }, + "dependencies": { + "@interchainjs/cosmos": "^0.0.1-beta.34", + "@interchainjs/cosmos-types": "^0.0.1-beta.34", + "@interchainjs/types": "^0.0.1-beta.34", + "@interchainjs/utils": "^0.0.1-beta.34", + "@noble/hashes": "^1.3.1", + "decimal.js": "^10.4.3" + }, + "devDependencies": { + "@tanstack/react-query": "4.29.1" + }, + "peerDependencies": { + "@tanstack/react-query": "4.29.1" + }, + "keywords": [ + "cosmos", + "blockchain", + "transaction", + "cosmjs", + "wallet" + ] +} diff --git a/libs/injectivejs/src/amino/amino.ts b/libs/injectivejs/src/amino/amino.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injectivejs/src/amino/amino.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injectivejs/src/binary.ts b/libs/injectivejs/src/binary.ts new file mode 100644 index 00000000..1f9d1f8c --- /dev/null +++ b/libs/injectivejs/src/binary.ts @@ -0,0 +1,534 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// 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 its author, 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. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from "./utf8"; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from "./varint"; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError("premature EOF"); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + "illegal tag: field no " + fieldNo + " wire type " + wireType + ); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === "number") { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error("float not supported"); + } + + double(): number { + throw new Error("double not supported"); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + val: T + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== "undefined") { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size); + } else { + return new Array(size); + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error("float not supported" + value); + } + + double(value: number): BinaryWriter { + throw new Error("double not supported" + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0); + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== "undefined") { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + "index out of range: " + + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len + ); +} diff --git a/libs/injectivejs/src/cosmos/auth/v1beta1/auth.ts b/libs/injectivejs/src/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..bd8ed990 --- /dev/null +++ b/libs/injectivejs/src/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,550 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + address: string; + pubKey?: Any; + accountNumber: bigint; + sequence: bigint; +} +export interface BaseAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; + value: Uint8Array; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountAmino { + address: string; + pub_key?: AnyAmino; + account_number: string; + sequence: string; +} +export interface BaseAccountAminoMsg { + type: "cosmos-sdk/BaseAccount"; + value: BaseAccountAmino; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + baseAccount?: BaseAccount; + name: string; + permissions: string[]; +} +export interface ModuleAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount"; + value: Uint8Array; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountAmino { + base_account?: BaseAccountAmino; + name: string; + permissions: string[]; +} +export interface ModuleAccountAminoMsg { + type: "cosmos-sdk/ModuleAccount"; + value: ModuleAccountAmino; +} +/** + * 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; +} +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsAmino { + max_memo_characters: string; + tx_sig_limit: string; + tx_size_cost_per_byte: string; + sig_verify_cost_ed25519: string; + sig_verify_cost_secp256k1: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/x/auth/Params"; + value: ParamsAmino; +} +function createBaseBaseAccount(): BaseAccount { + return { + address: "", + pubKey: undefined, + accountNumber: BigInt(0), + sequence: BigInt(0) + }; +} +export const BaseAccount = { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + aminoType: "cosmos-sdk/BaseAccount", + is(o: any): o is BaseAccount { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is BaseAccountAmino { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(32).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64(); + break; + case 4: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + 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); + return message; + }, + fromAmino(object: BaseAccountAmino): BaseAccount { + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + 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); + } + return message; + }, + toAmino(message: BaseAccount): BaseAccountAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber?.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { + return BaseAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { + return { + type: "cosmos-sdk/BaseAccount", + value: BaseAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { + return BaseAccount.decode(message.value); + }, + toProto(message: BaseAccount): Uint8Array { + return BaseAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseAccount): BaseAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + value: BaseAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseAccount.aminoType, BaseAccount.typeUrl); +function createBaseModuleAccount(): ModuleAccount { + return { + baseAccount: undefined, + name: "", + permissions: [] + }; +} +export const ModuleAccount = { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + aminoType: "cosmos-sdk/ModuleAccount", + is(o: any): o is ModuleAccount { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + isAmino(o: any): o is ModuleAccountAmino { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.name = object.name ?? ""; + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleAccountAmino): ModuleAccount { + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + toAmino(message: ModuleAccount): ModuleAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + obj.name = message.name === "" ? undefined : message.name; + if (message.permissions) { + obj.permissions = message.permissions.map(e => e); + } else { + obj.permissions = message.permissions; + } + return obj; + }, + fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { + return ModuleAccount.fromAmino(object.value); + }, + toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { + return { + type: "cosmos-sdk/ModuleAccount", + value: ModuleAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { + return ModuleAccount.decode(message.value); + }, + toProto(message: ModuleAccount): Uint8Array { + return ModuleAccount.encode(message).finish(); + }, + toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + value: ModuleAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleAccount.aminoType, ModuleAccount.typeUrl); +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: "", + derivationKeys: [] + }; +} +export const ModuleCredential = { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + aminoType: "cosmos-sdk/GroupAccountCredential", + is(o: any): o is ModuleCredential { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.moduleName === "string" && Array.isArray(o.derivationKeys) && (!o.derivationKeys.length || o.derivationKeys[0] instanceof Uint8Array || typeof o.derivationKeys[0] === "string")); + }, + isAmino(o: any): o is ModuleCredentialAmino { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.module_name === "string" && Array.isArray(o.derivation_keys) && (!o.derivation_keys.length || o.derivation_keys[0] instanceof Uint8Array || typeof o.derivation_keys[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ModuleCredential.typeUrl, ModuleCredential); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleCredential.aminoType, ModuleCredential.typeUrl); +function createBaseParams(): Params { + return { + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0) + }; +} +export const Params = { + typeUrl: "/cosmos.auth.v1beta1.Params", + aminoType: "cosmos-sdk/x/auth/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxMemoCharacters === "bigint" && typeof o.txSigLimit === "bigint" && typeof o.txSizeCostPerByte === "bigint" && typeof o.sigVerifyCostEd25519 === "bigint" && typeof o.sigVerifyCostSecp256k1 === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_memo_characters === "bigint" && typeof o.tx_sig_limit === "bigint" && typeof o.tx_size_cost_per_byte === "bigint" && typeof o.sig_verify_cost_ed25519 === "bigint" && typeof o.sig_verify_cost_secp256k1 === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { + writer.uint32(8).uint64(message.maxMemoCharacters); + } + if (message.txSigLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.txSigLimit); + } + if (message.txSizeCostPerByte !== BigInt(0)) { + writer.uint32(24).uint64(message.txSizeCostPerByte); + } + if (message.sigVerifyCostEd25519 !== BigInt(0)) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + } + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + } + 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.maxMemoCharacters = reader.uint64(); + break; + case 2: + message.txSigLimit = reader.uint64(); + break; + case 3: + message.txSizeCostPerByte = reader.uint64(); + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64(); + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0); + message.txSigLimit = object.txSigLimit !== undefined && object.txSigLimit !== null ? BigInt(object.txSigLimit.toString()) : BigInt(0); + message.txSizeCostPerByte = object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0); + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0); + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_memo_characters = message.maxMemoCharacters !== BigInt(0) ? message.maxMemoCharacters?.toString() : undefined; + obj.tx_sig_limit = message.txSigLimit !== BigInt(0) ? message.txSigLimit?.toString() : undefined; + obj.tx_size_cost_per_byte = message.txSizeCostPerByte !== BigInt(0) ? message.txSizeCostPerByte?.toString() : undefined; + obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 !== BigInt(0) ? message.sigVerifyCostEd25519?.toString() : undefined; + obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 !== BigInt(0) ? message.sigVerifyCostSecp256k1?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/auth/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.auth.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/auth/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/cosmos/auth/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..9a6e4931 --- /dev/null +++ b/libs/injectivejs/src/cosmos/auth/v1beta1/query.rpc.func.ts @@ -0,0 +1,72 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; +export const createGetAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountsRequest.encode, + decode: QueryAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Accounts", + clientResolver +}); +export const createGetAccount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountRequest.encode, + decode: QueryAccountResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Account", + clientResolver +}); +export const createGetAccountAddressByID = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressByIDRequest.encode, + decode: QueryAccountAddressByIDResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountAddressByID", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetModuleAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountsRequest.encode, + decode: QueryModuleAccountsResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccounts", + clientResolver +}); +export const createGetModuleAccountByName = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleAccountByNameRequest.encode, + decode: QueryModuleAccountByNameResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "ModuleAccountByName", + clientResolver +}); +export const createGetBech32Prefix = (clientResolver?: RpcResolver) => buildQuery({ + encode: Bech32PrefixRequest.encode, + decode: Bech32PrefixResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "Bech32Prefix", + clientResolver +}); +export const createGetAddressBytesToString = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressBytesToStringRequest.encode, + decode: AddressBytesToStringResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressBytesToString", + clientResolver +}); +export const createGetAddressStringToBytes = (clientResolver?: RpcResolver) => buildQuery({ + encode: AddressStringToBytesRequest.encode, + decode: AddressStringToBytesResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AddressStringToBytes", + clientResolver +}); +export const createGetAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountInfoRequest.encode, + decode: QueryAccountInfoResponse.decode, + service: "cosmos.auth.v1beta1.Query", + method: "AccountInfo", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/auth/v1beta1/query.ts b/libs/injectivejs/src/cosmos/auth/v1beta1/query.ts new file mode 100644 index 00000000..13eb3d8e --- /dev/null +++ b/libs/injectivejs/src/cosmos/auth/v1beta1/query.ts @@ -0,0 +1,2034 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, BaseAccount, BaseAccountProtoMsg, BaseAccountAmino, ModuleAccount, ModuleAccountProtoMsg } from "./auth"; +import { EthAccount, EthAccountProtoMsg } from "../../../injective/types/v1beta1/account"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAccountsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; + value: Uint8Array; +} +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryAccountsRequest"; + value: QueryAccountsRequestAmino; +} +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponse { + /** accounts are the existing accounts */ + accounts: (BaseAccount | EthAccount | Any)[] | Any[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; + value: Uint8Array; +} +export type QueryAccountsResponseEncoded = Omit & { + /** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg)[]; +}; +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponseAmino { + /** accounts are the existing accounts */ + accounts: AnyAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAccountsResponseAminoMsg { + type: "cosmos-sdk/QueryAccountsResponse"; + value: QueryAccountsResponseAmino; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + /** address defines the address to query for. */ + address: string; +} +export interface QueryAccountRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest"; + value: Uint8Array; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestAmino { + /** address defines the address to query for. */ + address: string; +} +export interface QueryAccountRequestAminoMsg { + type: "cosmos-sdk/QueryAccountRequest"; + value: QueryAccountRequestAmino; +} +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponse { + /** account defines the account of the corresponding address. */ + account?: BaseAccount | EthAccount | Any | undefined; +} +export interface QueryAccountResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; + value: Uint8Array; +} +export type QueryAccountResponseEncoded = Omit & { + /** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponseAmino { + /** account defines the account of the corresponding address. */ + account?: AnyAmino; +} +export interface QueryAccountResponseAminoMsg { + type: "cosmos-sdk/QueryAccountResponse"; + value: QueryAccountResponseAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/cosmos.auth.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: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * 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; +} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponse { + accounts: (ModuleAccount | Any)[] | Any[]; +} +export interface QueryModuleAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; + value: Uint8Array; +} +export type QueryModuleAccountsResponseEncoded = Omit & { + accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; +}; +/** + * 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; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} +export interface QueryModuleAccountByNameRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; + value: Uint8Array; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestAmino { + name: string; +} +export interface QueryModuleAccountByNameRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameRequest"; + value: QueryModuleAccountByNameRequestAmino; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account?: ModuleAccount | Any | undefined; +} +export interface QueryModuleAccountByNameResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; + value: Uint8Array; +} +export type QueryModuleAccountByNameResponseEncoded = Omit & { + account?: ModuleAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseAmino { + account?: AnyAmino; +} +export interface QueryModuleAccountByNameResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameResponse"; + value: QueryModuleAccountByNameResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + pagination: undefined + }; +} +export const QueryAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest", + aminoType: "cosmos-sdk/QueryAccountsRequest", + is(o: any): o is QueryAccountsRequest { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAccountsRequestAmino { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + 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: DeepPartial): 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.auth.v1beta1.QueryAccountsRequest", + value: QueryAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountsRequest.typeUrl, QueryAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsRequest.aminoType, QueryAccountsRequest.typeUrl); +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + accounts: [], + pagination: undefined + }; +} +export const QueryAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + aminoType: "cosmos-sdk/QueryAccountsResponse", + is(o: any): o is QueryAccountsResponse { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.is(o.accounts[0]) || EthAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isAmino(o: any): o is QueryAccountsResponseAmino { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isAmino(o.accounts[0]) || EthAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, + encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(GlobalDecoderRegistry.wrapAny(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): QueryAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.accounts = message.accounts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse { + return QueryAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountsResponse", + value: QueryAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse { + return QueryAccountsResponse.decode(message.value); + }, + toProto(message: QueryAccountsResponse): Uint8Array { + return QueryAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountsResponse): QueryAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + value: QueryAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountsResponse.typeUrl, QueryAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsResponse.aminoType, QueryAccountsResponse.typeUrl); +function createBaseQueryAccountRequest(): QueryAccountRequest { + return { + address: "" + }; +} +export const QueryAccountRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + aminoType: "cosmos-sdk/QueryAccountRequest", + is(o: any): o is QueryAccountRequest { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountRequestAmino { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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.auth.v1beta1.QueryAccountRequest", + value: QueryAccountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountRequest.typeUrl, QueryAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountRequest.aminoType, QueryAccountRequest.typeUrl); +function createBaseQueryAccountResponse(): QueryAccountResponse { + return { + account: undefined + }; +} +export const QueryAccountResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + aminoType: "cosmos-sdk/QueryAccountResponse", + is(o: any): o is QueryAccountResponse { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountResponseAmino { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.account), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; + }, + toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { + const obj: any = {}; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(message.account) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { + return QueryAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountResponse", + value: QueryAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { + return QueryAccountResponse.decode(message.value); + }, + toProto(message: QueryAccountResponse): Uint8Array { + return QueryAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + value: QueryAccountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountResponse.typeUrl, QueryAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountResponse.aminoType, QueryAccountResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.auth.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "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.auth.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; +} +export const QueryModuleAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + aminoType: "cosmos-sdk/QueryModuleAccountsRequest", + is(o: any): o is QueryModuleAccountsRequest { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountsRequestAmino { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseQueryModuleAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsRequestAminoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsRequestProtoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountsRequest): Uint8Array { + return QueryModuleAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountsRequest.typeUrl, QueryModuleAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsRequest.aminoType, QueryModuleAccountsRequest.typeUrl); +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { + return { + accounts: [] + }; +} +export const QueryModuleAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + aminoType: "cosmos-sdk/QueryModuleAccountsResponse", + is(o: any): o is QueryModuleAccountsResponse { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isAmino(o: any): o is QueryModuleAccountsResponseAmino { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + 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 = createBaseQueryModuleAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + return message; + }, + fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; + }, + toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsResponseAminoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsResponseProtoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountsResponse): Uint8Array { + return QueryModuleAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountsResponse.typeUrl, QueryModuleAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsResponse.aminoType, QueryModuleAccountsResponse.typeUrl); +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: "" + }; +} +export const QueryModuleAccountByNameRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + aminoType: "cosmos-sdk/QueryModuleAccountByNameRequest", + is(o: any): o is QueryModuleAccountByNameRequest { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is QueryModuleAccountByNameRequestAmino { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountByNameRequest.typeUrl, QueryModuleAccountByNameRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameRequest.aminoType, QueryModuleAccountByNameRequest.typeUrl); +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { + account: undefined + }; +} +export const QueryModuleAccountByNameResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + aminoType: "cosmos-sdk/QueryModuleAccountByNameResponse", + is(o: any): o is QueryModuleAccountByNameResponse { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountByNameResponseAmino { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; + }, + toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + const obj: any = {}; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(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 { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleAccountByNameResponse.typeUrl, QueryModuleAccountByNameResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameResponse.aminoType, QueryModuleAccountByNameResponse.typeUrl); +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + aminoType: "cosmos-sdk/Bech32PrefixRequest", + is(o: any): o is Bech32PrefixRequest { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + isAmino(o: any): o is Bech32PrefixRequestAmino { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Bech32PrefixRequest.typeUrl, Bech32PrefixRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixRequest.aminoType, Bech32PrefixRequest.typeUrl); +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + aminoType: "cosmos-sdk/Bech32PrefixResponse", + is(o: any): o is Bech32PrefixResponse { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32Prefix === "string"); + }, + isAmino(o: any): o is Bech32PrefixResponseAmino { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32_prefix === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Bech32PrefixResponse.typeUrl, Bech32PrefixResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixResponse.aminoType, Bech32PrefixResponse.typeUrl); +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + aminoType: "cosmos-sdk/AddressBytesToStringRequest", + is(o: any): o is AddressBytesToStringRequest { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isAmino(o: any): o is AddressBytesToStringRequestAmino { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringRequest.typeUrl, AddressBytesToStringRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringRequest.aminoType, AddressBytesToStringRequest.typeUrl); +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + aminoType: "cosmos-sdk/AddressBytesToStringResponse", + is(o: any): o is AddressBytesToStringResponse { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.addressString === "string"); + }, + isAmino(o: any): o is AddressBytesToStringResponseAmino { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.address_string === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringResponse.typeUrl, AddressBytesToStringResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringResponse.aminoType, AddressBytesToStringResponse.typeUrl); +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + aminoType: "cosmos-sdk/AddressStringToBytesRequest", + is(o: any): o is AddressStringToBytesRequest { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.addressString === "string"); + }, + isAmino(o: any): o is AddressStringToBytesRequestAmino { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.address_string === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesRequest.typeUrl, AddressStringToBytesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesRequest.aminoType, AddressStringToBytesRequest.typeUrl); +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + aminoType: "cosmos-sdk/AddressStringToBytesResponse", + is(o: any): o is AddressStringToBytesResponse { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isAmino(o: any): o is AddressStringToBytesResponseAmino { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesResponse.typeUrl, AddressStringToBytesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesResponse.aminoType, AddressStringToBytesResponse.typeUrl); +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + accountId: BigInt(0) + }; +} +export const QueryAccountAddressByIDRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + aminoType: "cosmos-sdk/QueryAccountAddressByIDRequest", + is(o: any): o is QueryAccountAddressByIDRequest { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.accountId === "bigint"); + }, + isAmino(o: any): o is QueryAccountAddressByIDRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.account_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDRequest.typeUrl, QueryAccountAddressByIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDRequest.aminoType, QueryAccountAddressByIDRequest.typeUrl); +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: "" + }; +} +export const QueryAccountAddressByIDResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + aminoType: "cosmos-sdk/QueryAccountAddressByIDResponse", + is(o: any): o is QueryAccountAddressByIDResponse { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressByIDResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.account_address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDResponse.typeUrl, QueryAccountAddressByIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDResponse.aminoType, QueryAccountAddressByIDResponse.typeUrl); +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { + address: "" + }; +} +export const QueryAccountInfoRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + aminoType: "cosmos-sdk/QueryAccountInfoRequest", + is(o: any): o is QueryAccountInfoRequest { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountInfoRequestAmino { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoRequest.typeUrl, QueryAccountInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoRequest.aminoType, QueryAccountInfoRequest.typeUrl); +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { + info: undefined + }; +} +export const QueryAccountInfoResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + aminoType: "cosmos-sdk/QueryAccountInfoResponse", + is(o: any): o is QueryAccountInfoResponse { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountInfoResponseAmino { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoResponse.typeUrl, QueryAccountInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoResponse.aminoType, QueryAccountInfoResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/authz/v1beta1/authz.ts b/libs/injectivejs/src/cosmos/authz/v1beta1/authz.ts new file mode 100644 index 00000000..e71c3fee --- /dev/null +++ b/libs/injectivejs/src/cosmos/authz/v1beta1/authz.ts @@ -0,0 +1,477 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorization { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string; +} +export interface GenericAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization"; + value: Uint8Array; +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationAmino { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string; +} +export interface GenericAuthorizationAminoMsg { + type: "cosmos-sdk/GenericAuthorization"; + value: GenericAuthorizationAmino; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface Grant { + authorization?: GenericAuthorization | Any | undefined; + /** + * 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"; + value: Uint8Array; +} +export type GrantEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +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 { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorization { + granter: string; + grantee: string; + authorization?: GenericAuthorization | Any | undefined; + expiration?: Date; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +export type GrantAuthorizationEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationAmino { + granter: string; + grantee: string; + authorization?: AnyAmino; + expiration?: string; +} +export interface GrantAuthorizationAminoMsg { + type: "cosmos-sdk/GrantAuthorization"; + value: GrantAuthorizationAmino; +} +/** 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; +} +function createBaseGenericAuthorization(): GenericAuthorization { + return { + msg: "" + }; +} +export const GenericAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + aminoType: "cosmos-sdk/GenericAuthorization", + is(o: any): o is GenericAuthorization { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + isAmino(o: any): o is GenericAuthorizationAmino { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + encode(message: GenericAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msg !== "") { + writer.uint32(10).string(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenericAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenericAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msg = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenericAuthorization { + const message = createBaseGenericAuthorization(); + message.msg = object.msg ?? ""; + return message; + }, + fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { + const message = createBaseGenericAuthorization(); + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } + return message; + }, + toAmino(message: GenericAuthorization): GenericAuthorizationAmino { + const obj: any = {}; + obj.msg = message.msg === "" ? undefined : message.msg; + return obj; + }, + fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization { + return GenericAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GenericAuthorization", + value: GenericAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization { + return GenericAuthorization.decode(message.value); + }, + toProto(message: GenericAuthorization): Uint8Array { + return GenericAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GenericAuthorization): GenericAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + value: GenericAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenericAuthorization.typeUrl, GenericAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GenericAuthorization.aminoType, GenericAuthorization.typeUrl); +function createBaseGrant(): Grant { + return { + authorization: undefined, + expiration: undefined + }; +} +export const Grant = { + typeUrl: "/cosmos.authz.v1beta1.Grant", + aminoType: "cosmos-sdk/Grant", + is(o: any): o is Grant { + return o && o.$typeUrl === Grant.typeUrl; + }, + isAmino(o: any): o is GrantAmino { + return o && o.$typeUrl === Grant.typeUrl; + }, + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authorization !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(10).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorization = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Grant { + const message = createBaseGrant(); + message.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAmino): Grant { + const message = createBaseGrant(); + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: Grant): GrantAmino { + const obj: any = {}; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value); + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish(); + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.Grant", + value: Grant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Grant.typeUrl, Grant); +GlobalDecoderRegistry.registerAminoProtoMapping(Grant.aminoType, Grant.typeUrl); +function createBaseGrantAuthorization(): GrantAuthorization { + return { + granter: "", + grantee: "", + authorization: undefined, + expiration: undefined + }; +} +export const GrantAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + aminoType: "cosmos-sdk/GrantAuthorization", + is(o: any): o is GrantAuthorization { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is GrantAuthorizationAmino { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: GrantAuthorization, 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.authorization !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(26).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantAuthorization(); + 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.authorization = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 4: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantAuthorization { + const message = createBaseGrantAuthorization(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + const message = createBaseGrantAuthorization(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: GrantAuthorization): GrantAuthorizationAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { + return GrantAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GrantAuthorization", + value: GrantAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value); + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + value: GrantAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantAuthorization.typeUrl, GrantAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantAuthorization.aminoType, GrantAuthorization.typeUrl); +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + aminoType: "cosmos-sdk/GrantQueueItem", + is(o: any): o is GrantQueueItem { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msgTypeUrls) && (!o.msgTypeUrls.length || typeof o.msgTypeUrls[0] === "string")); + }, + isAmino(o: any): o is GrantQueueItemAmino { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msg_type_urls) && (!o.msg_type_urls.length || typeof o.msg_type_urls[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GrantQueueItem.typeUrl, GrantQueueItem); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantQueueItem.aminoType, GrantQueueItem.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/authz/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/authz/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..18006a6c --- /dev/null +++ b/libs/injectivejs/src/cosmos/authz/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const createGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrant.typeUrl, + encoders: toEncoders(MsgGrant), + converters: toConverters(MsgGrant) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createRevoke = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevoke.typeUrl, + encoders: toEncoders(MsgRevoke), + converters: toConverters(MsgRevoke) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/authz/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 00000000..80640ebe --- /dev/null +++ b/libs/injectivejs/src/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,647 @@ +import { Grant, GrantAmino } from "./authz"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrant { + granter: string; + grantee: string; + grant: Grant; +} +export interface MsgGrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; + value: Uint8Array; +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantAmino { + granter: string; + grantee: string; + grant: GrantAmino; +} +export interface MsgGrantAminoMsg { + type: "cosmos-sdk/MsgGrant"; + value: MsgGrantAmino; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; + value: Uint8Array; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: "cosmos-sdk/MsgGrantResponse"; + value: MsgGrantResponseAmino; +} +/** + * 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. + */ +export interface MsgExec { + grantee: string; + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (Any)[] | Any[]; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExec"; + value: Uint8Array; +} +export type MsgExecEncoded = Omit & { + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (AnyProtoMsg)[]; +}; +/** + * 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. + */ +export interface MsgExecAmino { + grantee: string; + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: AnyAmino[]; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/MsgExec"; + value: MsgExecAmino; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[]; +} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results: string[]; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevoke { + granter: string; + grantee: string; + msgTypeUrl: string; +} +export interface MsgRevokeProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; + value: Uint8Array; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeAmino { + granter: string; + grantee: string; + msg_type_url: string; +} +export interface MsgRevokeAminoMsg { + type: "cosmos-sdk/MsgRevoke"; + value: MsgRevokeAmino; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponse {} +export interface MsgRevokeResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; + value: Uint8Array; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseAmino {} +export interface MsgRevokeResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeResponse"; + value: MsgRevokeResponseAmino; +} +function createBaseMsgGrant(): MsgGrant { + return { + granter: "", + grantee: "", + grant: Grant.fromPartial({}) + }; +} +export const MsgGrant = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + aminoType: "cosmos-sdk/MsgGrant", + is(o: any): o is MsgGrant { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.is(o.grant)); + }, + isAmino(o: any): o is MsgGrantAmino { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.isAmino(o.grant)); + }, + encode(message: MsgGrant, 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.grant !== undefined) { + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrant(); + 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.grant = Grant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgGrant { + const message = createBaseMsgGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.grant = object.grant !== undefined && object.grant !== null ? Grant.fromPartial(object.grant) : undefined; + return message; + }, + fromAmino(object: MsgGrantAmino): MsgGrant { + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; + }, + toAmino(message: MsgGrant): MsgGrantAmino { + 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) : Grant.toAmino(Grant.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { + return MsgGrant.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrant): MsgGrantAminoMsg { + return { + type: "cosmos-sdk/MsgGrant", + value: MsgGrant.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant { + return MsgGrant.decode(message.value); + }, + toProto(message: MsgGrant): Uint8Array { + return MsgGrant.encode(message).finish(); + }, + toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrant.typeUrl, MsgGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrant.aminoType, MsgGrant.typeUrl); +function createBaseMsgGrantResponse(): MsgGrantResponse { + return {}; +} +export const MsgGrantResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + aminoType: "cosmos-sdk/MsgGrantResponse", + is(o: any): o is MsgGrantResponse { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + isAmino(o: any): o is MsgGrantResponseAmino { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantResponse", + value: MsgGrantResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { + return MsgGrantResponse.decode(message.value); + }, + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + value: MsgGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantResponse.typeUrl, MsgGrantResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantResponse.aminoType, MsgGrantResponse.typeUrl); +function createBaseMsgExec(): MsgExec { + return { + grantee: "", + msgs: [] + }; +} +export const MsgExec = { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + aminoType: "cosmos-sdk/MsgExec", + is(o: any): o is MsgExec { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.is(o.msgs[0]))); + }, + isAmino(o: any): o is MsgExecAmino { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.isAmino(o.msgs[0]))); + }, + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + for (const v of message.msgs) { + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(18).fork()).ldelim(); + } + 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.grantee = reader.string(); + break; + case 2: + message.msgs.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExec { + const message = createBaseMsgExec(); + message.grantee = object.grantee ?? ""; + message.msgs = object.msgs?.map(e => (GlobalDecoderRegistry.fromPartial(e) as any)) || []; + return message; + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; + }, + toAmino(message: MsgExec): MsgExecAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.msgs = message.msgs; + } + return obj; + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value); + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: "cosmos-sdk/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.authz.v1beta1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExec.typeUrl, MsgExec); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExec.aminoType, MsgExec.typeUrl); +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [] + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + aminoType: "cosmos-sdk/MsgExecResponse", + is(o: any): o is MsgExecResponse { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + isAmino(o: any): o is MsgExecResponseAmino { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + 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): 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 1: + message.results.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; + }, + 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: 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.authz.v1beta1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecResponse.aminoType, MsgExecResponse.typeUrl); +function createBaseMsgRevoke(): MsgRevoke { + return { + granter: "", + grantee: "", + msgTypeUrl: "" + }; +} +export const MsgRevoke = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + aminoType: "cosmos-sdk/MsgRevoke", + is(o: any): o is MsgRevoke { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msgTypeUrl === "string"); + }, + isAmino(o: any): o is MsgRevokeAmino { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, + encode(message: MsgRevoke, 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.msgTypeUrl !== "") { + writer.uint32(26).string(message.msgTypeUrl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevoke(); + 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.msgTypeUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevoke { + const message = createBaseMsgRevoke(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.msgTypeUrl = object.msgTypeUrl ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAmino): MsgRevoke { + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; + }, + toAmino(message: MsgRevoke): MsgRevokeAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + return obj; + }, + fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { + return MsgRevoke.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg { + return { + type: "cosmos-sdk/MsgRevoke", + value: MsgRevoke.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke { + return MsgRevoke.decode(message.value); + }, + toProto(message: MsgRevoke): Uint8Array { + return MsgRevoke.encode(message).finish(); + }, + toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevoke.typeUrl, MsgRevoke); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevoke.aminoType, MsgRevoke.typeUrl); +function createBaseMsgRevokeResponse(): MsgRevokeResponse { + return {}; +} +export const MsgRevokeResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + aminoType: "cosmos-sdk/MsgRevokeResponse", + is(o: any): o is MsgRevokeResponse { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeResponseAmino { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { + return MsgRevokeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeResponse", + value: MsgRevokeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value); + }, + toProto(message: MsgRevokeResponse): Uint8Array { + return MsgRevokeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + value: MsgRevokeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeResponse.typeUrl, MsgRevokeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeResponse.aminoType, MsgRevokeResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/bank/v1beta1/bank.ts b/libs/injectivejs/src/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..2c115ba3 --- /dev/null +++ b/libs/injectivejs/src/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,974 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Params"; + value: Uint8Array; +} +/** 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/x/bank/Params"; + value: ParamsAmino; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} +export interface SendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled"; + value: Uint8Array; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledAmino { + denom: string; + enabled: boolean; +} +export interface SendEnabledAminoMsg { + type: "cosmos-sdk/SendEnabled"; + value: SendEnabledAmino; +} +/** Input models transaction input. */ +export interface Input { + address: string; + coins: Coin[]; +} +export interface InputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Input"; + value: Uint8Array; +} +/** Input models transaction input. */ +export interface InputAmino { + address: string; + coins: CoinAmino[]; +} +export interface InputAminoMsg { + type: "cosmos-sdk/Input"; + value: InputAmino; +} +/** Output models transaction outputs. */ +export interface Output { + address: string; + coins: Coin[]; +} +export interface OutputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Output"; + value: Uint8Array; +} +/** Output models transaction outputs. */ +export interface OutputAmino { + address: string; + coins: CoinAmino[]; +} +export interface OutputAminoMsg { + type: "cosmos-sdk/Output"; + value: OutputAmino; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface Supply { + total: Coin[]; +} +export interface SupplyProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Supply"; + value: Uint8Array; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplyAmino { + total: CoinAmino[]; +} +export interface SupplyAminoMsg { + type: "cosmos-sdk/Supply"; + value: SupplyAmino; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * 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 = 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). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit"; + value: Uint8Array; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitAmino { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * 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 = 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). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitAminoMsg { + type: "cosmos-sdk/DenomUnit"; + value: DenomUnitAmino; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * 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"; + value: Uint8Array; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataAmino { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denom_units: DenomUnitAmino[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * 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"; + value: MetadataAmino; +} +function createBaseParams(): Params { + return { + sendEnabled: [], + defaultSendEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.bank.v1beta1.Params", + aminoType: "cosmos-sdk/x/bank/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && typeof o.defaultSendEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && typeof o.default_send_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); + } + 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.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + 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.default_send_enabled = message.defaultSendEnabled === false ? undefined : message.defaultSendEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/bank/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.bank.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseSendEnabled(): SendEnabled { + return { + denom: "", + enabled: false + }; +} +export const SendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + aminoType: "cosmos-sdk/SendEnabled", + is(o: any): o is SendEnabled { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + isAmino(o: any): o is SendEnabledAmino { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ""; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: SendEnabledAmino): SendEnabled { + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: SendEnabled): SendEnabledAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { + return SendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { + return { + type: "cosmos-sdk/SendEnabled", + value: SendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { + return SendEnabled.decode(message.value); + }, + toProto(message: SendEnabled): Uint8Array { + return SendEnabled.encode(message).finish(); + }, + toProtoMsg(message: SendEnabled): SendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + value: SendEnabled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SendEnabled.typeUrl, SendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(SendEnabled.aminoType, SendEnabled.typeUrl); +function createBaseInput(): Input { + return { + address: "", + coins: [] + }; +} +export const Input = { + typeUrl: "/cosmos.bank.v1beta1.Input", + aminoType: "cosmos-sdk/Input", + is(o: any): o is Input { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is InputAmino { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Input { + const message = createBaseInput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InputAmino): Input { + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Input): InputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: InputAminoMsg): Input { + return Input.fromAmino(object.value); + }, + toAminoMsg(message: Input): InputAminoMsg { + return { + type: "cosmos-sdk/Input", + value: Input.toAmino(message) + }; + }, + fromProtoMsg(message: InputProtoMsg): Input { + return Input.decode(message.value); + }, + toProto(message: Input): Uint8Array { + return Input.encode(message).finish(); + }, + toProtoMsg(message: Input): InputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Input", + value: Input.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Input.typeUrl, Input); +GlobalDecoderRegistry.registerAminoProtoMapping(Input.aminoType, Input.typeUrl); +function createBaseOutput(): Output { + return { + address: "", + coins: [] + }; +} +export const Output = { + typeUrl: "/cosmos.bank.v1beta1.Output", + aminoType: "cosmos-sdk/Output", + is(o: any): o is Output { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is OutputAmino { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Output { + const message = createBaseOutput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OutputAmino): Output { + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Output): OutputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: OutputAminoMsg): Output { + return Output.fromAmino(object.value); + }, + toAminoMsg(message: Output): OutputAminoMsg { + return { + type: "cosmos-sdk/Output", + value: Output.toAmino(message) + }; + }, + fromProtoMsg(message: OutputProtoMsg): Output { + return Output.decode(message.value); + }, + toProto(message: Output): Uint8Array { + return Output.encode(message).finish(); + }, + toProtoMsg(message: Output): OutputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Output", + value: Output.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Output.typeUrl, Output); +GlobalDecoderRegistry.registerAminoProtoMapping(Output.aminoType, Output.typeUrl); +function createBaseSupply(): Supply { + return { + total: [] + }; +} +export const Supply = { + typeUrl: "/cosmos.bank.v1beta1.Supply", + aminoType: "cosmos-sdk/Supply", + is(o: any): o is Supply { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.is(o.total[0]))); + }, + isAmino(o: any): o is SupplyAmino { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.isAmino(o.total[0]))); + }, + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSupply(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SupplyAmino): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Supply): SupplyAmino { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total = message.total; + } + return obj; + }, + fromAminoMsg(object: SupplyAminoMsg): Supply { + return Supply.fromAmino(object.value); + }, + toAminoMsg(message: Supply): SupplyAminoMsg { + return { + type: "cosmos-sdk/Supply", + value: Supply.toAmino(message) + }; + }, + fromProtoMsg(message: SupplyProtoMsg): Supply { + return Supply.decode(message.value); + }, + toProto(message: Supply): Uint8Array { + return Supply.encode(message).finish(); + }, + toProtoMsg(message: Supply): SupplyProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Supply", + value: Supply.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Supply.typeUrl, Supply); +GlobalDecoderRegistry.registerAminoProtoMapping(Supply.aminoType, Supply.typeUrl); +function createBaseDenomUnit(): DenomUnit { + return { + denom: "", + exponent: 0, + aliases: [] + }; +} +export const DenomUnit = { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + aminoType: "cosmos-sdk/DenomUnit", + is(o: any): o is DenomUnit { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + isAmino(o: any): o is DenomUnitAmino { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent); + } + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomUnit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ""; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + fromAmino(object: DenomUnitAmino): DenomUnit { + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + toAmino(message: DenomUnit): DenomUnitAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + if (message.aliases) { + obj.aliases = message.aliases.map(e => e); + } else { + obj.aliases = message.aliases; + } + return obj; + }, + fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { + return DenomUnit.fromAmino(object.value); + }, + toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { + return { + type: "cosmos-sdk/DenomUnit", + value: DenomUnit.toAmino(message) + }; + }, + fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { + return DenomUnit.decode(message.value); + }, + toProto(message: DenomUnit): Uint8Array { + return DenomUnit.encode(message).finish(); + }, + toProtoMsg(message: DenomUnit): DenomUnitProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + value: DenomUnit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomUnit.typeUrl, DenomUnit); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomUnit.aminoType, DenomUnit.typeUrl); +function createBaseMetadata(): Metadata { + return { + description: "", + denomUnits: [], + base: "", + display: "", + name: "", + symbol: "", + uri: "", + uriHash: "" + }; +} +export const Metadata = { + typeUrl: "/cosmos.bank.v1beta1.Metadata", + aminoType: "cosmos-sdk/Metadata", + is(o: any): o is Metadata { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denomUnits) && (!o.denomUnits.length || DenomUnit.is(o.denomUnits[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uriHash === "string"); + }, + isAmino(o: any): o is MetadataAmino { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denom_units) && (!o.denom_units.length || DenomUnit.isAmino(o.denom_units[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uri_hash === "string"); + }, + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.display !== "") { + writer.uint32(34).string(message.display); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + 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 { + 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.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ""; + message.denomUnits = object.denomUnits?.map(e => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ""; + 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 { + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + 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 { + const obj: any = {}; + obj.description = message.description === "" ? undefined : message.description; + if (message.denomUnits) { + obj.denom_units = message.denomUnits.map(e => e ? DenomUnit.toAmino(e) : undefined); + } else { + obj.denom_units = message.denomUnits; + } + obj.base = message.base === "" ? undefined : message.base; + 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 { + 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.bank.v1beta1.Metadata", + value: Metadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping(Metadata.aminoType, Metadata.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/bank/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/cosmos/bank/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..dc21baf8 --- /dev/null +++ b/libs/injectivejs/src/cosmos/bank/v1beta1/query.rpc.func.ts @@ -0,0 +1,93 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +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"; +export const createGetBalance = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceRequest.encode, + decode: QueryBalanceResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Balance", + clientResolver +}); +export const createGetAllBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllBalancesRequest.encode, + decode: QueryAllBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "AllBalances", + clientResolver +}); +export const createGetSpendableBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalancesRequest.encode, + decode: QuerySpendableBalancesResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalances", + clientResolver +}); +export const createGetSpendableBalanceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpendableBalanceByDenomRequest.encode, + decode: QuerySpendableBalanceByDenomResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SpendableBalanceByDenom", + clientResolver +}); +export const createGetTotalSupply = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTotalSupplyRequest.encode, + decode: QueryTotalSupplyResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "TotalSupply", + clientResolver +}); +export const createGetSupplyOf = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySupplyOfRequest.encode, + decode: QuerySupplyOfResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SupplyOf", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDenomMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataRequest.encode, + decode: QueryDenomMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadata", + clientResolver +}); +export const createGetDenomMetadataByQueryString = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomMetadataByQueryStringRequest.encode, + decode: QueryDenomMetadataByQueryStringResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomMetadataByQueryString", + clientResolver +}); +export const createGetDenomsMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsMetadataRequest.encode, + decode: QueryDenomsMetadataResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomsMetadata", + clientResolver +}); +export const createGetDenomOwners = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersRequest.encode, + decode: QueryDenomOwnersResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwners", + clientResolver +}); +export const createGetDenomOwnersByQuery = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomOwnersByQueryRequest.encode, + decode: QueryDenomOwnersByQueryResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "DenomOwnersByQuery", + clientResolver +}); +export const createGetSendEnabled = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySendEnabledRequest.encode, + decode: QuerySendEnabledResponse.decode, + service: "cosmos.bank.v1beta1.Query", + method: "SendEnabled", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/bank/v1beta1/query.ts b/libs/injectivejs/src/cosmos/bank/v1beta1/query.ts new file mode 100644 index 00000000..45f3fa82 --- /dev/null +++ b/libs/injectivejs/src/cosmos/bank/v1beta1/query.ts @@ -0,0 +1,3027 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, Metadata, MetadataAmino, SendEnabled, SendEnabledAmino } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QueryBalanceRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequestAmino { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QueryBalanceRequestAminoMsg { + type: "cosmos-sdk/QueryBalanceRequest"; + value: QueryBalanceRequestAmino; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QueryBalanceResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; + value: Uint8Array; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QueryBalanceResponseAminoMsg { + type: "cosmos-sdk/QueryBalanceResponse"; + value: QueryBalanceResponseAmino; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequest { + /** address is the address to query balances for. */ + 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"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequestAmino { + /** address is the address to query balances for. */ + 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"; + value: QueryAllBalancesRequestAmino; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponse { + /** balances is the balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; + value: Uint8Array; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponseAmino { + /** balances is the balances of all the coins. */ + balances: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllBalancesResponseAminoMsg { + type: "cosmos-sdk/QueryAllBalancesResponse"; + value: QueryAllBalancesResponseAmino; +} +/** + * 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. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QuerySpendableBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; + value: Uint8Array; +} +/** + * 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. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QuerySpendableBalancesRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesRequest"; + value: QuerySpendableBalancesRequestAmino; +} +/** + * 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. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QuerySpendableBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; + value: Uint8Array; +} +/** + * 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[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QuerySpendableBalancesResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesResponse"; + value: QuerySpendableBalancesResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequest { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequest; +} +export interface QueryTotalSupplyRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; + value: Uint8Array; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequestAmino { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequestAmino; +} +export interface QueryTotalSupplyRequestAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyRequest"; + value: QueryTotalSupplyRequestAmino; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponse { + /** supply is the supply of the coins */ + supply: Coin[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponse; +} +export interface QueryTotalSupplyResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; + value: Uint8Array; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponseAmino { + /** supply is the supply of the coins */ + supply: CoinAmino[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponseAmino; +} +export interface QueryTotalSupplyResponseAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyResponse"; + value: QueryTotalSupplyResponseAmino; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequest { + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySupplyOfRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest"; + value: Uint8Array; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequestAmino { + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySupplyOfRequestAminoMsg { + type: "cosmos-sdk/QuerySupplyOfRequest"; + value: QuerySupplyOfRequestAmino; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponse { + /** amount is the supply of the coin. */ + amount: Coin; +} +export interface QuerySupplyOfResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse"; + value: Uint8Array; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponseAmino { + /** amount is the supply of the coin. */ + amount: CoinAmino; +} +export interface QuerySupplyOfResponseAminoMsg { + type: "cosmos-sdk/QuerySupplyOfResponse"; + value: QuerySupplyOfResponseAmino; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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 { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponseAmino { + /** params provides the parameters of the bank module. */ + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomsMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomsMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataRequest"; + value: QueryDenomsMetadataRequestAmino; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponse { + /** metadata provides the client information for all the registered tokens. */ + metadatas: Metadata[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomsMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponseAmino { + /** metadata provides the client information for all the registered tokens. */ + metadatas: MetadataAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomsMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataResponse"; + value: QueryDenomsMetadataResponseAmino; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequest { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequestAmino { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataRequest"; + value: QueryDenomMetadataRequestAmino; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponse { + /** metadata describes and provides all the client information for the requested token. */ + metadata: Metadata; +} +export interface QueryDenomMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponseAmino { + /** metadata describes and provides all the client information for the requested token. */ + metadata: MetadataAmino; +} +export interface QueryDenomMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataResponse"; + value: QueryDenomMetadataResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { + address: "", + denom: "" + }; +} +export const QueryBalanceRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + aminoType: "cosmos-sdk/QueryBalanceRequest", + is(o: any): o is QueryBalanceRequest { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryBalanceRequestAmino { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + encode(message: QueryBalanceRequest, 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): 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.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + 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: QueryBalanceRequest): QueryBalanceRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + 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.bank.v1beta1.QueryBalanceRequest", + value: QueryBalanceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceRequest.typeUrl, QueryBalanceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceRequest.aminoType, QueryBalanceRequest.typeUrl); +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { + balance: undefined + }; +} +export const QueryBalanceResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + aminoType: "cosmos-sdk/QueryBalanceResponse", + is(o: any): o is QueryBalanceResponse { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + isAmino(o: any): o is QueryBalanceResponseAmino { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + encode(message: QueryBalanceResponse, 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): 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.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance) : 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.bank.v1beta1.QueryBalanceResponse", + value: QueryBalanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceResponse.typeUrl, QueryBalanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceResponse.aminoType, QueryBalanceResponse.typeUrl); +function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { + return { + address: "", + pagination: undefined, + resolveDenom: false + }; +} +export const QueryAllBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + aminoType: "cosmos-sdk/QueryAllBalancesRequest", + is(o: any): o is QueryAllBalancesRequest { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolveDenom === "boolean"); + }, + isAmino(o: any): o is QueryAllBalancesRequestAmino { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolve_denom === "boolean"); + }, + encode(message: QueryAllBalancesRequest, 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(); + } + if (message.resolveDenom === true) { + writer.uint32(24).bool(message.resolveDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesRequest(); + 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; + case 3: + message.resolveDenom = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + 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 { + return QueryAllBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesRequest", + value: QueryAllBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesRequestProtoMsg): QueryAllBalancesRequest { + return QueryAllBalancesRequest.decode(message.value); + }, + toProto(message: QueryAllBalancesRequest): Uint8Array { + return QueryAllBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + value: QueryAllBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllBalancesRequest.typeUrl, QueryAllBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesRequest.aminoType, QueryAllBalancesRequest.typeUrl); +function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QueryAllBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + aminoType: "cosmos-sdk/QueryAllBalancesResponse", + is(o: any): o is QueryAllBalancesResponse { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is QueryAllBalancesResponseAmino { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.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): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.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: DeepPartial): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllBalancesResponseAminoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesResponse", + value: QueryAllBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesResponseProtoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.decode(message.value); + }, + toProto(message: QueryAllBalancesResponse): Uint8Array { + return QueryAllBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + value: QueryAllBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllBalancesResponse.typeUrl, QueryAllBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesResponse.aminoType, QueryAllBalancesResponse.typeUrl); +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { + return { + address: "", + pagination: undefined + }; +} +export const QuerySpendableBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + aminoType: "cosmos-sdk/QuerySpendableBalancesRequest", + is(o: any): o is QuerySpendableBalancesRequest { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QuerySpendableBalancesRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QuerySpendableBalancesRequest, 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): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesRequest(); + 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: DeepPartial): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + 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: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesRequestAminoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesRequestProtoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalancesRequest): Uint8Array { + return QuerySpendableBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesRequest.typeUrl, QuerySpendableBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesRequest.aminoType, QuerySpendableBalancesRequest.typeUrl); +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QuerySpendableBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + aminoType: "cosmos-sdk/QuerySpendableBalancesResponse", + is(o: any): o is QuerySpendableBalancesResponse { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is QuerySpendableBalancesResponseAmino { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.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): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.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: DeepPartial): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesResponseAminoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesResponseProtoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalancesResponse): Uint8Array { + return QuerySpendableBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesResponse.typeUrl, QuerySpendableBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesResponse.aminoType, QuerySpendableBalancesResponse.typeUrl); +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { + return { + address: "", + denom: "" + }; +} +export const QuerySpendableBalanceByDenomRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + is(o: any): o is QuerySpendableBalanceByDenomRequest { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + 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): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + 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: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomRequestAminoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomRequestProtoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomRequest): Uint8Array { + return QuerySpendableBalanceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomRequest.typeUrl, QuerySpendableBalanceByDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomRequest.aminoType, QuerySpendableBalanceByDenomRequest.typeUrl); +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { + balance: undefined + }; +} +export const QuerySpendableBalanceByDenomResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + is(o: any): o is QuerySpendableBalanceByDenomResponse { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomResponseAmino { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomResponse.typeUrl, QuerySpendableBalanceByDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomResponse.aminoType, QuerySpendableBalanceByDenomResponse.typeUrl); +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { + pagination: undefined + }; +} +export const QueryTotalSupplyRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + aminoType: "cosmos-sdk/QueryTotalSupplyRequest", + is(o: any): o is QueryTotalSupplyRequest { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + isAmino(o: any): o is QueryTotalSupplyRequestAmino { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + 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: DeepPartial): 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 { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalSupplyRequest.typeUrl, QueryTotalSupplyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyRequest.aminoType, QueryTotalSupplyRequest.typeUrl); +function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { + return { + supply: [], + pagination: undefined + }; +} +export const QueryTotalSupplyResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + aminoType: "cosmos-sdk/QueryTotalSupplyResponse", + is(o: any): o is QueryTotalSupplyResponse { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0]))); + }, + isAmino(o: any): o is QueryTotalSupplyResponseAmino { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0]))); + }, + encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.supply) { + Coin.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): QueryTotalSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supply.push(Coin.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: DeepPartial): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.supply = message.supply; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyResponseAminoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyResponseProtoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.decode(message.value); + }, + toProto(message: QueryTotalSupplyResponse): Uint8Array { + return QueryTotalSupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalSupplyResponse.typeUrl, QueryTotalSupplyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyResponse.aminoType, QueryTotalSupplyResponse.typeUrl); +function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { + return { + denom: "" + }; +} +export const QuerySupplyOfRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + aminoType: "cosmos-sdk/QuerySupplyOfRequest", + is(o: any): o is QuerySupplyOfRequest { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySupplyOfRequestAmino { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfRequest(); + 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: DeepPartial): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySupplyOfRequestAminoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfRequest", + value: QuerySupplyOfRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfRequestProtoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.decode(message.value); + }, + toProto(message: QuerySupplyOfRequest): Uint8Array { + return QuerySupplyOfRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + value: QuerySupplyOfRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySupplyOfRequest.typeUrl, QuerySupplyOfRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfRequest.aminoType, QuerySupplyOfRequest.typeUrl); +function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QuerySupplyOfResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + aminoType: "cosmos-sdk/QuerySupplyOfResponse", + is(o: any): o is QuerySupplyOfResponse { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.is(o.amount)); + }, + isAmino(o: any): o is QuerySupplyOfResponseAmino { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QuerySupplyOfResponse, 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): QuerySupplyOfResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfResponse(); + 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: DeepPartial): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfResponse", + value: QuerySupplyOfResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfResponseProtoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.decode(message.value); + }, + toProto(message: QuerySupplyOfResponse): Uint8Array { + return QuerySupplyOfResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + value: QuerySupplyOfResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySupplyOfResponse.typeUrl, QuerySupplyOfResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfResponse.aminoType, QuerySupplyOfResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.bank.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.bank.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { + return { + pagination: undefined + }; +} +export const QueryDenomsMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomsMetadataRequest", + is(o: any): o is QueryDenomsMetadataRequest { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + isAmino(o: any): o is QueryDenomsMetadataRequestAmino { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + encode(message: QueryDenomsMetadataRequest, 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): QueryDenomsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataRequest(); + 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: DeepPartial): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataRequestAminoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataRequestProtoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomsMetadataRequest): Uint8Array { + return QueryDenomsMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsMetadataRequest.typeUrl, QueryDenomsMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataRequest.aminoType, QueryDenomsMetadataRequest.typeUrl); +function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { + return { + metadatas: [], + pagination: undefined + }; +} +export const QueryDenomsMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomsMetadataResponse", + is(o: any): o is QueryDenomsMetadataResponse { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.is(o.metadatas[0]))); + }, + isAmino(o: any): o is QueryDenomsMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.isAmino(o.metadatas[0]))); + }, + encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.metadatas) { + Metadata.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): QueryDenomsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadatas.push(Metadata.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: DeepPartial): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { + const obj: any = {}; + if (message.metadatas) { + obj.metadatas = message.metadatas.map(e => e ? Metadata.toAmino(e) : undefined); + } else { + obj.metadatas = message.metadatas; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataResponseAminoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataResponseProtoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomsMetadataResponse): Uint8Array { + return QueryDenomsMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsMetadataResponse.typeUrl, QueryDenomsMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataResponse.aminoType, QueryDenomsMetadataResponse.typeUrl); +function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomMetadataRequest", + is(o: any): o is QueryDenomMetadataRequest { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataRequest(); + 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: DeepPartial): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataRequestAminoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataRequestProtoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomMetadataRequest): Uint8Array { + return QueryDenomMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataRequest.typeUrl, QueryDenomMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataRequest.aminoType, QueryDenomMetadataRequest.typeUrl); +function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomMetadataResponse", + is(o: any): o is QueryDenomMetadataResponse { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.is(o.metadata)); + }, + isAmino(o: any): o is QueryDenomMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.isAmino(o.metadata)); + }, + encode(message: QueryDenomMetadataResponse, 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): QueryDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataResponse(); + 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: DeepPartial): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { + const obj: any = {}; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.toAmino(Metadata.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataResponseProtoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomMetadataResponse): Uint8Array { + return QueryDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataResponse.typeUrl, QueryDenomMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataResponse.aminoType, QueryDenomMetadataResponse.typeUrl); +function createBaseQueryDenomMetadataByQueryStringRequest(): QueryDenomMetadataByQueryStringRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataByQueryStringRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + aminoType: "cosmos-sdk/QueryDenomMetadataByQueryStringRequest", + is(o: any): o is QueryDenomMetadataByQueryStringRequest { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomMetadataByQueryStringRequestAmino { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataByQueryStringRequest.typeUrl, QueryDenomMetadataByQueryStringRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataByQueryStringRequest.aminoType, QueryDenomMetadataByQueryStringRequest.typeUrl); +function createBaseQueryDenomMetadataByQueryStringResponse(): QueryDenomMetadataByQueryStringResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataByQueryStringResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + aminoType: "cosmos-sdk/QueryDenomMetadataByQueryStringResponse", + is(o: any): o is QueryDenomMetadataByQueryStringResponse { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringResponse.typeUrl || Metadata.is(o.metadata)); + }, + isAmino(o: any): o is QueryDenomMetadataByQueryStringResponseAmino { + return o && (o.$typeUrl === QueryDenomMetadataByQueryStringResponse.typeUrl || Metadata.isAmino(o.metadata)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomMetadataByQueryStringResponse.typeUrl, QueryDenomMetadataByQueryStringResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataByQueryStringResponse.aminoType, QueryDenomMetadataByQueryStringResponse.typeUrl); +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + aminoType: "cosmos-sdk/QueryDenomOwnersRequest", + is(o: any): o is QueryDenomOwnersRequest { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomOwnersRequestAmino { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersRequest.typeUrl, QueryDenomOwnersRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersRequest.aminoType, QueryDenomOwnersRequest.typeUrl); +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + aminoType: "cosmos-sdk/DenomOwner", + is(o: any): o is DenomOwner { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.is(o.balance)); + }, + isAmino(o: any): o is DenomOwnerAmino { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.isAmino(o.balance)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DenomOwner.typeUrl, DenomOwner); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomOwner.aminoType, DenomOwner.typeUrl); +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + aminoType: "cosmos-sdk/QueryDenomOwnersResponse", + is(o: any): o is QueryDenomOwnersResponse { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denomOwners) && (!o.denomOwners.length || DenomOwner.is(o.denomOwners[0]))); + }, + isAmino(o: any): o is QueryDenomOwnersResponseAmino { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isAmino(o.denom_owners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersResponse.typeUrl, QueryDenomOwnersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersResponse.aminoType, QueryDenomOwnersResponse.typeUrl); +function createBaseQueryDenomOwnersByQueryRequest(): QueryDenomOwnersByQueryRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", + aminoType: "cosmos-sdk/QueryDenomOwnersByQueryRequest", + is(o: any): o is QueryDenomOwnersByQueryRequest { + return o && (o.$typeUrl === QueryDenomOwnersByQueryRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomOwnersByQueryRequestAmino { + return o && (o.$typeUrl === QueryDenomOwnersByQueryRequest.typeUrl || typeof o.denom === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersByQueryRequest.typeUrl, QueryDenomOwnersByQueryRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersByQueryRequest.aminoType, QueryDenomOwnersByQueryRequest.typeUrl); +function createBaseQueryDenomOwnersByQueryResponse(): QueryDenomOwnersByQueryResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", + aminoType: "cosmos-sdk/QueryDenomOwnersByQueryResponse", + is(o: any): o is QueryDenomOwnersByQueryResponse { + return o && (o.$typeUrl === QueryDenomOwnersByQueryResponse.typeUrl || Array.isArray(o.denomOwners) && (!o.denomOwners.length || DenomOwner.is(o.denomOwners[0]))); + }, + isAmino(o: any): o is QueryDenomOwnersByQueryResponseAmino { + return o && (o.$typeUrl === QueryDenomOwnersByQueryResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isAmino(o.denom_owners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersByQueryResponse.typeUrl, QueryDenomOwnersByQueryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersByQueryResponse.aminoType, QueryDenomOwnersByQueryResponse.typeUrl); +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { + return { + denoms: [], + pagination: undefined + }; +} +export const QuerySendEnabledRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + aminoType: "cosmos-sdk/QuerySendEnabledRequest", + is(o: any): o is QuerySendEnabledRequest { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QuerySendEnabledRequestAmino { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySendEnabledRequest.typeUrl, QuerySendEnabledRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledRequest.aminoType, QuerySendEnabledRequest.typeUrl); +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { + sendEnabled: [], + pagination: undefined + }; +} +export const QuerySendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + aminoType: "cosmos-sdk/QuerySendEnabledResponse", + is(o: any): o is QuerySendEnabledResponse { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0]))); + }, + isAmino(o: any): o is QuerySendEnabledResponseAmino { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QuerySendEnabledResponse.typeUrl, QuerySendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledResponse.aminoType, QuerySendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/bank/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/bank/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..fa81e316 --- /dev/null +++ b/libs/injectivejs/src/cosmos/bank/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const createSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSend.typeUrl, + encoders: toEncoders(MsgSend), + converters: toConverters(MsgSend) +}); +export const createMultiSend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMultiSend.typeUrl, + encoders: toEncoders(MsgMultiSend), + converters: toConverters(MsgMultiSend) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSetSendEnabled = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetSendEnabled.typeUrl, + encoders: toEncoders(MsgSetSendEnabled), + converters: toConverters(MsgSetSendEnabled) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/bank/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..afc67365 --- /dev/null +++ b/libs/injectivejs/src/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,861 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Input, InputAmino, Output, OutputAmino, Params, ParamsAmino, SendEnabled, SendEnabledAmino } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSend"; + value: Uint8Array; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendAmino { + from_address: string; + to_address: string; + amount: CoinAmino[]; +} +export interface MsgSendAminoMsg { + type: "cosmos-sdk/MsgSend"; + value: MsgSendAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse"; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: "cosmos-sdk/MsgSendResponse"; + value: MsgSendResponseAmino; +} +/** 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[]; +} +export interface MsgMultiSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend"; + value: Uint8Array; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendAmino { + /** + * 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"; + value: MsgMultiSendAmino; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse"; + value: Uint8Array; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseAmino {} +export interface MsgMultiSendResponseAminoMsg { + type: "cosmos-sdk/MsgMultiSendResponse"; + value: MsgMultiSendResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSend(): MsgSend { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + aminoType: "cosmos-sdk/MsgSend", + is(o: any): o is MsgSend { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgSendAmino { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: MsgSend, 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): 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.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: DeepPartial): MsgSend { + const message = createBaseMsgSend(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSendAmino): MsgSend { + const message = createBaseMsgSend(); + 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: MsgSend): MsgSendAmino { + 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: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: "cosmos-sdk/MsgSend", + 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.bank.v1beta1.MsgSend", + value: MsgSend.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSend.typeUrl, MsgSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSend.aminoType, MsgSend.typeUrl); +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} +export const MsgSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + aminoType: "cosmos-sdk/MsgSendResponse", + is(o: any): o is MsgSendResponse { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendResponseAmino { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + 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(_: DeepPartial): 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.bank.v1beta1.MsgSendResponse", + value: MsgSendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendResponse.typeUrl, MsgSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendResponse.aminoType, MsgSendResponse.typeUrl); +function createBaseMsgMultiSend(): MsgMultiSend { + return { + inputs: [], + outputs: [] + }; +} +export const MsgMultiSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + aminoType: "cosmos-sdk/MsgMultiSend", + is(o: any): o is MsgMultiSend { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.is(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.is(o.outputs[0]))); + }, + isAmino(o: any): o is MsgMultiSendAmino { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.isAmino(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.isAmino(o.outputs[0]))); + }, + encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromPartial(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgMultiSendAmino): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgMultiSend): MsgMultiSendAmino { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map(e => e ? Input.toAmino(e) : undefined); + } else { + obj.inputs = message.inputs; + } + if (message.outputs) { + obj.outputs = message.outputs.map(e => e ? Output.toAmino(e) : undefined); + } else { + obj.outputs = message.outputs; + } + return obj; + }, + fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { + return MsgMultiSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSend", + value: MsgMultiSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { + return MsgMultiSend.decode(message.value); + }, + toProto(message: MsgMultiSend): Uint8Array { + return MsgMultiSend.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSend): MsgMultiSendProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMultiSend.typeUrl, MsgMultiSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSend.aminoType, MsgMultiSend.typeUrl); +function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { + return {}; +} +export const MsgMultiSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + aminoType: "cosmos-sdk/MsgMultiSendResponse", + is(o: any): o is MsgMultiSendResponse { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgMultiSendResponseAmino { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSendResponse", + value: MsgMultiSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.decode(message.value); + }, + toProto(message: MsgMultiSendResponse): Uint8Array { + return MsgMultiSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + value: MsgMultiSendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMultiSendResponse.typeUrl, MsgMultiSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSendResponse.aminoType, MsgMultiSendResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: "", + sendEnabled: [], + useDefaultFor: [] + }; +} +export const MsgSetSendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + aminoType: "cosmos-sdk/MsgSetSendEnabled", + is(o: any): o is MsgSetSendEnabled { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && Array.isArray(o.useDefaultFor) && (!o.useDefaultFor.length || typeof o.useDefaultFor[0] === "string")); + }, + isAmino(o: any): o is MsgSetSendEnabledAmino { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && Array.isArray(o.use_default_for) && (!o.use_default_for.length || typeof o.use_default_for[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabled.typeUrl, MsgSetSendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabled.aminoType, MsgSetSendEnabled.typeUrl); +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + aminoType: "cosmos-sdk/MsgSetSendEnabledResponse", + is(o: any): o is MsgSetSendEnabledResponse { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetSendEnabledResponseAmino { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabledResponse.typeUrl, MsgSetSendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabledResponse.aminoType, MsgSetSendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/base/abci/v1beta1/abci.ts b/libs/injectivejs/src/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 00000000..06316ec9 --- /dev/null +++ b/libs/injectivejs/src/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,1698 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Event, EventAmino } from "../../../../tendermint/abci/types"; +import { Block, BlockAmino } from "../../../../tendermint/types/block"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponse { + /** The block height */ + height: bigint; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + rawLog: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLog[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gasWanted: bigint; + /** Amount of gas consumed by transaction. */ + gasUsed: bigint; + /** The request transaction bytes. */ + tx?: Any; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; + /** + * 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. 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 + */ + events: Event[]; +} +export interface TxResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse"; + value: Uint8Array; +} +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponseAmino { + /** The block height */ + height: string; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + raw_log: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLogAmino[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gas_wanted: string; + /** Amount of gas consumed by transaction. */ + gas_used: string; + /** The request transaction bytes. */ + tx?: AnyAmino; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; + /** + * 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. 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 + */ + events: EventAmino[]; +} +export interface TxResponseAminoMsg { + type: "cosmos-sdk/TxResponse"; + value: TxResponseAmino; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLog { + msgIndex: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEvent[]; +} +export interface ABCIMessageLogProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog"; + value: Uint8Array; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLogAmino { + msg_index: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEventAmino[]; +} +export interface ABCIMessageLogAminoMsg { + type: "cosmos-sdk/ABCIMessageLog"; + value: ABCIMessageLogAmino; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEvent { + type: string; + attributes: Attribute[]; +} +export interface StringEventProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent"; + value: Uint8Array; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEventAmino { + type: string; + attributes: AttributeAmino[]; +} +export interface StringEventAminoMsg { + type: "cosmos-sdk/StringEvent"; + value: StringEventAmino; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface Attribute { + key: string; + value: string; +} +export interface AttributeProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute"; + value: Uint8Array; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface AttributeAmino { + key: string; + value: string; +} +export interface AttributeAminoMsg { + type: "cosmos-sdk/Attribute"; + value: AttributeAmino; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfo { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gasWanted: bigint; + /** GasUsed is the amount of gas actually consumed. */ + gasUsed: bigint; +} +export interface GasInfoProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; + value: Uint8Array; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfoAmino { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gas_wanted: string; + /** GasUsed is the amount of gas actually consumed. */ + gas_used: string; +} +export interface GasInfoAminoMsg { + type: "cosmos-sdk/GasInfo"; + value: GasInfoAmino; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +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; + /** + * Events contains a slice of Event objects that were emitted during message + * 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"; + value: Uint8Array; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +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; + /** + * Events contains a slice of Event objects that were emitted during message + * 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"; + value: ResultAmino; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponse { + gasInfo: GasInfo; + result?: Result; +} +export interface SimulationResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; + value: Uint8Array; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponseAmino { + gas_info: GasInfoAmino; + result?: ResultAmino; +} +export interface SimulationResponseAminoMsg { + type: "cosmos-sdk/SimulationResponse"; + value: SimulationResponseAmino; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgData { + msgType: string; + data: Uint8Array; +} +export interface MsgDataProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData"; + value: Uint8Array; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgDataAmino { + msg_type: string; + data: string; +} +export interface MsgDataAminoMsg { + type: "cosmos-sdk/MsgData"; + value: MsgDataAmino; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * 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"; + value: Uint8Array; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * 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"; + value: TxMsgDataAmino; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResult { + /** Count of all txs */ + totalCount: bigint; + /** Count of txs in current page */ + count: bigint; + /** Index of current page, start from 1 */ + pageNumber: bigint; + /** Count of total pages */ + pageTotal: bigint; + /** Max count txs per page */ + limit: bigint; + /** List of txs in current page */ + txs: TxResponse[]; +} +export interface SearchTxsResultProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult"; + value: Uint8Array; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResultAmino { + /** Count of all txs */ + total_count: string; + /** Count of txs in current page */ + count: string; + /** Index of current page, start from 1 */ + page_number: string; + /** Count of total pages */ + page_total: string; + /** Max count txs per page */ + limit: string; + /** List of txs in current page */ + txs: TxResponseAmino[]; +} +export interface SearchTxsResultAminoMsg { + type: "cosmos-sdk/SearchTxsResult"; + value: SearchTxsResultAmino; +} +/** 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; +} +function createBaseTxResponse(): TxResponse { + return { + height: BigInt(0), + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + logs: [], + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + tx: undefined, + timestamp: "", + events: [] + }; +} +export const TxResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + aminoType: "cosmos-sdk/TxResponse", + is(o: any): o is TxResponse { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.rawLog === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.is(o.logs[0])) && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0]))); + }, + isAmino(o: any): o is TxResponseAmino { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.raw_log === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.isAmino(o.logs[0])) && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0]))); + }, + encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.txhash !== "") { + writer.uint32(18).string(message.txhash); + } + if (message.codespace !== "") { + writer.uint32(26).string(message.codespace); + } + if (message.code !== 0) { + writer.uint32(32).uint32(message.code); + } + if (message.data !== "") { + writer.uint32(42).string(message.data); + } + if (message.rawLog !== "") { + writer.uint32(50).string(message.rawLog); + } + for (const v of message.logs) { + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.info !== "") { + writer.uint32(66).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(72).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(80).int64(message.gasUsed); + } + if (message.tx !== undefined) { + Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + } + if (message.timestamp !== "") { + writer.uint32(98).string(message.timestamp); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64(); + break; + case 10: + message.gasUsed = reader.int64(); + break; + case 11: + message.tx = Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + case 13: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponse { + const message = createBaseTxResponse(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.txhash = object.txhash ?? ""; + message.codespace = object.codespace ?? ""; + message.code = object.code ?? 0; + message.data = object.data ?? ""; + message.rawLog = object.rawLog ?? ""; + message.logs = object.logs?.map(e => ABCIMessageLog.fromPartial(e)) || []; + 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.tx = object.tx !== undefined && object.tx !== null ? Any.fromPartial(object.tx) : undefined; + message.timestamp = object.timestamp ?? ""; + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxResponseAmino): TxResponse { + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + 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); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxResponse): TxResponseAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.txhash = message.txhash === "" ? undefined : message.txhash; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data === "" ? undefined : message.data; + obj.raw_log = message.rawLog === "" ? undefined : message.rawLog; + if (message.logs) { + obj.logs = message.logs.map(e => e ? ABCIMessageLog.toAmino(e) : undefined); + } else { + obj.logs = message.logs; + } + 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; + obj.tx = message.tx ? Any.toAmino(message.tx) : undefined; + obj.timestamp = message.timestamp === "" ? undefined : message.timestamp; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: TxResponseAminoMsg): TxResponse { + return TxResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxResponse): TxResponseAminoMsg { + return { + type: "cosmos-sdk/TxResponse", + value: TxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxResponseProtoMsg): TxResponse { + return TxResponse.decode(message.value); + }, + toProto(message: TxResponse): Uint8Array { + return TxResponse.encode(message).finish(); + }, + toProtoMsg(message: TxResponse): TxResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + value: TxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponse.typeUrl, TxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxResponse.aminoType, TxResponse.typeUrl); +function createBaseABCIMessageLog(): ABCIMessageLog { + return { + msgIndex: 0, + log: "", + events: [] + }; +} +export const ABCIMessageLog = { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + aminoType: "cosmos-sdk/ABCIMessageLog", + is(o: any): o is ABCIMessageLog { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msgIndex === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.is(o.events[0]))); + }, + isAmino(o: any): o is ABCIMessageLogAmino { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msg_index === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.isAmino(o.events[0]))); + }, + encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgIndex !== 0) { + writer.uint32(8).uint32(message.msgIndex); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIMessageLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + message.msgIndex = object.msgIndex ?? 0; + message.log = object.log ?? ""; + message.events = object.events?.map(e => StringEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { + const obj: any = {}; + 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); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: ABCIMessageLogAminoMsg): ABCIMessageLog { + return ABCIMessageLog.fromAmino(object.value); + }, + toAminoMsg(message: ABCIMessageLog): ABCIMessageLogAminoMsg { + return { + type: "cosmos-sdk/ABCIMessageLog", + value: ABCIMessageLog.toAmino(message) + }; + }, + fromProtoMsg(message: ABCIMessageLogProtoMsg): ABCIMessageLog { + return ABCIMessageLog.decode(message.value); + }, + toProto(message: ABCIMessageLog): Uint8Array { + return ABCIMessageLog.encode(message).finish(); + }, + toProtoMsg(message: ABCIMessageLog): ABCIMessageLogProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + value: ABCIMessageLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ABCIMessageLog.typeUrl, ABCIMessageLog); +GlobalDecoderRegistry.registerAminoProtoMapping(ABCIMessageLog.aminoType, ABCIMessageLog.typeUrl); +function createBaseStringEvent(): StringEvent { + return { + type: "", + attributes: [] + }; +} +export const StringEvent = { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + aminoType: "cosmos-sdk/StringEvent", + is(o: any): o is StringEvent { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.is(o.attributes[0]))); + }, + isAmino(o: any): o is StringEventAmino { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.isAmino(o.attributes[0]))); + }, + encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StringEvent { + const message = createBaseStringEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => Attribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StringEventAmino): StringEvent { + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: StringEvent): StringEventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? Attribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: StringEventAminoMsg): StringEvent { + return StringEvent.fromAmino(object.value); + }, + toAminoMsg(message: StringEvent): StringEventAminoMsg { + return { + type: "cosmos-sdk/StringEvent", + value: StringEvent.toAmino(message) + }; + }, + fromProtoMsg(message: StringEventProtoMsg): StringEvent { + return StringEvent.decode(message.value); + }, + toProto(message: StringEvent): Uint8Array { + return StringEvent.encode(message).finish(); + }, + toProtoMsg(message: StringEvent): StringEventProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + value: StringEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StringEvent.typeUrl, StringEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(StringEvent.aminoType, StringEvent.typeUrl); +function createBaseAttribute(): Attribute { + return { + key: "", + value: "" + }; +} +export const Attribute = { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + aminoType: "cosmos-sdk/Attribute", + is(o: any): o is Attribute { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + isAmino(o: any): o is AttributeAmino { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + encode(message: Attribute, 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): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + 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: DeepPartial): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: AttributeAmino): Attribute { + const message = createBaseAttribute(); + 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: Attribute): AttributeAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AttributeAminoMsg): Attribute { + return Attribute.fromAmino(object.value); + }, + toAminoMsg(message: Attribute): AttributeAminoMsg { + return { + type: "cosmos-sdk/Attribute", + value: Attribute.toAmino(message) + }; + }, + fromProtoMsg(message: AttributeProtoMsg): Attribute { + return Attribute.decode(message.value); + }, + toProto(message: Attribute): Uint8Array { + return Attribute.encode(message).finish(); + }, + toProtoMsg(message: Attribute): AttributeProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + value: Attribute.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Attribute.typeUrl, Attribute); +GlobalDecoderRegistry.registerAminoProtoMapping(Attribute.aminoType, Attribute.typeUrl); +function createBaseGasInfo(): GasInfo { + return { + gasWanted: BigInt(0), + gasUsed: BigInt(0) + }; +} +export const GasInfo = { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + aminoType: "cosmos-sdk/GasInfo", + is(o: any): o is GasInfo { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint"); + }, + isAmino(o: any): o is GasInfoAmino { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint"); + }, + encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasWanted !== BigInt(0)) { + writer.uint32(8).uint64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(16).uint64(message.gasUsed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64(); + break; + case 2: + message.gasUsed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GasInfo { + const message = createBaseGasInfo(); + 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); + return message; + }, + fromAmino(object: GasInfoAmino): GasInfo { + const message = createBaseGasInfo(); + 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); + } + return message; + }, + toAmino(message: GasInfo): GasInfoAmino { + const obj: any = {}; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted?.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GasInfoAminoMsg): GasInfo { + return GasInfo.fromAmino(object.value); + }, + toAminoMsg(message: GasInfo): GasInfoAminoMsg { + return { + type: "cosmos-sdk/GasInfo", + value: GasInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GasInfoProtoMsg): GasInfo { + return GasInfo.decode(message.value); + }, + toProto(message: GasInfo): Uint8Array { + return GasInfo.encode(message).finish(); + }, + toProtoMsg(message: GasInfo): GasInfoProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + value: GasInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GasInfo.typeUrl, GasInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GasInfo.aminoType, GasInfo.typeUrl); +function createBaseResult(): Result { + return { + data: new Uint8Array(), + log: "", + events: [], + msgResponses: [] + }; +} +export const Result = { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + aminoType: "cosmos-sdk/Result", + is(o: any): o is Result { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isAmino(o: any): o is ResultAmino { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, + encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Result { + const message = createBaseResult(); + 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 { + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + 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 { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } 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 { + return Result.fromAmino(object.value); + }, + toAminoMsg(message: Result): ResultAminoMsg { + return { + type: "cosmos-sdk/Result", + value: Result.toAmino(message) + }; + }, + fromProtoMsg(message: ResultProtoMsg): Result { + return Result.decode(message.value); + }, + toProto(message: Result): Uint8Array { + return Result.encode(message).finish(); + }, + toProtoMsg(message: Result): ResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + value: Result.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Result.typeUrl, Result); +GlobalDecoderRegistry.registerAminoProtoMapping(Result.aminoType, Result.typeUrl); +function createBaseSimulationResponse(): SimulationResponse { + return { + gasInfo: GasInfo.fromPartial({}), + result: undefined + }; +} +export const SimulationResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + aminoType: "cosmos-sdk/SimulationResponse", + is(o: any): o is SimulationResponse { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.is(o.gasInfo)); + }, + isAmino(o: any): o is SimulationResponseAmino { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.isAmino(o.gas_info)); + }, + encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulationResponse { + const message = createBaseSimulationResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulationResponseAmino): SimulationResponse { + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulationResponse): SimulationResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulationResponseAminoMsg): SimulationResponse { + return SimulationResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulationResponse): SimulationResponseAminoMsg { + return { + type: "cosmos-sdk/SimulationResponse", + value: SimulationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulationResponseProtoMsg): SimulationResponse { + return SimulationResponse.decode(message.value); + }, + toProto(message: SimulationResponse): Uint8Array { + return SimulationResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulationResponse): SimulationResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + value: SimulationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulationResponse.typeUrl, SimulationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulationResponse.aminoType, SimulationResponse.typeUrl); +function createBaseMsgData(): MsgData { + return { + msgType: "", + data: new Uint8Array() + }; +} +export const MsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + aminoType: "cosmos-sdk/MsgData", + is(o: any): o is MsgData { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msgType === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgDataAmino { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msg_type === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgType !== "") { + writer.uint32(10).string(message.msgType); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgData { + const message = createBaseMsgData(); + message.msgType = object.msgType ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgDataAmino): MsgData { + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgData): MsgDataAmino { + const obj: any = {}; + obj.msg_type = message.msgType === "" ? undefined : message.msgType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDataAminoMsg): MsgData { + return MsgData.fromAmino(object.value); + }, + toAminoMsg(message: MsgData): MsgDataAminoMsg { + return { + type: "cosmos-sdk/MsgData", + value: MsgData.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDataProtoMsg): MsgData { + return MsgData.decode(message.value); + }, + toProto(message: MsgData): Uint8Array { + return MsgData.encode(message).finish(); + }, + toProtoMsg(message: MsgData): MsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + value: MsgData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgData.typeUrl, MsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgData.aminoType, MsgData.typeUrl); +function createBaseTxMsgData(): TxMsgData { + return { + data: [], + msgResponses: [] + }; +} +export const TxMsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + aminoType: "cosmos-sdk/TxMsgData", + is(o: any): o is TxMsgData { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.is(o.data[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isAmino(o: any): o is TxMsgDataAmino { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.isAmino(o.data[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, + encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? MsgData.toAmino(e) : undefined); + } 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 { + return TxMsgData.fromAmino(object.value); + }, + toAminoMsg(message: TxMsgData): TxMsgDataAminoMsg { + return { + type: "cosmos-sdk/TxMsgData", + value: TxMsgData.toAmino(message) + }; + }, + fromProtoMsg(message: TxMsgDataProtoMsg): TxMsgData { + return TxMsgData.decode(message.value); + }, + toProto(message: TxMsgData): Uint8Array { + return TxMsgData.encode(message).finish(); + }, + toProtoMsg(message: TxMsgData): TxMsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + value: TxMsgData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxMsgData.typeUrl, TxMsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(TxMsgData.aminoType, TxMsgData.typeUrl); +function createBaseSearchTxsResult(): SearchTxsResult { + return { + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), + txs: [] + }; +} +export const SearchTxsResult = { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + aminoType: "cosmos-sdk/SearchTxsResult", + is(o: any): o is SearchTxsResult { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.totalCount === "bigint" && typeof o.count === "bigint" && typeof o.pageNumber === "bigint" && typeof o.pageTotal === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.is(o.txs[0]))); + }, + isAmino(o: any): o is SearchTxsResultAmino { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.isAmino(o.txs[0]))); + }, + encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { + writer.uint32(8).uint64(message.totalCount); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + if (message.pageNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.pageNumber); + } + if (message.pageTotal !== BigInt(0)) { + writer.uint32(32).uint64(message.pageTotal); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } + for (const v of message.txs) { + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSearchTxsResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + case 3: + message.pageNumber = reader.uint64(); + break; + case 4: + message.pageTotal = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; + case 6: + message.txs.push(TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SearchTxsResult { + const message = createBaseSearchTxsResult(); + 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.txs = object.txs?.map(e => TxResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SearchTxsResultAmino): SearchTxsResult { + const message = createBaseSearchTxsResult(); + 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.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: SearchTxsResult): SearchTxsResultAmino { + 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.txs) { + obj.txs = message.txs.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: SearchTxsResultAminoMsg): SearchTxsResult { + return SearchTxsResult.fromAmino(object.value); + }, + toAminoMsg(message: SearchTxsResult): SearchTxsResultAminoMsg { + return { + type: "cosmos-sdk/SearchTxsResult", + value: SearchTxsResult.toAmino(message) + }; + }, + fromProtoMsg(message: SearchTxsResultProtoMsg): SearchTxsResult { + return SearchTxsResult.decode(message.value); + }, + toProto(message: SearchTxsResult): Uint8Array { + return SearchTxsResult.encode(message).finish(); + }, + toProtoMsg(message: SearchTxsResult): SearchTxsResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + value: SearchTxsResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SearchTxsResult.typeUrl, SearchTxsResult); +GlobalDecoderRegistry.registerAminoProtoMapping(SearchTxsResult.aminoType, SearchTxsResult.typeUrl); +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", + aminoType: "cosmos-sdk/SearchBlocksResult", + is(o: any): o is SearchBlocksResult { + return o && (o.$typeUrl === SearchBlocksResult.typeUrl || typeof o.totalCount === "bigint" && typeof o.count === "bigint" && typeof o.pageNumber === "bigint" && typeof o.pageTotal === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.blocks) && (!o.blocks.length || Block.is(o.blocks[0]))); + }, + isAmino(o: any): o is SearchBlocksResultAmino { + return o && (o.$typeUrl === SearchBlocksResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.blocks) && (!o.blocks.length || Block.isAmino(o.blocks[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SearchBlocksResult.typeUrl, SearchBlocksResult); +GlobalDecoderRegistry.registerAminoProtoMapping(SearchBlocksResult.aminoType, SearchBlocksResult.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/base/query/v1beta1/pagination.ts b/libs/injectivejs/src/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..35272ec2 --- /dev/null +++ b/libs/injectivejs/src/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,361 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: 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; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} +export interface PageRequestProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest"; + value: Uint8Array; +} +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequestAmino { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: string; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: 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; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} +export interface PageRequestAminoMsg { + type: "cosmos-sdk/PageRequest"; + value: PageRequestAmino; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + nextKey: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: bigint; +} +export interface PageResponseProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; + value: Uint8Array; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponseAmino { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + next_key: string; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: string; +} +export interface PageResponseAminoMsg { + type: "cosmos-sdk/PageResponse"; + value: PageResponseAmino; +} +function createBasePageRequest(): PageRequest { + return { + key: new Uint8Array(), + offset: BigInt(0), + limit: BigInt(0), + countTotal: false, + reverse: false + }; +} +export const PageRequest = { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + aminoType: "cosmos-sdk/PageRequest", + is(o: any): o is PageRequest { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.countTotal === "boolean" && typeof o.reverse === "boolean"); + }, + isAmino(o: any): o is PageRequestAmino { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.count_total === "boolean" && typeof o.reverse === "boolean"); + }, + encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== BigInt(0)) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset !== undefined && object.offset !== null ? BigInt(object.offset.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, + fromAmino(object: PageRequestAmino): PageRequest { + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; + }, + toAmino(message: PageRequest): PageRequestAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.offset = message.offset !== BigInt(0) ? message.offset?.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.count_total = message.countTotal === false ? undefined : message.countTotal; + obj.reverse = message.reverse === false ? undefined : message.reverse; + return obj; + }, + fromAminoMsg(object: PageRequestAminoMsg): PageRequest { + return PageRequest.fromAmino(object.value); + }, + toAminoMsg(message: PageRequest): PageRequestAminoMsg { + return { + type: "cosmos-sdk/PageRequest", + value: PageRequest.toAmino(message) + }; + }, + fromProtoMsg(message: PageRequestProtoMsg): PageRequest { + return PageRequest.decode(message.value); + }, + toProto(message: PageRequest): Uint8Array { + return PageRequest.encode(message).finish(); + }, + toProtoMsg(message: PageRequest): PageRequestProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + value: PageRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PageRequest.typeUrl, PageRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PageRequest.aminoType, PageRequest.typeUrl); +function createBasePageResponse(): PageResponse { + return { + nextKey: new Uint8Array(), + total: BigInt(0) + }; +} +export const PageResponse = { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + aminoType: "cosmos-sdk/PageResponse", + is(o: any): o is PageResponse { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.nextKey instanceof Uint8Array || typeof o.nextKey === "string") && typeof o.total === "bigint"); + }, + isAmino(o: any): o is PageResponseAmino { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.next_key instanceof Uint8Array || typeof o.next_key === "string") && typeof o.total === "bigint"); + }, + encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextKey.length !== 0) { + writer.uint32(10).bytes(message.nextKey); + } + if (message.total !== BigInt(0)) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PageResponseAmino): PageResponse { + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; + }, + toAmino(message: PageResponse): PageResponseAmino { + const obj: any = {}; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; + obj.total = message.total !== BigInt(0) ? message.total?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PageResponseAminoMsg): PageResponse { + return PageResponse.fromAmino(object.value); + }, + toAminoMsg(message: PageResponse): PageResponseAminoMsg { + return { + type: "cosmos-sdk/PageResponse", + value: PageResponse.toAmino(message) + }; + }, + fromProtoMsg(message: PageResponseProtoMsg): PageResponse { + return PageResponse.decode(message.value); + }, + toProto(message: PageResponse): Uint8Array { + return PageResponse.encode(message).finish(); + }, + toProtoMsg(message: PageResponse): PageResponseProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + value: PageResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PageResponse.typeUrl, PageResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PageResponse.aminoType, PageResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/base/v1beta1/coin.ts b/libs/injectivejs/src/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..155e8009 --- /dev/null +++ b/libs/injectivejs/src/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,439 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} +export interface CoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.Coin"; + value: Uint8Array; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinAmino { + denom: string; + amount: string; +} +export interface CoinAminoMsg { + type: "cosmos-sdk/Coin"; + value: CoinAmino; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} +export interface DecCoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecCoin"; + value: Uint8Array; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinAmino { + denom: string; + amount: string; +} +export interface DecCoinAminoMsg { + type: "cosmos-sdk/DecCoin"; + value: DecCoinAmino; +} +/** + * 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; +} +export interface IntProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.IntProto"; + value: Uint8Array; +} +/** + * 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; +} +export interface IntProtoAminoMsg { + type: "cosmos-sdk/IntProto"; + value: IntProtoAmino; +} +/** + * 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; +} +export interface DecProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecProto"; + value: Uint8Array; +} +/** + * 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; +} +export interface DecProtoAminoMsg { + type: "cosmos-sdk/DecProto"; + value: DecProtoAmino; +} +function createBaseCoin(): Coin { + return { + denom: "", + amount: "" + }; +} +export const Coin = { + typeUrl: "/cosmos.base.v1beta1.Coin", + aminoType: "cosmos-sdk/Coin", + is(o: any): o is Coin { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is CoinAmino { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: CoinAmino): Coin { + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Coin): CoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount ?? ""; + return obj; + }, + fromAminoMsg(object: CoinAminoMsg): Coin { + return Coin.fromAmino(object.value); + }, + toAminoMsg(message: Coin): CoinAminoMsg { + return { + type: "cosmos-sdk/Coin", + value: Coin.toAmino(message) + }; + }, + fromProtoMsg(message: CoinProtoMsg): Coin { + return Coin.decode(message.value); + }, + toProto(message: Coin): Uint8Array { + return Coin.encode(message).finish(); + }, + toProtoMsg(message: Coin): CoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.Coin", + value: Coin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Coin.typeUrl, Coin); +GlobalDecoderRegistry.registerAminoProtoMapping(Coin.aminoType, Coin.typeUrl); +function createBaseDecCoin(): DecCoin { + return { + denom: "", + amount: "" + }; +} +export const DecCoin = { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + aminoType: "cosmos-sdk/DecCoin", + is(o: any): o is DecCoin { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is DecCoinAmino { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: DecCoinAmino): DecCoin { + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: DecCoin): DecCoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: DecCoinAminoMsg): DecCoin { + return DecCoin.fromAmino(object.value); + }, + toAminoMsg(message: DecCoin): DecCoinAminoMsg { + return { + type: "cosmos-sdk/DecCoin", + value: DecCoin.toAmino(message) + }; + }, + fromProtoMsg(message: DecCoinProtoMsg): DecCoin { + return DecCoin.decode(message.value); + }, + toProto(message: DecCoin): Uint8Array { + return DecCoin.encode(message).finish(); + }, + toProtoMsg(message: DecCoin): DecCoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + value: DecCoin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DecCoin.typeUrl, DecCoin); +GlobalDecoderRegistry.registerAminoProtoMapping(DecCoin.aminoType, DecCoin.typeUrl); +function createBaseIntProto(): IntProto { + return { + int: "" + }; +} +export const IntProto = { + typeUrl: "/cosmos.base.v1beta1.IntProto", + aminoType: "cosmos-sdk/IntProto", + is(o: any): o is IntProto { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + isAmino(o: any): o is IntProtoAmino { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; + return message; + }, + fromAmino(object: IntProtoAmino): IntProto { + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; + }, + toAmino(message: IntProto): IntProtoAmino { + const obj: any = {}; + obj.int = message.int === "" ? undefined : message.int; + return obj; + }, + fromAminoMsg(object: IntProtoAminoMsg): IntProto { + return IntProto.fromAmino(object.value); + }, + toAminoMsg(message: IntProto): IntProtoAminoMsg { + return { + type: "cosmos-sdk/IntProto", + value: IntProto.toAmino(message) + }; + }, + fromProtoMsg(message: IntProtoProtoMsg): IntProto { + return IntProto.decode(message.value); + }, + toProto(message: IntProto): Uint8Array { + return IntProto.encode(message).finish(); + }, + toProtoMsg(message: IntProto): IntProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.IntProto", + value: IntProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IntProto.typeUrl, IntProto); +GlobalDecoderRegistry.registerAminoProtoMapping(IntProto.aminoType, IntProto.typeUrl); +function createBaseDecProto(): DecProto { + return { + dec: "" + }; +} +export const DecProto = { + typeUrl: "/cosmos.base.v1beta1.DecProto", + aminoType: "cosmos-sdk/DecProto", + is(o: any): o is DecProto { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + isAmino(o: any): o is DecProtoAmino { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; + return message; + }, + fromAmino(object: DecProtoAmino): DecProto { + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; + }, + toAmino(message: DecProto): DecProtoAmino { + const obj: any = {}; + obj.dec = message.dec === "" ? undefined : message.dec; + return obj; + }, + fromAminoMsg(object: DecProtoAminoMsg): DecProto { + return DecProto.fromAmino(object.value); + }, + toAminoMsg(message: DecProto): DecProtoAminoMsg { + return { + type: "cosmos-sdk/DecProto", + value: DecProto.toAmino(message) + }; + }, + fromProtoMsg(message: DecProtoProtoMsg): DecProto { + return DecProto.decode(message.value); + }, + toProto(message: DecProto): Uint8Array { + return DecProto.encode(message).finish(); + }, + toProtoMsg(message: DecProto): DecProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecProto", + value: DecProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DecProto.typeUrl, DecProto); +GlobalDecoderRegistry.registerAminoProtoMapping(DecProto.aminoType, DecProto.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/crypto/ed25519/keys.ts b/libs/injectivejs/src/cosmos/crypto/ed25519/keys.ts new file mode 100644 index 00000000..6f544d77 --- /dev/null +++ b/libs/injectivejs/src/cosmos/crypto/ed25519/keys.ts @@ -0,0 +1,209 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * 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. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PubKey"; + value: Uint8Array; +} +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * 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. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "tendermint/PubKeyEd25519"; + value: PubKeyAmino; +} +/** + * 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 { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PrivKey"; + value: Uint8Array; +} +/** + * 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: "tendermint/PrivKeyEd25519"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + aminoType: "tendermint/PubKeyEd25519", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "tendermint/PubKeyEd25519", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + aminoType: "tendermint/PrivKeyEd25519", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "tendermint/PrivKeyEd25519", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/libs/injectivejs/src/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..1d46639b --- /dev/null +++ b/libs/injectivejs/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,225 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} +export interface MultiSignatureProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature"; + value: Uint8Array; +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureAmino { + signatures: string[]; +} +export interface MultiSignatureAminoMsg { + type: "cosmos-sdk/MultiSignature"; + value: MultiSignatureAmino; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} +export interface CompactBitArrayProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray"; + value: Uint8Array; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArrayAmino { + extra_bits_stored: number; + elems: string; +} +export interface CompactBitArrayAminoMsg { + type: "cosmos-sdk/CompactBitArray"; + value: CompactBitArrayAmino; +} +function createBaseMultiSignature(): MultiSignature { + return { + signatures: [] + }; +} +export const MultiSignature = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + aminoType: "cosmos-sdk/MultiSignature", + is(o: any): o is MultiSignature { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MultiSignatureAmino { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMultiSignature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MultiSignatureAmino): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MultiSignature): MultiSignatureAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MultiSignatureAminoMsg): MultiSignature { + return MultiSignature.fromAmino(object.value); + }, + toAminoMsg(message: MultiSignature): MultiSignatureAminoMsg { + return { + type: "cosmos-sdk/MultiSignature", + value: MultiSignature.toAmino(message) + }; + }, + fromProtoMsg(message: MultiSignatureProtoMsg): MultiSignature { + return MultiSignature.decode(message.value); + }, + toProto(message: MultiSignature): Uint8Array { + return MultiSignature.encode(message).finish(); + }, + toProtoMsg(message: MultiSignature): MultiSignatureProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + value: MultiSignature.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MultiSignature.typeUrl, MultiSignature); +GlobalDecoderRegistry.registerAminoProtoMapping(MultiSignature.aminoType, MultiSignature.typeUrl); +function createBaseCompactBitArray(): CompactBitArray { + return { + extraBitsStored: 0, + elems: new Uint8Array() + }; +} +export const CompactBitArray = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + aminoType: "cosmos-sdk/CompactBitArray", + is(o: any): o is CompactBitArray { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extraBitsStored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + isAmino(o: any): o is CompactBitArrayAmino { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extra_bits_stored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.extraBitsStored !== 0) { + writer.uint32(8).uint32(message.extraBitsStored); + } + if (message.elems.length !== 0) { + writer.uint32(18).bytes(message.elems); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompactBitArray(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CompactBitArray { + const message = createBaseCompactBitArray(); + message.extraBitsStored = object.extraBitsStored ?? 0; + message.elems = object.elems ?? new Uint8Array(); + return message; + }, + fromAmino(object: CompactBitArrayAmino): CompactBitArray { + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + toAmino(message: CompactBitArray): CompactBitArrayAmino { + const obj: any = {}; + obj.extra_bits_stored = message.extraBitsStored === 0 ? undefined : message.extraBitsStored; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; + return obj; + }, + fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { + return CompactBitArray.fromAmino(object.value); + }, + toAminoMsg(message: CompactBitArray): CompactBitArrayAminoMsg { + return { + type: "cosmos-sdk/CompactBitArray", + value: CompactBitArray.toAmino(message) + }; + }, + fromProtoMsg(message: CompactBitArrayProtoMsg): CompactBitArray { + return CompactBitArray.decode(message.value); + }, + toProto(message: CompactBitArray): Uint8Array { + return CompactBitArray.encode(message).finish(); + }, + toProtoMsg(message: CompactBitArray): CompactBitArrayProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + value: CompactBitArray.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CompactBitArray.typeUrl, CompactBitArray); +GlobalDecoderRegistry.registerAminoProtoMapping(CompactBitArray.aminoType, CompactBitArray.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/crypto/secp256k1/keys.ts b/libs/injectivejs/src/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..c0fdd0ac --- /dev/null +++ b/libs/injectivejs/src/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,203 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PubKey"; + value: Uint8Array; +} +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "tendermint/PubKeySecp256k1"; + value: PubKeyAmino; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKeyAmino { + key: string; +} +export interface PrivKeyAminoMsg { + type: "tendermint/PrivKeySecp256k1"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + aminoType: "tendermint/PubKeySecp256k1", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "tendermint/PubKeySecp256k1", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + aminoType: "tendermint/PrivKeySecp256k1", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "tendermint/PrivKeySecp256k1", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/crypto/secp256r1/keys.ts b/libs/injectivejs/src/cosmos/crypto/secp256r1/keys.ts new file mode 100644 index 00000000..6b1edf68 --- /dev/null +++ b/libs/injectivejs/src/cosmos/crypto/secp256r1/keys.ts @@ -0,0 +1,201 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKey { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PubKey"; + value: Uint8Array; +} +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKeyAmino { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key: string; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKey { + /** secret number serialized using big-endian encoding */ + secret: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKeyAmino { + /** secret number serialized using big-endian encoding */ + secret: string; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + aminoType: "cosmos-sdk/PubKey", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "cosmos-sdk/PubKey", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + secret: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + aminoType: "cosmos-sdk/PrivKey", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.secret.length !== 0) { + writer.uint32(10).bytes(message.secret); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.secret = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.secret = object.secret ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "cosmos-sdk/PrivKey", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/distribution/v1beta1/distribution.ts b/libs/injectivejs/src/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 00000000..fdf747a5 --- /dev/null +++ b/libs/injectivejs/src/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,1494 @@ +import { DecCoin, DecCoinAmino, Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsAmino { + 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/x/distribution/Params"; + value: ParamsAmino; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; +} +export interface ValidatorHistoricalRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards"; + value: Uint8Array; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsAmino { + cumulative_reward_ratio: DecCoinAmino[]; + reference_count: number; +} +export interface ValidatorHistoricalRewardsAminoMsg { + type: "cosmos-sdk/ValidatorHistoricalRewards"; + value: ValidatorHistoricalRewardsAmino; +} +/** + * 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. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[]; + period: bigint; +} +export interface ValidatorCurrentRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; + value: Uint8Array; +} +/** + * 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. + */ +export interface ValidatorCurrentRewardsAmino { + rewards: DecCoinAmino[]; + period: string; +} +export interface ValidatorCurrentRewardsAminoMsg { + type: "cosmos-sdk/ValidatorCurrentRewards"; + value: ValidatorCurrentRewardsAmino; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[]; +} +export interface ValidatorAccumulatedCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"; + value: Uint8Array; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionAmino { + commission: DecCoinAmino[]; +} +export interface ValidatorAccumulatedCommissionAminoMsg { + type: "cosmos-sdk/ValidatorAccumulatedCommission"; + value: ValidatorAccumulatedCommissionAmino; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[]; +} +export interface ValidatorOutstandingRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards"; + value: Uint8Array; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsAmino { + rewards: DecCoinAmino[]; +} +export interface ValidatorOutstandingRewardsAminoMsg { + type: "cosmos-sdk/ValidatorOutstandingRewards"; + value: ValidatorOutstandingRewardsAmino; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: bigint; + fraction: string; +} +export interface ValidatorSlashEventProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent"; + value: Uint8Array; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventAmino { + validator_period: string; + fraction: string; +} +export interface ValidatorSlashEventAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvent"; + value: ValidatorSlashEventAmino; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[]; +} +export interface ValidatorSlashEventsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents"; + value: Uint8Array; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsAmino { + validator_slash_events: ValidatorSlashEventAmino[]; +} +export interface ValidatorSlashEventsAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvents"; + value: ValidatorSlashEventsAmino; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[]; +} +export interface FeePoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.FeePool"; + value: Uint8Array; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolAmino { + community_pool: DecCoinAmino[]; +} +export interface FeePoolAminoMsg { + type: "cosmos-sdk/FeePool"; + value: FeePoolAmino; +} +/** + * 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; + recipient: string; + amount: Coin[]; +} +export interface CommunityPoolSpendProposalProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; + value: Uint8Array; +} +/** + * 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[]; +} +export interface CommunityPoolSpendProposalAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposal"; + value: CommunityPoolSpendProposalAmino; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: bigint; + stake: string; + height: bigint; +} +export interface DelegatorStartingInfoProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; + value: Uint8Array; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoAmino { + previous_period: string; + stake: string; + height: string; +} +export interface DelegatorStartingInfoAminoMsg { + type: "cosmos-sdk/DelegatorStartingInfo"; + value: DelegatorStartingInfoAmino; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string; + reward: DecCoin[]; +} +export interface DelegationDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward"; + value: Uint8Array; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardAmino { + validator_address: string; + reward: DecCoinAmino[]; +} +export interface DelegationDelegatorRewardAminoMsg { + type: "cosmos-sdk/DelegationDelegatorReward"; + value: DelegationDelegatorRewardAmino; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export interface CommunityPoolSpendProposalWithDepositProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; + value: Uint8Array; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositAmino { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export interface CommunityPoolSpendProposalWithDepositAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; + value: CommunityPoolSpendProposalWithDepositAmino; +} +function createBaseParams(): Params { + return { + communityTax: "", + baseProposerReward: "", + bonusProposerReward: "", + withdrawAddrEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.distribution.v1beta1.Params", + aminoType: "cosmos-sdk/x/distribution/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.communityTax === "string" && typeof o.baseProposerReward === "string" && typeof o.bonusProposerReward === "string" && typeof o.withdrawAddrEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.community_tax === "string" && typeof o.base_proposer_reward === "string" && typeof o.bonus_proposer_reward === "string" && typeof o.withdraw_addr_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.communityTax !== "") { + writer.uint32(10).string(message.communityTax); + } + if (message.baseProposerReward !== "") { + writer.uint32(18).string(message.baseProposerReward); + } + if (message.bonusProposerReward !== "") { + writer.uint32(26).string(message.bonusProposerReward); + } + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled); + } + 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.communityTax = reader.string(); + break; + case 2: + message.baseProposerReward = reader.string(); + break; + case 3: + message.bonusProposerReward = reader.string(); + break; + case 4: + message.withdrawAddrEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.communityTax = object.communityTax ?? ""; + message.baseProposerReward = object.baseProposerReward ?? ""; + message.bonusProposerReward = object.bonusProposerReward ?? ""; + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + 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; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/distribution/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.distribution.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { + return { + cumulativeRewardRatio: [], + referenceCount: 0 + }; +} +export const ValidatorHistoricalRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + aminoType: "cosmos-sdk/ValidatorHistoricalRewards", + is(o: any): o is ValidatorHistoricalRewards { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulativeRewardRatio) && (!o.cumulativeRewardRatio.length || DecCoin.is(o.cumulativeRewardRatio[0])) && typeof o.referenceCount === "number"); + }, + isAmino(o: any): o is ValidatorHistoricalRewardsAmino { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulative_reward_ratio) && (!o.cumulative_reward_ratio.length || DecCoin.isAmino(o.cumulative_reward_ratio[0])) && typeof o.reference_count === "number"); + }, + encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cumulativeRewardRatio) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorHistoricalRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.referenceCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map(e => DecCoin.fromPartial(e)) || []; + message.referenceCount = object.referenceCount ?? 0; + return message; + }, + fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; + }, + toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { + const obj: any = {}; + if (message.cumulativeRewardRatio) { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio; + } + obj.reference_count = message.referenceCount === 0 ? undefined : message.referenceCount; + return obj; + }, + fromAminoMsg(object: ValidatorHistoricalRewardsAminoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorHistoricalRewardsProtoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.decode(message.value); + }, + toProto(message: ValidatorHistoricalRewards): Uint8Array { + return ValidatorHistoricalRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorHistoricalRewards.typeUrl, ValidatorHistoricalRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorHistoricalRewards.aminoType, ValidatorHistoricalRewards.typeUrl); +function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { + return { + rewards: [], + period: BigInt(0) + }; +} +export const ValidatorCurrentRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + aminoType: "cosmos-sdk/ValidatorCurrentRewards", + is(o: any): o is ValidatorCurrentRewards { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0])) && typeof o.period === "bigint"); + }, + isAmino(o: any): o is ValidatorCurrentRewardsAmino { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0])) && typeof o.period === "bigint"); + }, + encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.period !== BigInt(0)) { + writer.uint32(16).uint64(message.period); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorCurrentRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.period = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; + }, + toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + obj.period = message.period !== BigInt(0) ? message.period?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorCurrentRewardsAminoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorCurrentRewards", + value: ValidatorCurrentRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorCurrentRewardsProtoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.decode(message.value); + }, + toProto(message: ValidatorCurrentRewards): Uint8Array { + return ValidatorCurrentRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + value: ValidatorCurrentRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorCurrentRewards.typeUrl, ValidatorCurrentRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorCurrentRewards.aminoType, ValidatorCurrentRewards.typeUrl); +function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { + return { + commission: [] + }; +} +export const ValidatorAccumulatedCommission = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + aminoType: "cosmos-sdk/ValidatorAccumulatedCommission", + is(o: any): o is ValidatorAccumulatedCommission { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.is(o.commission[0]))); + }, + isAmino(o: any): o is ValidatorAccumulatedCommissionAmino { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.isAmino(o.commission[0]))); + }, + encode(message: ValidatorAccumulatedCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAccumulatedCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { + const obj: any = {}; + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = message.commission; + } + return obj; + }, + fromAminoMsg(object: ValidatorAccumulatedCommissionAminoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAminoMsg { + return { + type: "cosmos-sdk/ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorAccumulatedCommissionProtoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.decode(message.value); + }, + toProto(message: ValidatorAccumulatedCommission): Uint8Array { + return ValidatorAccumulatedCommission.encode(message).finish(); + }, + toProtoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorAccumulatedCommission.typeUrl, ValidatorAccumulatedCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorAccumulatedCommission.aminoType, ValidatorAccumulatedCommission.typeUrl); +function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { + return { + rewards: [] + }; +} +export const ValidatorOutstandingRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + aminoType: "cosmos-sdk/ValidatorOutstandingRewards", + is(o: any): o is ValidatorOutstandingRewards { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0]))); + }, + isAmino(o: any): o is ValidatorOutstandingRewardsAmino { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0]))); + }, + encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorOutstandingRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: ValidatorOutstandingRewardsAminoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorOutstandingRewardsProtoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.decode(message.value); + }, + toProto(message: ValidatorOutstandingRewards): Uint8Array { + return ValidatorOutstandingRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorOutstandingRewards.typeUrl, ValidatorOutstandingRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorOutstandingRewards.aminoType, ValidatorOutstandingRewards.typeUrl); +function createBaseValidatorSlashEvent(): ValidatorSlashEvent { + return { + validatorPeriod: BigInt(0), + fraction: "" + }; +} +export const ValidatorSlashEvent = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + aminoType: "cosmos-sdk/ValidatorSlashEvent", + is(o: any): o is ValidatorSlashEvent { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validatorPeriod === "bigint" && typeof o.fraction === "string"); + }, + isAmino(o: any): o is ValidatorSlashEventAmino { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validator_period === "bigint" && typeof o.fraction === "string"); + }, + encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.validatorPeriod); + } + if (message.fraction !== "") { + writer.uint32(18).string(message.fraction); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64(); + break; + case 2: + message.fraction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? BigInt(object.validatorPeriod.toString()) : BigInt(0); + message.fraction = object.fraction ?? ""; + return message; + }, + fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; + }, + toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { + const obj: any = {}; + obj.validator_period = message.validatorPeriod !== BigInt(0) ? message.validatorPeriod?.toString() : undefined; + obj.fraction = message.fraction === "" ? undefined : message.fraction; + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvent): ValidatorSlashEventAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvent", + value: ValidatorSlashEvent.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventProtoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.decode(message.value); + }, + toProto(message: ValidatorSlashEvent): Uint8Array { + return ValidatorSlashEvent.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvent): ValidatorSlashEventProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + value: ValidatorSlashEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSlashEvent.typeUrl, ValidatorSlashEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvent.aminoType, ValidatorSlashEvent.typeUrl); +function createBaseValidatorSlashEvents(): ValidatorSlashEvents { + return { + validatorSlashEvents: [] + }; +} +export const ValidatorSlashEvents = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + aminoType: "cosmos-sdk/ValidatorSlashEvents", + is(o: any): o is ValidatorSlashEvents { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validatorSlashEvents) && (!o.validatorSlashEvents.length || ValidatorSlashEvent.is(o.validatorSlashEvents[0]))); + }, + isAmino(o: any): o is ValidatorSlashEventsAmino { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEvent.isAmino(o.validator_slash_events[0]))); + }, + encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorSlashEvents) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validatorSlashEvents?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { + const obj: any = {}; + if (message.validatorSlashEvents) { + obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); + } else { + obj.validator_slash_events = message.validatorSlashEvents; + } + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventsAminoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvents", + value: ValidatorSlashEvents.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventsProtoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.decode(message.value); + }, + toProto(message: ValidatorSlashEvents): Uint8Array { + return ValidatorSlashEvents.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + value: ValidatorSlashEvents.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSlashEvents.typeUrl, ValidatorSlashEvents); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvents.aminoType, ValidatorSlashEvents.typeUrl); +function createBaseFeePool(): FeePool { + return { + communityPool: [] + }; +} +export const FeePool = { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + aminoType: "cosmos-sdk/FeePool", + is(o: any): o is FeePool { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.communityPool) && (!o.communityPool.length || DecCoin.is(o.communityPool[0]))); + }, + isAmino(o: any): o is FeePoolAmino { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.community_pool) && (!o.community_pool.length || DecCoin.isAmino(o.community_pool[0]))); + }, + encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.communityPool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityPool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.communityPool?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeePoolAmino): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeePool): FeePoolAmino { + const obj: any = {}; + if (message.communityPool) { + obj.community_pool = message.communityPool.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.community_pool = message.communityPool; + } + return obj; + }, + fromAminoMsg(object: FeePoolAminoMsg): FeePool { + return FeePool.fromAmino(object.value); + }, + toAminoMsg(message: FeePool): FeePoolAminoMsg { + return { + type: "cosmos-sdk/FeePool", + value: FeePool.toAmino(message) + }; + }, + fromProtoMsg(message: FeePoolProtoMsg): FeePool { + return FeePool.decode(message.value); + }, + toProto(message: FeePool): Uint8Array { + return FeePool.encode(message).finish(); + }, + toProtoMsg(message: FeePool): FeePoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + value: FeePool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeePool.typeUrl, FeePool); +GlobalDecoderRegistry.registerAminoProtoMapping(FeePool.aminoType, FeePool.typeUrl); +function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { + return { + title: "", + description: "", + recipient: "", + amount: [] + }; +} +export const CommunityPoolSpendProposal = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + aminoType: "cosmos-sdk/CommunityPoolSpendProposal", + is(o: any): o is CommunityPoolSpendProposal { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is CommunityPoolSpendProposalAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: CommunityPoolSpendProposal, 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.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposal(); + 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.recipient = reader.string(); + break; + case 4: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + 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: CommunityPoolSpendProposalAminoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalProtoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposal): Uint8Array { + return CommunityPoolSpendProposal.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommunityPoolSpendProposal.typeUrl, CommunityPoolSpendProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposal.aminoType, CommunityPoolSpendProposal.typeUrl); +function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { + return { + previousPeriod: BigInt(0), + stake: "", + height: BigInt(0) + }; +} +export const DelegatorStartingInfo = { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + aminoType: "cosmos-sdk/DelegatorStartingInfo", + is(o: any): o is DelegatorStartingInfo { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previousPeriod === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + isAmino(o: any): o is DelegatorStartingInfoAmino { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previous_period === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.previousPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.previousPeriod); + } + if (message.stake !== "") { + writer.uint32(18).string(message.stake); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorStartingInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64(); + break; + case 2: + message.stake = reader.string(); + break; + case 3: + message.height = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? BigInt(object.previousPeriod.toString()) : BigInt(0); + message.stake = object.stake ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { + const obj: any = {}; + obj.previous_period = message.previousPeriod !== BigInt(0) ? message.previousPeriod?.toString() : undefined; + obj.stake = message.stake ?? ""; + obj.height = message.height ? message.height?.toString() : "0"; + return obj; + }, + fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.fromAmino(object.value); + }, + toAminoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoAminoMsg { + return { + type: "cosmos-sdk/DelegatorStartingInfo", + value: DelegatorStartingInfo.toAmino(message) + }; + }, + fromProtoMsg(message: DelegatorStartingInfoProtoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.decode(message.value); + }, + toProto(message: DelegatorStartingInfo): Uint8Array { + return DelegatorStartingInfo.encode(message).finish(); + }, + toProtoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + value: DelegatorStartingInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegatorStartingInfo.typeUrl, DelegatorStartingInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegatorStartingInfo.aminoType, DelegatorStartingInfo.typeUrl); +function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { + return { + validatorAddress: "", + reward: [] + }; +} +export const DelegationDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + aminoType: "cosmos-sdk/DelegationDelegatorReward", + is(o: any): o is DelegationDelegatorReward { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validatorAddress === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.is(o.reward[0]))); + }, + isAmino(o: any): o is DelegationDelegatorRewardAmino { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.isAmino(o.reward[0]))); + }, + encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.reward) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationDelegatorReward(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.reward.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + message.validatorAddress = object.validatorAddress ?? ""; + message.reward = object.reward?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.reward) { + obj.reward = message.reward.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.reward = message.reward; + } + return obj; + }, + fromAminoMsg(object: DelegationDelegatorRewardAminoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/DelegationDelegatorReward", + value: DelegationDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationDelegatorRewardProtoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.decode(message.value); + }, + toProto(message: DelegationDelegatorReward): Uint8Array { + return DelegationDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + value: DelegationDelegatorReward.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegationDelegatorReward.typeUrl, DelegationDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationDelegatorReward.aminoType, DelegationDelegatorReward.typeUrl); +function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { + return { + title: "", + description: "", + recipient: "", + amount: "", + deposit: "" + }; +} +export const CommunityPoolSpendProposalWithDeposit = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + aminoType: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + is(o: any): o is CommunityPoolSpendProposalWithDeposit { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + isAmino(o: any): o is CommunityPoolSpendProposalWithDepositAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + encode(message: CommunityPoolSpendProposalWithDeposit, 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.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.deposit !== "") { + writer.uint32(42).string(message.deposit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + 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.recipient = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.deposit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount ?? ""; + message.deposit = object.deposit ?? ""; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; + }, + toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.deposit = message.deposit === "" ? undefined : message.deposit; + return obj; + }, + fromAminoMsg(object: CommunityPoolSpendProposalWithDepositAminoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalWithDepositProtoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposalWithDeposit): Uint8Array { + return CommunityPoolSpendProposalWithDeposit.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommunityPoolSpendProposalWithDeposit.typeUrl, CommunityPoolSpendProposalWithDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposalWithDeposit.aminoType, CommunityPoolSpendProposalWithDeposit.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..0323b14d --- /dev/null +++ b/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +export const createSetWithdrawAddress = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetWithdrawAddress.typeUrl, + encoders: toEncoders(MsgSetWithdrawAddress), + converters: toConverters(MsgSetWithdrawAddress) +}); +export const createWithdrawDelegatorReward = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawDelegatorReward.typeUrl, + encoders: toEncoders(MsgWithdrawDelegatorReward), + converters: toConverters(MsgWithdrawDelegatorReward) +}); +export const createWithdrawValidatorCommission = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawValidatorCommission.typeUrl, + encoders: toEncoders(MsgWithdrawValidatorCommission), + converters: toConverters(MsgWithdrawValidatorCommission) +}); +export const createFundCommunityPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundCommunityPool.typeUrl, + encoders: toEncoders(MsgFundCommunityPool), + converters: toConverters(MsgFundCommunityPool) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCommunityPoolSpend = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCommunityPoolSpend.typeUrl, + encoders: toEncoders(MsgCommunityPoolSpend), + converters: toConverters(MsgCommunityPoolSpend) +}); +export const createDepositValidatorRewardsPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositValidatorRewardsPool.typeUrl, + encoders: toEncoders(MsgDepositValidatorRewardsPool), + converters: toConverters(MsgDepositValidatorRewardsPool) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 00000000..64517d0b --- /dev/null +++ b/libs/injectivejs/src/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,1478 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino } from "./distribution"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string; + withdrawAddress: string; +} +export interface MsgSetWithdrawAddressProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress"; + value: Uint8Array; +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressAmino { + delegator_address: string; + withdraw_address: string; +} +export interface MsgSetWithdrawAddressAminoMsg { + type: "cosmos-sdk/MsgModifyWithdrawAddress"; + value: MsgSetWithdrawAddressAmino; +} +/** + * 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. + */ +export interface MsgSetWithdrawAddressResponseAmino {} +export interface MsgSetWithdrawAddressResponseAminoMsg { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; + value: MsgSetWithdrawAddressResponseAmino; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string; + validatorAddress: string; +} +export interface MsgWithdrawDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"; + value: Uint8Array; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardAmino { + delegator_address: string; + validator_address: string; +} +export interface MsgWithdrawDelegatorRewardAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegationReward"; + value: MsgWithdrawDelegatorRewardAmino; +} +/** + * 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 { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} +export interface MsgWithdrawDelegatorRewardResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; + value: MsgWithdrawDelegatorRewardResponseAmino; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string; +} +export interface MsgWithdrawValidatorCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"; + value: Uint8Array; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionAmino { + validator_address: string; +} +export interface MsgWithdrawValidatorCommissionAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; + value: MsgWithdrawValidatorCommissionAmino; +} +/** + * 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 { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} +export interface MsgWithdrawValidatorCommissionResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; + value: MsgWithdrawValidatorCommissionResponseAmino; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[]; + depositor: string; +} +export interface MsgFundCommunityPoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool"; + value: Uint8Array; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolAmino { + amount: CoinAmino[]; + depositor: string; +} +export interface MsgFundCommunityPoolAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPool"; + value: MsgFundCommunityPoolAmino; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} +export interface MsgFundCommunityPoolResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse"; + value: Uint8Array; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseAmino {} +export interface MsgFundCommunityPoolResponseAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPoolResponse"; + value: MsgFundCommunityPoolResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { + return { + delegatorAddress: "", + withdrawAddress: "" + }; +} +export const MsgSetWithdrawAddress = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + is(o: any): o is MsgSetWithdrawAddress { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegatorAddress === "string" && typeof o.withdrawAddress === "string"); + }, + isAmino(o: any): o is MsgSetWithdrawAddressAmino { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, + encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; + }, + toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoMsg { + return { + type: "cosmos-sdk/MsgModifyWithdrawAddress", + value: MsgSetWithdrawAddress.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressProtoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddress): Uint8Array { + return MsgSetWithdrawAddress.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetWithdrawAddress.typeUrl, MsgSetWithdrawAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddress.aminoType, MsgSetWithdrawAddress.typeUrl); +function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { + return {}; +} +export const MsgSetWithdrawAddressResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + aminoType: "cosmos-sdk/MsgSetWithdrawAddressResponse", + is(o: any): o is MsgSetWithdrawAddressResponse { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetWithdrawAddressResponseAmino { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressResponseAminoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressResponseProtoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddressResponse): Uint8Array { + return MsgSetWithdrawAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetWithdrawAddressResponse.typeUrl, MsgSetWithdrawAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddressResponse.aminoType, MsgSetWithdrawAddressResponse.typeUrl); +function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const MsgWithdrawDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + is(o: any): o is MsgWithdrawDelegatorReward { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorReward(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + 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; + } + return message; + }, + toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawDelegatorRewardAminoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegationReward", + value: MsgWithdrawDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardProtoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorReward): Uint8Array { + return MsgWithdrawDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorReward.typeUrl, MsgWithdrawDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorReward.aminoType, MsgWithdrawDelegatorReward.typeUrl); +function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { + return { + amount: [] + }; +} +export const MsgWithdrawDelegatorRewardResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + aminoType: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + is(o: any): o is MsgWithdrawDelegatorRewardResponse { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardResponseAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + 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 { + return MsgWithdrawDelegatorRewardResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardResponseProtoMsg): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorRewardResponse): Uint8Array { + return MsgWithdrawDelegatorRewardResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorRewardResponse.typeUrl, MsgWithdrawDelegatorRewardResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorRewardResponse.aminoType, MsgWithdrawDelegatorRewardResponse.typeUrl); +function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { + return { + validatorAddress: "" + }; +} +export const MsgWithdrawValidatorCommission = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + is(o: any): o is MsgWithdrawValidatorCommission { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validator_address === "string"); + }, + encode(message: MsgWithdrawValidatorCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommission(); + 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: DeepPartial): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawValidatorCommissionAminoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionProtoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommission): Uint8Array { + return MsgWithdrawValidatorCommission.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommission.typeUrl, MsgWithdrawValidatorCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommission.aminoType, MsgWithdrawValidatorCommission.typeUrl); +function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { + return { + amount: [] + }; +} +export const MsgWithdrawValidatorCommissionResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + is(o: any): o is MsgWithdrawValidatorCommissionResponse { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionResponseAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + 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 { + return MsgWithdrawValidatorCommissionResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionResponseProtoMsg): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommissionResponse): Uint8Array { + return MsgWithdrawValidatorCommissionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommissionResponse.typeUrl, MsgWithdrawValidatorCommissionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommissionResponse.aminoType, MsgWithdrawValidatorCommissionResponse.typeUrl); +function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { + return { + amount: [], + depositor: "" + }; +} +export const MsgFundCommunityPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + aminoType: "cosmos-sdk/MsgFundCommunityPool", + is(o: any): o is MsgFundCommunityPool { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.depositor === "string"); + }, + isAmino(o: any): o is MsgFundCommunityPoolAmino { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.depositor === "string"); + }, + encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPool(); + 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.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPool", + value: MsgFundCommunityPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolProtoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.decode(message.value); + }, + toProto(message: MsgFundCommunityPool): Uint8Array { + return MsgFundCommunityPool.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundCommunityPool.typeUrl, MsgFundCommunityPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPool.aminoType, MsgFundCommunityPool.typeUrl); +function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { + return {}; +} +export const MsgFundCommunityPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + aminoType: "cosmos-sdk/MsgFundCommunityPoolResponse", + is(o: any): o is MsgFundCommunityPoolResponse { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgFundCommunityPoolResponseAmino { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolResponseAminoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolResponseProtoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.decode(message.value); + }, + toProto(message: MsgFundCommunityPoolResponse): Uint8Array { + return MsgFundCommunityPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundCommunityPoolResponse.typeUrl, MsgFundCommunityPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPoolResponse.aminoType, MsgFundCommunityPoolResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { + authority: "", + recipient: "", + amount: [] + }; +} +export const MsgCommunityPoolSpend = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + is(o: any): o is MsgCommunityPoolSpend { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgCommunityPoolSpendAmino { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpend.typeUrl, MsgCommunityPoolSpend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpend.aminoType, MsgCommunityPoolSpend.typeUrl); +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} +export const MsgCommunityPoolSpendResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + aminoType: "cosmos-sdk/MsgCommunityPoolSpendResponse", + is(o: any): o is MsgCommunityPoolSpendResponse { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + isAmino(o: any): o is MsgCommunityPoolSpendResponseAmino { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpendResponse.typeUrl, MsgCommunityPoolSpendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpendResponse.aminoType, MsgCommunityPoolSpendResponse.typeUrl); +function createBaseMsgDepositValidatorRewardsPool(): MsgDepositValidatorRewardsPool { + return { + depositor: "", + validatorAddress: "", + amount: [] + }; +} +export const MsgDepositValidatorRewardsPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + aminoType: "cosmos-sdk/distr/MsgDepositValRewards", + is(o: any): o is MsgDepositValidatorRewardsPool { + return o && (o.$typeUrl === MsgDepositValidatorRewardsPool.typeUrl || typeof o.depositor === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositValidatorRewardsPoolAmino { + return o && (o.$typeUrl === MsgDepositValidatorRewardsPool.typeUrl || typeof o.depositor === "string" && typeof o.validator_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositValidatorRewardsPool.typeUrl, MsgDepositValidatorRewardsPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositValidatorRewardsPool.aminoType, MsgDepositValidatorRewardsPool.typeUrl); +function createBaseMsgDepositValidatorRewardsPoolResponse(): MsgDepositValidatorRewardsPoolResponse { + return {}; +} +export const MsgDepositValidatorRewardsPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + aminoType: "cosmos-sdk/MsgDepositValidatorRewardsPoolResponse", + is(o: any): o is MsgDepositValidatorRewardsPoolResponse { + return o && o.$typeUrl === MsgDepositValidatorRewardsPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositValidatorRewardsPoolResponseAmino { + return o && o.$typeUrl === MsgDepositValidatorRewardsPoolResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositValidatorRewardsPoolResponse.typeUrl, MsgDepositValidatorRewardsPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositValidatorRewardsPoolResponse.aminoType, MsgDepositValidatorRewardsPoolResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aa73f97f --- /dev/null +++ b/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const createGrantAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgGrantAllowance.typeUrl, + encoders: toEncoders(MsgGrantAllowance), + converters: toConverters(MsgGrantAllowance) +}); +export const createRevokeAllowance = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeAllowance.typeUrl, + encoders: toEncoders(MsgRevokeAllowance), + converters: toConverters(MsgRevokeAllowance) +}); +export const createPruneAllowances = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAllowances.typeUrl, + encoders: toEncoders(MsgPruneAllowances), + converters: toConverters(MsgPruneAllowances) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 00000000..9e674784 --- /dev/null +++ b/libs/injectivejs/src/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,596 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + 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, periodic, allowed fee allowance. */ + allowance?: Any | undefined; +} +export interface MsgGrantAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; + value: Uint8Array; +} +export type MsgGrantAllowanceEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: AnyProtoMsg | undefined; +}; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + 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, periodic, allowed fee allowance. */ + allowance?: AnyAmino; +} +export interface MsgGrantAllowanceAminoMsg { + type: "cosmos-sdk/MsgGrantAllowance"; + value: MsgGrantAllowanceAmino; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponse {} +export interface MsgGrantAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; + value: Uint8Array; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseAmino {} +export interface MsgGrantAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgGrantAllowanceResponse"; + value: MsgGrantAllowanceResponseAmino; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; + value: Uint8Array; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowance"; + value: MsgRevokeAllowanceAmino; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponse {} +export interface MsgRevokeAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; + value: Uint8Array; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseAmino {} +export interface MsgRevokeAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowanceResponse"; + value: MsgRevokeAllowanceResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgGrantAllowance(): MsgGrantAllowance { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const MsgGrantAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + aminoType: "cosmos-sdk/MsgGrantAllowance", + is(o: any): o is MsgGrantAllowance { + return o && (o.$typeUrl === MsgGrantAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is MsgGrantAllowanceAmino { + return o && (o.$typeUrl === MsgGrantAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: MsgGrantAllowance, 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.allowance !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.allowance), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowance(); + 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.allowance = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? GlobalDecoderRegistry.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = GlobalDecoderRegistry.fromAminoMsg(object.allowance); + } + return message; + }, + toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? GlobalDecoderRegistry.toAminoMsg(message.allowance) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { + return MsgGrantAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowance): MsgGrantAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowance", + value: MsgGrantAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceProtoMsg): MsgGrantAllowance { + return MsgGrantAllowance.decode(message.value); + }, + toProto(message: MsgGrantAllowance): Uint8Array { + return MsgGrantAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowance): MsgGrantAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantAllowance.typeUrl, MsgGrantAllowance); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantAllowance.aminoType, MsgGrantAllowance.typeUrl); +function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { + return {}; +} +export const MsgGrantAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + aminoType: "cosmos-sdk/MsgGrantAllowanceResponse", + is(o: any): o is MsgGrantAllowanceResponse { + return o && o.$typeUrl === MsgGrantAllowanceResponse.typeUrl; + }, + isAmino(o: any): o is MsgGrantAllowanceResponseAmino { + return o && o.$typeUrl === MsgGrantAllowanceResponse.typeUrl; + }, + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + toAmino(_: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceResponseAminoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceResponseProtoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.decode(message.value); + }, + toProto(message: MsgGrantAllowanceResponse): Uint8Array { + return MsgGrantAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgGrantAllowanceResponse.typeUrl, MsgGrantAllowanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantAllowanceResponse.aminoType, MsgGrantAllowanceResponse.typeUrl); +function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { + return { + granter: "", + grantee: "" + }; +} +export const MsgRevokeAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + aminoType: "cosmos-sdk/MsgRevokeAllowance", + is(o: any): o is MsgRevokeAllowance { + return o && (o.$typeUrl === MsgRevokeAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is MsgRevokeAllowanceAmino { + return o && (o.$typeUrl === MsgRevokeAllowance.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowance(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: MsgRevokeAllowance): MsgRevokeAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowance", + value: MsgRevokeAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceProtoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.decode(message.value); + }, + toProto(message: MsgRevokeAllowance): Uint8Array { + return MsgRevokeAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeAllowance.typeUrl, MsgRevokeAllowance); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeAllowance.aminoType, MsgRevokeAllowance.typeUrl); +function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { + return {}; +} +export const MsgRevokeAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + aminoType: "cosmos-sdk/MsgRevokeAllowanceResponse", + is(o: any): o is MsgRevokeAllowanceResponse { + return o && o.$typeUrl === MsgRevokeAllowanceResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeAllowanceResponseAmino { + return o && o.$typeUrl === MsgRevokeAllowanceResponse.typeUrl; + }, + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + toAmino(_: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceResponseAminoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceResponseProtoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.decode(message.value); + }, + toProto(message: MsgRevokeAllowanceResponse): Uint8Array { + return MsgRevokeAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeAllowanceResponse.typeUrl, MsgRevokeAllowanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeAllowanceResponse.aminoType, MsgRevokeAllowanceResponse.typeUrl); +function createBaseMsgPruneAllowances(): MsgPruneAllowances { + return { + pruner: "" + }; +} +export const MsgPruneAllowances = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + aminoType: "cosmos-sdk/MsgPruneAllowances", + is(o: any): o is MsgPruneAllowances { + return o && (o.$typeUrl === MsgPruneAllowances.typeUrl || typeof o.pruner === "string"); + }, + isAmino(o: any): o is MsgPruneAllowancesAmino { + return o && (o.$typeUrl === MsgPruneAllowances.typeUrl || typeof o.pruner === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAllowances.typeUrl, MsgPruneAllowances); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAllowances.aminoType, MsgPruneAllowances.typeUrl); +function createBaseMsgPruneAllowancesResponse(): MsgPruneAllowancesResponse { + return {}; +} +export const MsgPruneAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + aminoType: "cosmos-sdk/MsgPruneAllowancesResponse", + is(o: any): o is MsgPruneAllowancesResponse { + return o && o.$typeUrl === MsgPruneAllowancesResponse.typeUrl; + }, + isAmino(o: any): o is MsgPruneAllowancesResponseAmino { + return o && o.$typeUrl === MsgPruneAllowancesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAllowancesResponse.typeUrl, MsgPruneAllowancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAllowancesResponse.aminoType, MsgPruneAllowancesResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1/gov.ts b/libs/injectivejs/src/cosmos/gov/v1/gov.ts new file mode 100644 index 00000000..434920f3 --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1/gov.ts @@ -0,0 +1,1843 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { isSet, DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + aminoType: "cosmos-sdk/v1/WeightedVoteOption", + is(o: any): o is WeightedVoteOption { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedVoteOptionAmino { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedVoteOption.aminoType, WeightedVoteOption.typeUrl); +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1.Deposit", + aminoType: "cosmos-sdk/v1/Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +GlobalDecoderRegistry.registerAminoProtoMapping(Deposit.aminoType, Deposit.typeUrl); +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", + aminoType: "cosmos-sdk/v1/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && isSet(o.status) && Array.isArray(o.totalDeposit) && (!o.totalDeposit.length || Coin.is(o.totalDeposit[0])) && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.proposer === "string" && typeof o.expedited === "boolean" && typeof o.failedReason === "string"); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && isSet(o.status) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isAmino(o.total_deposit[0])) && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.proposer === "string" && typeof o.expedited === "boolean" && typeof o.failed_reason === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1.TallyResult", + aminoType: "cosmos-sdk/v1/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yesCount === "string" && typeof o.abstainCount === "string" && typeof o.noCount === "string" && typeof o.noWithVetoCount === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes_count === "string" && typeof o.abstain_count === "string" && typeof o.no_count === "string" && typeof o.no_with_veto_count === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1.Vote", + aminoType: "cosmos-sdk/v1/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: undefined + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1.DepositParams", + aminoType: "cosmos-sdk/v1/DepositParams", + is(o: any): o is DepositParams { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0]))); + }, + isAmino(o: any): o is DepositParamsAmino { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams); +GlobalDecoderRegistry.registerAminoProtoMapping(DepositParams.aminoType, DepositParams.typeUrl); +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: undefined + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1.VotingParams", + aminoType: "cosmos-sdk/v1/VotingParams", + is(o: any): o is VotingParams { + return o && o.$typeUrl === VotingParams.typeUrl; + }, + isAmino(o: any): o is VotingParamsAmino { + return o && o.$typeUrl === VotingParams.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams); +GlobalDecoderRegistry.registerAminoProtoMapping(VotingParams.aminoType, VotingParams.typeUrl); +function createBaseTallyParams(): TallyParams { + return { + quorum: "", + threshold: "", + vetoThreshold: "" + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1.TallyParams", + aminoType: "cosmos-sdk/v1/TallyParams", + is(o: any): o is TallyParams { + return o && (o.$typeUrl === TallyParams.typeUrl || typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.vetoThreshold === "string"); + }, + isAmino(o: any): o is TallyParamsAmino { + return o && (o.$typeUrl === TallyParams.typeUrl || typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.veto_threshold === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyParams.aminoType, TallyParams.typeUrl); +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", + aminoType: "cosmos-sdk/v1/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0])) && typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.vetoThreshold === "string" && typeof o.minInitialDepositRatio === "string" && typeof o.proposalCancelRatio === "string" && typeof o.proposalCancelDest === "string" && typeof o.expeditedThreshold === "string" && Array.isArray(o.expeditedMinDeposit) && (!o.expeditedMinDeposit.length || Coin.is(o.expeditedMinDeposit[0])) && typeof o.burnVoteQuorum === "boolean" && typeof o.burnProposalDepositPrevote === "boolean" && typeof o.burnVoteVeto === "boolean" && typeof o.minDepositRatio === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0])) && typeof o.quorum === "string" && typeof o.threshold === "string" && typeof o.veto_threshold === "string" && typeof o.min_initial_deposit_ratio === "string" && typeof o.proposal_cancel_ratio === "string" && typeof o.proposal_cancel_dest === "string" && typeof o.expedited_threshold === "string" && Array.isArray(o.expedited_min_deposit) && (!o.expedited_min_deposit.length || Coin.isAmino(o.expedited_min_deposit[0])) && typeof o.burn_vote_quorum === "boolean" && typeof o.burn_proposal_deposit_prevote === "boolean" && typeof o.burn_vote_veto === "boolean" && typeof o.min_deposit_ratio === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/gov/v1/tx.rpc.func.ts new file mode 100644 index 00000000..0fe35d3a --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createExecLegacyContent = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecLegacyContent.typeUrl, + encoders: toEncoders(MsgExecLegacyContent), + converters: toConverters(MsgExecLegacyContent) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCancelProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelProposal.typeUrl, + encoders: toEncoders(MsgCancelProposal), + converters: toConverters(MsgCancelProposal) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1/tx.ts b/libs/injectivejs/src/cosmos/gov/v1/tx.ts new file mode 100644 index 00000000..d01c6807 --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1/tx.ts @@ -0,0 +1,1660 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, Params, ParamsAmino } from "./gov"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { TextProposal, TextProposalProtoMsg } from "../v1beta1/gov"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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; +} +/** 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; +} +/** + * 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?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; +} +export type MsgExecLegacyContentEncoded = Omit & { + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + initialDeposit: [], + proposer: "", + metadata: "", + title: "", + summary: "", + expedited: false + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && Array.isArray(o.initialDeposit) && (!o.initialDeposit.length || Coin.is(o.initialDeposit[0])) && typeof o.proposer === "string" && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.expedited === "boolean"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isAmino(o.initial_deposit[0])) && typeof o.proposer === "string" && typeof o.metadata === "string" && typeof o.title === "string" && typeof o.summary === "string" && typeof o.expedited === "boolean"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/v1/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { + content: undefined, + authority: "" + }; +} +export const MsgExecLegacyContent = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", + is(o: any): o is MsgExecLegacyContent { + return o && (o.$typeUrl === MsgExecLegacyContent.typeUrl || typeof o.authority === "string"); + }, + isAmino(o: any): o is MsgExecLegacyContentAmino { + return o && (o.$typeUrl === MsgExecLegacyContent.typeUrl || typeof o.authority === "string"); + }, + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecLegacyContent.typeUrl, MsgExecLegacyContent); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecLegacyContent.aminoType, MsgExecLegacyContent.typeUrl); +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {}; +} +export const MsgExecLegacyContentResponse = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + aminoType: "cosmos-sdk/v1/MsgExecLegacyContentResponse", + is(o: any): o is MsgExecLegacyContentResponse { + return o && o.$typeUrl === MsgExecLegacyContentResponse.typeUrl; + }, + isAmino(o: any): o is MsgExecLegacyContentResponseAmino { + return o && o.$typeUrl === MsgExecLegacyContentResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecLegacyContentResponse.typeUrl, MsgExecLegacyContentResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecLegacyContentResponse.aminoType, MsgExecLegacyContentResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "" + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1.MsgVote", + aminoType: "cosmos-sdk/v1/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + aminoType: "cosmos-sdk/v1/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + is(o: any): o is MsgVoteWeighted { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgVoteWeightedAmino { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeighted.typeUrl, MsgVoteWeighted); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeighted.aminoType, MsgVoteWeighted.typeUrl); +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + aminoType: "cosmos-sdk/v1/MsgVoteWeightedResponse", + is(o: any): o is MsgVoteWeightedResponse { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteWeightedResponseAmino { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeightedResponse.typeUrl, MsgVoteWeightedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeightedResponse.aminoType, MsgVoteWeightedResponse.typeUrl); +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + aminoType: "cosmos-sdk/v1/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + aminoType: "cosmos-sdk/v1/MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositResponse.aminoType, MsgDepositResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/v1/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgCancelProposal(): MsgCancelProposal { + return { + proposalId: BigInt(0), + proposer: "" + }; +} +export const MsgCancelProposal = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + aminoType: "cosmos-sdk/v1/MsgCancelProposal", + is(o: any): o is MsgCancelProposal { + return o && (o.$typeUrl === MsgCancelProposal.typeUrl || typeof o.proposalId === "bigint" && typeof o.proposer === "string"); + }, + isAmino(o: any): o is MsgCancelProposalAmino { + return o && (o.$typeUrl === MsgCancelProposal.typeUrl || typeof o.proposal_id === "bigint" && typeof o.proposer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelProposal.typeUrl, MsgCancelProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelProposal.aminoType, MsgCancelProposal.typeUrl); +function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { + return { + proposalId: BigInt(0), + canceledTime: new Date(), + canceledHeight: BigInt(0) + }; +} +export const MsgCancelProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + aminoType: "cosmos-sdk/v1/MsgCancelProposalResponse", + is(o: any): o is MsgCancelProposalResponse { + return o && (o.$typeUrl === MsgCancelProposalResponse.typeUrl || typeof o.proposalId === "bigint" && Timestamp.is(o.canceledTime) && typeof o.canceledHeight === "bigint"); + }, + isAmino(o: any): o is MsgCancelProposalResponseAmino { + return o && (o.$typeUrl === MsgCancelProposalResponse.typeUrl || typeof o.proposal_id === "bigint" && Timestamp.isAmino(o.canceled_time) && typeof o.canceled_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelProposalResponse.typeUrl, MsgCancelProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelProposalResponse.aminoType, MsgCancelProposalResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1beta1/gov.ts b/libs/injectivejs/src/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 00000000..cf660d2d --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,1428 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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. + * + * 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 { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption"; + value: Uint8Array; +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +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/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * 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 { + typeUrl: "/cosmos.gov.v1beta1.TextProposal"; + value: Uint8Array; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * 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 { + type: "cosmos-sdk/TextProposal"; + value: TextProposalAmino; +} +/** + * 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.v1beta1.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/Deposit"; + value: DepositAmino; +} +/** 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?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** 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 { + typeUrl: "/cosmos.gov.v1beta1.Proposal"; + value: Uint8Array; +} +export type ProposalEncoded = Omit & { + /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + /** 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 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"; + value: ProposalAmino; +} +/** 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 { + typeUrl: "/cosmos.gov.v1beta1.TallyResult"; + value: Uint8Array; +} +/** 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 { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** + * 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; + /** + * 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. + */ + /** @deprecated */ + option: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOption[]; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.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; + /** + * 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. + */ + /** @deprecated */ + option: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOptionAmino[]; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +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.v1beta1.DepositParams"; + value: Uint8Array; +} +/** DepositParams defines the params for deposits on governance proposals. */ +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/DepositParams"; + value: DepositParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Duration of the voting period. */ + votingPeriod: Duration; +} +export interface VotingParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.VotingParams"; + value: Uint8Array; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsAmino { + /** Duration of the voting period. */ + voting_period: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/VotingParams"; + value: VotingParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * 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. + */ + vetoThreshold: Uint8Array; +} +export interface TallyParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.TallyParams"; + value: Uint8Array; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +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/TallyParams"; + value: TallyParamsAmino; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + aminoType: "cosmos-sdk/WeightedVoteOption", + is(o: any): o is WeightedVoteOption { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedVoteOptionAmino { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + 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: DeepPartial): 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 ?? ""; + return obj; + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value); + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.WeightedVoteOption", + value: WeightedVoteOption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedVoteOption.aminoType, WeightedVoteOption.typeUrl); +function createBaseTextProposal(): TextProposal { + return { + title: "", + description: "" + }; +} +export const TextProposal = { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + aminoType: "cosmos-sdk/TextProposal", + is(o: any): o is TextProposal { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is TextProposalAmino { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTextProposal(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TextProposal { + const message = createBaseTextProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: TextProposalAmino): TextProposal { + const message = createBaseTextProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: TextProposal): TextProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: TextProposalAminoMsg): TextProposal { + return TextProposal.fromAmino(object.value); + }, + toAminoMsg(message: TextProposal): TextProposalAminoMsg { + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TextProposalProtoMsg): TextProposal { + return TextProposal.decode(message.value); + }, + toProto(message: TextProposal): Uint8Array { + return TextProposal.encode(message).finish(); + }, + toProtoMsg(message: TextProposal): TextProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TextProposal.typeUrl, TextProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TextProposal.aminoType, TextProposal.typeUrl); +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1beta1.Deposit", + aminoType: "cosmos-sdk/Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +GlobalDecoderRegistry.registerAminoProtoMapping(Deposit.aminoType, Deposit.typeUrl); +function createBaseProposal(): Proposal { + return { + proposalId: BigInt(0), + content: undefined, + status: 0, + finalTallyResult: TallyResult.fromPartial({}), + submitTime: new Date(), + depositEndTime: new Date(), + totalDeposit: [], + votingStartTime: new Date(), + votingEndTime: new Date() + }; +} +export const Proposal = { + typeUrl: "/cosmos.gov.v1beta1.Proposal", + aminoType: "cosmos-sdk/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposalId === "bigint" && isSet(o.status) && TallyResult.is(o.finalTallyResult) && Timestamp.is(o.submitTime) && Timestamp.is(o.depositEndTime) && Array.isArray(o.totalDeposit) && (!o.totalDeposit.length || Coin.is(o.totalDeposit[0])) && Timestamp.is(o.votingStartTime) && Timestamp.is(o.votingEndTime)); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposal_id === "bigint" && isSet(o.status) && TallyResult.isAmino(o.final_tally_result) && Timestamp.isAmino(o.submit_time) && Timestamp.isAmino(o.deposit_end_time) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isAmino(o.total_deposit[0])) && Timestamp.isAmino(o.voting_start_time) && Timestamp.isAmino(o.voting_end_time)); + }, + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), 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(); + } + 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.proposalId = reader.uint64(); + break; + case 2: + message.content = GlobalDecoderRegistry.unwrapAny(reader); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proposal { + const message = createBaseProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.fromPartial(object.content) : undefined; + 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; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + 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)); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId?.toString() : undefined; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; + obj.status = message.status === 0 ? undefined : message.status; + 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)) : new Date(); + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : new Date(); + 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.gov.v1beta1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yes: "", + abstain: "", + no: "", + noWithVeto: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1beta1.TallyResult", + aminoType: "cosmos-sdk/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.noWithVeto === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.no_with_veto === "string"); + }, + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yes !== "") { + writer.uint32(10).string(message.yes); + } + if (message.abstain !== "") { + writer.uint32(18).string(message.abstain); + } + if (message.no !== "") { + writer.uint32(26).string(message.no); + } + if (message.noWithVeto !== "") { + writer.uint32(34).string(message.noWithVeto); + } + 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.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TallyResult { + const message = createBaseTallyResult(); + message.yes = object.yes ?? ""; + message.abstain = object.abstain ?? ""; + message.no = object.no ?? ""; + message.noWithVeto = object.noWithVeto ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes = message.yes === "" ? undefined : message.yes; + obj.abstain = message.abstain === "" ? undefined : message.abstain; + obj.no = message.no === "" ? undefined : message.no; + obj.no_with_veto = message.noWithVeto === "" ? undefined : message.noWithVeto; + 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.gov.v1beta1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + options: [] + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1beta1.Vote", + aminoType: "cosmos-sdk/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, + 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); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).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.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + 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; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: Vote): VoteAmino { + 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; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + 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.gov.v1beta1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: Duration.fromPartial({}) + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1beta1.DepositParams", + aminoType: "cosmos-sdk/DepositParams", + is(o: any): o is DepositParams { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0])) && Duration.is(o.maxDepositPeriod)); + }, + isAmino(o: any): o is DepositParamsAmino { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0])) && Duration.isAmino(o.max_deposit_period)); + }, + 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: DeepPartial): 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/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.v1beta1.DepositParams", + value: DepositParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams); +GlobalDecoderRegistry.registerAminoProtoMapping(DepositParams.aminoType, DepositParams.typeUrl); +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: Duration.fromPartial({}) + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1beta1.VotingParams", + aminoType: "cosmos-sdk/VotingParams", + is(o: any): o is VotingParams { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.is(o.votingPeriod)); + }, + isAmino(o: any): o is VotingParamsAmino { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.isAmino(o.voting_period)); + }, + 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: DeepPartial): 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/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.v1beta1.VotingParams", + value: VotingParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams); +GlobalDecoderRegistry.registerAminoProtoMapping(VotingParams.aminoType, VotingParams.typeUrl); +function createBaseTallyParams(): TallyParams { + return { + quorum: new Uint8Array(), + threshold: new Uint8Array(), + vetoThreshold: new Uint8Array() + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1beta1.TallyParams", + aminoType: "cosmos-sdk/TallyParams", + is(o: any): o is TallyParams { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.vetoThreshold instanceof Uint8Array || typeof o.vetoThreshold === "string")); + }, + isAmino(o: any): o is TallyParamsAmino { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.veto_threshold instanceof Uint8Array || typeof o.veto_threshold === "string")); + }, + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quorum.length !== 0) { + writer.uint32(10).bytes(message.quorum); + } + if (message.threshold.length !== 0) { + writer.uint32(18).bytes(message.threshold); + } + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(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.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? new Uint8Array(); + message.threshold = object.threshold ?? new Uint8Array(); + message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); + return message; + }, + fromAmino(object: TallyParamsAmino): TallyParams { + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; + }, + toAmino(message: TallyParams): TallyParamsAmino { + const obj: any = {}; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; + return obj; + }, + fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { + return TallyParams.fromAmino(object.value); + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.TallyParams", + value: TallyParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyParams.aminoType, TallyParams.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/cosmos/gov/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..eadeddd8 --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1beta1/query.rpc.func.ts @@ -0,0 +1,58 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +export const createGetProposal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalRequest.encode, + decode: QueryProposalResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposal", + clientResolver +}); +export const createGetProposals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProposalsRequest.encode, + decode: QueryProposalsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Proposals", + clientResolver +}); +export const createGetVote = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVoteRequest.encode, + decode: QueryVoteResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Vote", + clientResolver +}); +export const createGetVotes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVotesRequest.encode, + decode: QueryVotesResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Votes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositRequest.encode, + decode: QueryDepositResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposit", + clientResolver +}); +export const createGetDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDepositsRequest.encode, + decode: QueryDepositsResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "Deposits", + clientResolver +}); +export const createGetTallyResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTallyResultRequest.encode, + decode: QueryTallyResultResponse.decode, + service: "cosmos.gov.v1beta1.Query", + method: "TallyResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1beta1/query.ts b/libs/injectivejs/src/cosmos/gov/v1beta1/query.ts new file mode 100644 index 00000000..15053043 --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1beta1/query.ts @@ -0,0 +1,1749 @@ +import { ProposalStatus, Proposal, ProposalAmino, Vote, VoteAmino, VotingParams, VotingParamsAmino, DepositParams, DepositParamsAmino, TallyParams, TallyParamsAmino, Deposit, DepositAmino, TallyResult, TallyResultAmino } from "./gov"; +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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.v1beta1.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/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + proposal: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseAmino { + proposal: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** 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.v1beta1.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/QueryProposalsRequest"; + value: QueryProposalsRequestAmino; +} +/** + * 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.v1beta1.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/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +/** 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.v1beta1.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/QueryVoteRequest"; + value: QueryVoteRequestAmino; +} +/** 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.v1beta1.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/QueryVoteResponse"; + value: QueryVoteResponseAmino; +} +/** 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.v1beta1.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/QueryVotesRequest"; + value: QueryVotesRequestAmino; +} +/** 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.v1beta1.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/QueryVotesResponse"; + value: QueryVotesResponseAmino; +} +/** 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.v1beta1.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/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** voting_params defines the parameters related to voting. */ + votingParams: VotingParams; + /** deposit_params defines the parameters related to deposit. */ + depositParams: DepositParams; + /** tally_params defines the parameters related to tally. */ + tallyParams: TallyParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** 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; + /** deposit_params defines the parameters related to deposit. */ + deposit_params: DepositParamsAmino; + /** tally_params defines the parameters related to tally. */ + tally_params: TallyParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** 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.v1beta1.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/QueryDepositRequest"; + value: QueryDepositRequestAmino; +} +/** 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.v1beta1.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/QueryDepositResponse"; + value: QueryDepositResponseAmino; +} +/** 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.v1beta1.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/QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +/** 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.v1beta1.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/QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +/** 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.v1beta1.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/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** 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.v1beta1.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/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + aminoType: "cosmos-sdk/QueryProposalRequest", + is(o: any): o is QueryProposalRequest { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryProposalRequestAmino { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalRequest.typeUrl, QueryProposalRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalRequest.aminoType, QueryProposalRequest.typeUrl); +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: Proposal.fromPartial({}) + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + aminoType: "cosmos-sdk/QueryProposalResponse", + is(o: any): o is QueryProposalResponse { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.is(o.proposal)); + }, + isAmino(o: any): o is QueryProposalResponseAmino { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.isAmino(o.proposal)); + }, + 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: DeepPartial): 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) : Proposal.toAmino(Proposal.fromPartial({})); + 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.gov.v1beta1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalResponse.typeUrl, QueryProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalResponse.aminoType, QueryProposalResponse.typeUrl); +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { + proposalStatus: 0, + voter: "", + depositor: "", + pagination: undefined + }; +} +export const QueryProposalsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + aminoType: "cosmos-sdk/QueryProposalsRequest", + is(o: any): o is QueryProposalsRequest { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposalStatus) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryProposalsRequestAmino { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposal_status) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryProposalsRequest", + value: QueryProposalsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalsRequest.typeUrl, QueryProposalsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsRequest.aminoType, QueryProposalsRequest.typeUrl); +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + aminoType: "cosmos-sdk/QueryProposalsResponse", + is(o: any): o is QueryProposalsResponse { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is QueryProposalsResponseAmino { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isAmino(o.proposals[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProposalsResponse.typeUrl, QueryProposalsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsResponse.aminoType, QueryProposalsResponse.typeUrl); +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + aminoType: "cosmos-sdk/QueryVoteRequest", + is(o: any): o is QueryVoteRequest { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string"); + }, + isAmino(o: any): o is QueryVoteRequestAmino { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVoteRequest", + value: QueryVoteRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVoteRequest.typeUrl, QueryVoteRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteRequest.aminoType, QueryVoteRequest.typeUrl); +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { + vote: Vote.fromPartial({}) + }; +} +export const QueryVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + aminoType: "cosmos-sdk/QueryVoteResponse", + is(o: any): o is QueryVoteResponse { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.is(o.vote)); + }, + isAmino(o: any): o is QueryVoteResponseAmino { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.isAmino(o.vote)); + }, + 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: DeepPartial): 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) : Vote.toAmino(Vote.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { + return QueryVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.QueryVoteResponse", + value: QueryVoteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVoteResponse.typeUrl, QueryVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteResponse.aminoType, QueryVoteResponse.typeUrl); +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + aminoType: "cosmos-sdk/QueryVotesRequest", + is(o: any): o is QueryVotesRequest { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryVotesRequestAmino { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVotesRequest", + value: QueryVotesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVotesRequest.typeUrl, QueryVotesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesRequest.aminoType, QueryVotesRequest.typeUrl); +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + aminoType: "cosmos-sdk/QueryVotesResponse", + is(o: any): o is QueryVotesResponse { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.is(o.votes[0]))); + }, + isAmino(o: any): o is QueryVotesResponseAmino { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.isAmino(o.votes[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryVotesResponse", + value: QueryVotesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVotesResponse.typeUrl, QueryVotesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesResponse.aminoType, QueryVotesResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + paramsType: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.paramsType === "string"); + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.params_type === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + votingParams: VotingParams.fromPartial({}), + depositParams: DepositParams.fromPartial({}), + tallyParams: TallyParams.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.is(o.votingParams) && DepositParams.is(o.depositParams) && TallyParams.is(o.tallyParams)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.isAmino(o.voting_params) && DepositParams.isAmino(o.deposit_params) && TallyParams.isAmino(o.tally_params)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + 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); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + 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 { + 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.gov.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { + proposalId: BigInt(0), + depositor: "" + }; +} +export const QueryDepositRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + aminoType: "cosmos-sdk/QueryDepositRequest", + is(o: any): o is QueryDepositRequest { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryDepositRequestAmino { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositRequest", + value: QueryDepositRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositRequest.typeUrl, QueryDepositRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositRequest.aminoType, QueryDepositRequest.typeUrl); +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { + deposit: Deposit.fromPartial({}) + }; +} +export const QueryDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + aminoType: "cosmos-sdk/QueryDepositResponse", + is(o: any): o is QueryDepositResponse { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.is(o.deposit)); + }, + isAmino(o: any): o is QueryDepositResponseAmino { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.isAmino(o.deposit)); + }, + 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: DeepPartial): 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) : Deposit.toAmino(Deposit.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { + return QueryDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.QueryDepositResponse", + value: QueryDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositResponse.typeUrl, QueryDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositResponse.aminoType, QueryDepositResponse.typeUrl); +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryDepositsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + aminoType: "cosmos-sdk/QueryDepositsRequest", + is(o: any): o is QueryDepositsRequest { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryDepositsRequestAmino { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositsRequest.typeUrl, QueryDepositsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsRequest.aminoType, QueryDepositsRequest.typeUrl); +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [], + pagination: undefined + }; +} +export const QueryDepositsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + aminoType: "cosmos-sdk/QueryDepositsResponse", + is(o: any): o is QueryDepositsResponse { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is QueryDepositsResponseAmino { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isAmino(o.deposits[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDepositsResponse.typeUrl, QueryDepositsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsResponse.aminoType, QueryDepositsResponse.typeUrl); +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + aminoType: "cosmos-sdk/QueryTallyResultRequest", + is(o: any): o is QueryTallyResultRequest { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is QueryTallyResultRequestAmino { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTallyResultRequest.typeUrl, QueryTallyResultRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultRequest.aminoType, QueryTallyResultRequest.typeUrl); +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: TallyResult.fromPartial({}) + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + aminoType: "cosmos-sdk/QueryTallyResultResponse", + is(o: any): o is QueryTallyResultResponse { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.is(o.tally)); + }, + isAmino(o: any): o is QueryTallyResultResponseAmino { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.isAmino(o.tally)); + }, + 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: DeepPartial): 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.gov.v1beta1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTallyResultResponse.typeUrl, QueryTallyResultResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultResponse.aminoType, QueryTallyResultResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/gov/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..222ecb6c --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createVoteWeighted = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVoteWeighted.typeUrl, + encoders: toEncoders(MsgVoteWeighted), + converters: toConverters(MsgVoteWeighted) +}); +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/gov/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 00000000..2235f820 --- /dev/null +++ b/libs/injectivejs/src/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,884 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, TextProposal, TextProposalProtoMsg } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { SpotMarketParamUpdateProposal, SpotMarketParamUpdateProposalProtoMsg, BatchExchangeModificationProposal, BatchExchangeModificationProposalProtoMsg, SpotMarketLaunchProposal, SpotMarketLaunchProposalProtoMsg, PerpetualMarketLaunchProposal, PerpetualMarketLaunchProposalProtoMsg, BinaryOptionsMarketLaunchProposal, BinaryOptionsMarketLaunchProposalProtoMsg, ExpiryFuturesMarketLaunchProposal, ExpiryFuturesMarketLaunchProposalProtoMsg, DerivativeMarketParamUpdateProposal, DerivativeMarketParamUpdateProposalProtoMsg, MarketForcedSettlementProposal, MarketForcedSettlementProposalProtoMsg, UpdateDenomDecimalsProposal, UpdateDenomDecimalsProposalProtoMsg, BinaryOptionsMarketParamUpdateProposal, BinaryOptionsMarketParamUpdateProposalProtoMsg, TradingRewardCampaignLaunchProposal, TradingRewardCampaignLaunchProposalProtoMsg, TradingRewardCampaignUpdateProposal, TradingRewardCampaignUpdateProposalProtoMsg, TradingRewardPendingPointsUpdateProposal, TradingRewardPendingPointsUpdateProposalProtoMsg, FeeDiscountProposal, FeeDiscountProposalProtoMsg, BatchCommunityPoolSpendProposal, BatchCommunityPoolSpendProposalProtoMsg, AtomicMarketOrderFeeMultiplierScheduleProposal, AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg } from "../../../injective/exchange/v1beta1/proposal"; +import { SetConfigProposal, SetConfigProposalProtoMsg, SetBatchConfigProposal, SetBatchConfigProposalProtoMsg } from "../../../injective/ocr/v1beta1/ocr"; +import { GrantBandOraclePrivilegeProposal, GrantBandOraclePrivilegeProposalProtoMsg, RevokeBandOraclePrivilegeProposal, RevokeBandOraclePrivilegeProposalProtoMsg, GrantPriceFeederPrivilegeProposal, GrantPriceFeederPrivilegeProposalProtoMsg, GrantProviderPrivilegeProposal, GrantProviderPrivilegeProposalProtoMsg, RevokeProviderPrivilegeProposal, RevokeProviderPrivilegeProposalProtoMsg, RevokePriceFeederPrivilegeProposal, RevokePriceFeederPrivilegeProposalProtoMsg, AuthorizeBandOracleRequestProposal, AuthorizeBandOracleRequestProposalProtoMsg, UpdateBandOracleRequestProposal, UpdateBandOracleRequestProposalProtoMsg, EnableBandIBCProposal, EnableBandIBCProposalProtoMsg, GrantStorkPublisherPrivilegeProposal, GrantStorkPublisherPrivilegeProposalProtoMsg, RevokeStorkPublisherPrivilegeProposal, RevokeStorkPublisherPrivilegeProposalProtoMsg } from "../../../injective/oracle/v1beta1/proposal"; +import { BlacklistEthereumAddressesProposal, BlacklistEthereumAddressesProposalProtoMsg, RevokeEthereumBlacklistProposal, RevokeEthereumBlacklistProposalProtoMsg } from "../../../injective/peggy/v1/proposal"; +import { ContractRegistrationRequestProposal, ContractRegistrationRequestProposalProtoMsg, BatchContractRegistrationRequestProposal, BatchContractRegistrationRequestProposalProtoMsg, BatchContractDeregistrationProposal, BatchContractDeregistrationProposalProtoMsg, ContractRegistrationRequest, ContractRegistrationRequestProtoMsg, BatchStoreCodeProposal, BatchStoreCodeProposalProtoMsg } from "../../../injective/wasmx/v1/proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** content is the proposal's content. */ + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | SpotMarketParamUpdateProposal | BatchExchangeModificationProposal | SpotMarketLaunchProposal | PerpetualMarketLaunchProposal | BinaryOptionsMarketLaunchProposal | ExpiryFuturesMarketLaunchProposal | DerivativeMarketParamUpdateProposal | MarketForcedSettlementProposal | UpdateDenomDecimalsProposal | BinaryOptionsMarketParamUpdateProposal | TradingRewardCampaignLaunchProposal | TradingRewardCampaignUpdateProposal | TradingRewardPendingPointsUpdateProposal | FeeDiscountProposal | BatchCommunityPoolSpendProposal | AtomicMarketOrderFeeMultiplierScheduleProposal | SetConfigProposal | SetBatchConfigProposal | GrantBandOraclePrivilegeProposal | RevokeBandOraclePrivilegeProposal | GrantPriceFeederPrivilegeProposal | GrantProviderPrivilegeProposal | RevokeProviderPrivilegeProposal | RevokePriceFeederPrivilegeProposal | AuthorizeBandOracleRequestProposal | UpdateBandOracleRequestProposal | EnableBandIBCProposal | GrantStorkPublisherPrivilegeProposal | RevokeStorkPublisherPrivilegeProposal | BlacklistEthereumAddressesProposal | RevokeEthereumBlacklistProposal | ContractRegistrationRequestProposal | BatchContractRegistrationRequestProposal | BatchContractDeregistrationProposal | ContractRegistrationRequest | BatchStoreCodeProposal | Any | undefined; + /** 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 { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; + value: Uint8Array; +} +export type MsgSubmitProposalEncoded = Omit & { + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | SpotMarketParamUpdateProposalProtoMsg | BatchExchangeModificationProposalProtoMsg | SpotMarketLaunchProposalProtoMsg | PerpetualMarketLaunchProposalProtoMsg | BinaryOptionsMarketLaunchProposalProtoMsg | ExpiryFuturesMarketLaunchProposalProtoMsg | DerivativeMarketParamUpdateProposalProtoMsg | MarketForcedSettlementProposalProtoMsg | UpdateDenomDecimalsProposalProtoMsg | BinaryOptionsMarketParamUpdateProposalProtoMsg | TradingRewardCampaignLaunchProposalProtoMsg | TradingRewardCampaignUpdateProposalProtoMsg | TradingRewardPendingPointsUpdateProposalProtoMsg | FeeDiscountProposalProtoMsg | BatchCommunityPoolSpendProposalProtoMsg | AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg | SetConfigProposalProtoMsg | SetBatchConfigProposalProtoMsg | GrantBandOraclePrivilegeProposalProtoMsg | RevokeBandOraclePrivilegeProposalProtoMsg | GrantPriceFeederPrivilegeProposalProtoMsg | GrantProviderPrivilegeProposalProtoMsg | RevokeProviderPrivilegeProposalProtoMsg | RevokePriceFeederPrivilegeProposalProtoMsg | AuthorizeBandOracleRequestProposalProtoMsg | UpdateBandOracleRequestProposalProtoMsg | EnableBandIBCProposalProtoMsg | GrantStorkPublisherPrivilegeProposalProtoMsg | RevokeStorkPublisherPrivilegeProposalProtoMsg | BlacklistEthereumAddressesProposalProtoMsg | RevokeEthereumBlacklistProposalProtoMsg | ContractRegistrationRequestProposalProtoMsg | BatchContractRegistrationRequestProposalProtoMsg | BatchContractDeregistrationProposalProtoMsg | ContractRegistrationRequestProtoMsg | BatchStoreCodeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + /** content is the proposal's content. */ + content?: 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; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** 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.v1beta1.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/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** 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 { + typeUrl: "/cosmos.gov.v1beta1.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; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * 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 { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted"; + value: Uint8Array; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +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[]; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** 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.v1beta1.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/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + content: undefined, + initialDeposit: [], + proposer: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + aminoType: "cosmos-sdk/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initialDeposit) && (!o.initialDeposit.length || Coin.is(o.initialDeposit[0])) && typeof o.proposer === "string"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isAmino(o.initial_deposit[0])) && typeof o.proposer === "string"); + }, + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), 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); + } + 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.content = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.fromPartial(object.content) : undefined; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; + 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; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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 ? message.proposalId?.toString() : "0"; + 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.gov.v1beta1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + aminoType: "cosmos-sdk/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + 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); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + 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; + } + 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; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + aminoType: "cosmos-sdk/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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.gov.v1beta1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [] + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + aminoType: "cosmos-sdk/MsgVoteWeighted", + is(o: any): o is MsgVoteWeighted { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isAmino(o: any): o is MsgVoteWeightedAmino { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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)) || []; + 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)) || []; + 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; + } + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: "cosmos-sdk/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.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeighted.typeUrl, MsgVoteWeighted); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeighted.aminoType, MsgVoteWeighted.typeUrl); +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + aminoType: "cosmos-sdk/MsgVoteWeightedResponse", + is(o: any): o is MsgVoteWeightedResponse { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteWeightedResponseAmino { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + 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(_: DeepPartial): 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/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.v1beta1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteWeightedResponse.typeUrl, MsgVoteWeightedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeightedResponse.aminoType, MsgVoteWeightedResponse.typeUrl); +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + aminoType: "cosmos-sdk/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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/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.v1beta1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + aminoType: "cosmos-sdk/MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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/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.v1beta1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositResponse.aminoType, MsgDepositResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/group/v1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/group/v1/tx.rpc.func.ts new file mode 100644 index 00000000..28648bdd --- /dev/null +++ b/libs/injectivejs/src/cosmos/group/v1/tx.rpc.func.ts @@ -0,0 +1,87 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const createCreateGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroup.typeUrl, + encoders: toEncoders(MsgCreateGroup), + converters: toConverters(MsgCreateGroup) +}); +export const createUpdateGroupMembers = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMembers.typeUrl, + encoders: toEncoders(MsgUpdateGroupMembers), + converters: toConverters(MsgUpdateGroupMembers) +}); +export const createUpdateGroupAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupAdmin), + converters: toConverters(MsgUpdateGroupAdmin) +}); +export const createUpdateGroupMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupMetadata), + converters: toConverters(MsgUpdateGroupMetadata) +}); +export const createCreateGroupPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupPolicy), + converters: toConverters(MsgCreateGroupPolicy) +}); +export const createCreateGroupWithPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateGroupWithPolicy.typeUrl, + encoders: toEncoders(MsgCreateGroupWithPolicy), + converters: toConverters(MsgCreateGroupWithPolicy) +}); +export const createUpdateGroupPolicyAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyAdmin.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyAdmin), + converters: toConverters(MsgUpdateGroupPolicyAdmin) +}); +export const createUpdateGroupPolicyDecisionPolicy = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyDecisionPolicy.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyDecisionPolicy), + converters: toConverters(MsgUpdateGroupPolicyDecisionPolicy) +}); +export const createUpdateGroupPolicyMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateGroupPolicyMetadata.typeUrl, + encoders: toEncoders(MsgUpdateGroupPolicyMetadata), + converters: toConverters(MsgUpdateGroupPolicyMetadata) +}); +export const createSubmitProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitProposal.typeUrl, + encoders: toEncoders(MsgSubmitProposal), + converters: toConverters(MsgSubmitProposal) +}); +export const createWithdrawProposal = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawProposal.typeUrl, + encoders: toEncoders(MsgWithdrawProposal), + converters: toConverters(MsgWithdrawProposal) +}); +export const createVote = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgVote.typeUrl, + encoders: toEncoders(MsgVote), + converters: toConverters(MsgVote) +}); +export const createExec = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExec.typeUrl, + encoders: toEncoders(MsgExec), + converters: toConverters(MsgExec) +}); +export const createLeaveGroup = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLeaveGroup.typeUrl, + encoders: toEncoders(MsgLeaveGroup), + converters: toConverters(MsgLeaveGroup) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/group/v1/tx.ts b/libs/injectivejs/src/cosmos/group/v1/tx.ts new file mode 100644 index 00000000..492b0084 --- /dev/null +++ b/libs/injectivejs/src/cosmos/group/v1/tx.ts @@ -0,0 +1,3207 @@ +import { MemberRequest, MemberRequestAmino, VoteOption, ProposalExecutorResult, ThresholdDecisionPolicy, ThresholdDecisionPolicyProtoMsg, PercentageDecisionPolicy, PercentageDecisionPolicyProtoMsg } from "./types"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupWithPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupWithPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; + value: Uint8Array; +} +export type MsgUpdateGroupPolicyDecisionPolicyEncoded = Omit & { + /** decision_policy is the updated group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + admin: "", + members: [], + metadata: "" + }; +} +export const MsgCreateGroup = { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + aminoType: "cosmos-sdk/MsgCreateGroup", + is(o: any): o is MsgCreateGroup { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.is(o.members[0])) && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgCreateGroupAmino { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.isAmino(o.members[0])) && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroup.typeUrl, MsgCreateGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroup.aminoType, MsgCreateGroup.typeUrl); +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + aminoType: "cosmos-sdk/MsgCreateGroupResponse", + is(o: any): o is MsgCreateGroupResponse { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is MsgCreateGroupResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupResponse.typeUrl, MsgCreateGroupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupResponse.aminoType, MsgCreateGroupResponse.typeUrl); +function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { + return { + admin: "", + groupId: BigInt(0), + memberUpdates: [] + }; +} +export const MsgUpdateGroupMembers = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + aminoType: "cosmos-sdk/MsgUpdateGroupMembers", + is(o: any): o is MsgUpdateGroupMembers { + return o && (o.$typeUrl === MsgUpdateGroupMembers.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && Array.isArray(o.memberUpdates) && (!o.memberUpdates.length || MemberRequest.is(o.memberUpdates[0]))); + }, + isAmino(o: any): o is MsgUpdateGroupMembersAmino { + return o && (o.$typeUrl === MsgUpdateGroupMembers.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && Array.isArray(o.member_updates) && (!o.member_updates.length || MemberRequest.isAmino(o.member_updates[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMembers.typeUrl, MsgUpdateGroupMembers); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMembers.aminoType, MsgUpdateGroupMembers.typeUrl); +function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersResponse { + return {}; +} +export const MsgUpdateGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupMembersResponse", + is(o: any): o is MsgUpdateGroupMembersResponse { + return o && o.$typeUrl === MsgUpdateGroupMembersResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupMembersResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupMembersResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMembersResponse.typeUrl, MsgUpdateGroupMembersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMembersResponse.aminoType, MsgUpdateGroupMembersResponse.typeUrl); +function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { + return { + admin: "", + groupId: BigInt(0), + newAdmin: "" + }; +} +export const MsgUpdateGroupAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", + is(o: any): o is MsgUpdateGroupAdmin { + return o && (o.$typeUrl === MsgUpdateGroupAdmin.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupAdminAmino { + return o && (o.$typeUrl === MsgUpdateGroupAdmin.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupAdmin.typeUrl, MsgUpdateGroupAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupAdmin.aminoType, MsgUpdateGroupAdmin.typeUrl); +function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { + return {}; +} +export const MsgUpdateGroupAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupAdminResponse", + is(o: any): o is MsgUpdateGroupAdminResponse { + return o && o.$typeUrl === MsgUpdateGroupAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupAdminResponse.typeUrl, MsgUpdateGroupAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupAdminResponse.aminoType, MsgUpdateGroupAdminResponse.typeUrl); +function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { + return { + admin: "", + groupId: BigInt(0), + metadata: "" + }; +} +export const MsgUpdateGroupMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", + is(o: any): o is MsgUpdateGroupMetadata { + return o && (o.$typeUrl === MsgUpdateGroupMetadata.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupMetadataAmino { + return o && (o.$typeUrl === MsgUpdateGroupMetadata.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMetadata.typeUrl, MsgUpdateGroupMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMetadata.aminoType, MsgUpdateGroupMetadata.typeUrl); +function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataResponse { + return {}; +} +export const MsgUpdateGroupMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupMetadataResponse", + is(o: any): o is MsgUpdateGroupMetadataResponse { + return o && o.$typeUrl === MsgUpdateGroupMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupMetadataResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupMetadataResponse.typeUrl, MsgUpdateGroupMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupMetadataResponse.aminoType, MsgUpdateGroupMetadataResponse.typeUrl); +function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { + return { + admin: "", + groupId: BigInt(0), + metadata: "", + decisionPolicy: undefined + }; +} +export const MsgCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + aminoType: "cosmos-sdk/MsgCreateGroupPolicy", + is(o: any): o is MsgCreateGroupPolicy { + return o && (o.$typeUrl === MsgCreateGroupPolicy.typeUrl || typeof o.admin === "string" && typeof o.groupId === "bigint" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgCreateGroupPolicyAmino { + return o && (o.$typeUrl === MsgCreateGroupPolicy.typeUrl || typeof o.admin === "string" && typeof o.group_id === "bigint" && typeof o.metadata === "string"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupPolicy.typeUrl, MsgCreateGroupPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupPolicy.aminoType, MsgCreateGroupPolicy.typeUrl); +function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse { + return { + address: "" + }; +} +export const MsgCreateGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + aminoType: "cosmos-sdk/MsgCreateGroupPolicyResponse", + is(o: any): o is MsgCreateGroupPolicyResponse { + return o && (o.$typeUrl === MsgCreateGroupPolicyResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is MsgCreateGroupPolicyResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupPolicyResponse.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupPolicyResponse.typeUrl, MsgCreateGroupPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupPolicyResponse.aminoType, MsgCreateGroupPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { + return { + admin: "", + groupPolicyAddress: "", + newAdmin: "" + }; +} +export const MsgUpdateGroupPolicyAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + is(o: any): o is MsgUpdateGroupPolicyAdmin { + return o && (o.$typeUrl === MsgUpdateGroupPolicyAdmin.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyAdminAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyAdmin.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyAdmin.typeUrl, MsgUpdateGroupPolicyAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyAdmin.aminoType, MsgUpdateGroupPolicyAdmin.typeUrl); +function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdminResponse { + return {}; +} +export const MsgUpdateGroupPolicyAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse", + is(o: any): o is MsgUpdateGroupPolicyAdminResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyAdminResponse.typeUrl, MsgUpdateGroupPolicyAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyAdminResponse.aminoType, MsgUpdateGroupPolicyAdminResponse.typeUrl); +function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { + return { + admin: "", + members: [], + groupMetadata: "", + groupPolicyMetadata: "", + groupPolicyAsAdmin: false, + decisionPolicy: undefined + }; +} +export const MsgCreateGroupWithPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", + is(o: any): o is MsgCreateGroupWithPolicy { + return o && (o.$typeUrl === MsgCreateGroupWithPolicy.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.is(o.members[0])) && typeof o.groupMetadata === "string" && typeof o.groupPolicyMetadata === "string" && typeof o.groupPolicyAsAdmin === "boolean"); + }, + isAmino(o: any): o is MsgCreateGroupWithPolicyAmino { + return o && (o.$typeUrl === MsgCreateGroupWithPolicy.typeUrl || typeof o.admin === "string" && Array.isArray(o.members) && (!o.members.length || MemberRequest.isAmino(o.members[0])) && typeof o.group_metadata === "string" && typeof o.group_policy_metadata === "string" && typeof o.group_policy_as_admin === "boolean"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupWithPolicy.typeUrl, MsgCreateGroupWithPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupWithPolicy.aminoType, MsgCreateGroupWithPolicy.typeUrl); +function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { + return { + groupId: BigInt(0), + groupPolicyAddress: "" + }; +} +export const MsgCreateGroupWithPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicyResponse", + is(o: any): o is MsgCreateGroupWithPolicyResponse { + return o && (o.$typeUrl === MsgCreateGroupWithPolicyResponse.typeUrl || typeof o.groupId === "bigint" && typeof o.groupPolicyAddress === "string"); + }, + isAmino(o: any): o is MsgCreateGroupWithPolicyResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupWithPolicyResponse.typeUrl || typeof o.group_id === "bigint" && typeof o.group_policy_address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupWithPolicyResponse.typeUrl, MsgCreateGroupWithPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupWithPolicyResponse.aminoType, MsgCreateGroupWithPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDecisionPolicy { + return { + admin: "", + groupPolicyAddress: "", + decisionPolicy: undefined + }; +} +export const MsgUpdateGroupPolicyDecisionPolicy = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", + is(o: any): o is MsgUpdateGroupPolicyDecisionPolicy { + return o && (o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicy.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyDecisionPolicyAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicy.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string"); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + message.admin = object.admin ?? ""; + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyDecisionPolicy.typeUrl, MsgUpdateGroupPolicyDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyDecisionPolicy.aminoType, MsgUpdateGroupPolicyDecisionPolicy.typeUrl); +function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupPolicyDecisionPolicyResponse { + return {}; +} +export const MsgUpdateGroupPolicyDecisionPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse", + is(o: any): o is MsgUpdateGroupPolicyDecisionPolicyResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyDecisionPolicyResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl, MsgUpdateGroupPolicyDecisionPolicyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyDecisionPolicyResponse.aminoType, MsgUpdateGroupPolicyDecisionPolicyResponse.typeUrl); +function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata { + return { + admin: "", + groupPolicyAddress: "", + metadata: "" + }; +} +export const MsgUpdateGroupPolicyMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + is(o: any): o is MsgUpdateGroupPolicyMetadata { + return o && (o.$typeUrl === MsgUpdateGroupPolicyMetadata.typeUrl || typeof o.admin === "string" && typeof o.groupPolicyAddress === "string" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MsgUpdateGroupPolicyMetadataAmino { + return o && (o.$typeUrl === MsgUpdateGroupPolicyMetadata.typeUrl || typeof o.admin === "string" && typeof o.group_policy_address === "string" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyMetadata.typeUrl, MsgUpdateGroupPolicyMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyMetadata.aminoType, MsgUpdateGroupPolicyMetadata.typeUrl); +function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyMetadataResponse { + return {}; +} +export const MsgUpdateGroupPolicyMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse", + is(o: any): o is MsgUpdateGroupPolicyMetadataResponse { + return o && o.$typeUrl === MsgUpdateGroupPolicyMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateGroupPolicyMetadataResponseAmino { + return o && o.$typeUrl === MsgUpdateGroupPolicyMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateGroupPolicyMetadataResponse.typeUrl, MsgUpdateGroupPolicyMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateGroupPolicyMetadataResponse.aminoType, MsgUpdateGroupPolicyMetadataResponse.typeUrl); +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + groupPolicyAddress: "", + proposers: [], + metadata: "", + messages: [], + exec: 0, + title: "", + summary: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + aminoType: "cosmos-sdk/group/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || typeof o.groupPolicyAddress === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && typeof o.metadata === "string" && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && isSet(o.exec) && typeof o.title === "string" && typeof o.summary === "string"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || typeof o.group_policy_address === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && typeof o.metadata === "string" && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && isSet(o.exec) && typeof o.title === "string" && typeof o.summary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); +function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { + return { + proposalId: BigInt(0), + address: "" + }; +} +export const MsgWithdrawProposal = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + aminoType: "cosmos-sdk/group/MsgWithdrawProposal", + is(o: any): o is MsgWithdrawProposal { + return o && (o.$typeUrl === MsgWithdrawProposal.typeUrl || typeof o.proposalId === "bigint" && typeof o.address === "string"); + }, + isAmino(o: any): o is MsgWithdrawProposalAmino { + return o && (o.$typeUrl === MsgWithdrawProposal.typeUrl || typeof o.proposal_id === "bigint" && typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawProposal.typeUrl, MsgWithdrawProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawProposal.aminoType, MsgWithdrawProposal.typeUrl); +function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { + return {}; +} +export const MsgWithdrawProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + aminoType: "cosmos-sdk/MsgWithdrawProposalResponse", + is(o: any): o is MsgWithdrawProposalResponse { + return o && o.$typeUrl === MsgWithdrawProposalResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawProposalResponseAmino { + return o && o.$typeUrl === MsgWithdrawProposalResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawProposalResponse.typeUrl, MsgWithdrawProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawProposalResponse.aminoType, MsgWithdrawProposalResponse.typeUrl); +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + exec: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.group.v1.MsgVote", + aminoType: "cosmos-sdk/group/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && isSet(o.exec)); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && isSet(o.exec)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + aminoType: "cosmos-sdk/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); +function createBaseMsgExec(): MsgExec { + return { + proposalId: BigInt(0), + executor: "" + }; +} +export const MsgExec = { + typeUrl: "/cosmos.group.v1.MsgExec", + aminoType: "cosmos-sdk/group/MsgExec", + is(o: any): o is MsgExec { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.proposalId === "bigint" && typeof o.executor === "string"); + }, + isAmino(o: any): o is MsgExecAmino { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.proposal_id === "bigint" && typeof o.executor === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExec.typeUrl, MsgExec); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExec.aminoType, MsgExec.typeUrl); +function createBaseMsgExecResponse(): MsgExecResponse { + return { + result: 0 + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + aminoType: "cosmos-sdk/MsgExecResponse", + is(o: any): o is MsgExecResponse { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgExecResponseAmino { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecResponse.aminoType, MsgExecResponse.typeUrl); +function createBaseMsgLeaveGroup(): MsgLeaveGroup { + return { + address: "", + groupId: BigInt(0) + }; +} +export const MsgLeaveGroup = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + aminoType: "cosmos-sdk/group/MsgLeaveGroup", + is(o: any): o is MsgLeaveGroup { + return o && (o.$typeUrl === MsgLeaveGroup.typeUrl || typeof o.address === "string" && typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is MsgLeaveGroupAmino { + return o && (o.$typeUrl === MsgLeaveGroup.typeUrl || typeof o.address === "string" && typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgLeaveGroup.typeUrl, MsgLeaveGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLeaveGroup.aminoType, MsgLeaveGroup.typeUrl); +function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { + return {}; +} +export const MsgLeaveGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + aminoType: "cosmos-sdk/MsgLeaveGroupResponse", + is(o: any): o is MsgLeaveGroupResponse { + return o && o.$typeUrl === MsgLeaveGroupResponse.typeUrl; + }, + isAmino(o: any): o is MsgLeaveGroupResponseAmino { + return o && o.$typeUrl === MsgLeaveGroupResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgLeaveGroupResponse.typeUrl, MsgLeaveGroupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLeaveGroupResponse.aminoType, MsgLeaveGroupResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/group/v1/types.ts b/libs/injectivejs/src/cosmos/group/v1/types.ts new file mode 100644 index 00000000..f8e9c860 --- /dev/null +++ b/libs/injectivejs/src/cosmos/group/v1/types.ts @@ -0,0 +1,2081 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 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 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 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; + /** created_at is a timestamp specifying when a group policy was created. */ + createdAt: Date; +} +export interface GroupPolicyInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; + value: Uint8Array; +} +export type GroupPolicyInfoEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +function createBaseMember(): Member { + return { + address: "", + weight: "", + metadata: "", + addedAt: new Date() + }; +} +export const Member = { + typeUrl: "/cosmos.group.v1.Member", + aminoType: "cosmos-sdk/Member", + is(o: any): o is Member { + return o && (o.$typeUrl === Member.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string" && Timestamp.is(o.addedAt)); + }, + isAmino(o: any): o is MemberAmino { + return o && (o.$typeUrl === Member.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string" && Timestamp.isAmino(o.added_at)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Member.typeUrl, Member); +GlobalDecoderRegistry.registerAminoProtoMapping(Member.aminoType, Member.typeUrl); +function createBaseMemberRequest(): MemberRequest { + return { + address: "", + weight: "", + metadata: "" + }; +} +export const MemberRequest = { + typeUrl: "/cosmos.group.v1.MemberRequest", + aminoType: "cosmos-sdk/MemberRequest", + is(o: any): o is MemberRequest { + return o && (o.$typeUrl === MemberRequest.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string"); + }, + isAmino(o: any): o is MemberRequestAmino { + return o && (o.$typeUrl === MemberRequest.typeUrl || typeof o.address === "string" && typeof o.weight === "string" && typeof o.metadata === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MemberRequest.typeUrl, MemberRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(MemberRequest.aminoType, MemberRequest.typeUrl); +function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { + return { + threshold: "", + windows: undefined + }; +} +export const ThresholdDecisionPolicy = { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + aminoType: "cosmos-sdk/ThresholdDecisionPolicy", + is(o: any): o is ThresholdDecisionPolicy { + return o && (o.$typeUrl === ThresholdDecisionPolicy.typeUrl || typeof o.threshold === "string"); + }, + isAmino(o: any): o is ThresholdDecisionPolicyAmino { + return o && (o.$typeUrl === ThresholdDecisionPolicy.typeUrl || typeof o.threshold === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ThresholdDecisionPolicy.typeUrl, ThresholdDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(ThresholdDecisionPolicy.aminoType, ThresholdDecisionPolicy.typeUrl); +function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { + return { + percentage: "", + windows: undefined + }; +} +export const PercentageDecisionPolicy = { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + aminoType: "cosmos-sdk/PercentageDecisionPolicy", + is(o: any): o is PercentageDecisionPolicy { + return o && (o.$typeUrl === PercentageDecisionPolicy.typeUrl || typeof o.percentage === "string"); + }, + isAmino(o: any): o is PercentageDecisionPolicyAmino { + return o && (o.$typeUrl === PercentageDecisionPolicy.typeUrl || typeof o.percentage === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(PercentageDecisionPolicy.typeUrl, PercentageDecisionPolicy); +GlobalDecoderRegistry.registerAminoProtoMapping(PercentageDecisionPolicy.aminoType, PercentageDecisionPolicy.typeUrl); +function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { + return { + votingPeriod: Duration.fromPartial({}), + minExecutionPeriod: Duration.fromPartial({}) + }; +} +export const DecisionPolicyWindows = { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + aminoType: "cosmos-sdk/DecisionPolicyWindows", + is(o: any): o is DecisionPolicyWindows { + return o && (o.$typeUrl === DecisionPolicyWindows.typeUrl || Duration.is(o.votingPeriod) && Duration.is(o.minExecutionPeriod)); + }, + isAmino(o: any): o is DecisionPolicyWindowsAmino { + return o && (o.$typeUrl === DecisionPolicyWindows.typeUrl || Duration.isAmino(o.voting_period) && Duration.isAmino(o.min_execution_period)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(DecisionPolicyWindows.typeUrl, DecisionPolicyWindows); +GlobalDecoderRegistry.registerAminoProtoMapping(DecisionPolicyWindows.aminoType, DecisionPolicyWindows.typeUrl); +function createBaseGroupInfo(): GroupInfo { + return { + id: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + totalWeight: "", + createdAt: new Date() + }; +} +export const GroupInfo = { + typeUrl: "/cosmos.group.v1.GroupInfo", + aminoType: "cosmos-sdk/GroupInfo", + is(o: any): o is GroupInfo { + return o && (o.$typeUrl === GroupInfo.typeUrl || typeof o.id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && typeof o.totalWeight === "string" && Timestamp.is(o.createdAt)); + }, + isAmino(o: any): o is GroupInfoAmino { + return o && (o.$typeUrl === GroupInfo.typeUrl || typeof o.id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && typeof o.total_weight === "string" && Timestamp.isAmino(o.created_at)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GroupInfo.typeUrl, GroupInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupInfo.aminoType, GroupInfo.typeUrl); +function createBaseGroupMember(): GroupMember { + return { + groupId: BigInt(0), + member: undefined + }; +} +export const GroupMember = { + typeUrl: "/cosmos.group.v1.GroupMember", + aminoType: "cosmos-sdk/GroupMember", + is(o: any): o is GroupMember { + return o && (o.$typeUrl === GroupMember.typeUrl || typeof o.groupId === "bigint"); + }, + isAmino(o: any): o is GroupMemberAmino { + return o && (o.$typeUrl === GroupMember.typeUrl || typeof o.group_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(GroupMember.typeUrl, GroupMember); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupMember.aminoType, GroupMember.typeUrl); +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", + aminoType: "cosmos-sdk/GroupPolicyInfo", + is(o: any): o is GroupPolicyInfo { + return o && (o.$typeUrl === GroupPolicyInfo.typeUrl || typeof o.address === "string" && typeof o.groupId === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && Timestamp.is(o.createdAt)); + }, + isAmino(o: any): o is GroupPolicyInfoAmino { + return o && (o.$typeUrl === GroupPolicyInfo.typeUrl || typeof o.address === "string" && typeof o.group_id === "bigint" && typeof o.admin === "string" && typeof o.metadata === "string" && typeof o.version === "bigint" && Timestamp.isAmino(o.created_at)); + }, + 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(GlobalDecoderRegistry.wrapAny(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 = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ? GlobalDecoderRegistry.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 = GlobalDecoderRegistry.fromAminoMsg(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 ? GlobalDecoderRegistry.toAminoMsg(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() + }; + } +}; +GlobalDecoderRegistry.register(GroupPolicyInfo.typeUrl, GroupPolicyInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupPolicyInfo.aminoType, GroupPolicyInfo.typeUrl); +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", + aminoType: "cosmos-sdk/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && typeof o.groupPolicyAddress === "string" && typeof o.metadata === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && Timestamp.is(o.submitTime) && typeof o.groupVersion === "bigint" && typeof o.groupPolicyVersion === "bigint" && isSet(o.status) && TallyResult.is(o.finalTallyResult) && Timestamp.is(o.votingPeriodEnd) && isSet(o.executorResult) && Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && typeof o.title === "string" && typeof o.summary === "string"); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.id === "bigint" && typeof o.group_policy_address === "string" && typeof o.metadata === "string" && Array.isArray(o.proposers) && (!o.proposers.length || typeof o.proposers[0] === "string") && Timestamp.isAmino(o.submit_time) && typeof o.group_version === "bigint" && typeof o.group_policy_version === "bigint" && isSet(o.status) && TallyResult.isAmino(o.final_tally_result) && Timestamp.isAmino(o.voting_period_end) && isSet(o.executor_result) && Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && typeof o.title === "string" && typeof o.summary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.group.v1.TallyResult", + aminoType: "cosmos-sdk/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yesCount === "string" && typeof o.abstainCount === "string" && typeof o.noCount === "string" && typeof o.noWithVetoCount === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes_count === "string" && typeof o.abstain_count === "string" && typeof o.no_count === "string" && typeof o.no_with_veto_count === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + submitTime: new Date() + }; +} +export const Vote = { + typeUrl: "/cosmos.group.v1.Vote", + aminoType: "cosmos-sdk/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && Timestamp.is(o.submitTime)); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && typeof o.metadata === "string" && Timestamp.isAmino(o.submit_time)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/ics23/v1/proofs.ts b/libs/injectivejs/src/cosmos/ics23/v1/proofs.ts new file mode 100644 index 00000000..27759bde --- /dev/null +++ b/libs/injectivejs/src/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,2060 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +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, + KECCAK256 = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + SHA512_256 = 6, + BLAKE2B_512 = 7, + BLAKE2S_256 = 8, + BLAKE3 = 9, + UNRECOGNIZED = -1, +} +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 "KECCAK256": + return HashOp.KECCAK256; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case 6: + case "SHA512_256": + return HashOp.SHA512_256; + case 7: + case "BLAKE2B_512": + return HashOp.BLAKE2B_512; + case 8: + case "BLAKE2S_256": + return HashOp.BLAKE2S_256; + case 9: + case "BLAKE3": + return HashOp.BLAKE3; + 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.KECCAK256: + return "KECCAK256"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.SHA512_256: + return "SHA512_256"; + case HashOp.BLAKE2B_512: + return "BLAKE2B_512"; + case HashOp.BLAKE2S_256: + return "BLAKE2S_256"; + case HashOp.BLAKE3: + return "BLAKE3"; + 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 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; +} +/** + * 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; +} +/** 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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) + * the max_depth is interpreted as 128 if set to 0 + */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehashKeyBeforeComparison: boolean; +} +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) + * the max_depth is interpreted as 128 if set to 0 + */ + max_depth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + min_depth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehash_key_before_comparison: boolean; +} +export interface ProofSpecAminoMsg { + type: "cosmos-sdk/ProofSpec"; + value: ProofSpecAmino; +} +/** + * 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; + /** the max prefix length must be less than the minimum prefix length + child size */ + 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; + /** the max prefix length must be less than the minimum prefix length + child size */ + 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; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + 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 { + entries: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "cosmos-sdk/BatchProof"; + value: BatchProofAmino; +} +/** 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; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; + value: Uint8Array; +} +export interface CompressedBatchProofAmino { + entries: CompressedBatchEntryAmino[]; + lookup_inners: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "cosmos-sdk/CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +/** 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; +} +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 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; +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const ExistenceProof = { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + aminoType: "cosmos-sdk/ExistenceProof", + is(o: any): o is ExistenceProof { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.is(o.path[0]))); + }, + isAmino(o: any): o is ExistenceProofAmino { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isAmino(o.path[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExistenceProof.typeUrl, ExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(ExistenceProof.aminoType, ExistenceProof.typeUrl); +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const NonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + aminoType: "cosmos-sdk/NonExistenceProof", + is(o: any): o is NonExistenceProof { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is NonExistenceProofAmino { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(NonExistenceProof.typeUrl, NonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(NonExistenceProof.aminoType, NonExistenceProof.typeUrl); +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + }; +} +export const CommitmentProof = { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + aminoType: "cosmos-sdk/CommitmentProof", + is(o: any): o is CommitmentProof { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isAmino(o: any): o is CommitmentProofAmino { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CommitmentProof.typeUrl, CommitmentProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CommitmentProof.aminoType, CommitmentProof.typeUrl); +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + }; +} +export const LeafOp = { + typeUrl: "/cosmos.ics23.v1.LeafOp", + aminoType: "cosmos-sdk/LeafOp", + is(o: any): o is LeafOp { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehashKey) && isSet(o.prehashValue) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isAmino(o: any): o is LeafOpAmino { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(LeafOp.typeUrl, LeafOp); +GlobalDecoderRegistry.registerAminoProtoMapping(LeafOp.aminoType, LeafOp.typeUrl); +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + }; +} +export const InnerOp = { + typeUrl: "/cosmos.ics23.v1.InnerOp", + aminoType: "cosmos-sdk/InnerOp", + is(o: any): o is InnerOp { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isAmino(o: any): o is InnerOpAmino { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InnerOp.typeUrl, InnerOp); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerOp.aminoType, InnerOp.typeUrl); +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 0, + minDepth: 0, + prehashKeyBeforeComparison: false + }; +} +export const ProofSpec = { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + aminoType: "cosmos-sdk/ProofSpec", + is(o: any): o is ProofSpec { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.maxDepth === "number" && typeof o.minDepth === "number" && typeof o.prehashKeyBeforeComparison === "boolean"); + }, + isAmino(o: any): o is ProofSpecAmino { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number" && typeof o.prehash_key_before_comparison === "boolean"); + }, + 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); + } + if (message.prehashKeyBeforeComparison === true) { + writer.uint32(40).bool(message.prehashKeyBeforeComparison); + } + 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; + case 5: + message.prehashKeyBeforeComparison = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + message.prehashKeyBeforeComparison = object.prehashKeyBeforeComparison ?? false; + 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; + } + if (object.prehash_key_before_comparison !== undefined && object.prehash_key_before_comparison !== null) { + message.prehashKeyBeforeComparison = object.prehash_key_before_comparison; + } + 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; + obj.prehash_key_before_comparison = message.prehashKeyBeforeComparison === false ? undefined : message.prehashKeyBeforeComparison; + 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() + }; + } +}; +GlobalDecoderRegistry.register(ProofSpec.typeUrl, ProofSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(ProofSpec.aminoType, ProofSpec.typeUrl); +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + }; +} +export const InnerSpec = { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + aminoType: "cosmos-sdk/InnerSpec", + is(o: any): o is InnerSpec { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.childOrder) && (!o.childOrder.length || typeof o.childOrder[0] === "number") && typeof o.childSize === "number" && typeof o.minPrefixLength === "number" && typeof o.maxPrefixLength === "number" && (o.emptyChild instanceof Uint8Array || typeof o.emptyChild === "string") && isSet(o.hash)); + }, + isAmino(o: any): o is InnerSpecAmino { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InnerSpec.typeUrl, InnerSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerSpec.aminoType, InnerSpec.typeUrl); +function createBaseBatchProof(): BatchProof { + return { + entries: [] + }; +} +export const BatchProof = { + typeUrl: "/cosmos.ics23.v1.BatchProof", + aminoType: "cosmos-sdk/BatchProof", + is(o: any): o is BatchProof { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is BatchProofAmino { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isAmino(o.entries[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(BatchProof.typeUrl, BatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchProof.aminoType, BatchProof.typeUrl); +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const BatchEntry = { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + aminoType: "cosmos-sdk/BatchEntry", + is(o: any): o is BatchEntry { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isAmino(o: any): o is BatchEntryAmino { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(BatchEntry.typeUrl, BatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchEntry.aminoType, BatchEntry.typeUrl); +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + }; +} +export const CompressedBatchProof = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + aminoType: "cosmos-sdk/CompressedBatchProof", + is(o: any): o is CompressedBatchProof { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.is(o.entries[0])) && Array.isArray(o.lookupInners) && (!o.lookupInners.length || InnerOp.is(o.lookupInners[0]))); + }, + isAmino(o: any): o is CompressedBatchProofAmino { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isAmino(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isAmino(o.lookup_inners[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedBatchProof.typeUrl, CompressedBatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchProof.aminoType, CompressedBatchProof.typeUrl); +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const CompressedBatchEntry = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + aminoType: "cosmos-sdk/CompressedBatchEntry", + is(o: any): o is CompressedBatchEntry { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isAmino(o: any): o is CompressedBatchEntryAmino { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedBatchEntry.typeUrl, CompressedBatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchEntry.aminoType, CompressedBatchEntry.typeUrl); +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const CompressedExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + aminoType: "cosmos-sdk/CompressedExistenceProof", + is(o: any): o is CompressedExistenceProof { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isAmino(o: any): o is CompressedExistenceProofAmino { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedExistenceProof.typeUrl, CompressedExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedExistenceProof.aminoType, CompressedExistenceProof.typeUrl); +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const CompressedNonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + aminoType: "cosmos-sdk/CompressedNonExistenceProof", + is(o: any): o is CompressedNonExistenceProof { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is CompressedNonExistenceProofAmino { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(CompressedNonExistenceProof.typeUrl, CompressedNonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedNonExistenceProof.aminoType, CompressedNonExistenceProof.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/msg/v1/msg.ts b/libs/injectivejs/src/cosmos/msg/v1/msg.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injectivejs/src/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/query/v1/query.ts b/libs/injectivejs/src/cosmos/query/v1/query.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injectivejs/src/cosmos/query/v1/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/staking/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/cosmos/staking/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d870abdc --- /dev/null +++ b/libs/injectivejs/src/cosmos/staking/v1beta1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +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"; +export const createGetValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorsRequest.encode, + decode: QueryValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validators", + clientResolver +}); +export const createGetValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorRequest.encode, + decode: QueryValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Validator", + clientResolver +}); +export const createGetValidatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorDelegationsRequest.encode, + decode: QueryValidatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorDelegations", + clientResolver +}); +export const createGetValidatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValidatorUnbondingDelegationsRequest.encode, + decode: QueryValidatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "ValidatorUnbondingDelegations", + clientResolver +}); +export const createGetDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegationRequest.encode, + decode: QueryDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Delegation", + clientResolver +}); +export const createGetUnbondingDelegation = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryUnbondingDelegationRequest.encode, + decode: QueryUnbondingDelegationResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "UnbondingDelegation", + clientResolver +}); +export const createGetDelegatorDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorDelegationsRequest.encode, + decode: QueryDelegatorDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorDelegations", + clientResolver +}); +export const createGetDelegatorUnbondingDelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorUnbondingDelegationsRequest.encode, + decode: QueryDelegatorUnbondingDelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorUnbondingDelegations", + clientResolver +}); +export const createGetRedelegations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRedelegationsRequest.encode, + decode: QueryRedelegationsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Redelegations", + clientResolver +}); +export const createGetDelegatorValidators = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorsRequest.encode, + decode: QueryDelegatorValidatorsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidators", + clientResolver +}); +export const createGetDelegatorValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegatorValidatorRequest.encode, + decode: QueryDelegatorValidatorResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "DelegatorValidator", + clientResolver +}); +export const createGetHistoricalInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalInfoRequest.encode, + decode: QueryHistoricalInfoResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "HistoricalInfo", + clientResolver +}); +export const createGetPool = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPoolRequest.encode, + decode: QueryPoolResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Pool", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmos.staking.v1beta1.Query", + method: "Params", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/staking/v1beta1/query.ts b/libs/injectivejs/src/cosmos/staking/v1beta1/query.ts new file mode 100644 index 00000000..f4754096 --- /dev/null +++ b/libs/injectivejs/src/cosmos/staking/v1beta1/query.ts @@ -0,0 +1,3073 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { Validator, ValidatorAmino, DelegationResponse, DelegationResponseAmino, UnbondingDelegation, UnbondingDelegationAmino, RedelegationResponse, RedelegationResponseAmino, HistoricalInfo, HistoricalInfoAmino, Pool, PoolAmino, Params, ParamsAmino } from "./staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequest { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; + value: Uint8Array; +} +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequestAmino { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorsRequest"; + value: QueryValidatorsRequestAmino; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponse { + /** validators contains all the queried validators. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; + value: Uint8Array; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponseAmino { + /** validators contains all the queried validators. */ + validators: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorsResponse"; + value: QueryValidatorsResponseAmino; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest"; + value: Uint8Array; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorRequest"; + value: QueryValidatorRequestAmino; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponse { + /** validator defines the validator info. */ + validator: Validator; +} +export interface QueryValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse"; + value: Uint8Array; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponseAmino { + /** validator defines the validator info. */ + validator: ValidatorAmino; +} +export interface QueryValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorResponse"; + value: QueryValidatorResponseAmino; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsRequest"; + value: QueryValidatorDelegationsRequestAmino; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponse { + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponseAmino { + delegation_responses: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsResponse"; + value: QueryValidatorDelegationsResponseAmino; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest"; + value: QueryValidatorUnbondingDelegationsRequestAmino; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponseAmino { + unbonding_responses: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse"; + value: QueryValidatorUnbondingDelegationsResponseAmino; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest"; + value: Uint8Array; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryDelegationRequest"; + value: QueryDelegationRequestAmino; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponse { + /** delegation_responses defines the delegation info of a delegation. */ + delegationResponse?: DelegationResponse; +} +export interface QueryDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; + value: Uint8Array; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponseAmino { + /** delegation_responses defines the delegation info of a delegation. */ + delegation_response?: DelegationResponseAmino; +} +export interface QueryDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryDelegationResponse"; + value: QueryDelegationResponseAmino; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryUnbondingDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryUnbondingDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationRequest"; + value: QueryUnbondingDelegationRequestAmino; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponse { + /** unbond defines the unbonding information of a delegation. */ + unbond: UnbondingDelegation; +} +export interface QueryUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponseAmino { + /** unbond defines the unbonding information of a delegation. */ + unbond: UnbondingDelegationAmino; +} +export interface QueryUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationResponse"; + value: QueryUnbondingDelegationResponseAmino; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest"; + value: QueryDelegatorDelegationsRequestAmino; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponse { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponseAmino { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegation_responses: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse"; + value: QueryDelegatorDelegationsResponseAmino; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest"; + value: QueryDelegatorUnbondingDelegationsRequestAmino; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponseAmino { + unbonding_responses: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse"; + value: QueryDelegatorUnbondingDelegationsResponseAmino; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + srcValidatorAddr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dstValidatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryRedelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; + value: Uint8Array; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + src_validator_addr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dst_validator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryRedelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryRedelegationsRequest"; + value: QueryRedelegationsRequestAmino; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponse { + redelegationResponses: RedelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryRedelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; + value: Uint8Array; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponseAmino { + redelegation_responses: RedelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryRedelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryRedelegationsResponse"; + value: QueryRedelegationsResponseAmino; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; + value: QueryDelegatorValidatorsRequestAmino; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the validators' info of a delegator. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseAmino { + /** validators defines the validators' info of a delegator. */ + validators: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; + value: QueryDelegatorValidatorsResponseAmino; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegatorValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr: string; + /** validator_addr defines the validator address to query for. */ + validator_addr: string; +} +export interface QueryDelegatorValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorRequest"; + value: QueryDelegatorValidatorRequestAmino; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponse { + /** validator defines the validator info. */ + validator: Validator; +} +export interface QueryDelegatorValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponseAmino { + /** validator defines the validator info. */ + validator: ValidatorAmino; +} +export interface QueryDelegatorValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorResponse"; + value: QueryDelegatorValidatorResponseAmino; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequest { + /** height defines at which height to query the historical info. */ + height: bigint; +} +export interface QueryHistoricalInfoRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequestAmino { + /** height defines at which height to query the historical info. */ + height: string; +} +export interface QueryHistoricalInfoRequestAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoRequest"; + value: QueryHistoricalInfoRequestAmino; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponse { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfo; +} +export interface QueryHistoricalInfoResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponseAmino { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfoAmino; +} +export interface QueryHistoricalInfoResponseAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoResponse"; + value: QueryHistoricalInfoResponseAmino; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequest {} +export interface QueryPoolRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest"; + value: Uint8Array; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequestAmino {} +export interface QueryPoolRequestAminoMsg { + type: "cosmos-sdk/QueryPoolRequest"; + value: QueryPoolRequestAmino; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponse { + /** pool defines the pool info. */ + pool: Pool; +} +export interface QueryPoolResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse"; + value: Uint8Array; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponseAmino { + /** pool defines the pool info. */ + pool: PoolAmino; +} +export interface QueryPoolResponseAminoMsg { + type: "cosmos-sdk/QueryPoolResponse"; + value: QueryPoolResponseAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { + return { + status: "", + pagination: undefined + }; +} +export const QueryValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + aminoType: "cosmos-sdk/QueryValidatorsRequest", + is(o: any): o is QueryValidatorsRequest { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryValidatorsRequestAmino { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + message.status = object.status ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsRequestAminoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsRequest", + value: QueryValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsRequestProtoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.decode(message.value); + }, + toProto(message: QueryValidatorsRequest): Uint8Array { + return QueryValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + value: QueryValidatorsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorsRequest.typeUrl, QueryValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsRequest.aminoType, QueryValidatorsRequest.typeUrl); +function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + aminoType: "cosmos-sdk/QueryValidatorsResponse", + is(o: any): o is QueryValidatorsResponse { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isAmino(o: any): o is QueryValidatorsResponseAmino { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, + encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.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): QueryValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.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: DeepPartial): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsResponseAminoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsResponse", + value: QueryValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsResponseProtoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.decode(message.value); + }, + toProto(message: QueryValidatorsResponse): Uint8Array { + return QueryValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + value: QueryValidatorsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorsResponse.typeUrl, QueryValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsResponse.aminoType, QueryValidatorsResponse.typeUrl); +function createBaseQueryValidatorRequest(): QueryValidatorRequest { + return { + validatorAddr: "" + }; +} +export const QueryValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + aminoType: "cosmos-sdk/QueryValidatorRequest", + is(o: any): o is QueryValidatorRequest { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorRequestAmino { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryValidatorRequestAminoMsg): QueryValidatorRequest { + return QueryValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorRequest): QueryValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorRequest", + value: QueryValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorRequestProtoMsg): QueryValidatorRequest { + return QueryValidatorRequest.decode(message.value); + }, + toProto(message: QueryValidatorRequest): Uint8Array { + return QueryValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorRequest): QueryValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + value: QueryValidatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorRequest.typeUrl, QueryValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorRequest.aminoType, QueryValidatorRequest.typeUrl); +function createBaseQueryValidatorResponse(): QueryValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + aminoType: "cosmos-sdk/QueryValidatorResponse", + is(o: any): o is QueryValidatorResponse { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isAmino(o: any): o is QueryValidatorResponseAmino { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, + encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { + return QueryValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorResponse): QueryValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorResponse", + value: QueryValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorResponseProtoMsg): QueryValidatorResponse { + return QueryValidatorResponse.decode(message.value); + }, + toProto(message: QueryValidatorResponse): Uint8Array { + return QueryValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorResponse): QueryValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + value: QueryValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorResponse.typeUrl, QueryValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorResponse.aminoType, QueryValidatorResponse.typeUrl); +function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorDelegationsRequest", + is(o: any): o is QueryValidatorDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsRequestAminoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsRequestProtoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsRequest): Uint8Array { + return QueryValidatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDelegationsRequest.typeUrl, QueryValidatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsRequest.aminoType, QueryValidatorDelegationsRequest.typeUrl); +function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryValidatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorDelegationsResponse", + is(o: any): o is QueryValidatorDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isAmino(o: any): o is QueryValidatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, + encode(message: QueryValidatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.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): QueryValidatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.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: DeepPartial): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsResponseAminoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsResponseProtoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsResponse): Uint8Array { + return QueryValidatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDelegationsResponse.typeUrl, QueryValidatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsResponse.aminoType, QueryValidatorDelegationsResponse.typeUrl); +function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + is(o: any): o is QueryValidatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + encode(message: QueryValidatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsRequestAminoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsRequestProtoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsRequest): Uint8Array { + return QueryValidatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsRequest.typeUrl, QueryValidatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsRequest.aminoType, QueryValidatorUnbondingDelegationsRequest.typeUrl); +function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + is(o: any): o is QueryValidatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, + encode(message: QueryValidatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.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): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.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: DeepPartial): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsResponseAminoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsResponseProtoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsResponse): Uint8Array { + return QueryValidatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsResponse.typeUrl, QueryValidatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsResponse.aminoType, QueryValidatorUnbondingDelegationsResponse.typeUrl); +function createBaseQueryDelegationRequest(): QueryDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + aminoType: "cosmos-sdk/QueryDelegationRequest", + is(o: any): o is QueryDelegationRequest { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegationRequestAmino { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegationRequestAminoMsg): QueryDelegationRequest { + return QueryDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationRequest): QueryDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationRequest", + value: QueryDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationRequestProtoMsg): QueryDelegationRequest { + return QueryDelegationRequest.decode(message.value); + }, + toProto(message: QueryDelegationRequest): Uint8Array { + return QueryDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationRequest): QueryDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + value: QueryDelegationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegationRequest.typeUrl, QueryDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationRequest.aminoType, QueryDelegationRequest.typeUrl); +function createBaseQueryDelegationResponse(): QueryDelegationResponse { + return { + delegationResponse: undefined + }; +} +export const QueryDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + aminoType: "cosmos-sdk/QueryDelegationResponse", + is(o: any): o is QueryDelegationResponse { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + isAmino(o: any): o is QueryDelegationResponseAmino { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegationResponse !== undefined) { + DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + message.delegationResponse = object.delegationResponse !== undefined && object.delegationResponse !== null ? DelegationResponse.fromPartial(object.delegationResponse) : undefined; + return message; + }, + fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; + }, + toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { + const obj: any = {}; + obj.delegation_response = message.delegationResponse ? DelegationResponse.toAmino(message.delegationResponse) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegationResponseAminoMsg): QueryDelegationResponse { + return QueryDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationResponse): QueryDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationResponse", + value: QueryDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationResponseProtoMsg): QueryDelegationResponse { + return QueryDelegationResponse.decode(message.value); + }, + toProto(message: QueryDelegationResponse): Uint8Array { + return QueryDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationResponse): QueryDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + value: QueryDelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegationResponse.typeUrl, QueryDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationResponse.aminoType, QueryDelegationResponse.typeUrl); +function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryUnbondingDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + aminoType: "cosmos-sdk/QueryUnbondingDelegationRequest", + is(o: any): o is QueryUnbondingDelegationRequest { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryUnbondingDelegationRequestAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryUnbondingDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationRequestAminoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationRequestProtoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationRequest): Uint8Array { + return QueryUnbondingDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUnbondingDelegationRequest.typeUrl, QueryUnbondingDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationRequest.aminoType, QueryUnbondingDelegationRequest.typeUrl); +function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { + return { + unbond: UnbondingDelegation.fromPartial({}) + }; +} +export const QueryUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + aminoType: "cosmos-sdk/QueryUnbondingDelegationResponse", + is(o: any): o is QueryUnbondingDelegationResponse { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.is(o.unbond)); + }, + isAmino(o: any): o is QueryUnbondingDelegationResponseAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.isAmino(o.unbond)); + }, + encode(message: QueryUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbond !== undefined) { + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + message.unbond = object.unbond !== undefined && object.unbond !== null ? UnbondingDelegation.fromPartial(object.unbond) : undefined; + return message; + }, + fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; + }, + toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { + const obj: any = {}; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : UnbondingDelegation.toAmino(UnbondingDelegation.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationResponseProtoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationResponse): Uint8Array { + return QueryUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUnbondingDelegationResponse.typeUrl, QueryUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationResponse.aminoType, QueryUnbondingDelegationResponse.typeUrl); +function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsRequest", + is(o: any): o is QueryDelegatorDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsRequestAminoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsRequestProtoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsRequest): Uint8Array { + return QueryDelegatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsRequest.typeUrl, QueryDelegatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsRequest.aminoType, QueryDelegatorDelegationsRequest.typeUrl); +function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsResponse", + is(o: any): o is QueryDelegatorDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isAmino(o: any): o is QueryDelegatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, + encode(message: QueryDelegatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.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): QueryDelegatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.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: DeepPartial): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsResponseAminoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsResponseProtoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsResponse): Uint8Array { + return QueryDelegatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsResponse.typeUrl, QueryDelegatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsResponse.aminoType, QueryDelegatorDelegationsResponse.typeUrl); +function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + is(o: any): o is QueryDelegatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsRequestAminoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsRequestProtoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsRequest): Uint8Array { + return QueryDelegatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsRequest.typeUrl, QueryDelegatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsRequest.aminoType, QueryDelegatorUnbondingDelegationsRequest.typeUrl); +function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + is(o: any): o is QueryDelegatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.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): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.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: DeepPartial): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsResponseAminoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsResponseProtoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsResponse): Uint8Array { + return QueryDelegatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsResponse.typeUrl, QueryDelegatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsResponse.aminoType, QueryDelegatorUnbondingDelegationsResponse.typeUrl); +function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { + return { + delegatorAddr: "", + srcValidatorAddr: "", + dstValidatorAddr: "", + pagination: undefined + }; +} +export const QueryRedelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + aminoType: "cosmos-sdk/QueryRedelegationsRequest", + is(o: any): o is QueryRedelegationsRequest { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.srcValidatorAddr === "string" && typeof o.dstValidatorAddr === "string"); + }, + isAmino(o: any): o is QueryRedelegationsRequestAmino { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.src_validator_addr === "string" && typeof o.dst_validator_addr === "string"); + }, + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.srcValidatorAddr !== "") { + writer.uint32(18).string(message.srcValidatorAddr); + } + if (message.dstValidatorAddr !== "") { + writer.uint32(26).string(message.dstValidatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.srcValidatorAddr = reader.string(); + break; + case 3: + message.dstValidatorAddr = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.srcValidatorAddr = object.srcValidatorAddr ?? ""; + message.dstValidatorAddr = object.dstValidatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.src_validator_addr = message.srcValidatorAddr === "" ? undefined : message.srcValidatorAddr; + obj.dst_validator_addr = message.dstValidatorAddr === "" ? undefined : message.dstValidatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsRequestAminoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsRequest", + value: QueryRedelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsRequestProtoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.decode(message.value); + }, + toProto(message: QueryRedelegationsRequest): Uint8Array { + return QueryRedelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + value: QueryRedelegationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRedelegationsRequest.typeUrl, QueryRedelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsRequest.aminoType, QueryRedelegationsRequest.typeUrl); +function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { + return { + redelegationResponses: [], + pagination: undefined + }; +} +export const QueryRedelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + aminoType: "cosmos-sdk/QueryRedelegationsResponse", + is(o: any): o is QueryRedelegationsResponse { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegationResponses) && (!o.redelegationResponses.length || RedelegationResponse.is(o.redelegationResponses[0]))); + }, + isAmino(o: any): o is QueryRedelegationsResponseAmino { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegation_responses) && (!o.redelegation_responses.length || RedelegationResponse.isAmino(o.redelegation_responses[0]))); + }, + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.redelegationResponses) { + RedelegationResponse.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): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationResponses.push(RedelegationResponse.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: DeepPartial): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegationResponses?.map(e => RedelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { + const obj: any = {}; + if (message.redelegationResponses) { + obj.redelegation_responses = message.redelegationResponses.map(e => e ? RedelegationResponse.toAmino(e) : undefined); + } else { + obj.redelegation_responses = message.redelegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsResponseAminoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsResponse", + value: QueryRedelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsResponseProtoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.decode(message.value); + }, + toProto(message: QueryRedelegationsResponse): Uint8Array { + return QueryRedelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + value: QueryRedelegationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRedelegationsResponse.typeUrl, QueryRedelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsResponse.aminoType, QueryRedelegationsResponse.typeUrl); +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsRequest", + is(o: any): o is QueryDelegatorValidatorsRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsRequestAminoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsRequestProtoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsRequest): Uint8Array { + return QueryDelegatorValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsRequest.typeUrl, QueryDelegatorValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsRequest.aminoType, QueryDelegatorValidatorsRequest.typeUrl); +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryDelegatorValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsResponse", + is(o: any): o is QueryDelegatorValidatorsResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isAmino(o: any): o is QueryDelegatorValidatorsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.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): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.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: DeepPartial): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsResponseAminoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsResponseProtoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsResponse): Uint8Array { + return QueryDelegatorValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsResponse.typeUrl, QueryDelegatorValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsResponse.aminoType, QueryDelegatorValidatorsResponse.typeUrl); +function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegatorValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorRequest", + is(o: any): o is QueryDelegatorValidatorRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + encode(message: QueryDelegatorValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorRequestAminoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorRequestProtoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorRequest): Uint8Array { + return QueryDelegatorValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorRequest.typeUrl, QueryDelegatorValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorRequest.aminoType, QueryDelegatorValidatorRequest.typeUrl); +function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryDelegatorValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorResponse", + is(o: any): o is QueryDelegatorValidatorResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isAmino(o: any): o is QueryDelegatorValidatorResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, + encode(message: QueryDelegatorValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorResponseProtoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorResponse): Uint8Array { + return QueryDelegatorValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegatorValidatorResponse.typeUrl, QueryDelegatorValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorResponse.aminoType, QueryDelegatorValidatorResponse.typeUrl); +function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { + return { + height: BigInt(0) + }; +} +export const QueryHistoricalInfoRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + aminoType: "cosmos-sdk/QueryHistoricalInfoRequest", + is(o: any): o is QueryHistoricalInfoRequest { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is QueryHistoricalInfoRequestAmino { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoRequest(); + 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: DeepPartial): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoRequestAminoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoRequestProtoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.decode(message.value); + }, + toProto(message: QueryHistoricalInfoRequest): Uint8Array { + return QueryHistoricalInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalInfoRequest.typeUrl, QueryHistoricalInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoRequest.aminoType, QueryHistoricalInfoRequest.typeUrl); +function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { + return { + hist: undefined + }; +} +export const QueryHistoricalInfoResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + aminoType: "cosmos-sdk/QueryHistoricalInfoResponse", + is(o: any): o is QueryHistoricalInfoResponse { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryHistoricalInfoResponseAmino { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hist !== undefined) { + HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hist = HistoricalInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + message.hist = object.hist !== undefined && object.hist !== null ? HistoricalInfo.fromPartial(object.hist) : undefined; + return message; + }, + fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; + }, + toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { + const obj: any = {}; + obj.hist = message.hist ? HistoricalInfo.toAmino(message.hist) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoResponseAminoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoResponseProtoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.decode(message.value); + }, + toProto(message: QueryHistoricalInfoResponse): Uint8Array { + return QueryHistoricalInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalInfoResponse.typeUrl, QueryHistoricalInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoResponse.aminoType, QueryHistoricalInfoResponse.typeUrl); +function createBaseQueryPoolRequest(): QueryPoolRequest { + return {}; +} +export const QueryPoolRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + aminoType: "cosmos-sdk/QueryPoolRequest", + is(o: any): o is QueryPoolRequest { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + isAmino(o: any): o is QueryPoolRequestAmino { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPoolRequestAminoMsg): QueryPoolRequest { + return QueryPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolRequest): QueryPoolRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPoolRequest", + value: QueryPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolRequestProtoMsg): QueryPoolRequest { + return QueryPoolRequest.decode(message.value); + }, + toProto(message: QueryPoolRequest): Uint8Array { + return QueryPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolRequest): QueryPoolRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + value: QueryPoolRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPoolRequest.typeUrl, QueryPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolRequest.aminoType, QueryPoolRequest.typeUrl); +function createBaseQueryPoolResponse(): QueryPoolResponse { + return { + pool: Pool.fromPartial({}) + }; +} +export const QueryPoolResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + aminoType: "cosmos-sdk/QueryPoolResponse", + is(o: any): o is QueryPoolResponse { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.is(o.pool)); + }, + isAmino(o: any): o is QueryPoolResponseAmino { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.isAmino(o.pool)); + }, + encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pool !== undefined) { + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = Pool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + message.pool = object.pool !== undefined && object.pool !== null ? Pool.fromPartial(object.pool) : undefined; + return message; + }, + fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; + }, + toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { + const obj: any = {}; + obj.pool = message.pool ? Pool.toAmino(message.pool) : Pool.toAmino(Pool.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { + return QueryPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolResponse): QueryPoolResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPoolResponse", + value: QueryPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolResponseProtoMsg): QueryPoolResponse { + return QueryPoolResponse.decode(message.value); + }, + toProto(message: QueryPoolResponse): Uint8Array { + return QueryPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolResponse): QueryPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + value: QueryPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPoolResponse.typeUrl, QueryPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolResponse.aminoType, QueryPoolResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.staking.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.staking.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/staking/v1beta1/staking.ts b/libs/injectivejs/src/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 00000000..ab2a299e --- /dev/null +++ b/libs/injectivejs/src/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,3005 @@ +import { Header, HeaderAmino } from "../../../tendermint/types/types"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { ValidatorUpdate, ValidatorUpdateAmino } from "../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +/** BondStatus is the status of a validator. */ +export enum BondStatus { + /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1, +} +export const BondStatusAmino = BondStatus; +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case "BOND_STATUS_UNSPECIFIED": + return BondStatus.BOND_STATUS_UNSPECIFIED; + case 1: + case "BOND_STATUS_UNBONDED": + return BondStatus.BOND_STATUS_UNBONDED; + case 2: + case "BOND_STATUS_UNBONDING": + return BondStatus.BOND_STATUS_UNBONDING; + case 3: + case "BOND_STATUS_BONDED": + return BondStatus.BOND_STATUS_BONDED; + case -1: + case "UNRECOGNIZED": + default: + return BondStatus.UNRECOGNIZED; + } +} +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return "BOND_STATUS_UNSPECIFIED"; + case BondStatus.BOND_STATUS_UNBONDED: + return "BOND_STATUS_UNBONDED"; + case BondStatus.BOND_STATUS_UNBONDING: + return "BOND_STATUS_UNBONDING"; + case BondStatus.BOND_STATUS_BONDED: + return "BOND_STATUS_BONDED"; + case BondStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** 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 InfractionAmino = Infraction; +export function infractionFromJSON(object: any): Infraction { + switch (object) { + case 0: + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; + case 1: + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; + case 2: + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return Infraction.UNRECOGNIZED; + } +} +export function infractionToJSON(object: Infraction): string { + switch (object) { + 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"; + } +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header: Header; + valset: Validator[]; +} +export interface HistoricalInfoProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo"; + value: Uint8Array; +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoAmino { + header: HeaderAmino; + valset: ValidatorAmino[]; +} +export interface HistoricalInfoAminoMsg { + type: "cosmos-sdk/HistoricalInfo"; + value: HistoricalInfoAmino; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + maxRate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + maxChangeRate: string; +} +export interface CommissionRatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates"; + value: Uint8Array; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesAmino { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + max_rate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + max_change_rate: string; +} +export interface CommissionRatesAminoMsg { + type: "cosmos-sdk/CommissionRates"; + value: CommissionRatesAmino; +} +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commissionRates: CommissionRates; + /** update_time is the last time the commission rate was changed. */ + updateTime: Date; +} +export interface CommissionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Commission"; + value: Uint8Array; +} +/** 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; + /** update_time is the last time the commission rate was changed. */ + update_time: string; +} +export interface CommissionAminoMsg { + type: "cosmos-sdk/Commission"; + value: CommissionAmino; +} +/** Description defines a validator description. */ +export interface Description { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + securityContact: string; + /** details define other optional details. */ + details: string; +} +export interface DescriptionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Description"; + value: Uint8Array; +} +/** Description defines a validator description. */ +export interface DescriptionAmino { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + security_contact: string; + /** details define other optional details. */ + details: string; +} +export interface DescriptionAminoMsg { + type: "cosmos-sdk/Description"; + value: DescriptionAmino; +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface Validator { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensusPubkey?: Any | undefined; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegatorShares: string; + /** description defines the description terms for the validator. */ + description: Description; + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbondingHeight: bigint; + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbondingTime: Date; + /** commission defines the commission parameters. */ + commission: Commission; + /** + * 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; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbondingIds: bigint[]; +} +export interface ValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validator"; + value: Uint8Array; +} +export type ValidatorEncoded = Omit & { + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */consensusPubkey?: AnyProtoMsg | undefined; +}; +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operator_address: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensus_pubkey?: AnyAmino; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegator_shares: string; + /** description defines the description terms for the validator. */ + 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; + /** commission defines the commission parameters. */ + 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; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbonding_ids: string[]; +} +export interface ValidatorAminoMsg { + type: "cosmos-sdk/Validator"; + value: ValidatorAmino; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + addresses: string[]; +} +export interface ValAddressesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses"; + value: Uint8Array; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesAmino { + addresses: string[]; +} +export interface ValAddressesAminoMsg { + type: "cosmos-sdk/ValAddresses"; + value: ValAddressesAmino; +} +/** + * 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. + */ +export interface DVPair { + delegatorAddress: string; + validatorAddress: string; +} +export interface DVPairProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPair"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DVPairAmino { + delegator_address: string; + validator_address: string; +} +export interface DVPairAminoMsg { + type: "cosmos-sdk/DVPair"; + value: DVPairAmino; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} +export interface DVPairsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPairs"; + value: Uint8Array; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsAmino { + pairs: DVPairAmino[]; +} +export interface DVPairsAminoMsg { + type: "cosmos-sdk/DVPairs"; + value: DVPairsAmino; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; +} +export interface DVVTripletProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet"; + value: Uint8Array; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletAmino { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; +} +export interface DVVTripletAminoMsg { + type: "cosmos-sdk/DVVTriplet"; + value: DVVTripletAmino; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} +export interface DVVTripletsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets"; + value: Uint8Array; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsAmino { + triplets: DVVTripletAmino[]; +} +export interface DVVTripletsAminoMsg { + type: "cosmos-sdk/DVVTriplets"; + value: DVVTripletsAmino; +} +/** + * 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. + */ +export interface Delegation { + /** delegator_address is the encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the encoded address of the validator. */ + validatorAddress: string; + /** shares define the delegation shares received. */ + shares: string; +} +export interface DelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Delegation"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DelegationAmino { + /** delegator_address is the encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the encoded address of the validator. */ + validator_address: string; + /** shares define the delegation shares received. */ + shares: string; +} +export interface DelegationAminoMsg { + type: "cosmos-sdk/Delegation"; + value: DelegationAmino; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + /** delegator_address is the encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the encoded address of the validator. */ + validatorAddress: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntry[]; +} +export interface UnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation"; + value: Uint8Array; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationAmino { + /** delegator_address is the encoded address of the delegator. */ + delegator_address: string; + /** validator_address is the encoded address of the validator. */ + validator_address: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntryAmino[]; +} +export interface UnbondingDelegationAminoMsg { + type: "cosmos-sdk/UnbondingDelegation"; + value: UnbondingDelegationAmino; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; + /** completion_time is the unix time for unbonding completion. */ + completionTime: Date; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initialBalance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; +} +export interface UnbondingDelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; + value: Uint8Array; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +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; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initial_balance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count: string; +} +export interface UnbondingDelegationEntryAminoMsg { + type: "cosmos-sdk/UnbondingDelegationEntry"; + value: UnbondingDelegationEntryAmino; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: bigint; + /** completion_time defines the unix time for redelegation completion. */ + completionTime: Date; + /** initial_balance defines the initial balance when redelegation started. */ + initialBalance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + sharesDst: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; +} +export interface RedelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; + value: Uint8Array; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +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; + /** initial_balance defines the initial balance when redelegation started. */ + initial_balance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + shares_dst: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count: string; +} +export interface RedelegationEntryAminoMsg { + type: "cosmos-sdk/RedelegationEntry"; + value: RedelegationEntryAmino; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_src_address is the validator redelegation source operator address. */ + validatorSrcAddress: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validatorDstAddress: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntry[]; +} +export interface RedelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Redelegation"; + value: Uint8Array; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address: string; + /** validator_src_address is the validator redelegation source operator address. */ + validator_src_address: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validator_dst_address: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntryAmino[]; +} +export interface RedelegationAminoMsg { + type: "cosmos-sdk/Redelegation"; + value: RedelegationAmino; +} +/** Params defines the parameters for the x/staking module. */ +export interface Params { + /** unbonding_time is the time duration of unbonding. */ + unbondingTime: Duration; + /** max_validators is the maximum number of validators. */ + maxValidators: number; + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + maxEntries: number; + /** historical_entries is the number of historical entries to persist. */ + 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 x/staking module. */ +export interface ParamsAmino { + /** unbonding_time is the time duration of unbonding. */ + 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). */ + max_entries: number; + /** historical_entries is the number of historical entries to persist. */ + 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/x/staking/Params"; + value: ParamsAmino; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation: Delegation; + balance: Coin; +} +export interface DelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse"; + value: Uint8Array; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseAmino { + delegation: DelegationAmino; + balance: CoinAmino; +} +export interface DelegationResponseAminoMsg { + type: "cosmos-sdk/DelegationResponse"; + value: DelegationResponseAmino; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry: RedelegationEntry; + balance: string; +} +export interface RedelegationEntryResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse"; + value: Uint8Array; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseAmino { + redelegation_entry: RedelegationEntryAmino; + balance: string; +} +export interface RedelegationEntryResponseAminoMsg { + type: "cosmos-sdk/RedelegationEntryResponse"; + value: RedelegationEntryResponseAmino; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation: Redelegation; + entries: RedelegationEntryResponse[]; +} +export interface RedelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse"; + value: Uint8Array; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseAmino { + redelegation: RedelegationAmino; + entries: RedelegationEntryResponseAmino[]; +} +export interface RedelegationResponseAminoMsg { + type: "cosmos-sdk/RedelegationResponse"; + value: RedelegationResponseAmino; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} +export interface PoolProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Pool"; + value: Uint8Array; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolAmino { + not_bonded_tokens: string; + bonded_tokens: string; +} +export interface PoolAminoMsg { + type: "cosmos-sdk/Pool"; + value: PoolAmino; +} +/** + * 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[]; +} +export interface ValidatorUpdatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; + value: Uint8Array; +} +/** + * 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[]; +} +export interface ValidatorUpdatesAminoMsg { + type: "cosmos-sdk/ValidatorUpdates"; + value: ValidatorUpdatesAmino; +} +function createBaseHistoricalInfo(): HistoricalInfo { + return { + header: Header.fromPartial({}), + valset: [] + }; +} +export const HistoricalInfo = { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + aminoType: "cosmos-sdk/HistoricalInfo", + is(o: any): o is HistoricalInfo { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.is(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.is(o.valset[0]))); + }, + isAmino(o: any): o is HistoricalInfoAmino { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.isAmino(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.isAmino(o.valset[0]))); + }, + encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HistoricalInfo { + const message = createBaseHistoricalInfo(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.valset = object.valset?.map(e => Validator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HistoricalInfoAmino): HistoricalInfo { + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; + }, + toAmino(message: HistoricalInfo): HistoricalInfoAmino { + const obj: any = {}; + 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 { + obj.valset = message.valset; + } + return obj; + }, + fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo { + return HistoricalInfo.fromAmino(object.value); + }, + toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg { + return { + type: "cosmos-sdk/HistoricalInfo", + value: HistoricalInfo.toAmino(message) + }; + }, + fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo { + return HistoricalInfo.decode(message.value); + }, + toProto(message: HistoricalInfo): Uint8Array { + return HistoricalInfo.encode(message).finish(); + }, + toProtoMsg(message: HistoricalInfo): HistoricalInfoProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + value: HistoricalInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HistoricalInfo.typeUrl, HistoricalInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(HistoricalInfo.aminoType, HistoricalInfo.typeUrl); +function createBaseCommissionRates(): CommissionRates { + return { + rate: "", + maxRate: "", + maxChangeRate: "" + }; +} +export const CommissionRates = { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + aminoType: "cosmos-sdk/CommissionRates", + is(o: any): o is CommissionRates { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.maxRate === "string" && typeof o.maxChangeRate === "string"); + }, + isAmino(o: any): o is CommissionRatesAmino { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.max_rate === "string" && typeof o.max_change_rate === "string"); + }, + encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rate !== "") { + writer.uint32(10).string(message.rate); + } + if (message.maxRate !== "") { + writer.uint32(18).string(message.maxRate); + } + if (message.maxChangeRate !== "") { + writer.uint32(26).string(message.maxChangeRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommissionRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommissionRates { + const message = createBaseCommissionRates(); + message.rate = object.rate ?? ""; + message.maxRate = object.maxRate ?? ""; + message.maxChangeRate = object.maxChangeRate ?? ""; + return message; + }, + fromAmino(object: CommissionRatesAmino): CommissionRates { + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; + }, + toAmino(message: CommissionRates): CommissionRatesAmino { + const obj: any = {}; + obj.rate = message.rate ?? ""; + obj.max_rate = message.maxRate ?? ""; + obj.max_change_rate = message.maxChangeRate ?? ""; + return obj; + }, + fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { + return CommissionRates.fromAmino(object.value); + }, + toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg { + return { + type: "cosmos-sdk/CommissionRates", + value: CommissionRates.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates { + return CommissionRates.decode(message.value); + }, + toProto(message: CommissionRates): Uint8Array { + return CommissionRates.encode(message).finish(); + }, + toProtoMsg(message: CommissionRates): CommissionRatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + value: CommissionRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommissionRates.typeUrl, CommissionRates); +GlobalDecoderRegistry.registerAminoProtoMapping(CommissionRates.aminoType, CommissionRates.typeUrl); +function createBaseCommission(): Commission { + return { + commissionRates: CommissionRates.fromPartial({}), + updateTime: new Date() + }; +} +export const Commission = { + typeUrl: "/cosmos.staking.v1beta1.Commission", + aminoType: "cosmos-sdk/Commission", + is(o: any): o is Commission { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.is(o.commissionRates) && Timestamp.is(o.updateTime)); + }, + isAmino(o: any): o is CommissionAmino { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.isAmino(o.commission_rates) && Timestamp.isAmino(o.update_time)); + }, + encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Commission { + const message = createBaseCommission(); + message.commissionRates = object.commissionRates !== undefined && object.commissionRates !== null ? CommissionRates.fromPartial(object.commissionRates) : undefined; + message.updateTime = object.updateTime ?? undefined; + return message; + }, + fromAmino(object: CommissionAmino): Commission { + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time)); + } + return message; + }, + toAmino(message: Commission): CommissionAmino { + const obj: any = {}; + 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 { + return Commission.fromAmino(object.value); + }, + toAminoMsg(message: Commission): CommissionAminoMsg { + return { + type: "cosmos-sdk/Commission", + value: Commission.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionProtoMsg): Commission { + return Commission.decode(message.value); + }, + toProto(message: Commission): Uint8Array { + return Commission.encode(message).finish(); + }, + toProtoMsg(message: Commission): CommissionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Commission", + value: Commission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Commission.typeUrl, Commission); +GlobalDecoderRegistry.registerAminoProtoMapping(Commission.aminoType, Commission.typeUrl); +function createBaseDescription(): Description { + return { + moniker: "", + identity: "", + website: "", + securityContact: "", + details: "" + }; +} +export const Description = { + typeUrl: "/cosmos.staking.v1beta1.Description", + aminoType: "cosmos-sdk/Description", + is(o: any): o is Description { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.securityContact === "string" && typeof o.details === "string"); + }, + isAmino(o: any): o is DescriptionAmino { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.security_contact === "string" && typeof o.details === "string"); + }, + encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moniker !== "") { + writer.uint32(10).string(message.moniker); + } + if (message.identity !== "") { + writer.uint32(18).string(message.identity); + } + if (message.website !== "") { + writer.uint32(26).string(message.website); + } + if (message.securityContact !== "") { + writer.uint32(34).string(message.securityContact); + } + if (message.details !== "") { + writer.uint32(42).string(message.details); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Description { + const message = createBaseDescription(); + message.moniker = object.moniker ?? ""; + message.identity = object.identity ?? ""; + message.website = object.website ?? ""; + message.securityContact = object.securityContact ?? ""; + message.details = object.details ?? ""; + return message; + }, + fromAmino(object: DescriptionAmino): Description { + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; + }, + toAmino(message: Description): DescriptionAmino { + const obj: any = {}; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + obj.identity = message.identity === "" ? undefined : message.identity; + obj.website = message.website === "" ? undefined : message.website; + obj.security_contact = message.securityContact === "" ? undefined : message.securityContact; + obj.details = message.details === "" ? undefined : message.details; + return obj; + }, + fromAminoMsg(object: DescriptionAminoMsg): Description { + return Description.fromAmino(object.value); + }, + toAminoMsg(message: Description): DescriptionAminoMsg { + return { + type: "cosmos-sdk/Description", + value: Description.toAmino(message) + }; + }, + fromProtoMsg(message: DescriptionProtoMsg): Description { + return Description.decode(message.value); + }, + toProto(message: Description): Uint8Array { + return Description.encode(message).finish(); + }, + toProtoMsg(message: Description): DescriptionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Description", + value: Description.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Description.typeUrl, Description); +GlobalDecoderRegistry.registerAminoProtoMapping(Description.aminoType, Description.typeUrl); +function createBaseValidator(): Validator { + return { + operatorAddress: "", + consensusPubkey: undefined, + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + description: Description.fromPartial({}), + unbondingHeight: BigInt(0), + unbondingTime: new Date(), + commission: Commission.fromPartial({}), + minSelfDelegation: "", + unbondingOnHoldRefCount: BigInt(0), + unbondingIds: [] + }; +} +export const Validator = { + typeUrl: "/cosmos.staking.v1beta1.Validator", + aminoType: "cosmos-sdk/Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operatorAddress === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegatorShares === "string" && Description.is(o.description) && typeof o.unbondingHeight === "bigint" && Timestamp.is(o.unbondingTime) && Commission.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.unbondingOnHoldRefCount === "bigint" && Array.isArray(o.unbondingIds) && (!o.unbondingIds.length || typeof o.unbondingIds[0] === "bigint")); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operator_address === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegator_shares === "string" && Description.isAmino(o.description) && typeof o.unbonding_height === "bigint" && Timestamp.isAmino(o.unbonding_time) && Commission.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.unbonding_on_hold_ref_count === "bigint" && Array.isArray(o.unbonding_ids) && (!o.unbonding_ids.length || typeof o.unbonding_ids[0] === "bigint")); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.consensusPubkey !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.consensusPubkey), writer.uint32(18).fork()).ldelim(); + } + if (message.jailed === true) { + writer.uint32(24).bool(message.jailed); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.tokens !== "") { + writer.uint32(42).string(message.tokens); + } + if (message.delegatorShares !== "") { + writer.uint32(50).string(message.delegatorShares); + } + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + } + if (message.unbondingHeight !== BigInt(0)) { + writer.uint32(64).int64(message.unbondingHeight); + } + if (message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + } + if (message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(90).string(message.minSelfDelegation); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(96).int64(message.unbondingOnHoldRefCount); + } + writer.uint32(106).fork(); + for (const v of message.unbondingIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = (reader.int32() as any); + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.commission = Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + case 12: + message.unbondingOnHoldRefCount = reader.int64(); + break; + case 13: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.unbondingIds.push(reader.uint64()); + } + } else { + message.unbondingIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? GlobalDecoderRegistry.fromPartial(object.consensusPubkey) : undefined; + message.jailed = object.jailed ?? false; + message.status = object.status ?? 0; + message.tokens = object.tokens ?? ""; + message.delegatorShares = object.delegatorShares ?? ""; + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? BigInt(object.unbondingHeight.toString()) : BigInt(0); + message.unbondingTime = object.unbondingTime ?? undefined; + message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + message.unbondingIds = object.unbondingIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time)); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + message.unbondingIds = object.unbonding_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; + obj.jailed = message.jailed === false ? undefined : message.jailed; + 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) : 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)) : 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) { + obj.unbonding_ids = message.unbondingIds.map(e => e.toString()); + } else { + obj.unbonding_ids = message.unbondingIds; + } + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + toAminoMsg(message: Validator): ValidatorAminoMsg { + return { + type: "cosmos-sdk/Validator", + value: Validator.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +GlobalDecoderRegistry.registerAminoProtoMapping(Validator.aminoType, Validator.typeUrl); +function createBaseValAddresses(): ValAddresses { + return { + addresses: [] + }; +} +export const ValAddresses = { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + aminoType: "cosmos-sdk/ValAddresses", + is(o: any): o is ValAddresses { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is ValAddressesAmino { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: ValAddressesAmino): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: ValAddresses): ValAddressesAmino { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses { + return ValAddresses.fromAmino(object.value); + }, + toAminoMsg(message: ValAddresses): ValAddressesAminoMsg { + return { + type: "cosmos-sdk/ValAddresses", + value: ValAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses { + return ValAddresses.decode(message.value); + }, + toProto(message: ValAddresses): Uint8Array { + return ValAddresses.encode(message).finish(); + }, + toProtoMsg(message: ValAddresses): ValAddressesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + value: ValAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValAddresses.typeUrl, ValAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(ValAddresses.aminoType, ValAddresses.typeUrl); +function createBaseDVPair(): DVPair { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const DVPair = { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + aminoType: "cosmos-sdk/DVPair", + is(o: any): o is DVPair { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is DVPairAmino { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPair(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVPair { + const message = createBaseDVPair(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: DVPairAmino): DVPair { + const message = createBaseDVPair(); + 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; + } + return message; + }, + toAmino(message: DVPair): DVPairAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: DVPairAminoMsg): DVPair { + return DVPair.fromAmino(object.value); + }, + toAminoMsg(message: DVPair): DVPairAminoMsg { + return { + type: "cosmos-sdk/DVPair", + value: DVPair.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairProtoMsg): DVPair { + return DVPair.decode(message.value); + }, + toProto(message: DVPair): Uint8Array { + return DVPair.encode(message).finish(); + }, + toProtoMsg(message: DVPair): DVPairProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + value: DVPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVPair.typeUrl, DVPair); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPair.aminoType, DVPair.typeUrl); +function createBaseDVPairs(): DVPairs { + return { + pairs: [] + }; +} +export const DVPairs = { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + aminoType: "cosmos-sdk/DVPairs", + is(o: any): o is DVPairs { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.is(o.pairs[0]))); + }, + isAmino(o: any): o is DVPairsAmino { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.isAmino(o.pairs[0]))); + }, + encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pairs) { + DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVPairsAmino): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVPairs): DVPairsAmino { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map(e => e ? DVPair.toAmino(e) : undefined); + } else { + obj.pairs = message.pairs; + } + return obj; + }, + fromAminoMsg(object: DVPairsAminoMsg): DVPairs { + return DVPairs.fromAmino(object.value); + }, + toAminoMsg(message: DVPairs): DVPairsAminoMsg { + return { + type: "cosmos-sdk/DVPairs", + value: DVPairs.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairsProtoMsg): DVPairs { + return DVPairs.decode(message.value); + }, + toProto(message: DVPairs): Uint8Array { + return DVPairs.encode(message).finish(); + }, + toProtoMsg(message: DVPairs): DVPairsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + value: DVPairs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVPairs.typeUrl, DVPairs); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPairs.aminoType, DVPairs.typeUrl); +function createBaseDVVTriplet(): DVVTriplet { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "" + }; +} +export const DVVTriplet = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + aminoType: "cosmos-sdk/DVVTriplet", + is(o: any): o is DVVTriplet { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string"); + }, + isAmino(o: any): o is DVVTripletAmino { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string"); + }, + encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplet { + const message = createBaseDVVTriplet(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + return message; + }, + fromAmino(object: DVVTripletAmino): DVVTriplet { + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; + }, + toAmino(message: DVVTriplet): DVVTripletAmino { + const obj: any = {}; + 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; + return obj; + }, + fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { + return DVVTriplet.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg { + return { + type: "cosmos-sdk/DVVTriplet", + value: DVVTriplet.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet { + return DVVTriplet.decode(message.value); + }, + toProto(message: DVVTriplet): Uint8Array { + return DVVTriplet.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplet): DVVTripletProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + value: DVVTriplet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVVTriplet.typeUrl, DVVTriplet); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplet.aminoType, DVVTriplet.typeUrl); +function createBaseDVVTriplets(): DVVTriplets { + return { + triplets: [] + }; +} +export const DVVTriplets = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + aminoType: "cosmos-sdk/DVVTriplets", + is(o: any): o is DVVTriplets { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.is(o.triplets[0]))); + }, + isAmino(o: any): o is DVVTripletsAmino { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.isAmino(o.triplets[0]))); + }, + encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.triplets) { + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVVTripletsAmino): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVVTriplets): DVVTripletsAmino { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map(e => e ? DVVTriplet.toAmino(e) : undefined); + } else { + obj.triplets = message.triplets; + } + return obj; + }, + fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets { + return DVVTriplets.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg { + return { + type: "cosmos-sdk/DVVTriplets", + value: DVVTriplets.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets { + return DVVTriplets.decode(message.value); + }, + toProto(message: DVVTriplets): Uint8Array { + return DVVTriplets.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplets): DVVTripletsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + value: DVVTriplets.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DVVTriplets.typeUrl, DVVTriplets); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplets.aminoType, DVVTriplets.typeUrl); +function createBaseDelegation(): Delegation { + return { + delegatorAddress: "", + validatorAddress: "", + shares: "" + }; +} +export const Delegation = { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + aminoType: "cosmos-sdk/Delegation", + is(o: any): o is Delegation { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && typeof o.shares === "string"); + }, + isAmino(o: any): o is DelegationAmino { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.shares === "string"); + }, + encode(message: Delegation, 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.shares !== "") { + writer.uint32(26).string(message.shares); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegation(); + 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.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Delegation { + const message = createBaseDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.shares = object.shares ?? ""; + return message; + }, + fromAmino(object: DelegationAmino): Delegation { + const message = createBaseDelegation(); + 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.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; + }, + toAmino(message: Delegation): DelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.shares = message.shares === "" ? undefined : message.shares; + return obj; + }, + fromAminoMsg(object: DelegationAminoMsg): Delegation { + return Delegation.fromAmino(object.value); + }, + toAminoMsg(message: Delegation): DelegationAminoMsg { + return { + type: "cosmos-sdk/Delegation", + value: Delegation.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationProtoMsg): Delegation { + return Delegation.decode(message.value); + }, + toProto(message: Delegation): Uint8Array { + return Delegation.encode(message).finish(); + }, + toProtoMsg(message: Delegation): DelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + value: Delegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Delegation.typeUrl, Delegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Delegation.aminoType, Delegation.typeUrl); +function createBaseUnbondingDelegation(): UnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + entries: [] + }; +} +export const UnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + aminoType: "cosmos-sdk/UnbondingDelegation", + is(o: any): o is UnbondingDelegation { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is UnbondingDelegationAmino { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.isAmino(o.entries[0]))); + }, + encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegation(); + 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.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + 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; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.entries) { + obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation { + return UnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegation", + value: UnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation { + return UnbondingDelegation.decode(message.value); + }, + toProto(message: UnbondingDelegation): Uint8Array { + return UnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegation): UnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + value: UnbondingDelegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UnbondingDelegation.typeUrl, UnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegation.aminoType, UnbondingDelegation.typeUrl); +function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + balance: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) + }; +} +export const UnbondingDelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + aminoType: "cosmos-sdk/UnbondingDelegationEntry", + is(o: any): o is UnbondingDelegationEntry { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.balance === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isAmino(o: any): o is UnbondingDelegationEntryAmino { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.balance === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.balance = object.balance ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; + }, + 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)) : 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; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegationEntry", + value: UnbondingDelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationEntryProtoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.decode(message.value); + }, + toProto(message: UnbondingDelegationEntry): Uint8Array { + return UnbondingDelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + value: UnbondingDelegationEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UnbondingDelegationEntry.typeUrl, UnbondingDelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegationEntry.aminoType, UnbondingDelegationEntry.typeUrl); +function createBaseRedelegationEntry(): RedelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + sharesDst: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) + }; +} +export const RedelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + aminoType: "cosmos-sdk/RedelegationEntry", + is(o: any): o is RedelegationEntry { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.sharesDst === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isAmino(o: any): o is RedelegationEntryAmino { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.shares_dst === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.sharesDst !== "") { + writer.uint32(34).string(message.sharesDst); + } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntry { + const message = createBaseRedelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.sharesDst = object.sharesDst ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RedelegationEntryAmino): RedelegationEntry { + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; + }, + 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)) : 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; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { + return RedelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntry", + value: RedelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry { + return RedelegationEntry.decode(message.value); + }, + toProto(message: RedelegationEntry): Uint8Array { + return RedelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntry): RedelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + value: RedelegationEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationEntry.typeUrl, RedelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntry.aminoType, RedelegationEntry.typeUrl); +function createBaseRedelegation(): Redelegation { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + entries: [] + }; +} +export const Redelegation = { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + aminoType: "cosmos-sdk/Redelegation", + is(o: any): o is Redelegation { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationAmino { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.isAmino(o.entries[0]))); + }, + encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Redelegation { + const message = createBaseRedelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.entries = object.entries?.map(e => RedelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationAmino): Redelegation { + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: Redelegation): RedelegationAmino { + const obj: any = {}; + 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; + if (message.entries) { + obj.entries = message.entries.map(e => e ? RedelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationAminoMsg): Redelegation { + return Redelegation.fromAmino(object.value); + }, + toAminoMsg(message: Redelegation): RedelegationAminoMsg { + return { + type: "cosmos-sdk/Redelegation", + value: Redelegation.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationProtoMsg): Redelegation { + return Redelegation.decode(message.value); + }, + toProto(message: Redelegation): Uint8Array { + return Redelegation.encode(message).finish(); + }, + toProtoMsg(message: Redelegation): RedelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + value: Redelegation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Redelegation.typeUrl, Redelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Redelegation.aminoType, Redelegation.typeUrl); +function createBaseParams(): Params { + return { + unbondingTime: Duration.fromPartial({}), + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + minCommissionRate: "" + }; +} +export const Params = { + typeUrl: "/cosmos.staking.v1beta1.Params", + aminoType: "cosmos-sdk/x/staking/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.unbondingTime) && typeof o.maxValidators === "number" && typeof o.maxEntries === "number" && typeof o.historicalEntries === "number" && typeof o.bondDenom === "string" && typeof o.minCommissionRate === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.unbonding_time) && typeof o.max_validators === "number" && typeof o.max_entries === "number" && typeof o.historical_entries === "number" && typeof o.bond_denom === "string" && typeof o.min_commission_rate === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators); + } + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries); + } + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries); + } + if (message.bondDenom !== "") { + writer.uint32(42).string(message.bondDenom); + } + if (message.minCommissionRate !== "") { + writer.uint32(50).string(message.minCommissionRate); + } + 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.unbondingTime = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + case 6: + message.minCommissionRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Duration.fromPartial(object.unbondingTime) : undefined; + message.maxValidators = object.maxValidators ?? 0; + message.maxEntries = object.maxEntries ?? 0; + message.historicalEntries = object.historicalEntries ?? 0; + message.bondDenom = object.bondDenom ?? ""; + message.minCommissionRate = object.minCommissionRate ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + 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) : 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 { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/x/staking/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.staking.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseDelegationResponse(): DelegationResponse { + return { + delegation: Delegation.fromPartial({}), + balance: Coin.fromPartial({}) + }; +} +export const DelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + aminoType: "cosmos-sdk/DelegationResponse", + is(o: any): o is DelegationResponse { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.is(o.delegation) && Coin.is(o.balance)); + }, + isAmino(o: any): o is DelegationResponseAmino { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.isAmino(o.delegation) && Coin.isAmino(o.balance)); + }, + encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegation !== undefined) { + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelegationResponse { + const message = createBaseDelegationResponse(); + message.delegation = object.delegation !== undefined && object.delegation !== null ? Delegation.fromPartial(object.delegation) : undefined; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DelegationResponseAmino): DelegationResponse { + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DelegationResponse): DelegationResponseAmino { + const obj: any = {}; + 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 { + return DelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg { + return { + type: "cosmos-sdk/DelegationResponse", + value: DelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse { + return DelegationResponse.decode(message.value); + }, + toProto(message: DelegationResponse): Uint8Array { + return DelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: DelegationResponse): DelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + value: DelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelegationResponse.typeUrl, DelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationResponse.aminoType, DelegationResponse.typeUrl); +function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { + return { + redelegationEntry: RedelegationEntry.fromPartial({}), + balance: "" + }; +} +export const RedelegationEntryResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + aminoType: "cosmos-sdk/RedelegationEntryResponse", + is(o: any): o is RedelegationEntryResponse { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.is(o.redelegationEntry) && typeof o.balance === "string"); + }, + isAmino(o: any): o is RedelegationEntryResponseAmino { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.isAmino(o.redelegation_entry) && typeof o.balance === "string"); + }, + encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + message.redelegationEntry = object.redelegationEntry !== undefined && object.redelegationEntry !== null ? RedelegationEntry.fromPartial(object.redelegationEntry) : undefined; + message.balance = object.balance ?? ""; + return message; + }, + fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; + }, + toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { + const obj: any = {}; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.toAmino(RedelegationEntry.fromPartial({})); + obj.balance = message.balance === "" ? undefined : message.balance; + return obj; + }, + fromAminoMsg(object: RedelegationEntryResponseAminoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntryResponse", + value: RedelegationEntryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryResponseProtoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.decode(message.value); + }, + toProto(message: RedelegationEntryResponse): Uint8Array { + return RedelegationEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + value: RedelegationEntryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationEntryResponse.typeUrl, RedelegationEntryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntryResponse.aminoType, RedelegationEntryResponse.typeUrl); +function createBaseRedelegationResponse(): RedelegationResponse { + return { + redelegation: Redelegation.fromPartial({}), + entries: [] + }; +} +export const RedelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + aminoType: "cosmos-sdk/RedelegationResponse", + is(o: any): o is RedelegationResponse { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.is(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.is(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationResponseAmino { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.isAmino(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.isAmino(o.entries[0]))); + }, + encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegation !== undefined) { + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedelegationResponse { + const message = createBaseRedelegationResponse(); + message.redelegation = object.redelegation !== undefined && object.redelegation !== null ? Redelegation.fromPartial(object.redelegation) : undefined; + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationResponseAmino): RedelegationResponse { + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: RedelegationResponse): RedelegationResponseAmino { + const obj: any = {}; + 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 { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse { + return RedelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationResponse", + value: RedelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse { + return RedelegationResponse.decode(message.value); + }, + toProto(message: RedelegationResponse): Uint8Array { + return RedelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationResponse): RedelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + value: RedelegationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedelegationResponse.typeUrl, RedelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationResponse.aminoType, RedelegationResponse.typeUrl); +function createBasePool(): Pool { + return { + notBondedTokens: "", + bondedTokens: "" + }; +} +export const Pool = { + typeUrl: "/cosmos.staking.v1beta1.Pool", + aminoType: "cosmos-sdk/Pool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.notBondedTokens === "string" && typeof o.bondedTokens === "string"); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.not_bonded_tokens === "string" && typeof o.bonded_tokens === "string"); + }, + encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.notBondedTokens !== "") { + writer.uint32(10).string(message.notBondedTokens); + } + if (message.bondedTokens !== "") { + writer.uint32(18).string(message.bondedTokens); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Pool { + const message = createBasePool(); + message.notBondedTokens = object.notBondedTokens ?? ""; + message.bondedTokens = object.bondedTokens ?? ""; + return message; + }, + fromAmino(object: PoolAmino): Pool { + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; + }, + toAmino(message: Pool): PoolAmino { + const obj: any = {}; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; + return obj; + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value); + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: "cosmos-sdk/Pool", + value: Pool.toAmino(message) + }; + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value); + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish(); + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Pool", + value: Pool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); +function createBaseValidatorUpdates(): ValidatorUpdates { + return { + updates: [] + }; +} +export const ValidatorUpdates = { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + aminoType: "cosmos-sdk/ValidatorUpdates", + is(o: any): o is ValidatorUpdates { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.is(o.updates[0]))); + }, + isAmino(o: any): o is ValidatorUpdatesAmino { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.isAmino(o.updates[0]))); + }, + encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorUpdatesAmino): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorUpdates): ValidatorUpdatesAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.updates = message.updates; + } + return obj; + }, + fromAminoMsg(object: ValidatorUpdatesAminoMsg): ValidatorUpdates { + return ValidatorUpdates.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorUpdates): ValidatorUpdatesAminoMsg { + return { + type: "cosmos-sdk/ValidatorUpdates", + value: ValidatorUpdates.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorUpdatesProtoMsg): ValidatorUpdates { + return ValidatorUpdates.decode(message.value); + }, + toProto(message: ValidatorUpdates): Uint8Array { + return ValidatorUpdates.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdates): ValidatorUpdatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + value: ValidatorUpdates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorUpdates.typeUrl, ValidatorUpdates); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorUpdates.aminoType, ValidatorUpdates.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/staking/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/staking/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..81244bbe --- /dev/null +++ b/libs/injectivejs/src/cosmos/staking/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const createCreateValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateValidator.typeUrl, + encoders: toEncoders(MsgCreateValidator), + converters: toConverters(MsgCreateValidator) +}); +export const createEditValidator = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEditValidator.typeUrl, + encoders: toEncoders(MsgEditValidator), + converters: toConverters(MsgEditValidator) +}); +export const createDelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDelegate.typeUrl, + encoders: toEncoders(MsgDelegate), + converters: toConverters(MsgDelegate) +}); +export const createBeginRedelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBeginRedelegate.typeUrl, + encoders: toEncoders(MsgBeginRedelegate), + converters: toConverters(MsgBeginRedelegate) +}); +export const createUndelegate = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUndelegate.typeUrl, + encoders: toEncoders(MsgUndelegate), + converters: toConverters(MsgUndelegate) +}); +export const createCancelUnbondingDelegation = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelUnbondingDelegation.typeUrl, + encoders: toEncoders(MsgCancelUnbondingDelegation), + converters: toConverters(MsgCancelUnbondingDelegation) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/staking/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 00000000..ef9fba80 --- /dev/null +++ b/libs/injectivejs/src/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,1638 @@ +import { Description, DescriptionAmino, CommissionRates, CommissionRatesAmino, Params, ParamsAmino } from "./staking"; +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +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 | undefined; + value: Coin; +} +export interface MsgCreateValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; + value: Uint8Array; +} +export type MsgCreateValidatorEncoded = Omit & { + pubkey?: AnyProtoMsg | undefined; +}; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorAmino { + 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; +} +export interface MsgCreateValidatorAminoMsg { + type: "cosmos-sdk/MsgCreateValidator"; + value: MsgCreateValidatorAmino; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponse {} +export interface MsgCreateValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse"; + value: Uint8Array; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseAmino {} +export interface MsgCreateValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgCreateValidatorResponse"; + value: MsgCreateValidatorResponseAmino; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidator { + description: Description; + validatorAddress: string; + /** + * 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 + */ + commissionRate: string; + minSelfDelegation: string; +} +export interface MsgEditValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator"; + value: Uint8Array; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorAmino { + description: DescriptionAmino; + validator_address: string; + /** + * 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 + */ + commission_rate: string; + min_self_delegation: string; +} +export interface MsgEditValidatorAminoMsg { + type: "cosmos-sdk/MsgEditValidator"; + value: MsgEditValidatorAmino; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponse {} +export interface MsgEditValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse"; + value: Uint8Array; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseAmino {} +export interface MsgEditValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgEditValidatorResponse"; + value: MsgEditValidatorResponseAmino; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgDelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate"; + value: Uint8Array; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateAmino { + delegator_address: string; + validator_address: string; + amount: CoinAmino; +} +export interface MsgDelegateAminoMsg { + type: "cosmos-sdk/MsgDelegate"; + value: MsgDelegateAmino; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponse {} +export interface MsgDelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse"; + value: Uint8Array; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseAmino {} +export interface MsgDelegateResponseAminoMsg { + type: "cosmos-sdk/MsgDelegateResponse"; + value: MsgDelegateResponseAmino; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + amount: Coin; +} +export interface MsgBeginRedelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate"; + value: Uint8Array; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateAmino { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + amount: CoinAmino; +} +export interface MsgBeginRedelegateAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegate"; + value: MsgBeginRedelegateAmino; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponse { + completionTime: Date; +} +export interface MsgBeginRedelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse"; + value: Uint8Array; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseAmino { + completion_time: string; +} +export interface MsgBeginRedelegateResponseAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegateResponse"; + value: MsgBeginRedelegateResponseAmino; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgUndelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate"; + value: Uint8Array; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateAmino { + delegator_address: string; + validator_address: string; + amount: CoinAmino; +} +export interface MsgUndelegateAminoMsg { + type: "cosmos-sdk/MsgUndelegate"; + value: MsgUndelegateAmino; +} +/** 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"; + value: Uint8Array; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseAmino { + completion_time: string; + /** + * amount returns the amount of undelegated coins + * + * Since: cosmos-sdk 0.50 + */ + amount: CoinAmino; +} +export interface MsgUndelegateResponseAminoMsg { + type: "cosmos-sdk/MsgUndelegateResponse"; + value: MsgUndelegateResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgCreateValidator(): MsgCreateValidator { + return { + description: Description.fromPartial({}), + commission: CommissionRates.fromPartial({}), + minSelfDelegation: "", + delegatorAddress: "", + validatorAddress: "", + pubkey: undefined, + value: Coin.fromPartial({}) + }; +} +export const MsgCreateValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + aminoType: "cosmos-sdk/MsgCreateValidator", + is(o: any): o is MsgCreateValidator { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.is(o.description) && CommissionRates.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.value)); + }, + isAmino(o: any): o is MsgCreateValidatorAmino { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.isAmino(o.description) && CommissionRates.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.value)); + }, + encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.commission !== undefined) { + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(26).string(message.minSelfDelegation); + } + if (message.delegatorAddress !== "") { + writer.uint32(34).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(42).string(message.validatorAddress); + } + if (message.pubkey !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.pubkey), writer.uint32(50).fork()).ldelim(); + } + if (message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = GlobalDecoderRegistry.unwrapAny(reader); + break; + case 7: + message.value = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.commission = object.commission !== undefined && object.commission !== null ? CommissionRates.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.pubkey = object.pubkey !== undefined && object.pubkey !== null ? GlobalDecoderRegistry.fromPartial(object.pubkey) : undefined; + message.value = object.value !== undefined && object.value !== null ? Coin.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + 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.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; + }, + toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { + const obj: any = {}; + 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) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { + return MsgCreateValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidator): MsgCreateValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidator", + value: MsgCreateValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorProtoMsg): MsgCreateValidator { + return MsgCreateValidator.decode(message.value); + }, + toProto(message: MsgCreateValidator): Uint8Array { + return MsgCreateValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidator): MsgCreateValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateValidator.typeUrl, MsgCreateValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidator.aminoType, MsgCreateValidator.typeUrl); +function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { + return {}; +} +export const MsgCreateValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + aminoType: "cosmos-sdk/MsgCreateValidatorResponse", + is(o: any): o is MsgCreateValidatorResponse { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateValidatorResponseAmino { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorResponseAminoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorResponseProtoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.decode(message.value); + }, + toProto(message: MsgCreateValidatorResponse): Uint8Array { + return MsgCreateValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateValidatorResponse.typeUrl, MsgCreateValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidatorResponse.aminoType, MsgCreateValidatorResponse.typeUrl); +function createBaseMsgEditValidator(): MsgEditValidator { + return { + description: Description.fromPartial({}), + validatorAddress: "", + commissionRate: "", + minSelfDelegation: "" + }; +} +export const MsgEditValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + aminoType: "cosmos-sdk/MsgEditValidator", + is(o: any): o is MsgEditValidator { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.is(o.description) && typeof o.validatorAddress === "string" && typeof o.commissionRate === "string" && typeof o.minSelfDelegation === "string"); + }, + isAmino(o: any): o is MsgEditValidatorAmino { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.isAmino(o.description) && typeof o.validator_address === "string" && typeof o.commission_rate === "string" && typeof o.min_self_delegation === "string"); + }, + encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.commissionRate !== "") { + writer.uint32(26).string(message.commissionRate); + } + if (message.minSelfDelegation !== "") { + writer.uint32(34).string(message.minSelfDelegation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgEditValidator { + const message = createBaseMsgEditValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.validatorAddress = object.validatorAddress ?? ""; + message.commissionRate = object.commissionRate ?? ""; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + return message; + }, + fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; + }, + toAmino(message: MsgEditValidator): MsgEditValidatorAmino { + const obj: any = {}; + 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; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { + return MsgEditValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidator): MsgEditValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidator", + value: MsgEditValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorProtoMsg): MsgEditValidator { + return MsgEditValidator.decode(message.value); + }, + toProto(message: MsgEditValidator): Uint8Array { + return MsgEditValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidator): MsgEditValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEditValidator.typeUrl, MsgEditValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidator.aminoType, MsgEditValidator.typeUrl); +function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { + return {}; +} +export const MsgEditValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + aminoType: "cosmos-sdk/MsgEditValidatorResponse", + is(o: any): o is MsgEditValidatorResponse { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgEditValidatorResponseAmino { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorResponseAminoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidatorResponse", + value: MsgEditValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorResponseProtoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.decode(message.value); + }, + toProto(message: MsgEditValidatorResponse): Uint8Array { + return MsgEditValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + value: MsgEditValidatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEditValidatorResponse.typeUrl, MsgEditValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidatorResponse.aminoType, MsgEditValidatorResponse.typeUrl); +function createBaseMsgDelegate(): MsgDelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgDelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + aminoType: "cosmos-sdk/MsgDelegate", + is(o: any): o is MsgDelegate { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgDelegateAmino { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgDelegate, 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(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegate(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDelegate { + const message = createBaseMsgDelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgDelegateAmino): MsgDelegate { + const message = createBaseMsgDelegate(); + 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); + } + return message; + }, + toAmino(message: MsgDelegate): MsgDelegateAmino { + 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({})); + return obj; + }, + fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { + return MsgDelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegate): MsgDelegateAminoMsg { + return { + type: "cosmos-sdk/MsgDelegate", + value: MsgDelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateProtoMsg): MsgDelegate { + return MsgDelegate.decode(message.value); + }, + toProto(message: MsgDelegate): Uint8Array { + return MsgDelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegate): MsgDelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDelegate.typeUrl, MsgDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegate.aminoType, MsgDelegate.typeUrl); +function createBaseMsgDelegateResponse(): MsgDelegateResponse { + return {}; +} +export const MsgDelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + aminoType: "cosmos-sdk/MsgDelegateResponse", + is(o: any): o is MsgDelegateResponse { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateResponseAmino { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDelegateResponseAminoMsg): MsgDelegateResponse { + return MsgDelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegateResponse): MsgDelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDelegateResponse", + value: MsgDelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateResponseProtoMsg): MsgDelegateResponse { + return MsgDelegateResponse.decode(message.value); + }, + toProto(message: MsgDelegateResponse): Uint8Array { + return MsgDelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegateResponse): MsgDelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + value: MsgDelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDelegateResponse.typeUrl, MsgDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateResponse.aminoType, MsgDelegateResponse.typeUrl); +function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBeginRedelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + aminoType: "cosmos-sdk/MsgBeginRedelegate", + is(o: any): o is MsgBeginRedelegate { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgBeginRedelegateAmino { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { + const obj: any = {}; + 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) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegate", + value: MsgBeginRedelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateProtoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.decode(message.value); + }, + toProto(message: MsgBeginRedelegate): Uint8Array { + return MsgBeginRedelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBeginRedelegate.typeUrl, MsgBeginRedelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegate.aminoType, MsgBeginRedelegate.typeUrl); +function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { + return { + completionTime: new Date() + }; +} +export const MsgBeginRedelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + aminoType: "cosmos-sdk/MsgBeginRedelegateResponse", + is(o: any): o is MsgBeginRedelegateResponse { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.is(o.completionTime)); + }, + isAmino(o: any): o is MsgBeginRedelegateResponseAmino { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time)); + }, + encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; + }, + toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { + const obj: any = {}; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateResponseProtoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.decode(message.value); + }, + toProto(message: MsgBeginRedelegateResponse): Uint8Array { + return MsgBeginRedelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBeginRedelegateResponse.typeUrl, MsgBeginRedelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegateResponse.aminoType, MsgBeginRedelegateResponse.typeUrl); +function createBaseMsgUndelegate(): MsgUndelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgUndelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + aminoType: "cosmos-sdk/MsgUndelegate", + is(o: any): o is MsgUndelegate { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgUndelegateAmino { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgUndelegate, 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(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegate(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUndelegate { + const message = createBaseMsgUndelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgUndelegateAmino): MsgUndelegate { + const message = createBaseMsgUndelegate(); + 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); + } + return message; + }, + toAmino(message: MsgUndelegate): MsgUndelegateAmino { + 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({})); + return obj; + }, + fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { + return MsgUndelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegate): MsgUndelegateAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegate", + value: MsgUndelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateProtoMsg): MsgUndelegate { + return MsgUndelegate.decode(message.value); + }, + toProto(message: MsgUndelegate): Uint8Array { + return MsgUndelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegate): MsgUndelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegate.typeUrl, MsgUndelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegate.aminoType, MsgUndelegate.typeUrl); +function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { + return { + completionTime: new Date(), + amount: Coin.fromPartial({}) + }; +} +export const MsgUndelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + aminoType: "cosmos-sdk/MsgUndelegateResponse", + is(o: any): o is MsgUndelegateResponse { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.is(o.completionTime) && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgUndelegateResponseAmino { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time) && Coin.isAmino(o.amount)); + }, + encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseMsgUndelegateResponse(); + 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)) : new Date(); + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegateResponse", + value: MsgUndelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.decode(message.value); + }, + toProto(message: MsgUndelegateResponse): Uint8Array { + return MsgUndelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + value: MsgUndelegateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegateResponse.typeUrl, MsgUndelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateResponse.aminoType, MsgUndelegateResponse.typeUrl); +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + is(o: any): o is MsgCancelUnbondingDelegation { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount) && typeof o.creationHeight === "bigint"); + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationAmino { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount) && typeof o.creation_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegation.typeUrl, MsgCancelUnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegation.aminoType, MsgCancelUnbondingDelegation.typeUrl); +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + is(o: any): o is MsgCancelUnbondingDelegationResponse { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationResponseAmino { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegationResponse.typeUrl, MsgCancelUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegationResponse.aminoType, MsgCancelUnbondingDelegationResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/tx/signing/v1beta1/signing.ts b/libs/injectivejs/src/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..8c90655f --- /dev/null +++ b/libs/injectivejs/src/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,688 @@ +import { CompactBitArray, CompactBitArrayAmino } from "../../../crypto/multisig/v1beta1/multisig"; +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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. + */ + 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. + */ + 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. + * + * 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. + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + /** + * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + * + * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + * but is not implemented on the SDK by default. To enable EIP-191, you need + * to pass a custom `TxConfig` that has an implementation of + * `SignModeHandler` for EIP-191. The SDK may decide to fully support + * EIP-191 in the future. + * + * Since: cosmos-sdk 0.45.2 + */ + SIGN_MODE_EIP_191 = 191, + UNRECOGNIZED = -1, +} +export const SignModeAmino = SignMode; +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + 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; + case 191: + case "SIGN_MODE_EIP_191": + return SignMode.SIGN_MODE_EIP_191; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + 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: + return "SIGN_MODE_EIP_191"; + case SignMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} +export interface SignatureDescriptorsProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors"; + value: Uint8Array; +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsAmino { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptorAmino[]; +} +export interface SignatureDescriptorsAminoMsg { + type: "cosmos-sdk/SignatureDescriptors"; + value: SignatureDescriptorsAmino; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: bigint; +} +export interface SignatureDescriptorProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; + value: Uint8Array; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorAmino { + /** public_key is the public key of the signer */ + public_key?: AnyAmino; + data?: SignatureDescriptor_DataAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: string; +} +export interface SignatureDescriptorAminoMsg { + type: "cosmos-sdk/SignatureDescriptor"; + value: SignatureDescriptorAmino; +} +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi; +} +export interface SignatureDescriptor_DataProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Data"; + value: Uint8Array; +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataAmino { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_SingleAmino; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_MultiAmino; +} +export interface SignatureDescriptor_DataAminoMsg { + type: "cosmos-sdk/Data"; + value: SignatureDescriptor_DataAmino; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: Uint8Array; +} +export interface SignatureDescriptor_Data_SingleProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Single"; + value: Uint8Array; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleAmino { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: string; +} +export interface SignatureDescriptor_Data_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: SignatureDescriptor_Data_SingleAmino; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[]; +} +export interface SignatureDescriptor_Data_MultiProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_DataAmino[]; +} +export interface SignatureDescriptor_Data_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: SignatureDescriptor_Data_MultiAmino; +} +function createBaseSignatureDescriptors(): SignatureDescriptors { + return { + signatures: [] + }; +} +export const SignatureDescriptors = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + aminoType: "cosmos-sdk/SignatureDescriptors", + is(o: any): o is SignatureDescriptors { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.is(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptorsAmino { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.isAmino(o.signatures[0]))); + }, + encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptors(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptorsAminoMsg): SignatureDescriptors { + return SignatureDescriptors.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptors): SignatureDescriptorsAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptors", + value: SignatureDescriptors.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorsProtoMsg): SignatureDescriptors { + return SignatureDescriptors.decode(message.value); + }, + toProto(message: SignatureDescriptors): Uint8Array { + return SignatureDescriptors.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptors): SignatureDescriptorsProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + value: SignatureDescriptors.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptors.typeUrl, SignatureDescriptors); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptors.aminoType, SignatureDescriptors.typeUrl); +function createBaseSignatureDescriptor(): SignatureDescriptor { + return { + publicKey: undefined, + data: undefined, + sequence: BigInt(0) + }; +} +export const SignatureDescriptor = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + aminoType: "cosmos-sdk/SignatureDescriptor", + is(o: any): o is SignatureDescriptor { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignatureDescriptorAmino { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.data = object.data !== undefined && object.data !== null ? SignatureDescriptor_Data.fromPartial(object.data) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.data = message.data ? SignatureDescriptor_Data.toAmino(message.data) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { + return SignatureDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor): SignatureDescriptorAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptor", + value: SignatureDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorProtoMsg): SignatureDescriptor { + return SignatureDescriptor.decode(message.value); + }, + toProto(message: SignatureDescriptor): Uint8Array { + return SignatureDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor): SignatureDescriptorProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + value: SignatureDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor.typeUrl, SignatureDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor.aminoType, SignatureDescriptor.typeUrl); +function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { + return { + single: undefined, + multi: undefined + }; +} +export const SignatureDescriptor_Data = { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + aminoType: "cosmos-sdk/Data", + is(o: any): o is SignatureDescriptor_Data { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + isAmino(o: any): o is SignatureDescriptor_DataAmino { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + message.single = object.single !== undefined && object.single !== null ? SignatureDescriptor_Data_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { + const obj: any = {}; + obj.single = message.single ? SignatureDescriptor_Data_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_DataAminoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataAminoMsg { + return { + type: "cosmos-sdk/Data", + value: SignatureDescriptor_Data.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_DataProtoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data): Uint8Array { + return SignatureDescriptor_Data.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + value: SignatureDescriptor_Data.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data.typeUrl, SignatureDescriptor_Data); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data.aminoType, SignatureDescriptor_Data.typeUrl); +function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { + return { + mode: 0, + signature: new Uint8Array() + }; +} +export const SignatureDescriptor_Data_Single = { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is SignatureDescriptor_Data_Single { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is SignatureDescriptor_Data_SingleAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: SignatureDescriptor_Data_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = (reader.int32() as any); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + message.mode = object.mode ?? 0; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: SignatureDescriptor_Data_Single.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_SingleProtoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Single): Uint8Array { + return SignatureDescriptor_Data_Single.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + value: SignatureDescriptor_Data_Single.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Single.typeUrl, SignatureDescriptor_Data_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Single.aminoType, SignatureDescriptor_Data_Single.typeUrl); +function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { + return { + bitarray: undefined, + signatures: [] + }; +} +export const SignatureDescriptor_Data_Multi = { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is SignatureDescriptor_Data_Multi { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.is(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptor_Data_MultiAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.isAmino(o.signatures[0]))); + }, + encode(message: SignatureDescriptor_Data_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor_Data.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_MultiAminoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: SignatureDescriptor_Data_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_MultiProtoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Multi): Uint8Array { + return SignatureDescriptor_Data_Multi.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + value: SignatureDescriptor_Data_Multi.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Multi.typeUrl, SignatureDescriptor_Data_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Multi.aminoType, SignatureDescriptor_Data_Multi.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/tx/v1beta1/service.rpc.func.ts b/libs/injectivejs/src/cosmos/tx/v1beta1/service.rpc.func.ts new file mode 100644 index 00000000..a13635e1 --- /dev/null +++ b/libs/injectivejs/src/cosmos/tx/v1beta1/service.rpc.func.ts @@ -0,0 +1,65 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; +export const createGetSimulate = (clientResolver?: RpcResolver) => buildQuery({ + encode: SimulateRequest.encode, + decode: SimulateResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "Simulate", + clientResolver +}); +export const createGetGetTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxRequest.encode, + decode: GetTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTx", + clientResolver +}); +export const createGetBroadcastTx = (clientResolver?: RpcResolver) => buildQuery({ + encode: BroadcastTxRequest.encode, + decode: BroadcastTxResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "BroadcastTx", + clientResolver +}); +export const createGetGetTxsEvent = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetTxsEventRequest.encode, + decode: GetTxsEventResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetTxsEvent", + clientResolver +}); +export const createGetGetBlockWithTxs = (clientResolver?: RpcResolver) => buildQuery({ + encode: GetBlockWithTxsRequest.encode, + decode: GetBlockWithTxsResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "GetBlockWithTxs", + clientResolver +}); +export const createGetTxDecode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeRequest.encode, + decode: TxDecodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecode", + clientResolver +}); +export const createGetTxEncode = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeRequest.encode, + decode: TxEncodeResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncode", + clientResolver +}); +export const createGetTxEncodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxEncodeAminoRequest.encode, + decode: TxEncodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxEncodeAmino", + clientResolver +}); +export const createGetTxDecodeAmino = (clientResolver?: RpcResolver) => buildQuery({ + encode: TxDecodeAminoRequest.encode, + decode: TxDecodeAminoResponse.decode, + service: "cosmos.tx.v1beta1.Service", + method: "TxDecodeAmino", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/tx/v1beta1/service.ts b/libs/injectivejs/src/cosmos/tx/v1beta1/service.ts new file mode 100644 index 00000000..9c0eaf31 --- /dev/null +++ b/libs/injectivejs/src/cosmos/tx/v1beta1/service.ts @@ -0,0 +1,2294 @@ +import { Tx, TxAmino } from "./tx"; +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; +import { TxResponse, TxResponseAmino, GasInfo, GasInfoAmino, Result, ResultAmino } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino } from "../../../tendermint/types/types"; +import { Block, BlockAmino } from "../../../tendermint/types/block"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** 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 = 0, + /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ + ORDER_BY_ASC = 1, + /** ORDER_BY_DESC - ORDER_BY_DESC defines descending order */ + ORDER_BY_DESC = 2, + UNRECOGNIZED = -1, +} +export const OrderByAmino = OrderBy; +export function orderByFromJSON(object: any): OrderBy { + switch (object) { + case 0: + case "ORDER_BY_UNSPECIFIED": + return OrderBy.ORDER_BY_UNSPECIFIED; + case 1: + case "ORDER_BY_ASC": + return OrderBy.ORDER_BY_ASC; + case 2: + case "ORDER_BY_DESC": + return OrderBy.ORDER_BY_DESC; + case -1: + case "UNRECOGNIZED": + default: + return OrderBy.UNRECOGNIZED; + } +} +export function orderByToJSON(object: OrderBy): string { + switch (object) { + case OrderBy.ORDER_BY_UNSPECIFIED: + return "ORDER_BY_UNSPECIFIED"; + case OrderBy.ORDER_BY_ASC: + return "ORDER_BY_ASC"; + case OrderBy.ORDER_BY_DESC: + return "ORDER_BY_DESC"; + case OrderBy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * 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 - 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 = 2, + /** + * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + * returns immediately. + */ + BROADCAST_MODE_ASYNC = 3, + UNRECOGNIZED = -1, +} +export const BroadcastModeAmino = BroadcastMode; +export function broadcastModeFromJSON(object: any): BroadcastMode { + switch (object) { + case 0: + case "BROADCAST_MODE_UNSPECIFIED": + return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; + case 1: + case "BROADCAST_MODE_BLOCK": + return BroadcastMode.BROADCAST_MODE_BLOCK; + case 2: + case "BROADCAST_MODE_SYNC": + return BroadcastMode.BROADCAST_MODE_SYNC; + case 3: + case "BROADCAST_MODE_ASYNC": + return BroadcastMode.BROADCAST_MODE_ASYNC; + case -1: + case "UNRECOGNIZED": + default: + return BroadcastMode.UNRECOGNIZED; + } +} +export function broadcastModeToJSON(object: BroadcastMode): string { + switch (object) { + case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: + return "BROADCAST_MODE_UNSPECIFIED"; + case BroadcastMode.BROADCAST_MODE_BLOCK: + return "BROADCAST_MODE_BLOCK"; + case BroadcastMode.BROADCAST_MODE_SYNC: + return "BROADCAST_MODE_SYNC"; + case BroadcastMode.BROADCAST_MODE_ASYNC: + return "BROADCAST_MODE_ASYNC"; + case BroadcastMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequest { + /** + * 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. + * 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"; + value: Uint8Array; +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequestAmino { + /** + * 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. + * 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"; + value: GetTxsEventRequestAmino; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponse { + /** txs is the list of queried transactions. */ + txs: Tx[]; + /** tx_responses is the list of queried TxResponses. */ + txResponses: TxResponse[]; + /** + * 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"; + value: Uint8Array; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponseAmino { + /** txs is the list of queried transactions. */ + txs: TxAmino[]; + /** tx_responses is the list of queried TxResponses. */ + tx_responses: TxResponseAmino[]; + /** + * 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"; + value: GetTxsEventResponseAmino; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; + mode: BroadcastMode; +} +export interface BroadcastTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest"; + value: Uint8Array; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes: string; + mode: BroadcastMode; +} +export interface BroadcastTxRequestAminoMsg { + type: "cosmos-sdk/BroadcastTxRequest"; + value: BroadcastTxRequestAmino; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponse { + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface BroadcastTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; + value: Uint8Array; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponseAmino { + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface BroadcastTxResponseAminoMsg { + type: "cosmos-sdk/BroadcastTxResponse"; + value: BroadcastTxResponseAmino; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequest { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: Tx; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + txBytes: Uint8Array; +} +export interface SimulateRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest"; + value: Uint8Array; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequestAmino { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: TxAmino; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + tx_bytes: string; +} +export interface SimulateRequestAminoMsg { + type: "cosmos-sdk/SimulateRequest"; + value: SimulateRequestAmino; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponse { + /** gas_info is the information about gas used in the simulation. */ + gasInfo?: GasInfo; + /** result is the result of the simulation. */ + result?: Result; +} +export interface SimulateResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; + value: Uint8Array; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponseAmino { + /** gas_info is the information about gas used in the simulation. */ + gas_info?: GasInfoAmino; + /** result is the result of the simulation. */ + result?: ResultAmino; +} +export interface SimulateResponseAminoMsg { + type: "cosmos-sdk/SimulateResponse"; + value: SimulateResponseAmino; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequest { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} +export interface GetTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest"; + value: Uint8Array; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequestAmino { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} +export interface GetTxRequestAminoMsg { + type: "cosmos-sdk/GetTxRequest"; + value: GetTxRequestAmino; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponse { + /** tx is the queried transaction. */ + tx?: Tx; + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface GetTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; + value: Uint8Array; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponseAmino { + /** tx is the queried transaction. */ + tx?: TxAmino; + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface GetTxResponseAminoMsg { + type: "cosmos-sdk/GetTxResponse"; + value: GetTxResponseAmino; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequest { + /** height is the height of the block to query. */ + height: bigint; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; +} +export interface GetBlockWithTxsRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; + value: Uint8Array; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestAmino { + /** height is the height of the block to query. */ + height: string; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface GetBlockWithTxsRequestAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsRequest"; + value: GetBlockWithTxsRequestAmino; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponse { + /** txs are the transactions in the block. */ + txs: Tx[]; + blockId?: BlockID; + block?: Block; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetBlockWithTxsResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; + value: Uint8Array; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseAmino { + /** txs are the transactions in the block. */ + txs: TxAmino[]; + block_id?: BlockIDAmino; + block?: BlockAmino; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetBlockWithTxsResponseAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsResponse"; + value: GetBlockWithTxsResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseGetTxsEventRequest(): GetTxsEventRequest { + return { + events: [], + pagination: undefined, + orderBy: 0, + page: BigInt(0), + limit: BigInt(0), + query: "" + }; +} +export const GetTxsEventRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + aminoType: "cosmos-sdk/GetTxsEventRequest", + is(o: any): o is GetTxsEventRequest { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.orderBy) && typeof o.page === "bigint" && typeof o.limit === "bigint" && typeof o.query === "string"); + }, + isAmino(o: any): o is GetTxsEventRequestAmino { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.order_by) && typeof o.page === "bigint" && typeof o.limit === "bigint" && typeof o.query === "string"); + }, + encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(reader.string()); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest(); + 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 { + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + 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 { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e); + } else { + obj.events = message.events; + } + 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 { + return GetTxsEventRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventRequest): GetTxsEventRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventRequest", + value: GetTxsEventRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventRequestProtoMsg): GetTxsEventRequest { + return GetTxsEventRequest.decode(message.value); + }, + toProto(message: GetTxsEventRequest): Uint8Array { + return GetTxsEventRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventRequest): GetTxsEventRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + value: GetTxsEventRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxsEventRequest.typeUrl, GetTxsEventRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventRequest.aminoType, GetTxsEventRequest.typeUrl); +function createBaseGetTxsEventResponse(): GetTxsEventResponse { + return { + txs: [], + txResponses: [], + pagination: undefined, + total: BigInt(0) + }; +} +export const GetTxsEventResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + aminoType: "cosmos-sdk/GetTxsEventResponse", + is(o: any): o is GetTxsEventResponse { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0])) && Array.isArray(o.txResponses) && (!o.txResponses.length || TxResponse.is(o.txResponses[0])) && typeof o.total === "bigint"); + }, + isAmino(o: any): o is GetTxsEventResponseAmino { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0])) && Array.isArray(o.tx_responses) && (!o.tx_responses.length || TxResponse.isAmino(o.tx_responses[0])) && typeof o.total === "bigint"); + }, + encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.txResponses) { + TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.txResponses.push(TxResponse.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 4: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse(); + 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 { + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + 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 { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + if (message.txResponses) { + obj.tx_responses = message.txResponses.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + 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 { + return GetTxsEventResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventResponse): GetTxsEventResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventResponse", + value: GetTxsEventResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventResponseProtoMsg): GetTxsEventResponse { + return GetTxsEventResponse.decode(message.value); + }, + toProto(message: GetTxsEventResponse): Uint8Array { + return GetTxsEventResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventResponse): GetTxsEventResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + value: GetTxsEventResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxsEventResponse.typeUrl, GetTxsEventResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventResponse.aminoType, GetTxsEventResponse.typeUrl); +function createBaseBroadcastTxRequest(): BroadcastTxRequest { + return { + txBytes: new Uint8Array(), + mode: 0 + }; +} +export const BroadcastTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + aminoType: "cosmos-sdk/BroadcastTxRequest", + is(o: any): o is BroadcastTxRequest { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.txBytes instanceof Uint8Array || typeof o.txBytes === "string") && isSet(o.mode)); + }, + isAmino(o: any): o is BroadcastTxRequestAmino { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string") && isSet(o.mode)); + }, + encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + if (message.mode !== 0) { + writer.uint32(16).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + case 2: + message.mode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { + return BroadcastTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxRequest): BroadcastTxRequestAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxRequest", + value: BroadcastTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxRequestProtoMsg): BroadcastTxRequest { + return BroadcastTxRequest.decode(message.value); + }, + toProto(message: BroadcastTxRequest): Uint8Array { + return BroadcastTxRequest.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxRequest): BroadcastTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + value: BroadcastTxRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BroadcastTxRequest.typeUrl, BroadcastTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxRequest.aminoType, BroadcastTxRequest.typeUrl); +function createBaseBroadcastTxResponse(): BroadcastTxResponse { + return { + txResponse: undefined + }; +} +export const BroadcastTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + aminoType: "cosmos-sdk/BroadcastTxResponse", + is(o: any): o is BroadcastTxResponse { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + isAmino(o: any): o is BroadcastTxResponseAmino { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { + const obj: any = {}; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: BroadcastTxResponseAminoMsg): BroadcastTxResponse { + return BroadcastTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxResponse): BroadcastTxResponseAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxResponse", + value: BroadcastTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxResponseProtoMsg): BroadcastTxResponse { + return BroadcastTxResponse.decode(message.value); + }, + toProto(message: BroadcastTxResponse): Uint8Array { + return BroadcastTxResponse.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxResponse): BroadcastTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + value: BroadcastTxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BroadcastTxResponse.typeUrl, BroadcastTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxResponse.aminoType, BroadcastTxResponse.typeUrl); +function createBaseSimulateRequest(): SimulateRequest { + return { + tx: undefined, + txBytes: new Uint8Array() + }; +} +export const SimulateRequest = { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + aminoType: "cosmos-sdk/SimulateRequest", + is(o: any): o is SimulateRequest { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is SimulateRequestAmino { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txBytes.length !== 0) { + writer.uint32(18).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulateRequest { + const message = createBaseSimulateRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: SimulateRequestAmino): SimulateRequest { + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: SimulateRequest): SimulateRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { + return SimulateRequest.fromAmino(object.value); + }, + toAminoMsg(message: SimulateRequest): SimulateRequestAminoMsg { + return { + type: "cosmos-sdk/SimulateRequest", + value: SimulateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateRequestProtoMsg): SimulateRequest { + return SimulateRequest.decode(message.value); + }, + toProto(message: SimulateRequest): Uint8Array { + return SimulateRequest.encode(message).finish(); + }, + toProtoMsg(message: SimulateRequest): SimulateRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + value: SimulateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulateRequest.typeUrl, SimulateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateRequest.aminoType, SimulateRequest.typeUrl); +function createBaseSimulateResponse(): SimulateResponse { + return { + gasInfo: undefined, + result: undefined + }; +} +export const SimulateResponse = { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + aminoType: "cosmos-sdk/SimulateResponse", + is(o: any): o is SimulateResponse { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + isAmino(o: any): o is SimulateResponseAmino { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimulateResponse { + const message = createBaseSimulateResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulateResponseAmino): SimulateResponse { + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulateResponse): SimulateResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateResponseAminoMsg): SimulateResponse { + return SimulateResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulateResponse): SimulateResponseAminoMsg { + return { + type: "cosmos-sdk/SimulateResponse", + value: SimulateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateResponseProtoMsg): SimulateResponse { + return SimulateResponse.decode(message.value); + }, + toProto(message: SimulateResponse): Uint8Array { + return SimulateResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulateResponse): SimulateResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + value: SimulateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimulateResponse.typeUrl, SimulateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateResponse.aminoType, SimulateResponse.typeUrl); +function createBaseGetTxRequest(): GetTxRequest { + return { + hash: "" + }; +} +export const GetTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + aminoType: "cosmos-sdk/GetTxRequest", + is(o: any): o is GetTxRequest { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + isAmino(o: any): o is GetTxRequestAmino { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxRequest { + const message = createBaseGetTxRequest(); + message.hash = object.hash ?? ""; + return message; + }, + fromAmino(object: GetTxRequestAmino): GetTxRequest { + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: GetTxRequest): GetTxRequestAmino { + const obj: any = {}; + obj.hash = message.hash === "" ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: GetTxRequestAminoMsg): GetTxRequest { + return GetTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxRequest): GetTxRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxRequest", + value: GetTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxRequestProtoMsg): GetTxRequest { + return GetTxRequest.decode(message.value); + }, + toProto(message: GetTxRequest): Uint8Array { + return GetTxRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxRequest): GetTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + value: GetTxRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxRequest.typeUrl, GetTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxRequest.aminoType, GetTxRequest.typeUrl); +function createBaseGetTxResponse(): GetTxResponse { + return { + tx: undefined, + txResponse: undefined + }; +} +export const GetTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + aminoType: "cosmos-sdk/GetTxResponse", + is(o: any): o is GetTxResponse { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + isAmino(o: any): o is GetTxResponseAmino { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetTxResponse { + const message = createBaseGetTxResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: GetTxResponseAmino): GetTxResponse { + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: GetTxResponse): GetTxResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: GetTxResponseAminoMsg): GetTxResponse { + return GetTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxResponse): GetTxResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxResponse", + value: GetTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxResponseProtoMsg): GetTxResponse { + return GetTxResponse.decode(message.value); + }, + toProto(message: GetTxResponse): Uint8Array { + return GetTxResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxResponse): GetTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + value: GetTxResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetTxResponse.typeUrl, GetTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxResponse.aminoType, GetTxResponse.typeUrl); +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { + height: BigInt(0), + pagination: undefined + }; +} +export const GetBlockWithTxsRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + aminoType: "cosmos-sdk/GetBlockWithTxsRequest", + is(o: any): o is GetBlockWithTxsRequest { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is GetBlockWithTxsRequestAmino { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsRequestProtoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.decode(message.value); + }, + toProto(message: GetBlockWithTxsRequest): Uint8Array { + return GetBlockWithTxsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsRequest.typeUrl, GetBlockWithTxsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsRequest.aminoType, GetBlockWithTxsRequest.typeUrl); +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { + txs: [], + blockId: undefined, + block: undefined, + pagination: undefined + }; +} +export const GetBlockWithTxsResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + aminoType: "cosmos-sdk/GetBlockWithTxsResponse", + is(o: any): o is GetBlockWithTxsResponse { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0]))); + }, + isAmino(o: any): o is GetBlockWithTxsResponseAmino { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0]))); + }, + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 3: + message.block = Block.decode(reader, reader.uint32()); + break; + case 4: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; + 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.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsResponseAminoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsResponseProtoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.decode(message.value); + }, + toProto(message: GetBlockWithTxsResponse): Uint8Array { + return GetBlockWithTxsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsResponse.typeUrl, GetBlockWithTxsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsResponse.aminoType, GetBlockWithTxsResponse.typeUrl); +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { + txBytes: new Uint8Array() + }; +} +export const TxDecodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + aminoType: "cosmos-sdk/TxDecodeRequest", + is(o: any): o is TxDecodeRequest { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is TxDecodeRequestAmino { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeRequest.typeUrl, TxDecodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeRequest.aminoType, TxDecodeRequest.typeUrl); +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { + tx: undefined + }; +} +export const TxDecodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + aminoType: "cosmos-sdk/TxDecodeResponse", + is(o: any): o is TxDecodeResponse { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + isAmino(o: any): o is TxDecodeResponseAmino { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeResponse.typeUrl, TxDecodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeResponse.aminoType, TxDecodeResponse.typeUrl); +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { + tx: undefined + }; +} +export const TxEncodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + aminoType: "cosmos-sdk/TxEncodeRequest", + is(o: any): o is TxEncodeRequest { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + isAmino(o: any): o is TxEncodeRequestAmino { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeRequest.typeUrl, TxEncodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeRequest.aminoType, TxEncodeRequest.typeUrl); +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { + txBytes: new Uint8Array() + }; +} +export const TxEncodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + aminoType: "cosmos-sdk/TxEncodeResponse", + is(o: any): o is TxEncodeResponse { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isAmino(o: any): o is TxEncodeResponseAmino { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeResponse.typeUrl, TxEncodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeResponse.aminoType, TxEncodeResponse.typeUrl); +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { + aminoJson: "" + }; +} +export const TxEncodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + aminoType: "cosmos-sdk/TxEncodeAminoRequest", + is(o: any): o is TxEncodeAminoRequest { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.aminoJson === "string"); + }, + isAmino(o: any): o is TxEncodeAminoRequestAmino { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.amino_json === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoRequest.typeUrl, TxEncodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoRequest.aminoType, TxEncodeAminoRequest.typeUrl); +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxEncodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + aminoType: "cosmos-sdk/TxEncodeAminoResponse", + is(o: any): o is TxEncodeAminoResponse { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isAmino(o: any): o is TxEncodeAminoResponseAmino { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoResponse.typeUrl, TxEncodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoResponse.aminoType, TxEncodeAminoResponse.typeUrl); +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxDecodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + aminoType: "cosmos-sdk/TxDecodeAminoRequest", + is(o: any): o is TxDecodeAminoRequest { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isAmino(o: any): o is TxDecodeAminoRequestAmino { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoRequest.typeUrl, TxDecodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoRequest.aminoType, TxDecodeAminoRequest.typeUrl); +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { + aminoJson: "" + }; +} +export const TxDecodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + aminoType: "cosmos-sdk/TxDecodeAminoResponse", + is(o: any): o is TxDecodeAminoResponse { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.aminoJson === "string"); + }, + isAmino(o: any): o is TxDecodeAminoResponseAmino { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.amino_json === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoResponse.typeUrl, TxDecodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoResponse.aminoType, TxDecodeAminoResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/tx/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..6e8614bb --- /dev/null +++ b/libs/injectivejs/src/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,2029 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { SignMode } from "../signing/v1beta1/signing"; +import { CompactBitArray, CompactBitArrayAmino } from "../../crypto/multisig/v1beta1/multisig"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Tx is the standard type used for broadcasting transactions. */ +export interface Tx { + /** body is the processable content of the transaction */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tx"; + value: Uint8Array; +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxAmino { + /** body is the processable content of the transaction */ + body?: TxBodyAmino; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + auth_info?: AuthInfoAmino; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: string[]; +} +export interface TxAminoMsg { + type: "cosmos-sdk/Tx"; + value: TxAmino; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxRawProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxRaw"; + value: Uint8Array; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawAmino { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + body_bytes: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + auth_info_bytes: string; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: string[]; +} +export interface TxRawAminoMsg { + type: "cosmos-sdk/TxRaw"; + value: TxRawAmino; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique 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; +} +export interface SignDocProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDoc"; + value: Uint8Array; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + auth_info_bytes: string; + /** + * chain_id is the unique 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; +} +export interface SignDocAminoMsg { + type: "cosmos-sdk/SignDoc"; + value: SignDocAmino; +} +/** + * 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; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: bigint; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} +export interface TxBodyProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxBody"; + value: Uint8Array; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodyAmino { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: AnyAmino[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeout_height: string; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extension_options: AnyAmino[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + non_critical_extension_options: AnyAmino[]; +} +export interface TxBodyAminoMsg { + type: "cosmos-sdk/TxBody"; + value: TxBodyAmino; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * 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"; + value: Uint8Array; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoAmino { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signer_infos: SignerInfoAmino[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * 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"; + value: AuthInfoAmino; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: bigint; +} +export interface SignerInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; + value: Uint8Array; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoAmino { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + public_key?: AnyAmino; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + mode_info?: ModeInfoAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: string; +} +export interface SignerInfoAminoMsg { + type: "cosmos-sdk/SignerInfo"; + value: SignerInfoAmino; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfo { + /** single represents a single signer */ + single?: ModeInfo_Single; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_Multi; +} +export interface ModeInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo"; + value: Uint8Array; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoAmino { + /** single represents a single signer */ + single?: ModeInfo_SingleAmino; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_MultiAmino; +} +export interface ModeInfoAminoMsg { + type: "cosmos-sdk/ModeInfo"; + value: ModeInfoAmino; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} +export interface ModeInfo_SingleProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Single"; + value: Uint8Array; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleAmino { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} +export interface ModeInfo_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: ModeInfo_SingleAmino; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} +export interface ModeInfo_MultiProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + mode_infos: ModeInfoAmino[]; +} +export interface ModeInfo_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: ModeInfo_MultiAmino; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** amount is the amount of coins to be paid as a fee */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: bigint; + /** + * 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. + */ + payer: string; + /** + * 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 + */ + granter: string; +} +export interface FeeProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Fee"; + value: Uint8Array; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeAmino { + /** amount is the amount of coins to be paid as a fee */ + amount: CoinAmino[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gas_limit: string; + /** + * 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. + */ + payer: string; + /** + * 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 + */ + granter: string; +} +export interface FeeAminoMsg { + type: "cosmos-sdk/Fee"; + value: FeeAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseTx(): Tx { + return { + body: undefined, + authInfo: undefined, + signatures: [] + }; +} +export const Tx = { + typeUrl: "/cosmos.tx.v1beta1.Tx", + aminoType: "cosmos-sdk/Tx", + is(o: any): o is Tx { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxAmino { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.body !== undefined) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Tx { + const message = createBaseTx(); + message.body = object.body !== undefined && object.body !== null ? TxBody.fromPartial(object.body) : undefined; + message.authInfo = object.authInfo !== undefined && object.authInfo !== null ? AuthInfo.fromPartial(object.authInfo) : undefined; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxAmino): Tx { + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Tx): TxAmino { + const obj: any = {}; + obj.body = message.body ? TxBody.toAmino(message.body) : undefined; + obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxAminoMsg): Tx { + return Tx.fromAmino(object.value); + }, + toAminoMsg(message: Tx): TxAminoMsg { + return { + type: "cosmos-sdk/Tx", + value: Tx.toAmino(message) + }; + }, + fromProtoMsg(message: TxProtoMsg): Tx { + return Tx.decode(message.value); + }, + toProto(message: Tx): Uint8Array { + return Tx.encode(message).finish(); + }, + toProtoMsg(message: Tx): TxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tx", + value: Tx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Tx.typeUrl, Tx); +GlobalDecoderRegistry.registerAminoProtoMapping(Tx.aminoType, Tx.typeUrl); +function createBaseTxRaw(): TxRaw { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + signatures: [] + }; +} +export const TxRaw = { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + aminoType: "cosmos-sdk/TxRaw", + is(o: any): o is TxRaw { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxRawAmino { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxRaw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxRaw { + const message = createBaseTxRaw(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxRawAmino): TxRaw { + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: TxRaw): TxRawAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxRawAminoMsg): TxRaw { + return TxRaw.fromAmino(object.value); + }, + toAminoMsg(message: TxRaw): TxRawAminoMsg { + return { + type: "cosmos-sdk/TxRaw", + value: TxRaw.toAmino(message) + }; + }, + fromProtoMsg(message: TxRawProtoMsg): TxRaw { + return TxRaw.decode(message.value); + }, + toProto(message: TxRaw): Uint8Array { + return TxRaw.encode(message).finish(); + }, + toProtoMsg(message: TxRaw): TxRawProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + value: TxRaw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxRaw.typeUrl, TxRaw); +GlobalDecoderRegistry.registerAminoProtoMapping(TxRaw.aminoType, TxRaw.typeUrl); +function createBaseSignDoc(): SignDoc { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + chainId: "", + accountNumber: BigInt(0) + }; +} +export const SignDoc = { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + aminoType: "cosmos-sdk/SignDoc", + is(o: any): o is SignDoc { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint"); + }, + isAmino(o: any): o is SignDocAmino { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint"); + }, + encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDoc(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignDoc { + const message = createBaseSignDoc(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignDocAmino): SignDoc { + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + 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); + } + return message; + }, + toAmino(message: SignDoc): SignDocAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignDocAminoMsg): SignDoc { + return SignDoc.fromAmino(object.value); + }, + toAminoMsg(message: SignDoc): SignDocAminoMsg { + return { + type: "cosmos-sdk/SignDoc", + value: SignDoc.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocProtoMsg): SignDoc { + return SignDoc.decode(message.value); + }, + toProto(message: SignDoc): Uint8Array { + return SignDoc.encode(message).finish(); + }, + toProtoMsg(message: SignDoc): SignDocProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + value: SignDoc.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignDoc.typeUrl, SignDoc); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDoc.aminoType, SignDoc.typeUrl); +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", + aminoType: "cosmos-sdk/SignDocDirectAux", + is(o: any): o is SignDocDirectAux { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignDocDirectAuxAmino { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SignDocDirectAux.typeUrl, SignDocDirectAux); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDocDirectAux.aminoType, SignDocDirectAux.typeUrl); +function createBaseTxBody(): TxBody { + return { + messages: [], + memo: "", + timeoutHeight: BigInt(0), + extensionOptions: [], + nonCriticalExtensionOptions: [] + }; +} +export const TxBody = { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + aminoType: "cosmos-sdk/TxBody", + is(o: any): o is TxBody { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && typeof o.memo === "string" && typeof o.timeoutHeight === "bigint" && Array.isArray(o.extensionOptions) && (!o.extensionOptions.length || Any.is(o.extensionOptions[0])) && Array.isArray(o.nonCriticalExtensionOptions) && (!o.nonCriticalExtensionOptions.length || Any.is(o.nonCriticalExtensionOptions[0]))); + }, + isAmino(o: any): o is TxBodyAmino { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && typeof o.memo === "string" && typeof o.timeout_height === "bigint" && Array.isArray(o.extension_options) && (!o.extension_options.length || Any.isAmino(o.extension_options[0])) && Array.isArray(o.non_critical_extension_options) && (!o.non_critical_extension_options.length || Any.isAmino(o.non_critical_extension_options[0]))); + }, + encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.memo !== "") { + writer.uint32(18).string(message.memo); + } + if (message.timeoutHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.timeoutHeight); + } + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxBody(); + 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.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.memo = object.memo ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? BigInt(object.timeoutHeight.toString()) : BigInt(0); + message.extensionOptions = object.extensionOptions?.map(e => Any.fromPartial(e)) || []; + message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxBodyAmino): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxBody): TxBodyAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.memo = message.memo === "" ? undefined : message.memo; + obj.timeout_height = message.timeoutHeight !== BigInt(0) ? message.timeoutHeight?.toString() : undefined; + if (message.extensionOptions) { + obj.extension_options = message.extensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.extension_options = message.extensionOptions; + } + if (message.nonCriticalExtensionOptions) { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions; + } + return obj; + }, + fromAminoMsg(object: TxBodyAminoMsg): TxBody { + return TxBody.fromAmino(object.value); + }, + toAminoMsg(message: TxBody): TxBodyAminoMsg { + return { + type: "cosmos-sdk/TxBody", + value: TxBody.toAmino(message) + }; + }, + fromProtoMsg(message: TxBodyProtoMsg): TxBody { + return TxBody.decode(message.value); + }, + toProto(message: TxBody): Uint8Array { + return TxBody.encode(message).finish(); + }, + toProtoMsg(message: TxBody): TxBodyProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + value: TxBody.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxBody.typeUrl, TxBody); +GlobalDecoderRegistry.registerAminoProtoMapping(TxBody.aminoType, TxBody.typeUrl); +function createBaseAuthInfo(): AuthInfo { + return { + signerInfos: [], + fee: undefined, + tip: undefined + }; +} +export const AuthInfo = { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + aminoType: "cosmos-sdk/AuthInfo", + is(o: any): o is AuthInfo { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signerInfos) && (!o.signerInfos.length || SignerInfo.is(o.signerInfos[0]))); + }, + isAmino(o: any): o is AuthInfoAmino { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signer_infos) && (!o.signer_infos.length || SignerInfo.isAmino(o.signer_infos[0]))); + }, + encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 { + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + 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 { + const obj: any = {}; + if (message.signerInfos) { + obj.signer_infos = message.signerInfos.map(e => e ? SignerInfo.toAmino(e) : undefined); + } else { + 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 { + return AuthInfo.fromAmino(object.value); + }, + toAminoMsg(message: AuthInfo): AuthInfoAminoMsg { + return { + type: "cosmos-sdk/AuthInfo", + value: AuthInfo.toAmino(message) + }; + }, + fromProtoMsg(message: AuthInfoProtoMsg): AuthInfo { + return AuthInfo.decode(message.value); + }, + toProto(message: AuthInfo): Uint8Array { + return AuthInfo.encode(message).finish(); + }, + toProtoMsg(message: AuthInfo): AuthInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + value: AuthInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AuthInfo.typeUrl, AuthInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthInfo.aminoType, AuthInfo.typeUrl); +function createBaseSignerInfo(): SignerInfo { + return { + publicKey: undefined, + modeInfo: undefined, + sequence: BigInt(0) + }; +} +export const SignerInfo = { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + aminoType: "cosmos-sdk/SignerInfo", + is(o: any): o is SignerInfo { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignerInfoAmino { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignerInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignerInfo { + const message = createBaseSignerInfo(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.modeInfo = object.modeInfo !== undefined && object.modeInfo !== null ? ModeInfo.fromPartial(object.modeInfo) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignerInfoAmino): SignerInfo { + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignerInfo): SignerInfoAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.mode_info = message.modeInfo ? ModeInfo.toAmino(message.modeInfo) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { + return SignerInfo.fromAmino(object.value); + }, + toAminoMsg(message: SignerInfo): SignerInfoAminoMsg { + return { + type: "cosmos-sdk/SignerInfo", + value: SignerInfo.toAmino(message) + }; + }, + fromProtoMsg(message: SignerInfoProtoMsg): SignerInfo { + return SignerInfo.decode(message.value); + }, + toProto(message: SignerInfo): Uint8Array { + return SignerInfo.encode(message).finish(); + }, + toProtoMsg(message: SignerInfo): SignerInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + value: SignerInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignerInfo.typeUrl, SignerInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(SignerInfo.aminoType, SignerInfo.typeUrl); +function createBaseModeInfo(): ModeInfo { + return { + single: undefined, + multi: undefined + }; +} +export const ModeInfo = { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + aminoType: "cosmos-sdk/ModeInfo", + is(o: any): o is ModeInfo { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + isAmino(o: any): o is ModeInfoAmino { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo { + const message = createBaseModeInfo(); + message.single = object.single !== undefined && object.single !== null ? ModeInfo_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? ModeInfo_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: ModeInfoAmino): ModeInfo { + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: ModeInfo): ModeInfoAmino { + const obj: any = {}; + obj.single = message.single ? ModeInfo_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? ModeInfo_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: ModeInfoAminoMsg): ModeInfo { + return ModeInfo.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo): ModeInfoAminoMsg { + return { + type: "cosmos-sdk/ModeInfo", + value: ModeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfoProtoMsg): ModeInfo { + return ModeInfo.decode(message.value); + }, + toProto(message: ModeInfo): Uint8Array { + return ModeInfo.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo): ModeInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + value: ModeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo.typeUrl, ModeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo.aminoType, ModeInfo.typeUrl); +function createBaseModeInfo_Single(): ModeInfo_Single { + return { + mode: 0 + }; +} +export const ModeInfo_Single = { + typeUrl: "/cosmos.tx.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is ModeInfo_Single { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + isAmino(o: any): o is ModeInfo_SingleAmino { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { + return ModeInfo_Single.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Single): ModeInfo_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: ModeInfo_Single.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_SingleProtoMsg): ModeInfo_Single { + return ModeInfo_Single.decode(message.value); + }, + toProto(message: ModeInfo_Single): Uint8Array { + return ModeInfo_Single.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Single): ModeInfo_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Single", + value: ModeInfo_Single.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo_Single.typeUrl, ModeInfo_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Single.aminoType, ModeInfo_Single.typeUrl); +function createBaseModeInfo_Multi(): ModeInfo_Multi { + return { + bitarray: undefined, + modeInfos: [] + }; +} +export const ModeInfo_Multi = { + typeUrl: "/cosmos.tx.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is ModeInfo_Multi { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.modeInfos) && (!o.modeInfos.length || ModeInfo.is(o.modeInfos[0]))); + }, + isAmino(o: any): o is ModeInfo_MultiAmino { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.mode_infos) && (!o.mode_infos.length || ModeInfo.isAmino(o.mode_infos[0]))); + }, + encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.modeInfos = object.modeInfos?.map(e => ModeInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.modeInfos) { + obj.mode_infos = message.modeInfos.map(e => e ? ModeInfo.toAmino(e) : undefined); + } else { + obj.mode_infos = message.modeInfos; + } + return obj; + }, + fromAminoMsg(object: ModeInfo_MultiAminoMsg): ModeInfo_Multi { + return ModeInfo_Multi.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Multi): ModeInfo_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: ModeInfo_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_MultiProtoMsg): ModeInfo_Multi { + return ModeInfo_Multi.decode(message.value); + }, + toProto(message: ModeInfo_Multi): Uint8Array { + return ModeInfo_Multi.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Multi): ModeInfo_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Multi", + value: ModeInfo_Multi.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModeInfo_Multi.typeUrl, ModeInfo_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Multi.aminoType, ModeInfo_Multi.typeUrl); +function createBaseFee(): Fee { + return { + amount: [], + gasLimit: BigInt(0), + payer: "", + granter: "" + }; +} +export const Fee = { + typeUrl: "/cosmos.tx.v1beta1.Fee", + aminoType: "cosmos-sdk/Fee", + is(o: any): o is Fee { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.gasLimit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is FeeAmino { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.gas_limit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.payer !== "") { + writer.uint32(26).string(message.payer); + } + if (message.granter !== "") { + writer.uint32(34).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFee(); + 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.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.payer = object.payer ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: FeeAmino): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: Fee): FeeAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.payer = message.payer === "" ? undefined : message.payer; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: FeeAminoMsg): Fee { + return Fee.fromAmino(object.value); + }, + toAminoMsg(message: Fee): FeeAminoMsg { + return { + type: "cosmos-sdk/Fee", + value: Fee.toAmino(message) + }; + }, + fromProtoMsg(message: FeeProtoMsg): Fee { + return Fee.decode(message.value); + }, + toProto(message: Fee): Uint8Array { + return Fee.encode(message).finish(); + }, + toProtoMsg(message: Fee): FeeProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Fee", + value: Fee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Fee.typeUrl, Fee); +GlobalDecoderRegistry.registerAminoProtoMapping(Fee.aminoType, Fee.typeUrl); +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + aminoType: "cosmos-sdk/Tip", + is(o: any): o is Tip { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.tipper === "string"); + }, + isAmino(o: any): o is TipAmino { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.tipper === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Tip.typeUrl, Tip); +GlobalDecoderRegistry.registerAminoProtoMapping(Tip.aminoType, Tip.typeUrl); +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + aminoType: "cosmos-sdk/AuxSignerData", + is(o: any): o is AuxSignerData { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + isAmino(o: any): o is AuxSignerDataAmino { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AuxSignerData.typeUrl, AuxSignerData); +GlobalDecoderRegistry.registerAminoProtoMapping(AuxSignerData.aminoType, AuxSignerData.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/upgrade/v1beta1/upgrade.ts b/libs/injectivejs/src/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 00000000..c2adfcb7 --- /dev/null +++ b/libs/injectivejs/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,591 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * 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 + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * 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. + */ + /** @deprecated */ + time: Date; + /** The height at which the upgrade must be performed. */ + height: bigint; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * 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. + */ + /** @deprecated */ + upgradedClientState?: Any; +} +export interface PlanProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.Plan"; + value: Uint8Array; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * 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 + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * 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. + */ + /** @deprecated */ + time: string; + /** The height at which the upgrade must be performed. */ + height: string; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * 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. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino; +} +export interface PlanAminoMsg { + type: "cosmos-sdk/Plan"; + value: PlanAmino; +} +/** + * 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 { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * 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 of the proposal */ + plan: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/SoftwareUpgradeProposal"; + value: SoftwareUpgradeProposalAmino; +} +/** + * 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 { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * 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 { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: bigint; +} +export interface ModuleVersionProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; + value: Uint8Array; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: string; +} +export interface ModuleVersionAminoMsg { + type: "cosmos-sdk/ModuleVersion"; + value: ModuleVersionAmino; +} +function createBasePlan(): Plan { + return { + name: "", + time: new Date(), + height: BigInt(0), + info: "", + upgradedClientState: undefined + }; +} +export const Plan = { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + aminoType: "cosmos-sdk/Plan", + is(o: any): o is Plan { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.is(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + isAmino(o: any): o is PlanAmino { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.isAmino(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.info = object.info ?? ""; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: PlanAmino): Plan { + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: Plan): PlanAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + 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; + return obj; + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value); + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: "cosmos-sdk/Plan", + value: Plan.toAmino(message) + }; + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value); + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish(); + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + value: Plan.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Plan.typeUrl, Plan); +GlobalDecoderRegistry.registerAminoProtoMapping(Plan.aminoType, Plan.typeUrl); +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { + title: "", + description: "", + plan: Plan.fromPartial({}) + }; +} +export const SoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + aminoType: "cosmos-sdk/SoftwareUpgradeProposal", + is(o: any): o is SoftwareUpgradeProposal { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.is(o.plan)); + }, + isAmino(o: any): o is SoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isAmino(o.plan)); + }, + encode(message: SoftwareUpgradeProposal, 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.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + 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.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { + 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) : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SoftwareUpgradeProposalProtoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SoftwareUpgradeProposal.typeUrl, SoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SoftwareUpgradeProposal.aminoType, SoftwareUpgradeProposal.typeUrl); +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { + title: "", + description: "" + }; +} +export const CancelSoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + aminoType: "cosmos-sdk/CancelSoftwareUpgradeProposal", + is(o: any): o is CancelSoftwareUpgradeProposal { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is CancelSoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: CancelSoftwareUpgradeProposalAminoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSoftwareUpgradeProposalProtoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelSoftwareUpgradeProposal.typeUrl, CancelSoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelSoftwareUpgradeProposal.aminoType, CancelSoftwareUpgradeProposal.typeUrl); +function createBaseModuleVersion(): ModuleVersion { + return { + name: "", + version: BigInt(0) + }; +} +export const ModuleVersion = { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + aminoType: "cosmos-sdk/ModuleVersion", + is(o: any): o is ModuleVersion { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + isAmino(o: any): o is ModuleVersionAmino { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; + }, + toAmino(message: ModuleVersion): ModuleVersionAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.version = message.version !== BigInt(0) ? message.version?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value); + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: "cosmos-sdk/ModuleVersion", + value: ModuleVersion.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value); + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish(); + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + value: ModuleVersion.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleVersion.typeUrl, ModuleVersion); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleVersion.aminoType, ModuleVersion.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..49328086 --- /dev/null +++ b/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.rpc.func.ts @@ -0,0 +1,21 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const createCreateVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateVestingAccount.typeUrl, + encoders: toEncoders(MsgCreateVestingAccount), + converters: toConverters(MsgCreateVestingAccount) +}); +export const createCreatePermanentLockedAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePermanentLockedAccount.typeUrl, + encoders: toEncoders(MsgCreatePermanentLockedAccount), + converters: toConverters(MsgCreatePermanentLockedAccount) +}); +export const createCreatePeriodicVestingAccount = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreatePeriodicVestingAccount.typeUrl, + encoders: toEncoders(MsgCreatePeriodicVestingAccount), + converters: toConverters(MsgCreatePeriodicVestingAccount) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.ts b/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.ts new file mode 100644 index 00000000..4e9fcb3f --- /dev/null +++ b/libs/injectivejs/src/cosmos/vesting/v1beta1/tx.ts @@ -0,0 +1,698 @@ +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { Period, PeriodAmino } from "./vesting"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; + /** end of vesting as unix time (in seconds). */ + endTime: bigint; + delayed: boolean; +} +export interface MsgCreateVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccountAmino { + from_address: string; + to_address: string; + amount: CoinAmino[]; + /** end of vesting as unix time (in seconds). */ + end_time: string; + delayed: boolean; +} +export interface MsgCreateVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccount"; + value: MsgCreateVestingAccountAmino; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponse {} +export interface MsgCreateVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse"; + value: Uint8Array; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponseAmino {} +export interface MsgCreateVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccountResponse"; + value: MsgCreateVestingAccountResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { + return { + fromAddress: "", + toAddress: "", + amount: [], + endTime: BigInt(0), + delayed: false + }; +} +export const MsgCreateVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + aminoType: "cosmos-sdk/MsgCreateVestingAccount", + is(o: any): o is MsgCreateVestingAccount { + return o && (o.$typeUrl === MsgCreateVestingAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.endTime === "bigint" && typeof o.delayed === "boolean"); + }, + isAmino(o: any): o is MsgCreateVestingAccountAmino { + return o && (o.$typeUrl === MsgCreateVestingAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.end_time === "bigint" && typeof o.delayed === "boolean"); + }, + encode(message: MsgCreateVestingAccount, 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(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(32).int64(message.endTime); + } + if (message.delayed === true) { + writer.uint32(40).bool(message.delayed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccount(); + 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; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + message.delayed = object.delayed ?? false; + return message; + }, + fromAmino(object: MsgCreateVestingAccountAmino): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + 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)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = object.delayed; + } + return message; + }, + toAmino(message: MsgCreateVestingAccount): MsgCreateVestingAccountAmino { + 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; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime?.toString() : undefined; + obj.delayed = message.delayed === false ? undefined : message.delayed; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountAminoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccount", + value: MsgCreateVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountProtoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.decode(message.value); + }, + toProto(message: MsgCreateVestingAccount): Uint8Array { + return MsgCreateVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateVestingAccount.typeUrl, MsgCreateVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateVestingAccount.aminoType, MsgCreateVestingAccount.typeUrl); +function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountResponse { + return {}; +} +export const MsgCreateVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + aminoType: "cosmos-sdk/MsgCreateVestingAccountResponse", + is(o: any): o is MsgCreateVestingAccountResponse { + return o && o.$typeUrl === MsgCreateVestingAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateVestingAccountResponseAmino { + return o && o.$typeUrl === MsgCreateVestingAccountResponse.typeUrl; + }, + encode(_: MsgCreateVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + fromAmino(_: MsgCreateVestingAccountResponseAmino): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + toAmino(_: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountResponseAminoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountResponseProtoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreateVestingAccountResponse): Uint8Array { + return MsgCreateVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateVestingAccountResponse.typeUrl, MsgCreateVestingAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateVestingAccountResponse.aminoType, MsgCreateVestingAccountResponse.typeUrl); +function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAccount { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgCreatePermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", + is(o: any): o is MsgCreatePermanentLockedAccount { + return o && (o.$typeUrl === MsgCreatePermanentLockedAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is MsgCreatePermanentLockedAccountAmino { + return o && (o.$typeUrl === MsgCreatePermanentLockedAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePermanentLockedAccount.typeUrl, MsgCreatePermanentLockedAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePermanentLockedAccount.aminoType, MsgCreatePermanentLockedAccount.typeUrl); +function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanentLockedAccountResponse { + return {}; +} +export const MsgCreatePermanentLockedAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + aminoType: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse", + is(o: any): o is MsgCreatePermanentLockedAccountResponse { + return o && o.$typeUrl === MsgCreatePermanentLockedAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreatePermanentLockedAccountResponseAmino { + return o && o.$typeUrl === MsgCreatePermanentLockedAccountResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePermanentLockedAccountResponse.typeUrl, MsgCreatePermanentLockedAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePermanentLockedAccountResponse.aminoType, MsgCreatePermanentLockedAccountResponse.typeUrl); +function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAccount { + return { + fromAddress: "", + toAddress: "", + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const MsgCreatePeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + aminoType: "cosmos-sdk/MsgCreatePeriodVestAccount", + is(o: any): o is MsgCreatePeriodicVestingAccount { + return o && (o.$typeUrl === MsgCreatePeriodicVestingAccount.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && typeof o.startTime === "bigint" && Array.isArray(o.vestingPeriods) && (!o.vestingPeriods.length || Period.is(o.vestingPeriods[0]))); + }, + isAmino(o: any): o is MsgCreatePeriodicVestingAccountAmino { + return o && (o.$typeUrl === MsgCreatePeriodicVestingAccount.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && typeof o.start_time === "bigint" && Array.isArray(o.vesting_periods) && (!o.vesting_periods.length || Period.isAmino(o.vesting_periods[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePeriodicVestingAccount.typeUrl, MsgCreatePeriodicVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePeriodicVestingAccount.aminoType, MsgCreatePeriodicVestingAccount.typeUrl); +function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicVestingAccountResponse { + return {}; +} +export const MsgCreatePeriodicVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + aminoType: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse", + is(o: any): o is MsgCreatePeriodicVestingAccountResponse { + return o && o.$typeUrl === MsgCreatePeriodicVestingAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreatePeriodicVestingAccountResponseAmino { + return o && o.$typeUrl === MsgCreatePeriodicVestingAccountResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreatePeriodicVestingAccountResponse.typeUrl, MsgCreatePeriodicVestingAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePeriodicVestingAccountResponse.aminoType, MsgCreatePeriodicVestingAccountResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos/vesting/v1beta1/vesting.ts b/libs/injectivejs/src/cosmos/vesting/v1beta1/vesting.ts new file mode 100644 index 00000000..91f05562 --- /dev/null +++ b/libs/injectivejs/src/cosmos/vesting/v1beta1/vesting.ts @@ -0,0 +1,735 @@ +import { BaseAccount, BaseAccountAmino } from "../../auth/v1beta1/auth"; +import { Coin, CoinAmino } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccount { + baseAccount?: BaseAccount; + originalVesting: Coin[]; + delegatedFree: Coin[]; + delegatedVesting: Coin[]; + /** Vesting end time, as unix timestamp (in seconds). */ + endTime: bigint; +} +export interface BaseVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; + value: Uint8Array; +} +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccountAmino { + base_account?: BaseAccountAmino; + original_vesting: CoinAmino[]; + delegated_free: CoinAmino[]; + delegated_vesting: CoinAmino[]; + /** Vesting end time, as unix timestamp (in seconds). */ + end_time: string; +} +export interface BaseVestingAccountAminoMsg { + type: "cosmos-sdk/BaseVestingAccount"; + value: BaseVestingAccountAmino; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccount { + baseVestingAccount?: BaseVestingAccount; + /** Vesting start time, as unix timestamp (in seconds). */ + startTime: bigint; +} +export interface ContinuousVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; + value: Uint8Array; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + /** Vesting start time, as unix timestamp (in seconds). */ + start_time: string; +} +export interface ContinuousVestingAccountAminoMsg { + type: "cosmos-sdk/ContinuousVestingAccount"; + value: ContinuousVestingAccountAmino; +} +/** + * 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. + */ +export interface DelayedVestingAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface DelayedVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DelayedVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface DelayedVestingAccountAminoMsg { + type: "cosmos-sdk/DelayedVestingAccount"; + value: DelayedVestingAccountAmino; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface Period { + /** Period duration in seconds. */ + length: bigint; + amount: Coin[]; +} +export interface PeriodProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.Period"; + value: Uint8Array; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface PeriodAmino { + /** Period duration in seconds. */ + length: string; + amount: CoinAmino[]; +} +export interface PeriodAminoMsg { + type: "cosmos-sdk/Period"; + value: PeriodAmino; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; + vestingPeriods: Period[]; +} +export interface PeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount"; + value: Uint8Array; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + start_time: string; + vesting_periods: PeriodAmino[]; +} +export interface PeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/PeriodicVestingAccount"; + value: PeriodicVestingAccountAmino; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface PermanentLockedAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; + value: Uint8Array; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface PermanentLockedAccountAminoMsg { + type: "cosmos-sdk/PermanentLockedAccount"; + value: PermanentLockedAccountAmino; +} +function createBaseBaseVestingAccount(): BaseVestingAccount { + return { + baseAccount: undefined, + originalVesting: [], + delegatedFree: [], + delegatedVesting: [], + endTime: BigInt(0) + }; +} +export const BaseVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + aminoType: "cosmos-sdk/BaseVestingAccount", + is(o: any): o is BaseVestingAccount { + return o && (o.$typeUrl === BaseVestingAccount.typeUrl || Array.isArray(o.originalVesting) && (!o.originalVesting.length || Coin.is(o.originalVesting[0])) && Array.isArray(o.delegatedFree) && (!o.delegatedFree.length || Coin.is(o.delegatedFree[0])) && Array.isArray(o.delegatedVesting) && (!o.delegatedVesting.length || Coin.is(o.delegatedVesting[0])) && typeof o.endTime === "bigint"); + }, + isAmino(o: any): o is BaseVestingAccountAmino { + return o && (o.$typeUrl === BaseVestingAccount.typeUrl || Array.isArray(o.original_vesting) && (!o.original_vesting.length || Coin.isAmino(o.original_vesting[0])) && Array.isArray(o.delegated_free) && (!o.delegated_free.length || Coin.isAmino(o.delegated_free[0])) && Array.isArray(o.delegated_vesting) && (!o.delegated_vesting.length || Coin.isAmino(o.delegated_vesting[0])) && typeof o.end_time === "bigint"); + }, + encode(message: BaseVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.originalVesting) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatedFree) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.delegatedVesting) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(40).int64(message.endTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.originalVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.delegatedFree.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.originalVesting = object.originalVesting?.map(e => Coin.fromPartial(e)) || []; + message.delegatedFree = object.delegatedFree?.map(e => Coin.fromPartial(e)) || []; + message.delegatedVesting = object.delegatedVesting?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BaseVestingAccountAmino): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + message.originalVesting = object.original_vesting?.map(e => Coin.fromAmino(e)) || []; + message.delegatedFree = object.delegated_free?.map(e => Coin.fromAmino(e)) || []; + message.delegatedVesting = object.delegated_vesting?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + return message; + }, + toAmino(message: BaseVestingAccount): BaseVestingAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + if (message.originalVesting) { + obj.original_vesting = message.originalVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.original_vesting = message.originalVesting; + } + if (message.delegatedFree) { + obj.delegated_free = message.delegatedFree.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_free = message.delegatedFree; + } + if (message.delegatedVesting) { + obj.delegated_vesting = message.delegatedVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_vesting = message.delegatedVesting; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseVestingAccountAminoMsg): BaseVestingAccount { + return BaseVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseVestingAccount): BaseVestingAccountAminoMsg { + return { + type: "cosmos-sdk/BaseVestingAccount", + value: BaseVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseVestingAccountProtoMsg): BaseVestingAccount { + return BaseVestingAccount.decode(message.value); + }, + toProto(message: BaseVestingAccount): Uint8Array { + return BaseVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseVestingAccount): BaseVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + value: BaseVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BaseVestingAccount.typeUrl, BaseVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseVestingAccount.aminoType, BaseVestingAccount.typeUrl); +function createBaseContinuousVestingAccount(): ContinuousVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0) + }; +} +export const ContinuousVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + aminoType: "cosmos-sdk/ContinuousVestingAccount", + is(o: any): o is ContinuousVestingAccount { + return o && (o.$typeUrl === ContinuousVestingAccount.typeUrl || typeof o.startTime === "bigint"); + }, + isAmino(o: any): o is ContinuousVestingAccountAmino { + return o && (o.$typeUrl === ContinuousVestingAccount.typeUrl || typeof o.start_time === "bigint"); + }, + encode(message: ContinuousVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContinuousVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ContinuousVestingAccountAmino): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + return message; + }, + toAmino(message: ContinuousVestingAccount): ContinuousVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ContinuousVestingAccountAminoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountAminoMsg { + return { + type: "cosmos-sdk/ContinuousVestingAccount", + value: ContinuousVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ContinuousVestingAccountProtoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.decode(message.value); + }, + toProto(message: ContinuousVestingAccount): Uint8Array { + return ContinuousVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + value: ContinuousVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContinuousVestingAccount.typeUrl, ContinuousVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(ContinuousVestingAccount.aminoType, ContinuousVestingAccount.typeUrl); +function createBaseDelayedVestingAccount(): DelayedVestingAccount { + return { + baseVestingAccount: undefined + }; +} +export const DelayedVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + aminoType: "cosmos-sdk/DelayedVestingAccount", + is(o: any): o is DelayedVestingAccount { + return o && o.$typeUrl === DelayedVestingAccount.typeUrl; + }, + isAmino(o: any): o is DelayedVestingAccountAmino { + return o && o.$typeUrl === DelayedVestingAccount.typeUrl; + }, + encode(message: DelayedVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelayedVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: DelayedVestingAccountAmino): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: DelayedVestingAccount): DelayedVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: DelayedVestingAccountAminoMsg): DelayedVestingAccount { + return DelayedVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: DelayedVestingAccount): DelayedVestingAccountAminoMsg { + return { + type: "cosmos-sdk/DelayedVestingAccount", + value: DelayedVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: DelayedVestingAccountProtoMsg): DelayedVestingAccount { + return DelayedVestingAccount.decode(message.value); + }, + toProto(message: DelayedVestingAccount): Uint8Array { + return DelayedVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: DelayedVestingAccount): DelayedVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + value: DelayedVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DelayedVestingAccount.typeUrl, DelayedVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(DelayedVestingAccount.aminoType, DelayedVestingAccount.typeUrl); +function createBasePeriod(): Period { + return { + length: BigInt(0), + amount: [] + }; +} +export const Period = { + typeUrl: "/cosmos.vesting.v1beta1.Period", + aminoType: "cosmos-sdk/Period", + is(o: any): o is Period { + return o && (o.$typeUrl === Period.typeUrl || typeof o.length === "bigint" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is PeriodAmino { + return o && (o.$typeUrl === Period.typeUrl || typeof o.length === "bigint" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: Period, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.length !== BigInt(0)) { + writer.uint32(8).int64(message.length); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Period { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriod(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.length = reader.int64(); + break; + case 2: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Period { + const message = createBasePeriod(); + message.length = object.length !== undefined && object.length !== null ? BigInt(object.length.toString()) : BigInt(0); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PeriodAmino): Period { + const message = createBasePeriod(); + if (object.length !== undefined && object.length !== null) { + message.length = BigInt(object.length); + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Period): PeriodAmino { + const obj: any = {}; + obj.length = message.length !== BigInt(0) ? message.length?.toString() : undefined; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: PeriodAminoMsg): Period { + return Period.fromAmino(object.value); + }, + toAminoMsg(message: Period): PeriodAminoMsg { + return { + type: "cosmos-sdk/Period", + value: Period.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodProtoMsg): Period { + return Period.decode(message.value); + }, + toProto(message: Period): Uint8Array { + return Period.encode(message).finish(); + }, + toProtoMsg(message: Period): PeriodProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.Period", + value: Period.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Period.typeUrl, Period); +GlobalDecoderRegistry.registerAminoProtoMapping(Period.aminoType, Period.typeUrl); +function createBasePeriodicVestingAccount(): PeriodicVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const PeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + aminoType: "cosmos-sdk/PeriodicVestingAccount", + is(o: any): o is PeriodicVestingAccount { + return o && (o.$typeUrl === PeriodicVestingAccount.typeUrl || typeof o.startTime === "bigint" && Array.isArray(o.vestingPeriods) && (!o.vestingPeriods.length || Period.is(o.vestingPeriods[0]))); + }, + isAmino(o: any): o is PeriodicVestingAccountAmino { + return o && (o.$typeUrl === PeriodicVestingAccount.typeUrl || typeof o.start_time === "bigint" && Array.isArray(o.vesting_periods) && (!o.vesting_periods.length || Period.isAmino(o.vesting_periods[0]))); + }, + encode(message: PeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + case 3: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + 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: PeriodicVestingAccountAmino): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + 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: PeriodicVestingAccount): PeriodicVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + 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: PeriodicVestingAccountAminoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountAminoMsg { + return { + type: "cosmos-sdk/PeriodicVestingAccount", + value: PeriodicVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodicVestingAccountProtoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.decode(message.value); + }, + toProto(message: PeriodicVestingAccount): Uint8Array { + return PeriodicVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + value: PeriodicVestingAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PeriodicVestingAccount.typeUrl, PeriodicVestingAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(PeriodicVestingAccount.aminoType, PeriodicVestingAccount.typeUrl); +function createBasePermanentLockedAccount(): PermanentLockedAccount { + return { + baseVestingAccount: undefined + }; +} +export const PermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + aminoType: "cosmos-sdk/PermanentLockedAccount", + is(o: any): o is PermanentLockedAccount { + return o && o.$typeUrl === PermanentLockedAccount.typeUrl; + }, + isAmino(o: any): o is PermanentLockedAccountAmino { + return o && o.$typeUrl === PermanentLockedAccount.typeUrl; + }, + encode(message: PermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: PermanentLockedAccountAmino): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: PermanentLockedAccount): PermanentLockedAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: PermanentLockedAccountAminoMsg): PermanentLockedAccount { + return PermanentLockedAccount.fromAmino(object.value); + }, + toAminoMsg(message: PermanentLockedAccount): PermanentLockedAccountAminoMsg { + return { + type: "cosmos-sdk/PermanentLockedAccount", + value: PermanentLockedAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PermanentLockedAccountProtoMsg): PermanentLockedAccount { + return PermanentLockedAccount.decode(message.value); + }, + toProto(message: PermanentLockedAccount): Uint8Array { + return PermanentLockedAccount.encode(message).finish(); + }, + toProtoMsg(message: PermanentLockedAccount): PermanentLockedAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + value: PermanentLockedAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PermanentLockedAccount.typeUrl, PermanentLockedAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(PermanentLockedAccount.aminoType, PermanentLockedAccount.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmos_proto/cosmos.ts b/libs/injectivejs/src/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..0a97877f --- /dev/null +++ b/libs/injectivejs/src/cosmos_proto/cosmos.ts @@ -0,0 +1,341 @@ +import { BinaryReader, BinaryWriter } from "../binary"; +import { DeepPartial } from "../helpers"; +import { GlobalDecoderRegistry } from "../registry"; +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} +export const ScalarTypeAmino = ScalarType; +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: "/cosmos_proto.InterfaceDescriptor"; + value: Uint8Array; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorAmino { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorAminoMsg { + type: "/cosmos_proto.InterfaceDescriptor"; + value: InterfaceDescriptorAmino; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} +export interface ScalarDescriptorProtoMsg { + typeUrl: "/cosmos_proto.ScalarDescriptor"; + value: Uint8Array; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorAmino { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + field_type: ScalarType[]; +} +export interface ScalarDescriptorAminoMsg { + type: "/cosmos_proto.ScalarDescriptor"; + value: ScalarDescriptorAmino; +} +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { + name: "", + description: "" + }; +} +export const InterfaceDescriptor = { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + is(o: any): o is InterfaceDescriptor { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is InterfaceDescriptorAmino { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { + return InterfaceDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { + return InterfaceDescriptor.decode(message.value); + }, + toProto(message: InterfaceDescriptor): Uint8Array { + return InterfaceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceDescriptor): InterfaceDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + value: InterfaceDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InterfaceDescriptor.typeUrl, InterfaceDescriptor); +function createBaseScalarDescriptor(): ScalarDescriptor { + return { + name: "", + description: "", + fieldType: [] + }; +} +export const ScalarDescriptor = { + typeUrl: "/cosmos_proto.ScalarDescriptor", + is(o: any): o is ScalarDescriptor { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.fieldType)); + }, + isAmino(o: any): o is ScalarDescriptorAmino { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.field_type)); + }, + encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = 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.fieldType.push((reader.int32() as any)); + } + } else { + message.fieldType.push((reader.int32() as any)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map(e => e) || []; + return message; + }, + fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => e) || []; + return message; + }, + toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + if (message.fieldType) { + obj.field_type = message.fieldType.map(e => e); + } else { + obj.field_type = message.fieldType; + } + return obj; + }, + fromAminoMsg(object: ScalarDescriptorAminoMsg): ScalarDescriptor { + return ScalarDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: ScalarDescriptorProtoMsg): ScalarDescriptor { + return ScalarDescriptor.decode(message.value); + }, + toProto(message: ScalarDescriptor): Uint8Array { + return ScalarDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ScalarDescriptor): ScalarDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.ScalarDescriptor", + value: ScalarDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ScalarDescriptor.typeUrl, ScalarDescriptor); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/proposal_legacy.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/proposal_legacy.ts new file mode 100644 index 00000000..0a986632 --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/proposal_legacy.ts @@ -0,0 +1,2432 @@ +import { AccessConfig, AccessConfigAmino } from "./types"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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 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 contract 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 contract 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 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 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 contract 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 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 contract 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 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 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 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 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 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 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 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; +} +/** + * 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; +} +/** + * 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 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 contract 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 contract 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; +} +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", + aminoType: "wasm/StoreCodeProposal", + is(o: any): o is StoreCodeProposal { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is StoreCodeProposalAmino { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(StoreCodeProposal.typeUrl, StoreCodeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreCodeProposal.aminoType, StoreCodeProposal.typeUrl); +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const InstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + aminoType: "wasm/InstantiateContractProposal", + is(o: any): o is InstantiateContractProposal { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is InstantiateContractProposalAmino { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InstantiateContractProposal.typeUrl, InstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContractProposal.aminoType, InstantiateContractProposal.typeUrl); +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", + aminoType: "wasm/InstantiateContract2Proposal", + is(o: any): o is InstantiateContract2Proposal { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isAmino(o: any): o is InstantiateContract2ProposalAmino { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(InstantiateContract2Proposal.typeUrl, InstantiateContract2Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContract2Proposal.aminoType, InstantiateContract2Proposal.typeUrl); +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + title: "", + description: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MigrateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + aminoType: "wasm/MigrateContractProposal", + is(o: any): o is MigrateContractProposal { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MigrateContractProposalAmino { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MigrateContractProposal.typeUrl, MigrateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrateContractProposal.aminoType, MigrateContractProposal.typeUrl); +function createBaseSudoContractProposal(): SudoContractProposal { + return { + title: "", + description: "", + contract: "", + msg: new Uint8Array() + }; +} +export const SudoContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + aminoType: "wasm/SudoContractProposal", + is(o: any): o is SudoContractProposal { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is SudoContractProposalAmino { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(SudoContractProposal.typeUrl, SudoContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SudoContractProposal.aminoType, SudoContractProposal.typeUrl); +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + title: "", + description: "", + runAs: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const ExecuteContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + aminoType: "wasm/ExecuteContractProposal", + is(o: any): o is ExecuteContractProposal { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is ExecuteContractProposalAmino { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExecuteContractProposal.typeUrl, ExecuteContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExecuteContractProposal.aminoType, ExecuteContractProposal.typeUrl); +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + title: "", + description: "", + newAdmin: "", + contract: "" + }; +} +export const UpdateAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + aminoType: "wasm/UpdateAdminProposal", + is(o: any): o is UpdateAdminProposal { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is UpdateAdminProposalAmino { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpdateAdminProposal.typeUrl, UpdateAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateAdminProposal.aminoType, UpdateAdminProposal.typeUrl); +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + title: "", + description: "", + contract: "" + }; +} +export const ClearAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + aminoType: "wasm/ClearAdminProposal", + is(o: any): o is ClearAdminProposal { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is ClearAdminProposalAmino { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ClearAdminProposal.typeUrl, ClearAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ClearAdminProposal.aminoType, ClearAdminProposal.typeUrl); +function createBasePinCodesProposal(): PinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const PinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + aminoType: "wasm/PinCodesProposal", + is(o: any): o is PinCodesProposal { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is PinCodesProposalAmino { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(PinCodesProposal.typeUrl, PinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(PinCodesProposal.aminoType, PinCodesProposal.typeUrl); +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const UnpinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + aminoType: "wasm/UnpinCodesProposal", + is(o: any): o is UnpinCodesProposal { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is UnpinCodesProposalAmino { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UnpinCodesProposal.typeUrl, UnpinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UnpinCodesProposal.aminoType, UnpinCodesProposal.typeUrl); +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const AccessConfigUpdate = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + aminoType: "wasm/AccessConfigUpdate", + is(o: any): o is AccessConfigUpdate { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.codeId === "bigint" && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is AccessConfigUpdateAmino { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.code_id === "bigint" && AccessConfig.isAmino(o.instantiate_permission)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(AccessConfigUpdate.typeUrl, AccessConfigUpdate); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfigUpdate.aminoType, AccessConfigUpdate.typeUrl); +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + title: "", + description: "", + accessConfigUpdates: [] + }; +} +export const UpdateInstantiateConfigProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + aminoType: "wasm/UpdateInstantiateConfigProposal", + is(o: any): o is UpdateInstantiateConfigProposal { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.accessConfigUpdates) && (!o.accessConfigUpdates.length || AccessConfigUpdate.is(o.accessConfigUpdates[0]))); + }, + isAmino(o: any): o is UpdateInstantiateConfigProposalAmino { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.access_config_updates) && (!o.access_config_updates.length || AccessConfigUpdate.isAmino(o.access_config_updates[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpdateInstantiateConfigProposal.typeUrl, UpdateInstantiateConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateInstantiateConfigProposal.aminoType, UpdateInstantiateConfigProposal.typeUrl); +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", + aminoType: "wasm/StoreAndInstantiateContractProposal", + is(o: any): o is StoreAndInstantiateContractProposal { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is StoreAndInstantiateContractProposalAmino { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(StoreAndInstantiateContractProposal.typeUrl, StoreAndInstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreAndInstantiateContractProposal.aminoType, StoreAndInstantiateContractProposal.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/query.rpc.func.ts new file mode 100644 index 00000000..8a0c89f5 --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -0,0 +1,100 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractInfoRequest.encode, + decode: QueryContractInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractInfo", + clientResolver +}); +export const createGetContractHistory = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractHistoryRequest.encode, + decode: QueryContractHistoryResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractHistory", + clientResolver +}); +export const createGetContractsByCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCodeRequest.encode, + decode: QueryContractsByCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCode", + clientResolver +}); +export const createGetAllContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllContractStateRequest.encode, + decode: QueryAllContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "AllContractState", + clientResolver +}); +export const createGetRawContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryRawContractStateRequest.encode, + decode: QueryRawContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "RawContractState", + clientResolver +}); +export const createGetSmartContractState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySmartContractStateRequest.encode, + decode: QuerySmartContractStateResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "SmartContractState", + clientResolver +}); +export const createGetCode = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeRequest.encode, + decode: QueryCodeResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Code", + clientResolver +}); +export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodesRequest.encode, + decode: QueryCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Codes", + clientResolver +}); +export const createGetCodeInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCodeInfoRequest.encode, + decode: QueryCodeInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "CodeInfo", + clientResolver +}); +export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPinnedCodesRequest.encode, + decode: QueryPinnedCodesResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "PinnedCodes", + clientResolver +}); +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "Params", + clientResolver +}); +export const createGetContractsByCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractsByCreatorRequest.encode, + decode: QueryContractsByCreatorResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "ContractsByCreator", + clientResolver +}); +export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmLimitsConfigRequest.encode, + decode: QueryWasmLimitsConfigResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "WasmLimitsConfig", + clientResolver +}); +export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBuildAddressRequest.encode, + decode: QueryBuildAddressResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "BuildAddress", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/query.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/query.ts new file mode 100644 index 00000000..cd8c0b8e --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/query.ts @@ -0,0 +1,3235 @@ +import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../../cosmos/base/query/v1beta1/pagination"; +import { ContractInfo, ContractInfoAmino, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, Model, ModelAmino, AccessConfig, AccessConfigAmino, Params, ParamsAmino } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequest { + /** address is the address of the contract to query */ + address: string; +} +export interface QueryContractInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest"; + value: Uint8Array; +} +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequestAmino { + /** address is the address of the contract to query */ + address: string; +} +export interface QueryContractInfoRequestAminoMsg { + type: "wasm/QueryContractInfoRequest"; + value: QueryContractInfoRequestAmino; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponse { + /** address is the address of the contract */ + address: string; + contractInfo: ContractInfo; +} +export interface QueryContractInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse"; + value: Uint8Array; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponseAmino { + /** address is the address of the contract */ + address: string; + contract_info: ContractInfoAmino; +} +export interface QueryContractInfoResponseAminoMsg { + type: "wasm/QueryContractInfoResponse"; + value: QueryContractInfoResponseAmino; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequest { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractHistoryRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; + value: Uint8Array; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestAmino { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractHistoryRequestAminoMsg { + type: "wasm/QueryContractHistoryRequest"; + value: QueryContractHistoryRequestAmino; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponse { + entries: ContractCodeHistoryEntry[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractHistoryResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; + value: Uint8Array; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseAmino { + entries: ContractCodeHistoryEntryAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractHistoryResponseAminoMsg { + type: "wasm/QueryContractHistoryResponse"; + value: QueryContractHistoryResponseAmino; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCodeRequestAminoMsg { + type: "wasm/QueryContractsByCodeRequest"; + value: QueryContractsByCodeRequestAmino; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponse { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponseAmino { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCodeResponseAminoMsg { + type: "wasm/QueryContractsByCodeResponse"; + value: QueryContractsByCodeResponseAmino; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequest { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; + value: Uint8Array; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllContractStateRequestAminoMsg { + type: "wasm/QueryAllContractStateRequest"; + value: QueryAllContractStateRequestAmino; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponse { + models: Model[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; + value: Uint8Array; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponseAmino { + models: ModelAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllContractStateResponseAminoMsg { + type: "wasm/QueryAllContractStateResponse"; + value: QueryAllContractStateResponseAmino; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequest { + /** address is the address of the contract */ + address: string; + queryData: Uint8Array; +} +export interface QueryRawContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest"; + value: Uint8Array; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + query_data: string; +} +export interface QueryRawContractStateRequestAminoMsg { + type: "wasm/QueryRawContractStateRequest"; + value: QueryRawContractStateRequestAmino; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponse { + /** Data contains the raw store data */ + data: Uint8Array; +} +export interface QueryRawContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse"; + value: Uint8Array; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponseAmino { + /** Data contains the raw store data */ + data: string; +} +export interface QueryRawContractStateResponseAminoMsg { + type: "wasm/QueryRawContractStateResponse"; + value: QueryRawContractStateResponseAmino; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequest { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + queryData: Uint8Array; +} +export interface QuerySmartContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest"; + value: Uint8Array; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequestAmino { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + query_data: any; +} +export interface QuerySmartContractStateRequestAminoMsg { + type: "wasm/QuerySmartContractStateRequest"; + value: QuerySmartContractStateRequestAmino; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponse { + /** Data contains the json data returned from the smart contract */ + data: Uint8Array; +} +export interface QuerySmartContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse"; + value: Uint8Array; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponseAmino { + /** Data contains the json data returned from the smart contract */ + data: any; +} +export interface QuerySmartContractStateResponseAminoMsg { + type: "wasm/QuerySmartContractStateResponse"; + value: QuerySmartContractStateResponseAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; +} +export interface QueryCodeRequestAminoMsg { + type: "wasm/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; +} +export interface QueryCodeInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest"; + value: Uint8Array; +} +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; +} +export interface QueryCodeInfoRequestAminoMsg { + type: "wasm/QueryCodeInfoRequest"; + value: QueryCodeInfoRequestAmino; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponse { + codeId: bigint; + creator: string; + checksum: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface QueryCodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse"; + value: Uint8Array; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponseAmino { + code_id: string; + creator: string; + checksum: string; + instantiate_permission: AccessConfigAmino; +} +export interface QueryCodeInfoResponseAminoMsg { + type: "wasm/QueryCodeInfoResponse"; + value: QueryCodeInfoResponseAmino; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponse { + codeId: bigint; + creator: string; + dataHash: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface CodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse"; + value: Uint8Array; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponseAmino { + code_id: string; + creator: string; + data_hash: string; + instantiate_permission: AccessConfigAmino; +} +export interface CodeInfoResponseAminoMsg { + type: "wasm/CodeInfoResponse"; + value: CodeInfoResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponse { + codeInfo?: CodeInfoResponse; + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponseAmino { + code_info?: CodeInfoResponseAmino; + data: string; +} +export interface QueryCodeResponseAminoMsg { + type: "wasm/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; + value: Uint8Array; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryCodesRequestAminoMsg { + type: "wasm/QueryCodesRequest"; + value: QueryCodesRequestAmino; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponse { + codeInfos: CodeInfoResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; + value: Uint8Array; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponseAmino { + code_infos: CodeInfoResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryCodesResponseAminoMsg { + type: "wasm/QueryCodesResponse"; + value: QueryCodesResponseAmino; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryPinnedCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; + value: Uint8Array; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryPinnedCodesRequestAminoMsg { + type: "wasm/QueryPinnedCodesRequest"; + value: QueryPinnedCodesRequestAmino; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponse { + codeIds: bigint[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryPinnedCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; + value: Uint8Array; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponseAmino { + code_ids: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryPinnedCodesResponseAminoMsg { + type: "wasm/QueryPinnedCodesResponse"; + value: QueryPinnedCodesResponseAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.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; +} +/** 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.wasm.v1.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; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequest { + /** CreatorAddress is the address of contract creator */ + creatorAddress: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCreatorRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequestAmino { + /** CreatorAddress is the address of contract creator */ + creator_address: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCreatorRequestAminoMsg { + type: "wasm/QueryContractsByCreatorRequest"; + value: QueryContractsByCreatorRequestAmino; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponse { + /** ContractAddresses result set */ + contractAddresses: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCreatorResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponseAmino { + /** ContractAddresses result set */ + contract_addresses: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCreatorResponseAminoMsg { + type: "wasm/QueryContractsByCreatorResponse"; + value: QueryContractsByCreatorResponseAmino; +} +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequest {} +export interface QueryWasmLimitsConfigRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequestAmino {} +export interface QueryWasmLimitsConfigRequestAminoMsg { + type: "wasm/QueryWasmLimitsConfigRequest"; + value: QueryWasmLimitsConfigRequestAmino; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponse { + config: string; +} +export interface QueryWasmLimitsConfigResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponseAmino { + config: string; +} +export interface QueryWasmLimitsConfigResponseAminoMsg { + type: "wasm/QueryWasmLimitsConfigResponse"; + value: QueryWasmLimitsConfigResponseAmino; +} +/** + * 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; +} +/** + * 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; +} +function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { + return { + address: "" + }; +} +export const QueryContractInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + aminoType: "wasm/QueryContractInfoRequest", + is(o: any): o is QueryContractInfoRequest { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractInfoRequestAmino { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryContractInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoRequest(); + 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: DeepPartial): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryContractInfoRequestAmino): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryContractInfoRequest): QueryContractInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryContractInfoRequestAminoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestAminoMsg { + return { + type: "wasm/QueryContractInfoRequest", + value: QueryContractInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoRequestProtoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.decode(message.value); + }, + toProto(message: QueryContractInfoRequest): Uint8Array { + return QueryContractInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + value: QueryContractInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractInfoRequest.typeUrl, QueryContractInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoRequest.aminoType, QueryContractInfoRequest.typeUrl); +function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { + return { + address: "", + contractInfo: ContractInfo.fromPartial({}) + }; +} +export const QueryContractInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + aminoType: "wasm/QueryContractInfoResponse", + is(o: any): o is QueryContractInfoResponse { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.is(o.contractInfo)); + }, + isAmino(o: any): o is QueryContractInfoResponseAmino { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.isAmino(o.contract_info)); + }, + encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + message.address = object.address ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + return message; + }, + fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; + }, + toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.toAmino(ContractInfo.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseAminoMsg { + return { + type: "wasm/QueryContractInfoResponse", + value: QueryContractInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoResponseProtoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.decode(message.value); + }, + toProto(message: QueryContractInfoResponse): Uint8Array { + return QueryContractInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + value: QueryContractInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractInfoResponse.typeUrl, QueryContractInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoResponse.aminoType, QueryContractInfoResponse.typeUrl); +function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryContractHistoryRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + aminoType: "wasm/QueryContractHistoryRequest", + is(o: any): o is QueryContractHistoryRequest { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractHistoryRequestAmino { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryContractHistoryRequest, 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): QueryContractHistoryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryRequest(); + 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: DeepPartial): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + 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: QueryContractHistoryRequest): QueryContractHistoryRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryRequestAminoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestAminoMsg { + return { + type: "wasm/QueryContractHistoryRequest", + value: QueryContractHistoryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryRequestProtoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.decode(message.value); + }, + toProto(message: QueryContractHistoryRequest): Uint8Array { + return QueryContractHistoryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + value: QueryContractHistoryRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractHistoryRequest.typeUrl, QueryContractHistoryRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryRequest.aminoType, QueryContractHistoryRequest.typeUrl); +function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { + return { + entries: [], + pagination: undefined + }; +} +export const QueryContractHistoryResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + aminoType: "wasm/QueryContractHistoryResponse", + is(o: any): o is QueryContractHistoryResponse { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.is(o.entries[0]))); + }, + isAmino(o: any): o is QueryContractHistoryResponseAmino { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.isAmino(o.entries[0]))); + }, + encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + ContractCodeHistoryEntry.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): QueryContractHistoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(ContractCodeHistoryEntry.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: DeepPartial): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractHistoryResponse): QueryContractHistoryResponseAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? ContractCodeHistoryEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryResponseAminoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseAminoMsg { + return { + type: "wasm/QueryContractHistoryResponse", + value: QueryContractHistoryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryResponseProtoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.decode(message.value); + }, + toProto(message: QueryContractHistoryResponse): Uint8Array { + return QueryContractHistoryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + value: QueryContractHistoryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractHistoryResponse.typeUrl, QueryContractHistoryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryResponse.aminoType, QueryContractHistoryResponse.typeUrl); +function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { + return { + codeId: BigInt(0), + pagination: undefined + }; +} +export const QueryContractsByCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + aminoType: "wasm/QueryContractsByCodeRequest", + is(o: any): o is QueryContractsByCodeRequest { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryContractsByCodeRequestAmino { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryContractsByCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeRequestAmino): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeRequestAminoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAminoMsg { + return { + type: "wasm/QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeRequestProtoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.decode(message.value); + }, + toProto(message: QueryContractsByCodeRequest): Uint8Array { + return QueryContractsByCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCodeRequest.typeUrl, QueryContractsByCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeRequest.aminoType, QueryContractsByCodeRequest.typeUrl); +function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { + return { + contracts: [], + pagination: undefined + }; +} +export const QueryContractsByCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + aminoType: "wasm/QueryContractsByCodeResponse", + is(o: any): o is QueryContractsByCodeResponse { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCodeResponseAmino { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + encode(message: QueryContractsByCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + 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): QueryContractsByCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeResponseAmino): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeResponseAminoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAminoMsg { + return { + type: "wasm/QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeResponseProtoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.decode(message.value); + }, + toProto(message: QueryContractsByCodeResponse): Uint8Array { + return QueryContractsByCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCodeResponse.typeUrl, QueryContractsByCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeResponse.aminoType, QueryContractsByCodeResponse.typeUrl); +function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAllContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + aminoType: "wasm/QueryAllContractStateRequest", + is(o: any): o is QueryAllContractStateRequest { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAllContractStateRequestAmino { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryAllContractStateRequest, 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): QueryAllContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateRequest(); + 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: DeepPartial): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateRequestAmino): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + 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: QueryAllContractStateRequest): QueryAllContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateRequestAminoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestAminoMsg { + return { + type: "wasm/QueryAllContractStateRequest", + value: QueryAllContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateRequestProtoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.decode(message.value); + }, + toProto(message: QueryAllContractStateRequest): Uint8Array { + return QueryAllContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + value: QueryAllContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllContractStateRequest.typeUrl, QueryAllContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateRequest.aminoType, QueryAllContractStateRequest.typeUrl); +function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { + return { + models: [], + pagination: undefined + }; +} +export const QueryAllContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + aminoType: "wasm/QueryAllContractStateResponse", + is(o: any): o is QueryAllContractStateResponse { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.is(o.models[0]))); + }, + isAmino(o: any): o is QueryAllContractStateResponseAmino { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.isAmino(o.models[0]))); + }, + encode(message: QueryAllContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.models) { + Model.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): QueryAllContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.models.push(Model.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: DeepPartial): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateResponseAmino): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllContractStateResponse): QueryAllContractStateResponseAmino { + const obj: any = {}; + if (message.models) { + obj.models = message.models.map(e => e ? Model.toAmino(e) : undefined); + } else { + obj.models = message.models; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateResponseAminoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseAminoMsg { + return { + type: "wasm/QueryAllContractStateResponse", + value: QueryAllContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateResponseProtoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.decode(message.value); + }, + toProto(message: QueryAllContractStateResponse): Uint8Array { + return QueryAllContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + value: QueryAllContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllContractStateResponse.typeUrl, QueryAllContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateResponse.aminoType, QueryAllContractStateResponse.typeUrl); +function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QueryRawContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + aminoType: "wasm/QueryRawContractStateRequest", + is(o: any): o is QueryRawContractStateRequest { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isAmino(o: any): o is QueryRawContractStateRequestAmino { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + encode(message: QueryRawContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateRequestAmino): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = bytesFromBase64(object.query_data); + } + return message; + }, + toAmino(message: QueryRawContractStateRequest): QueryRawContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? base64FromBytes(message.queryData) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateRequestAminoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestAminoMsg { + return { + type: "wasm/QueryRawContractStateRequest", + value: QueryRawContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateRequestProtoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.decode(message.value); + }, + toProto(message: QueryRawContractStateRequest): Uint8Array { + return QueryRawContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + value: QueryRawContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRawContractStateRequest.typeUrl, QueryRawContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateRequest.aminoType, QueryRawContractStateRequest.typeUrl); +function createBaseQueryRawContractStateResponse(): QueryRawContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QueryRawContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + aminoType: "wasm/QueryRawContractStateResponse", + is(o: any): o is QueryRawContractStateResponse { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryRawContractStateResponseAmino { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QueryRawContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateResponse(); + 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: DeepPartial): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateResponseAmino): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryRawContractStateResponse): QueryRawContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateResponseAminoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseAminoMsg { + return { + type: "wasm/QueryRawContractStateResponse", + value: QueryRawContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateResponseProtoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.decode(message.value); + }, + toProto(message: QueryRawContractStateResponse): Uint8Array { + return QueryRawContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + value: QueryRawContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRawContractStateResponse.typeUrl, QueryRawContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateResponse.aminoType, QueryRawContractStateResponse.typeUrl); +function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QuerySmartContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + aminoType: "wasm/QuerySmartContractStateRequest", + is(o: any): o is QuerySmartContractStateRequest { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isAmino(o: any): o is QuerySmartContractStateRequestAmino { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + encode(message: QuerySmartContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateRequestAmino): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = toUtf8(JSON.stringify(object.query_data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? JSON.parse(fromUtf8(message.queryData)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateRequestAminoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAminoMsg { + return { + type: "wasm/QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateRequestProtoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.decode(message.value); + }, + toProto(message: QuerySmartContractStateRequest): Uint8Array { + return QuerySmartContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySmartContractStateRequest.typeUrl, QuerySmartContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateRequest.aminoType, QuerySmartContractStateRequest.typeUrl); +function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QuerySmartContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + aminoType: "wasm/QuerySmartContractStateResponse", + is(o: any): o is QuerySmartContractStateResponse { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QuerySmartContractStateResponseAmino { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QuerySmartContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateResponse(); + 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: DeepPartial): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateResponseAmino): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = toUtf8(JSON.stringify(object.data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? JSON.parse(fromUtf8(message.data)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateResponseAminoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAminoMsg { + return { + type: "wasm/QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateResponseProtoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.decode(message.value); + }, + toProto(message: QuerySmartContractStateResponse): Uint8Array { + return QuerySmartContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySmartContractStateResponse.typeUrl, QuerySmartContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateResponse.aminoType, QuerySmartContractStateResponse.typeUrl); +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest", + aminoType: "wasm/QueryCodeRequest", + is(o: any): o is QueryCodeRequest { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryCodeRequestAmino { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + 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.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "wasm/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: "/cosmwasm.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeRequest.typeUrl, QueryCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeRequest.aminoType, QueryCodeRequest.typeUrl); +function createBaseQueryCodeInfoRequest(): QueryCodeInfoRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + aminoType: "wasm/QueryCodeInfoRequest", + is(o: any): o is QueryCodeInfoRequest { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryCodeInfoRequestAmino { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryCodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeInfoRequestAmino): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeInfoRequest): QueryCodeInfoRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeInfoRequestAminoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestAminoMsg { + return { + type: "wasm/QueryCodeInfoRequest", + value: QueryCodeInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoRequestProtoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.decode(message.value); + }, + toProto(message: QueryCodeInfoRequest): Uint8Array { + return QueryCodeInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + value: QueryCodeInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoRequest.typeUrl, QueryCodeInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoRequest.aminoType, QueryCodeInfoRequest.typeUrl); +function createBaseQueryCodeInfoResponse(): QueryCodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + checksum: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const QueryCodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + aminoType: "wasm/QueryCodeInfoResponse", + is(o: any): o is QueryCodeInfoResponse { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is QueryCodeInfoResponseAmino { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, + encode(message: QueryCodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: QueryCodeInfoResponseAmino): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: QueryCodeInfoResponse): QueryCodeInfoResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryCodeInfoResponseAminoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseAminoMsg { + return { + type: "wasm/QueryCodeInfoResponse", + value: QueryCodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoResponseProtoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.decode(message.value); + }, + toProto(message: QueryCodeInfoResponse): Uint8Array { + return QueryCodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + value: QueryCodeInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoResponse.typeUrl, QueryCodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoResponse.aminoType, QueryCodeInfoResponse.typeUrl); +function createBaseCodeInfoResponse(): CodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + dataHash: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const CodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + aminoType: "wasm/CodeInfoResponse", + is(o: any): o is CodeInfoResponse { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is CodeInfoResponseAmino { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, + encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.dataHash.length !== 0) { + writer.uint32(26).bytes(message.dataHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.dataHash = reader.bytes(); + break; + case 6: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.dataHash = object.dataHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeInfoResponse): CodeInfoResponseAmino { + const obj: any = {}; + 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) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { + return CodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfoResponse): CodeInfoResponseAminoMsg { + return { + type: "wasm/CodeInfoResponse", + value: CodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoResponseProtoMsg): CodeInfoResponse { + return CodeInfoResponse.decode(message.value); + }, + toProto(message: CodeInfoResponse): Uint8Array { + return CodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: CodeInfoResponse): CodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + value: CodeInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CodeInfoResponse.typeUrl, CodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfoResponse.aminoType, CodeInfoResponse.typeUrl); +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + codeInfo: undefined, + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse", + aminoType: "wasm/QueryCodeResponse", + is(o: any): o is QueryCodeResponse { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryCodeResponseAmino { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.data.length !== 0) { + writer.uint32(18).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.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfoResponse.fromPartial(object.codeInfo) : undefined; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : ""; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "wasm/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: "/cosmwasm.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeResponse.typeUrl, QueryCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeResponse.aminoType, QueryCodeResponse.typeUrl); +function createBaseQueryCodesRequest(): QueryCodesRequest { + return { + pagination: undefined + }; +} +export const QueryCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + aminoType: "wasm/QueryCodesRequest", + is(o: any): o is QueryCodesRequest { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryCodesRequestAmino { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + encode(message: QueryCodesRequest, 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): QueryCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesRequest(); + 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: DeepPartial): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesRequestAmino): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesRequest): QueryCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesRequestAminoMsg): QueryCodesRequest { + return QueryCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesRequest): QueryCodesRequestAminoMsg { + return { + type: "wasm/QueryCodesRequest", + value: QueryCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesRequestProtoMsg): QueryCodesRequest { + return QueryCodesRequest.decode(message.value); + }, + toProto(message: QueryCodesRequest): Uint8Array { + return QueryCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesRequest): QueryCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + value: QueryCodesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodesRequest.typeUrl, QueryCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesRequest.aminoType, QueryCodesRequest.typeUrl); +function createBaseQueryCodesResponse(): QueryCodesResponse { + return { + codeInfos: [], + pagination: undefined + }; +} +export const QueryCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + aminoType: "wasm/QueryCodesResponse", + is(o: any): o is QueryCodesResponse { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.codeInfos) && (!o.codeInfos.length || CodeInfoResponse.is(o.codeInfos[0]))); + }, + isAmino(o: any): o is QueryCodesResponseAmino { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.code_infos) && (!o.code_infos.length || CodeInfoResponse.isAmino(o.code_infos[0]))); + }, + encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.codeInfos) { + CodeInfoResponse.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): QueryCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfos.push(CodeInfoResponse.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: DeepPartial): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.codeInfos?.map(e => CodeInfoResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesResponse): QueryCodesResponseAmino { + const obj: any = {}; + if (message.codeInfos) { + obj.code_infos = message.codeInfos.map(e => e ? CodeInfoResponse.toAmino(e) : undefined); + } else { + obj.code_infos = message.codeInfos; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesResponseAminoMsg): QueryCodesResponse { + return QueryCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesResponse): QueryCodesResponseAminoMsg { + return { + type: "wasm/QueryCodesResponse", + value: QueryCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesResponseProtoMsg): QueryCodesResponse { + return QueryCodesResponse.decode(message.value); + }, + toProto(message: QueryCodesResponse): Uint8Array { + return QueryCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesResponse): QueryCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + value: QueryCodesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodesResponse.typeUrl, QueryCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesResponse.aminoType, QueryCodesResponse.typeUrl); +function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { + return { + pagination: undefined + }; +} +export const QueryPinnedCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + aminoType: "wasm/QueryPinnedCodesRequest", + is(o: any): o is QueryPinnedCodesRequest { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPinnedCodesRequestAmino { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + encode(message: QueryPinnedCodesRequest, 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): QueryPinnedCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesRequest(); + 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: DeepPartial): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesRequestAmino): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesRequestAminoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAminoMsg { + return { + type: "wasm/QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesRequestProtoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.decode(message.value); + }, + toProto(message: QueryPinnedCodesRequest): Uint8Array { + return QueryPinnedCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPinnedCodesRequest.typeUrl, QueryPinnedCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesRequest.aminoType, QueryPinnedCodesRequest.typeUrl); +function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { + return { + codeIds: [], + pagination: undefined + }; +} +export const QueryPinnedCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + aminoType: "wasm/QueryPinnedCodesResponse", + is(o: any): o is QueryPinnedCodesResponse { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is QueryPinnedCodesResponseAmino { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + encode(message: QueryPinnedCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesResponse(); + 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.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesResponseAmino): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAmino { + const obj: any = {}; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesResponseAminoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAminoMsg { + return { + type: "wasm/QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesResponseProtoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.decode(message.value); + }, + toProto(message: QueryPinnedCodesResponse): Uint8Array { + return QueryPinnedCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPinnedCodesResponse.typeUrl, QueryPinnedCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesResponse.aminoType, QueryPinnedCodesResponse.typeUrl); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest", + aminoType: "wasm/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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.wasm.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse", + aminoType: "wasm/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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) : Params.toAmino(Params.fromPartial({})); + 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.wasm.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { + return { + creatorAddress: "", + pagination: undefined + }; +} +export const QueryContractsByCreatorRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + aminoType: "wasm/QueryContractsByCreatorRequest", + is(o: any): o is QueryContractsByCreatorRequest { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creatorAddress === "string"); + }, + isAmino(o: any): o is QueryContractsByCreatorRequestAmino { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creator_address === "string"); + }, + encode(message: QueryContractsByCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creatorAddress !== "") { + writer.uint32(10).string(message.creatorAddress); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creatorAddress = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + message.creatorAddress = object.creatorAddress ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorRequestAmino): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAmino { + const obj: any = {}; + obj.creator_address = message.creatorAddress === "" ? undefined : message.creatorAddress; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorRequestAminoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAminoMsg { + return { + type: "wasm/QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorRequestProtoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.decode(message.value); + }, + toProto(message: QueryContractsByCreatorRequest): Uint8Array { + return QueryContractsByCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCreatorRequest.typeUrl, QueryContractsByCreatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorRequest.aminoType, QueryContractsByCreatorRequest.typeUrl); +function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { + return { + contractAddresses: [], + pagination: undefined + }; +} +export const QueryContractsByCreatorResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + aminoType: "wasm/QueryContractsByCreatorResponse", + is(o: any): o is QueryContractsByCreatorResponse { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contractAddresses) && (!o.contractAddresses.length || typeof o.contractAddresses[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCreatorResponseAmino { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contract_addresses) && (!o.contract_addresses.length || typeof o.contract_addresses[0] === "string")); + }, + encode(message: QueryContractsByCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contractAddresses) { + 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): QueryContractsByCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddresses.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contractAddresses?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorResponseAmino): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAmino { + const obj: any = {}; + if (message.contractAddresses) { + obj.contract_addresses = message.contractAddresses.map(e => e); + } else { + obj.contract_addresses = message.contractAddresses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorResponseAminoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAminoMsg { + return { + type: "wasm/QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorResponseProtoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.decode(message.value); + }, + toProto(message: QueryContractsByCreatorResponse): Uint8Array { + return QueryContractsByCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractsByCreatorResponse.typeUrl, QueryContractsByCreatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorResponse.aminoType, QueryContractsByCreatorResponse.typeUrl); +function createBaseQueryWasmLimitsConfigRequest(): QueryWasmLimitsConfigRequest { + return {}; +} +export const QueryWasmLimitsConfigRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + aminoType: "wasm/QueryWasmLimitsConfigRequest", + is(o: any): o is QueryWasmLimitsConfigRequest { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + isAmino(o: any): o is QueryWasmLimitsConfigRequestAmino { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + encode(_: QueryWasmLimitsConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + fromAmino(_: QueryWasmLimitsConfigRequestAmino): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + toAmino(_: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigRequestAminoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigRequestProtoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigRequest): Uint8Array { + return QueryWasmLimitsConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigRequest.typeUrl, QueryWasmLimitsConfigRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigRequest.aminoType, QueryWasmLimitsConfigRequest.typeUrl); +function createBaseQueryWasmLimitsConfigResponse(): QueryWasmLimitsConfigResponse { + return { + config: "" + }; +} +export const QueryWasmLimitsConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + aminoType: "wasm/QueryWasmLimitsConfigResponse", + is(o: any): o is QueryWasmLimitsConfigResponse { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + isAmino(o: any): o is QueryWasmLimitsConfigResponseAmino { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + encode(message: QueryWasmLimitsConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.config !== "") { + writer.uint32(10).string(message.config); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + message.config = object.config ?? ""; + return message; + }, + fromAmino(object: QueryWasmLimitsConfigResponseAmino): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = object.config; + } + return message; + }, + toAmino(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAmino { + const obj: any = {}; + obj.config = message.config === "" ? undefined : message.config; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigResponseAminoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigResponseProtoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigResponse): Uint8Array { + return QueryWasmLimitsConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigResponse.typeUrl, QueryWasmLimitsConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigResponse.aminoType, QueryWasmLimitsConfigResponse.typeUrl); +function createBaseQueryBuildAddressRequest(): QueryBuildAddressRequest { + return { + codeHash: "", + creatorAddress: "", + salt: "", + initArgs: new Uint8Array() + }; +} +export const QueryBuildAddressRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest", + aminoType: "wasm/QueryBuildAddressRequest", + is(o: any): o is QueryBuildAddressRequest { + return o && (o.$typeUrl === QueryBuildAddressRequest.typeUrl || typeof o.codeHash === "string" && typeof o.creatorAddress === "string" && typeof o.salt === "string" && (o.initArgs instanceof Uint8Array || typeof o.initArgs === "string")); + }, + isAmino(o: any): o is QueryBuildAddressRequestAmino { + return o && (o.$typeUrl === QueryBuildAddressRequest.typeUrl || typeof o.code_hash === "string" && typeof o.creator_address === "string" && typeof o.salt === "string" && (o.init_args instanceof Uint8Array || typeof o.init_args === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryBuildAddressRequest.typeUrl, QueryBuildAddressRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBuildAddressRequest.aminoType, QueryBuildAddressRequest.typeUrl); +function createBaseQueryBuildAddressResponse(): QueryBuildAddressResponse { + return { + address: "" + }; +} +export const QueryBuildAddressResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse", + aminoType: "wasm/QueryBuildAddressResponse", + is(o: any): o is QueryBuildAddressResponse { + return o && (o.$typeUrl === QueryBuildAddressResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryBuildAddressResponseAmino { + return o && (o.$typeUrl === QueryBuildAddressResponse.typeUrl || typeof o.address === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(QueryBuildAddressResponse.typeUrl, QueryBuildAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBuildAddressResponse.aminoType, QueryBuildAddressResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/tx.rpc.func.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/tx.rpc.func.ts new file mode 100644 index 00000000..61f2ed80 --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/tx.rpc.func.ts @@ -0,0 +1,105 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const createStoreCode = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreCode.typeUrl, + encoders: toEncoders(MsgStoreCode), + converters: toConverters(MsgStoreCode) +}); +export const createInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract.typeUrl, + encoders: toEncoders(MsgInstantiateContract), + converters: toConverters(MsgInstantiateContract) +}); +export const createInstantiateContract2 = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantiateContract2.typeUrl, + encoders: toEncoders(MsgInstantiateContract2), + converters: toConverters(MsgInstantiateContract2) +}); +export const createExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContract.typeUrl, + encoders: toEncoders(MsgExecuteContract), + converters: toConverters(MsgExecuteContract) +}); +export const createMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMigrateContract.typeUrl, + encoders: toEncoders(MsgMigrateContract), + converters: toConverters(MsgMigrateContract) +}); +export const createUpdateAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateAdmin.typeUrl, + encoders: toEncoders(MsgUpdateAdmin), + converters: toConverters(MsgUpdateAdmin) +}); +export const createClearAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClearAdmin.typeUrl, + encoders: toEncoders(MsgClearAdmin), + converters: toConverters(MsgClearAdmin) +}); +export const createUpdateInstantiateConfig = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateInstantiateConfig.typeUrl, + encoders: toEncoders(MsgUpdateInstantiateConfig), + converters: toConverters(MsgUpdateInstantiateConfig) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createSudoContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSudoContract.typeUrl, + encoders: toEncoders(MsgSudoContract), + converters: toConverters(MsgSudoContract) +}); +export const createPinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPinCodes.typeUrl, + encoders: toEncoders(MsgPinCodes), + converters: toConverters(MsgPinCodes) +}); +export const createUnpinCodes = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnpinCodes.typeUrl, + encoders: toEncoders(MsgUnpinCodes), + converters: toConverters(MsgUnpinCodes) +}); +export const createStoreAndInstantiateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndInstantiateContract.typeUrl, + encoders: toEncoders(MsgStoreAndInstantiateContract), + converters: toConverters(MsgStoreAndInstantiateContract) +}); +export const createRemoveCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRemoveCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgRemoveCodeUploadParamsAddresses), + converters: toConverters(MsgRemoveCodeUploadParamsAddresses) +}); +export const createAddCodeUploadParamsAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAddCodeUploadParamsAddresses.typeUrl, + encoders: toEncoders(MsgAddCodeUploadParamsAddresses), + converters: toConverters(MsgAddCodeUploadParamsAddresses) +}); +export const createStoreAndMigrateContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgStoreAndMigrateContract.typeUrl, + encoders: toEncoders(MsgStoreAndMigrateContract), + converters: toConverters(MsgStoreAndMigrateContract) +}); +export const createUpdateContractLabel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContractLabel.typeUrl, + encoders: toEncoders(MsgUpdateContractLabel), + converters: toConverters(MsgUpdateContractLabel) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/tx.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/tx.ts new file mode 100644 index 00000000..c97c9907 --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/tx.ts @@ -0,0 +1,4191 @@ +import { AccessConfig, AccessConfigAmino, Params, ParamsAmino } from "./types"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiatePermission?: AccessConfig; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeAmino { + /** Sender is the actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code: string; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface MsgStoreCodeAminoMsg { + type: "wasm/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Checksum is the sha256 hash of the stored code */ + checksum: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "wasm/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContract { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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 MsgInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract"; + value: Uint8Array; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractAmino { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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 MsgInstantiateContractAminoMsg { + type: "wasm/MsgInstantiateContract"; + value: MsgInstantiateContractAmino; +} +/** 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; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predictable address. + */ +export interface MsgInstantiateContract2 { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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[]; + /** 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 MsgInstantiateContract2ProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2"; + value: Uint8Array; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predictable address. + */ +export interface MsgInstantiateContract2Amino { + /** Sender is the that actor that signed the messages */ + sender: 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 contract 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[]; + /** 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 MsgInstantiateContract2AminoMsg { + type: "wasm/MsgInstantiateContract2"; + value: MsgInstantiateContract2Amino; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2Response { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContract2ResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response"; + value: Uint8Array; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgInstantiateContract2ResponseAminoMsg { + type: "wasm/MsgInstantiateContract2Response"; + value: MsgInstantiateContract2ResponseAmino; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on execution */ + funds: Coin[]; +} +export interface MsgExecuteContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract"; + value: Uint8Array; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: any; + /** Funds coins that are transferred to the contract on execution */ + funds: CoinAmino[]; +} +export interface MsgExecuteContractAminoMsg { + type: "wasm/MsgExecuteContract"; + value: MsgExecuteContractAmino; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse"; + value: Uint8Array; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgExecuteContractResponseAminoMsg { + type: "wasm/MsgExecuteContractResponse"; + value: MsgExecuteContractResponseAmino; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: 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 MsgMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractAmino { + /** Sender is the that actor that signed the messages */ + sender: 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 MsgMigrateContractAminoMsg { + type: "wasm/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseAmino { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: string; +} +export interface MsgMigrateContractResponseAminoMsg { + type: "wasm/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin"; + value: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + new_admin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateAdminAminoMsg { + type: "wasm/MsgUpdateAdmin"; + value: MsgUpdateAdminAmino; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseAmino {} +export interface MsgUpdateAdminResponseAminoMsg { + type: "wasm/MsgUpdateAdminResponse"; + value: MsgUpdateAdminResponseAmino; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgClearAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin"; + value: Uint8Array; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminAmino { + /** Sender is the actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgClearAdminAminoMsg { + type: "wasm/MsgClearAdmin"; + value: MsgClearAdminAmino; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse"; + value: Uint8Array; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseAmino {} +export interface MsgClearAdminResponseAminoMsg { + type: "wasm/MsgClearAdminResponse"; + value: MsgClearAdminResponseAmino; +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfig { + /** Sender is the that actor that signed the messages */ + sender: string; + /** CodeID references the stored WASM code */ + codeId: bigint; + /** NewInstantiatePermission is the new access control */ + newInstantiatePermission?: AccessConfig; +} +export interface MsgUpdateInstantiateConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; + value: Uint8Array; +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfigAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** CodeID references the stored WASM code */ + code_id: string; + /** NewInstantiatePermission is the new access control */ + new_instantiate_permission?: AccessConfigAmino; +} +export interface MsgUpdateInstantiateConfigAminoMsg { + type: "wasm/MsgUpdateInstantiateConfig"; + value: MsgUpdateInstantiateConfigAmino; +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponse {} +export interface MsgUpdateInstantiateConfigResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse"; + value: Uint8Array; +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponseAmino {} +export interface MsgUpdateInstantiateConfigResponseAminoMsg { + type: "wasm/MsgUpdateInstantiateConfigResponse"; + value: MsgUpdateInstantiateConfigResponseAmino; +} +/** + * 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 interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * 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 interface MsgUpdateParamsAminoMsg { + type: "wasm/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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 contract 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 contract 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + aminoType: "wasm/MsgStoreCode", + is(o: any): o is MsgStoreCode { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string")); + }, + isAmino(o: any): o is MsgStoreCodeAmino { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCode.typeUrl, MsgStoreCode); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCode.aminoType, MsgStoreCode.typeUrl); +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + aminoType: "wasm/MsgStoreCodeResponse", + is(o: any): o is MsgStoreCodeResponse { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isAmino(o: any): o is MsgStoreCodeResponseAmino { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCodeResponse.typeUrl, MsgStoreCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCodeResponse.aminoType, MsgStoreCodeResponse.typeUrl); +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + aminoType: "wasm/MsgInstantiateContract", + is(o: any): o is MsgInstantiateContract { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is MsgInstantiateContractAmino { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract.typeUrl, MsgInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract.aminoType, MsgInstantiateContract.typeUrl); +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + aminoType: "wasm/MsgInstantiateContractResponse", + is(o: any): o is MsgInstantiateContractResponse { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContractResponse.typeUrl, MsgInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContractResponse.aminoType, MsgInstantiateContractResponse.typeUrl); +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", + aminoType: "wasm/MsgInstantiateContract2", + is(o: any): o is MsgInstantiateContract2 { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isAmino(o: any): o is MsgInstantiateContract2Amino { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + 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); + } + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2.typeUrl, MsgInstantiateContract2); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2.aminoType, MsgInstantiateContract2.typeUrl); +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + aminoType: "wasm/MsgInstantiateContract2Response", + is(o: any): o is MsgInstantiateContract2Response { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContract2ResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2Response.typeUrl, MsgInstantiateContract2Response); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2Response.aminoType, MsgInstantiateContract2Response.typeUrl); +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + aminoType: "wasm/MsgExecuteContract", + is(o: any): o is MsgExecuteContract { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isAmino(o: any): o is MsgExecuteContractAmino { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContract.typeUrl, MsgExecuteContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContract.aminoType, MsgExecuteContract.typeUrl); +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + aminoType: "wasm/MsgExecuteContractResponse", + is(o: any): o is MsgExecuteContractResponse { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgExecuteContractResponseAmino { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractResponse.typeUrl, MsgExecuteContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContractResponse.aminoType, MsgExecuteContractResponse.typeUrl); +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + aminoType: "wasm/MsgMigrateContract", + is(o: any): o is MsgMigrateContract { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgMigrateContractAmino { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContract.typeUrl, MsgMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContract.aminoType, MsgMigrateContract.typeUrl); +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + aminoType: "wasm/MsgMigrateContractResponse", + is(o: any): o is MsgMigrateContractResponse { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContractResponse.typeUrl, MsgMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContractResponse.aminoType, MsgMigrateContractResponse.typeUrl); +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + aminoType: "wasm/MsgUpdateAdmin", + is(o: any): o is MsgUpdateAdmin { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateAdminAmino { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdmin.typeUrl, MsgUpdateAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdmin.aminoType, MsgUpdateAdmin.typeUrl); +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + aminoType: "wasm/MsgUpdateAdminResponse", + is(o: any): o is MsgUpdateAdminResponse { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdminResponse.typeUrl, MsgUpdateAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdminResponse.aminoType, MsgUpdateAdminResponse.typeUrl); +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + aminoType: "wasm/MsgClearAdmin", + is(o: any): o is MsgClearAdmin { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgClearAdminAmino { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdmin.typeUrl, MsgClearAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdmin.aminoType, MsgClearAdmin.typeUrl); +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + aminoType: "wasm/MsgClearAdminResponse", + is(o: any): o is MsgClearAdminResponse { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgClearAdminResponseAmino { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdminResponse.typeUrl, MsgClearAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdminResponse.aminoType, MsgClearAdminResponse.typeUrl); +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { + sender: "", + codeId: BigInt(0), + newInstantiatePermission: undefined + }; +} +export const MsgUpdateInstantiateConfig = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + aminoType: "wasm/MsgUpdateInstantiateConfig", + is(o: any): o is MsgUpdateInstantiateConfig { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigAmino { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.code_id === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfig.typeUrl, MsgUpdateInstantiateConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfig.aminoType, MsgUpdateInstantiateConfig.typeUrl); +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} +export const MsgUpdateInstantiateConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + aminoType: "wasm/MsgUpdateInstantiateConfigResponse", + is(o: any): o is MsgUpdateInstantiateConfigResponse { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigResponseAmino { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfigResponse.typeUrl, MsgUpdateInstantiateConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfigResponse.aminoType, MsgUpdateInstantiateConfigResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + aminoType: "wasm/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + aminoType: "wasm/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + aminoType: "wasm/MsgSudoContract", + is(o: any): o is MsgSudoContract { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgSudoContractAmino { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + 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); + } + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSudoContract.typeUrl, MsgSudoContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContract.aminoType, MsgSudoContract.typeUrl); +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + aminoType: "wasm/MsgSudoContractResponse", + is(o: any): o is MsgSudoContractResponse { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgSudoContractResponseAmino { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + 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): MsgSudoContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgSudoContractResponse.typeUrl, MsgSudoContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContractResponse.aminoType, MsgSudoContractResponse.typeUrl); +function createBaseMsgPinCodes(): MsgPinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + aminoType: "wasm/MsgPinCodes", + is(o: any): o is MsgPinCodes { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is MsgPinCodesAmino { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPinCodes.typeUrl, MsgPinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodes.aminoType, MsgPinCodes.typeUrl); +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + aminoType: "wasm/MsgPinCodesResponse", + is(o: any): o is MsgPinCodesResponse { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgPinCodesResponseAmino { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPinCodesResponse.typeUrl, MsgPinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodesResponse.aminoType, MsgPinCodesResponse.typeUrl); +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + aminoType: "wasm/MsgUnpinCodes", + is(o: any): o is MsgUnpinCodes { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isAmino(o: any): o is MsgUnpinCodesAmino { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + 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.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: DeepPartial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgUnpinCodesAmino): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { + 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: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { + return { + type: "wasm/MsgUnpinCodes", + value: MsgUnpinCodes.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value); + }, + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish(); + }, + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnpinCodes.typeUrl, MsgUnpinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodes.aminoType, MsgUnpinCodes.typeUrl); +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + aminoType: "wasm/MsgUnpinCodesResponse", + is(o: any): o is MsgUnpinCodesResponse { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgUnpinCodesResponseAmino { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnpinCodesResponse.typeUrl, MsgUnpinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodesResponse.aminoType, MsgUnpinCodesResponse.typeUrl); +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + aminoType: "wasm/MsgStoreAndInstantiateContract", + is(o: any): o is MsgStoreAndInstantiateContract { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); + } + 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(58).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(66).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(82).string(message.source); + } + 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): MsgStoreAndInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreAndInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 3: + message.wasmByteCode = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 5: + message.unpinCode = reader.bool(); + break; + case 6: + message.admin = reader.string(); + break; + case 7: + message.label = reader.string(); + break; + case 8: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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.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: 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.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: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { + const obj: any = {}; + 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.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: MsgStoreAndInstantiateContractAminoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoMsg { + return { + type: "wasm/MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndInstantiateContractProtoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value); + }, + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContract.typeUrl, MsgStoreAndInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContract.aminoType, MsgStoreAndInstantiateContract.typeUrl); +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + aminoType: "wasm/MsgStoreAndInstantiateContractResponse", + is(o: any): o is MsgStoreAndInstantiateContractResponse { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgStoreAndInstantiateContractResponse, 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): MsgStoreAndInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreAndInstantiateContractResponse(); + 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: DeepPartial): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreAndInstantiateContractResponseAmino): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + 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: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreAndInstantiateContractResponseAminoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndInstantiateContractResponseProtoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContractResponse.typeUrl, MsgStoreAndInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContractResponse.aminoType, MsgStoreAndInstantiateContractResponse.typeUrl); +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { + return { + authority: "", + addresses: [] + }; +} +export const MsgAddCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + is(o: any): o is MsgAddCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgAddCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.addresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + 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 = createBaseMsgAddCodeUploadParamsAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgAddCodeUploadParamsAddressesAmino): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAmino { + const obj: any = {}; + 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: MsgAddCodeUploadParamsAddressesAminoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAminoMsg { + return { + type: "wasm/MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesProtoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value); + }, + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddresses.typeUrl, MsgAddCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddresses.aminoType, MsgAddCodeUploadParamsAddresses.typeUrl); +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; +} +export const MsgAddCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgAddCodeUploadParamsAddressesResponse", + is(o: any): o is MsgAddCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgAddCodeUploadParamsAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; + }, + fromAmino(_: MsgAddCodeUploadParamsAddressesResponseAmino): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; + }, + toAmino(_: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesResponseAminoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAminoMsg { + return { + type: "wasm/MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesResponseProtoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value); + }, + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddressesResponse.typeUrl, MsgAddCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddressesResponse.aminoType, MsgAddCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { + return { + authority: "", + addresses: [] + }; +} +export const MsgRemoveCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + is(o: any): o is MsgRemoveCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.addresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + 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 = createBaseMsgRemoveCodeUploadParamsAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + 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: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAmino { + const obj: any = {}; + 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: MsgRemoveCodeUploadParamsAddressesAminoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAminoMsg { + return { + type: "wasm/MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesProtoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value); + }, + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddresses.typeUrl, MsgRemoveCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddresses.aminoType, MsgRemoveCodeUploadParamsAddresses.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; +} +export const MsgRemoveCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + is(o: any): o is MsgRemoveCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; + }, + fromAmino(_: MsgRemoveCodeUploadParamsAddressesResponseAmino): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; + }, + toAmino(_: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + return { + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value); + }, + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddressesResponse.typeUrl, MsgRemoveCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddressesResponse.aminoType, MsgRemoveCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array() + }; +} +export const MsgStoreAndMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + aminoType: "wasm/MsgStoreAndMigrateContract", + is(o: any): o is MsgStoreAndMigrateContract { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgStoreAndMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + 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(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + return writer; + }, + 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 = createBaseMsgStoreAndMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: MsgStoreAndMigrateContractAmino): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + 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.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: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAmino { + const obj: any = {}; + 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: MsgStoreAndMigrateContractAminoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAminoMsg { + return { + type: "wasm/MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndMigrateContractProtoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value); + }, + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndMigrateContract.typeUrl, MsgStoreAndMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContract.aminoType, MsgStoreAndMigrateContract.typeUrl); +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array(), + data: new Uint8Array() + }; +} +export const MsgStoreAndMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + aminoType: "wasm/MsgStoreAndMigrateContractResponse", + is(o: any): o is MsgStoreAndMigrateContractResponse { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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): MsgStoreAndMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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(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(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: MsgStoreAndMigrateContractResponseAminoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreAndMigrateContractResponseProtoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreAndMigrateContractResponse.typeUrl, MsgStoreAndMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContractResponse.aminoType, MsgStoreAndMigrateContractResponse.typeUrl); +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { + return { + sender: "", + newLabel: "", + contract: "" + }; +} +export const MsgUpdateContractLabel = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + aminoType: "wasm/MsgUpdateContractLabel", + is(o: any): o is MsgUpdateContractLabel { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.newLabel === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateContractLabelAmino { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.new_label === "string" && typeof o.contract === "string"); + }, + 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): MsgUpdateContractLabel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); + message.sender = object.sender ?? ""; + message.newLabel = object.newLabel ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + 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: 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: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { + return { + type: "wasm/MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractLabelProtoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value); + }, + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractLabel.typeUrl, MsgUpdateContractLabel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabel.aminoType, MsgUpdateContractLabel.typeUrl); +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { + return {}; +} +export const MsgUpdateContractLabelResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + aminoType: "wasm/MsgUpdateContractLabelResponse", + is(o: any): o is MsgUpdateContractLabelResponse { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateContractLabelResponseAmino { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + encode(_: MsgUpdateContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + 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 = createBaseMsgUpdateContractLabelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; + }, + fromAmino(_: MsgUpdateContractLabelResponseAmino): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; + }, + toAmino(_: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractLabelResponseAminoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAminoMsg { + return { + type: "wasm/MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractLabelResponseProtoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value); + }, + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractLabelResponse.typeUrl, MsgUpdateContractLabelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabelResponse.aminoType, MsgUpdateContractLabelResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/cosmwasm/wasm/v1/types.ts b/libs/injectivejs/src/cosmwasm/wasm/v1/types.ts new file mode 100644 index 00000000..3dccb816 --- /dev/null +++ b/libs/injectivejs/src/cosmwasm/wasm/v1/types.ts @@ -0,0 +1,1120 @@ +import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** AccessType permission types */ +export enum AccessType { + /** 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 AccessTypeAmino = AccessType; +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case "ACCESS_TYPE_UNSPECIFIED": + return AccessType.ACCESS_TYPE_UNSPECIFIED; + case 1: + case "ACCESS_TYPE_NOBODY": + return AccessType.ACCESS_TYPE_NOBODY; + case 3: + case "ACCESS_TYPE_EVERYBODY": + return AccessType.ACCESS_TYPE_EVERYBODY; + case 4: + case "ACCESS_TYPE_ANY_OF_ADDRESSES": + return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES; + case -1: + case "UNRECOGNIZED": + default: + return AccessType.UNRECOGNIZED; + } +} +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: + return "ACCESS_TYPE_UNSPECIFIED"; + case AccessType.ACCESS_TYPE_NOBODY: + return "ACCESS_TYPE_NOBODY"; + case AccessType.ACCESS_TYPE_EVERYBODY: + return "ACCESS_TYPE_EVERYBODY"; + case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: + return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + case AccessType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1, +} +export const ContractCodeHistoryOperationTypeAmino = ContractCodeHistoryOperationType; +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; + case 1: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; + case 2: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; + case 3: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; + case -1: + case "UNRECOGNIZED": + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED; + } +} +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + case ContractCodeHistoryOperationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** AccessTypeParam */ +export interface AccessTypeParam { + value: AccessType; +} +export interface AccessTypeParamProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam"; + value: Uint8Array; +} +/** AccessTypeParam */ +export interface AccessTypeParamAmino { + value: AccessType; +} +export interface AccessTypeParamAminoMsg { + type: "wasm/AccessTypeParam"; + value: AccessTypeParamAmino; +} +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType; + addresses: string[]; +} +export interface AccessConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; + value: Uint8Array; +} +/** AccessConfig access control type. */ +export interface AccessConfigAmino { + permission: AccessType; + addresses: string[]; +} +export interface AccessConfigAminoMsg { + type: "wasm/AccessConfig"; + value: AccessConfigAmino; +} +/** Params defines the set of wasm parameters. */ +export interface Params { + codeUploadAccess: AccessConfig; + instantiateDefaultPermission: AccessType; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of wasm parameters. */ +export interface ParamsAmino { + code_upload_access: AccessConfigAmino; + instantiate_default_permission: AccessType; +} +export interface ParamsAminoMsg { + type: "wasm/Params"; + value: ParamsAmino; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + /** CodeHash is the unique identifier created by wasmvm */ + codeHash: Uint8Array; + /** Creator address who initially stored the code */ + creator: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiateConfig: AccessConfig; +} +export interface CodeInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo"; + value: Uint8Array; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoAmino { + /** CodeHash is the unique identifier created by wasmvm */ + code_hash: string; + /** Creator address who initially stored the code */ + creator: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiate_config: AccessConfigAmino; +} +export interface CodeInfoAminoMsg { + type: "wasm/CodeInfo"; + value: CodeInfoAmino; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: bigint; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPosition; + ibcPortId: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: Any | undefined; +} +export interface ContractInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; + value: Uint8Array; +} +export type ContractInfoEncoded = Omit & { + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyProtoMsg | undefined; +}; +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoAmino { + /** CodeID is the reference to the stored Wasm code */ + code_id: string; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPositionAmino; + ibc_port_id: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyAmino; +} +export interface ContractInfoAminoMsg { + type: "wasm/ContractInfo"; + value: ContractInfoAmino; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition; + msg: Uint8Array; +} +export interface ContractCodeHistoryEntryProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry"; + value: Uint8Array; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntryAmino { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + code_id: string; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPositionAmino; + msg: any; +} +export interface ContractCodeHistoryEntryAminoMsg { + type: "wasm/ContractCodeHistoryEntry"; + value: ContractCodeHistoryEntryAmino; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: bigint; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: bigint; +} +export interface AbsoluteTxPositionProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition"; + value: Uint8Array; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionAmino { + /** BlockHeight is the block the contract was created at */ + block_height: string; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + tx_index: string; +} +export interface AbsoluteTxPositionAminoMsg { + type: "wasm/AbsoluteTxPosition"; + value: AbsoluteTxPositionAmino; +} +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + key: Uint8Array; + /** base64-encode raw value */ + value: Uint8Array; +} +export interface ModelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Model"; + value: Uint8Array; +} +/** Model is a struct that holds a KV pair */ +export interface ModelAmino { + /** hex-encode key to read it better (this is often ascii) */ + key: string; + /** base64-encode raw value */ + value: string; +} +export interface ModelAminoMsg { + type: "wasm/Model"; + value: ModelAmino; +} +function createBaseAccessTypeParam(): AccessTypeParam { + return { + value: 0 + }; +} +export const AccessTypeParam = { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + aminoType: "wasm/AccessTypeParam", + is(o: any): o is AccessTypeParam { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + isAmino(o: any): o is AccessTypeParamAmino { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTypeParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccessTypeParam { + const message = createBaseAccessTypeParam(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: AccessTypeParamAmino): AccessTypeParam { + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: AccessTypeParam): AccessTypeParamAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { + return AccessTypeParam.fromAmino(object.value); + }, + toAminoMsg(message: AccessTypeParam): AccessTypeParamAminoMsg { + return { + type: "wasm/AccessTypeParam", + value: AccessTypeParam.toAmino(message) + }; + }, + fromProtoMsg(message: AccessTypeParamProtoMsg): AccessTypeParam { + return AccessTypeParam.decode(message.value); + }, + toProto(message: AccessTypeParam): Uint8Array { + return AccessTypeParam.encode(message).finish(); + }, + toProtoMsg(message: AccessTypeParam): AccessTypeParamProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + value: AccessTypeParam.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccessTypeParam.typeUrl, AccessTypeParam); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessTypeParam.aminoType, AccessTypeParam.typeUrl); +function createBaseAccessConfig(): AccessConfig { + return { + permission: 0, + addresses: [] + }; +} +export const AccessConfig = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + aminoType: "wasm/AccessConfig", + is(o: any): o is AccessConfig { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is AccessConfigAmino { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: AccessConfig, 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): AccessConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfig(); + 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: DeepPartial): AccessConfig { + const message = createBaseAccessConfig(); + message.permission = object.permission ?? 0; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: AccessConfigAmino): AccessConfig { + const message = createBaseAccessConfig(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: AccessConfig): AccessConfigAmino { + 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: AccessConfigAminoMsg): AccessConfig { + return AccessConfig.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfig): AccessConfigAminoMsg { + return { + type: "wasm/AccessConfig", + value: AccessConfig.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigProtoMsg): AccessConfig { + return AccessConfig.decode(message.value); + }, + toProto(message: AccessConfig): Uint8Array { + return AccessConfig.encode(message).finish(); + }, + toProtoMsg(message: AccessConfig): AccessConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + value: AccessConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccessConfig.typeUrl, AccessConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfig.aminoType, AccessConfig.typeUrl); +function createBaseParams(): Params { + return { + codeUploadAccess: AccessConfig.fromPartial({}), + instantiateDefaultPermission: 0 + }; +} +export const Params = { + typeUrl: "/cosmwasm.wasm.v1.Params", + aminoType: "wasm/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.is(o.codeUploadAccess) && isSet(o.instantiateDefaultPermission)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.isAmino(o.code_upload_access) && isSet(o.instantiate_default_permission)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeUploadAccess !== undefined) { + AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); + } + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission); + } + 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.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); + break; + case 2: + message.instantiateDefaultPermission = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.codeUploadAccess = object.codeUploadAccess !== undefined && object.codeUploadAccess !== null ? AccessConfig.fromPartial(object.codeUploadAccess) : undefined; + message.instantiateDefaultPermission = object.instantiateDefaultPermission ?? 0; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.code_upload_access !== undefined && object.code_upload_access !== null) { + message.codeUploadAccess = AccessConfig.fromAmino(object.code_upload_access); + } + if (object.instantiate_default_permission !== undefined && object.instantiate_default_permission !== null) { + message.instantiateDefaultPermission = object.instantiate_default_permission; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + 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; + }, + 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.wasm.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseCodeInfo(): CodeInfo { + return { + codeHash: new Uint8Array(), + creator: "", + instantiateConfig: AccessConfig.fromPartial({}) + }; +} +export const CodeInfo = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + aminoType: "wasm/CodeInfo", + is(o: any): o is CodeInfo { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string") && typeof o.creator === "string" && AccessConfig.is(o.instantiateConfig)); + }, + isAmino(o: any): o is CodeInfoAmino { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string") && typeof o.creator === "string" && AccessConfig.isAmino(o.instantiate_config)); + }, + encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.instantiateConfig !== undefined) { + AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.creator = reader.string(); + break; + case 5: + message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CodeInfo { + const message = createBaseCodeInfo(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.creator = object.creator ?? ""; + message.instantiateConfig = object.instantiateConfig !== undefined && object.instantiateConfig !== null ? AccessConfig.fromPartial(object.instantiateConfig) : undefined; + return message; + }, + fromAmino(object: CodeInfoAmino): CodeInfo { + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.instantiate_config !== undefined && object.instantiate_config !== null) { + message.instantiateConfig = AccessConfig.fromAmino(object.instantiate_config); + } + return message; + }, + toAmino(message: CodeInfo): CodeInfoAmino { + 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) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { + return CodeInfo.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfo): CodeInfoAminoMsg { + return { + type: "wasm/CodeInfo", + value: CodeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoProtoMsg): CodeInfo { + return CodeInfo.decode(message.value); + }, + toProto(message: CodeInfo): Uint8Array { + return CodeInfo.encode(message).finish(); + }, + toProtoMsg(message: CodeInfo): CodeInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + value: CodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CodeInfo.typeUrl, CodeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfo.aminoType, CodeInfo.typeUrl); +function createBaseContractInfo(): ContractInfo { + return { + codeId: BigInt(0), + creator: "", + admin: "", + label: "", + created: undefined, + ibcPortId: "", + extension: undefined + }; +} +export const ContractInfo = { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + aminoType: "wasm/ContractInfo", + is(o: any): o is ContractInfo { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibcPortId === "string"); + }, + isAmino(o: any): o is ContractInfoAmino { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibc_port_id === "string"); + }, + encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); + } + if (message.extension !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.extension), writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 6: + message.ibcPortId = reader.string(); + break; + case 7: + message.extension = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractInfo { + const message = createBaseContractInfo(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.created = object.created !== undefined && object.created !== null ? AbsoluteTxPosition.fromPartial(object.created) : undefined; + message.ibcPortId = object.ibcPortId ?? ""; + message.extension = object.extension !== undefined && object.extension !== null ? GlobalDecoderRegistry.fromPartial(object.extension) : undefined; + return message; + }, + fromAmino(object: ContractInfoAmino): ContractInfo { + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = GlobalDecoderRegistry.fromAminoMsg(object.extension); + } + return message; + }, + toAmino(message: ContractInfo): ContractInfoAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.created = message.created ? AbsoluteTxPosition.toAmino(message.created) : undefined; + obj.ibc_port_id = message.ibcPortId === "" ? undefined : message.ibcPortId; + obj.extension = message.extension ? GlobalDecoderRegistry.toAminoMsg(message.extension) : undefined; + return obj; + }, + fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { + return ContractInfo.fromAmino(object.value); + }, + toAminoMsg(message: ContractInfo): ContractInfoAminoMsg { + return { + type: "wasm/ContractInfo", + value: ContractInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ContractInfoProtoMsg): ContractInfo { + return ContractInfo.decode(message.value); + }, + toProto(message: ContractInfo): Uint8Array { + return ContractInfo.encode(message).finish(); + }, + toProtoMsg(message: ContractInfo): ContractInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + value: ContractInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractInfo.typeUrl, ContractInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractInfo.aminoType, ContractInfo.typeUrl); +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { + operation: 0, + codeId: BigInt(0), + updated: undefined, + msg: new Uint8Array() + }; +} +export const ContractCodeHistoryEntry = { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + aminoType: "wasm/ContractCodeHistoryEntry", + is(o: any): o is ContractCodeHistoryEntry { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is ContractCodeHistoryEntryAmino { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractCodeHistoryEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operation = (reader.int32() as any); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + message.operation = object.operation ?? 0; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.updated = object.updated !== undefined && object.updated !== null ? AbsoluteTxPosition.fromPartial(object.updated) : undefined; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = object.operation; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAmino { + const obj: any = {}; + obj.operation = message.operation === 0 ? undefined : message.operation; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: ContractCodeHistoryEntryAminoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.fromAmino(object.value); + }, + toAminoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAminoMsg { + return { + type: "wasm/ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.toAmino(message) + }; + }, + fromProtoMsg(message: ContractCodeHistoryEntryProtoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.decode(message.value); + }, + toProto(message: ContractCodeHistoryEntry): Uint8Array { + return ContractCodeHistoryEntry.encode(message).finish(); + }, + toProtoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractCodeHistoryEntry.typeUrl, ContractCodeHistoryEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractCodeHistoryEntry.aminoType, ContractCodeHistoryEntry.typeUrl); +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { + blockHeight: BigInt(0), + txIndex: BigInt(0) + }; +} +export const AbsoluteTxPosition = { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + aminoType: "wasm/AbsoluteTxPosition", + is(o: any): o is AbsoluteTxPosition { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.blockHeight === "bigint" && typeof o.txIndex === "bigint"); + }, + isAmino(o: any): o is AbsoluteTxPositionAmino { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.block_height === "bigint" && typeof o.tx_index === "bigint"); + }, + encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.blockHeight); + } + if (message.txIndex !== BigInt(0)) { + writer.uint32(16).uint64(message.txIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAbsoluteTxPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.txIndex = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.txIndex = object.txIndex !== undefined && object.txIndex !== null ? BigInt(object.txIndex.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; + }, + toAmino(message: AbsoluteTxPosition): AbsoluteTxPositionAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.tx_index = message.txIndex !== BigInt(0) ? message.txIndex?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.fromAmino(object.value); + }, + toAminoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionAminoMsg { + return { + type: "wasm/AbsoluteTxPosition", + value: AbsoluteTxPosition.toAmino(message) + }; + }, + fromProtoMsg(message: AbsoluteTxPositionProtoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.decode(message.value); + }, + toProto(message: AbsoluteTxPosition): Uint8Array { + return AbsoluteTxPosition.encode(message).finish(); + }, + toProtoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + value: AbsoluteTxPosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AbsoluteTxPosition.typeUrl, AbsoluteTxPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(AbsoluteTxPosition.aminoType, AbsoluteTxPosition.typeUrl); +function createBaseModel(): Model { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const Model = { + typeUrl: "/cosmwasm.wasm.v1.Model", + aminoType: "wasm/Model", + is(o: any): o is Model { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is ModelAmino { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + encode(message: Model, 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): Model { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModel(); + 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: DeepPartial): Model { + const message = createBaseModel(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: ModelAmino): Model { + const message = createBaseModel(); + 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: Model): ModelAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: ModelAminoMsg): Model { + return Model.fromAmino(object.value); + }, + toAminoMsg(message: Model): ModelAminoMsg { + return { + type: "wasm/Model", + value: Model.toAmino(message) + }; + }, + fromProtoMsg(message: ModelProtoMsg): Model { + return Model.decode(message.value); + }, + toProto(message: Model): Uint8Array { + return Model.encode(message).finish(); + }, + toProtoMsg(message: Model): ModelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Model", + value: Model.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Model.typeUrl, Model); +GlobalDecoderRegistry.registerAminoProtoMapping(Model.aminoType, Model.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/extern.ts b/libs/injectivejs/src/extern.ts new file mode 100644 index 00000000..dd4c7d6e --- /dev/null +++ b/libs/injectivejs/src/extern.ts @@ -0,0 +1,38 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { + createQueryRpc, +} from '@interchainjs/cosmos/utils'; +import { Rpc } from "./helpers"; + +const _rpcClients: Record = {}; + +export const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => { + if (typeof rpcEndpoint === 'string') { + return rpcEndpoint; + } else if (!!rpcEndpoint) { + //@ts-ignore + return rpcEndpoint.url; + } +} + +export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + const key = getRpcEndpointKey(rpcEndpoint); + if (!key) return; + if (_rpcClients.hasOwnProperty(key)) { + return _rpcClients[key]; + } + const rpc = await createRpcClient(rpcEndpoint); + _rpcClients[key] = rpc; + return rpc; +} + +export const createRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { + return createQueryRpc(rpcEndpoint) +} diff --git a/libs/injectivejs/src/gogoproto/gogo.ts b/libs/injectivejs/src/gogoproto/gogo.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injectivejs/src/gogoproto/gogo.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injectivejs/src/google/api/annotations.ts b/libs/injectivejs/src/google/api/annotations.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/libs/injectivejs/src/google/api/annotations.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/libs/injectivejs/src/google/api/http.ts b/libs/injectivejs/src/google/api/http.ts new file mode 100644 index 00000000..3fd3a11b --- /dev/null +++ b/libs/injectivejs/src/google/api/http.ts @@ -0,0 +1,1069 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} +export interface HttpProtoMsg { + typeUrl: "/google.api.Http"; + value: Uint8Array; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpAmino { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRuleAmino[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} +export interface HttpAminoMsg { + type: "/google.api.Http"; + value: HttpAmino; +} +/** + * gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` + * + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * The following example selects a gRPC method and applies an `HttpRule` to it: + * + * http: + * rules: + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} +export interface HttpRuleProtoMsg { + typeUrl: "/google.api.HttpRule"; + value: Uint8Array; +} +/** + * gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` + * + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * The following example selects a gRPC method and applies an `HttpRule` to it: + * + * http: + * rules: + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleAmino { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPatternAmino; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRuleAmino[]; +} +export interface HttpRuleAminoMsg { + type: "/google.api.HttpRule"; + value: HttpRuleAmino; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternProtoMsg { + typeUrl: "/google.api.CustomHttpPattern"; + value: Uint8Array; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternAmino { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternAminoMsg { + type: "/google.api.CustomHttpPattern"; + value: CustomHttpPatternAmino; +} +function createBaseHttp(): Http { + return { + rules: [], + fullyDecodeReservedExpansion: false + }; +} +export const Http = { + typeUrl: "/google.api.Http", + is(o: any): o is Http { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.is(o.rules[0])) && typeof o.fullyDecodeReservedExpansion === "boolean"); + }, + isAmino(o: any): o is HttpAmino { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.isAmino(o.rules[0])) && typeof o.fully_decode_reserved_expansion === "boolean"); + }, + encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, + fromAmino(object: HttpAmino): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; + }, + toAmino(message: Http): HttpAmino { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.rules = message.rules; + } + obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion === false ? undefined : message.fullyDecodeReservedExpansion; + return obj; + }, + fromAminoMsg(object: HttpAminoMsg): Http { + return Http.fromAmino(object.value); + }, + fromProtoMsg(message: HttpProtoMsg): Http { + return Http.decode(message.value); + }, + toProto(message: Http): Uint8Array { + return Http.encode(message).finish(); + }, + toProtoMsg(message: Http): HttpProtoMsg { + return { + typeUrl: "/google.api.Http", + value: Http.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Http.typeUrl, Http); +function createBaseHttpRule(): HttpRule { + return { + selector: "", + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: "", + responseBody: "", + additionalBindings: [] + }; +} +export const HttpRule = { + typeUrl: "/google.api.HttpRule", + is(o: any): o is HttpRule { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.responseBody === "string" && Array.isArray(o.additionalBindings) && (!o.additionalBindings.length || HttpRule.is(o.additionalBindings[0]))); + }, + isAmino(o: any): o is HttpRuleAmino { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.response_body === "string" && Array.isArray(o.additional_bindings) && (!o.additional_bindings.length || HttpRule.isAmino(o.additional_bindings[0]))); + }, + encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = object.custom !== undefined && object.custom !== null ? CustomHttpPattern.fromPartial(object.custom) : undefined; + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HttpRuleAmino): HttpRule { + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; + }, + toAmino(message: HttpRule): HttpRuleAmino { + const obj: any = {}; + obj.selector = message.selector === "" ? undefined : message.selector; + obj.get = message.get === null ? undefined : message.get; + obj.put = message.put === null ? undefined : message.put; + obj.post = message.post === null ? undefined : message.post; + obj.delete = message.delete === null ? undefined : message.delete; + obj.patch = message.patch === null ? undefined : message.patch; + obj.custom = message.custom ? CustomHttpPattern.toAmino(message.custom) : undefined; + obj.body = message.body === "" ? undefined : message.body; + obj.response_body = message.responseBody === "" ? undefined : message.responseBody; + if (message.additionalBindings) { + obj.additional_bindings = message.additionalBindings.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.additional_bindings = message.additionalBindings; + } + return obj; + }, + fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { + return HttpRule.fromAmino(object.value); + }, + fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { + return HttpRule.decode(message.value); + }, + toProto(message: HttpRule): Uint8Array { + return HttpRule.encode(message).finish(); + }, + toProtoMsg(message: HttpRule): HttpRuleProtoMsg { + return { + typeUrl: "/google.api.HttpRule", + value: HttpRule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HttpRule.typeUrl, HttpRule); +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { + kind: "", + path: "" + }; +} +export const CustomHttpPattern = { + typeUrl: "/google.api.CustomHttpPattern", + is(o: any): o is CustomHttpPattern { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + isAmino(o: any): o is CustomHttpPatternAmino { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, + fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; + }, + toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.path = message.path === "" ? undefined : message.path; + return obj; + }, + fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { + return CustomHttpPattern.fromAmino(object.value); + }, + fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { + return CustomHttpPattern.decode(message.value); + }, + toProto(message: CustomHttpPattern): Uint8Array { + return CustomHttpPattern.encode(message).finish(); + }, + toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg { + return { + typeUrl: "/google.api.CustomHttpPattern", + value: CustomHttpPattern.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CustomHttpPattern.typeUrl, CustomHttpPattern); \ No newline at end of file diff --git a/libs/injectivejs/src/google/protobuf/any.ts b/libs/injectivejs/src/google/protobuf/any.ts new file mode 100644 index 00000000..bbae1be1 --- /dev/null +++ b/libs/injectivejs/src/google/protobuf/any.ts @@ -0,0 +1,331 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} +export interface AnyProtoMsg { + typeUrl: "/google.protobuf.Any"; + value: Uint8Array; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnyAmino { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + type: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: any; +} +export interface AnyAminoMsg { + type: string; + value: AnyAmino; +} +function createBaseAny(): Any { + return { + typeUrl: "", + value: new Uint8Array() + }; +} +export const Any = { + typeUrl: "/google.protobuf.Any", + is(o: any): o is Any { + return o && (o.$typeUrl === Any.typeUrl || typeof o.typeUrl === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is AnyAmino { + return o && (o.$typeUrl === Any.typeUrl || typeof o.type === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: AnyAmino): Any { + return { + typeUrl: object.type, + value: object.value + }; + }, + toAmino(message: Any): AnyAmino { + const obj: any = {}; + obj.type = message.typeUrl; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: AnyAminoMsg): Any { + return Any.fromAmino(object.value); + }, + fromProtoMsg(message: AnyProtoMsg): Any { + return Any.decode(message.value); + }, + toProto(message: Any): Uint8Array { + return Any.encode(message).finish(); + }, + toProtoMsg(message: Any): AnyProtoMsg { + return { + typeUrl: "/google.protobuf.Any", + value: Any.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/libs/injectivejs/src/google/protobuf/descriptor.ts b/libs/injectivejs/src/google/protobuf/descriptor.ts new file mode 100644 index 00000000..53b60923 --- /dev/null +++ b/libs/injectivejs/src/google/protobuf/descriptor.ts @@ -0,0 +1,7177 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** The full set of known editions. */ +export enum Edition { + /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ + EDITION_UNKNOWN = 0, + /** + * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + */ + EDITION_LEGACY = 900, + /** + * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + */ + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + /** + * EDITION_2023 - Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + */ + EDITION_2023 = 1000, + EDITION_2024 = 1001, + /** + * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + */ + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + /** + * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + */ + EDITION_MAX = 2147483647, + UNRECOGNIZED = -1, +} +export const EditionAmino = Edition; +export function editionFromJSON(object: any): Edition { + switch (object) { + case 0: + case "EDITION_UNKNOWN": + return Edition.EDITION_UNKNOWN; + case 900: + case "EDITION_LEGACY": + return Edition.EDITION_LEGACY; + case 998: + case "EDITION_PROTO2": + return Edition.EDITION_PROTO2; + case 999: + case "EDITION_PROTO3": + return Edition.EDITION_PROTO3; + case 1000: + case "EDITION_2023": + return Edition.EDITION_2023; + case 1001: + case "EDITION_2024": + return Edition.EDITION_2024; + case 1: + case "EDITION_1_TEST_ONLY": + return Edition.EDITION_1_TEST_ONLY; + case 2: + case "EDITION_2_TEST_ONLY": + return Edition.EDITION_2_TEST_ONLY; + case 99997: + case "EDITION_99997_TEST_ONLY": + return Edition.EDITION_99997_TEST_ONLY; + case 99998: + case "EDITION_99998_TEST_ONLY": + return Edition.EDITION_99998_TEST_ONLY; + case 99999: + case "EDITION_99999_TEST_ONLY": + return Edition.EDITION_99999_TEST_ONLY; + case 2147483647: + case "EDITION_MAX": + return Edition.EDITION_MAX; + case -1: + case "UNRECOGNIZED": + default: + return Edition.UNRECOGNIZED; + } +} +export function editionToJSON(object: Edition): string { + switch (object) { + case Edition.EDITION_UNKNOWN: + return "EDITION_UNKNOWN"; + case Edition.EDITION_LEGACY: + return "EDITION_LEGACY"; + case Edition.EDITION_PROTO2: + return "EDITION_PROTO2"; + case Edition.EDITION_PROTO3: + return "EDITION_PROTO3"; + case Edition.EDITION_2023: + return "EDITION_2023"; + case Edition.EDITION_2024: + return "EDITION_2024"; + case Edition.EDITION_1_TEST_ONLY: + return "EDITION_1_TEST_ONLY"; + case Edition.EDITION_2_TEST_ONLY: + return "EDITION_2_TEST_ONLY"; + case Edition.EDITION_99997_TEST_ONLY: + return "EDITION_99997_TEST_ONLY"; + case Edition.EDITION_99998_TEST_ONLY: + return "EDITION_99998_TEST_ONLY"; + case Edition.EDITION_99999_TEST_ONLY: + return "EDITION_99999_TEST_ONLY"; + case Edition.EDITION_MAX: + return "EDITION_MAX"; + case Edition.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** The verification state of the extension range. */ +export enum ExtensionRangeOptions_VerificationState { + /** DECLARATION - All the extensions of the range must be declared. */ + DECLARATION = 0, + UNVERIFIED = 1, + UNRECOGNIZED = -1, +} +export const ExtensionRangeOptions_VerificationStateAmino = ExtensionRangeOptions_VerificationState; +export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState { + switch (object) { + case 0: + case "DECLARATION": + return ExtensionRangeOptions_VerificationState.DECLARATION; + case 1: + case "UNVERIFIED": + return ExtensionRangeOptions_VerificationState.UNVERIFIED; + case -1: + case "UNRECOGNIZED": + default: + return ExtensionRangeOptions_VerificationState.UNRECOGNIZED; + } +} +export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string { + switch (object) { + case ExtensionRangeOptions_VerificationState.DECLARATION: + return "DECLARATION"; + case ExtensionRangeOptions_VerificationState.UNVERIFIED: + return "UNVERIFIED"; + case ExtensionRangeOptions_VerificationState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - 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, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_TypeAmino = FieldDescriptorProto_Type; +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + /** + * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + */ + LABEL_REQUIRED = 2, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_LabelAmino = FieldDescriptorProto_Label; +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export const FileOptions_OptimizeModeAmino = FileOptions_OptimizeMode; +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + /** + * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + */ + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_CTypeAmino = FieldOptions_CType; +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_JSTypeAmino = FieldOptions_JSType; +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_OptionRetentionAmino = FieldOptions_OptionRetention; +export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { + switch (object) { + case 0: + case "RETENTION_UNKNOWN": + return FieldOptions_OptionRetention.RETENTION_UNKNOWN; + case 1: + case "RETENTION_RUNTIME": + return FieldOptions_OptionRetention.RETENTION_RUNTIME; + case 2: + case "RETENTION_SOURCE": + return FieldOptions_OptionRetention.RETENTION_SOURCE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionRetention.UNRECOGNIZED; + } +} +export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { + switch (object) { + case FieldOptions_OptionRetention.RETENTION_UNKNOWN: + return "RETENTION_UNKNOWN"; + case FieldOptions_OptionRetention.RETENTION_RUNTIME: + return "RETENTION_RUNTIME"; + case FieldOptions_OptionRetention.RETENTION_SOURCE: + return "RETENTION_SOURCE"; + case FieldOptions_OptionRetention.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} +export const FieldOptions_OptionTargetTypeAmino = FieldOptions_OptionTargetType; +export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { + switch (object) { + case 0: + case "TARGET_TYPE_UNKNOWN": + return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; + case 1: + case "TARGET_TYPE_FILE": + return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; + case 2: + case "TARGET_TYPE_EXTENSION_RANGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; + case 3: + case "TARGET_TYPE_MESSAGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; + case 4: + case "TARGET_TYPE_FIELD": + return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; + case 5: + case "TARGET_TYPE_ONEOF": + return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; + case 6: + case "TARGET_TYPE_ENUM": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; + case 7: + case "TARGET_TYPE_ENUM_ENTRY": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; + case 8: + case "TARGET_TYPE_SERVICE": + return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; + case 9: + case "TARGET_TYPE_METHOD": + return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionTargetType.UNRECOGNIZED; + } +} +export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { + switch (object) { + case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: + return "TARGET_TYPE_UNKNOWN"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: + return "TARGET_TYPE_FILE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: + return "TARGET_TYPE_EXTENSION_RANGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: + return "TARGET_TYPE_MESSAGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: + return "TARGET_TYPE_FIELD"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: + return "TARGET_TYPE_ONEOF"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: + return "TARGET_TYPE_ENUM"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: + return "TARGET_TYPE_ENUM_ENTRY"; + case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: + return "TARGET_TYPE_SERVICE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: + return "TARGET_TYPE_METHOD"; + case FieldOptions_OptionTargetType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * 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. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} +export const MethodOptions_IdempotencyLevelAmino = MethodOptions_IdempotencyLevel; +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3, + UNRECOGNIZED = -1, +} +export const FeatureSet_FieldPresenceAmino = FeatureSet_FieldPresence; +export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence { + switch (object) { + case 0: + case "FIELD_PRESENCE_UNKNOWN": + return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; + case 1: + case "EXPLICIT": + return FeatureSet_FieldPresence.EXPLICIT; + case 2: + case "IMPLICIT": + return FeatureSet_FieldPresence.IMPLICIT; + case 3: + case "LEGACY_REQUIRED": + return FeatureSet_FieldPresence.LEGACY_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_FieldPresence.UNRECOGNIZED; + } +} +export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string { + switch (object) { + case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: + return "FIELD_PRESENCE_UNKNOWN"; + case FeatureSet_FieldPresence.EXPLICIT: + return "EXPLICIT"; + case FeatureSet_FieldPresence.IMPLICIT: + return "IMPLICIT"; + case FeatureSet_FieldPresence.LEGACY_REQUIRED: + return "LEGACY_REQUIRED"; + case FeatureSet_FieldPresence.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_EnumTypeAmino = FeatureSet_EnumType; +export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType { + switch (object) { + case 0: + case "ENUM_TYPE_UNKNOWN": + return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; + case 1: + case "OPEN": + return FeatureSet_EnumType.OPEN; + case 2: + case "CLOSED": + return FeatureSet_EnumType.CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_EnumType.UNRECOGNIZED; + } +} +export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string { + switch (object) { + case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: + return "ENUM_TYPE_UNKNOWN"; + case FeatureSet_EnumType.OPEN: + return "OPEN"; + case FeatureSet_EnumType.CLOSED: + return "CLOSED"; + case FeatureSet_EnumType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_RepeatedFieldEncodingAmino = FeatureSet_RepeatedFieldEncoding; +export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding { + switch (object) { + case 0: + case "REPEATED_FIELD_ENCODING_UNKNOWN": + return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; + case 1: + case "PACKED": + return FeatureSet_RepeatedFieldEncoding.PACKED; + case 2: + case "EXPANDED": + return FeatureSet_RepeatedFieldEncoding.EXPANDED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED; + } +} +export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string { + switch (object) { + case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: + return "REPEATED_FIELD_ENCODING_UNKNOWN"; + case FeatureSet_RepeatedFieldEncoding.PACKED: + return "PACKED"; + case FeatureSet_RepeatedFieldEncoding.EXPANDED: + return "EXPANDED"; + case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3, + UNRECOGNIZED = -1, +} +export const FeatureSet_Utf8ValidationAmino = FeatureSet_Utf8Validation; +export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation { + switch (object) { + case 0: + case "UTF8_VALIDATION_UNKNOWN": + return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; + case 2: + case "VERIFY": + return FeatureSet_Utf8Validation.VERIFY; + case 3: + case "NONE": + return FeatureSet_Utf8Validation.NONE; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_Utf8Validation.UNRECOGNIZED; + } +} +export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string { + switch (object) { + case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: + return "UTF8_VALIDATION_UNKNOWN"; + case FeatureSet_Utf8Validation.VERIFY: + return "VERIFY"; + case FeatureSet_Utf8Validation.NONE: + return "NONE"; + case FeatureSet_Utf8Validation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_MessageEncodingAmino = FeatureSet_MessageEncoding; +export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding { + switch (object) { + case 0: + case "MESSAGE_ENCODING_UNKNOWN": + return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; + case 1: + case "LENGTH_PREFIXED": + return FeatureSet_MessageEncoding.LENGTH_PREFIXED; + case 2: + case "DELIMITED": + return FeatureSet_MessageEncoding.DELIMITED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_MessageEncoding.UNRECOGNIZED; + } +} +export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string { + switch (object) { + case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: + return "MESSAGE_ENCODING_UNKNOWN"; + case FeatureSet_MessageEncoding.LENGTH_PREFIXED: + return "LENGTH_PREFIXED"; + case FeatureSet_MessageEncoding.DELIMITED: + return "DELIMITED"; + case FeatureSet_MessageEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureSet_JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2, + UNRECOGNIZED = -1, +} +export const FeatureSet_JsonFormatAmino = FeatureSet_JsonFormat; +export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat { + switch (object) { + case 0: + case "JSON_FORMAT_UNKNOWN": + return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; + case 1: + case "ALLOW": + return FeatureSet_JsonFormat.ALLOW; + case 2: + case "LEGACY_BEST_EFFORT": + return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_JsonFormat.UNRECOGNIZED; + } +} +export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string { + switch (object) { + case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: + return "JSON_FORMAT_UNKNOWN"; + case FeatureSet_JsonFormat.ALLOW: + return "ALLOW"; + case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: + return "LEGACY_BEST_EFFORT"; + case FeatureSet_JsonFormat.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} +export const GeneratedCodeInfo_Annotation_SemanticAmino = GeneratedCodeInfo_Annotation_Semantic; +export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { + switch (object) { + case 0: + case "NONE": + return GeneratedCodeInfo_Annotation_Semantic.NONE; + case 1: + case "SET": + return GeneratedCodeInfo_Annotation_Semantic.SET; + case 2: + case "ALIAS": + return GeneratedCodeInfo_Annotation_Semantic.ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; + } +} +export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { + switch (object) { + case GeneratedCodeInfo_Annotation_Semantic.NONE: + return "NONE"; + case GeneratedCodeInfo_Annotation_Semantic.SET: + return "SET"; + case GeneratedCodeInfo_Annotation_Semantic.ALIAS: + return "ALIAS"; + case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} +export interface FileDescriptorSetProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorSet"; + value: Uint8Array; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetAmino { + file: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorSetAminoMsg { + type: "/google.protobuf.FileDescriptorSet"; + value: FileDescriptorSetAmino; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * 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. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + edition: Edition; +} +export interface FileDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorProto"; + value: Uint8Array; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoAmino { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProtoAmino[]; + enum_type: EnumDescriptorProtoAmino[]; + service: ServiceDescriptorProtoAmino[]; + extension: FieldDescriptorProtoAmino[]; + options?: FileOptionsAmino; + /** + * 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. + */ + source_code_info?: SourceCodeInfoAmino; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + edition: Edition; +} +export interface FileDescriptorProtoAminoMsg { + type: "/google.protobuf.FileDescriptorProto"; + value: FileDescriptorProtoAmino; +} +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} +export interface DescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.DescriptorProto"; + value: Uint8Array; +} +/** Describes a message type. */ +export interface DescriptorProtoAmino { + name: string; + field: FieldDescriptorProtoAmino[]; + extension: FieldDescriptorProtoAmino[]; + nested_type: DescriptorProtoAmino[]; + enum_type: EnumDescriptorProtoAmino[]; + extension_range: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl: OneofDescriptorProtoAmino[]; + options?: MessageOptionsAmino; + reserved_range: DescriptorProto_ReservedRangeAmino[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} +export interface DescriptorProtoAminoMsg { + type: "/google.protobuf.DescriptorProto"; + value: DescriptorProtoAmino; +} +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} +export interface DescriptorProto_ExtensionRangeProtoMsg { + typeUrl: "/google.protobuf.ExtensionRange"; + value: Uint8Array; +} +export interface DescriptorProto_ExtensionRangeAmino { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptionsAmino; +} +export interface DescriptorProto_ExtensionRangeAminoMsg { + type: "/google.protobuf.ExtensionRange"; + value: DescriptorProto_ExtensionRangeAmino; +} +/** + * 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. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeProtoMsg { + typeUrl: "/google.protobuf.ReservedRange"; + value: Uint8Array; +} +/** + * 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. + */ +export interface DescriptorProto_ReservedRangeAmino { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeAminoMsg { + type: "/google.protobuf.ReservedRange"; + value: DescriptorProto_ReservedRangeAmino; +} +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** Any features defined in the specific edition. */ + features?: FeatureSet; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification: ExtensionRangeOptions_VerificationState; +} +export interface ExtensionRangeOptionsProtoMsg { + typeUrl: "/google.protobuf.ExtensionRangeOptions"; + value: Uint8Array; +} +export interface ExtensionRangeOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_DeclarationAmino[]; + /** Any features defined in the specific edition. */ + features?: FeatureSetAmino; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification: ExtensionRangeOptions_VerificationState; +} +export interface ExtensionRangeOptionsAminoMsg { + type: "/google.protobuf.ExtensionRangeOptions"; + value: ExtensionRangeOptionsAmino; +} +export interface ExtensionRangeOptions_Declaration { + /** The extension number declared within the extension range. */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + fullName: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated: boolean; +} +export interface ExtensionRangeOptions_DeclarationProtoMsg { + typeUrl: "/google.protobuf.Declaration"; + value: Uint8Array; +} +export interface ExtensionRangeOptions_DeclarationAmino { + /** The extension number declared within the extension range. */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + full_name: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated: boolean; +} +export interface ExtensionRangeOptions_DeclarationAminoMsg { + type: "/google.protobuf.Declaration"; + value: ExtensionRangeOptions_DeclarationAmino; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * 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. + */ + type: FieldDescriptorProto_Type; + /** + * 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). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * 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. + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * 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. + */ + jsonName: string; + options?: FieldOptions; + /** + * 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 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`. + */ + proto3Optional: boolean; +} +export interface FieldDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FieldDescriptorProto"; + value: Uint8Array; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoAmino { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * 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. + */ + type: FieldDescriptorProto_Type; + /** + * 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). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * 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. + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * 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. + */ + json_name: string; + options?: FieldOptionsAmino; + /** + * 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 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`. + */ + proto3_optional: boolean; +} +export interface FieldDescriptorProtoAminoMsg { + type: "/google.protobuf.FieldDescriptorProto"; + value: FieldDescriptorProtoAmino; +} +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +export interface OneofDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.OneofDescriptorProto"; + value: Uint8Array; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoAmino { + name: string; + options?: OneofOptionsAmino; +} +export interface OneofDescriptorProtoAminoMsg { + type: "/google.protobuf.OneofDescriptorProto"; + value: OneofDescriptorProtoAmino; +} +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * 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. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +export interface EnumDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumDescriptorProto"; + value: Uint8Array; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoAmino { + name: string; + value: EnumValueDescriptorProtoAmino[]; + options?: EnumOptionsAmino; + /** + * 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. + */ + reserved_range: EnumDescriptorProto_EnumReservedRangeAmino[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} +export interface EnumDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumDescriptorProto"; + value: EnumDescriptorProtoAmino; +} +/** + * 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. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { + typeUrl: "/google.protobuf.EnumReservedRange"; + value: Uint8Array; +} +/** + * 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. + */ +export interface EnumDescriptorProto_EnumReservedRangeAmino { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { + type: "/google.protobuf.EnumReservedRange"; + value: EnumDescriptorProto_EnumReservedRangeAmino; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +export interface EnumValueDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumValueDescriptorProto"; + value: Uint8Array; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoAmino { + name: string; + number: number; + options?: EnumValueOptionsAmino; +} +export interface EnumValueDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumValueDescriptorProto"; + value: EnumValueDescriptorProtoAmino; +} +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +export interface ServiceDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.ServiceDescriptorProto"; + value: Uint8Array; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoAmino { + name: string; + method: MethodDescriptorProtoAmino[]; + options?: ServiceOptionsAmino; +} +export interface ServiceDescriptorProtoAminoMsg { + type: "/google.protobuf.ServiceDescriptorProto"; + value: ServiceDescriptorProtoAmino; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} +export interface MethodDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.MethodDescriptorProto"; + value: Uint8Array; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoAmino { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options?: MethodOptionsAmino; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} +export interface MethodDescriptorProtoAminoMsg { + type: "/google.protobuf.MethodDescriptorProto"; + value: MethodDescriptorProtoAmino; +} +export interface 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. + */ + javaPackage: string; + /** + * 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. + */ + javaOuterClassname: string; + /** + * 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. + */ + javaMultipleFiles: boolean; + /** This option does nothing. */ + /** @deprecated */ + javaGenerateEqualsAndHash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * 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. + */ + goPackage: string; + /** + * 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. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * 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. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * 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. + */ + phpNamespace: string; + /** + * 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. + */ + phpMetadataNamespace: string; + /** + * 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. + */ + rubyPackage: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FileOptionsProtoMsg { + typeUrl: "/google.protobuf.FileOptions"; + value: Uint8Array; +} +export interface FileOptionsAmino { + /** + * 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. + */ + java_package: string; + /** + * 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. + */ + java_outer_classname: string; + /** + * 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. + */ + java_multiple_files: boolean; + /** This option does nothing. */ + /** @deprecated */ + java_generate_equals_and_hash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * 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. + */ + go_package: string; + /** + * 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. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * 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. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * 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. + */ + php_namespace: string; + /** + * 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. + */ + php_metadata_namespace: string; + /** + * 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. + */ + ruby_package: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface FileOptionsAminoMsg { + type: "/google.protobuf.FileOptions"; + value: FileOptionsAmino; +} +export interface 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. + */ + messageSetWireFormat: boolean; + /** + * 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". + */ + noStandardDescriptorAccessor: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * 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. + * + * 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. + */ + mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + */ + /** @deprecated */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MessageOptionsProtoMsg { + typeUrl: "/google.protobuf.MessageOptions"; + value: Uint8Array; +} +export interface MessageOptionsAmino { + /** + * 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. + */ + message_set_wire_format: boolean; + /** + * 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". + */ + no_standard_descriptor_accessor: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * 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. + * + * 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. + */ + map_entry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + */ + /** @deprecated */ + deprecated_legacy_json_field_conflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface MessageOptionsAminoMsg { + type: "/google.protobuf.MessageOptions"; + value: MessageOptionsAmino; +} +export interface FieldOptions { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * 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 only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + */ + ctype: FieldOptions_CType; + /** + * 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. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed: boolean; + /** + * 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. + */ + jstype: FieldOptions_JSType; + /** + * 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 lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy: boolean; + /** + * 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. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact: boolean; + retention: FieldOptions_OptionRetention; + targets: FieldOptions_OptionTargetType[]; + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + featureSupport?: FieldOptions_FeatureSupport; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FieldOptionsProtoMsg { + typeUrl: "/google.protobuf.FieldOptions"; + value: Uint8Array; +} +export interface FieldOptionsAmino { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * 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 only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + */ + ctype: FieldOptions_CType; + /** + * 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. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed: boolean; + /** + * 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. + */ + jstype: FieldOptions_JSType; + /** + * 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 lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverified_lazy: boolean; + /** + * 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. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debug_redact: boolean; + retention: FieldOptions_OptionRetention; + targets: FieldOptions_OptionTargetType[]; + edition_defaults: FieldOptions_EditionDefaultAmino[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + feature_support?: FieldOptions_FeatureSupportAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface FieldOptionsAminoMsg { + type: "/google.protobuf.FieldOptions"; + value: FieldOptionsAmino; +} +export interface FieldOptions_EditionDefault { + edition: Edition; + /** Textproto value. */ + value: string; +} +export interface FieldOptions_EditionDefaultProtoMsg { + typeUrl: "/google.protobuf.EditionDefault"; + value: Uint8Array; +} +export interface FieldOptions_EditionDefaultAmino { + edition: Edition; + /** Textproto value. */ + value: string; +} +export interface FieldOptions_EditionDefaultAminoMsg { + type: "/google.protobuf.EditionDefault"; + value: FieldOptions_EditionDefaultAmino; +} +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupport { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + editionIntroduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + editionDeprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecationWarning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + editionRemoved: Edition; +} +export interface FieldOptions_FeatureSupportProtoMsg { + typeUrl: "/google.protobuf.FeatureSupport"; + value: Uint8Array; +} +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupportAmino { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + edition_introduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + edition_deprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecation_warning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + edition_removed: Edition; +} +export interface FieldOptions_FeatureSupportAminoMsg { + type: "/google.protobuf.FeatureSupport"; + value: FieldOptions_FeatureSupportAmino; +} +export interface OneofOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface OneofOptionsProtoMsg { + typeUrl: "/google.protobuf.OneofOptions"; + value: Uint8Array; +} +export interface OneofOptionsAmino { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface OneofOptionsAminoMsg { + type: "/google.protobuf.OneofOptions"; + value: OneofOptionsAmino; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + */ + /** @deprecated */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumOptions"; + value: Uint8Array; +} +export interface EnumOptionsAmino { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * 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. + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + */ + /** @deprecated */ + deprecated_legacy_json_field_conflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface EnumOptionsAminoMsg { + type: "/google.protobuf.EnumOptions"; + value: EnumOptionsAmino; +} +export interface 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. + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debugRedact: boolean; + /** Information about the support window of a feature value. */ + featureSupport?: FieldOptions_FeatureSupport; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumValueOptions"; + value: Uint8Array; +} +export interface EnumValueOptionsAmino { + /** + * 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. + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debug_redact: boolean; + /** Information about the support window of a feature value. */ + feature_support?: FieldOptions_FeatureSupportAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface EnumValueOptionsAminoMsg { + type: "/google.protobuf.EnumValueOptions"; + value: EnumValueOptionsAmino; +} +export interface ServiceOptions { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** + * 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. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptionsProtoMsg { + typeUrl: "/google.protobuf.ServiceOptions"; + value: Uint8Array; +} +export interface ServiceOptionsAmino { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** + * 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. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface ServiceOptionsAminoMsg { + type: "/google.protobuf.ServiceOptions"; + value: ServiceOptionsAmino; +} +export interface MethodOptions { + /** + * 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. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSet; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptionsProtoMsg { + typeUrl: "/google.protobuf.MethodOptions"; + value: Uint8Array; +} +export interface MethodOptionsAmino { + /** + * 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. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ + features?: FeatureSetAmino; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOptionAmino[]; +} +export interface MethodOptionsAminoMsg { + type: "/google.protobuf.MethodOptions"; + value: MethodOptionsAmino; +} +/** + * 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. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: bigint; + negativeIntValue: bigint; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} +export interface UninterpretedOptionProtoMsg { + typeUrl: "/google.protobuf.UninterpretedOption"; + value: Uint8Array; +} +/** + * 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. + */ +export interface UninterpretedOptionAmino { + name: UninterpretedOption_NamePartAmino[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: string; + negative_int_value: string; + double_value: number; + string_value: string; + aggregate_value: string; +} +export interface UninterpretedOptionAminoMsg { + type: "/google.protobuf.UninterpretedOption"; + value: UninterpretedOptionAmino; +} +/** + * 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". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} +export interface UninterpretedOption_NamePartProtoMsg { + typeUrl: "/google.protobuf.NamePart"; + value: Uint8Array; +} +/** + * 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". + */ +export interface UninterpretedOption_NamePartAmino { + name_part: string; + is_extension: boolean; +} +export interface UninterpretedOption_NamePartAminoMsg { + type: "/google.protobuf.NamePart"; + value: UninterpretedOption_NamePartAmino; +} +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSet { + fieldPresence: FeatureSet_FieldPresence; + enumType: FeatureSet_EnumType; + repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; + utf8Validation: FeatureSet_Utf8Validation; + messageEncoding: FeatureSet_MessageEncoding; + jsonFormat: FeatureSet_JsonFormat; +} +export interface FeatureSetProtoMsg { + typeUrl: "/google.protobuf.FeatureSet"; + value: Uint8Array; +} +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSetAmino { + field_presence: FeatureSet_FieldPresence; + enum_type: FeatureSet_EnumType; + repeated_field_encoding: FeatureSet_RepeatedFieldEncoding; + utf8_validation: FeatureSet_Utf8Validation; + message_encoding: FeatureSet_MessageEncoding; + json_format: FeatureSet_JsonFormat; +} +export interface FeatureSetAminoMsg { + type: "/google.protobuf.FeatureSet"; + value: FeatureSetAmino; +} +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaults { + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimumEdition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximumEdition: Edition; +} +export interface FeatureSetDefaultsProtoMsg { + typeUrl: "/google.protobuf.FeatureSetDefaults"; + value: Uint8Array; +} +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaultsAmino { + defaults: FeatureSetDefaults_FeatureSetEditionDefaultAmino[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimum_edition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximum_edition: Edition; +} +export interface FeatureSetDefaultsAminoMsg { + type: "/google.protobuf.FeatureSetDefaults"; + value: FeatureSetDefaultsAmino; +} +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefault { + edition: Edition; + /** Defaults of features that can be overridden in this edition. */ + overridableFeatures?: FeatureSet; + /** Defaults of features that can't be overridden in this edition. */ + fixedFeatures?: FeatureSet; +} +export interface FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { + typeUrl: "/google.protobuf.FeatureSetEditionDefault"; + value: Uint8Array; +} +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefaultAmino { + edition: Edition; + /** Defaults of features that can be overridden in this edition. */ + overridable_features?: FeatureSetAmino; + /** Defaults of features that can't be overridden in this edition. */ + fixed_features?: FeatureSetAmino; +} +export interface FeatureSetDefaults_FeatureSetEditionDefaultAminoMsg { + type: "/google.protobuf.FeatureSetEditionDefault"; + value: FeatureSetDefaults_FeatureSetEditionDefaultAmino; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface 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. + */ + location: SourceCodeInfo_Location[]; +} +export interface SourceCodeInfoProtoMsg { + typeUrl: "/google.protobuf.SourceCodeInfo"; + value: Uint8Array; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoAmino { + /** + * 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. + */ + location: SourceCodeInfo_LocationAmino[]; +} +export interface SourceCodeInfoAminoMsg { + type: "/google.protobuf.SourceCodeInfo"; + value: SourceCodeInfoAmino; +} +export interface SourceCodeInfo_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 appears. + * 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). + */ + path: number[]; + /** + * 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. + */ + span: number[]; + /** + * 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. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} +export interface SourceCodeInfo_LocationProtoMsg { + typeUrl: "/google.protobuf.Location"; + value: Uint8Array; +} +export interface SourceCodeInfo_LocationAmino { + /** + * 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 appears. + * 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). + */ + path: number[]; + /** + * 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. + */ + span: number[]; + /** + * 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. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} +export interface SourceCodeInfo_LocationAminoMsg { + type: "/google.protobuf.Location"; + value: SourceCodeInfo_LocationAmino; +} +/** + * 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. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +export interface GeneratedCodeInfoProtoMsg { + typeUrl: "/google.protobuf.GeneratedCodeInfo"; + value: Uint8Array; +} +/** + * 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. + */ +export interface GeneratedCodeInfoAmino { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_AnnotationAmino[]; +} +export interface GeneratedCodeInfoAminoMsg { + type: "/google.protobuf.GeneratedCodeInfo"; + value: GeneratedCodeInfoAmino; +} +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * 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). + */ + end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} +export interface GeneratedCodeInfo_AnnotationProtoMsg { + typeUrl: "/google.protobuf.Annotation"; + value: Uint8Array; +} +export interface GeneratedCodeInfo_AnnotationAmino { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * 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). + */ + end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} +export interface GeneratedCodeInfo_AnnotationAminoMsg { + type: "/google.protobuf.Annotation"; + value: GeneratedCodeInfo_AnnotationAmino; +} +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { + file: [] + }; +} +export const FileDescriptorSet = { + typeUrl: "/google.protobuf.FileDescriptorSet", + is(o: any): o is FileDescriptorSet { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.is(o.file[0]))); + }, + isAmino(o: any): o is FileDescriptorSetAmino { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.isAmino(o.file[0]))); + }, + encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.file = message.file; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorSetAminoMsg): FileDescriptorSet { + return FileDescriptorSet.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorSetProtoMsg): FileDescriptorSet { + return FileDescriptorSet.decode(message.value); + }, + toProto(message: FileDescriptorSet): Uint8Array { + return FileDescriptorSet.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorSet): FileDescriptorSetProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorSet", + value: FileDescriptorSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorSet.typeUrl, FileDescriptorSet); +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + edition: 1 + }; +} +export const FileDescriptorProto = { + typeUrl: "/google.protobuf.FileDescriptorProto", + is(o: any): o is FileDescriptorProto { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.publicDependency) && (!o.publicDependency.length || typeof o.publicDependency[0] === "number") && Array.isArray(o.weakDependency) && (!o.weakDependency.length || typeof o.weakDependency[0] === "number") && Array.isArray(o.messageType) && (!o.messageType.length || DescriptorProto.is(o.messageType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.is(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && typeof o.syntax === "string" && isSet(o.edition)); + }, + isAmino(o: any): o is FileDescriptorProtoAmino { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.public_dependency) && (!o.public_dependency.length || typeof o.public_dependency[0] === "number") && Array.isArray(o.weak_dependency) && (!o.weak_dependency.length || typeof o.weak_dependency[0] === "number") && Array.isArray(o.message_type) && (!o.message_type.length || DescriptorProto.isAmino(o.message_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.isAmino(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && typeof o.syntax === "string" && isSet(o.edition)); + }, + encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + if (message.edition !== 1) { + writer.uint32(112).int32(message.edition); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + case 14: + message.edition = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.publicDependency?.map(e => e) || []; + message.weakDependency = object.weakDependency?.map(e => e) || []; + message.messageType = object.messageType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? FileOptions.fromPartial(object.options) : undefined; + message.sourceCodeInfo = object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) : undefined; + message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? 1; + return message; + }, + fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + return message; + }, + toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.package = message.package === "" ? undefined : message.package; + if (message.dependency) { + obj.dependency = message.dependency.map(e => e); + } else { + obj.dependency = message.dependency; + } + if (message.publicDependency) { + obj.public_dependency = message.publicDependency.map(e => e); + } else { + obj.public_dependency = message.publicDependency; + } + if (message.weakDependency) { + obj.weak_dependency = message.weakDependency.map(e => e); + } else { + obj.weak_dependency = message.weakDependency; + } + if (message.messageType) { + obj.message_type = message.messageType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.message_type = message.messageType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.service) { + obj.service = message.service.map(e => e ? ServiceDescriptorProto.toAmino(e) : undefined); + } else { + obj.service = message.service; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + obj.options = message.options ? FileOptions.toAmino(message.options) : undefined; + obj.source_code_info = message.sourceCodeInfo ? SourceCodeInfo.toAmino(message.sourceCodeInfo) : undefined; + obj.syntax = message.syntax === "" ? undefined : message.syntax; + obj.edition = message.edition === 1 ? undefined : message.edition; + return obj; + }, + fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { + return FileDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorProtoProtoMsg): FileDescriptorProto { + return FileDescriptorProto.decode(message.value); + }, + toProto(message: FileDescriptorProto): Uint8Array { + return FileDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorProto): FileDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorProto", + value: FileDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorProto.typeUrl, FileDescriptorProto); +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const DescriptorProto = { + typeUrl: "/google.protobuf.DescriptorProto", + is(o: any): o is DescriptorProto { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.is(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && Array.isArray(o.nestedType) && (!o.nestedType.length || DescriptorProto.is(o.nestedType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.extensionRange) && (!o.extensionRange.length || DescriptorProto_ExtensionRange.is(o.extensionRange[0])) && Array.isArray(o.oneofDecl) && (!o.oneofDecl.length || OneofDescriptorProto.is(o.oneofDecl[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || DescriptorProto_ReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isAmino(o: any): o is DescriptorProtoAmino { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.isAmino(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && Array.isArray(o.nested_type) && (!o.nested_type.length || DescriptorProto.isAmino(o.nested_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.extension_range) && (!o.extension_range.length || DescriptorProto_ExtensionRange.isAmino(o.extension_range[0])) && Array.isArray(o.oneof_decl) && (!o.oneof_decl.length || OneofDescriptorProto.isAmino(o.oneof_decl[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || DescriptorProto_ReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map(e => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map(e => OneofDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? MessageOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: DescriptorProtoAmino): DescriptorProto { + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: DescriptorProto): DescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.field) { + obj.field = message.field.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.field = message.field; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + if (message.nestedType) { + obj.nested_type = message.nestedType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.nested_type = message.nestedType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.extensionRange) { + obj.extension_range = message.extensionRange.map(e => e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined); + } else { + obj.extension_range = message.extensionRange; + } + if (message.oneofDecl) { + obj.oneof_decl = message.oneofDecl.map(e => e ? OneofDescriptorProto.toAmino(e) : undefined); + } else { + obj.oneof_decl = message.oneofDecl; + } + obj.options = message.options ? MessageOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? DescriptorProto_ReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: DescriptorProtoAminoMsg): DescriptorProto { + return DescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProtoProtoMsg): DescriptorProto { + return DescriptorProto.decode(message.value); + }, + toProto(message: DescriptorProto): Uint8Array { + return DescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto): DescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.DescriptorProto", + value: DescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto.typeUrl, DescriptorProto); +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { + start: 0, + end: 0, + options: undefined + }; +} +export const DescriptorProto_ExtensionRange = { + typeUrl: "/google.protobuf.ExtensionRange", + is(o: any): o is DescriptorProto_ExtensionRange { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ExtensionRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = object.options !== undefined && object.options !== null ? ExtensionRangeOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + obj.options = message.options ? ExtensionRangeOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ExtensionRangeAminoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ExtensionRangeProtoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.decode(message.value); + }, + toProto(message: DescriptorProto_ExtensionRange): Uint8Array { + return DescriptorProto_ExtensionRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRange", + value: DescriptorProto_ExtensionRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto_ExtensionRange.typeUrl, DescriptorProto_ExtensionRange); +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { + start: 0, + end: 0 + }; +} +export const DescriptorProto_ReservedRange = { + typeUrl: "/google.protobuf.ReservedRange", + is(o: any): o is DescriptorProto_ReservedRange { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ReservedRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ReservedRangeAminoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ReservedRangeProtoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.decode(message.value); + }, + toProto(message: DescriptorProto_ReservedRange): Uint8Array { + return DescriptorProto_ReservedRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ReservedRange", + value: DescriptorProto_ReservedRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DescriptorProto_ReservedRange.typeUrl, DescriptorProto_ReservedRange); +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { + uninterpretedOption: [], + declaration: [], + features: undefined, + verification: 1 + }; +} +export const ExtensionRangeOptions = { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + is(o: any): o is ExtensionRangeOptions { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0])) && Array.isArray(o.declaration) && (!o.declaration.length || ExtensionRangeOptions_Declaration.is(o.declaration[0])) && isSet(o.verification)); + }, + isAmino(o: any): o is ExtensionRangeOptionsAmino { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0])) && Array.isArray(o.declaration) && (!o.declaration.length || ExtensionRangeOptions_Declaration.isAmino(o.declaration[0])) && isSet(o.verification)); + }, + encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + for (const v of message.declaration) { + ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim(); + } + if (message.verification !== 1) { + writer.uint32(24).int32(message.verification); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + case 2: + message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32())); + break; + case 50: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 3: + message.verification = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + message.declaration = object.declaration?.map(e => ExtensionRangeOptions_Declaration.fromPartial(e)) || []; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.verification = object.verification ?? 1; + return message; + }, + fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + message.declaration = object.declaration?.map(e => ExtensionRangeOptions_Declaration.fromAmino(e)) || []; + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.verification !== undefined && object.verification !== null) { + message.verification = object.verification; + } + return message; + }, + toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + if (message.declaration) { + obj.declaration = message.declaration.map(e => e ? ExtensionRangeOptions_Declaration.toAmino(e) : undefined); + } else { + obj.declaration = message.declaration; + } + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.verification = message.verification === 1 ? undefined : message.verification; + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptionsAminoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptionsProtoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.decode(message.value); + }, + toProto(message: ExtensionRangeOptions): Uint8Array { + return ExtensionRangeOptions.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions): ExtensionRangeOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + value: ExtensionRangeOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionRangeOptions.typeUrl, ExtensionRangeOptions); +function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration { + return { + number: 0, + fullName: "", + type: "", + reserved: false, + repeated: false + }; +} +export const ExtensionRangeOptions_Declaration = { + typeUrl: "/google.protobuf.Declaration", + is(o: any): o is ExtensionRangeOptions_Declaration { + return o && (o.$typeUrl === ExtensionRangeOptions_Declaration.typeUrl || typeof o.number === "number" && typeof o.fullName === "string" && typeof o.type === "string" && typeof o.reserved === "boolean" && typeof o.repeated === "boolean"); + }, + isAmino(o: any): o is ExtensionRangeOptions_DeclarationAmino { + return o && (o.$typeUrl === ExtensionRangeOptions_Declaration.typeUrl || typeof o.number === "number" && typeof o.full_name === "string" && typeof o.type === "string" && typeof o.reserved === "boolean" && typeof o.repeated === "boolean"); + }, + encode(message: ExtensionRangeOptions_Declaration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.number !== 0) { + writer.uint32(8).int32(message.number); + } + if (message.fullName !== "") { + writer.uint32(18).string(message.fullName); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.reserved === true) { + writer.uint32(40).bool(message.reserved); + } + if (message.repeated === true) { + writer.uint32(48).bool(message.repeated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions_Declaration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.number = reader.int32(); + break; + case 2: + message.fullName = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + case 5: + message.reserved = reader.bool(); + break; + case 6: + message.repeated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + message.number = object.number ?? 0; + message.fullName = object.fullName ?? ""; + message.type = object.type ?? ""; + message.reserved = object.reserved ?? false; + message.repeated = object.repeated ?? false; + return message; + }, + fromAmino(object: ExtensionRangeOptions_DeclarationAmino): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.full_name !== undefined && object.full_name !== null) { + message.fullName = object.full_name; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.reserved !== undefined && object.reserved !== null) { + message.reserved = object.reserved; + } + if (object.repeated !== undefined && object.repeated !== null) { + message.repeated = object.repeated; + } + return message; + }, + toAmino(message: ExtensionRangeOptions_Declaration): ExtensionRangeOptions_DeclarationAmino { + const obj: any = {}; + obj.number = message.number === 0 ? undefined : message.number; + obj.full_name = message.fullName === "" ? undefined : message.fullName; + obj.type = message.type === "" ? undefined : message.type; + obj.reserved = message.reserved === false ? undefined : message.reserved; + obj.repeated = message.repeated === false ? undefined : message.repeated; + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptions_DeclarationAminoMsg): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptions_DeclarationProtoMsg): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.decode(message.value); + }, + toProto(message: ExtensionRangeOptions_Declaration): Uint8Array { + return ExtensionRangeOptions_Declaration.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions_Declaration): ExtensionRangeOptions_DeclarationProtoMsg { + return { + typeUrl: "/google.protobuf.Declaration", + value: ExtensionRangeOptions_Declaration.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionRangeOptions_Declaration.typeUrl, ExtensionRangeOptions_Declaration); +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false + }; +} +export const FieldDescriptorProto = { + typeUrl: "/google.protobuf.FieldDescriptorProto", + is(o: any): o is FieldDescriptorProto { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.typeName === "string" && typeof o.extendee === "string" && typeof o.defaultValue === "string" && typeof o.oneofIndex === "number" && typeof o.jsonName === "string" && typeof o.proto3Optional === "boolean"); + }, + isAmino(o: any): o is FieldDescriptorProtoAmino { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.type_name === "string" && typeof o.extendee === "string" && typeof o.default_value === "string" && typeof o.oneof_index === "number" && typeof o.json_name === "string" && typeof o.proto3_optional === "boolean"); + }, + encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = (reader.int32() as any); + break; + case 5: + message.type = (reader.int32() as any); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = object.options !== undefined && object.options !== null ? FieldOptions.fromPartial(object.options) : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, + fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + if (object.proto3_optional !== undefined && object.proto3_optional !== null) { + message.proto3Optional = object.proto3_optional; + } + return message; + }, + toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.label = message.label === 1 ? undefined : message.label; + obj.type = message.type === 1 ? undefined : message.type; + obj.type_name = message.typeName === "" ? undefined : message.typeName; + obj.extendee = message.extendee === "" ? undefined : message.extendee; + obj.default_value = message.defaultValue === "" ? undefined : message.defaultValue; + obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; + obj.json_name = message.jsonName === "" ? undefined : message.jsonName; + obj.options = message.options ? FieldOptions.toAmino(message.options) : undefined; + obj.proto3_optional = message.proto3Optional === false ? undefined : message.proto3Optional; + return obj; + }, + fromAminoMsg(object: FieldDescriptorProtoAminoMsg): FieldDescriptorProto { + return FieldDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FieldDescriptorProtoProtoMsg): FieldDescriptorProto { + return FieldDescriptorProto.decode(message.value); + }, + toProto(message: FieldDescriptorProto): Uint8Array { + return FieldDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FieldDescriptorProto): FieldDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FieldDescriptorProto", + value: FieldDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldDescriptorProto.typeUrl, FieldDescriptorProto); +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { + name: "", + options: undefined + }; +} +export const OneofDescriptorProto = { + typeUrl: "/google.protobuf.OneofDescriptorProto", + is(o: any): o is OneofDescriptorProto { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is OneofDescriptorProtoAmino { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = object.options !== undefined && object.options !== null ? OneofOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.options = message.options ? OneofOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: OneofDescriptorProtoAminoMsg): OneofDescriptorProto { + return OneofDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: OneofDescriptorProtoProtoMsg): OneofDescriptorProto { + return OneofDescriptorProto.decode(message.value); + }, + toProto(message: OneofDescriptorProto): Uint8Array { + return OneofDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: OneofDescriptorProto): OneofDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.OneofDescriptorProto", + value: OneofDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OneofDescriptorProto.typeUrl, OneofDescriptorProto); +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + name: "", + value: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const EnumDescriptorProto = { + typeUrl: "/google.protobuf.EnumDescriptorProto", + is(o: any): o is EnumDescriptorProto { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.is(o.value[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || EnumDescriptorProto_EnumReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isAmino(o: any): o is EnumDescriptorProtoAmino { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.isAmino(o.value[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || EnumDescriptorProto_EnumReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map(e => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? EnumOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.value) { + obj.value = message.value.map(e => e ? EnumValueDescriptorProto.toAmino(e) : undefined); + } else { + obj.value = message.value; + } + obj.options = message.options ? EnumOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: EnumDescriptorProtoAminoMsg): EnumDescriptorProto { + return EnumDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProtoProtoMsg): EnumDescriptorProto { + return EnumDescriptorProto.decode(message.value); + }, + toProto(message: EnumDescriptorProto): Uint8Array { + return EnumDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto): EnumDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumDescriptorProto", + value: EnumDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumDescriptorProto.typeUrl, EnumDescriptorProto); +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { + start: 0, + end: 0 + }; +} +export const EnumDescriptorProto_EnumReservedRange = { + typeUrl: "/google.protobuf.EnumReservedRange", + is(o: any): o is EnumDescriptorProto_EnumReservedRange { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is EnumDescriptorProto_EnumReservedRangeAmino { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: EnumDescriptorProto_EnumReservedRangeAminoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProto_EnumReservedRangeProtoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.decode(message.value); + }, + toProto(message: EnumDescriptorProto_EnumReservedRange): Uint8Array { + return EnumDescriptorProto_EnumReservedRange.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.EnumReservedRange", + value: EnumDescriptorProto_EnumReservedRange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumDescriptorProto_EnumReservedRange.typeUrl, EnumDescriptorProto_EnumReservedRange); +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { + name: "", + number: 0, + options: undefined + }; +} +export const EnumValueDescriptorProto = { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + is(o: any): o is EnumValueDescriptorProto { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + isAmino(o: any): o is EnumValueDescriptorProtoAmino { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = object.options !== undefined && object.options !== null ? EnumValueOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.options = message.options ? EnumValueOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: EnumValueDescriptorProtoAminoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueDescriptorProtoProtoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.decode(message.value); + }, + toProto(message: EnumValueDescriptorProto): Uint8Array { + return EnumValueDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumValueDescriptorProto): EnumValueDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + value: EnumValueDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumValueDescriptorProto.typeUrl, EnumValueDescriptorProto); +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { + name: "", + method: [], + options: undefined + }; +} +export const ServiceDescriptorProto = { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + is(o: any): o is ServiceDescriptorProto { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.is(o.method[0]))); + }, + isAmino(o: any): o is ServiceDescriptorProtoAmino { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.isAmino(o.method[0]))); + }, + encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map(e => MethodDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? ServiceOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.method) { + obj.method = message.method.map(e => e ? MethodDescriptorProto.toAmino(e) : undefined); + } else { + obj.method = message.method; + } + obj.options = message.options ? ServiceOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: ServiceDescriptorProtoAminoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceDescriptorProtoProtoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.decode(message.value); + }, + toProto(message: ServiceDescriptorProto): Uint8Array { + return ServiceDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: ServiceDescriptorProto): ServiceDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + value: ServiceDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ServiceDescriptorProto.typeUrl, ServiceDescriptorProto); +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false + }; +} +export const MethodDescriptorProto = { + typeUrl: "/google.protobuf.MethodDescriptorProto", + is(o: any): o is MethodDescriptorProto { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.inputType === "string" && typeof o.outputType === "string" && typeof o.clientStreaming === "boolean" && typeof o.serverStreaming === "boolean"); + }, + isAmino(o: any): o is MethodDescriptorProtoAmino { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.input_type === "string" && typeof o.output_type === "string" && typeof o.client_streaming === "boolean" && typeof o.server_streaming === "boolean"); + }, + encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = object.options !== undefined && object.options !== null ? MethodOptions.fromPartial(object.options) : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, + fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; + }, + toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.input_type = message.inputType === "" ? undefined : message.inputType; + obj.output_type = message.outputType === "" ? undefined : message.outputType; + obj.options = message.options ? MethodOptions.toAmino(message.options) : undefined; + obj.client_streaming = message.clientStreaming === false ? undefined : message.clientStreaming; + obj.server_streaming = message.serverStreaming === false ? undefined : message.serverStreaming; + return obj; + }, + fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { + return MethodDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: MethodDescriptorProtoProtoMsg): MethodDescriptorProto { + return MethodDescriptorProto.decode(message.value); + }, + toProto(message: MethodDescriptorProto): Uint8Array { + return MethodDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: MethodDescriptorProto): MethodDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.MethodDescriptorProto", + value: MethodDescriptorProto.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MethodDescriptorProto.typeUrl, MethodDescriptorProto); +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + features: undefined, + uninterpretedOption: [] + }; +} +export const FileOptions = { + typeUrl: "/google.protobuf.FileOptions", + is(o: any): o is FileOptions { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.javaPackage === "string" && typeof o.javaOuterClassname === "string" && typeof o.javaMultipleFiles === "boolean" && typeof o.javaGenerateEqualsAndHash === "boolean" && typeof o.javaStringCheckUtf8 === "boolean" && isSet(o.optimizeFor) && typeof o.goPackage === "string" && typeof o.ccGenericServices === "boolean" && typeof o.javaGenericServices === "boolean" && typeof o.pyGenericServices === "boolean" && typeof o.deprecated === "boolean" && typeof o.ccEnableArenas === "boolean" && typeof o.objcClassPrefix === "string" && typeof o.csharpNamespace === "string" && typeof o.swiftPrefix === "string" && typeof o.phpClassPrefix === "string" && typeof o.phpNamespace === "string" && typeof o.phpMetadataNamespace === "string" && typeof o.rubyPackage === "string" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is FileOptionsAmino { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.java_package === "string" && typeof o.java_outer_classname === "string" && typeof o.java_multiple_files === "boolean" && typeof o.java_generate_equals_and_hash === "boolean" && typeof o.java_string_check_utf8 === "boolean" && isSet(o.optimize_for) && typeof o.go_package === "string" && typeof o.cc_generic_services === "boolean" && typeof o.java_generic_services === "boolean" && typeof o.py_generic_services === "boolean" && typeof o.deprecated === "boolean" && typeof o.cc_enable_arenas === "boolean" && typeof o.objc_class_prefix === "string" && typeof o.csharp_namespace === "string" && typeof o.swift_prefix === "string" && typeof o.php_class_prefix === "string" && typeof o.php_namespace === "string" && typeof o.php_metadata_namespace === "string" && typeof o.ruby_package === "string" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = (reader.int32() as any); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 50: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileOptionsAmino): FileOptions { + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = object.optimize_for; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileOptions): FileOptionsAmino { + const obj: any = {}; + obj.java_package = message.javaPackage === "" ? undefined : message.javaPackage; + obj.java_outer_classname = message.javaOuterClassname === "" ? undefined : message.javaOuterClassname; + obj.java_multiple_files = message.javaMultipleFiles === false ? undefined : message.javaMultipleFiles; + obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash === false ? undefined : message.javaGenerateEqualsAndHash; + obj.java_string_check_utf8 = message.javaStringCheckUtf8 === false ? undefined : message.javaStringCheckUtf8; + obj.optimize_for = message.optimizeFor === 1 ? undefined : message.optimizeFor; + obj.go_package = message.goPackage === "" ? undefined : message.goPackage; + obj.cc_generic_services = message.ccGenericServices === false ? undefined : message.ccGenericServices; + obj.java_generic_services = message.javaGenericServices === false ? undefined : message.javaGenericServices; + obj.py_generic_services = message.pyGenericServices === false ? undefined : message.pyGenericServices; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.cc_enable_arenas = message.ccEnableArenas === false ? undefined : message.ccEnableArenas; + obj.objc_class_prefix = message.objcClassPrefix === "" ? undefined : message.objcClassPrefix; + obj.csharp_namespace = message.csharpNamespace === "" ? undefined : message.csharpNamespace; + obj.swift_prefix = message.swiftPrefix === "" ? undefined : message.swiftPrefix; + obj.php_class_prefix = message.phpClassPrefix === "" ? undefined : message.phpClassPrefix; + obj.php_namespace = message.phpNamespace === "" ? undefined : message.phpNamespace; + obj.php_metadata_namespace = message.phpMetadataNamespace === "" ? undefined : message.phpMetadataNamespace; + obj.ruby_package = message.rubyPackage === "" ? undefined : message.rubyPackage; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FileOptionsAminoMsg): FileOptions { + return FileOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FileOptionsProtoMsg): FileOptions { + return FileOptions.decode(message.value); + }, + toProto(message: FileOptions): Uint8Array { + return FileOptions.encode(message).finish(); + }, + toProtoMsg(message: FileOptions): FileOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FileOptions", + value: FileOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileOptions.typeUrl, FileOptions); +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [] + }; +} +export const MessageOptions = { + typeUrl: "/google.protobuf.MessageOptions", + is(o: any): o is MessageOptions { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.messageSetWireFormat === "boolean" && typeof o.noStandardDescriptorAccessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.mapEntry === "boolean" && typeof o.deprecatedLegacyJsonFieldConflicts === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is MessageOptionsAmino { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.message_set_wire_format === "boolean" && typeof o.no_standard_descriptor_accessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.map_entry === "boolean" && typeof o.deprecated_legacy_json_field_conflicts === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 11: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case 12: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MessageOptionsAmino): MessageOptions { + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + if (object.deprecated_legacy_json_field_conflicts !== undefined && object.deprecated_legacy_json_field_conflicts !== null) { + message.deprecatedLegacyJsonFieldConflicts = object.deprecated_legacy_json_field_conflicts; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MessageOptions): MessageOptionsAmino { + const obj: any = {}; + obj.message_set_wire_format = message.messageSetWireFormat === false ? undefined : message.messageSetWireFormat; + obj.no_standard_descriptor_accessor = message.noStandardDescriptorAccessor === false ? undefined : message.noStandardDescriptorAccessor; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; + obj.deprecated_legacy_json_field_conflicts = message.deprecatedLegacyJsonFieldConflicts === false ? undefined : message.deprecatedLegacyJsonFieldConflicts; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MessageOptionsAminoMsg): MessageOptions { + return MessageOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MessageOptionsProtoMsg): MessageOptions { + return MessageOptions.decode(message.value); + }, + toProto(message: MessageOptions): Uint8Array { + return MessageOptions.encode(message).finish(); + }, + toProtoMsg(message: MessageOptions): MessageOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MessageOptions", + value: MessageOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MessageOptions.typeUrl, MessageOptions); +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 1, + packed: false, + jstype: 1, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 1, + targets: [], + editionDefaults: [], + features: undefined, + featureSupport: undefined, + uninterpretedOption: [] + }; +} +export const FieldOptions = { + typeUrl: "/google.protobuf.FieldOptions", + is(o: any): o is FieldOptions { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.unverifiedLazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && typeof o.debugRedact === "boolean" && isSet(o.retention) && Array.isArray(o.targets) && Array.isArray(o.editionDefaults) && (!o.editionDefaults.length || FieldOptions_EditionDefault.is(o.editionDefaults[0])) && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is FieldOptionsAmino { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.unverified_lazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && typeof o.debug_redact === "boolean" && isSet(o.retention) && Array.isArray(o.targets) && Array.isArray(o.edition_defaults) && (!o.edition_defaults.length || FieldOptions_EditionDefault.isAmino(o.edition_defaults[0])) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ctype !== 1) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 1) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy === true) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + if (message.debugRedact === true) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== 1) { + writer.uint32(136).int32(message.retention); + } + writer.uint32(154).fork(); + for (const v of message.targets) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.editionDefaults) { + FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).ldelim(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim(); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = (reader.int32() as any); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = (reader.int32() as any); + break; + case 5: + message.lazy = reader.bool(); + break; + case 15: + message.unverifiedLazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 16: + message.debugRedact = reader.bool(); + break; + case 17: + message.retention = (reader.int32() as any); + break; + case 19: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.targets.push((reader.int32() as any)); + } + } else { + message.targets.push((reader.int32() as any)); + } + break; + case 20: + message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32())); + break; + case 21: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 22: + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 1; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 1; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 1; + message.targets = object.targets?.map(e => e) || []; + message.editionDefaults = object.editionDefaults?.map(e => FieldOptions_EditionDefault.fromPartial(e)) || []; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.featureSupport = object.featureSupport !== undefined && object.featureSupport !== null ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FieldOptionsAmino): FieldOptions { + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.unverified_lazy !== undefined && object.unverified_lazy !== null) { + message.unverifiedLazy = object.unverified_lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + if (object.debug_redact !== undefined && object.debug_redact !== null) { + message.debugRedact = object.debug_redact; + } + if (object.retention !== undefined && object.retention !== null) { + message.retention = object.retention; + } + message.targets = object.targets?.map(e => e) || []; + message.editionDefaults = object.edition_defaults?.map(e => FieldOptions_EditionDefault.fromAmino(e)) || []; + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.feature_support !== undefined && object.feature_support !== null) { + message.featureSupport = FieldOptions_FeatureSupport.fromAmino(object.feature_support); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FieldOptions): FieldOptionsAmino { + const obj: any = {}; + obj.ctype = message.ctype === 1 ? undefined : message.ctype; + obj.packed = message.packed === false ? undefined : message.packed; + obj.jstype = message.jstype === 1 ? undefined : message.jstype; + obj.lazy = message.lazy === false ? undefined : message.lazy; + obj.unverified_lazy = message.unverifiedLazy === false ? undefined : message.unverifiedLazy; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.weak = message.weak === false ? undefined : message.weak; + obj.debug_redact = message.debugRedact === false ? undefined : message.debugRedact; + obj.retention = message.retention === 1 ? undefined : message.retention; + if (message.targets) { + obj.targets = message.targets.map(e => e); + } else { + obj.targets = message.targets; + } + if (message.editionDefaults) { + obj.edition_defaults = message.editionDefaults.map(e => e ? FieldOptions_EditionDefault.toAmino(e) : undefined); + } else { + obj.edition_defaults = message.editionDefaults; + } + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.feature_support = message.featureSupport ? FieldOptions_FeatureSupport.toAmino(message.featureSupport) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FieldOptionsAminoMsg): FieldOptions { + return FieldOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptionsProtoMsg): FieldOptions { + return FieldOptions.decode(message.value); + }, + toProto(message: FieldOptions): Uint8Array { + return FieldOptions.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions): FieldOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FieldOptions", + value: FieldOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions.typeUrl, FieldOptions); +function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault { + return { + edition: 1, + value: "" + }; +} +export const FieldOptions_EditionDefault = { + typeUrl: "/google.protobuf.EditionDefault", + is(o: any): o is FieldOptions_EditionDefault { + return o && (o.$typeUrl === FieldOptions_EditionDefault.typeUrl || isSet(o.edition) && typeof o.value === "string"); + }, + isAmino(o: any): o is FieldOptions_EditionDefaultAmino { + return o && (o.$typeUrl === FieldOptions_EditionDefault.typeUrl || isSet(o.edition) && typeof o.value === "string"); + }, + encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.edition !== 1) { + writer.uint32(24).int32(message.edition); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_EditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.edition = (reader.int32() as any); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + message.edition = object.edition ?? 1; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: FieldOptions_EditionDefaultAmino): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: FieldOptions_EditionDefault): FieldOptions_EditionDefaultAmino { + const obj: any = {}; + obj.edition = message.edition === 1 ? undefined : message.edition; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: FieldOptions_EditionDefaultAminoMsg): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptions_EditionDefaultProtoMsg): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.decode(message.value); + }, + toProto(message: FieldOptions_EditionDefault): Uint8Array { + return FieldOptions_EditionDefault.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions_EditionDefault): FieldOptions_EditionDefaultProtoMsg { + return { + typeUrl: "/google.protobuf.EditionDefault", + value: FieldOptions_EditionDefault.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions_EditionDefault.typeUrl, FieldOptions_EditionDefault); +function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport { + return { + editionIntroduced: 1, + editionDeprecated: 1, + deprecationWarning: "", + editionRemoved: 1 + }; +} +export const FieldOptions_FeatureSupport = { + typeUrl: "/google.protobuf.FeatureSupport", + is(o: any): o is FieldOptions_FeatureSupport { + return o && (o.$typeUrl === FieldOptions_FeatureSupport.typeUrl || isSet(o.editionIntroduced) && isSet(o.editionDeprecated) && typeof o.deprecationWarning === "string" && isSet(o.editionRemoved)); + }, + isAmino(o: any): o is FieldOptions_FeatureSupportAmino { + return o && (o.$typeUrl === FieldOptions_FeatureSupport.typeUrl || isSet(o.edition_introduced) && isSet(o.edition_deprecated) && typeof o.deprecation_warning === "string" && isSet(o.edition_removed)); + }, + encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.editionIntroduced !== 1) { + writer.uint32(8).int32(message.editionIntroduced); + } + if (message.editionDeprecated !== 1) { + writer.uint32(16).int32(message.editionDeprecated); + } + if (message.deprecationWarning !== "") { + writer.uint32(26).string(message.deprecationWarning); + } + if (message.editionRemoved !== 1) { + writer.uint32(32).int32(message.editionRemoved); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_FeatureSupport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.editionIntroduced = (reader.int32() as any); + break; + case 2: + message.editionDeprecated = (reader.int32() as any); + break; + case 3: + message.deprecationWarning = reader.string(); + break; + case 4: + message.editionRemoved = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + message.editionIntroduced = object.editionIntroduced ?? 1; + message.editionDeprecated = object.editionDeprecated ?? 1; + message.deprecationWarning = object.deprecationWarning ?? ""; + message.editionRemoved = object.editionRemoved ?? 1; + return message; + }, + fromAmino(object: FieldOptions_FeatureSupportAmino): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + if (object.edition_introduced !== undefined && object.edition_introduced !== null) { + message.editionIntroduced = object.edition_introduced; + } + if (object.edition_deprecated !== undefined && object.edition_deprecated !== null) { + message.editionDeprecated = object.edition_deprecated; + } + if (object.deprecation_warning !== undefined && object.deprecation_warning !== null) { + message.deprecationWarning = object.deprecation_warning; + } + if (object.edition_removed !== undefined && object.edition_removed !== null) { + message.editionRemoved = object.edition_removed; + } + return message; + }, + toAmino(message: FieldOptions_FeatureSupport): FieldOptions_FeatureSupportAmino { + const obj: any = {}; + obj.edition_introduced = message.editionIntroduced === 1 ? undefined : message.editionIntroduced; + obj.edition_deprecated = message.editionDeprecated === 1 ? undefined : message.editionDeprecated; + obj.deprecation_warning = message.deprecationWarning === "" ? undefined : message.deprecationWarning; + obj.edition_removed = message.editionRemoved === 1 ? undefined : message.editionRemoved; + return obj; + }, + fromAminoMsg(object: FieldOptions_FeatureSupportAminoMsg): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptions_FeatureSupportProtoMsg): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.decode(message.value); + }, + toProto(message: FieldOptions_FeatureSupport): Uint8Array { + return FieldOptions_FeatureSupport.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions_FeatureSupport): FieldOptions_FeatureSupportProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSupport", + value: FieldOptions_FeatureSupport.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FieldOptions_FeatureSupport.typeUrl, FieldOptions_FeatureSupport); +function createBaseOneofOptions(): OneofOptions { + return { + features: undefined, + uninterpretedOption: [] + }; +} +export const OneofOptions = { + typeUrl: "/google.protobuf.OneofOptions", + is(o: any): o is OneofOptions { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is OneofOptionsAmino { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OneofOptions { + const message = createBaseOneofOptions(); + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OneofOptionsAmino): OneofOptions { + const message = createBaseOneofOptions(); + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: OneofOptions): OneofOptionsAmino { + const obj: any = {}; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: OneofOptionsAminoMsg): OneofOptions { + return OneofOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OneofOptionsProtoMsg): OneofOptions { + return OneofOptions.decode(message.value); + }, + toProto(message: OneofOptions): Uint8Array { + return OneofOptions.encode(message).finish(); + }, + toProtoMsg(message: OneofOptions): OneofOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.OneofOptions", + value: OneofOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OneofOptions.typeUrl, OneofOptions); +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [] + }; +} +export const EnumOptions = { + typeUrl: "/google.protobuf.EnumOptions", + is(o: any): o is EnumOptions { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allowAlias === "boolean" && typeof o.deprecated === "boolean" && typeof o.deprecatedLegacyJsonFieldConflicts === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is EnumOptionsAmino { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allow_alias === "boolean" && typeof o.deprecated === "boolean" && typeof o.deprecated_legacy_json_field_conflicts === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 6: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case 7: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumOptionsAmino): EnumOptions { + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.deprecated_legacy_json_field_conflicts !== undefined && object.deprecated_legacy_json_field_conflicts !== null) { + message.deprecatedLegacyJsonFieldConflicts = object.deprecated_legacy_json_field_conflicts; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumOptions): EnumOptionsAmino { + const obj: any = {}; + obj.allow_alias = message.allowAlias === false ? undefined : message.allowAlias; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.deprecated_legacy_json_field_conflicts = message.deprecatedLegacyJsonFieldConflicts === false ? undefined : message.deprecatedLegacyJsonFieldConflicts; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumOptionsAminoMsg): EnumOptions { + return EnumOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumOptionsProtoMsg): EnumOptions { + return EnumOptions.decode(message.value); + }, + toProto(message: EnumOptions): Uint8Array { + return EnumOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumOptions): EnumOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumOptions", + value: EnumOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumOptions.typeUrl, EnumOptions); +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + features: undefined, + debugRedact: false, + featureSupport: undefined, + uninterpretedOption: [] + }; +} +export const EnumValueOptions = { + typeUrl: "/google.protobuf.EnumValueOptions", + is(o: any): o is EnumValueOptions { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && typeof o.debugRedact === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is EnumValueOptionsAmino { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && typeof o.debug_redact === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim(); + } + if (message.debugRedact === true) { + writer.uint32(24).bool(message.debugRedact); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 2: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 3: + message.debugRedact = reader.bool(); + break; + case 4: + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.debugRedact = object.debugRedact ?? false; + message.featureSupport = object.featureSupport !== undefined && object.featureSupport !== null ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.debug_redact !== undefined && object.debug_redact !== null) { + message.debugRedact = object.debug_redact; + } + if (object.feature_support !== undefined && object.feature_support !== null) { + message.featureSupport = FieldOptions_FeatureSupport.fromAmino(object.feature_support); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumValueOptions): EnumValueOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.debug_redact = message.debugRedact === false ? undefined : message.debugRedact; + obj.feature_support = message.featureSupport ? FieldOptions_FeatureSupport.toAmino(message.featureSupport) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumValueOptionsAminoMsg): EnumValueOptions { + return EnumValueOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueOptionsProtoMsg): EnumValueOptions { + return EnumValueOptions.decode(message.value); + }, + toProto(message: EnumValueOptions): Uint8Array { + return EnumValueOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumValueOptions): EnumValueOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueOptions", + value: EnumValueOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnumValueOptions.typeUrl, EnumValueOptions); +function createBaseServiceOptions(): ServiceOptions { + return { + features: undefined, + deprecated: false, + uninterpretedOption: [] + }; +} +export const ServiceOptions = { + typeUrl: "/google.protobuf.ServiceOptions", + is(o: any): o is ServiceOptions { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is ServiceOptionsAmino { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(274).fork()).ldelim(); + } + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 34: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ServiceOptions { + const message = createBaseServiceOptions(); + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ServiceOptionsAmino): ServiceOptions { + const message = createBaseServiceOptions(); + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: ServiceOptions): ServiceOptionsAmino { + const obj: any = {}; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ServiceOptionsAminoMsg): ServiceOptions { + return ServiceOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceOptionsProtoMsg): ServiceOptions { + return ServiceOptions.decode(message.value); + }, + toProto(message: ServiceOptions): Uint8Array { + return ServiceOptions.encode(message).finish(); + }, + toProtoMsg(message: ServiceOptions): ServiceOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceOptions", + value: ServiceOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ServiceOptions.typeUrl, ServiceOptions); +function createBaseMethodOptions(): MethodOptions { + return { + deprecated: false, + idempotencyLevel: 1, + features: undefined, + uninterpretedOption: [] + }; +} +export const MethodOptions = { + typeUrl: "/google.protobuf.MethodOptions", + is(o: any): o is MethodOptions { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotencyLevel) && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isAmino(o: any): o is MethodOptionsAmino { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotency_level) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, + encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 1) { + writer.uint32(272).int32(message.idempotencyLevel); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(282).fork()).ldelim(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = (reader.int32() as any); + break; + case 35: + message.features = FeatureSet.decode(reader, reader.uint32()); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 1; + message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MethodOptionsAmino): MethodOptions { + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + message.idempotencyLevel = object.idempotency_level; + } + if (object.features !== undefined && object.features !== null) { + message.features = FeatureSet.fromAmino(object.features); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MethodOptions): MethodOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.idempotency_level = message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; + obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MethodOptionsAminoMsg): MethodOptions { + return MethodOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MethodOptionsProtoMsg): MethodOptions { + return MethodOptions.decode(message.value); + }, + toProto(message: MethodOptions): Uint8Array { + return MethodOptions.encode(message).finish(); + }, + toProtoMsg(message: MethodOptions): MethodOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MethodOptions", + value: MethodOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MethodOptions.typeUrl, MethodOptions); +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "" + }; +} +export const UninterpretedOption = { + typeUrl: "/google.protobuf.UninterpretedOption", + is(o: any): o is UninterpretedOption { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.is(o.name[0])) && typeof o.identifierValue === "string" && typeof o.positiveIntValue === "bigint" && typeof o.negativeIntValue === "bigint" && typeof o.doubleValue === "number" && (o.stringValue instanceof Uint8Array || typeof o.stringValue === "string") && typeof o.aggregateValue === "string"); + }, + isAmino(o: any): o is UninterpretedOptionAmino { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.isAmino(o.name[0])) && typeof o.identifier_value === "string" && typeof o.positive_int_value === "bigint" && typeof o.negative_int_value === "bigint" && typeof o.double_value === "number" && (o.string_value instanceof Uint8Array || typeof o.string_value === "string") && typeof o.aggregate_value === "string"); + }, + encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== BigInt(0)) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== BigInt(0)) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = object.positiveIntValue !== undefined && object.positiveIntValue !== null ? BigInt(object.positiveIntValue.toString()) : BigInt(0); + message.negativeIntValue = object.negativeIntValue !== undefined && object.negativeIntValue !== null ? BigInt(object.negativeIntValue.toString()) : BigInt(0); + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, + fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; + }, + toAmino(message: UninterpretedOption): UninterpretedOptionAmino { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toAmino(e) : undefined); + } else { + obj.name = message.name; + } + obj.identifier_value = message.identifierValue === "" ? undefined : message.identifierValue; + obj.positive_int_value = message.positiveIntValue !== BigInt(0) ? message.positiveIntValue?.toString() : undefined; + obj.negative_int_value = message.negativeIntValue !== BigInt(0) ? message.negativeIntValue?.toString() : undefined; + obj.double_value = message.doubleValue === 0 ? undefined : message.doubleValue; + obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; + obj.aggregate_value = message.aggregateValue === "" ? undefined : message.aggregateValue; + return obj; + }, + fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { + return UninterpretedOption.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOptionProtoMsg): UninterpretedOption { + return UninterpretedOption.decode(message.value); + }, + toProto(message: UninterpretedOption): Uint8Array { + return UninterpretedOption.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption): UninterpretedOptionProtoMsg { + return { + typeUrl: "/google.protobuf.UninterpretedOption", + value: UninterpretedOption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UninterpretedOption.typeUrl, UninterpretedOption); +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { + namePart: "", + isExtension: false + }; +} +export const UninterpretedOption_NamePart = { + typeUrl: "/google.protobuf.NamePart", + is(o: any): o is UninterpretedOption_NamePart { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.namePart === "string" && typeof o.isExtension === "boolean"); + }, + isAmino(o: any): o is UninterpretedOption_NamePartAmino { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.name_part === "string" && typeof o.is_extension === "boolean"); + }, + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, + fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; + }, + toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { + const obj: any = {}; + obj.name_part = message.namePart === "" ? undefined : message.namePart; + obj.is_extension = message.isExtension === false ? undefined : message.isExtension; + return obj; + }, + fromAminoMsg(object: UninterpretedOption_NamePartAminoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOption_NamePartProtoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.decode(message.value); + }, + toProto(message: UninterpretedOption_NamePart): Uint8Array { + return UninterpretedOption_NamePart.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartProtoMsg { + return { + typeUrl: "/google.protobuf.NamePart", + value: UninterpretedOption_NamePart.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UninterpretedOption_NamePart.typeUrl, UninterpretedOption_NamePart); +function createBaseFeatureSet(): FeatureSet { + return { + fieldPresence: 1, + enumType: 1, + repeatedFieldEncoding: 1, + utf8Validation: 0, + messageEncoding: 1, + jsonFormat: 1 + }; +} +export const FeatureSet = { + typeUrl: "/google.protobuf.FeatureSet", + is(o: any): o is FeatureSet { + return o && (o.$typeUrl === FeatureSet.typeUrl || isSet(o.fieldPresence) && isSet(o.enumType) && isSet(o.repeatedFieldEncoding) && isSet(o.utf8Validation) && isSet(o.messageEncoding) && isSet(o.jsonFormat)); + }, + isAmino(o: any): o is FeatureSetAmino { + return o && (o.$typeUrl === FeatureSet.typeUrl || isSet(o.field_presence) && isSet(o.enum_type) && isSet(o.repeated_field_encoding) && isSet(o.utf8_validation) && isSet(o.message_encoding) && isSet(o.json_format)); + }, + encode(message: FeatureSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fieldPresence !== 1) { + writer.uint32(8).int32(message.fieldPresence); + } + if (message.enumType !== 1) { + writer.uint32(16).int32(message.enumType); + } + if (message.repeatedFieldEncoding !== 1) { + writer.uint32(24).int32(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== 0) { + writer.uint32(32).int32(message.utf8Validation); + } + if (message.messageEncoding !== 1) { + writer.uint32(40).int32(message.messageEncoding); + } + if (message.jsonFormat !== 1) { + writer.uint32(48).int32(message.jsonFormat); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fieldPresence = (reader.int32() as any); + break; + case 2: + message.enumType = (reader.int32() as any); + break; + case 3: + message.repeatedFieldEncoding = (reader.int32() as any); + break; + case 4: + message.utf8Validation = (reader.int32() as any); + break; + case 5: + message.messageEncoding = (reader.int32() as any); + break; + case 6: + message.jsonFormat = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSet { + const message = createBaseFeatureSet(); + message.fieldPresence = object.fieldPresence ?? 1; + message.enumType = object.enumType ?? 1; + message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 1; + message.utf8Validation = object.utf8Validation ?? 0; + message.messageEncoding = object.messageEncoding ?? 1; + message.jsonFormat = object.jsonFormat ?? 1; + return message; + }, + fromAmino(object: FeatureSetAmino): FeatureSet { + const message = createBaseFeatureSet(); + if (object.field_presence !== undefined && object.field_presence !== null) { + message.fieldPresence = object.field_presence; + } + if (object.enum_type !== undefined && object.enum_type !== null) { + message.enumType = object.enum_type; + } + if (object.repeated_field_encoding !== undefined && object.repeated_field_encoding !== null) { + message.repeatedFieldEncoding = object.repeated_field_encoding; + } + if (object.utf8_validation !== undefined && object.utf8_validation !== null) { + message.utf8Validation = object.utf8_validation; + } + if (object.message_encoding !== undefined && object.message_encoding !== null) { + message.messageEncoding = object.message_encoding; + } + if (object.json_format !== undefined && object.json_format !== null) { + message.jsonFormat = object.json_format; + } + return message; + }, + toAmino(message: FeatureSet): FeatureSetAmino { + const obj: any = {}; + obj.field_presence = message.fieldPresence === 1 ? undefined : message.fieldPresence; + obj.enum_type = message.enumType === 1 ? undefined : message.enumType; + obj.repeated_field_encoding = message.repeatedFieldEncoding === 1 ? undefined : message.repeatedFieldEncoding; + obj.utf8_validation = message.utf8Validation === 0 ? undefined : message.utf8Validation; + obj.message_encoding = message.messageEncoding === 1 ? undefined : message.messageEncoding; + obj.json_format = message.jsonFormat === 1 ? undefined : message.jsonFormat; + return obj; + }, + fromAminoMsg(object: FeatureSetAminoMsg): FeatureSet { + return FeatureSet.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetProtoMsg): FeatureSet { + return FeatureSet.decode(message.value); + }, + toProto(message: FeatureSet): Uint8Array { + return FeatureSet.encode(message).finish(); + }, + toProtoMsg(message: FeatureSet): FeatureSetProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSet", + value: FeatureSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSet.typeUrl, FeatureSet); +function createBaseFeatureSetDefaults(): FeatureSetDefaults { + return { + defaults: [], + minimumEdition: 1, + maximumEdition: 1 + }; +} +export const FeatureSetDefaults = { + typeUrl: "/google.protobuf.FeatureSetDefaults", + is(o: any): o is FeatureSetDefaults { + return o && (o.$typeUrl === FeatureSetDefaults.typeUrl || Array.isArray(o.defaults) && (!o.defaults.length || FeatureSetDefaults_FeatureSetEditionDefault.is(o.defaults[0])) && isSet(o.minimumEdition) && isSet(o.maximumEdition)); + }, + isAmino(o: any): o is FeatureSetDefaultsAmino { + return o && (o.$typeUrl === FeatureSetDefaults.typeUrl || Array.isArray(o.defaults) && (!o.defaults.length || FeatureSetDefaults_FeatureSetEditionDefault.isAmino(o.defaults[0])) && isSet(o.minimum_edition) && isSet(o.maximum_edition)); + }, + encode(message: FeatureSetDefaults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.defaults) { + FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.minimumEdition !== 1) { + writer.uint32(32).int32(message.minimumEdition); + } + if (message.maximumEdition !== 1) { + writer.uint32(40).int32(message.maximumEdition); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + case 4: + message.minimumEdition = (reader.int32() as any); + break; + case 5: + message.maximumEdition = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map(e => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || []; + message.minimumEdition = object.minimumEdition ?? 1; + message.maximumEdition = object.maximumEdition ?? 1; + return message; + }, + fromAmino(object: FeatureSetDefaultsAmino): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map(e => FeatureSetDefaults_FeatureSetEditionDefault.fromAmino(e)) || []; + if (object.minimum_edition !== undefined && object.minimum_edition !== null) { + message.minimumEdition = object.minimum_edition; + } + if (object.maximum_edition !== undefined && object.maximum_edition !== null) { + message.maximumEdition = object.maximum_edition; + } + return message; + }, + toAmino(message: FeatureSetDefaults): FeatureSetDefaultsAmino { + const obj: any = {}; + if (message.defaults) { + obj.defaults = message.defaults.map(e => e ? FeatureSetDefaults_FeatureSetEditionDefault.toAmino(e) : undefined); + } else { + obj.defaults = message.defaults; + } + obj.minimum_edition = message.minimumEdition === 1 ? undefined : message.minimumEdition; + obj.maximum_edition = message.maximumEdition === 1 ? undefined : message.maximumEdition; + return obj; + }, + fromAminoMsg(object: FeatureSetDefaultsAminoMsg): FeatureSetDefaults { + return FeatureSetDefaults.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetDefaultsProtoMsg): FeatureSetDefaults { + return FeatureSetDefaults.decode(message.value); + }, + toProto(message: FeatureSetDefaults): Uint8Array { + return FeatureSetDefaults.encode(message).finish(); + }, + toProtoMsg(message: FeatureSetDefaults): FeatureSetDefaultsProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSetDefaults", + value: FeatureSetDefaults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSetDefaults.typeUrl, FeatureSetDefaults); +function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault { + return { + edition: 1, + overridableFeatures: undefined, + fixedFeatures: undefined + }; +} +export const FeatureSetDefaults_FeatureSetEditionDefault = { + typeUrl: "/google.protobuf.FeatureSetEditionDefault", + is(o: any): o is FeatureSetDefaults_FeatureSetEditionDefault { + return o && (o.$typeUrl === FeatureSetDefaults_FeatureSetEditionDefault.typeUrl || isSet(o.edition)); + }, + isAmino(o: any): o is FeatureSetDefaults_FeatureSetEditionDefaultAmino { + return o && (o.$typeUrl === FeatureSetDefaults_FeatureSetEditionDefault.typeUrl || isSet(o.edition)); + }, + encode(message: FeatureSetDefaults_FeatureSetEditionDefault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.edition !== 1) { + writer.uint32(24).int32(message.edition); + } + if (message.overridableFeatures !== undefined) { + FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).ldelim(); + } + if (message.fixedFeatures !== undefined) { + FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.edition = (reader.int32() as any); + break; + case 4: + message.overridableFeatures = FeatureSet.decode(reader, reader.uint32()); + break; + case 5: + message.fixedFeatures = FeatureSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + message.edition = object.edition ?? 1; + message.overridableFeatures = object.overridableFeatures !== undefined && object.overridableFeatures !== null ? FeatureSet.fromPartial(object.overridableFeatures) : undefined; + message.fixedFeatures = object.fixedFeatures !== undefined && object.fixedFeatures !== null ? FeatureSet.fromPartial(object.fixedFeatures) : undefined; + return message; + }, + fromAmino(object: FeatureSetDefaults_FeatureSetEditionDefaultAmino): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + if (object.edition !== undefined && object.edition !== null) { + message.edition = object.edition; + } + if (object.overridable_features !== undefined && object.overridable_features !== null) { + message.overridableFeatures = FeatureSet.fromAmino(object.overridable_features); + } + if (object.fixed_features !== undefined && object.fixed_features !== null) { + message.fixedFeatures = FeatureSet.fromAmino(object.fixed_features); + } + return message; + }, + toAmino(message: FeatureSetDefaults_FeatureSetEditionDefault): FeatureSetDefaults_FeatureSetEditionDefaultAmino { + const obj: any = {}; + obj.edition = message.edition === 1 ? undefined : message.edition; + obj.overridable_features = message.overridableFeatures ? FeatureSet.toAmino(message.overridableFeatures) : undefined; + obj.fixed_features = message.fixedFeatures ? FeatureSet.toAmino(message.fixedFeatures) : undefined; + return obj; + }, + fromAminoMsg(object: FeatureSetDefaults_FeatureSetEditionDefaultAminoMsg): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.decode(message.value); + }, + toProto(message: FeatureSetDefaults_FeatureSetEditionDefault): Uint8Array { + return FeatureSetDefaults_FeatureSetEditionDefault.encode(message).finish(); + }, + toProtoMsg(message: FeatureSetDefaults_FeatureSetEditionDefault): FeatureSetDefaults_FeatureSetEditionDefaultProtoMsg { + return { + typeUrl: "/google.protobuf.FeatureSetEditionDefault", + value: FeatureSetDefaults_FeatureSetEditionDefault.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeatureSetDefaults_FeatureSetEditionDefault.typeUrl, FeatureSetDefaults_FeatureSetEditionDefault); +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { + location: [] + }; +} +export const SourceCodeInfo = { + typeUrl: "/google.protobuf.SourceCodeInfo", + is(o: any): o is SourceCodeInfo { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.is(o.location[0]))); + }, + isAmino(o: any): o is SourceCodeInfoAmino { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.isAmino(o.location[0]))); + }, + encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; + }, + toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toAmino(e) : undefined); + } else { + obj.location = message.location; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfoAminoMsg): SourceCodeInfo { + return SourceCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfoProtoMsg): SourceCodeInfo { + return SourceCodeInfo.decode(message.value); + }, + toProto(message: SourceCodeInfo): Uint8Array { + return SourceCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo): SourceCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.SourceCodeInfo", + value: SourceCodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SourceCodeInfo.typeUrl, SourceCodeInfo); +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + path: [], + span: [], + leadingComments: "", + trailingComments: "", + leadingDetachedComments: [] + }; +} +export const SourceCodeInfo_Location = { + typeUrl: "/google.protobuf.Location", + is(o: any): o is SourceCodeInfo_Location { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leadingComments === "string" && typeof o.trailingComments === "string" && Array.isArray(o.leadingDetachedComments) && (!o.leadingDetachedComments.length || typeof o.leadingDetachedComments[0] === "string")); + }, + isAmino(o: any): o is SourceCodeInfo_LocationAmino { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leading_comments === "string" && typeof o.trailing_comments === "string" && Array.isArray(o.leading_detached_comments) && (!o.leading_detached_comments.length || typeof o.leading_detached_comments[0] === "string")); + }, + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + 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.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map(e => e) || []; + return message; + }, + fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; + }, + toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + if (message.span) { + obj.span = message.span.map(e => e); + } else { + obj.span = message.span; + } + obj.leading_comments = message.leadingComments === "" ? undefined : message.leadingComments; + obj.trailing_comments = message.trailingComments === "" ? undefined : message.trailingComments; + if (message.leadingDetachedComments) { + obj.leading_detached_comments = message.leadingDetachedComments.map(e => e); + } else { + obj.leading_detached_comments = message.leadingDetachedComments; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfo_LocationAminoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfo_LocationProtoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.decode(message.value); + }, + toProto(message: SourceCodeInfo_Location): Uint8Array { + return SourceCodeInfo_Location.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo_Location): SourceCodeInfo_LocationProtoMsg { + return { + typeUrl: "/google.protobuf.Location", + value: SourceCodeInfo_Location.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SourceCodeInfo_Location.typeUrl, SourceCodeInfo_Location); +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { + annotation: [] + }; +} +export const GeneratedCodeInfo = { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + is(o: any): o is GeneratedCodeInfo { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.is(o.annotation[0]))); + }, + isAmino(o: any): o is GeneratedCodeInfoAmino { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.isAmino(o.annotation[0]))); + }, + encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; + }, + toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined); + } else { + obj.annotation = message.annotation; + } + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfoAminoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfoProtoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.decode(message.value); + }, + toProto(message: GeneratedCodeInfo): Uint8Array { + return GeneratedCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo): GeneratedCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + value: GeneratedCodeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo.typeUrl, GeneratedCodeInfo); +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { + path: [], + sourceFile: "", + begin: 0, + end: 0, + semantic: 1 + }; +} +export const GeneratedCodeInfo_Annotation = { + typeUrl: "/google.protobuf.Annotation", + is(o: any): o is GeneratedCodeInfo_Annotation { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.sourceFile === "string" && typeof o.begin === "number" && typeof o.end === "number" && isSet(o.semantic)); + }, + isAmino(o: any): o is GeneratedCodeInfo_AnnotationAmino { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.source_file === "string" && typeof o.begin === "number" && typeof o.end === "number" && isSet(o.semantic)); + }, + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + if (message.semantic !== 1) { + writer.uint32(40).int32(message.semantic); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + 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.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + case 5: + message.semantic = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + message.semantic = object.semantic ?? 1; + return message; + }, + fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.semantic !== undefined && object.semantic !== null) { + message.semantic = object.semantic; + } + return message; + }, + toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + obj.source_file = message.sourceFile === "" ? undefined : message.sourceFile; + obj.begin = message.begin === 0 ? undefined : message.begin; + obj.end = message.end === 0 ? undefined : message.end; + obj.semantic = message.semantic === 1 ? undefined : message.semantic; + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfo_AnnotationAminoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfo_AnnotationProtoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.decode(message.value); + }, + toProto(message: GeneratedCodeInfo_Annotation): Uint8Array { + return GeneratedCodeInfo_Annotation.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationProtoMsg { + return { + typeUrl: "/google.protobuf.Annotation", + value: GeneratedCodeInfo_Annotation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo_Annotation.typeUrl, GeneratedCodeInfo_Annotation); \ No newline at end of file diff --git a/libs/injectivejs/src/google/protobuf/duration.ts b/libs/injectivejs/src/google/protobuf/duration.ts new file mode 100644 index 00000000..6e3e301a --- /dev/null +++ b/libs/injectivejs/src/google/protobuf/duration.ts @@ -0,0 +1,225 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} +export interface DurationProtoMsg { + typeUrl: "/google.protobuf.Duration"; + value: Uint8Array; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export type DurationAmino = string; +export interface DurationAminoMsg { + type: "/google.protobuf.Duration"; + value: DurationAmino; +} +function createBaseDuration(): Duration { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Duration = { + typeUrl: "/google.protobuf.Duration", + is(o: any): o is Duration { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is DurationAmino { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: DurationAmino): Duration { + const value = BigInt(object); + return { + seconds: value / BigInt("1000000000"), + nanos: Number(value % BigInt("1000000000")) + }; + }, + toAmino(message: Duration): DurationAmino { + return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString(); + }, + fromAminoMsg(object: DurationAminoMsg): Duration { + return Duration.fromAmino(object.value); + }, + fromProtoMsg(message: DurationProtoMsg): Duration { + return Duration.decode(message.value); + }, + toProto(message: Duration): Uint8Array { + return Duration.encode(message).finish(); + }, + toProtoMsg(message: Duration): DurationProtoMsg { + return { + typeUrl: "/google.protobuf.Duration", + value: Duration.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Duration.typeUrl, Duration); \ No newline at end of file diff --git a/libs/injectivejs/src/google/protobuf/timestamp.ts b/libs/injectivejs/src/google/protobuf/timestamp.ts new file mode 100644 index 00000000..d4d255b3 --- /dev/null +++ b/libs/injectivejs/src/google/protobuf/timestamp.ts @@ -0,0 +1,281 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} +export interface TimestampProtoMsg { + typeUrl: "/google.protobuf.Timestamp"; + value: Uint8Array; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export type TimestampAmino = string; +export interface TimestampAminoMsg { + type: "/google.protobuf.Timestamp"; + value: TimestampAmino; +} +function createBaseTimestamp(): Timestamp { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Timestamp = { + typeUrl: "/google.protobuf.Timestamp", + is(o: any): o is Timestamp { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is TimestampAmino { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: TimestampAmino): Timestamp { + return fromJsonTimestamp(object); + }, + toAmino(message: Timestamp): TimestampAmino { + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); + }, + fromAminoMsg(object: TimestampAminoMsg): Timestamp { + return Timestamp.fromAmino(object.value); + }, + fromProtoMsg(message: TimestampProtoMsg): Timestamp { + return Timestamp.decode(message.value); + }, + toProto(message: Timestamp): Uint8Array { + return Timestamp.encode(message).finish(); + }, + toProtoMsg(message: Timestamp): TimestampProtoMsg { + return { + typeUrl: "/google.protobuf.Timestamp", + value: Timestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Timestamp.typeUrl, Timestamp); \ No newline at end of file diff --git a/libs/injectivejs/src/helper-func-types.ts b/libs/injectivejs/src/helper-func-types.ts new file mode 100644 index 00000000..89c4980f --- /dev/null +++ b/libs/injectivejs/src/helper-func-types.ts @@ -0,0 +1,191 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +import { HttpEndpoint } from "@interchainjs/types"; +import { BinaryReader, BinaryWriter } from "./binary"; +import { getRpcClient } from "./extern"; +import { isRpc, Rpc } from "./helpers"; + +export interface QueryBuilderOptions { + encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter + decode: (input: BinaryReader | Uint8Array, length?: number) => TRes + service: string, + method: string, + clientResolver?: RpcResolver +} + +export function buildQuery(opts: QueryBuilderOptions) { + return async (request: TReq) => { + let rpc: Rpc | undefined; + + if(isRpc(opts.clientResolver)) { + rpc = opts.clientResolver; + } else { + rpc = opts.clientResolver ? await getRpcClient(opts.clientResolver) : undefined; + } + + if (!rpc) throw new Error("Query Rpc is not initialized"); + + const data = opts.encode(request).finish(); + const response = await rpc.request(opts.service, opts.method, data); + return opts.decode(response); + }; +} + +export interface ITxArgs { + signerAddress: string; + message: TMsg; + fee: StdFee | 'auto'; + memo: string; +} + +export function isISigningClient(client: unknown): client is ISigningClient { + return client !== null && client !== undefined + && typeof (client as ISigningClient).signAndBroadcast === 'function' + && typeof (client as ISigningClient).addConverters === 'function' + && typeof (client as ISigningClient).addEncoders === 'function'; +} + +export interface ISigningClient { + /** + * register converters + */ + addConverters: (converters: AminoConverter[]) => void; + /** + * register encoders + */ + addEncoders: (encoders: Encoder[]) => void; + + signAndBroadcast: ( + signerAddress: string, + message: Message[], + fee: StdFee | 'auto', + memo: string + ) => Promise; +} + +export interface TxBuilderOptions { + clientResolver?: SigningClientResolver, + typeUrl: string, + encoders?: Encoder[], + converters?: AminoConverter[], +} + +export function buildTx(opts: TxBuilderOptions) { + return async ( + signerAddress: string, + message: TMsg, + fee: StdFee | 'auto', + memo: string + ): Promise => { + let client: ISigningClient | undefined; + + // if opts.getSigningClient is a function, call it to get the SigningClient instance + if(isISigningClient(opts.clientResolver)) { + client = opts.clientResolver; + } + + if (!client) throw new Error("SigningClient is not initialized"); + + //register all related encoders and converters + client.addEncoders(opts.encoders ?? []); + client.addConverters(opts.converters ?? []); + + const data = [ + { + typeUrl: opts.typeUrl, + value: message, + }, + ]; + return client.signAndBroadcast!(signerAddress, data, fee, memo); + }; +} + +export interface Coin { + denom: string; + amount: string; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +export interface Message { + typeUrl: string; + value: T; +} + +export interface Encoder { + typeUrl: string; + fromPartial: (data: any) => any; + encode: (data: any) => Uint8Array; +} + +export interface AminoConverter { + typeUrl: string; + aminoType: string; + fromAmino: (data: any) => any; + toAmino: (data: any) => any; +} + +export type SigningClientResolver = string | HttpEndpoint | ISigningClient; +export type RpcResolver = string | HttpEndpoint | Rpc ; diff --git a/libs/injectivejs/src/helpers.ts b/libs/injectivejs/src/helpers.ts new file mode 100644 index 00000000..1179995a --- /dev/null +++ b/libs/injectivejs/src/helpers.ts @@ -0,0 +1,259 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== 'undefined') return globalThis; + if (typeof self !== 'undefined') return self; + if (typeof window !== 'undefined') return window; + if (typeof global !== 'undefined') return global; + throw 'Unable to locate global object'; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); + +export function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); + +export function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return btoa(bin.join('')); +} + +export interface AminoHeight { + readonly revision_number?: string; + readonly revision_height?: string; +} + +export function omitDefault( + input: T +): T | undefined { + if (typeof input === 'string') { + return input === '' ? undefined : input; + } + + if (typeof input === 'number') { + return input === 0 ? undefined : input; + } + + if (typeof input === "boolean"){ + return input === false ? undefined : input; + } + + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input; + } + + throw new Error(`Got unsupported type ${typeof input}`); +} + +interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + + nanos: number; +} + +export function toDuration(duration: string): Duration { + return { + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000 + }; +} + +export function fromDuration(duration: Duration): string { + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString(); +} + +export function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export function isObject(value: any): boolean { + return typeof value === 'object' && value !== null; +} + +export interface PageRequest { + key: Uint8Array; + offset: bigint; + limit: bigint; + countTotal: boolean; + reverse: boolean; +} + +export interface PageRequestParams { + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; +} + +export interface Params { + params: PageRequestParams; +} + +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { + if (!pagination) { + return options; + } + + if (typeof pagination?.countTotal !== 'undefined') { + options.params['pagination.count_total'] = pagination.countTotal; + } + if (typeof pagination?.key !== 'undefined') { + // String to Uint8Array + // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); + + // Uint8Array to String + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ); + } + if (typeof pagination?.limit !== 'undefined') { + options.params['pagination.limit'] = pagination.limit.toString(); + } + if (typeof pagination?.offset !== 'undefined') { + options.params['pagination.offset'] = pagination.offset.toString(); + } + if (typeof pagination?.reverse !== 'undefined') { + options.params['pagination.reverse'] = pagination.reverse; + } + + return options; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + >; + +export interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +export function isRpc(rpc: unknown): rpc is Rpc { + return rpc !== null && rpc !== undefined && typeof (rpc as Rpc).request === 'function'; +} + +interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + + nanos: number; +} + +export function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1000) * 1000000; + return { + seconds, + nanos + }; +} + +export function fromTimestamp(t: Timestamp): Date { + let millis = Number(t.seconds) * 1000; + millis += t.nanos / 1000000; + return new Date(millis); +} + +const timestampFromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; +}; + +export function fromJsonTimestamp(o: any): Timestamp { + if (o instanceof Date) { + return toTimestamp(o); + } else if (typeof o === 'string') { + return toTimestamp(new Date(o)); + } else { + return timestampFromJSON(o); + } +} + +function numberToLong(number: number) { + return BigInt(Math.trunc(number)); +} + diff --git a/libs/injectivejs/src/ibc/applications/transfer/v1/transfer.ts b/libs/injectivejs/src/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 00000000..12d6526c --- /dev/null +++ b/libs/injectivejs/src/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,373 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Params"; + value: Uint8Array; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsAmino { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + send_enabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receive_enabled: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface Forwarding { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: Hop[]; +} +export interface ForwardingProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Forwarding"; + value: Uint8Array; +} +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface ForwardingAmino { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: HopAmino[]; +} +export interface ForwardingAminoMsg { + type: "cosmos-sdk/Forwarding"; + value: ForwardingAmino; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface Hop { + portId: string; + channelId: string; +} +export interface HopProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Hop"; + value: Uint8Array; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface HopAmino { + port_id: string; + channel_id: string; +} +export interface HopAminoMsg { + type: "cosmos-sdk/Hop"; + value: HopAmino; +} +function createBaseParams(): Params { + return { + sendEnabled: false, + receiveEnabled: false + }; +} +export const Params = { + typeUrl: "/ibc.applications.transfer.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.sendEnabled === "boolean" && typeof o.receiveEnabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.send_enabled === "boolean" && typeof o.receive_enabled === "boolean"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + 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.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled ?? false; + message.receiveEnabled = object.receiveEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.send_enabled = message.sendEnabled === false ? undefined : message.sendEnabled; + obj.receive_enabled = message.receiveEnabled === false ? undefined : message.receiveEnabled; + 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.applications.transfer.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseForwarding(): Forwarding { + return { + unwind: false, + hops: [] + }; +} +export const Forwarding = { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + aminoType: "cosmos-sdk/Forwarding", + is(o: any): o is Forwarding { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.is(o.hops[0]))); + }, + isAmino(o: any): o is ForwardingAmino { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.isAmino(o.hops[0]))); + }, + encode(message: Forwarding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unwind === true) { + writer.uint32(8).bool(message.unwind); + } + for (const v of message.hops) { + Hop.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Forwarding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForwarding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unwind = reader.bool(); + break; + case 2: + message.hops.push(Hop.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Forwarding { + const message = createBaseForwarding(); + message.unwind = object.unwind ?? false; + message.hops = object.hops?.map(e => Hop.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ForwardingAmino): Forwarding { + const message = createBaseForwarding(); + if (object.unwind !== undefined && object.unwind !== null) { + message.unwind = object.unwind; + } + message.hops = object.hops?.map(e => Hop.fromAmino(e)) || []; + return message; + }, + toAmino(message: Forwarding): ForwardingAmino { + const obj: any = {}; + obj.unwind = message.unwind === false ? undefined : message.unwind; + if (message.hops) { + obj.hops = message.hops.map(e => e ? Hop.toAmino(e) : undefined); + } else { + obj.hops = message.hops; + } + return obj; + }, + fromAminoMsg(object: ForwardingAminoMsg): Forwarding { + return Forwarding.fromAmino(object.value); + }, + toAminoMsg(message: Forwarding): ForwardingAminoMsg { + return { + type: "cosmos-sdk/Forwarding", + value: Forwarding.toAmino(message) + }; + }, + fromProtoMsg(message: ForwardingProtoMsg): Forwarding { + return Forwarding.decode(message.value); + }, + toProto(message: Forwarding): Uint8Array { + return Forwarding.encode(message).finish(); + }, + toProtoMsg(message: Forwarding): ForwardingProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + value: Forwarding.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Forwarding.typeUrl, Forwarding); +GlobalDecoderRegistry.registerAminoProtoMapping(Forwarding.aminoType, Forwarding.typeUrl); +function createBaseHop(): Hop { + return { + portId: "", + channelId: "" + }; +} +export const Hop = { + typeUrl: "/ibc.applications.transfer.v1.Hop", + aminoType: "cosmos-sdk/Hop", + is(o: any): o is Hop { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is HopAmino { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: Hop, 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): Hop { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHop(); + 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: DeepPartial): Hop { + const message = createBaseHop(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: HopAmino): Hop { + const message = createBaseHop(); + 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: Hop): HopAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: HopAminoMsg): Hop { + return Hop.fromAmino(object.value); + }, + toAminoMsg(message: Hop): HopAminoMsg { + return { + type: "cosmos-sdk/Hop", + value: Hop.toAmino(message) + }; + }, + fromProtoMsg(message: HopProtoMsg): Hop { + return Hop.decode(message.value); + }, + toProto(message: Hop): Uint8Array { + return Hop.encode(message).finish(); + }, + toProtoMsg(message: Hop): HopProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Hop", + value: Hop.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Hop.typeUrl, Hop); +GlobalDecoderRegistry.registerAminoProtoMapping(Hop.aminoType, Hop.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/applications/transfer/v1/tx.rpc.func.ts b/libs/injectivejs/src/ibc/applications/transfer/v1/tx.rpc.func.ts new file mode 100644 index 00000000..72028384 --- /dev/null +++ b/libs/injectivejs/src/ibc/applications/transfer/v1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const createTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransfer.typeUrl, + encoders: toEncoders(MsgTransfer), + converters: toConverters(MsgTransfer) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/applications/transfer/v1/tx.ts b/libs/injectivejs/src/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 00000000..f4fb581c --- /dev/null +++ b/libs/injectivejs/src/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,569 @@ +import { Coin, CoinAmino } from "../../../../cosmos/base/v1beta1/coin"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../../core/client/v1/client"; +import { Forwarding, ForwardingAmino } from "./transfer"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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 + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the token to be transferred. this field has been replaced by the tokens field. */ + /** @deprecated */ + token: Coin; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Height; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint; + /** optional memo */ + memo: string; + /** tokens to be transferred */ + tokens: Coin[]; + /** optional forwarding information */ + forwarding?: Forwarding; +} +export interface MsgTransferProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; + value: Uint8Array; +} +/** + * 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 + */ +export interface MsgTransferAmino { + /** the port on which the packet will be sent */ + source_port: string; + /** the channel by which the packet will be sent */ + source_channel: string; + /** the token to be transferred. this field has been replaced by the tokens field. */ + /** @deprecated */ + token: CoinAmino; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height: HeightAmino; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeout_timestamp: string; + /** optional memo */ + memo: string; + /** tokens to be transferred */ + tokens: CoinAmino[]; + /** optional forwarding information */ + forwarding?: ForwardingAmino; +} +export interface MsgTransferAminoMsg { + type: "cosmos-sdk/MsgTransfer"; + value: MsgTransferAmino; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse { + /** sequence number of the transfer packet sent */ + sequence: bigint; +} +export interface MsgTransferResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; + value: Uint8Array; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino { + /** sequence number of the transfer packet sent */ + sequence: string; +} +export interface MsgTransferResponseAminoMsg { + type: "cosmos-sdk/MsgTransferResponse"; + value: MsgTransferResponseAmino; +} +/** 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; +} +/** + * 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; +} +function createBaseMsgTransfer(): MsgTransfer { + return { + sourcePort: "", + sourceChannel: "", + token: Coin.fromPartial({}), + sender: "", + receiver: "", + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0), + memo: "", + tokens: [], + forwarding: undefined + }; +} +export const MsgTransfer = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + aminoType: "cosmos-sdk/MsgTransfer", + is(o: any): o is MsgTransfer { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && Coin.is(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint" && typeof o.memo === "string" && Array.isArray(o.tokens) && (!o.tokens.length || Coin.is(o.tokens[0]))); + }, + isAmino(o: any): o is MsgTransferAmino { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Coin.isAmino(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint" && typeof o.memo === "string" && Array.isArray(o.tokens) && (!o.tokens.length || Coin.isAmino(o.tokens[0]))); + }, + encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + if (message.memo !== "") { + writer.uint32(66).string(message.memo); + } + for (const v of message.tokens) { + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.forwarding !== undefined) { + Forwarding.encode(message.forwarding, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransfer(); + 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.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + case 8: + message.memo = reader.string(); + break; + case 9: + message.tokens.push(Coin.decode(reader, reader.uint32())); + break; + case 10: + message.forwarding = Forwarding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransfer { + const message = createBaseMsgTransfer(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.token = object.token !== undefined && object.token !== null ? Coin.fromPartial(object.token) : undefined; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + message.memo = object.memo ?? ""; + message.tokens = object.tokens?.map(e => Coin.fromPartial(e)) || []; + message.forwarding = object.forwarding !== undefined && object.forwarding !== null ? Forwarding.fromPartial(object.forwarding) : undefined; + return message; + }, + fromAmino(object: MsgTransferAmino): MsgTransfer { + const message = createBaseMsgTransfer(); + 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; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + message.tokens = object.tokens?.map(e => Coin.fromAmino(e)) || []; + if (object.forwarding !== undefined && object.forwarding !== null) { + message.forwarding = Forwarding.fromAmino(object.forwarding); + } + return message; + }, + toAmino(message: MsgTransfer): MsgTransferAmino { + 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) : 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) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp?.toString() : undefined; + obj.memo = message.memo === "" ? undefined : message.memo; + if (message.tokens) { + obj.tokens = message.tokens.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.tokens = message.tokens; + } + obj.forwarding = message.forwarding ? Forwarding.toAmino(message.forwarding) : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { + return MsgTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransfer): MsgTransferAminoMsg { + return { + type: "cosmos-sdk/MsgTransfer", + value: MsgTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferProtoMsg): MsgTransfer { + return MsgTransfer.decode(message.value); + }, + toProto(message: MsgTransfer): Uint8Array { + return MsgTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgTransfer): MsgTransferProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransfer.typeUrl, MsgTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransfer.aminoType, MsgTransfer.typeUrl); +function createBaseMsgTransferResponse(): MsgTransferResponse { + return { + sequence: BigInt(0) + }; +} +export const MsgTransferResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + aminoType: "cosmos-sdk/MsgTransferResponse", + is(o: any): o is MsgTransferResponse { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MsgTransferResponseAmino { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + encode(message: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferResponse(); + 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: DeepPartial): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgTransferResponseAmino): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { + return MsgTransferResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferResponse): MsgTransferResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTransferResponse", + value: MsgTransferResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferResponseProtoMsg): MsgTransferResponse { + return MsgTransferResponse.decode(message.value); + }, + toProto(message: MsgTransferResponse): Uint8Array { + return MsgTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferResponse): MsgTransferResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + value: MsgTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferResponse.typeUrl, MsgTransferResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferResponse.aminoType, MsgTransferResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/channel/v1/channel.ts b/libs/injectivejs/src/ibc/core/channel/v1/channel.ts new file mode 100644 index 00000000..6965c083 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1510 @@ +import { Height, HeightAmino } from "../../client/v1/client"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * 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 StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + 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: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + 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"; + } +} +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} +export const OrderAmino = Order; +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + case Order.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + 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"; + value: Uint8Array; +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelAmino { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + 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"; + value: ChannelAmino; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + 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"; + value: Uint8Array; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelAmino { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + 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"; + value: IdentifiedChannelAmino; +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.channel.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartyAmino { + /** port on the counterparty chain which owns the other end of the channel. */ + port_id: string; + /** channel end on the counterparty chain */ + channel_id: string; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: bigint; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: bigint; +} +export interface PacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.Packet"; + value: Uint8Array; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketAmino { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: string; + /** identifies the port on the sending chain. */ + source_port: string; + /** identifies the channel end on the sending chain. */ + source_channel: string; + /** identifies the port on the receiving chain. */ + destination_port: string; + /** identifies the channel end on the receiving chain. */ + destination_channel: string; + /** actual opaque bytes transferred directly to the application module */ + data: string; + /** block height after which the packet times out */ + timeout_height: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeout_timestamp: string; +} +export interface PacketAminoMsg { + type: "cosmos-sdk/Packet"; + value: PacketAmino; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: bigint; + /** embedded data that represents packet state. */ + data: Uint8Array; +} +export interface PacketStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketState"; + value: Uint8Array; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateAmino { + /** channel port identifier. */ + port_id: string; + /** channel unique identifier. */ + channel_id: string; + /** packet sequence. */ + sequence: string; + /** embedded data that represents packet state. */ + data: string; +} +export interface PacketStateAminoMsg { + type: "cosmos-sdk/PacketState"; + value: PacketStateAmino; +} +/** + * PacketId is an identifier for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketId { + /** channel port identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface PacketIdProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketId"; + value: Uint8Array; +} +/** + * PacketId is an identifier for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketIdAmino { + /** channel port identifier */ + port_id: string; + /** channel unique identifier */ + channel_id: string; + /** packet sequence */ + sequence: string; +} +export interface PacketIdAminoMsg { + type: "cosmos-sdk/PacketId"; + value: PacketIdAmino; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result?: Uint8Array; + error?: string; +} +export interface AcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.Acknowledgement"; + value: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementAmino { + result?: string; + error?: string; +} +export interface AcknowledgementAminoMsg { + type: "cosmos-sdk/Acknowledgement"; + value: AcknowledgementAmino; +} +/** + * 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; +} +/** 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; +} +function createBaseChannel(): Channel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + upgradeSequence: BigInt(0) + }; +} +export const Channel = { + typeUrl: "/ibc.core.channel.v1.Channel", + aminoType: "cosmos-sdk/Channel", + is(o: any): o is Channel { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is ChannelAmino { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.upgrade_sequence === "bigint"); + }, + encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Channel { + const message = createBaseChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + 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 { + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + 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 { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + 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 { + return Channel.fromAmino(object.value); + }, + toAminoMsg(message: Channel): ChannelAminoMsg { + return { + type: "cosmos-sdk/Channel", + value: Channel.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelProtoMsg): Channel { + return Channel.decode(message.value); + }, + toProto(message: Channel): Uint8Array { + return Channel.encode(message).finish(); + }, + toProtoMsg(message: Channel): ChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Channel", + value: Channel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Channel.typeUrl, Channel); +GlobalDecoderRegistry.registerAminoProtoMapping(Channel.aminoType, Channel.typeUrl); +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + portId: "", + channelId: "", + upgradeSequence: BigInt(0) + }; +} +export const IdentifiedChannel = { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + aminoType: "cosmos-sdk/IdentifiedChannel", + is(o: any): o is IdentifiedChannel { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is IdentifiedChannelAmino { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.upgrade_sequence === "bigint"); + }, + encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + case 8: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + 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.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 { + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + 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.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; + }, + toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + 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 { + return IdentifiedChannel.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { + return { + type: "cosmos-sdk/IdentifiedChannel", + value: IdentifiedChannel.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { + return IdentifiedChannel.decode(message.value); + }, + toProto(message: IdentifiedChannel): Uint8Array { + return IdentifiedChannel.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + value: IdentifiedChannel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedChannel.typeUrl, IdentifiedChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedChannel.aminoType, IdentifiedChannel.typeUrl); +function createBaseCounterparty(): Counterparty { + return { + portId: "", + channelId: "" + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.channel.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: Counterparty, 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): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + 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: DeepPartial): Counterparty { + const message = createBaseCounterparty(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + 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: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); +function createBasePacket(): Packet { + return { + sequence: BigInt(0), + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + data: new Uint8Array(), + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + }; +} +export const Packet = { + typeUrl: "/ibc.core.channel.v1.Packet", + aminoType: "cosmos-sdk/Packet", + is(o: any): o is Packet { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && typeof o.destinationPort === "string" && typeof o.destinationChannel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint"); + }, + isAmino(o: any): o is PacketAmino { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.source_port === "string" && typeof o.source_channel === "string" && typeof o.destination_port === "string" && typeof o.destination_channel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint"); + }, + encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Packet { + const message = createBasePacket(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.destinationPort = object.destinationPort ?? ""; + message.destinationChannel = object.destinationChannel ?? ""; + message.data = object.data ?? new Uint8Array(); + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketAmino): Packet { + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + 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; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; + }, + toAmino(message: Packet): PacketAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + obj.destination_port = message.destinationPort === "" ? undefined : message.destinationPort; + obj.destination_channel = message.destinationChannel === "" ? undefined : message.destinationChannel; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketAminoMsg): Packet { + return Packet.fromAmino(object.value); + }, + toAminoMsg(message: Packet): PacketAminoMsg { + return { + type: "cosmos-sdk/Packet", + value: Packet.toAmino(message) + }; + }, + fromProtoMsg(message: PacketProtoMsg): Packet { + return Packet.decode(message.value); + }, + toProto(message: Packet): Uint8Array { + return Packet.encode(message).finish(); + }, + toProtoMsg(message: Packet): PacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Packet", + value: Packet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Packet.typeUrl, Packet); +GlobalDecoderRegistry.registerAminoProtoMapping(Packet.aminoType, Packet.typeUrl); +function createBasePacketState(): PacketState { + return { + portId: "", + channelId: "", + sequence: BigInt(0), + data: new Uint8Array() + }; +} +export const PacketState = { + typeUrl: "/ibc.core.channel.v1.PacketState", + aminoType: "cosmos-sdk/PacketState", + is(o: any): o is PacketState { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is PacketStateAmino { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: PacketState, 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.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketState(); + 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.sequence = reader.uint64(); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PacketState { + const message = createBasePacketState(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketStateAmino): PacketState { + const message = createBasePacketState(); + 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.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: PacketState): PacketStateAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: PacketStateAminoMsg): PacketState { + return PacketState.fromAmino(object.value); + }, + toAminoMsg(message: PacketState): PacketStateAminoMsg { + return { + type: "cosmos-sdk/PacketState", + value: PacketState.toAmino(message) + }; + }, + fromProtoMsg(message: PacketStateProtoMsg): PacketState { + return PacketState.decode(message.value); + }, + toProto(message: PacketState): Uint8Array { + return PacketState.encode(message).finish(); + }, + toProtoMsg(message: PacketState): PacketStateProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketState", + value: PacketState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PacketState.typeUrl, PacketState); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketState.aminoType, PacketState.typeUrl); +function createBasePacketId(): PacketId { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const PacketId = { + typeUrl: "/ibc.core.channel.v1.PacketId", + aminoType: "cosmos-sdk/PacketId", + is(o: any): o is PacketId { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is PacketIdAmino { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + encode(message: PacketId, 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.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketId(); + 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.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PacketId { + const message = createBasePacketId(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketIdAmino): PacketId { + const message = createBasePacketId(); + 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.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: PacketId): PacketIdAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketIdAminoMsg): PacketId { + return PacketId.fromAmino(object.value); + }, + toAminoMsg(message: PacketId): PacketIdAminoMsg { + return { + type: "cosmos-sdk/PacketId", + value: PacketId.toAmino(message) + }; + }, + fromProtoMsg(message: PacketIdProtoMsg): PacketId { + return PacketId.decode(message.value); + }, + toProto(message: PacketId): Uint8Array { + return PacketId.encode(message).finish(); + }, + toProtoMsg(message: PacketId): PacketIdProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketId", + value: PacketId.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PacketId.typeUrl, PacketId); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketId.aminoType, PacketId.typeUrl); +function createBaseAcknowledgement(): Acknowledgement { + return { + result: undefined, + error: undefined + }; +} +export const Acknowledgement = { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + aminoType: "cosmos-sdk/Acknowledgement", + is(o: any): o is Acknowledgement { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + isAmino(o: any): o is AcknowledgementAmino { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Acknowledgement { + const message = createBaseAcknowledgement(); + message.result = object.result ?? undefined; + message.error = object.error ?? undefined; + return message; + }, + fromAmino(object: AcknowledgementAmino): Acknowledgement { + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: Acknowledgement): AcknowledgementAmino { + const obj: any = {}; + obj.result = message.result ? base64FromBytes(message.result) : undefined; + obj.error = message.error === null ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { + return Acknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { + return { + type: "cosmos-sdk/Acknowledgement", + value: Acknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { + return Acknowledgement.decode(message.value); + }, + toProto(message: Acknowledgement): Uint8Array { + return Acknowledgement.encode(message).finish(); + }, + toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + value: Acknowledgement.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Acknowledgement.typeUrl, Acknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(Acknowledgement.aminoType, Acknowledgement.typeUrl); +function createBaseTimeout(): Timeout { + return { + height: Height.fromPartial({}), + timestamp: BigInt(0) + }; +} +export const Timeout = { + typeUrl: "/ibc.core.channel.v1.Timeout", + aminoType: "cosmos-sdk/Timeout", + is(o: any): o is Timeout { + return o && (o.$typeUrl === Timeout.typeUrl || Height.is(o.height) && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is TimeoutAmino { + return o && (o.$typeUrl === Timeout.typeUrl || Height.isAmino(o.height) && typeof o.timestamp === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Timeout.typeUrl, Timeout); +GlobalDecoderRegistry.registerAminoProtoMapping(Timeout.aminoType, Timeout.typeUrl); +function createBaseParams(): Params { + return { + upgradeTimeout: Timeout.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/ibc.core.channel.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Timeout.is(o.upgradeTimeout)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Timeout.isAmino(o.upgrade_timeout)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/channel/v1/tx.rpc.func.ts b/libs/injectivejs/src/ibc/core/channel/v1/tx.rpc.func.ts new file mode 100644 index 00000000..92917fb9 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/channel/v1/tx.rpc.func.ts @@ -0,0 +1,117 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const createChannelOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenInit.typeUrl, + encoders: toEncoders(MsgChannelOpenInit), + converters: toConverters(MsgChannelOpenInit) +}); +export const createChannelOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenTry.typeUrl, + encoders: toEncoders(MsgChannelOpenTry), + converters: toConverters(MsgChannelOpenTry) +}); +export const createChannelOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenAck.typeUrl, + encoders: toEncoders(MsgChannelOpenAck), + converters: toConverters(MsgChannelOpenAck) +}); +export const createChannelOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelOpenConfirm.typeUrl, + encoders: toEncoders(MsgChannelOpenConfirm), + converters: toConverters(MsgChannelOpenConfirm) +}); +export const createChannelCloseInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseInit.typeUrl, + encoders: toEncoders(MsgChannelCloseInit), + converters: toConverters(MsgChannelCloseInit) +}); +export const createChannelCloseConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelCloseConfirm.typeUrl, + encoders: toEncoders(MsgChannelCloseConfirm), + converters: toConverters(MsgChannelCloseConfirm) +}); +export const createRecvPacket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecvPacket.typeUrl, + encoders: toEncoders(MsgRecvPacket), + converters: toConverters(MsgRecvPacket) +}); +export const createTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeout.typeUrl, + encoders: toEncoders(MsgTimeout), + converters: toConverters(MsgTimeout) +}); +export const createTimeoutOnClose = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTimeoutOnClose.typeUrl, + encoders: toEncoders(MsgTimeoutOnClose), + converters: toConverters(MsgTimeoutOnClose) +}); +export const createAcknowledgement = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcknowledgement.typeUrl, + encoders: toEncoders(MsgAcknowledgement), + converters: toConverters(MsgAcknowledgement) +}); +export const createChannelUpgradeInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeInit.typeUrl, + encoders: toEncoders(MsgChannelUpgradeInit), + converters: toConverters(MsgChannelUpgradeInit) +}); +export const createChannelUpgradeTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTry.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTry), + converters: toConverters(MsgChannelUpgradeTry) +}); +export const createChannelUpgradeAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeAck.typeUrl, + encoders: toEncoders(MsgChannelUpgradeAck), + converters: toConverters(MsgChannelUpgradeAck) +}); +export const createChannelUpgradeConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeConfirm.typeUrl, + encoders: toEncoders(MsgChannelUpgradeConfirm), + converters: toConverters(MsgChannelUpgradeConfirm) +}); +export const createChannelUpgradeOpen = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeOpen.typeUrl, + encoders: toEncoders(MsgChannelUpgradeOpen), + converters: toConverters(MsgChannelUpgradeOpen) +}); +export const createChannelUpgradeTimeout = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeTimeout.typeUrl, + encoders: toEncoders(MsgChannelUpgradeTimeout), + converters: toConverters(MsgChannelUpgradeTimeout) +}); +export const createChannelUpgradeCancel = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChannelUpgradeCancel.typeUrl, + encoders: toEncoders(MsgChannelUpgradeCancel), + converters: toConverters(MsgChannelUpgradeCancel) +}); +export const createUpdateChannelParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createPruneAcknowledgements = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPruneAcknowledgements.typeUrl, + encoders: toEncoders(MsgPruneAcknowledgements), + converters: toConverters(MsgPruneAcknowledgements) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/channel/v1/tx.ts b/libs/injectivejs/src/ibc/core/channel/v1/tx.ts new file mode 100644 index 00000000..b7023355 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/channel/v1/tx.ts @@ -0,0 +1,4866 @@ +import { Channel, ChannelAmino, Packet, PacketAmino, State } from "./channel"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client"; +import { UpgradeFields, UpgradeFieldsAmino, Upgrade, UpgradeAmino, ErrorReceipt, ErrorReceiptAmino } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** ResponseResultType defines the possible outcomes of the execution of a message */ +export enum ResponseResultType { + /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0, + /** RESPONSE_RESULT_TYPE_NOOP - The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) */ + 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 ResponseResultTypeAmino = ResponseResultType; +export function responseResultTypeFromJSON(object: any): ResponseResultType { + switch (object) { + case 0: + case "RESPONSE_RESULT_TYPE_UNSPECIFIED": + return ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED; + case 1: + case "RESPONSE_RESULT_TYPE_NOOP": + return ResponseResultType.RESPONSE_RESULT_TYPE_NOOP; + 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: + return ResponseResultType.UNRECOGNIZED; + } +} +export function responseResultTypeToJSON(object: ResponseResultType): string { + switch (object) { + case ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED: + return "RESPONSE_RESULT_TYPE_UNSPECIFIED"; + case ResponseResultType.RESPONSE_RESULT_TYPE_NOOP: + 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"; + } +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string; + channel: Channel; + signer: string; +} +export interface MsgChannelOpenInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitAmino { + port_id: string; + channel: ChannelAmino; + signer: string; +} +export interface MsgChannelOpenInitAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInit"; + value: MsgChannelOpenInitAmino; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse { + channelId: string; + version: string; +} +export interface MsgChannelOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; + value: Uint8Array; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseAmino { + channel_id: string; + version: string; +} +export interface MsgChannelOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInitResponse"; + value: MsgChannelOpenInitResponseAmino; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTry { + portId: string; + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + previousChannelId: string; + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: Channel; + counterpartyVersion: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTryAmino { + port_id: string; + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + previous_channel_id: string; + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: ChannelAmino; + counterparty_version: string; + proof_init: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenTryAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTry"; + value: MsgChannelOpenTryAmino; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse { + version: string; + channelId: string; +} +export interface MsgChannelOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; + value: Uint8Array; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseAmino { + version: string; + channel_id: string; +} +export interface MsgChannelOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTryResponse"; + value: MsgChannelOpenTryResponseAmino; +} +/** + * 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; + channelId: string; + counterpartyChannelId: string; + counterpartyVersion: string; + proofTry: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck"; + value: Uint8Array; +} +/** + * 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; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenAckAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAck"; + value: MsgChannelOpenAckAmino; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse {} +export interface MsgChannelOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse"; + value: Uint8Array; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseAmino {} +export interface MsgChannelOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAckResponse"; + value: MsgChannelOpenAckResponseAmino; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string; + channelId: string; + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmAmino { + port_id: string; + channel_id: string; + proof_ack: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgChannelOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirm"; + value: MsgChannelOpenConfirmAmino; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponse {} +export interface MsgChannelOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseAmino {} +export interface MsgChannelOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse"; + value: MsgChannelOpenConfirmResponseAmino; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string; + channelId: string; + signer: string; +} +export interface MsgChannelCloseInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit"; + value: Uint8Array; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitAmino { + port_id: string; + channel_id: string; + signer: string; +} +export interface MsgChannelCloseInitAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInit"; + value: MsgChannelCloseInitAmino; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse {} +export interface MsgChannelCloseInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse"; + value: Uint8Array; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseAmino {} +export interface MsgChannelCloseInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInitResponse"; + value: MsgChannelCloseInitResponseAmino; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string; + channelId: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; + counterpartyUpgradeSequence: bigint; +} +export interface MsgChannelCloseConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmAmino { + port_id: string; + channel_id: string; + proof_init: string; + proof_height: HeightAmino; + signer: string; + counterparty_upgrade_sequence: string; +} +export interface MsgChannelCloseConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirm"; + value: MsgChannelCloseConfirmAmino; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponse {} +export interface MsgChannelCloseConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseAmino {} +export interface MsgChannelCloseConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse"; + value: MsgChannelCloseConfirmResponseAmino; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet: Packet; + proofCommitment: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgRecvPacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket"; + value: Uint8Array; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketAmino { + packet: PacketAmino; + proof_commitment: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgRecvPacketAminoMsg { + type: "cosmos-sdk/MsgRecvPacket"; + value: MsgRecvPacketAmino; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse { + result: ResponseResultType; +} +export interface MsgRecvPacketResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; + value: Uint8Array; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseAmino { + result: ResponseResultType; +} +export interface MsgRecvPacketResponseAminoMsg { + type: "cosmos-sdk/MsgRecvPacketResponse"; + value: MsgRecvPacketResponseAmino; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet; + proofUnreceived: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; +} +export interface MsgTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeout"; + value: Uint8Array; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutAmino { + packet: PacketAmino; + proof_unreceived: string; + proof_height: HeightAmino; + next_sequence_recv: string; + signer: string; +} +export interface MsgTimeoutAminoMsg { + type: "cosmos-sdk/MsgTimeout"; + value: MsgTimeoutAmino; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse { + result: ResponseResultType; +} +export interface MsgTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; + value: Uint8Array; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseAmino { + result: ResponseResultType; +} +export interface MsgTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutResponse"; + value: MsgTimeoutResponseAmino; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; + counterpartyUpgradeSequence: bigint; +} +export interface MsgTimeoutOnCloseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; + value: Uint8Array; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseAmino { + packet: PacketAmino; + proof_unreceived: string; + proof_close: string; + proof_height: HeightAmino; + next_sequence_recv: string; + signer: string; + counterparty_upgrade_sequence: string; +} +export interface MsgTimeoutOnCloseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnClose"; + value: MsgTimeoutOnCloseAmino; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse { + result: ResponseResultType; +} +export interface MsgTimeoutOnCloseResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; + value: Uint8Array; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseAmino { + result: ResponseResultType; +} +export interface MsgTimeoutOnCloseResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; + value: MsgTimeoutOnCloseResponseAmino; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet: Packet; + acknowledgement: Uint8Array; + proofAcked: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgAcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement"; + value: Uint8Array; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementAmino { + packet: PacketAmino; + acknowledgement: string; + proof_acked: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgAcknowledgementAminoMsg { + type: "cosmos-sdk/MsgAcknowledgement"; + value: MsgAcknowledgementAmino; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse { + result: ResponseResultType; +} +export interface MsgAcknowledgementResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseAmino { + result: ResponseResultType; +} +export interface MsgAcknowledgementResponseAminoMsg { + type: "cosmos-sdk/MsgAcknowledgementResponse"; + value: MsgAcknowledgementResponseAmino; +} +/** + * 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponse {} +export interface MsgChannelUpgradeTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseAmino {} +export interface MsgChannelUpgradeTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; + value: MsgChannelUpgradeTimeoutResponseAmino; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { + return { + portId: "", + channel: Channel.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + aminoType: "cosmos-sdk/MsgChannelOpenInit", + is(o: any): o is MsgChannelOpenInit { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.portId === "string" && Channel.is(o.channel) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitAmino { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.port_id === "string" && Channel.isAmino(o.channel) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + message.portId = object.portId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenInit): MsgChannelOpenInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitAminoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInit", + value: MsgChannelOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitProtoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.decode(message.value); + }, + toProto(message: MsgChannelOpenInit): Uint8Array { + return MsgChannelOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenInit.typeUrl, MsgChannelOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInit.aminoType, MsgChannelOpenInit.typeUrl); +function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { + return { + channelId: "", + version: "" + }; +} +export const MsgChannelOpenInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + aminoType: "cosmos-sdk/MsgChannelOpenInitResponse", + is(o: any): o is MsgChannelOpenInitResponse { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channelId === "string" && typeof o.version === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channel_id === "string" && typeof o.version === "string"); + }, + encode(message: MsgChannelOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + message.channelId = object.channelId ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenInitResponseAmino): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAmino { + const obj: any = {}; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitResponseAminoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitResponseProtoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenInitResponse): Uint8Array { + return MsgChannelOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenInitResponse.typeUrl, MsgChannelOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInitResponse.aminoType, MsgChannelOpenInitResponse.typeUrl); +function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { + return { + portId: "", + previousChannelId: "", + channel: Channel.fromPartial({}), + counterpartyVersion: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + aminoType: "cosmos-sdk/MsgChannelOpenTry", + is(o: any): o is MsgChannelOpenTry { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.portId === "string" && typeof o.previousChannelId === "string" && Channel.is(o.channel) && typeof o.counterpartyVersion === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryAmino { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.port_id === "string" && typeof o.previous_channel_id === "string" && Channel.isAmino(o.channel) && typeof o.counterparty_version === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.previousChannelId !== "") { + writer.uint32(18).string(message.previousChannelId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit); + } + 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): MsgChannelOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = 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: DeepPartial): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + message.portId = object.portId ?? ""; + message.previousChannelId = object.previousChannelId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { + message.previousChannelId = object.previous_channel_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + 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: MsgChannelOpenTry): MsgChannelOpenTryAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.previous_channel_id = message.previousChannelId === "" ? undefined : message.previousChannelId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + 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; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenTryAminoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTry", + value: MsgChannelOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryProtoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.decode(message.value); + }, + toProto(message: MsgChannelOpenTry): Uint8Array { + return MsgChannelOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenTry.typeUrl, MsgChannelOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTry.aminoType, MsgChannelOpenTry.typeUrl); +function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { + return { + version: "", + channelId: "" + }; +} +export const MsgChannelOpenTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + aminoType: "cosmos-sdk/MsgChannelOpenTryResponse", + is(o: any): o is MsgChannelOpenTryResponse { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channel_id === "string"); + }, + encode(message: MsgChannelOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + message.version = object.version ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + 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 { + return MsgChannelOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryResponseProtoMsg): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenTryResponse): Uint8Array { + return MsgChannelOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenTryResponse.typeUrl, MsgChannelOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTryResponse.aminoType, MsgChannelOpenTryResponse.typeUrl); +function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { + return { + portId: "", + channelId: "", + counterpartyChannelId: "", + counterpartyVersion: "", + proofTry: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + aminoType: "cosmos-sdk/MsgChannelOpenAck", + is(o: any): o is MsgChannelOpenAck { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.counterpartyChannelId === "string" && typeof o.counterpartyVersion === "string" && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenAckAmino { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.counterparty_channel_id === "string" && typeof o.counterparty_version === "string" && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenAck, 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.counterpartyChannelId !== "") { + writer.uint32(26).string(message.counterpartyChannelId); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry); + } + 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): MsgChannelOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAck(); + 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.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = 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: DeepPartial): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelId = object.counterpartyChannelId ?? ""; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + 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_id !== undefined && object.counterparty_channel_id !== null) { + message.counterpartyChannelId = object.counterparty_channel_id; + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + 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: MsgChannelOpenAck): MsgChannelOpenAckAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel_id = message.counterpartyChannelId === "" ? undefined : message.counterpartyChannelId; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckAminoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAck", + value: MsgChannelOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckProtoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.decode(message.value); + }, + toProto(message: MsgChannelOpenAck): Uint8Array { + return MsgChannelOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenAck.typeUrl, MsgChannelOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAck.aminoType, MsgChannelOpenAck.typeUrl); +function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { + return {}; +} +export const MsgChannelOpenAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + aminoType: "cosmos-sdk/MsgChannelOpenAckResponse", + is(o: any): o is MsgChannelOpenAckResponse { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenAckResponseAmino { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + encode(_: MsgChannelOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckResponseAminoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckResponseProtoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenAckResponse): Uint8Array { + return MsgChannelOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenAckResponse.typeUrl, MsgChannelOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAckResponse.aminoType, MsgChannelOpenAckResponse.typeUrl); +function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { + return { + portId: "", + channelId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + aminoType: "cosmos-sdk/MsgChannelOpenConfirm", + is(o: any): o is MsgChannelOpenConfirm { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenConfirmAmino { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelOpenConfirm, 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.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirm(); + 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.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + 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.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + 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: MsgChannelOpenConfirm): MsgChannelOpenConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmAminoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmProtoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirm): Uint8Array { + return MsgChannelOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenConfirm.typeUrl, MsgChannelOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirm.aminoType, MsgChannelOpenConfirm.typeUrl); +function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmResponse { + return {}; +} +export const MsgChannelOpenConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelOpenConfirmResponse", + is(o: any): o is MsgChannelOpenConfirmResponse { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + encode(_: MsgChannelOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenConfirmResponseAmino): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmResponseAminoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmResponseProtoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirmResponse): Uint8Array { + return MsgChannelOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelOpenConfirmResponse.typeUrl, MsgChannelOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirmResponse.aminoType, MsgChannelOpenConfirmResponse.typeUrl); +function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { + return { + portId: "", + channelId: "", + signer: "" + }; +} +export const MsgChannelCloseInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + aminoType: "cosmos-sdk/MsgChannelCloseInit", + is(o: any): o is MsgChannelCloseInit { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelCloseInitAmino { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgChannelCloseInit, 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.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInit(); + 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.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + 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.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelCloseInit): MsgChannelCloseInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitAminoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInit", + value: MsgChannelCloseInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitProtoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.decode(message.value); + }, + toProto(message: MsgChannelCloseInit): Uint8Array { + return MsgChannelCloseInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseInit.typeUrl, MsgChannelCloseInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInit.aminoType, MsgChannelCloseInit.typeUrl); +function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { + return {}; +} +export const MsgChannelCloseInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + aminoType: "cosmos-sdk/MsgChannelCloseInitResponse", + is(o: any): o is MsgChannelCloseInitResponse { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseInitResponseAmino { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + encode(_: MsgChannelCloseInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitResponseAminoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitResponseProtoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseInitResponse): Uint8Array { + return MsgChannelCloseInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseInitResponse.typeUrl, MsgChannelCloseInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInitResponse.aminoType, MsgChannelCloseInitResponse.typeUrl); +function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { + return { + portId: "", + channelId: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "", + counterpartyUpgradeSequence: BigInt(0) + }; +} +export const MsgChannelCloseConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + aminoType: "cosmos-sdk/MsgChannelCloseConfirm", + is(o: any): o is MsgChannelCloseConfirm { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelCloseConfirmAmino { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + encode(message: MsgChannelCloseConfirm, 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.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirm(); + 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.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + case 6: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + 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 { + const message = createBaseMsgChannelCloseConfirm(); + 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.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + 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; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; + }, + toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + 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 { + return MsgChannelCloseConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmProtoMsg): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirm): Uint8Array { + return MsgChannelCloseConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseConfirm.typeUrl, MsgChannelCloseConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirm.aminoType, MsgChannelCloseConfirm.typeUrl); +function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmResponse { + return {}; +} +export const MsgChannelCloseConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelCloseConfirmResponse", + is(o: any): o is MsgChannelCloseConfirmResponse { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + encode(_: MsgChannelCloseConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseConfirmResponseAmino): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseConfirmResponseAminoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmResponseProtoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirmResponse): Uint8Array { + return MsgChannelCloseConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelCloseConfirmResponse.typeUrl, MsgChannelCloseConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirmResponse.aminoType, MsgChannelCloseConfirmResponse.typeUrl); +function createBaseMsgRecvPacket(): MsgRecvPacket { + return { + packet: Packet.fromPartial({}), + proofCommitment: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgRecvPacket = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + aminoType: "cosmos-sdk/MsgRecvPacket", + is(o: any): o is MsgRecvPacket { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.is(o.packet) && (o.proofCommitment instanceof Uint8Array || typeof o.proofCommitment === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecvPacketAmino { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.isAmino(o.packet) && (o.proof_commitment instanceof Uint8Array || typeof o.proof_commitment === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgRecvPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofCommitment = object.proofCommitment ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_commitment !== undefined && object.proof_commitment !== null) { + message.proofCommitment = bytesFromBase64(object.proof_commitment); + } + 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: MsgRecvPacket): MsgRecvPacketAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_commitment = message.proofCommitment ? base64FromBytes(message.proofCommitment) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketAminoMsg): MsgRecvPacket { + return MsgRecvPacket.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacket): MsgRecvPacketAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacket", + value: MsgRecvPacket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketProtoMsg): MsgRecvPacket { + return MsgRecvPacket.decode(message.value); + }, + toProto(message: MsgRecvPacket): Uint8Array { + return MsgRecvPacket.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacket): MsgRecvPacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecvPacket.typeUrl, MsgRecvPacket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacket.aminoType, MsgRecvPacket.typeUrl); +function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { + return { + result: 0 + }; +} +export const MsgRecvPacketResponse = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + aminoType: "cosmos-sdk/MsgRecvPacketResponse", + is(o: any): o is MsgRecvPacketResponse { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgRecvPacketResponseAmino { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgRecvPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacketResponse(); + 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: DeepPartial): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacketResponse", + value: MsgRecvPacketResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketResponseProtoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.decode(message.value); + }, + toProto(message: MsgRecvPacketResponse): Uint8Array { + return MsgRecvPacketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + value: MsgRecvPacketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecvPacketResponse.typeUrl, MsgRecvPacketResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacketResponse.aminoType, MsgRecvPacketResponse.typeUrl); +function createBaseMsgTimeout(): MsgTimeout { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "" + }; +} +export const MsgTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + aminoType: "cosmos-sdk/MsgTimeout", + is(o: any): o is MsgTimeout { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgTimeoutAmino { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string"); + }, + encode(message: MsgTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(32).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTimeout { + const message = createBaseMsgTimeout(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + 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 ?? ""; + return message; + }, + fromAmino(object: MsgTimeoutAmino): MsgTimeout { + const message = createBaseMsgTimeout(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgTimeout): MsgTimeoutAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + 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; + return obj; + }, + fromAminoMsg(object: MsgTimeoutAminoMsg): MsgTimeout { + return MsgTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeout): MsgTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgTimeout", + value: MsgTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutProtoMsg): MsgTimeout { + return MsgTimeout.decode(message.value); + }, + toProto(message: MsgTimeout): Uint8Array { + return MsgTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeout): MsgTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeout.typeUrl, MsgTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeout.aminoType, MsgTimeout.typeUrl); +function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { + return { + result: 0 + }; +} +export const MsgTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + aminoType: "cosmos-sdk/MsgTimeoutResponse", + is(o: any): o is MsgTimeoutResponse { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutResponseAmino { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutResponse(); + 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: DeepPartial): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgTimeoutResponseAmino): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgTimeoutResponse): MsgTimeoutResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutResponse", + value: MsgTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutResponseProtoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.decode(message.value); + }, + toProto(message: MsgTimeoutResponse): Uint8Array { + return MsgTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + value: MsgTimeoutResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutResponse.typeUrl, MsgTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutResponse.aminoType, MsgTimeoutResponse.typeUrl); +function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofClose: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "", + counterpartyUpgradeSequence: BigInt(0) + }; +} +export const MsgTimeoutOnClose = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + aminoType: "cosmos-sdk/MsgTimeoutOnClose", + is(o: any): o is MsgTimeoutOnClose { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && (o.proofClose instanceof Uint8Array || typeof o.proofClose === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgTimeoutOnCloseAmino { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && (o.proof_close instanceof Uint8Array || typeof o.proof_close === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + encode(message: MsgTimeoutOnClose, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(40).uint64(message.nextSequenceRecv); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = reader.uint64(); + break; + case 6: + message.signer = reader.string(); + break; + case 7: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofClose = object.proofClose ?? new Uint8Array(); + 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 { + const message = createBaseMsgTimeoutOnClose(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_close !== undefined && object.proof_close !== null) { + message.proofClose = bytesFromBase64(object.proof_close); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + 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 { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_close = message.proofClose ? base64FromBytes(message.proofClose) : undefined; + 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 { + return MsgTimeoutOnClose.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnClose", + value: MsgTimeoutOnClose.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseProtoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.decode(message.value); + }, + toProto(message: MsgTimeoutOnClose): Uint8Array { + return MsgTimeoutOnClose.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutOnClose.typeUrl, MsgTimeoutOnClose); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnClose.aminoType, MsgTimeoutOnClose.typeUrl); +function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { + return { + result: 0 + }; +} +export const MsgTimeoutOnCloseResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + aminoType: "cosmos-sdk/MsgTimeoutOnCloseResponse", + is(o: any): o is MsgTimeoutOnCloseResponse { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutOnCloseResponseAmino { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgTimeoutOnCloseResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnCloseResponse(); + 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: DeepPartial): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgTimeoutOnCloseResponseAminoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseResponseProtoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.decode(message.value); + }, + toProto(message: MsgTimeoutOnCloseResponse): Uint8Array { + return MsgTimeoutOnCloseResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTimeoutOnCloseResponse.typeUrl, MsgTimeoutOnCloseResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnCloseResponse.aminoType, MsgTimeoutOnCloseResponse.typeUrl); +function createBaseMsgAcknowledgement(): MsgAcknowledgement { + return { + packet: Packet.fromPartial({}), + acknowledgement: new Uint8Array(), + proofAcked: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgAcknowledgement = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + aminoType: "cosmos-sdk/MsgAcknowledgement", + is(o: any): o is MsgAcknowledgement { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.is(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proofAcked instanceof Uint8Array || typeof o.proofAcked === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgAcknowledgementAmino { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.isAmino(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof_acked instanceof Uint8Array || typeof o.proof_acked === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proofAcked = object.proofAcked ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof_acked !== undefined && object.proof_acked !== null) { + message.proofAcked = bytesFromBase64(object.proof_acked); + } + 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: MsgAcknowledgement): MsgAcknowledgementAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof_acked = message.proofAcked ? base64FromBytes(message.proofAcked) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementAminoMsg): MsgAcknowledgement { + return MsgAcknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgement): MsgAcknowledgementAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgement", + value: MsgAcknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementProtoMsg): MsgAcknowledgement { + return MsgAcknowledgement.decode(message.value); + }, + toProto(message: MsgAcknowledgement): Uint8Array { + return MsgAcknowledgement.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgement): MsgAcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcknowledgement.typeUrl, MsgAcknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgement.aminoType, MsgAcknowledgement.typeUrl); +function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { + return { + result: 0 + }; +} +export const MsgAcknowledgementResponse = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + aminoType: "cosmos-sdk/MsgAcknowledgementResponse", + is(o: any): o is MsgAcknowledgementResponse { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgAcknowledgementResponseAmino { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgementResponse(); + 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: DeepPartial): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgAcknowledgementResponseAmino): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementResponseAminoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementResponseProtoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.decode(message.value); + }, + toProto(message: MsgAcknowledgementResponse): Uint8Array { + return MsgAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcknowledgementResponse.typeUrl, MsgAcknowledgementResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgementResponse.aminoType, MsgAcknowledgementResponse.typeUrl); +function createBaseMsgChannelUpgradeInit(): MsgChannelUpgradeInit { + return { + portId: "", + channelId: "", + fields: UpgradeFields.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + is(o: any): o is MsgChannelUpgradeInit { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && UpgradeFields.is(o.fields) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && UpgradeFields.isAmino(o.fields) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInit.typeUrl, MsgChannelUpgradeInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInit.aminoType, MsgChannelUpgradeInit.typeUrl); +function createBaseMsgChannelUpgradeInitResponse(): MsgChannelUpgradeInitResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0) + }; +} +export const MsgChannelUpgradeInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeInitResponse", + is(o: any): o is MsgChannelUpgradeInitResponse { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInitResponse.typeUrl, MsgChannelUpgradeInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInitResponse.aminoType, MsgChannelUpgradeInitResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + is(o: any): o is MsgChannelUpgradeTry { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.proposedUpgradeConnectionHops) && (!o.proposedUpgradeConnectionHops.length || typeof o.proposedUpgradeConnectionHops[0] === "string") && UpgradeFields.is(o.counterpartyUpgradeFields) && typeof o.counterpartyUpgradeSequence === "bigint" && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTryAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.proposed_upgrade_connection_hops) && (!o.proposed_upgrade_connection_hops.length || typeof o.proposed_upgrade_connection_hops[0] === "string") && UpgradeFields.isAmino(o.counterparty_upgrade_fields) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTry.typeUrl, MsgChannelUpgradeTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTry.aminoType, MsgChannelUpgradeTry.typeUrl); +function createBaseMsgChannelUpgradeTryResponse(): MsgChannelUpgradeTryResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0), + result: 0 + }; +} +export const MsgChannelUpgradeTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTryResponse", + is(o: any): o is MsgChannelUpgradeTryResponse { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint" && isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeTryResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint" && isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTryResponse.typeUrl, MsgChannelUpgradeTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTryResponse.aminoType, MsgChannelUpgradeTryResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + is(o: any): o is MsgChannelUpgradeAck { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeAckAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAck.typeUrl, MsgChannelUpgradeAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAck.aminoType, MsgChannelUpgradeAck.typeUrl); +function createBaseMsgChannelUpgradeAckResponse(): MsgChannelUpgradeAckResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeAckResponse", + is(o: any): o is MsgChannelUpgradeAckResponse { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeAckResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAckResponse.typeUrl, MsgChannelUpgradeAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAckResponse.aminoType, MsgChannelUpgradeAckResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + is(o: any): o is MsgChannelUpgradeConfirm { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirm.typeUrl, MsgChannelUpgradeConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirm.aminoType, MsgChannelUpgradeConfirm.typeUrl); +function createBaseMsgChannelUpgradeConfirmResponse(): MsgChannelUpgradeConfirmResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + is(o: any): o is MsgChannelUpgradeConfirmResponse { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirmResponse.typeUrl, MsgChannelUpgradeConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirmResponse.aminoType, MsgChannelUpgradeConfirmResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + is(o: any): o is MsgChannelUpgradeOpen { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && typeof o.counterpartyUpgradeSequence === "bigint" && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeOpenAmino { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpen.typeUrl, MsgChannelUpgradeOpen); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpen.aminoType, MsgChannelUpgradeOpen.typeUrl); +function createBaseMsgChannelUpgradeOpenResponse(): MsgChannelUpgradeOpenResponse { + return {}; +} +export const MsgChannelUpgradeOpenResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + is(o: any): o is MsgChannelUpgradeOpenResponse { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeOpenResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpenResponse.typeUrl, MsgChannelUpgradeOpenResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpenResponse.aminoType, MsgChannelUpgradeOpenResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + is(o: any): o is MsgChannelUpgradeTimeout { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Channel.is(o.counterpartyChannel) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Channel.isAmino(o.counterparty_channel) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeout.typeUrl, MsgChannelUpgradeTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeout.aminoType, MsgChannelUpgradeTimeout.typeUrl); +function createBaseMsgChannelUpgradeTimeoutResponse(): MsgChannelUpgradeTimeoutResponse { + return {}; +} +export const MsgChannelUpgradeTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + is(o: any): o is MsgChannelUpgradeTimeoutResponse { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeoutResponse.typeUrl, MsgChannelUpgradeTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeoutResponse.aminoType, MsgChannelUpgradeTimeoutResponse.typeUrl); +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", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + is(o: any): o is MsgChannelUpgradeCancel { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && ErrorReceipt.is(o.errorReceipt) && (o.proofErrorReceipt instanceof Uint8Array || typeof o.proofErrorReceipt === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeCancelAmino { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && ErrorReceipt.isAmino(o.error_receipt) && (o.proof_error_receipt instanceof Uint8Array || typeof o.proof_error_receipt === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancel.typeUrl, MsgChannelUpgradeCancel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancel.aminoType, MsgChannelUpgradeCancel.typeUrl); +function createBaseMsgChannelUpgradeCancelResponse(): MsgChannelUpgradeCancelResponse { + return {}; +} +export const MsgChannelUpgradeCancelResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + is(o: any): o is MsgChannelUpgradeCancelResponse { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeCancelResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancelResponse.typeUrl, MsgChannelUpgradeCancelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancelResponse.aminoType, MsgChannelUpgradeCancelResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgPruneAcknowledgements(): MsgPruneAcknowledgements { + return { + portId: "", + channelId: "", + limit: BigInt(0), + signer: "" + }; +} +export const MsgPruneAcknowledgements = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + is(o: any): o is MsgPruneAcknowledgements { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgements.typeUrl, MsgPruneAcknowledgements); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgements.aminoType, MsgPruneAcknowledgements.typeUrl); +function createBaseMsgPruneAcknowledgementsResponse(): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: BigInt(0), + totalRemainingSequences: BigInt(0) + }; +} +export const MsgPruneAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + aminoType: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + is(o: any): o is MsgPruneAcknowledgementsResponse { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.totalPrunedSequences === "bigint" && typeof o.totalRemainingSequences === "bigint"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsResponseAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.total_pruned_sequences === "bigint" && typeof o.total_remaining_sequences === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgementsResponse.typeUrl, MsgPruneAcknowledgementsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgementsResponse.aminoType, MsgPruneAcknowledgementsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/channel/v1/upgrade.ts b/libs/injectivejs/src/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 00000000..8ce98e36 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,388 @@ +import { Timeout, TimeoutAmino, Order } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * 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; +} +/** + * 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; +} +/** + * 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; +} +function createBaseUpgrade(): Upgrade { + return { + fields: UpgradeFields.fromPartial({}), + timeout: Timeout.fromPartial({}), + nextSequenceSend: BigInt(0) + }; +} +export const Upgrade = { + typeUrl: "/ibc.core.channel.v1.Upgrade", + aminoType: "cosmos-sdk/Upgrade", + is(o: any): o is Upgrade { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.is(o.fields) && Timeout.is(o.timeout) && typeof o.nextSequenceSend === "bigint"); + }, + isAmino(o: any): o is UpgradeAmino { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.isAmino(o.fields) && Timeout.isAmino(o.timeout) && typeof o.next_sequence_send === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Upgrade.typeUrl, Upgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(Upgrade.aminoType, Upgrade.typeUrl); +function createBaseUpgradeFields(): UpgradeFields { + return { + ordering: 0, + connectionHops: [], + version: "" + }; +} +export const UpgradeFields = { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + aminoType: "cosmos-sdk/UpgradeFields", + is(o: any): o is UpgradeFields { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string"); + }, + isAmino(o: any): o is UpgradeFieldsAmino { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(UpgradeFields.typeUrl, UpgradeFields); +GlobalDecoderRegistry.registerAminoProtoMapping(UpgradeFields.aminoType, UpgradeFields.typeUrl); +function createBaseErrorReceipt(): ErrorReceipt { + return { + sequence: BigInt(0), + message: "" + }; +} +export const ErrorReceipt = { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + aminoType: "cosmos-sdk/ErrorReceipt", + is(o: any): o is ErrorReceipt { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + isAmino(o: any): o is ErrorReceiptAmino { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ErrorReceipt.typeUrl, ErrorReceipt); +GlobalDecoderRegistry.registerAminoProtoMapping(ErrorReceipt.aminoType, ErrorReceipt.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/client/v1/client.ts b/libs/injectivejs/src/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..f6c36539 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/client/v1/client.ts @@ -0,0 +1,602 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; + value: Uint8Array; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id: string; + /** client state */ + client_state?: AnyAmino; +} +export interface IdentifiedClientStateAminoMsg { + type: "cosmos-sdk/IdentifiedClientState"; + value: IdentifiedClientStateAmino; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height; + /** consensus state */ + consensusState?: Any; +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; + value: Uint8Array; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height: HeightAmino; + /** consensus state */ + consensus_state?: AnyAmino; +} +export interface ConsensusStateWithHeightAminoMsg { + type: "cosmos-sdk/ConsensusStateWithHeight"; + value: ConsensusStateWithHeightAmino; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; + value: Uint8Array; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id: string; + /** consensus states and their heights associated with the client */ + consensus_states: ConsensusStateWithHeightAmino[]; +} +export interface ClientConsensusStatesAminoMsg { + type: "cosmos-sdk/ClientConsensusStates"; + value: ClientConsensusStatesAmino; +} +/** + * 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 + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. + */ +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 + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. + */ +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; +} +/** 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; +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: "", + clientState: undefined + }; +} +export const IdentifiedClientState = { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + aminoType: "cosmos-sdk/IdentifiedClientState", + is(o: any): o is IdentifiedClientState { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.clientId === "string"); + }, + isAmino(o: any): o is IdentifiedClientStateAmino { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.client_id === "string"); + }, + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: "cosmos-sdk/IdentifiedClientState", + value: IdentifiedClientState.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value); + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + value: IdentifiedClientState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedClientState.typeUrl, IdentifiedClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedClientState.aminoType, IdentifiedClientState.typeUrl); +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined + }; +} +export const ConsensusStateWithHeight = { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + aminoType: "cosmos-sdk/ConsensusStateWithHeight", + is(o: any): o is ConsensusStateWithHeight { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.is(o.height)); + }, + isAmino(o: any): o is ConsensusStateWithHeightAmino { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.isAmino(o.height)); + }, + encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateWithHeightAminoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateWithHeight", + value: ConsensusStateWithHeight.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateWithHeightProtoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value); + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + value: ConsensusStateWithHeight.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConsensusStateWithHeight.typeUrl, ConsensusStateWithHeight); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusStateWithHeight.aminoType, ConsensusStateWithHeight.typeUrl); +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: "", + consensusStates: [] + }; +} +export const ClientConsensusStates = { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + aminoType: "cosmos-sdk/ClientConsensusStates", + is(o: any): o is ClientConsensusStates { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.clientId === "string" && Array.isArray(o.consensusStates) && (!o.consensusStates.length || ConsensusStateWithHeight.is(o.consensusStates[0]))); + }, + isAmino(o: any): o is ClientConsensusStatesAmino { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.client_id === "string" && Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isAmino(o.consensus_states[0]))); + }, + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); + } else { + obj.consensus_states = message.consensusStates; + } + return obj; + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value); + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: "cosmos-sdk/ClientConsensusStates", + value: ClientConsensusStates.toAmino(message) + }; + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value); + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish(); + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + value: ClientConsensusStates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientConsensusStates.typeUrl, ClientConsensusStates); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientConsensusStates.aminoType, ClientConsensusStates.typeUrl); +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + aminoType: "cosmos-sdk/Height", + is(o: any): o is Height { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); + }, + isAmino(o: any): o is HeightAmino { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + 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: DeepPartial): 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 ? message.revisionNumber?.toString() : "0"; + obj.revision_height = message.revisionHeight ? message.revisionHeight?.toString() : "0"; + 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() + }; + } +}; +GlobalDecoderRegistry.register(Height.typeUrl, Height); +GlobalDecoderRegistry.registerAminoProtoMapping(Height.aminoType, Height.typeUrl); +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowedClients) && (!o.allowedClients.length || typeof o.allowedClients[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_clients) && (!o.allowed_clients.length || typeof o.allowed_clients[0] === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/client/v1/tx.rpc.func.ts b/libs/injectivejs/src/ibc/core/client/v1/tx.rpc.func.ts new file mode 100644 index 00000000..a178d5d2 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/client/v1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const createCreateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateClient.typeUrl, + encoders: toEncoders(MsgCreateClient), + converters: toConverters(MsgCreateClient) +}); +export const createUpdateClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateClient.typeUrl, + encoders: toEncoders(MsgUpdateClient), + converters: toConverters(MsgUpdateClient) +}); +export const createUpgradeClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpgradeClient.typeUrl, + encoders: toEncoders(MsgUpgradeClient), + converters: toConverters(MsgUpgradeClient) +}); +export const createSubmitMisbehaviour = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitMisbehaviour.typeUrl, + encoders: toEncoders(MsgSubmitMisbehaviour), + converters: toConverters(MsgSubmitMisbehaviour) +}); +export const createRecoverClient = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRecoverClient.typeUrl, + encoders: toEncoders(MsgRecoverClient), + converters: toConverters(MsgRecoverClient) +}); +export const createIBCSoftwareUpgrade = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIBCSoftwareUpgrade.typeUrl, + encoders: toEncoders(MsgIBCSoftwareUpgrade), + converters: toConverters(MsgIBCSoftwareUpgrade) +}); +export const createUpdateClientParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/client/v1/tx.ts b/libs/injectivejs/src/ibc/core/client/v1/tx.ts new file mode 100644 index 00000000..c0281aac --- /dev/null +++ b/libs/injectivejs/src/ibc/core/client/v1/tx.ts @@ -0,0 +1,1560 @@ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Params, ParamsAmino } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any; + /** signer address */ + signer: string; +} +export interface MsgCreateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClient"; + value: Uint8Array; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientAmino { + /** light client state */ + client_state?: AnyAmino; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensus_state?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgCreateClientAminoMsg { + type: "cosmos-sdk/MsgCreateClient"; + value: MsgCreateClientAmino; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse { + clientId: string; +} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; + value: Uint8Array; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino { + client_id: string; +} +export interface MsgCreateClientResponseAminoMsg { + type: "cosmos-sdk/MsgCreateClientResponse"; + value: MsgCreateClientResponseAmino; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** client message to update the light client */ + clientMessage?: Any; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; + value: Uint8Array; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id: string; + /** client message to update the light client */ + client_message?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientAminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: MsgUpdateClientAmino; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} +export interface MsgUpdateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; + value: Uint8Array; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseAmino {} +export interface MsgUpdateClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateClientResponse"; + value: MsgUpdateClientResponseAmino; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState?: Any; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState?: Any; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; + value: Uint8Array; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientAmino { + /** client unique identifier */ + client_id: string; + /** upgraded client state */ + client_state?: AnyAmino; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensus_state?: AnyAmino; + /** proof that old chain committed to new client */ + proof_upgrade_client: string; + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state: string; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientAminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: MsgUpgradeClientAmino; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} +export interface MsgUpgradeClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; + value: Uint8Array; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseAmino {} +export interface MsgUpgradeClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpgradeClientResponse"; + value: MsgUpgradeClientResponseAmino; +} +/** + * 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; + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; + value: Uint8Array; +} +/** + * 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; + /** misbehaviour used for freezing the light client */ + misbehaviour?: AnyAmino; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviour"; + value: MsgSubmitMisbehaviourAmino; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse {} +export interface MsgSubmitMisbehaviourResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseAmino {} +export interface MsgSubmitMisbehaviourResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse"; + value: MsgSubmitMisbehaviourResponseAmino; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +/** 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; +} +function createBaseMsgCreateClient(): MsgCreateClient { + return { + clientState: undefined, + consensusState: undefined, + signer: "" + }; +} +export const MsgCreateClient = { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + aminoType: "cosmos-sdk/MsgCreateClient", + is(o: any): o is MsgCreateClient { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgCreateClientAmino { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateClient { + const message = createBaseMsgCreateClient(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientAmino): MsgCreateClient { + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgCreateClient): MsgCreateClientAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { + return MsgCreateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClient): MsgCreateClientAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClient", + value: MsgCreateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientProtoMsg): MsgCreateClient { + return MsgCreateClient.decode(message.value); + }, + toProto(message: MsgCreateClient): Uint8Array { + return MsgCreateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClient): MsgCreateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateClient.typeUrl, MsgCreateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClient.aminoType, MsgCreateClient.typeUrl); +function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { + return { + clientId: "" + }; +} +export const MsgCreateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + aminoType: "cosmos-sdk/MsgCreateClientResponse", + is(o: any): o is MsgCreateClientResponse { + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.clientId === "string"); + }, + isAmino(o: any): o is MsgCreateClientResponseAmino { + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.client_id === "string"); + }, + encode(message: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientResponseAmino): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: MsgCreateClientResponse): MsgCreateClientResponseAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + return obj; + }, + fromAminoMsg(object: MsgCreateClientResponseAminoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClientResponse", + value: MsgCreateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientResponseProtoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.decode(message.value); + }, + toProto(message: MsgCreateClientResponse): Uint8Array { + return MsgCreateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + value: MsgCreateClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateClientResponse.typeUrl, MsgCreateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClientResponse.aminoType, MsgCreateClientResponse.typeUrl); +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { + clientId: "", + clientMessage: undefined, + signer: "" + }; +} +export const MsgUpdateClient = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + aminoType: "cosmos-sdk/MsgUpdateClient", + is(o: any): o is MsgUpdateClient { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpdateClientAmino { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMessage = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + message.clientId = object.clientId ?? ""; + message.clientMessage = object.clientMessage !== undefined && object.clientMessage !== null ? Any.fromPartial(object.clientMessage) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + 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; + } + return message; + }, + toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_message = message.clientMessage ? Any.toAmino(message.clientMessage) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { + return MsgUpdateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClient): MsgUpdateClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClient", + value: MsgUpdateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientProtoMsg): MsgUpdateClient { + return MsgUpdateClient.decode(message.value); + }, + toProto(message: MsgUpdateClient): Uint8Array { + return MsgUpdateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClient): MsgUpdateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateClient.typeUrl, MsgUpdateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClient.aminoType, MsgUpdateClient.typeUrl); +function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { + return {}; +} +export const MsgUpdateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + aminoType: "cosmos-sdk/MsgUpdateClientResponse", + is(o: any): o is MsgUpdateClientResponse { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateClientResponseAmino { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientResponseAminoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClientResponse", + value: MsgUpdateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientResponseProtoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.decode(message.value); + }, + toProto(message: MsgUpdateClientResponse): Uint8Array { + return MsgUpdateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + value: MsgUpdateClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateClientResponse.typeUrl, MsgUpdateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClientResponse.aminoType, MsgUpdateClientResponse.typeUrl); +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: "", + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: "" + }; +} +export const MsgUpgradeClient = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + aminoType: "cosmos-sdk/MsgUpgradeClient", + is(o: any): o is MsgUpgradeClient { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.clientId === "string" && (o.proofUpgradeClient instanceof Uint8Array || typeof o.proofUpgradeClient === "string") && (o.proofUpgradeConsensusState instanceof Uint8Array || typeof o.proofUpgradeConsensusState === "string") && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpgradeClientAmino { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.client_id === "string" && (o.proof_upgrade_client instanceof Uint8Array || typeof o.proof_upgrade_client === "string") && (o.proof_upgrade_consensus_state instanceof Uint8Array || typeof o.proof_upgrade_consensus_state === "string") && typeof o.signer === "string"); + }, + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array(); + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { + return MsgUpgradeClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClient): MsgUpgradeClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClient", + value: MsgUpgradeClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientProtoMsg): MsgUpgradeClient { + return MsgUpgradeClient.decode(message.value); + }, + toProto(message: MsgUpgradeClient): Uint8Array { + return MsgUpgradeClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClient): MsgUpgradeClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpgradeClient.typeUrl, MsgUpgradeClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClient.aminoType, MsgUpgradeClient.typeUrl); +function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { + return {}; +} +export const MsgUpgradeClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + aminoType: "cosmos-sdk/MsgUpgradeClientResponse", + is(o: any): o is MsgUpgradeClientResponse { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpgradeClientResponseAmino { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientResponseAminoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientResponseProtoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.decode(message.value); + }, + toProto(message: MsgUpgradeClientResponse): Uint8Array { + return MsgUpgradeClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpgradeClientResponse.typeUrl, MsgUpgradeClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClientResponse.aminoType, MsgUpgradeClientResponse.typeUrl); +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { + clientId: "", + misbehaviour: undefined, + signer: "" + }; +} +export const MsgSubmitMisbehaviour = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + is(o: any): o is MsgSubmitMisbehaviour { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgSubmitMisbehaviourAmino { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.misbehaviour = object.misbehaviour !== undefined && object.misbehaviour !== null ? Any.fromPartial(object.misbehaviour) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.misbehaviour = message.misbehaviour ? Any.toAmino(message.misbehaviour) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourProtoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviour): Uint8Array { + return MsgSubmitMisbehaviour.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviour.typeUrl, MsgSubmitMisbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviour.aminoType, MsgSubmitMisbehaviour.typeUrl); +function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { + return {}; +} +export const MsgSubmitMisbehaviourResponse = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + is(o: any): o is MsgSubmitMisbehaviourResponse { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubmitMisbehaviourResponseAmino { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourResponseAminoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourResponseProtoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviourResponse): Uint8Array { + return MsgSubmitMisbehaviourResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviourResponse.typeUrl, MsgSubmitMisbehaviourResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviourResponse.aminoType, MsgSubmitMisbehaviourResponse.typeUrl); +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "" + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + aminoType: "cosmos-sdk/MsgRecoverClient", + is(o: any): o is MsgRecoverClient { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subjectClientId === "string" && typeof o.substituteClientId === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecoverClientAmino { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string" && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClient.typeUrl, MsgRecoverClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClient.aminoType, MsgRecoverClient.typeUrl); +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + aminoType: "cosmos-sdk/MsgRecoverClientResponse", + is(o: any): o is MsgRecoverClientResponse { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgRecoverClientResponseAmino { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClientResponse.typeUrl, MsgRecoverClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClientResponse.aminoType, MsgRecoverClientResponse.typeUrl); +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "" + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + is(o: any): o is MsgIBCSoftwareUpgrade { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.is(o.plan) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeAmino { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.isAmino(o.plan) && typeof o.signer === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgrade.typeUrl, MsgIBCSoftwareUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgrade.aminoType, MsgIBCSoftwareUpgrade.typeUrl); +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + is(o: any): o is MsgIBCSoftwareUpgradeResponse { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeResponseAmino { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgradeResponse.typeUrl, MsgIBCSoftwareUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgradeResponse.aminoType, MsgIBCSoftwareUpgradeResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/commitment/v1/commitment.ts b/libs/injectivejs/src/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 00000000..051efcdf --- /dev/null +++ b/libs/injectivejs/src/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,314 @@ +import { CommitmentProof, CommitmentProofAmino } from "../../../../cosmos/ics23/v1/proofs"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} +export interface MerkleRootProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; + value: Uint8Array; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootAmino { + hash: string; +} +export interface MerkleRootAminoMsg { + type: "cosmos-sdk/MerkleRoot"; + value: MerkleRootAmino; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} +export interface MerklePrefixProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; + value: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixAmino { + key_prefix: string; +} +export interface MerklePrefixAminoMsg { + type: "cosmos-sdk/MerklePrefix"; + value: MerklePrefixAmino; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} +export interface MerkleProofProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleProof"; + value: Uint8Array; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofAmino { + proofs: CommitmentProofAmino[]; +} +export interface MerkleProofAminoMsg { + type: "cosmos-sdk/MerkleProof"; + value: MerkleProofAmino; +} +function createBaseMerkleRoot(): MerkleRoot { + return { + hash: new Uint8Array() + }; +} +export const MerkleRoot = { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + aminoType: "cosmos-sdk/MerkleRoot", + is(o: any): o is MerkleRoot { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + isAmino(o: any): o is MerkleRootAmino { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleRoot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerkleRoot { + const message = createBaseMerkleRoot(); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerkleRootAmino): MerkleRoot { + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: MerkleRoot): MerkleRootAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { + return MerkleRoot.fromAmino(object.value); + }, + toAminoMsg(message: MerkleRoot): MerkleRootAminoMsg { + return { + type: "cosmos-sdk/MerkleRoot", + value: MerkleRoot.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleRootProtoMsg): MerkleRoot { + return MerkleRoot.decode(message.value); + }, + toProto(message: MerkleRoot): Uint8Array { + return MerkleRoot.encode(message).finish(); + }, + toProtoMsg(message: MerkleRoot): MerkleRootProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + value: MerkleRoot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerkleRoot.typeUrl, MerkleRoot); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleRoot.aminoType, MerkleRoot.typeUrl); +function createBaseMerklePrefix(): MerklePrefix { + return { + keyPrefix: new Uint8Array() + }; +} +export const MerklePrefix = { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + aminoType: "cosmos-sdk/MerklePrefix", + is(o: any): o is MerklePrefix { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.keyPrefix instanceof Uint8Array || typeof o.keyPrefix === "string"); + }, + isAmino(o: any): o is MerklePrefixAmino { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.key_prefix instanceof Uint8Array || typeof o.key_prefix === "string"); + }, + encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePrefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerklePrefix { + const message = createBaseMerklePrefix(); + message.keyPrefix = object.keyPrefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerklePrefixAmino): MerklePrefix { + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; + }, + toAmino(message: MerklePrefix): MerklePrefixAmino { + const obj: any = {}; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; + return obj; + }, + fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { + return MerklePrefix.fromAmino(object.value); + }, + toAminoMsg(message: MerklePrefix): MerklePrefixAminoMsg { + return { + type: "cosmos-sdk/MerklePrefix", + value: MerklePrefix.toAmino(message) + }; + }, + fromProtoMsg(message: MerklePrefixProtoMsg): MerklePrefix { + return MerklePrefix.decode(message.value); + }, + toProto(message: MerklePrefix): Uint8Array { + return MerklePrefix.encode(message).finish(); + }, + toProtoMsg(message: MerklePrefix): MerklePrefixProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + value: MerklePrefix.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerklePrefix.typeUrl, MerklePrefix); +GlobalDecoderRegistry.registerAminoProtoMapping(MerklePrefix.aminoType, MerklePrefix.typeUrl); +function createBaseMerkleProof(): MerkleProof { + return { + proofs: [] + }; +} +export const MerkleProof = { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + aminoType: "cosmos-sdk/MerkleProof", + is(o: any): o is MerkleProof { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.is(o.proofs[0]))); + }, + isAmino(o: any): o is MerkleProofAmino { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.isAmino(o.proofs[0]))); + }, + encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MerkleProofAmino): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; + }, + toAmino(message: MerkleProof): MerkleProofAmino { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map(e => e ? CommitmentProof.toAmino(e) : undefined); + } else { + obj.proofs = message.proofs; + } + return obj; + }, + fromAminoMsg(object: MerkleProofAminoMsg): MerkleProof { + return MerkleProof.fromAmino(object.value); + }, + toAminoMsg(message: MerkleProof): MerkleProofAminoMsg { + return { + type: "cosmos-sdk/MerkleProof", + value: MerkleProof.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleProofProtoMsg): MerkleProof { + return MerkleProof.decode(message.value); + }, + toProto(message: MerkleProof): Uint8Array { + return MerkleProof.encode(message).finish(); + }, + toProtoMsg(message: MerkleProof): MerkleProofProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + value: MerkleProof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MerkleProof.typeUrl, MerkleProof); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleProof.aminoType, MerkleProof.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/connection/v1/connection.ts b/libs/injectivejs/src/ibc/core/connection/v1/connection.ts new file mode 100644 index 00000000..1791709d --- /dev/null +++ b/libs/injectivejs/src/ibc/core/connection/v1/connection.ts @@ -0,0 +1,1010 @@ +import { MerklePrefix, MerklePrefixAmino } from "../../commitment/v1/commitment"; +import { isSet, DeepPartial } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** + * 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. + */ + delayPeriod: bigint; +} +export interface ConnectionEndProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; + value: Uint8Array; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndAmino { + /** client associated with this connection. */ + client_id: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: VersionAmino[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: CounterpartyAmino; + /** + * 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. + */ + delay_period: string; +} +export interface ConnectionEndAminoMsg { + type: "cosmos-sdk/ConnectionEnd"; + value: ConnectionEndAmino; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** delay period associated with this connection. */ + delayPeriod: bigint; +} +export interface IdentifiedConnectionProtoMsg { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; + value: Uint8Array; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionAmino { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + client_id: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: VersionAmino[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: CounterpartyAmino; + /** delay period associated with this connection. */ + delay_period: string; +} +export interface IdentifiedConnectionAminoMsg { + type: "cosmos-sdk/IdentifiedConnection"; + value: IdentifiedConnectionAmino; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.connection.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartyAmino { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefixAmino; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ClientPaths"; + value: Uint8Array; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsAmino { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsAminoMsg { + type: "cosmos-sdk/ClientPaths"; + value: ClientPathsAmino; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; + value: Uint8Array; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsAmino { + /** client state unique identifier */ + client_id: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsAminoMsg { + type: "cosmos-sdk/ConnectionPaths"; + value: ConnectionPathsAmino; +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionProtoMsg { + typeUrl: "/ibc.core.connection.v1.Version"; + value: Uint8Array; +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface VersionAmino { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionAminoMsg { + type: "cosmos-sdk/Version"; + value: VersionAmino; +} +/** Params defines the set of Connection parameters. */ +export interface 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. + */ + maxExpectedTimePerBlock: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsAmino { + /** + * 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. + */ + max_expected_time_per_block: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +function createBaseConnectionEnd(): ConnectionEnd { + return { + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const ConnectionEnd = { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + aminoType: "cosmos-sdk/ConnectionEnd", + is(o: any): o is ConnectionEnd { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isAmino(o: any): o is ConnectionEndAmino { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, + encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = (reader.int32() as any); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionEnd { + const message = createBaseConnectionEnd(); + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConnectionEndAmino): ConnectionEnd { + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: ConnectionEnd): ConnectionEndAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionEndAminoMsg): ConnectionEnd { + return ConnectionEnd.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionEnd): ConnectionEndAminoMsg { + return { + type: "cosmos-sdk/ConnectionEnd", + value: ConnectionEnd.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionEndProtoMsg): ConnectionEnd { + return ConnectionEnd.decode(message.value); + }, + toProto(message: ConnectionEnd): Uint8Array { + return ConnectionEnd.encode(message).finish(); + }, + toProtoMsg(message: ConnectionEnd): ConnectionEndProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + value: ConnectionEnd.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConnectionEnd.typeUrl, ConnectionEnd); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionEnd.aminoType, ConnectionEnd.typeUrl); +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { + id: "", + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const IdentifiedConnection = { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + aminoType: "cosmos-sdk/IdentifiedConnection", + is(o: any): o is IdentifiedConnection { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isAmino(o: any): o is IdentifiedConnectionAmino { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, + encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = (reader.int32() as any); + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + message.id = object.id ?? ""; + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: IdentifiedConnection): IdentifiedConnectionAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedConnectionAminoMsg): IdentifiedConnection { + return IdentifiedConnection.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedConnection): IdentifiedConnectionAminoMsg { + return { + type: "cosmos-sdk/IdentifiedConnection", + value: IdentifiedConnection.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedConnectionProtoMsg): IdentifiedConnection { + return IdentifiedConnection.decode(message.value); + }, + toProto(message: IdentifiedConnection): Uint8Array { + return IdentifiedConnection.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedConnection): IdentifiedConnectionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + value: IdentifiedConnection.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IdentifiedConnection.typeUrl, IdentifiedConnection); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedConnection.aminoType, IdentifiedConnection.typeUrl); +function createBaseCounterparty(): Counterparty { + return { + clientId: "", + connectionId: "", + prefix: MerklePrefix.fromPartial({}) + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.connection.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.clientId === "string" && typeof o.connectionId === "string" && MerklePrefix.is(o.prefix)); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.client_id === "string" && typeof o.connection_id === "string" && MerklePrefix.isAmino(o.prefix)); + }, + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Counterparty { + const message = createBaseCounterparty(); + message.clientId = object.clientId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? MerklePrefix.fromPartial(object.prefix) : undefined; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; + }, + toAmino(message: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.prefix = message.prefix ? MerklePrefix.toAmino(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); +function createBaseClientPaths(): ClientPaths { + return { + paths: [] + }; +} +export const ClientPaths = { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + aminoType: "cosmos-sdk/ClientPaths", + is(o: any): o is ClientPaths { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ClientPathsAmino { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ClientPathsAmino): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ClientPaths): ClientPathsAmino { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ClientPathsAminoMsg): ClientPaths { + return ClientPaths.fromAmino(object.value); + }, + toAminoMsg(message: ClientPaths): ClientPathsAminoMsg { + return { + type: "cosmos-sdk/ClientPaths", + value: ClientPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ClientPathsProtoMsg): ClientPaths { + return ClientPaths.decode(message.value); + }, + toProto(message: ClientPaths): Uint8Array { + return ClientPaths.encode(message).finish(); + }, + toProtoMsg(message: ClientPaths): ClientPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + value: ClientPaths.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientPaths.typeUrl, ClientPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientPaths.aminoType, ClientPaths.typeUrl); +function createBaseConnectionPaths(): ConnectionPaths { + return { + clientId: "", + paths: [] + }; +} +export const ConnectionPaths = { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + aminoType: "cosmos-sdk/ConnectionPaths", + is(o: any): o is ConnectionPaths { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.clientId === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ConnectionPathsAmino { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.client_id === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConnectionPaths { + const message = createBaseConnectionPaths(); + message.clientId = object.clientId ?? ""; + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ConnectionPathsAmino): ConnectionPaths { + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ConnectionPaths): ConnectionPathsAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ConnectionPathsAminoMsg): ConnectionPaths { + return ConnectionPaths.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionPaths): ConnectionPathsAminoMsg { + return { + type: "cosmos-sdk/ConnectionPaths", + value: ConnectionPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionPathsProtoMsg): ConnectionPaths { + return ConnectionPaths.decode(message.value); + }, + toProto(message: ConnectionPaths): Uint8Array { + return ConnectionPaths.encode(message).finish(); + }, + toProtoMsg(message: ConnectionPaths): ConnectionPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + value: ConnectionPaths.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConnectionPaths.typeUrl, ConnectionPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionPaths.aminoType, ConnectionPaths.typeUrl); +function createBaseVersion(): Version { + return { + identifier: "", + features: [] + }; +} +export const Version = { + typeUrl: "/ibc.core.connection.v1.Version", + aminoType: "cosmos-sdk/Version", + is(o: any): o is Version { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + isAmino(o: any): o is VersionAmino { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Version { + const message = createBaseVersion(); + message.identifier = object.identifier ?? ""; + message.features = object.features?.map(e => e) || []; + return message; + }, + fromAmino(object: VersionAmino): Version { + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; + }, + toAmino(message: Version): VersionAmino { + const obj: any = {}; + obj.identifier = message.identifier === "" ? undefined : message.identifier; + if (message.features) { + obj.features = message.features.map(e => e); + } else { + obj.features = message.features; + } + return obj; + }, + fromAminoMsg(object: VersionAminoMsg): Version { + return Version.fromAmino(object.value); + }, + toAminoMsg(message: Version): VersionAminoMsg { + return { + type: "cosmos-sdk/Version", + value: Version.toAmino(message) + }; + }, + fromProtoMsg(message: VersionProtoMsg): Version { + return Version.decode(message.value); + }, + toProto(message: Version): Uint8Array { + return Version.encode(message).finish(); + }, + toProtoMsg(message: Version): VersionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Version", + value: Version.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Version.typeUrl, Version); +GlobalDecoderRegistry.registerAminoProtoMapping(Version.aminoType, Version.typeUrl); +function createBaseParams(): Params { + return { + maxExpectedTimePerBlock: BigInt(0) + }; +} +export const Params = { + typeUrl: "/ibc.core.connection.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxExpectedTimePerBlock === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_expected_time_per_block === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxExpectedTimePerBlock !== BigInt(0)) { + writer.uint32(8).uint64(message.maxExpectedTimePerBlock); + } + 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.maxExpectedTimePerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_expected_time_per_block = message.maxExpectedTimePerBlock !== BigInt(0) ? message.maxExpectedTimePerBlock?.toString() : 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.connection.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/connection/v1/tx.rpc.func.ts b/libs/injectivejs/src/ibc/core/connection/v1/tx.rpc.func.ts new file mode 100644 index 00000000..c6b7e37d --- /dev/null +++ b/libs/injectivejs/src/ibc/core/connection/v1/tx.rpc.func.ts @@ -0,0 +1,33 @@ +import { buildTx, SigningClientResolver } from "../../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const createConnectionOpenInit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenInit.typeUrl, + encoders: toEncoders(MsgConnectionOpenInit), + converters: toConverters(MsgConnectionOpenInit) +}); +export const createConnectionOpenTry = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenTry.typeUrl, + encoders: toEncoders(MsgConnectionOpenTry), + converters: toConverters(MsgConnectionOpenTry) +}); +export const createConnectionOpenAck = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenAck.typeUrl, + encoders: toEncoders(MsgConnectionOpenAck), + converters: toConverters(MsgConnectionOpenAck) +}); +export const createConnectionOpenConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConnectionOpenConfirm.typeUrl, + encoders: toEncoders(MsgConnectionOpenConfirm), + converters: toConverters(MsgConnectionOpenConfirm) +}); +export const createUpdateConnectionParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/ibc/core/connection/v1/tx.ts b/libs/injectivejs/src/ibc/core/connection/v1/tx.ts new file mode 100644 index 00000000..fd194d48 --- /dev/null +++ b/libs/injectivejs/src/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1393 @@ +import { Counterparty, CounterpartyAmino, Version, VersionAmino } from "./connection"; +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, Params, ParamsAmino } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty: Counterparty; + version?: Version; + delayPeriod: bigint; + signer: string; +} +export interface MsgConnectionOpenInitProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitAmino { + client_id: string; + counterparty: CounterpartyAmino; + version?: VersionAmino; + delay_period: string; + signer: string; +} +export interface MsgConnectionOpenInitAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInit"; + value: MsgConnectionOpenInitAmino; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse {} +export interface MsgConnectionOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseAmino {} +export interface MsgConnectionOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInitResponse"; + value: MsgConnectionOpenInitResponseAmino; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previousConnectionId: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + clientState?: Any; + counterparty: Counterparty; + delayPeriod: bigint; + counterpartyVersions: Version[]; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofClient: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensusHeight: Height; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenTryProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; + value: Uint8Array; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTryAmino { + client_id: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previous_connection_id: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + client_state?: AnyAmino; + counterparty: CounterpartyAmino; + delay_period: string; + counterparty_versions: VersionAmino[]; + proof_height: HeightAmino; + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proof_init: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_client: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensus_height: HeightAmino; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + host_consensus_state_proof: string; +} +export interface MsgConnectionOpenTryAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: MsgConnectionOpenTryAmino; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} +export interface MsgConnectionOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseAmino {} +export interface MsgConnectionOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTryResponse"; + value: MsgConnectionOpenTryResponseAmino; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version?: Version; + /** Deprecated: this field is unused. */ + /** @deprecated */ + clientState?: Any; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofClient: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensusHeight: Height; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenAckProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; + value: Uint8Array; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckAmino { + connection_id: string; + counterparty_connection_id: string; + version?: VersionAmino; + /** Deprecated: this field is unused. */ + /** @deprecated */ + client_state?: AnyAmino; + proof_height: HeightAmino; + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proof_try: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_client: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + consensus_height: HeightAmino; + signer: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ + host_consensus_state_proof: string; +} +export interface MsgConnectionOpenAckAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: MsgConnectionOpenAckAmino; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} +export interface MsgConnectionOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseAmino {} +export interface MsgConnectionOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAckResponse"; + value: MsgConnectionOpenAckResponseAmino; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgConnectionOpenConfirmProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmAmino { + connection_id: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proof_ack: string; + proof_height: HeightAmino; + signer: string; +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: MsgConnectionOpenConfirmAmino; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse {} +export interface MsgConnectionOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseAmino {} +export interface MsgConnectionOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse"; + value: MsgConnectionOpenConfirmResponseAmino; +} +/** 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; +} +/** 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; +} +function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { + return { + clientId: "", + counterparty: Counterparty.fromPartial({}), + version: undefined, + delayPeriod: BigInt(0), + signer: "" + }; +} +export const MsgConnectionOpenInit = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + is(o: any): o is MsgConnectionOpenInit { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.clientId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenInitAmino { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.client_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && typeof o.signer === "string"); + }, + encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + message.clientId = object.clientId ?? ""; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenInit): MsgConnectionOpenInitAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitAminoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitProtoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.decode(message.value); + }, + toProto(message: MsgConnectionOpenInit): Uint8Array { + return MsgConnectionOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenInit.typeUrl, MsgConnectionOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInit.aminoType, MsgConnectionOpenInit.typeUrl); +function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { + return {}; +} +export const MsgConnectionOpenInitResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenInitResponse", + is(o: any): o is MsgConnectionOpenInitResponse { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenInitResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitResponseAminoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitResponseProtoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenInitResponse): Uint8Array { + return MsgConnectionOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenInitResponse.typeUrl, MsgConnectionOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInitResponse.aminoType, MsgConnectionOpenInitResponse.typeUrl); +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: "", + previousConnectionId: "", + clientState: undefined, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0), + counterpartyVersions: [], + proofHeight: Height.fromPartial({}), + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenTry = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + is(o: any): o is MsgConnectionOpenTry { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.clientId === "string" && typeof o.previousConnectionId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && Array.isArray(o.counterpartyVersions) && (!o.counterpartyVersions.length || Version.is(o.counterpartyVersions[0])) && Height.is(o.proofHeight) && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenTryAmino { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.client_id === "string" && typeof o.previous_connection_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && Array.isArray(o.counterparty_versions) && (!o.counterparty_versions.length || Version.isAmino(o.counterparty_versions[0])) && Height.isAmino(o.proof_height) && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + case 13: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + message.clientId = object.clientId ?? ""; + message.previousConnectionId = object.previousConnectionId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.counterpartyVersions = object.counterpartyVersions?.map(e => Version.fromPartial(e)) || []; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + 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 { + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + 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 { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.previous_connection_id = message.previousConnectionId === "" ? undefined : message.previousConnectionId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod?.toString() : undefined; + if (message.counterpartyVersions) { + obj.counterparty_versions = message.counterpartyVersions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.counterparty_versions = message.counterpartyVersions; + } + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + 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 { + return MsgConnectionOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryProtoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.decode(message.value); + }, + toProto(message: MsgConnectionOpenTry): Uint8Array { + return MsgConnectionOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenTry.typeUrl, MsgConnectionOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTry.aminoType, MsgConnectionOpenTry.typeUrl); +function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { + return {}; +} +export const MsgConnectionOpenTryResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenTryResponse", + is(o: any): o is MsgConnectionOpenTryResponse { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenTryResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryResponseAminoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryResponseProtoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenTryResponse): Uint8Array { + return MsgConnectionOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenTryResponse.typeUrl, MsgConnectionOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTryResponse.aminoType, MsgConnectionOpenTryResponse.typeUrl); +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: "", + counterpartyConnectionId: "", + version: undefined, + clientState: undefined, + proofHeight: Height.fromPartial({}), + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenAck = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + is(o: any): o is MsgConnectionOpenAck { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connectionId === "string" && typeof o.counterpartyConnectionId === "string" && Height.is(o.proofHeight) && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenAckAmino { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connection_id === "string" && typeof o.counterparty_connection_id === "string" && Height.isAmino(o.proof_height) && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + case 11: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + message.connectionId = object.connectionId ?? ""; + message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + 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 { + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + 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 { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.counterparty_connection_id = message.counterpartyConnectionId === "" ? undefined : message.counterpartyConnectionId; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + 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 { + return MsgConnectionOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckProtoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.decode(message.value); + }, + toProto(message: MsgConnectionOpenAck): Uint8Array { + return MsgConnectionOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenAck.typeUrl, MsgConnectionOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAck.aminoType, MsgConnectionOpenAck.typeUrl); +function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { + return {}; +} +export const MsgConnectionOpenAckResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenAckResponse", + is(o: any): o is MsgConnectionOpenAckResponse { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenAckResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckResponseAminoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckResponseProtoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenAckResponse): Uint8Array { + return MsgConnectionOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenAckResponse.typeUrl, MsgConnectionOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAckResponse.aminoType, MsgConnectionOpenAckResponse.typeUrl); +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { + connectionId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenConfirm = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + is(o: any): o is MsgConnectionOpenConfirm { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connectionId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenConfirmAmino { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connection_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + message.connectionId = object.connectionId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + 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: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmAminoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmProtoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirm): Uint8Array { + return MsgConnectionOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirm.typeUrl, MsgConnectionOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirm.aminoType, MsgConnectionOpenConfirm.typeUrl); +function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { + return {}; +} +export const MsgConnectionOpenConfirmResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + is(o: any): o is MsgConnectionOpenConfirmResponse { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmResponseAminoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmResponseProtoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirmResponse): Uint8Array { + return MsgConnectionOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirmResponse.typeUrl, MsgConnectionOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirmResponse.aminoType, MsgConnectionOpenConfirmResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/auction.ts b/libs/injectivejs/src/injective/auction/v1beta1/auction.ts new file mode 100644 index 00000000..7fd1367f --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/auction.ts @@ -0,0 +1,692 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** auction_period_duration defines the auction period duration */ + auctionPeriod: bigint; + /** min_next_bid_increment_rate defines the minimum increment rate for new bids */ + minNextBidIncrementRate: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.auction.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** auction_period_duration defines the auction period duration */ + auction_period: string; + /** min_next_bid_increment_rate defines the minimum increment rate for new bids */ + min_next_bid_increment_rate: string; +} +export interface ParamsAminoMsg { + type: "auction/Params"; + value: ParamsAmino; +} +export interface Bid { + bidder: string; + amount: string; +} +export interface BidProtoMsg { + typeUrl: "/injective.auction.v1beta1.Bid"; + value: Uint8Array; +} +export interface BidAmino { + bidder: string; + amount: string; +} +export interface BidAminoMsg { + type: "/injective.auction.v1beta1.Bid"; + value: BidAmino; +} +export interface LastAuctionResult { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface LastAuctionResultProtoMsg { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult"; + value: Uint8Array; +} +export interface LastAuctionResultAmino { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface LastAuctionResultAminoMsg { + type: "/injective.auction.v1beta1.LastAuctionResult"; + value: LastAuctionResultAmino; +} +export interface EventBid { + /** bidder describes the address of bidder */ + bidder: string; + /** amount describes the amount the bidder put on the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface EventBidProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventBid"; + value: Uint8Array; +} +export interface EventBidAmino { + /** bidder describes the address of bidder */ + bidder: string; + /** amount describes the amount the bidder put on the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface EventBidAminoMsg { + type: "/injective.auction.v1beta1.EventBid"; + value: EventBidAmino; +} +export interface EventAuctionResult { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: bigint; +} +export interface EventAuctionResultProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult"; + value: Uint8Array; +} +export interface EventAuctionResultAmino { + /** winner describes the address of the winner */ + winner: string; + /** amount describes the amount the winner get from the auction */ + amount: string; + /** round defines the round number of auction */ + round: string; +} +export interface EventAuctionResultAminoMsg { + type: "/injective.auction.v1beta1.EventAuctionResult"; + value: EventAuctionResultAmino; +} +export interface EventAuctionStart { + /** round defines the round number of auction */ + round: bigint; + /** ending_timestamp describes auction end time */ + endingTimestamp: bigint; + /** + * new_basket describes auction module balance at the time of new auction + * start + */ + newBasket: Coin[]; +} +export interface EventAuctionStartProtoMsg { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart"; + value: Uint8Array; +} +export interface EventAuctionStartAmino { + /** round defines the round number of auction */ + round: string; + /** ending_timestamp describes auction end time */ + ending_timestamp: string; + /** + * new_basket describes auction module balance at the time of new auction + * start + */ + new_basket: CoinAmino[]; +} +export interface EventAuctionStartAminoMsg { + type: "/injective.auction.v1beta1.EventAuctionStart"; + value: EventAuctionStartAmino; +} +function createBaseParams(): Params { + return { + auctionPeriod: BigInt(0), + minNextBidIncrementRate: "" + }; +} +export const Params = { + typeUrl: "/injective.auction.v1beta1.Params", + aminoType: "auction/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.auctionPeriod === "bigint" && typeof o.minNextBidIncrementRate === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.auction_period === "bigint" && typeof o.min_next_bid_increment_rate === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.auctionPeriod !== BigInt(0)) { + writer.uint32(8).int64(message.auctionPeriod); + } + if (message.minNextBidIncrementRate !== "") { + writer.uint32(18).string(message.minNextBidIncrementRate); + } + 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.auctionPeriod = reader.int64(); + break; + case 2: + message.minNextBidIncrementRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.auctionPeriod = object.auctionPeriod !== undefined && object.auctionPeriod !== null ? BigInt(object.auctionPeriod.toString()) : BigInt(0); + message.minNextBidIncrementRate = object.minNextBidIncrementRate ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.auction_period !== undefined && object.auction_period !== null) { + message.auctionPeriod = BigInt(object.auction_period); + } + if (object.min_next_bid_increment_rate !== undefined && object.min_next_bid_increment_rate !== null) { + message.minNextBidIncrementRate = object.min_next_bid_increment_rate; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.auction_period = message.auctionPeriod !== BigInt(0) ? message.auctionPeriod?.toString() : undefined; + obj.min_next_bid_increment_rate = message.minNextBidIncrementRate === "" ? undefined : message.minNextBidIncrementRate; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "auction/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: "/injective.auction.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseBid(): Bid { + return { + bidder: "", + amount: "" + }; +} +export const Bid = { + typeUrl: "/injective.auction.v1beta1.Bid", + is(o: any): o is Bid { + return o && (o.$typeUrl === Bid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is BidAmino { + return o && (o.$typeUrl === Bid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string"); + }, + encode(message: Bid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bidder !== "") { + writer.uint32(10).string(message.bidder); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bidder = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Bid { + const message = createBaseBid(); + message.bidder = object.bidder ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: BidAmino): Bid { + const message = createBaseBid(); + if (object.bidder !== undefined && object.bidder !== null) { + message.bidder = object.bidder; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Bid): BidAmino { + const obj: any = {}; + obj.bidder = message.bidder ?? ""; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: BidAminoMsg): Bid { + return Bid.fromAmino(object.value); + }, + fromProtoMsg(message: BidProtoMsg): Bid { + return Bid.decode(message.value); + }, + toProto(message: Bid): Uint8Array { + return Bid.encode(message).finish(); + }, + toProtoMsg(message: Bid): BidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.Bid", + value: Bid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Bid.typeUrl, Bid); +function createBaseLastAuctionResult(): LastAuctionResult { + return { + winner: "", + amount: "", + round: BigInt(0) + }; +} +export const LastAuctionResult = { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult", + is(o: any): o is LastAuctionResult { + return o && (o.$typeUrl === LastAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is LastAuctionResultAmino { + return o && (o.$typeUrl === LastAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: LastAuctionResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.winner !== "") { + writer.uint32(10).string(message.winner); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastAuctionResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastAuctionResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.winner = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastAuctionResult { + const message = createBaseLastAuctionResult(); + message.winner = object.winner ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastAuctionResultAmino): LastAuctionResult { + const message = createBaseLastAuctionResult(); + if (object.winner !== undefined && object.winner !== null) { + message.winner = object.winner; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: LastAuctionResult): LastAuctionResultAmino { + const obj: any = {}; + obj.winner = message.winner === "" ? undefined : message.winner; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastAuctionResultAminoMsg): LastAuctionResult { + return LastAuctionResult.fromAmino(object.value); + }, + fromProtoMsg(message: LastAuctionResultProtoMsg): LastAuctionResult { + return LastAuctionResult.decode(message.value); + }, + toProto(message: LastAuctionResult): Uint8Array { + return LastAuctionResult.encode(message).finish(); + }, + toProtoMsg(message: LastAuctionResult): LastAuctionResultProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.LastAuctionResult", + value: LastAuctionResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastAuctionResult.typeUrl, LastAuctionResult); +function createBaseEventBid(): EventBid { + return { + bidder: "", + amount: "", + round: BigInt(0) + }; +} +export const EventBid = { + typeUrl: "/injective.auction.v1beta1.EventBid", + is(o: any): o is EventBid { + return o && (o.$typeUrl === EventBid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EventBidAmino { + return o && (o.$typeUrl === EventBid.typeUrl || typeof o.bidder === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: EventBid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bidder !== "") { + writer.uint32(10).string(message.bidder); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bidder = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBid { + const message = createBaseEventBid(); + message.bidder = object.bidder ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBidAmino): EventBid { + const message = createBaseEventBid(); + if (object.bidder !== undefined && object.bidder !== null) { + message.bidder = object.bidder; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EventBid): EventBidAmino { + const obj: any = {}; + obj.bidder = message.bidder === "" ? undefined : message.bidder; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBidAminoMsg): EventBid { + return EventBid.fromAmino(object.value); + }, + fromProtoMsg(message: EventBidProtoMsg): EventBid { + return EventBid.decode(message.value); + }, + toProto(message: EventBid): Uint8Array { + return EventBid.encode(message).finish(); + }, + toProtoMsg(message: EventBid): EventBidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventBid", + value: EventBid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBid.typeUrl, EventBid); +function createBaseEventAuctionResult(): EventAuctionResult { + return { + winner: "", + amount: "", + round: BigInt(0) + }; +} +export const EventAuctionResult = { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult", + is(o: any): o is EventAuctionResult { + return o && (o.$typeUrl === EventAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EventAuctionResultAmino { + return o && (o.$typeUrl === EventAuctionResult.typeUrl || typeof o.winner === "string" && typeof o.amount === "string" && typeof o.round === "bigint"); + }, + encode(message: EventAuctionResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.winner !== "") { + writer.uint32(10).string(message.winner); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAuctionResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAuctionResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.winner = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAuctionResult { + const message = createBaseEventAuctionResult(); + message.winner = object.winner ?? ""; + message.amount = object.amount ?? ""; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventAuctionResultAmino): EventAuctionResult { + const message = createBaseEventAuctionResult(); + if (object.winner !== undefined && object.winner !== null) { + message.winner = object.winner; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EventAuctionResult): EventAuctionResultAmino { + const obj: any = {}; + obj.winner = message.winner === "" ? undefined : message.winner; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventAuctionResultAminoMsg): EventAuctionResult { + return EventAuctionResult.fromAmino(object.value); + }, + fromProtoMsg(message: EventAuctionResultProtoMsg): EventAuctionResult { + return EventAuctionResult.decode(message.value); + }, + toProto(message: EventAuctionResult): Uint8Array { + return EventAuctionResult.encode(message).finish(); + }, + toProtoMsg(message: EventAuctionResult): EventAuctionResultProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventAuctionResult", + value: EventAuctionResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAuctionResult.typeUrl, EventAuctionResult); +function createBaseEventAuctionStart(): EventAuctionStart { + return { + round: BigInt(0), + endingTimestamp: BigInt(0), + newBasket: [] + }; +} +export const EventAuctionStart = { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart", + is(o: any): o is EventAuctionStart { + return o && (o.$typeUrl === EventAuctionStart.typeUrl || typeof o.round === "bigint" && typeof o.endingTimestamp === "bigint" && Array.isArray(o.newBasket) && (!o.newBasket.length || Coin.is(o.newBasket[0]))); + }, + isAmino(o: any): o is EventAuctionStartAmino { + return o && (o.$typeUrl === EventAuctionStart.typeUrl || typeof o.round === "bigint" && typeof o.ending_timestamp === "bigint" && Array.isArray(o.new_basket) && (!o.new_basket.length || Coin.isAmino(o.new_basket[0]))); + }, + encode(message: EventAuctionStart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== BigInt(0)) { + writer.uint32(8).uint64(message.round); + } + if (message.endingTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.endingTimestamp); + } + for (const v of message.newBasket) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAuctionStart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAuctionStart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.uint64(); + break; + case 2: + message.endingTimestamp = reader.int64(); + break; + case 3: + message.newBasket.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAuctionStart { + const message = createBaseEventAuctionStart(); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.endingTimestamp = object.endingTimestamp !== undefined && object.endingTimestamp !== null ? BigInt(object.endingTimestamp.toString()) : BigInt(0); + message.newBasket = object.newBasket?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAuctionStartAmino): EventAuctionStart { + const message = createBaseEventAuctionStart(); + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.ending_timestamp !== undefined && object.ending_timestamp !== null) { + message.endingTimestamp = BigInt(object.ending_timestamp); + } + message.newBasket = object.new_basket?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventAuctionStart): EventAuctionStartAmino { + const obj: any = {}; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.ending_timestamp = message.endingTimestamp !== BigInt(0) ? message.endingTimestamp?.toString() : undefined; + if (message.newBasket) { + obj.new_basket = message.newBasket.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.new_basket = message.newBasket; + } + return obj; + }, + fromAminoMsg(object: EventAuctionStartAminoMsg): EventAuctionStart { + return EventAuctionStart.fromAmino(object.value); + }, + fromProtoMsg(message: EventAuctionStartProtoMsg): EventAuctionStart { + return EventAuctionStart.decode(message.value); + }, + toProto(message: EventAuctionStart): Uint8Array { + return EventAuctionStart.encode(message).finish(); + }, + toProtoMsg(message: EventAuctionStart): EventAuctionStartProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.EventAuctionStart", + value: EventAuctionStart.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAuctionStart.typeUrl, EventAuctionStart); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/genesis.ts b/libs/injectivejs/src/injective/auction/v1beta1/genesis.ts new file mode 100644 index 00000000..6ea94963 --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/genesis.ts @@ -0,0 +1,156 @@ +import { Params, ParamsAmino, Bid, BidAmino, LastAuctionResult, LastAuctionResultAmino } from "./auction"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the auction module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to auction. */ + params: Params; + /** current auction round */ + auctionRound: bigint; + /** current highest bid */ + highestBid?: Bid; + /** auction ending timestamp */ + auctionEndingTimestamp: bigint; + /** last auction result */ + lastAuctionResult?: LastAuctionResult; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.auction.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the auction module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to auction. */ + params: ParamsAmino; + /** current auction round */ + auction_round: string; + /** current highest bid */ + highest_bid?: BidAmino; + /** auction ending timestamp */ + auction_ending_timestamp: string; + /** last auction result */ + last_auction_result?: LastAuctionResultAmino; +} +export interface GenesisStateAminoMsg { + type: "/injective.auction.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + auctionRound: BigInt(0), + highestBid: undefined, + auctionEndingTimestamp: BigInt(0), + lastAuctionResult: undefined + }; +} +export const GenesisState = { + typeUrl: "/injective.auction.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && typeof o.auctionRound === "bigint" && typeof o.auctionEndingTimestamp === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && typeof o.auction_round === "bigint" && typeof o.auction_ending_timestamp === "bigint"); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.auctionRound !== BigInt(0)) { + writer.uint32(16).uint64(message.auctionRound); + } + if (message.highestBid !== undefined) { + Bid.encode(message.highestBid, writer.uint32(26).fork()).ldelim(); + } + if (message.auctionEndingTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.auctionEndingTimestamp); + } + if (message.lastAuctionResult !== undefined) { + LastAuctionResult.encode(message.lastAuctionResult, writer.uint32(42).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.auctionRound = reader.uint64(); + break; + case 3: + message.highestBid = Bid.decode(reader, reader.uint32()); + break; + case 4: + message.auctionEndingTimestamp = reader.int64(); + break; + case 5: + message.lastAuctionResult = LastAuctionResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.auctionRound = object.auctionRound !== undefined && object.auctionRound !== null ? BigInt(object.auctionRound.toString()) : BigInt(0); + message.highestBid = object.highestBid !== undefined && object.highestBid !== null ? Bid.fromPartial(object.highestBid) : undefined; + message.auctionEndingTimestamp = object.auctionEndingTimestamp !== undefined && object.auctionEndingTimestamp !== null ? BigInt(object.auctionEndingTimestamp.toString()) : BigInt(0); + message.lastAuctionResult = object.lastAuctionResult !== undefined && object.lastAuctionResult !== null ? LastAuctionResult.fromPartial(object.lastAuctionResult) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.auction_round !== undefined && object.auction_round !== null) { + message.auctionRound = BigInt(object.auction_round); + } + if (object.highest_bid !== undefined && object.highest_bid !== null) { + message.highestBid = Bid.fromAmino(object.highest_bid); + } + if (object.auction_ending_timestamp !== undefined && object.auction_ending_timestamp !== null) { + message.auctionEndingTimestamp = BigInt(object.auction_ending_timestamp); + } + if (object.last_auction_result !== undefined && object.last_auction_result !== null) { + message.lastAuctionResult = LastAuctionResult.fromAmino(object.last_auction_result); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.auction_round = message.auctionRound !== BigInt(0) ? message.auctionRound?.toString() : undefined; + obj.highest_bid = message.highestBid ? Bid.toAmino(message.highestBid) : undefined; + obj.auction_ending_timestamp = message.auctionEndingTimestamp !== BigInt(0) ? message.auctionEndingTimestamp?.toString() : undefined; + obj.last_auction_result = message.lastAuctionResult ? LastAuctionResult.toAmino(message.lastAuctionResult) : undefined; + 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: "/injective.auction.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/auction/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..831e714f --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/query.rpc.func.ts @@ -0,0 +1,30 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryAuctionParamsRequest, QueryAuctionParamsResponse, QueryCurrentAuctionBasketRequest, QueryCurrentAuctionBasketResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryLastAuctionResultRequest, QueryLastAuctionResultResponse } from "./query"; +export const createGetAuctionParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAuctionParamsRequest.encode, + decode: QueryAuctionParamsResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionParams", + clientResolver +}); +export const createGetCurrentAuctionBasket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentAuctionBasketRequest.encode, + decode: QueryCurrentAuctionBasketResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "CurrentAuctionBasket", + clientResolver +}); +export const createGetAuctionModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "AuctionModuleState", + clientResolver +}); +export const createGetLastAuctionResult = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastAuctionResultRequest.encode, + decode: QueryLastAuctionResultResponse.decode, + service: "injective.auction.v1beta1.Query", + method: "LastAuctionResult", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/query.ts b/libs/injectivejs/src/injective/auction/v1beta1/query.ts new file mode 100644 index 00000000..723f9496 --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/query.ts @@ -0,0 +1,726 @@ +import { Params, ParamsAmino, LastAuctionResult, LastAuctionResultAmino } from "./auction"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC + * method. + */ +export interface QueryAuctionParamsRequest {} +export interface QueryAuctionParamsRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest"; + value: Uint8Array; +} +/** + * QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC + * method. + */ +export interface QueryAuctionParamsRequestAmino {} +export interface QueryAuctionParamsRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryAuctionParamsRequest"; + value: QueryAuctionParamsRequestAmino; +} +/** + * QueryAuctionParamsRequest is the response type for the Query/AuctionParams + * RPC method. + */ +export interface QueryAuctionParamsResponse { + params: Params; +} +export interface QueryAuctionParamsResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse"; + value: Uint8Array; +} +/** + * QueryAuctionParamsRequest is the response type for the Query/AuctionParams + * RPC method. + */ +export interface QueryAuctionParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryAuctionParamsResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryAuctionParamsResponse"; + value: QueryAuctionParamsResponseAmino; +} +/** + * QueryCurrentAuctionBasketRequest is the request type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketRequest {} +export interface QueryCurrentAuctionBasketRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest"; + value: Uint8Array; +} +/** + * QueryCurrentAuctionBasketRequest is the request type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketRequestAmino {} +export interface QueryCurrentAuctionBasketRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest"; + value: QueryCurrentAuctionBasketRequestAmino; +} +/** + * QueryCurrentAuctionBasketResponse is the response type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketResponse { + /** amount describes the amount put on auction */ + amount: Coin[]; + /** auctionRound describes current auction round */ + auctionRound: bigint; + /** auctionClosingTime describes auction close time for the round */ + auctionClosingTime: bigint; + /** highestBidder describes highest bidder on current round */ + highestBidder: string; + /** highestBidAmount describes highest bid amount on current round */ + highestBidAmount: string; +} +export interface QueryCurrentAuctionBasketResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse"; + value: Uint8Array; +} +/** + * QueryCurrentAuctionBasketResponse is the response type for the + * Query/CurrentAuctionBasket RPC method. + */ +export interface QueryCurrentAuctionBasketResponseAmino { + /** amount describes the amount put on auction */ + amount: CoinAmino[]; + /** auctionRound describes current auction round */ + auctionRound: string; + /** auctionClosingTime describes auction close time for the round */ + auctionClosingTime: string; + /** highestBidder describes highest bidder on current round */ + highestBidder: string; + /** highestBidAmount describes highest bid amount on current round */ + highestBidAmount: string; +} +export interface QueryCurrentAuctionBasketResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse"; + value: QueryCurrentAuctionBasketResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/AuctionModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/AuctionModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/AuctionModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/AuctionModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface QueryLastAuctionResultRequest {} +export interface QueryLastAuctionResultRequestProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest"; + value: Uint8Array; +} +export interface QueryLastAuctionResultRequestAmino {} +export interface QueryLastAuctionResultRequestAminoMsg { + type: "/injective.auction.v1beta1.QueryLastAuctionResultRequest"; + value: QueryLastAuctionResultRequestAmino; +} +export interface QueryLastAuctionResultResponse { + lastAuctionResult?: LastAuctionResult; +} +export interface QueryLastAuctionResultResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse"; + value: Uint8Array; +} +export interface QueryLastAuctionResultResponseAmino { + last_auction_result?: LastAuctionResultAmino; +} +export interface QueryLastAuctionResultResponseAminoMsg { + type: "/injective.auction.v1beta1.QueryLastAuctionResultResponse"; + value: QueryLastAuctionResultResponseAmino; +} +function createBaseQueryAuctionParamsRequest(): QueryAuctionParamsRequest { + return {}; +} +export const QueryAuctionParamsRequest = { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest", + is(o: any): o is QueryAuctionParamsRequest { + return o && o.$typeUrl === QueryAuctionParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAuctionParamsRequestAmino { + return o && o.$typeUrl === QueryAuctionParamsRequest.typeUrl; + }, + encode(_: QueryAuctionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuctionParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuctionParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryAuctionParamsRequest { + const message = createBaseQueryAuctionParamsRequest(); + return message; + }, + fromAmino(_: QueryAuctionParamsRequestAmino): QueryAuctionParamsRequest { + const message = createBaseQueryAuctionParamsRequest(); + return message; + }, + toAmino(_: QueryAuctionParamsRequest): QueryAuctionParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuctionParamsRequestAminoMsg): QueryAuctionParamsRequest { + return QueryAuctionParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAuctionParamsRequestProtoMsg): QueryAuctionParamsRequest { + return QueryAuctionParamsRequest.decode(message.value); + }, + toProto(message: QueryAuctionParamsRequest): Uint8Array { + return QueryAuctionParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuctionParamsRequest): QueryAuctionParamsRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsRequest", + value: QueryAuctionParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuctionParamsRequest.typeUrl, QueryAuctionParamsRequest); +function createBaseQueryAuctionParamsResponse(): QueryAuctionParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryAuctionParamsResponse = { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse", + is(o: any): o is QueryAuctionParamsResponse { + return o && (o.$typeUrl === QueryAuctionParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryAuctionParamsResponseAmino { + return o && (o.$typeUrl === QueryAuctionParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryAuctionParamsResponse, 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): QueryAuctionParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuctionParamsResponse(); + 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: DeepPartial): QueryAuctionParamsResponse { + const message = createBaseQueryAuctionParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryAuctionParamsResponseAmino): QueryAuctionParamsResponse { + const message = createBaseQueryAuctionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryAuctionParamsResponse): QueryAuctionParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAuctionParamsResponseAminoMsg): QueryAuctionParamsResponse { + return QueryAuctionParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAuctionParamsResponseProtoMsg): QueryAuctionParamsResponse { + return QueryAuctionParamsResponse.decode(message.value); + }, + toProto(message: QueryAuctionParamsResponse): Uint8Array { + return QueryAuctionParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuctionParamsResponse): QueryAuctionParamsResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryAuctionParamsResponse", + value: QueryAuctionParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuctionParamsResponse.typeUrl, QueryAuctionParamsResponse); +function createBaseQueryCurrentAuctionBasketRequest(): QueryCurrentAuctionBasketRequest { + return {}; +} +export const QueryCurrentAuctionBasketRequest = { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest", + is(o: any): o is QueryCurrentAuctionBasketRequest { + return o && o.$typeUrl === QueryCurrentAuctionBasketRequest.typeUrl; + }, + isAmino(o: any): o is QueryCurrentAuctionBasketRequestAmino { + return o && o.$typeUrl === QueryCurrentAuctionBasketRequest.typeUrl; + }, + encode(_: QueryCurrentAuctionBasketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentAuctionBasketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentAuctionBasketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCurrentAuctionBasketRequest { + const message = createBaseQueryCurrentAuctionBasketRequest(); + return message; + }, + fromAmino(_: QueryCurrentAuctionBasketRequestAmino): QueryCurrentAuctionBasketRequest { + const message = createBaseQueryCurrentAuctionBasketRequest(); + return message; + }, + toAmino(_: QueryCurrentAuctionBasketRequest): QueryCurrentAuctionBasketRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCurrentAuctionBasketRequestAminoMsg): QueryCurrentAuctionBasketRequest { + return QueryCurrentAuctionBasketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentAuctionBasketRequestProtoMsg): QueryCurrentAuctionBasketRequest { + return QueryCurrentAuctionBasketRequest.decode(message.value); + }, + toProto(message: QueryCurrentAuctionBasketRequest): Uint8Array { + return QueryCurrentAuctionBasketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentAuctionBasketRequest): QueryCurrentAuctionBasketRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketRequest", + value: QueryCurrentAuctionBasketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentAuctionBasketRequest.typeUrl, QueryCurrentAuctionBasketRequest); +function createBaseQueryCurrentAuctionBasketResponse(): QueryCurrentAuctionBasketResponse { + return { + amount: [], + auctionRound: BigInt(0), + auctionClosingTime: BigInt(0), + highestBidder: "", + highestBidAmount: "" + }; +} +export const QueryCurrentAuctionBasketResponse = { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse", + is(o: any): o is QueryCurrentAuctionBasketResponse { + return o && (o.$typeUrl === QueryCurrentAuctionBasketResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.auctionRound === "bigint" && typeof o.auctionClosingTime === "bigint" && typeof o.highestBidder === "string" && typeof o.highestBidAmount === "string"); + }, + isAmino(o: any): o is QueryCurrentAuctionBasketResponseAmino { + return o && (o.$typeUrl === QueryCurrentAuctionBasketResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.auctionRound === "bigint" && typeof o.auctionClosingTime === "bigint" && typeof o.highestBidder === "string" && typeof o.highestBidAmount === "string"); + }, + encode(message: QueryCurrentAuctionBasketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.auctionRound !== BigInt(0)) { + writer.uint32(16).uint64(message.auctionRound); + } + if (message.auctionClosingTime !== BigInt(0)) { + writer.uint32(24).int64(message.auctionClosingTime); + } + if (message.highestBidder !== "") { + writer.uint32(34).string(message.highestBidder); + } + if (message.highestBidAmount !== "") { + writer.uint32(42).string(message.highestBidAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentAuctionBasketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentAuctionBasketResponse(); + 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.auctionRound = reader.uint64(); + break; + case 3: + message.auctionClosingTime = reader.int64(); + break; + case 4: + message.highestBidder = reader.string(); + break; + case 5: + message.highestBidAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCurrentAuctionBasketResponse { + const message = createBaseQueryCurrentAuctionBasketResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.auctionRound = object.auctionRound !== undefined && object.auctionRound !== null ? BigInt(object.auctionRound.toString()) : BigInt(0); + message.auctionClosingTime = object.auctionClosingTime !== undefined && object.auctionClosingTime !== null ? BigInt(object.auctionClosingTime.toString()) : BigInt(0); + message.highestBidder = object.highestBidder ?? ""; + message.highestBidAmount = object.highestBidAmount ?? ""; + return message; + }, + fromAmino(object: QueryCurrentAuctionBasketResponseAmino): QueryCurrentAuctionBasketResponse { + const message = createBaseQueryCurrentAuctionBasketResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.auctionRound !== undefined && object.auctionRound !== null) { + message.auctionRound = BigInt(object.auctionRound); + } + if (object.auctionClosingTime !== undefined && object.auctionClosingTime !== null) { + message.auctionClosingTime = BigInt(object.auctionClosingTime); + } + if (object.highestBidder !== undefined && object.highestBidder !== null) { + message.highestBidder = object.highestBidder; + } + if (object.highestBidAmount !== undefined && object.highestBidAmount !== null) { + message.highestBidAmount = object.highestBidAmount; + } + return message; + }, + toAmino(message: QueryCurrentAuctionBasketResponse): QueryCurrentAuctionBasketResponseAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.auctionRound = message.auctionRound !== BigInt(0) ? message.auctionRound?.toString() : undefined; + obj.auctionClosingTime = message.auctionClosingTime !== BigInt(0) ? message.auctionClosingTime?.toString() : undefined; + obj.highestBidder = message.highestBidder === "" ? undefined : message.highestBidder; + obj.highestBidAmount = message.highestBidAmount === "" ? undefined : message.highestBidAmount; + return obj; + }, + fromAminoMsg(object: QueryCurrentAuctionBasketResponseAminoMsg): QueryCurrentAuctionBasketResponse { + return QueryCurrentAuctionBasketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentAuctionBasketResponseProtoMsg): QueryCurrentAuctionBasketResponse { + return QueryCurrentAuctionBasketResponse.decode(message.value); + }, + toProto(message: QueryCurrentAuctionBasketResponse): Uint8Array { + return QueryCurrentAuctionBasketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentAuctionBasketResponse): QueryCurrentAuctionBasketResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryCurrentAuctionBasketResponse", + value: QueryCurrentAuctionBasketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentAuctionBasketResponse.typeUrl, QueryCurrentAuctionBasketResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryLastAuctionResultRequest(): QueryLastAuctionResultRequest { + return {}; +} +export const QueryLastAuctionResultRequest = { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest", + is(o: any): o is QueryLastAuctionResultRequest { + return o && o.$typeUrl === QueryLastAuctionResultRequest.typeUrl; + }, + isAmino(o: any): o is QueryLastAuctionResultRequestAmino { + return o && o.$typeUrl === QueryLastAuctionResultRequest.typeUrl; + }, + encode(_: QueryLastAuctionResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastAuctionResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastAuctionResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryLastAuctionResultRequest { + const message = createBaseQueryLastAuctionResultRequest(); + return message; + }, + fromAmino(_: QueryLastAuctionResultRequestAmino): QueryLastAuctionResultRequest { + const message = createBaseQueryLastAuctionResultRequest(); + return message; + }, + toAmino(_: QueryLastAuctionResultRequest): QueryLastAuctionResultRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLastAuctionResultRequestAminoMsg): QueryLastAuctionResultRequest { + return QueryLastAuctionResultRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastAuctionResultRequestProtoMsg): QueryLastAuctionResultRequest { + return QueryLastAuctionResultRequest.decode(message.value); + }, + toProto(message: QueryLastAuctionResultRequest): Uint8Array { + return QueryLastAuctionResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastAuctionResultRequest): QueryLastAuctionResultRequestProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultRequest", + value: QueryLastAuctionResultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastAuctionResultRequest.typeUrl, QueryLastAuctionResultRequest); +function createBaseQueryLastAuctionResultResponse(): QueryLastAuctionResultResponse { + return { + lastAuctionResult: undefined + }; +} +export const QueryLastAuctionResultResponse = { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse", + is(o: any): o is QueryLastAuctionResultResponse { + return o && o.$typeUrl === QueryLastAuctionResultResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastAuctionResultResponseAmino { + return o && o.$typeUrl === QueryLastAuctionResultResponse.typeUrl; + }, + encode(message: QueryLastAuctionResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastAuctionResult !== undefined) { + LastAuctionResult.encode(message.lastAuctionResult, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastAuctionResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastAuctionResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastAuctionResult = LastAuctionResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastAuctionResultResponse { + const message = createBaseQueryLastAuctionResultResponse(); + message.lastAuctionResult = object.lastAuctionResult !== undefined && object.lastAuctionResult !== null ? LastAuctionResult.fromPartial(object.lastAuctionResult) : undefined; + return message; + }, + fromAmino(object: QueryLastAuctionResultResponseAmino): QueryLastAuctionResultResponse { + const message = createBaseQueryLastAuctionResultResponse(); + if (object.last_auction_result !== undefined && object.last_auction_result !== null) { + message.lastAuctionResult = LastAuctionResult.fromAmino(object.last_auction_result); + } + return message; + }, + toAmino(message: QueryLastAuctionResultResponse): QueryLastAuctionResultResponseAmino { + const obj: any = {}; + obj.last_auction_result = message.lastAuctionResult ? LastAuctionResult.toAmino(message.lastAuctionResult) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastAuctionResultResponseAminoMsg): QueryLastAuctionResultResponse { + return QueryLastAuctionResultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastAuctionResultResponseProtoMsg): QueryLastAuctionResultResponse { + return QueryLastAuctionResultResponse.decode(message.value); + }, + toProto(message: QueryLastAuctionResultResponse): Uint8Array { + return QueryLastAuctionResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastAuctionResultResponse): QueryLastAuctionResultResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.QueryLastAuctionResultResponse", + value: QueryLastAuctionResultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastAuctionResultResponse.typeUrl, QueryLastAuctionResultResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/auction/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..b8eb2122 --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/tx.rpc.func.ts @@ -0,0 +1,15 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgBid, MsgUpdateParams } from "./tx"; +export const createBid = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBid.typeUrl, + encoders: toEncoders(MsgBid), + converters: toConverters(MsgBid) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/auction/v1beta1/tx.ts b/libs/injectivejs/src/injective/auction/v1beta1/tx.ts new file mode 100644 index 00000000..9905ad0e --- /dev/null +++ b/libs/injectivejs/src/injective/auction/v1beta1/tx.ts @@ -0,0 +1,383 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino } from "./auction"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Bid defines a SDK message for placing a bid for an auction */ +export interface MsgBid { + sender: string; + /** amount of the bid in INJ tokens */ + bidAmount: Coin; + /** the current auction round being bid on */ + round: bigint; +} +export interface MsgBidProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgBid"; + value: Uint8Array; +} +/** Bid defines a SDK message for placing a bid for an auction */ +export interface MsgBidAmino { + sender: string; + /** amount of the bid in INJ tokens */ + bid_amount: CoinAmino; + /** the current auction round being bid on */ + round: string; +} +export interface MsgBidAminoMsg { + type: "auction/MsgBid"; + value: MsgBidAmino; +} +export interface MsgBidResponse {} +export interface MsgBidResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse"; + value: Uint8Array; +} +export interface MsgBidResponseAmino {} +export interface MsgBidResponseAminoMsg { + type: "/injective.auction.v1beta1.MsgBidResponse"; + value: MsgBidResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "auction/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.auction.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgBid(): MsgBid { + return { + sender: "", + bidAmount: Coin.fromPartial({}), + round: BigInt(0) + }; +} +export const MsgBid = { + typeUrl: "/injective.auction.v1beta1.MsgBid", + aminoType: "auction/MsgBid", + is(o: any): o is MsgBid { + return o && (o.$typeUrl === MsgBid.typeUrl || typeof o.sender === "string" && Coin.is(o.bidAmount) && typeof o.round === "bigint"); + }, + isAmino(o: any): o is MsgBidAmino { + return o && (o.$typeUrl === MsgBid.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.bid_amount) && typeof o.round === "bigint"); + }, + encode(message: MsgBid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.bidAmount !== undefined) { + Coin.encode(message.bidAmount, writer.uint32(18).fork()).ldelim(); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.bidAmount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBid { + const message = createBaseMsgBid(); + message.sender = object.sender ?? ""; + message.bidAmount = object.bidAmount !== undefined && object.bidAmount !== null ? Coin.fromPartial(object.bidAmount) : undefined; + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgBidAmino): MsgBid { + const message = createBaseMsgBid(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.bid_amount !== undefined && object.bid_amount !== null) { + message.bidAmount = Coin.fromAmino(object.bid_amount); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: MsgBid): MsgBidAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.bid_amount = message.bidAmount ? Coin.toAmino(message.bidAmount) : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgBidAminoMsg): MsgBid { + return MsgBid.fromAmino(object.value); + }, + toAminoMsg(message: MsgBid): MsgBidAminoMsg { + return { + type: "auction/MsgBid", + value: MsgBid.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBidProtoMsg): MsgBid { + return MsgBid.decode(message.value); + }, + toProto(message: MsgBid): Uint8Array { + return MsgBid.encode(message).finish(); + }, + toProtoMsg(message: MsgBid): MsgBidProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgBid", + value: MsgBid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBid.typeUrl, MsgBid); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBid.aminoType, MsgBid.typeUrl); +function createBaseMsgBidResponse(): MsgBidResponse { + return {}; +} +export const MsgBidResponse = { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse", + is(o: any): o is MsgBidResponse { + return o && o.$typeUrl === MsgBidResponse.typeUrl; + }, + isAmino(o: any): o is MsgBidResponseAmino { + return o && o.$typeUrl === MsgBidResponse.typeUrl; + }, + encode(_: MsgBidResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBidResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgBidResponse { + const message = createBaseMsgBidResponse(); + return message; + }, + fromAmino(_: MsgBidResponseAmino): MsgBidResponse { + const message = createBaseMsgBidResponse(); + return message; + }, + toAmino(_: MsgBidResponse): MsgBidResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBidResponseAminoMsg): MsgBidResponse { + return MsgBidResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBidResponseProtoMsg): MsgBidResponse { + return MsgBidResponse.decode(message.value); + }, + toProto(message: MsgBidResponse): Uint8Array { + return MsgBidResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBidResponse): MsgBidResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgBidResponse", + value: MsgBidResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBidResponse.typeUrl, MsgBidResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParams", + aminoType: "auction/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "auction/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: "/injective.auction.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.auction.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts b/libs/injectivejs/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts new file mode 100644 index 00000000..0017ec6a --- /dev/null +++ b/libs/injectivejs/src/injective/crypto/v1beta1/ethsecp256k1/keys.ts @@ -0,0 +1,205 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * PubKey defines a type alias for an ecdsa.PublicKey that implements + * Tendermint's PubKey interface. It represents the 33-byte compressed public + * key format. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey"; + value: Uint8Array; +} +/** + * PubKey defines a type alias for an ecdsa.PublicKey that implements + * Tendermint's PubKey interface. It represents the 33-byte compressed public + * key format. + */ +export interface PubKeyAmino { + key: string; +} +export interface PubKeyAminoMsg { + type: "injective/PubKeyEthSecp256k1"; + value: PubKeyAmino; +} +/** + * PrivKey defines a type alias for an ecdsa.PrivateKey that implements + * Tendermint's PrivateKey interface. + */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey"; + value: Uint8Array; +} +/** + * PrivKey defines a type alias for an ecdsa.PrivateKey that implements + * Tendermint's PrivateKey interface. + */ +export interface PrivKeyAmino { + key: string; +} +export interface PrivKeyAminoMsg { + type: "injective/PrivKeyEthSecp256k1"; + value: PrivKeyAmino; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey", + aminoType: "injective/PubKeyEthSecp256k1", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "injective/PubKeyEthSecp256k1", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey", + aminoType: "injective/PrivKeyEthSecp256k1", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "injective/PrivKeyEthSecp256k1", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/injective.crypto.v1beta1.ethsecp256k1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/authz.ts b/libs/injectivejs/src/injective/exchange/v1beta1/authz.ts new file mode 100644 index 00000000..96f2d111 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/authz.ts @@ -0,0 +1,1213 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** spot authz messages */ +export interface CreateSpotLimitOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateSpotLimitOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz"; + value: Uint8Array; +} +/** spot authz messages */ +export interface CreateSpotLimitOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateSpotLimitOrderAuthzAminoMsg { + type: "exchange/CreateSpotLimitOrderAuthz"; + value: CreateSpotLimitOrderAuthzAmino; +} +export interface CreateSpotMarketOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateSpotMarketOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz"; + value: Uint8Array; +} +export interface CreateSpotMarketOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateSpotMarketOrderAuthzAminoMsg { + type: "exchange/CreateSpotMarketOrderAuthz"; + value: CreateSpotMarketOrderAuthzAmino; +} +export interface BatchCreateSpotLimitOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCreateSpotLimitOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCreateSpotLimitOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCreateSpotLimitOrdersAuthzAminoMsg { + type: "exchange/BatchCreateSpotLimitOrdersAuthz"; + value: BatchCreateSpotLimitOrdersAuthzAmino; +} +export interface CancelSpotOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CancelSpotOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz"; + value: Uint8Array; +} +export interface CancelSpotOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CancelSpotOrderAuthzAminoMsg { + type: "exchange/CancelSpotOrderAuthz"; + value: CancelSpotOrderAuthzAmino; +} +export interface BatchCancelSpotOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCancelSpotOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCancelSpotOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCancelSpotOrdersAuthzAminoMsg { + type: "exchange/BatchCancelSpotOrdersAuthz"; + value: BatchCancelSpotOrdersAuthzAmino; +} +/** derivative authz messages */ +export interface CreateDerivativeLimitOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateDerivativeLimitOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz"; + value: Uint8Array; +} +/** derivative authz messages */ +export interface CreateDerivativeLimitOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateDerivativeLimitOrderAuthzAminoMsg { + type: "exchange/CreateDerivativeLimitOrderAuthz"; + value: CreateDerivativeLimitOrderAuthzAmino; +} +export interface CreateDerivativeMarketOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CreateDerivativeMarketOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz"; + value: Uint8Array; +} +export interface CreateDerivativeMarketOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CreateDerivativeMarketOrderAuthzAminoMsg { + type: "exchange/CreateDerivativeMarketOrderAuthz"; + value: CreateDerivativeMarketOrderAuthzAmino; +} +export interface BatchCreateDerivativeLimitOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCreateDerivativeLimitOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCreateDerivativeLimitOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCreateDerivativeLimitOrdersAuthzAminoMsg { + type: "exchange/BatchCreateDerivativeLimitOrdersAuthz"; + value: BatchCreateDerivativeLimitOrdersAuthzAmino; +} +export interface CancelDerivativeOrderAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface CancelDerivativeOrderAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz"; + value: Uint8Array; +} +export interface CancelDerivativeOrderAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface CancelDerivativeOrderAuthzAminoMsg { + type: "exchange/CancelDerivativeOrderAuthz"; + value: CancelDerivativeOrderAuthzAmino; +} +export interface BatchCancelDerivativeOrdersAuthz { + subaccountId: string; + marketIds: string[]; +} +export interface BatchCancelDerivativeOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz"; + value: Uint8Array; +} +export interface BatchCancelDerivativeOrdersAuthzAmino { + subaccount_id: string; + market_ids: string[]; +} +export interface BatchCancelDerivativeOrdersAuthzAminoMsg { + type: "exchange/BatchCancelDerivativeOrdersAuthz"; + value: BatchCancelDerivativeOrdersAuthzAmino; +} +/** common authz message used in both spot & derivative markets */ +export interface BatchUpdateOrdersAuthz { + subaccountId: string; + spotMarkets: string[]; + derivativeMarkets: string[]; +} +export interface BatchUpdateOrdersAuthzProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz"; + value: Uint8Array; +} +/** common authz message used in both spot & derivative markets */ +export interface BatchUpdateOrdersAuthzAmino { + subaccount_id: string; + spot_markets: string[]; + derivative_markets: string[]; +} +export interface BatchUpdateOrdersAuthzAminoMsg { + type: "exchange/BatchUpdateOrdersAuthz"; + value: BatchUpdateOrdersAuthzAmino; +} +function createBaseCreateSpotLimitOrderAuthz(): CreateSpotLimitOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateSpotLimitOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz", + aminoType: "exchange/CreateSpotLimitOrderAuthz", + is(o: any): o is CreateSpotLimitOrderAuthz { + return o && (o.$typeUrl === CreateSpotLimitOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateSpotLimitOrderAuthzAmino { + return o && (o.$typeUrl === CreateSpotLimitOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateSpotLimitOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateSpotLimitOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSpotLimitOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateSpotLimitOrderAuthz { + const message = createBaseCreateSpotLimitOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateSpotLimitOrderAuthzAmino): CreateSpotLimitOrderAuthz { + const message = createBaseCreateSpotLimitOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateSpotLimitOrderAuthzAminoMsg): CreateSpotLimitOrderAuthz { + return CreateSpotLimitOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzAminoMsg { + return { + type: "exchange/CreateSpotLimitOrderAuthz", + value: CreateSpotLimitOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateSpotLimitOrderAuthzProtoMsg): CreateSpotLimitOrderAuthz { + return CreateSpotLimitOrderAuthz.decode(message.value); + }, + toProto(message: CreateSpotLimitOrderAuthz): Uint8Array { + return CreateSpotLimitOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateSpotLimitOrderAuthz): CreateSpotLimitOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateSpotLimitOrderAuthz", + value: CreateSpotLimitOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateSpotLimitOrderAuthz.typeUrl, CreateSpotLimitOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateSpotLimitOrderAuthz.aminoType, CreateSpotLimitOrderAuthz.typeUrl); +function createBaseCreateSpotMarketOrderAuthz(): CreateSpotMarketOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateSpotMarketOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz", + aminoType: "exchange/CreateSpotMarketOrderAuthz", + is(o: any): o is CreateSpotMarketOrderAuthz { + return o && (o.$typeUrl === CreateSpotMarketOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateSpotMarketOrderAuthzAmino { + return o && (o.$typeUrl === CreateSpotMarketOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateSpotMarketOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateSpotMarketOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSpotMarketOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateSpotMarketOrderAuthz { + const message = createBaseCreateSpotMarketOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateSpotMarketOrderAuthzAmino): CreateSpotMarketOrderAuthz { + const message = createBaseCreateSpotMarketOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateSpotMarketOrderAuthzAminoMsg): CreateSpotMarketOrderAuthz { + return CreateSpotMarketOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzAminoMsg { + return { + type: "exchange/CreateSpotMarketOrderAuthz", + value: CreateSpotMarketOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateSpotMarketOrderAuthzProtoMsg): CreateSpotMarketOrderAuthz { + return CreateSpotMarketOrderAuthz.decode(message.value); + }, + toProto(message: CreateSpotMarketOrderAuthz): Uint8Array { + return CreateSpotMarketOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateSpotMarketOrderAuthz): CreateSpotMarketOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateSpotMarketOrderAuthz", + value: CreateSpotMarketOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateSpotMarketOrderAuthz.typeUrl, CreateSpotMarketOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateSpotMarketOrderAuthz.aminoType, CreateSpotMarketOrderAuthz.typeUrl); +function createBaseBatchCreateSpotLimitOrdersAuthz(): BatchCreateSpotLimitOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCreateSpotLimitOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz", + aminoType: "exchange/BatchCreateSpotLimitOrdersAuthz", + is(o: any): o is BatchCreateSpotLimitOrdersAuthz { + return o && (o.$typeUrl === BatchCreateSpotLimitOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCreateSpotLimitOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCreateSpotLimitOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCreateSpotLimitOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateSpotLimitOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCreateSpotLimitOrdersAuthz { + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCreateSpotLimitOrdersAuthzAmino): BatchCreateSpotLimitOrdersAuthz { + const message = createBaseBatchCreateSpotLimitOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCreateSpotLimitOrdersAuthzAminoMsg): BatchCreateSpotLimitOrdersAuthz { + return BatchCreateSpotLimitOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCreateSpotLimitOrdersAuthz", + value: BatchCreateSpotLimitOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCreateSpotLimitOrdersAuthzProtoMsg): BatchCreateSpotLimitOrdersAuthz { + return BatchCreateSpotLimitOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCreateSpotLimitOrdersAuthz): Uint8Array { + return BatchCreateSpotLimitOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCreateSpotLimitOrdersAuthz): BatchCreateSpotLimitOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCreateSpotLimitOrdersAuthz", + value: BatchCreateSpotLimitOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCreateSpotLimitOrdersAuthz.typeUrl, BatchCreateSpotLimitOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCreateSpotLimitOrdersAuthz.aminoType, BatchCreateSpotLimitOrdersAuthz.typeUrl); +function createBaseCancelSpotOrderAuthz(): CancelSpotOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CancelSpotOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz", + aminoType: "exchange/CancelSpotOrderAuthz", + is(o: any): o is CancelSpotOrderAuthz { + return o && (o.$typeUrl === CancelSpotOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CancelSpotOrderAuthzAmino { + return o && (o.$typeUrl === CancelSpotOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CancelSpotOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSpotOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSpotOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelSpotOrderAuthz { + const message = createBaseCancelSpotOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CancelSpotOrderAuthzAmino): CancelSpotOrderAuthz { + const message = createBaseCancelSpotOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CancelSpotOrderAuthzAminoMsg): CancelSpotOrderAuthz { + return CancelSpotOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzAminoMsg { + return { + type: "exchange/CancelSpotOrderAuthz", + value: CancelSpotOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSpotOrderAuthzProtoMsg): CancelSpotOrderAuthz { + return CancelSpotOrderAuthz.decode(message.value); + }, + toProto(message: CancelSpotOrderAuthz): Uint8Array { + return CancelSpotOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CancelSpotOrderAuthz): CancelSpotOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CancelSpotOrderAuthz", + value: CancelSpotOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelSpotOrderAuthz.typeUrl, CancelSpotOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelSpotOrderAuthz.aminoType, CancelSpotOrderAuthz.typeUrl); +function createBaseBatchCancelSpotOrdersAuthz(): BatchCancelSpotOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCancelSpotOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz", + aminoType: "exchange/BatchCancelSpotOrdersAuthz", + is(o: any): o is BatchCancelSpotOrdersAuthz { + return o && (o.$typeUrl === BatchCancelSpotOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCancelSpotOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCancelSpotOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCancelSpotOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelSpotOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCancelSpotOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCancelSpotOrdersAuthz { + const message = createBaseBatchCancelSpotOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCancelSpotOrdersAuthzAmino): BatchCancelSpotOrdersAuthz { + const message = createBaseBatchCancelSpotOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCancelSpotOrdersAuthzAminoMsg): BatchCancelSpotOrdersAuthz { + return BatchCancelSpotOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCancelSpotOrdersAuthz", + value: BatchCancelSpotOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCancelSpotOrdersAuthzProtoMsg): BatchCancelSpotOrdersAuthz { + return BatchCancelSpotOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCancelSpotOrdersAuthz): Uint8Array { + return BatchCancelSpotOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCancelSpotOrdersAuthz): BatchCancelSpotOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCancelSpotOrdersAuthz", + value: BatchCancelSpotOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCancelSpotOrdersAuthz.typeUrl, BatchCancelSpotOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCancelSpotOrdersAuthz.aminoType, BatchCancelSpotOrdersAuthz.typeUrl); +function createBaseCreateDerivativeLimitOrderAuthz(): CreateDerivativeLimitOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateDerivativeLimitOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz", + aminoType: "exchange/CreateDerivativeLimitOrderAuthz", + is(o: any): o is CreateDerivativeLimitOrderAuthz { + return o && (o.$typeUrl === CreateDerivativeLimitOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateDerivativeLimitOrderAuthzAmino { + return o && (o.$typeUrl === CreateDerivativeLimitOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateDerivativeLimitOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateDerivativeLimitOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateDerivativeLimitOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateDerivativeLimitOrderAuthz { + const message = createBaseCreateDerivativeLimitOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateDerivativeLimitOrderAuthzAmino): CreateDerivativeLimitOrderAuthz { + const message = createBaseCreateDerivativeLimitOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateDerivativeLimitOrderAuthzAminoMsg): CreateDerivativeLimitOrderAuthz { + return CreateDerivativeLimitOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzAminoMsg { + return { + type: "exchange/CreateDerivativeLimitOrderAuthz", + value: CreateDerivativeLimitOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateDerivativeLimitOrderAuthzProtoMsg): CreateDerivativeLimitOrderAuthz { + return CreateDerivativeLimitOrderAuthz.decode(message.value); + }, + toProto(message: CreateDerivativeLimitOrderAuthz): Uint8Array { + return CreateDerivativeLimitOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateDerivativeLimitOrderAuthz): CreateDerivativeLimitOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeLimitOrderAuthz", + value: CreateDerivativeLimitOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateDerivativeLimitOrderAuthz.typeUrl, CreateDerivativeLimitOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateDerivativeLimitOrderAuthz.aminoType, CreateDerivativeLimitOrderAuthz.typeUrl); +function createBaseCreateDerivativeMarketOrderAuthz(): CreateDerivativeMarketOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CreateDerivativeMarketOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz", + aminoType: "exchange/CreateDerivativeMarketOrderAuthz", + is(o: any): o is CreateDerivativeMarketOrderAuthz { + return o && (o.$typeUrl === CreateDerivativeMarketOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CreateDerivativeMarketOrderAuthzAmino { + return o && (o.$typeUrl === CreateDerivativeMarketOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CreateDerivativeMarketOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateDerivativeMarketOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateDerivativeMarketOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CreateDerivativeMarketOrderAuthz { + const message = createBaseCreateDerivativeMarketOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CreateDerivativeMarketOrderAuthzAmino): CreateDerivativeMarketOrderAuthz { + const message = createBaseCreateDerivativeMarketOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CreateDerivativeMarketOrderAuthzAminoMsg): CreateDerivativeMarketOrderAuthz { + return CreateDerivativeMarketOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzAminoMsg { + return { + type: "exchange/CreateDerivativeMarketOrderAuthz", + value: CreateDerivativeMarketOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CreateDerivativeMarketOrderAuthzProtoMsg): CreateDerivativeMarketOrderAuthz { + return CreateDerivativeMarketOrderAuthz.decode(message.value); + }, + toProto(message: CreateDerivativeMarketOrderAuthz): Uint8Array { + return CreateDerivativeMarketOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CreateDerivativeMarketOrderAuthz): CreateDerivativeMarketOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CreateDerivativeMarketOrderAuthz", + value: CreateDerivativeMarketOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateDerivativeMarketOrderAuthz.typeUrl, CreateDerivativeMarketOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateDerivativeMarketOrderAuthz.aminoType, CreateDerivativeMarketOrderAuthz.typeUrl); +function createBaseBatchCreateDerivativeLimitOrdersAuthz(): BatchCreateDerivativeLimitOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCreateDerivativeLimitOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz", + aminoType: "exchange/BatchCreateDerivativeLimitOrdersAuthz", + is(o: any): o is BatchCreateDerivativeLimitOrdersAuthz { + return o && (o.$typeUrl === BatchCreateDerivativeLimitOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCreateDerivativeLimitOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCreateDerivativeLimitOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCreateDerivativeLimitOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCreateDerivativeLimitOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCreateDerivativeLimitOrdersAuthz { + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCreateDerivativeLimitOrdersAuthzAmino): BatchCreateDerivativeLimitOrdersAuthz { + const message = createBaseBatchCreateDerivativeLimitOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCreateDerivativeLimitOrdersAuthzAminoMsg): BatchCreateDerivativeLimitOrdersAuthz { + return BatchCreateDerivativeLimitOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCreateDerivativeLimitOrdersAuthz", + value: BatchCreateDerivativeLimitOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCreateDerivativeLimitOrdersAuthzProtoMsg): BatchCreateDerivativeLimitOrdersAuthz { + return BatchCreateDerivativeLimitOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCreateDerivativeLimitOrdersAuthz): Uint8Array { + return BatchCreateDerivativeLimitOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCreateDerivativeLimitOrdersAuthz): BatchCreateDerivativeLimitOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCreateDerivativeLimitOrdersAuthz", + value: BatchCreateDerivativeLimitOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCreateDerivativeLimitOrdersAuthz.typeUrl, BatchCreateDerivativeLimitOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCreateDerivativeLimitOrdersAuthz.aminoType, BatchCreateDerivativeLimitOrdersAuthz.typeUrl); +function createBaseCancelDerivativeOrderAuthz(): CancelDerivativeOrderAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const CancelDerivativeOrderAuthz = { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz", + aminoType: "exchange/CancelDerivativeOrderAuthz", + is(o: any): o is CancelDerivativeOrderAuthz { + return o && (o.$typeUrl === CancelDerivativeOrderAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is CancelDerivativeOrderAuthzAmino { + return o && (o.$typeUrl === CancelDerivativeOrderAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: CancelDerivativeOrderAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelDerivativeOrderAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelDerivativeOrderAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CancelDerivativeOrderAuthz { + const message = createBaseCancelDerivativeOrderAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: CancelDerivativeOrderAuthzAmino): CancelDerivativeOrderAuthz { + const message = createBaseCancelDerivativeOrderAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: CancelDerivativeOrderAuthzAminoMsg): CancelDerivativeOrderAuthz { + return CancelDerivativeOrderAuthz.fromAmino(object.value); + }, + toAminoMsg(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzAminoMsg { + return { + type: "exchange/CancelDerivativeOrderAuthz", + value: CancelDerivativeOrderAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: CancelDerivativeOrderAuthzProtoMsg): CancelDerivativeOrderAuthz { + return CancelDerivativeOrderAuthz.decode(message.value); + }, + toProto(message: CancelDerivativeOrderAuthz): Uint8Array { + return CancelDerivativeOrderAuthz.encode(message).finish(); + }, + toProtoMsg(message: CancelDerivativeOrderAuthz): CancelDerivativeOrderAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CancelDerivativeOrderAuthz", + value: CancelDerivativeOrderAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CancelDerivativeOrderAuthz.typeUrl, CancelDerivativeOrderAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelDerivativeOrderAuthz.aminoType, CancelDerivativeOrderAuthz.typeUrl); +function createBaseBatchCancelDerivativeOrdersAuthz(): BatchCancelDerivativeOrdersAuthz { + return { + subaccountId: "", + marketIds: [] + }; +} +export const BatchCancelDerivativeOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz", + aminoType: "exchange/BatchCancelDerivativeOrdersAuthz", + is(o: any): o is BatchCancelDerivativeOrdersAuthz { + return o && (o.$typeUrl === BatchCancelDerivativeOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is BatchCancelDerivativeOrdersAuthzAmino { + return o && (o.$typeUrl === BatchCancelDerivativeOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: BatchCancelDerivativeOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCancelDerivativeOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCancelDerivativeOrdersAuthz { + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchCancelDerivativeOrdersAuthzAmino): BatchCancelDerivativeOrdersAuthz { + const message = createBaseBatchCancelDerivativeOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: BatchCancelDerivativeOrdersAuthzAminoMsg): BatchCancelDerivativeOrdersAuthz { + return BatchCancelDerivativeOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzAminoMsg { + return { + type: "exchange/BatchCancelDerivativeOrdersAuthz", + value: BatchCancelDerivativeOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCancelDerivativeOrdersAuthzProtoMsg): BatchCancelDerivativeOrdersAuthz { + return BatchCancelDerivativeOrdersAuthz.decode(message.value); + }, + toProto(message: BatchCancelDerivativeOrdersAuthz): Uint8Array { + return BatchCancelDerivativeOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchCancelDerivativeOrdersAuthz): BatchCancelDerivativeOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCancelDerivativeOrdersAuthz", + value: BatchCancelDerivativeOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCancelDerivativeOrdersAuthz.typeUrl, BatchCancelDerivativeOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCancelDerivativeOrdersAuthz.aminoType, BatchCancelDerivativeOrdersAuthz.typeUrl); +function createBaseBatchUpdateOrdersAuthz(): BatchUpdateOrdersAuthz { + return { + subaccountId: "", + spotMarkets: [], + derivativeMarkets: [] + }; +} +export const BatchUpdateOrdersAuthz = { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz", + aminoType: "exchange/BatchUpdateOrdersAuthz", + is(o: any): o is BatchUpdateOrdersAuthz { + return o && (o.$typeUrl === BatchUpdateOrdersAuthz.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.spotMarkets) && (!o.spotMarkets.length || typeof o.spotMarkets[0] === "string") && Array.isArray(o.derivativeMarkets) && (!o.derivativeMarkets.length || typeof o.derivativeMarkets[0] === "string")); + }, + isAmino(o: any): o is BatchUpdateOrdersAuthzAmino { + return o && (o.$typeUrl === BatchUpdateOrdersAuthz.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.spot_markets) && (!o.spot_markets.length || typeof o.spot_markets[0] === "string") && Array.isArray(o.derivative_markets) && (!o.derivative_markets.length || typeof o.derivative_markets[0] === "string")); + }, + encode(message: BatchUpdateOrdersAuthz, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.spotMarkets) { + writer.uint32(18).string(v!); + } + for (const v of message.derivativeMarkets) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchUpdateOrdersAuthz { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchUpdateOrdersAuthz(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.spotMarkets.push(reader.string()); + break; + case 3: + message.derivativeMarkets.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchUpdateOrdersAuthz { + const message = createBaseBatchUpdateOrdersAuthz(); + message.subaccountId = object.subaccountId ?? ""; + message.spotMarkets = object.spotMarkets?.map(e => e) || []; + message.derivativeMarkets = object.derivativeMarkets?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchUpdateOrdersAuthzAmino): BatchUpdateOrdersAuthz { + const message = createBaseBatchUpdateOrdersAuthz(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.spotMarkets = object.spot_markets?.map(e => e) || []; + message.derivativeMarkets = object.derivative_markets?.map(e => e) || []; + return message; + }, + toAmino(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.spotMarkets) { + obj.spot_markets = message.spotMarkets.map(e => e); + } else { + obj.spot_markets = message.spotMarkets; + } + if (message.derivativeMarkets) { + obj.derivative_markets = message.derivativeMarkets.map(e => e); + } else { + obj.derivative_markets = message.derivativeMarkets; + } + return obj; + }, + fromAminoMsg(object: BatchUpdateOrdersAuthzAminoMsg): BatchUpdateOrdersAuthz { + return BatchUpdateOrdersAuthz.fromAmino(object.value); + }, + toAminoMsg(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzAminoMsg { + return { + type: "exchange/BatchUpdateOrdersAuthz", + value: BatchUpdateOrdersAuthz.toAmino(message) + }; + }, + fromProtoMsg(message: BatchUpdateOrdersAuthzProtoMsg): BatchUpdateOrdersAuthz { + return BatchUpdateOrdersAuthz.decode(message.value); + }, + toProto(message: BatchUpdateOrdersAuthz): Uint8Array { + return BatchUpdateOrdersAuthz.encode(message).finish(); + }, + toProtoMsg(message: BatchUpdateOrdersAuthz): BatchUpdateOrdersAuthzProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchUpdateOrdersAuthz", + value: BatchUpdateOrdersAuthz.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchUpdateOrdersAuthz.typeUrl, BatchUpdateOrdersAuthz); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchUpdateOrdersAuthz.aminoType, BatchUpdateOrdersAuthz.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/events.ts b/libs/injectivejs/src/injective/exchange/v1beta1/events.ts new file mode 100644 index 00000000..133514d5 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/events.ts @@ -0,0 +1,4016 @@ +import { ExecutionType, TradeLog, TradeLogAmino, DerivativeTradeLog, DerivativeTradeLogAmino, SubaccountPosition, SubaccountPositionAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, SpotMarket, SpotMarketAmino, DerivativeMarket, DerivativeMarketAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, DepositUpdate, DepositUpdateAmino, DerivativeMarketOrder, DerivativeMarketOrderAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, AccountRewards, AccountRewardsAmino, DerivativeOrder, DerivativeOrderAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino, Level, LevelAmino, GrantAuthorization, GrantAuthorizationAmino } from "./exchange"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventBatchSpotExecution { + marketId: string; + isBuy: boolean; + executionType: ExecutionType; + trades: TradeLog[]; +} +export interface EventBatchSpotExecutionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution"; + value: Uint8Array; +} +export interface EventBatchSpotExecutionAmino { + market_id: string; + is_buy: boolean; + executionType: ExecutionType; + trades: TradeLogAmino[]; +} +export interface EventBatchSpotExecutionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchSpotExecution"; + value: EventBatchSpotExecutionAmino; +} +export interface EventBatchDerivativeExecution { + marketId: string; + isBuy: boolean; + isLiquidation: boolean; + /** nil for time expiry futures */ + cumulativeFunding?: string; + executionType: ExecutionType; + trades: DerivativeTradeLog[]; +} +export interface EventBatchDerivativeExecutionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution"; + value: Uint8Array; +} +export interface EventBatchDerivativeExecutionAmino { + market_id: string; + is_buy: boolean; + is_liquidation: boolean; + /** nil for time expiry futures */ + cumulative_funding?: string; + executionType: ExecutionType; + trades: DerivativeTradeLogAmino[]; +} +export interface EventBatchDerivativeExecutionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDerivativeExecution"; + value: EventBatchDerivativeExecutionAmino; +} +export interface EventLostFundsFromLiquidation { + marketId: string; + subaccountId: Uint8Array; + lostFundsFromAvailableDuringPayout: string; + lostFundsFromOrderCancels: string; +} +export interface EventLostFundsFromLiquidationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation"; + value: Uint8Array; +} +export interface EventLostFundsFromLiquidationAmino { + market_id: string; + subaccount_id: string; + lost_funds_from_available_during_payout: string; + lost_funds_from_order_cancels: string; +} +export interface EventLostFundsFromLiquidationAminoMsg { + type: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation"; + value: EventLostFundsFromLiquidationAmino; +} +export interface EventBatchDerivativePosition { + marketId: string; + positions: SubaccountPosition[]; +} +export interface EventBatchDerivativePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition"; + value: Uint8Array; +} +export interface EventBatchDerivativePositionAmino { + market_id: string; + positions: SubaccountPositionAmino[]; +} +export interface EventBatchDerivativePositionAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDerivativePosition"; + value: EventBatchDerivativePositionAmino; +} +export interface EventDerivativeMarketPaused { + marketId: string; + settlePrice: string; + totalMissingFunds: string; + missingFundsRate: string; +} +export interface EventDerivativeMarketPausedProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused"; + value: Uint8Array; +} +export interface EventDerivativeMarketPausedAmino { + market_id: string; + settle_price: string; + total_missing_funds: string; + missing_funds_rate: string; +} +export interface EventDerivativeMarketPausedAminoMsg { + type: "/injective.exchange.v1beta1.EventDerivativeMarketPaused"; + value: EventDerivativeMarketPausedAmino; +} +export interface EventMarketBeyondBankruptcy { + marketId: string; + settlePrice: string; + missingMarketFunds: string; +} +export interface EventMarketBeyondBankruptcyProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy"; + value: Uint8Array; +} +export interface EventMarketBeyondBankruptcyAmino { + market_id: string; + settle_price: string; + missing_market_funds: string; +} +export interface EventMarketBeyondBankruptcyAminoMsg { + type: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy"; + value: EventMarketBeyondBankruptcyAmino; +} +export interface EventAllPositionsHaircut { + marketId: string; + settlePrice: string; + missingFundsRate: string; +} +export interface EventAllPositionsHaircutProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut"; + value: Uint8Array; +} +export interface EventAllPositionsHaircutAmino { + market_id: string; + settle_price: string; + missing_funds_rate: string; +} +export interface EventAllPositionsHaircutAminoMsg { + type: "/injective.exchange.v1beta1.EventAllPositionsHaircut"; + value: EventAllPositionsHaircutAmino; +} +export interface EventBinaryOptionsMarketUpdate { + market: BinaryOptionsMarket; +} +export interface EventBinaryOptionsMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate"; + value: Uint8Array; +} +export interface EventBinaryOptionsMarketUpdateAmino { + market: BinaryOptionsMarketAmino; +} +export interface EventBinaryOptionsMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate"; + value: EventBinaryOptionsMarketUpdateAmino; +} +export interface EventNewSpotOrders { + marketId: string; + buyOrders: SpotLimitOrder[]; + sellOrders: SpotLimitOrder[]; +} +export interface EventNewSpotOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders"; + value: Uint8Array; +} +export interface EventNewSpotOrdersAmino { + market_id: string; + buy_orders: SpotLimitOrderAmino[]; + sell_orders: SpotLimitOrderAmino[]; +} +export interface EventNewSpotOrdersAminoMsg { + type: "/injective.exchange.v1beta1.EventNewSpotOrders"; + value: EventNewSpotOrdersAmino; +} +export interface EventNewDerivativeOrders { + marketId: string; + buyOrders: DerivativeLimitOrder[]; + sellOrders: DerivativeLimitOrder[]; +} +export interface EventNewDerivativeOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders"; + value: Uint8Array; +} +export interface EventNewDerivativeOrdersAmino { + market_id: string; + buy_orders: DerivativeLimitOrderAmino[]; + sell_orders: DerivativeLimitOrderAmino[]; +} +export interface EventNewDerivativeOrdersAminoMsg { + type: "/injective.exchange.v1beta1.EventNewDerivativeOrders"; + value: EventNewDerivativeOrdersAmino; +} +export interface EventCancelSpotOrder { + marketId: string; + order: SpotLimitOrder; +} +export interface EventCancelSpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder"; + value: Uint8Array; +} +export interface EventCancelSpotOrderAmino { + market_id: string; + order: SpotLimitOrderAmino; +} +export interface EventCancelSpotOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelSpotOrder"; + value: EventCancelSpotOrderAmino; +} +export interface EventSpotMarketUpdate { + market: SpotMarket; +} +export interface EventSpotMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate"; + value: Uint8Array; +} +export interface EventSpotMarketUpdateAmino { + market: SpotMarketAmino; +} +export interface EventSpotMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventSpotMarketUpdate"; + value: EventSpotMarketUpdateAmino; +} +export interface EventPerpetualMarketUpdate { + market: DerivativeMarket; + perpetualMarketInfo?: PerpetualMarketInfo; + funding?: PerpetualMarketFunding; +} +export interface EventPerpetualMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate"; + value: Uint8Array; +} +export interface EventPerpetualMarketUpdateAmino { + market: DerivativeMarketAmino; + perpetual_market_info?: PerpetualMarketInfoAmino; + funding?: PerpetualMarketFundingAmino; +} +export interface EventPerpetualMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate"; + value: EventPerpetualMarketUpdateAmino; +} +export interface EventExpiryFuturesMarketUpdate { + market: DerivativeMarket; + expiryFuturesMarketInfo?: ExpiryFuturesMarketInfo; +} +export interface EventExpiryFuturesMarketUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate"; + value: Uint8Array; +} +export interface EventExpiryFuturesMarketUpdateAmino { + market: DerivativeMarketAmino; + expiry_futures_market_info?: ExpiryFuturesMarketInfoAmino; +} +export interface EventExpiryFuturesMarketUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate"; + value: EventExpiryFuturesMarketUpdateAmino; +} +export interface EventPerpetualMarketFundingUpdate { + marketId: string; + funding: PerpetualMarketFunding; + isHourlyFunding: boolean; + fundingRate?: string; + markPrice?: string; +} +export interface EventPerpetualMarketFundingUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate"; + value: Uint8Array; +} +export interface EventPerpetualMarketFundingUpdateAmino { + market_id: string; + funding: PerpetualMarketFundingAmino; + is_hourly_funding: boolean; + funding_rate?: string; + mark_price?: string; +} +export interface EventPerpetualMarketFundingUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate"; + value: EventPerpetualMarketFundingUpdateAmino; +} +export interface EventSubaccountDeposit { + srcAddress: string; + subaccountId: Uint8Array; + amount: Coin; +} +export interface EventSubaccountDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit"; + value: Uint8Array; +} +export interface EventSubaccountDepositAmino { + src_address: string; + subaccount_id: string; + amount: CoinAmino; +} +export interface EventSubaccountDepositAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountDeposit"; + value: EventSubaccountDepositAmino; +} +export interface EventSubaccountWithdraw { + subaccountId: Uint8Array; + dstAddress: string; + amount: Coin; +} +export interface EventSubaccountWithdrawProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw"; + value: Uint8Array; +} +export interface EventSubaccountWithdrawAmino { + subaccount_id: string; + dst_address: string; + amount: CoinAmino; +} +export interface EventSubaccountWithdrawAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountWithdraw"; + value: EventSubaccountWithdrawAmino; +} +export interface EventSubaccountBalanceTransfer { + srcSubaccountId: string; + dstSubaccountId: string; + amount: Coin; +} +export interface EventSubaccountBalanceTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer"; + value: Uint8Array; +} +export interface EventSubaccountBalanceTransferAmino { + src_subaccount_id: string; + dst_subaccount_id: string; + amount: CoinAmino; +} +export interface EventSubaccountBalanceTransferAminoMsg { + type: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer"; + value: EventSubaccountBalanceTransferAmino; +} +export interface EventBatchDepositUpdate { + depositUpdates: DepositUpdate[]; +} +export interface EventBatchDepositUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate"; + value: Uint8Array; +} +export interface EventBatchDepositUpdateAmino { + deposit_updates: DepositUpdateAmino[]; +} +export interface EventBatchDepositUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventBatchDepositUpdate"; + value: EventBatchDepositUpdateAmino; +} +export interface DerivativeMarketOrderCancel { + marketOrder?: DerivativeMarketOrder; + cancelQuantity: string; +} +export interface DerivativeMarketOrderCancelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel"; + value: Uint8Array; +} +export interface DerivativeMarketOrderCancelAmino { + market_order?: DerivativeMarketOrderAmino; + cancel_quantity: string; +} +export interface DerivativeMarketOrderCancelAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel"; + value: DerivativeMarketOrderCancelAmino; +} +export interface EventCancelDerivativeOrder { + marketId: string; + isLimitCancel: boolean; + limitOrder?: DerivativeLimitOrder; + marketOrderCancel?: DerivativeMarketOrderCancel; +} +export interface EventCancelDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder"; + value: Uint8Array; +} +export interface EventCancelDerivativeOrderAmino { + market_id: string; + isLimitCancel: boolean; + limit_order?: DerivativeLimitOrderAmino; + market_order_cancel?: DerivativeMarketOrderCancelAmino; +} +export interface EventCancelDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelDerivativeOrder"; + value: EventCancelDerivativeOrderAmino; +} +export interface EventFeeDiscountSchedule { + schedule?: FeeDiscountSchedule; +} +export interface EventFeeDiscountScheduleProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule"; + value: Uint8Array; +} +export interface EventFeeDiscountScheduleAmino { + schedule?: FeeDiscountScheduleAmino; +} +export interface EventFeeDiscountScheduleAminoMsg { + type: "/injective.exchange.v1beta1.EventFeeDiscountSchedule"; + value: EventFeeDiscountScheduleAmino; +} +export interface EventTradingRewardCampaignUpdate { + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPools: CampaignRewardPool[]; +} +export interface EventTradingRewardCampaignUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate"; + value: Uint8Array; +} +export interface EventTradingRewardCampaignUpdateAmino { + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools: CampaignRewardPoolAmino[]; +} +export interface EventTradingRewardCampaignUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate"; + value: EventTradingRewardCampaignUpdateAmino; +} +export interface EventTradingRewardDistribution { + accountRewards: AccountRewards[]; +} +export interface EventTradingRewardDistributionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution"; + value: Uint8Array; +} +export interface EventTradingRewardDistributionAmino { + account_rewards: AccountRewardsAmino[]; +} +export interface EventTradingRewardDistributionAminoMsg { + type: "/injective.exchange.v1beta1.EventTradingRewardDistribution"; + value: EventTradingRewardDistributionAmino; +} +export interface EventNewConditionalDerivativeOrder { + marketId: string; + order?: DerivativeOrder; + hash: Uint8Array; + isMarket: boolean; +} +export interface EventNewConditionalDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder"; + value: Uint8Array; +} +export interface EventNewConditionalDerivativeOrderAmino { + market_id: string; + order?: DerivativeOrderAmino; + hash: string; + is_market: boolean; +} +export interface EventNewConditionalDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder"; + value: EventNewConditionalDerivativeOrderAmino; +} +export interface EventCancelConditionalDerivativeOrder { + marketId: string; + isLimitCancel: boolean; + limitOrder?: DerivativeLimitOrder; + marketOrder?: DerivativeMarketOrder; +} +export interface EventCancelConditionalDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder"; + value: Uint8Array; +} +export interface EventCancelConditionalDerivativeOrderAmino { + market_id: string; + isLimitCancel: boolean; + limit_order?: DerivativeLimitOrderAmino; + market_order?: DerivativeMarketOrderAmino; +} +export interface EventCancelConditionalDerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder"; + value: EventCancelConditionalDerivativeOrderAmino; +} +export interface EventConditionalDerivativeOrderTrigger { + marketId: Uint8Array; + isLimitTrigger: boolean; + triggeredOrderHash: Uint8Array; + placedOrderHash: Uint8Array; + triggeredOrderCid: string; +} +export interface EventConditionalDerivativeOrderTriggerProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger"; + value: Uint8Array; +} +export interface EventConditionalDerivativeOrderTriggerAmino { + market_id: string; + isLimitTrigger: boolean; + triggered_order_hash: string; + placed_order_hash: string; + triggered_order_cid: string; +} +export interface EventConditionalDerivativeOrderTriggerAminoMsg { + type: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger"; + value: EventConditionalDerivativeOrderTriggerAmino; +} +export interface EventOrderFail { + account: Uint8Array; + hashes: Uint8Array[]; + flags: number[]; + cids: string[]; +} +export interface EventOrderFailProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail"; + value: Uint8Array; +} +export interface EventOrderFailAmino { + account: string; + hashes: string[]; + flags: number[]; + cids: string[]; +} +export interface EventOrderFailAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderFail"; + value: EventOrderFailAmino; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdated { + marketFeeMultipliers: MarketFeeMultiplier[]; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated"; + value: Uint8Array; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + market_fee_multipliers: MarketFeeMultiplierAmino[]; +} +export interface EventAtomicMarketOrderFeeMultipliersUpdatedAminoMsg { + type: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated"; + value: EventAtomicMarketOrderFeeMultipliersUpdatedAmino; +} +export interface EventOrderbookUpdate { + spotUpdates: OrderbookUpdate[]; + derivativeUpdates: OrderbookUpdate[]; +} +export interface EventOrderbookUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate"; + value: Uint8Array; +} +export interface EventOrderbookUpdateAmino { + spot_updates: OrderbookUpdateAmino[]; + derivative_updates: OrderbookUpdateAmino[]; +} +export interface EventOrderbookUpdateAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderbookUpdate"; + value: EventOrderbookUpdateAmino; +} +export interface OrderbookUpdate { + seq: bigint; + orderbook?: Orderbook; +} +export interface OrderbookUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate"; + value: Uint8Array; +} +export interface OrderbookUpdateAmino { + seq: string; + orderbook?: OrderbookAmino; +} +export interface OrderbookUpdateAminoMsg { + type: "/injective.exchange.v1beta1.OrderbookUpdate"; + value: OrderbookUpdateAmino; +} +export interface Orderbook { + marketId: Uint8Array; + buyLevels: Level[]; + sellLevels: Level[]; +} +export interface OrderbookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Orderbook"; + value: Uint8Array; +} +export interface OrderbookAmino { + market_id: string; + buy_levels: LevelAmino[]; + sell_levels: LevelAmino[]; +} +export interface OrderbookAminoMsg { + type: "/injective.exchange.v1beta1.Orderbook"; + value: OrderbookAmino; +} +export interface EventGrantAuthorizations { + granter: string; + grants: GrantAuthorization[]; +} +export interface EventGrantAuthorizationsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations"; + value: Uint8Array; +} +export interface EventGrantAuthorizationsAmino { + granter: string; + grants: GrantAuthorizationAmino[]; +} +export interface EventGrantAuthorizationsAminoMsg { + type: "/injective.exchange.v1beta1.EventGrantAuthorizations"; + value: EventGrantAuthorizationsAmino; +} +export interface EventGrantActivation { + grantee: string; + granter: string; + amount: string; +} +export interface EventGrantActivationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation"; + value: Uint8Array; +} +export interface EventGrantActivationAmino { + grantee: string; + granter: string; + amount: string; +} +export interface EventGrantActivationAminoMsg { + type: "/injective.exchange.v1beta1.EventGrantActivation"; + value: EventGrantActivationAmino; +} +export interface EventInvalidGrant { + grantee: string; + granter: string; +} +export interface EventInvalidGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant"; + value: Uint8Array; +} +export interface EventInvalidGrantAmino { + grantee: string; + granter: string; +} +export interface EventInvalidGrantAminoMsg { + type: "/injective.exchange.v1beta1.EventInvalidGrant"; + value: EventInvalidGrantAmino; +} +export interface EventOrderCancelFail { + marketId: string; + subaccountId: string; + orderHash: string; + cid: string; + description: string; +} +export interface EventOrderCancelFailProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail"; + value: Uint8Array; +} +export interface EventOrderCancelFailAmino { + market_id: string; + subaccount_id: string; + order_hash: string; + cid: string; + description: string; +} +export interface EventOrderCancelFailAminoMsg { + type: "/injective.exchange.v1beta1.EventOrderCancelFail"; + value: EventOrderCancelFailAmino; +} +function createBaseEventBatchSpotExecution(): EventBatchSpotExecution { + return { + marketId: "", + isBuy: false, + executionType: 0, + trades: [] + }; +} +export const EventBatchSpotExecution = { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution", + is(o: any): o is EventBatchSpotExecution { + return o && (o.$typeUrl === EventBatchSpotExecution.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || TradeLog.is(o.trades[0]))); + }, + isAmino(o: any): o is EventBatchSpotExecutionAmino { + return o && (o.$typeUrl === EventBatchSpotExecution.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || TradeLog.isAmino(o.trades[0]))); + }, + encode(message: EventBatchSpotExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== 0) { + writer.uint32(24).int32(message.executionType); + } + for (const v of message.trades) { + TradeLog.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchSpotExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchSpotExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = (reader.int32() as any); + break; + case 4: + message.trades.push(TradeLog.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchSpotExecution { + const message = createBaseEventBatchSpotExecution(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? 0; + message.trades = object.trades?.map(e => TradeLog.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchSpotExecutionAmino): EventBatchSpotExecution { + const message = createBaseEventBatchSpotExecution(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + message.trades = object.trades?.map(e => TradeLog.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchSpotExecution): EventBatchSpotExecutionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === 0 ? undefined : message.executionType; + if (message.trades) { + obj.trades = message.trades.map(e => e ? TradeLog.toAmino(e) : undefined); + } else { + obj.trades = message.trades; + } + return obj; + }, + fromAminoMsg(object: EventBatchSpotExecutionAminoMsg): EventBatchSpotExecution { + return EventBatchSpotExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchSpotExecutionProtoMsg): EventBatchSpotExecution { + return EventBatchSpotExecution.decode(message.value); + }, + toProto(message: EventBatchSpotExecution): Uint8Array { + return EventBatchSpotExecution.encode(message).finish(); + }, + toProtoMsg(message: EventBatchSpotExecution): EventBatchSpotExecutionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchSpotExecution", + value: EventBatchSpotExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchSpotExecution.typeUrl, EventBatchSpotExecution); +function createBaseEventBatchDerivativeExecution(): EventBatchDerivativeExecution { + return { + marketId: "", + isBuy: false, + isLiquidation: false, + cumulativeFunding: undefined, + executionType: 0, + trades: [] + }; +} +export const EventBatchDerivativeExecution = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution", + is(o: any): o is EventBatchDerivativeExecution { + return o && (o.$typeUrl === EventBatchDerivativeExecution.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.isLiquidation === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || DerivativeTradeLog.is(o.trades[0]))); + }, + isAmino(o: any): o is EventBatchDerivativeExecutionAmino { + return o && (o.$typeUrl === EventBatchDerivativeExecution.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.is_liquidation === "boolean" && isSet(o.executionType) && Array.isArray(o.trades) && (!o.trades.length || DerivativeTradeLog.isAmino(o.trades[0]))); + }, + encode(message: EventBatchDerivativeExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.isLiquidation === true) { + writer.uint32(24).bool(message.isLiquidation); + } + if (message.cumulativeFunding !== undefined) { + writer.uint32(34).string(message.cumulativeFunding); + } + if (message.executionType !== 0) { + writer.uint32(40).int32(message.executionType); + } + for (const v of message.trades) { + DerivativeTradeLog.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDerivativeExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDerivativeExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.isLiquidation = reader.bool(); + break; + case 4: + message.cumulativeFunding = reader.string(); + break; + case 5: + message.executionType = (reader.int32() as any); + break; + case 6: + message.trades.push(DerivativeTradeLog.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDerivativeExecution { + const message = createBaseEventBatchDerivativeExecution(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.isLiquidation = object.isLiquidation ?? false; + message.cumulativeFunding = object.cumulativeFunding ?? undefined; + message.executionType = object.executionType ?? 0; + message.trades = object.trades?.map(e => DerivativeTradeLog.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDerivativeExecutionAmino): EventBatchDerivativeExecution { + const message = createBaseEventBatchDerivativeExecution(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.is_liquidation !== undefined && object.is_liquidation !== null) { + message.isLiquidation = object.is_liquidation; + } + if (object.cumulative_funding !== undefined && object.cumulative_funding !== null) { + message.cumulativeFunding = object.cumulative_funding; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + message.trades = object.trades?.map(e => DerivativeTradeLog.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDerivativeExecution): EventBatchDerivativeExecutionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.is_liquidation = message.isLiquidation === false ? undefined : message.isLiquidation; + obj.cumulative_funding = message.cumulativeFunding === null ? undefined : message.cumulativeFunding; + obj.executionType = message.executionType === 0 ? undefined : message.executionType; + if (message.trades) { + obj.trades = message.trades.map(e => e ? DerivativeTradeLog.toAmino(e) : undefined); + } else { + obj.trades = message.trades; + } + return obj; + }, + fromAminoMsg(object: EventBatchDerivativeExecutionAminoMsg): EventBatchDerivativeExecution { + return EventBatchDerivativeExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDerivativeExecutionProtoMsg): EventBatchDerivativeExecution { + return EventBatchDerivativeExecution.decode(message.value); + }, + toProto(message: EventBatchDerivativeExecution): Uint8Array { + return EventBatchDerivativeExecution.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDerivativeExecution): EventBatchDerivativeExecutionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativeExecution", + value: EventBatchDerivativeExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDerivativeExecution.typeUrl, EventBatchDerivativeExecution); +function createBaseEventLostFundsFromLiquidation(): EventLostFundsFromLiquidation { + return { + marketId: "", + subaccountId: new Uint8Array(), + lostFundsFromAvailableDuringPayout: "", + lostFundsFromOrderCancels: "" + }; +} +export const EventLostFundsFromLiquidation = { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation", + is(o: any): o is EventLostFundsFromLiquidation { + return o && (o.$typeUrl === EventLostFundsFromLiquidation.typeUrl || typeof o.marketId === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.lostFundsFromAvailableDuringPayout === "string" && typeof o.lostFundsFromOrderCancels === "string"); + }, + isAmino(o: any): o is EventLostFundsFromLiquidationAmino { + return o && (o.$typeUrl === EventLostFundsFromLiquidation.typeUrl || typeof o.market_id === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.lost_funds_from_available_during_payout === "string" && typeof o.lost_funds_from_order_cancels === "string"); + }, + encode(message: EventLostFundsFromLiquidation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + if (message.lostFundsFromAvailableDuringPayout !== "") { + writer.uint32(26).string(message.lostFundsFromAvailableDuringPayout); + } + if (message.lostFundsFromOrderCancels !== "") { + writer.uint32(34).string(message.lostFundsFromOrderCancels); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventLostFundsFromLiquidation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventLostFundsFromLiquidation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + case 3: + message.lostFundsFromAvailableDuringPayout = reader.string(); + break; + case 4: + message.lostFundsFromOrderCancels = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventLostFundsFromLiquidation { + const message = createBaseEventLostFundsFromLiquidation(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.lostFundsFromAvailableDuringPayout = object.lostFundsFromAvailableDuringPayout ?? ""; + message.lostFundsFromOrderCancels = object.lostFundsFromOrderCancels ?? ""; + return message; + }, + fromAmino(object: EventLostFundsFromLiquidationAmino): EventLostFundsFromLiquidation { + const message = createBaseEventLostFundsFromLiquidation(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.lost_funds_from_available_during_payout !== undefined && object.lost_funds_from_available_during_payout !== null) { + message.lostFundsFromAvailableDuringPayout = object.lost_funds_from_available_during_payout; + } + if (object.lost_funds_from_order_cancels !== undefined && object.lost_funds_from_order_cancels !== null) { + message.lostFundsFromOrderCancels = object.lost_funds_from_order_cancels; + } + return message; + }, + toAmino(message: EventLostFundsFromLiquidation): EventLostFundsFromLiquidationAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.lost_funds_from_available_during_payout = message.lostFundsFromAvailableDuringPayout === "" ? undefined : message.lostFundsFromAvailableDuringPayout; + obj.lost_funds_from_order_cancels = message.lostFundsFromOrderCancels === "" ? undefined : message.lostFundsFromOrderCancels; + return obj; + }, + fromAminoMsg(object: EventLostFundsFromLiquidationAminoMsg): EventLostFundsFromLiquidation { + return EventLostFundsFromLiquidation.fromAmino(object.value); + }, + fromProtoMsg(message: EventLostFundsFromLiquidationProtoMsg): EventLostFundsFromLiquidation { + return EventLostFundsFromLiquidation.decode(message.value); + }, + toProto(message: EventLostFundsFromLiquidation): Uint8Array { + return EventLostFundsFromLiquidation.encode(message).finish(); + }, + toProtoMsg(message: EventLostFundsFromLiquidation): EventLostFundsFromLiquidationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventLostFundsFromLiquidation", + value: EventLostFundsFromLiquidation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventLostFundsFromLiquidation.typeUrl, EventLostFundsFromLiquidation); +function createBaseEventBatchDerivativePosition(): EventBatchDerivativePosition { + return { + marketId: "", + positions: [] + }; +} +export const EventBatchDerivativePosition = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition", + is(o: any): o is EventBatchDerivativePosition { + return o && (o.$typeUrl === EventBatchDerivativePosition.typeUrl || typeof o.marketId === "string" && Array.isArray(o.positions) && (!o.positions.length || SubaccountPosition.is(o.positions[0]))); + }, + isAmino(o: any): o is EventBatchDerivativePositionAmino { + return o && (o.$typeUrl === EventBatchDerivativePosition.typeUrl || typeof o.market_id === "string" && Array.isArray(o.positions) && (!o.positions.length || SubaccountPosition.isAmino(o.positions[0]))); + }, + encode(message: EventBatchDerivativePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.positions) { + SubaccountPosition.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDerivativePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDerivativePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.positions.push(SubaccountPosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDerivativePosition { + const message = createBaseEventBatchDerivativePosition(); + message.marketId = object.marketId ?? ""; + message.positions = object.positions?.map(e => SubaccountPosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDerivativePositionAmino): EventBatchDerivativePosition { + const message = createBaseEventBatchDerivativePosition(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.positions = object.positions?.map(e => SubaccountPosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDerivativePosition): EventBatchDerivativePositionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.positions) { + obj.positions = message.positions.map(e => e ? SubaccountPosition.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + return obj; + }, + fromAminoMsg(object: EventBatchDerivativePositionAminoMsg): EventBatchDerivativePosition { + return EventBatchDerivativePosition.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDerivativePositionProtoMsg): EventBatchDerivativePosition { + return EventBatchDerivativePosition.decode(message.value); + }, + toProto(message: EventBatchDerivativePosition): Uint8Array { + return EventBatchDerivativePosition.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDerivativePosition): EventBatchDerivativePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDerivativePosition", + value: EventBatchDerivativePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDerivativePosition.typeUrl, EventBatchDerivativePosition); +function createBaseEventDerivativeMarketPaused(): EventDerivativeMarketPaused { + return { + marketId: "", + settlePrice: "", + totalMissingFunds: "", + missingFundsRate: "" + }; +} +export const EventDerivativeMarketPaused = { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused", + is(o: any): o is EventDerivativeMarketPaused { + return o && (o.$typeUrl === EventDerivativeMarketPaused.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.totalMissingFunds === "string" && typeof o.missingFundsRate === "string"); + }, + isAmino(o: any): o is EventDerivativeMarketPausedAmino { + return o && (o.$typeUrl === EventDerivativeMarketPaused.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.total_missing_funds === "string" && typeof o.missing_funds_rate === "string"); + }, + encode(message: EventDerivativeMarketPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.totalMissingFunds !== "") { + writer.uint32(26).string(message.totalMissingFunds); + } + if (message.missingFundsRate !== "") { + writer.uint32(34).string(message.missingFundsRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventDerivativeMarketPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventDerivativeMarketPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.totalMissingFunds = reader.string(); + break; + case 4: + message.missingFundsRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventDerivativeMarketPaused { + const message = createBaseEventDerivativeMarketPaused(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.totalMissingFunds = object.totalMissingFunds ?? ""; + message.missingFundsRate = object.missingFundsRate ?? ""; + return message; + }, + fromAmino(object: EventDerivativeMarketPausedAmino): EventDerivativeMarketPaused { + const message = createBaseEventDerivativeMarketPaused(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.total_missing_funds !== undefined && object.total_missing_funds !== null) { + message.totalMissingFunds = object.total_missing_funds; + } + if (object.missing_funds_rate !== undefined && object.missing_funds_rate !== null) { + message.missingFundsRate = object.missing_funds_rate; + } + return message; + }, + toAmino(message: EventDerivativeMarketPaused): EventDerivativeMarketPausedAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.total_missing_funds = message.totalMissingFunds === "" ? undefined : message.totalMissingFunds; + obj.missing_funds_rate = message.missingFundsRate === "" ? undefined : message.missingFundsRate; + return obj; + }, + fromAminoMsg(object: EventDerivativeMarketPausedAminoMsg): EventDerivativeMarketPaused { + return EventDerivativeMarketPaused.fromAmino(object.value); + }, + fromProtoMsg(message: EventDerivativeMarketPausedProtoMsg): EventDerivativeMarketPaused { + return EventDerivativeMarketPaused.decode(message.value); + }, + toProto(message: EventDerivativeMarketPaused): Uint8Array { + return EventDerivativeMarketPaused.encode(message).finish(); + }, + toProtoMsg(message: EventDerivativeMarketPaused): EventDerivativeMarketPausedProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventDerivativeMarketPaused", + value: EventDerivativeMarketPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventDerivativeMarketPaused.typeUrl, EventDerivativeMarketPaused); +function createBaseEventMarketBeyondBankruptcy(): EventMarketBeyondBankruptcy { + return { + marketId: "", + settlePrice: "", + missingMarketFunds: "" + }; +} +export const EventMarketBeyondBankruptcy = { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy", + is(o: any): o is EventMarketBeyondBankruptcy { + return o && (o.$typeUrl === EventMarketBeyondBankruptcy.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.missingMarketFunds === "string"); + }, + isAmino(o: any): o is EventMarketBeyondBankruptcyAmino { + return o && (o.$typeUrl === EventMarketBeyondBankruptcy.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.missing_market_funds === "string"); + }, + encode(message: EventMarketBeyondBankruptcy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.missingMarketFunds !== "") { + writer.uint32(26).string(message.missingMarketFunds); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventMarketBeyondBankruptcy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMarketBeyondBankruptcy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.missingMarketFunds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventMarketBeyondBankruptcy { + const message = createBaseEventMarketBeyondBankruptcy(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.missingMarketFunds = object.missingMarketFunds ?? ""; + return message; + }, + fromAmino(object: EventMarketBeyondBankruptcyAmino): EventMarketBeyondBankruptcy { + const message = createBaseEventMarketBeyondBankruptcy(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.missing_market_funds !== undefined && object.missing_market_funds !== null) { + message.missingMarketFunds = object.missing_market_funds; + } + return message; + }, + toAmino(message: EventMarketBeyondBankruptcy): EventMarketBeyondBankruptcyAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.missing_market_funds = message.missingMarketFunds === "" ? undefined : message.missingMarketFunds; + return obj; + }, + fromAminoMsg(object: EventMarketBeyondBankruptcyAminoMsg): EventMarketBeyondBankruptcy { + return EventMarketBeyondBankruptcy.fromAmino(object.value); + }, + fromProtoMsg(message: EventMarketBeyondBankruptcyProtoMsg): EventMarketBeyondBankruptcy { + return EventMarketBeyondBankruptcy.decode(message.value); + }, + toProto(message: EventMarketBeyondBankruptcy): Uint8Array { + return EventMarketBeyondBankruptcy.encode(message).finish(); + }, + toProtoMsg(message: EventMarketBeyondBankruptcy): EventMarketBeyondBankruptcyProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventMarketBeyondBankruptcy", + value: EventMarketBeyondBankruptcy.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventMarketBeyondBankruptcy.typeUrl, EventMarketBeyondBankruptcy); +function createBaseEventAllPositionsHaircut(): EventAllPositionsHaircut { + return { + marketId: "", + settlePrice: "", + missingFundsRate: "" + }; +} +export const EventAllPositionsHaircut = { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut", + is(o: any): o is EventAllPositionsHaircut { + return o && (o.$typeUrl === EventAllPositionsHaircut.typeUrl || typeof o.marketId === "string" && typeof o.settlePrice === "string" && typeof o.missingFundsRate === "string"); + }, + isAmino(o: any): o is EventAllPositionsHaircutAmino { + return o && (o.$typeUrl === EventAllPositionsHaircut.typeUrl || typeof o.market_id === "string" && typeof o.settle_price === "string" && typeof o.missing_funds_rate === "string"); + }, + encode(message: EventAllPositionsHaircut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlePrice !== "") { + writer.uint32(18).string(message.settlePrice); + } + if (message.missingFundsRate !== "") { + writer.uint32(26).string(message.missingFundsRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAllPositionsHaircut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAllPositionsHaircut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlePrice = reader.string(); + break; + case 3: + message.missingFundsRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAllPositionsHaircut { + const message = createBaseEventAllPositionsHaircut(); + message.marketId = object.marketId ?? ""; + message.settlePrice = object.settlePrice ?? ""; + message.missingFundsRate = object.missingFundsRate ?? ""; + return message; + }, + fromAmino(object: EventAllPositionsHaircutAmino): EventAllPositionsHaircut { + const message = createBaseEventAllPositionsHaircut(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settle_price !== undefined && object.settle_price !== null) { + message.settlePrice = object.settle_price; + } + if (object.missing_funds_rate !== undefined && object.missing_funds_rate !== null) { + message.missingFundsRate = object.missing_funds_rate; + } + return message; + }, + toAmino(message: EventAllPositionsHaircut): EventAllPositionsHaircutAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settle_price = message.settlePrice === "" ? undefined : message.settlePrice; + obj.missing_funds_rate = message.missingFundsRate === "" ? undefined : message.missingFundsRate; + return obj; + }, + fromAminoMsg(object: EventAllPositionsHaircutAminoMsg): EventAllPositionsHaircut { + return EventAllPositionsHaircut.fromAmino(object.value); + }, + fromProtoMsg(message: EventAllPositionsHaircutProtoMsg): EventAllPositionsHaircut { + return EventAllPositionsHaircut.decode(message.value); + }, + toProto(message: EventAllPositionsHaircut): Uint8Array { + return EventAllPositionsHaircut.encode(message).finish(); + }, + toProtoMsg(message: EventAllPositionsHaircut): EventAllPositionsHaircutProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventAllPositionsHaircut", + value: EventAllPositionsHaircut.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAllPositionsHaircut.typeUrl, EventAllPositionsHaircut); +function createBaseEventBinaryOptionsMarketUpdate(): EventBinaryOptionsMarketUpdate { + return { + market: BinaryOptionsMarket.fromPartial({}) + }; +} +export const EventBinaryOptionsMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate", + is(o: any): o is EventBinaryOptionsMarketUpdate { + return o && (o.$typeUrl === EventBinaryOptionsMarketUpdate.typeUrl || BinaryOptionsMarket.is(o.market)); + }, + isAmino(o: any): o is EventBinaryOptionsMarketUpdateAmino { + return o && (o.$typeUrl === EventBinaryOptionsMarketUpdate.typeUrl || BinaryOptionsMarket.isAmino(o.market)); + }, + encode(message: EventBinaryOptionsMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + BinaryOptionsMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBinaryOptionsMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBinaryOptionsMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = BinaryOptionsMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBinaryOptionsMarketUpdate { + const message = createBaseEventBinaryOptionsMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? BinaryOptionsMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: EventBinaryOptionsMarketUpdateAmino): EventBinaryOptionsMarketUpdate { + const message = createBaseEventBinaryOptionsMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = BinaryOptionsMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: EventBinaryOptionsMarketUpdate): EventBinaryOptionsMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? BinaryOptionsMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: EventBinaryOptionsMarketUpdateAminoMsg): EventBinaryOptionsMarketUpdate { + return EventBinaryOptionsMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventBinaryOptionsMarketUpdateProtoMsg): EventBinaryOptionsMarketUpdate { + return EventBinaryOptionsMarketUpdate.decode(message.value); + }, + toProto(message: EventBinaryOptionsMarketUpdate): Uint8Array { + return EventBinaryOptionsMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventBinaryOptionsMarketUpdate): EventBinaryOptionsMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBinaryOptionsMarketUpdate", + value: EventBinaryOptionsMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBinaryOptionsMarketUpdate.typeUrl, EventBinaryOptionsMarketUpdate); +function createBaseEventNewSpotOrders(): EventNewSpotOrders { + return { + marketId: "", + buyOrders: [], + sellOrders: [] + }; +} +export const EventNewSpotOrders = { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders", + is(o: any): o is EventNewSpotOrders { + return o && (o.$typeUrl === EventNewSpotOrders.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyOrders) && (!o.buyOrders.length || SpotLimitOrder.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || SpotLimitOrder.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is EventNewSpotOrdersAmino { + return o && (o.$typeUrl === EventNewSpotOrders.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_orders) && (!o.buy_orders.length || SpotLimitOrder.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || SpotLimitOrder.isAmino(o.sell_orders[0]))); + }, + encode(message: EventNewSpotOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyOrders) { + SpotLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellOrders) { + SpotLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewSpotOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewSpotOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyOrders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.sellOrders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewSpotOrders { + const message = createBaseEventNewSpotOrders(); + message.marketId = object.marketId ?? ""; + message.buyOrders = object.buyOrders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventNewSpotOrdersAmino): EventNewSpotOrders { + const message = createBaseEventNewSpotOrders(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyOrders = object.buy_orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventNewSpotOrders): EventNewSpotOrdersAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: EventNewSpotOrdersAminoMsg): EventNewSpotOrders { + return EventNewSpotOrders.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewSpotOrdersProtoMsg): EventNewSpotOrders { + return EventNewSpotOrders.decode(message.value); + }, + toProto(message: EventNewSpotOrders): Uint8Array { + return EventNewSpotOrders.encode(message).finish(); + }, + toProtoMsg(message: EventNewSpotOrders): EventNewSpotOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewSpotOrders", + value: EventNewSpotOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewSpotOrders.typeUrl, EventNewSpotOrders); +function createBaseEventNewDerivativeOrders(): EventNewDerivativeOrders { + return { + marketId: "", + buyOrders: [], + sellOrders: [] + }; +} +export const EventNewDerivativeOrders = { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders", + is(o: any): o is EventNewDerivativeOrders { + return o && (o.$typeUrl === EventNewDerivativeOrders.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyOrders) && (!o.buyOrders.length || DerivativeLimitOrder.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || DerivativeLimitOrder.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is EventNewDerivativeOrdersAmino { + return o && (o.$typeUrl === EventNewDerivativeOrders.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_orders) && (!o.buy_orders.length || DerivativeLimitOrder.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || DerivativeLimitOrder.isAmino(o.sell_orders[0]))); + }, + encode(message: EventNewDerivativeOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewDerivativeOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewDerivativeOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.sellOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewDerivativeOrders { + const message = createBaseEventNewDerivativeOrders(); + message.marketId = object.marketId ?? ""; + message.buyOrders = object.buyOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventNewDerivativeOrdersAmino): EventNewDerivativeOrders { + const message = createBaseEventNewDerivativeOrders(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyOrders = object.buy_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventNewDerivativeOrders): EventNewDerivativeOrdersAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: EventNewDerivativeOrdersAminoMsg): EventNewDerivativeOrders { + return EventNewDerivativeOrders.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewDerivativeOrdersProtoMsg): EventNewDerivativeOrders { + return EventNewDerivativeOrders.decode(message.value); + }, + toProto(message: EventNewDerivativeOrders): Uint8Array { + return EventNewDerivativeOrders.encode(message).finish(); + }, + toProtoMsg(message: EventNewDerivativeOrders): EventNewDerivativeOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewDerivativeOrders", + value: EventNewDerivativeOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewDerivativeOrders.typeUrl, EventNewDerivativeOrders); +function createBaseEventCancelSpotOrder(): EventCancelSpotOrder { + return { + marketId: "", + order: SpotLimitOrder.fromPartial({}) + }; +} +export const EventCancelSpotOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder", + is(o: any): o is EventCancelSpotOrder { + return o && (o.$typeUrl === EventCancelSpotOrder.typeUrl || typeof o.marketId === "string" && SpotLimitOrder.is(o.order)); + }, + isAmino(o: any): o is EventCancelSpotOrderAmino { + return o && (o.$typeUrl === EventCancelSpotOrder.typeUrl || typeof o.market_id === "string" && SpotLimitOrder.isAmino(o.order)); + }, + encode(message: EventCancelSpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + SpotLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelSpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = SpotLimitOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelSpotOrder { + const message = createBaseEventCancelSpotOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotLimitOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: EventCancelSpotOrderAmino): EventCancelSpotOrder { + const message = createBaseEventCancelSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotLimitOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: EventCancelSpotOrder): EventCancelSpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? SpotLimitOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelSpotOrderAminoMsg): EventCancelSpotOrder { + return EventCancelSpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelSpotOrderProtoMsg): EventCancelSpotOrder { + return EventCancelSpotOrder.decode(message.value); + }, + toProto(message: EventCancelSpotOrder): Uint8Array { + return EventCancelSpotOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelSpotOrder): EventCancelSpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelSpotOrder", + value: EventCancelSpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelSpotOrder.typeUrl, EventCancelSpotOrder); +function createBaseEventSpotMarketUpdate(): EventSpotMarketUpdate { + return { + market: SpotMarket.fromPartial({}) + }; +} +export const EventSpotMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate", + is(o: any): o is EventSpotMarketUpdate { + return o && (o.$typeUrl === EventSpotMarketUpdate.typeUrl || SpotMarket.is(o.market)); + }, + isAmino(o: any): o is EventSpotMarketUpdateAmino { + return o && (o.$typeUrl === EventSpotMarketUpdate.typeUrl || SpotMarket.isAmino(o.market)); + }, + encode(message: EventSpotMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSpotMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSpotMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSpotMarketUpdate { + const message = createBaseEventSpotMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: EventSpotMarketUpdateAmino): EventSpotMarketUpdate { + const message = createBaseEventSpotMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: EventSpotMarketUpdate): EventSpotMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: EventSpotMarketUpdateAminoMsg): EventSpotMarketUpdate { + return EventSpotMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventSpotMarketUpdateProtoMsg): EventSpotMarketUpdate { + return EventSpotMarketUpdate.decode(message.value); + }, + toProto(message: EventSpotMarketUpdate): Uint8Array { + return EventSpotMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventSpotMarketUpdate): EventSpotMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSpotMarketUpdate", + value: EventSpotMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSpotMarketUpdate.typeUrl, EventSpotMarketUpdate); +function createBaseEventPerpetualMarketUpdate(): EventPerpetualMarketUpdate { + return { + market: DerivativeMarket.fromPartial({}), + perpetualMarketInfo: undefined, + funding: undefined + }; +} +export const EventPerpetualMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate", + is(o: any): o is EventPerpetualMarketUpdate { + return o && (o.$typeUrl === EventPerpetualMarketUpdate.typeUrl || DerivativeMarket.is(o.market)); + }, + isAmino(o: any): o is EventPerpetualMarketUpdateAmino { + return o && (o.$typeUrl === EventPerpetualMarketUpdate.typeUrl || DerivativeMarket.isAmino(o.market)); + }, + encode(message: EventPerpetualMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualMarketInfo !== undefined) { + PerpetualMarketInfo.encode(message.perpetualMarketInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventPerpetualMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventPerpetualMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualMarketInfo = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + case 3: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventPerpetualMarketUpdate { + const message = createBaseEventPerpetualMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.perpetualMarketInfo = object.perpetualMarketInfo !== undefined && object.perpetualMarketInfo !== null ? PerpetualMarketInfo.fromPartial(object.perpetualMarketInfo) : undefined; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + return message; + }, + fromAmino(object: EventPerpetualMarketUpdateAmino): EventPerpetualMarketUpdate { + const message = createBaseEventPerpetualMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.perpetual_market_info !== undefined && object.perpetual_market_info !== null) { + message.perpetualMarketInfo = PerpetualMarketInfo.fromAmino(object.perpetual_market_info); + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + return message; + }, + toAmino(message: EventPerpetualMarketUpdate): EventPerpetualMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.perpetual_market_info = message.perpetualMarketInfo ? PerpetualMarketInfo.toAmino(message.perpetualMarketInfo) : undefined; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + return obj; + }, + fromAminoMsg(object: EventPerpetualMarketUpdateAminoMsg): EventPerpetualMarketUpdate { + return EventPerpetualMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventPerpetualMarketUpdateProtoMsg): EventPerpetualMarketUpdate { + return EventPerpetualMarketUpdate.decode(message.value); + }, + toProto(message: EventPerpetualMarketUpdate): Uint8Array { + return EventPerpetualMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventPerpetualMarketUpdate): EventPerpetualMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketUpdate", + value: EventPerpetualMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventPerpetualMarketUpdate.typeUrl, EventPerpetualMarketUpdate); +function createBaseEventExpiryFuturesMarketUpdate(): EventExpiryFuturesMarketUpdate { + return { + market: DerivativeMarket.fromPartial({}), + expiryFuturesMarketInfo: undefined + }; +} +export const EventExpiryFuturesMarketUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate", + is(o: any): o is EventExpiryFuturesMarketUpdate { + return o && (o.$typeUrl === EventExpiryFuturesMarketUpdate.typeUrl || DerivativeMarket.is(o.market)); + }, + isAmino(o: any): o is EventExpiryFuturesMarketUpdateAmino { + return o && (o.$typeUrl === EventExpiryFuturesMarketUpdate.typeUrl || DerivativeMarket.isAmino(o.market)); + }, + encode(message: EventExpiryFuturesMarketUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.expiryFuturesMarketInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.expiryFuturesMarketInfo, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventExpiryFuturesMarketUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventExpiryFuturesMarketUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 3: + message.expiryFuturesMarketInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventExpiryFuturesMarketUpdate { + const message = createBaseEventExpiryFuturesMarketUpdate(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.expiryFuturesMarketInfo = object.expiryFuturesMarketInfo !== undefined && object.expiryFuturesMarketInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.expiryFuturesMarketInfo) : undefined; + return message; + }, + fromAmino(object: EventExpiryFuturesMarketUpdateAmino): EventExpiryFuturesMarketUpdate { + const message = createBaseEventExpiryFuturesMarketUpdate(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.expiry_futures_market_info !== undefined && object.expiry_futures_market_info !== null) { + message.expiryFuturesMarketInfo = ExpiryFuturesMarketInfo.fromAmino(object.expiry_futures_market_info); + } + return message; + }, + toAmino(message: EventExpiryFuturesMarketUpdate): EventExpiryFuturesMarketUpdateAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.expiry_futures_market_info = message.expiryFuturesMarketInfo ? ExpiryFuturesMarketInfo.toAmino(message.expiryFuturesMarketInfo) : undefined; + return obj; + }, + fromAminoMsg(object: EventExpiryFuturesMarketUpdateAminoMsg): EventExpiryFuturesMarketUpdate { + return EventExpiryFuturesMarketUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventExpiryFuturesMarketUpdateProtoMsg): EventExpiryFuturesMarketUpdate { + return EventExpiryFuturesMarketUpdate.decode(message.value); + }, + toProto(message: EventExpiryFuturesMarketUpdate): Uint8Array { + return EventExpiryFuturesMarketUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventExpiryFuturesMarketUpdate): EventExpiryFuturesMarketUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventExpiryFuturesMarketUpdate", + value: EventExpiryFuturesMarketUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventExpiryFuturesMarketUpdate.typeUrl, EventExpiryFuturesMarketUpdate); +function createBaseEventPerpetualMarketFundingUpdate(): EventPerpetualMarketFundingUpdate { + return { + marketId: "", + funding: PerpetualMarketFunding.fromPartial({}), + isHourlyFunding: false, + fundingRate: undefined, + markPrice: undefined + }; +} +export const EventPerpetualMarketFundingUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate", + is(o: any): o is EventPerpetualMarketFundingUpdate { + return o && (o.$typeUrl === EventPerpetualMarketFundingUpdate.typeUrl || typeof o.marketId === "string" && PerpetualMarketFunding.is(o.funding) && typeof o.isHourlyFunding === "boolean"); + }, + isAmino(o: any): o is EventPerpetualMarketFundingUpdateAmino { + return o && (o.$typeUrl === EventPerpetualMarketFundingUpdate.typeUrl || typeof o.market_id === "string" && PerpetualMarketFunding.isAmino(o.funding) && typeof o.is_hourly_funding === "boolean"); + }, + encode(message: EventPerpetualMarketFundingUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(18).fork()).ldelim(); + } + if (message.isHourlyFunding === true) { + writer.uint32(24).bool(message.isHourlyFunding); + } + if (message.fundingRate !== undefined) { + writer.uint32(34).string(message.fundingRate); + } + if (message.markPrice !== undefined) { + writer.uint32(42).string(message.markPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventPerpetualMarketFundingUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventPerpetualMarketFundingUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + case 3: + message.isHourlyFunding = reader.bool(); + break; + case 4: + message.fundingRate = reader.string(); + break; + case 5: + message.markPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventPerpetualMarketFundingUpdate { + const message = createBaseEventPerpetualMarketFundingUpdate(); + message.marketId = object.marketId ?? ""; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + message.isHourlyFunding = object.isHourlyFunding ?? false; + message.fundingRate = object.fundingRate ?? undefined; + message.markPrice = object.markPrice ?? undefined; + return message; + }, + fromAmino(object: EventPerpetualMarketFundingUpdateAmino): EventPerpetualMarketFundingUpdate { + const message = createBaseEventPerpetualMarketFundingUpdate(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + if (object.is_hourly_funding !== undefined && object.is_hourly_funding !== null) { + message.isHourlyFunding = object.is_hourly_funding; + } + if (object.funding_rate !== undefined && object.funding_rate !== null) { + message.fundingRate = object.funding_rate; + } + if (object.mark_price !== undefined && object.mark_price !== null) { + message.markPrice = object.mark_price; + } + return message; + }, + toAmino(message: EventPerpetualMarketFundingUpdate): EventPerpetualMarketFundingUpdateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + obj.is_hourly_funding = message.isHourlyFunding === false ? undefined : message.isHourlyFunding; + obj.funding_rate = message.fundingRate === null ? undefined : message.fundingRate; + obj.mark_price = message.markPrice === null ? undefined : message.markPrice; + return obj; + }, + fromAminoMsg(object: EventPerpetualMarketFundingUpdateAminoMsg): EventPerpetualMarketFundingUpdate { + return EventPerpetualMarketFundingUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventPerpetualMarketFundingUpdateProtoMsg): EventPerpetualMarketFundingUpdate { + return EventPerpetualMarketFundingUpdate.decode(message.value); + }, + toProto(message: EventPerpetualMarketFundingUpdate): Uint8Array { + return EventPerpetualMarketFundingUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventPerpetualMarketFundingUpdate): EventPerpetualMarketFundingUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventPerpetualMarketFundingUpdate", + value: EventPerpetualMarketFundingUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventPerpetualMarketFundingUpdate.typeUrl, EventPerpetualMarketFundingUpdate); +function createBaseEventSubaccountDeposit(): EventSubaccountDeposit { + return { + srcAddress: "", + subaccountId: new Uint8Array(), + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountDeposit = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit", + is(o: any): o is EventSubaccountDeposit { + return o && (o.$typeUrl === EventSubaccountDeposit.typeUrl || typeof o.srcAddress === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountDepositAmino { + return o && (o.$typeUrl === EventSubaccountDeposit.typeUrl || typeof o.src_address === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.srcAddress !== "") { + writer.uint32(10).string(message.srcAddress); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.srcAddress = reader.string(); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountDeposit { + const message = createBaseEventSubaccountDeposit(); + message.srcAddress = object.srcAddress ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountDepositAmino): EventSubaccountDeposit { + const message = createBaseEventSubaccountDeposit(); + if (object.src_address !== undefined && object.src_address !== null) { + message.srcAddress = object.src_address; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountDeposit): EventSubaccountDepositAmino { + const obj: any = {}; + obj.src_address = message.srcAddress === "" ? undefined : message.srcAddress; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountDepositAminoMsg): EventSubaccountDeposit { + return EventSubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountDepositProtoMsg): EventSubaccountDeposit { + return EventSubaccountDeposit.decode(message.value); + }, + toProto(message: EventSubaccountDeposit): Uint8Array { + return EventSubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountDeposit): EventSubaccountDepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountDeposit", + value: EventSubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountDeposit.typeUrl, EventSubaccountDeposit); +function createBaseEventSubaccountWithdraw(): EventSubaccountWithdraw { + return { + subaccountId: new Uint8Array(), + dstAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountWithdraw = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw", + is(o: any): o is EventSubaccountWithdraw { + return o && (o.$typeUrl === EventSubaccountWithdraw.typeUrl || (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.dstAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountWithdrawAmino { + return o && (o.$typeUrl === EventSubaccountWithdraw.typeUrl || (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.dst_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.dstAddress !== "") { + writer.uint32(18).string(message.dstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.dstAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountWithdraw { + const message = createBaseEventSubaccountWithdraw(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.dstAddress = object.dstAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountWithdrawAmino): EventSubaccountWithdraw { + const message = createBaseEventSubaccountWithdraw(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.dst_address !== undefined && object.dst_address !== null) { + message.dstAddress = object.dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountWithdraw): EventSubaccountWithdrawAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.dst_address = message.dstAddress === "" ? undefined : message.dstAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountWithdrawAminoMsg): EventSubaccountWithdraw { + return EventSubaccountWithdraw.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountWithdrawProtoMsg): EventSubaccountWithdraw { + return EventSubaccountWithdraw.decode(message.value); + }, + toProto(message: EventSubaccountWithdraw): Uint8Array { + return EventSubaccountWithdraw.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountWithdraw): EventSubaccountWithdrawProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountWithdraw", + value: EventSubaccountWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountWithdraw.typeUrl, EventSubaccountWithdraw); +function createBaseEventSubaccountBalanceTransfer(): EventSubaccountBalanceTransfer { + return { + srcSubaccountId: "", + dstSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const EventSubaccountBalanceTransfer = { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer", + is(o: any): o is EventSubaccountBalanceTransfer { + return o && (o.$typeUrl === EventSubaccountBalanceTransfer.typeUrl || typeof o.srcSubaccountId === "string" && typeof o.dstSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventSubaccountBalanceTransferAmino { + return o && (o.$typeUrl === EventSubaccountBalanceTransfer.typeUrl || typeof o.src_subaccount_id === "string" && typeof o.dst_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventSubaccountBalanceTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.srcSubaccountId !== "") { + writer.uint32(10).string(message.srcSubaccountId); + } + if (message.dstSubaccountId !== "") { + writer.uint32(18).string(message.dstSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubaccountBalanceTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubaccountBalanceTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.srcSubaccountId = reader.string(); + break; + case 2: + message.dstSubaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubaccountBalanceTransfer { + const message = createBaseEventSubaccountBalanceTransfer(); + message.srcSubaccountId = object.srcSubaccountId ?? ""; + message.dstSubaccountId = object.dstSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventSubaccountBalanceTransferAmino): EventSubaccountBalanceTransfer { + const message = createBaseEventSubaccountBalanceTransfer(); + if (object.src_subaccount_id !== undefined && object.src_subaccount_id !== null) { + message.srcSubaccountId = object.src_subaccount_id; + } + if (object.dst_subaccount_id !== undefined && object.dst_subaccount_id !== null) { + message.dstSubaccountId = object.dst_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventSubaccountBalanceTransfer): EventSubaccountBalanceTransferAmino { + const obj: any = {}; + obj.src_subaccount_id = message.srcSubaccountId === "" ? undefined : message.srcSubaccountId; + obj.dst_subaccount_id = message.dstSubaccountId === "" ? undefined : message.dstSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventSubaccountBalanceTransferAminoMsg): EventSubaccountBalanceTransfer { + return EventSubaccountBalanceTransfer.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubaccountBalanceTransferProtoMsg): EventSubaccountBalanceTransfer { + return EventSubaccountBalanceTransfer.decode(message.value); + }, + toProto(message: EventSubaccountBalanceTransfer): Uint8Array { + return EventSubaccountBalanceTransfer.encode(message).finish(); + }, + toProtoMsg(message: EventSubaccountBalanceTransfer): EventSubaccountBalanceTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventSubaccountBalanceTransfer", + value: EventSubaccountBalanceTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubaccountBalanceTransfer.typeUrl, EventSubaccountBalanceTransfer); +function createBaseEventBatchDepositUpdate(): EventBatchDepositUpdate { + return { + depositUpdates: [] + }; +} +export const EventBatchDepositUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate", + is(o: any): o is EventBatchDepositUpdate { + return o && (o.$typeUrl === EventBatchDepositUpdate.typeUrl || Array.isArray(o.depositUpdates) && (!o.depositUpdates.length || DepositUpdate.is(o.depositUpdates[0]))); + }, + isAmino(o: any): o is EventBatchDepositUpdateAmino { + return o && (o.$typeUrl === EventBatchDepositUpdate.typeUrl || Array.isArray(o.deposit_updates) && (!o.deposit_updates.length || DepositUpdate.isAmino(o.deposit_updates[0]))); + }, + encode(message: EventBatchDepositUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.depositUpdates) { + DepositUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBatchDepositUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBatchDepositUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositUpdates.push(DepositUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBatchDepositUpdate { + const message = createBaseEventBatchDepositUpdate(); + message.depositUpdates = object.depositUpdates?.map(e => DepositUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventBatchDepositUpdateAmino): EventBatchDepositUpdate { + const message = createBaseEventBatchDepositUpdate(); + message.depositUpdates = object.deposit_updates?.map(e => DepositUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventBatchDepositUpdate): EventBatchDepositUpdateAmino { + const obj: any = {}; + if (message.depositUpdates) { + obj.deposit_updates = message.depositUpdates.map(e => e ? DepositUpdate.toAmino(e) : undefined); + } else { + obj.deposit_updates = message.depositUpdates; + } + return obj; + }, + fromAminoMsg(object: EventBatchDepositUpdateAminoMsg): EventBatchDepositUpdate { + return EventBatchDepositUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventBatchDepositUpdateProtoMsg): EventBatchDepositUpdate { + return EventBatchDepositUpdate.decode(message.value); + }, + toProto(message: EventBatchDepositUpdate): Uint8Array { + return EventBatchDepositUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventBatchDepositUpdate): EventBatchDepositUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventBatchDepositUpdate", + value: EventBatchDepositUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBatchDepositUpdate.typeUrl, EventBatchDepositUpdate); +function createBaseDerivativeMarketOrderCancel(): DerivativeMarketOrderCancel { + return { + marketOrder: undefined, + cancelQuantity: "" + }; +} +export const DerivativeMarketOrderCancel = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel", + is(o: any): o is DerivativeMarketOrderCancel { + return o && (o.$typeUrl === DerivativeMarketOrderCancel.typeUrl || typeof o.cancelQuantity === "string"); + }, + isAmino(o: any): o is DerivativeMarketOrderCancelAmino { + return o && (o.$typeUrl === DerivativeMarketOrderCancel.typeUrl || typeof o.cancel_quantity === "string"); + }, + encode(message: DerivativeMarketOrderCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketOrder !== undefined) { + DerivativeMarketOrder.encode(message.marketOrder, writer.uint32(10).fork()).ldelim(); + } + if (message.cancelQuantity !== "") { + writer.uint32(18).string(message.cancelQuantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrderCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrderCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketOrder = DerivativeMarketOrder.decode(reader, reader.uint32()); + break; + case 2: + message.cancelQuantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrderCancel { + const message = createBaseDerivativeMarketOrderCancel(); + message.marketOrder = object.marketOrder !== undefined && object.marketOrder !== null ? DerivativeMarketOrder.fromPartial(object.marketOrder) : undefined; + message.cancelQuantity = object.cancelQuantity ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketOrderCancelAmino): DerivativeMarketOrderCancel { + const message = createBaseDerivativeMarketOrderCancel(); + if (object.market_order !== undefined && object.market_order !== null) { + message.marketOrder = DerivativeMarketOrder.fromAmino(object.market_order); + } + if (object.cancel_quantity !== undefined && object.cancel_quantity !== null) { + message.cancelQuantity = object.cancel_quantity; + } + return message; + }, + toAmino(message: DerivativeMarketOrderCancel): DerivativeMarketOrderCancelAmino { + const obj: any = {}; + obj.market_order = message.marketOrder ? DerivativeMarketOrder.toAmino(message.marketOrder) : undefined; + obj.cancel_quantity = message.cancelQuantity === "" ? undefined : message.cancelQuantity; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderCancelAminoMsg): DerivativeMarketOrderCancel { + return DerivativeMarketOrderCancel.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderCancelProtoMsg): DerivativeMarketOrderCancel { + return DerivativeMarketOrderCancel.decode(message.value); + }, + toProto(message: DerivativeMarketOrderCancel): Uint8Array { + return DerivativeMarketOrderCancel.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrderCancel): DerivativeMarketOrderCancelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderCancel", + value: DerivativeMarketOrderCancel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrderCancel.typeUrl, DerivativeMarketOrderCancel); +function createBaseEventCancelDerivativeOrder(): EventCancelDerivativeOrder { + return { + marketId: "", + isLimitCancel: false, + limitOrder: undefined, + marketOrderCancel: undefined + }; +} +export const EventCancelDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder", + is(o: any): o is EventCancelDerivativeOrder { + return o && (o.$typeUrl === EventCancelDerivativeOrder.typeUrl || typeof o.marketId === "string" && typeof o.isLimitCancel === "boolean"); + }, + isAmino(o: any): o is EventCancelDerivativeOrderAmino { + return o && (o.$typeUrl === EventCancelDerivativeOrder.typeUrl || typeof o.market_id === "string" && typeof o.isLimitCancel === "boolean"); + }, + encode(message: EventCancelDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isLimitCancel === true) { + writer.uint32(16).bool(message.isLimitCancel); + } + if (message.limitOrder !== undefined) { + DerivativeLimitOrder.encode(message.limitOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.marketOrderCancel !== undefined) { + DerivativeMarketOrderCancel.encode(message.marketOrderCancel, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isLimitCancel = reader.bool(); + break; + case 3: + message.limitOrder = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 4: + message.marketOrderCancel = DerivativeMarketOrderCancel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelDerivativeOrder { + const message = createBaseEventCancelDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.isLimitCancel = object.isLimitCancel ?? false; + message.limitOrder = object.limitOrder !== undefined && object.limitOrder !== null ? DerivativeLimitOrder.fromPartial(object.limitOrder) : undefined; + message.marketOrderCancel = object.marketOrderCancel !== undefined && object.marketOrderCancel !== null ? DerivativeMarketOrderCancel.fromPartial(object.marketOrderCancel) : undefined; + return message; + }, + fromAmino(object: EventCancelDerivativeOrderAmino): EventCancelDerivativeOrder { + const message = createBaseEventCancelDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isLimitCancel !== undefined && object.isLimitCancel !== null) { + message.isLimitCancel = object.isLimitCancel; + } + if (object.limit_order !== undefined && object.limit_order !== null) { + message.limitOrder = DerivativeLimitOrder.fromAmino(object.limit_order); + } + if (object.market_order_cancel !== undefined && object.market_order_cancel !== null) { + message.marketOrderCancel = DerivativeMarketOrderCancel.fromAmino(object.market_order_cancel); + } + return message; + }, + toAmino(message: EventCancelDerivativeOrder): EventCancelDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isLimitCancel = message.isLimitCancel === false ? undefined : message.isLimitCancel; + obj.limit_order = message.limitOrder ? DerivativeLimitOrder.toAmino(message.limitOrder) : undefined; + obj.market_order_cancel = message.marketOrderCancel ? DerivativeMarketOrderCancel.toAmino(message.marketOrderCancel) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelDerivativeOrderAminoMsg): EventCancelDerivativeOrder { + return EventCancelDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelDerivativeOrderProtoMsg): EventCancelDerivativeOrder { + return EventCancelDerivativeOrder.decode(message.value); + }, + toProto(message: EventCancelDerivativeOrder): Uint8Array { + return EventCancelDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelDerivativeOrder): EventCancelDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelDerivativeOrder", + value: EventCancelDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelDerivativeOrder.typeUrl, EventCancelDerivativeOrder); +function createBaseEventFeeDiscountSchedule(): EventFeeDiscountSchedule { + return { + schedule: undefined + }; +} +export const EventFeeDiscountSchedule = { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule", + is(o: any): o is EventFeeDiscountSchedule { + return o && o.$typeUrl === EventFeeDiscountSchedule.typeUrl; + }, + isAmino(o: any): o is EventFeeDiscountScheduleAmino { + return o && o.$typeUrl === EventFeeDiscountSchedule.typeUrl; + }, + encode(message: EventFeeDiscountSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + FeeDiscountSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventFeeDiscountSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventFeeDiscountSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventFeeDiscountSchedule { + const message = createBaseEventFeeDiscountSchedule(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? FeeDiscountSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: EventFeeDiscountScheduleAmino): EventFeeDiscountSchedule { + const message = createBaseEventFeeDiscountSchedule(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = FeeDiscountSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: EventFeeDiscountSchedule): EventFeeDiscountScheduleAmino { + const obj: any = {}; + obj.schedule = message.schedule ? FeeDiscountSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: EventFeeDiscountScheduleAminoMsg): EventFeeDiscountSchedule { + return EventFeeDiscountSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: EventFeeDiscountScheduleProtoMsg): EventFeeDiscountSchedule { + return EventFeeDiscountSchedule.decode(message.value); + }, + toProto(message: EventFeeDiscountSchedule): Uint8Array { + return EventFeeDiscountSchedule.encode(message).finish(); + }, + toProtoMsg(message: EventFeeDiscountSchedule): EventFeeDiscountScheduleProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventFeeDiscountSchedule", + value: EventFeeDiscountSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventFeeDiscountSchedule.typeUrl, EventFeeDiscountSchedule); +function createBaseEventTradingRewardCampaignUpdate(): EventTradingRewardCampaignUpdate { + return { + campaignInfo: undefined, + campaignRewardPools: [] + }; +} +export const EventTradingRewardCampaignUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate", + is(o: any): o is EventTradingRewardCampaignUpdate { + return o && (o.$typeUrl === EventTradingRewardCampaignUpdate.typeUrl || Array.isArray(o.campaignRewardPools) && (!o.campaignRewardPools.length || CampaignRewardPool.is(o.campaignRewardPools[0]))); + }, + isAmino(o: any): o is EventTradingRewardCampaignUpdateAmino { + return o && (o.$typeUrl === EventTradingRewardCampaignUpdate.typeUrl || Array.isArray(o.campaign_reward_pools) && (!o.campaign_reward_pools.length || CampaignRewardPool.isAmino(o.campaign_reward_pools[0]))); + }, + encode(message: EventTradingRewardCampaignUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.campaignRewardPools) { + CampaignRewardPool.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTradingRewardCampaignUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTradingRewardCampaignUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 2: + message.campaignRewardPools.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTradingRewardCampaignUpdate { + const message = createBaseEventTradingRewardCampaignUpdate(); + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPools = object.campaignRewardPools?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventTradingRewardCampaignUpdateAmino): EventTradingRewardCampaignUpdate { + const message = createBaseEventTradingRewardCampaignUpdate(); + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPools = object.campaign_reward_pools?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventTradingRewardCampaignUpdate): EventTradingRewardCampaignUpdateAmino { + const obj: any = {}; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPools) { + obj.campaign_reward_pools = message.campaignRewardPools.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools = message.campaignRewardPools; + } + return obj; + }, + fromAminoMsg(object: EventTradingRewardCampaignUpdateAminoMsg): EventTradingRewardCampaignUpdate { + return EventTradingRewardCampaignUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventTradingRewardCampaignUpdateProtoMsg): EventTradingRewardCampaignUpdate { + return EventTradingRewardCampaignUpdate.decode(message.value); + }, + toProto(message: EventTradingRewardCampaignUpdate): Uint8Array { + return EventTradingRewardCampaignUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventTradingRewardCampaignUpdate): EventTradingRewardCampaignUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardCampaignUpdate", + value: EventTradingRewardCampaignUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTradingRewardCampaignUpdate.typeUrl, EventTradingRewardCampaignUpdate); +function createBaseEventTradingRewardDistribution(): EventTradingRewardDistribution { + return { + accountRewards: [] + }; +} +export const EventTradingRewardDistribution = { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution", + is(o: any): o is EventTradingRewardDistribution { + return o && (o.$typeUrl === EventTradingRewardDistribution.typeUrl || Array.isArray(o.accountRewards) && (!o.accountRewards.length || AccountRewards.is(o.accountRewards[0]))); + }, + isAmino(o: any): o is EventTradingRewardDistributionAmino { + return o && (o.$typeUrl === EventTradingRewardDistribution.typeUrl || Array.isArray(o.account_rewards) && (!o.account_rewards.length || AccountRewards.isAmino(o.account_rewards[0]))); + }, + encode(message: EventTradingRewardDistribution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountRewards) { + AccountRewards.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTradingRewardDistribution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTradingRewardDistribution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountRewards.push(AccountRewards.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTradingRewardDistribution { + const message = createBaseEventTradingRewardDistribution(); + message.accountRewards = object.accountRewards?.map(e => AccountRewards.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventTradingRewardDistributionAmino): EventTradingRewardDistribution { + const message = createBaseEventTradingRewardDistribution(); + message.accountRewards = object.account_rewards?.map(e => AccountRewards.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventTradingRewardDistribution): EventTradingRewardDistributionAmino { + const obj: any = {}; + if (message.accountRewards) { + obj.account_rewards = message.accountRewards.map(e => e ? AccountRewards.toAmino(e) : undefined); + } else { + obj.account_rewards = message.accountRewards; + } + return obj; + }, + fromAminoMsg(object: EventTradingRewardDistributionAminoMsg): EventTradingRewardDistribution { + return EventTradingRewardDistribution.fromAmino(object.value); + }, + fromProtoMsg(message: EventTradingRewardDistributionProtoMsg): EventTradingRewardDistribution { + return EventTradingRewardDistribution.decode(message.value); + }, + toProto(message: EventTradingRewardDistribution): Uint8Array { + return EventTradingRewardDistribution.encode(message).finish(); + }, + toProtoMsg(message: EventTradingRewardDistribution): EventTradingRewardDistributionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventTradingRewardDistribution", + value: EventTradingRewardDistribution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTradingRewardDistribution.typeUrl, EventTradingRewardDistribution); +function createBaseEventNewConditionalDerivativeOrder(): EventNewConditionalDerivativeOrder { + return { + marketId: "", + order: undefined, + hash: new Uint8Array(), + isMarket: false + }; +} +export const EventNewConditionalDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder", + is(o: any): o is EventNewConditionalDerivativeOrder { + return o && (o.$typeUrl === EventNewConditionalDerivativeOrder.typeUrl || typeof o.marketId === "string" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.isMarket === "boolean"); + }, + isAmino(o: any): o is EventNewConditionalDerivativeOrderAmino { + return o && (o.$typeUrl === EventNewConditionalDerivativeOrder.typeUrl || typeof o.market_id === "string" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.is_market === "boolean"); + }, + encode(message: EventNewConditionalDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(26).bytes(message.hash); + } + if (message.isMarket === true) { + writer.uint32(32).bool(message.isMarket); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewConditionalDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewConditionalDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + case 3: + message.hash = reader.bytes(); + break; + case 4: + message.isMarket = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewConditionalDerivativeOrder { + const message = createBaseEventNewConditionalDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + message.hash = object.hash ?? new Uint8Array(); + message.isMarket = object.isMarket ?? false; + return message; + }, + fromAmino(object: EventNewConditionalDerivativeOrderAmino): EventNewConditionalDerivativeOrder { + const message = createBaseEventNewConditionalDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.is_market !== undefined && object.is_market !== null) { + message.isMarket = object.is_market; + } + return message; + }, + toAmino(message: EventNewConditionalDerivativeOrder): EventNewConditionalDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.is_market = message.isMarket === false ? undefined : message.isMarket; + return obj; + }, + fromAminoMsg(object: EventNewConditionalDerivativeOrderAminoMsg): EventNewConditionalDerivativeOrder { + return EventNewConditionalDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewConditionalDerivativeOrderProtoMsg): EventNewConditionalDerivativeOrder { + return EventNewConditionalDerivativeOrder.decode(message.value); + }, + toProto(message: EventNewConditionalDerivativeOrder): Uint8Array { + return EventNewConditionalDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventNewConditionalDerivativeOrder): EventNewConditionalDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventNewConditionalDerivativeOrder", + value: EventNewConditionalDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewConditionalDerivativeOrder.typeUrl, EventNewConditionalDerivativeOrder); +function createBaseEventCancelConditionalDerivativeOrder(): EventCancelConditionalDerivativeOrder { + return { + marketId: "", + isLimitCancel: false, + limitOrder: undefined, + marketOrder: undefined + }; +} +export const EventCancelConditionalDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder", + is(o: any): o is EventCancelConditionalDerivativeOrder { + return o && (o.$typeUrl === EventCancelConditionalDerivativeOrder.typeUrl || typeof o.marketId === "string" && typeof o.isLimitCancel === "boolean"); + }, + isAmino(o: any): o is EventCancelConditionalDerivativeOrderAmino { + return o && (o.$typeUrl === EventCancelConditionalDerivativeOrder.typeUrl || typeof o.market_id === "string" && typeof o.isLimitCancel === "boolean"); + }, + encode(message: EventCancelConditionalDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isLimitCancel === true) { + writer.uint32(16).bool(message.isLimitCancel); + } + if (message.limitOrder !== undefined) { + DerivativeLimitOrder.encode(message.limitOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.marketOrder !== undefined) { + DerivativeMarketOrder.encode(message.marketOrder, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelConditionalDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelConditionalDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isLimitCancel = reader.bool(); + break; + case 3: + message.limitOrder = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 4: + message.marketOrder = DerivativeMarketOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelConditionalDerivativeOrder { + const message = createBaseEventCancelConditionalDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.isLimitCancel = object.isLimitCancel ?? false; + message.limitOrder = object.limitOrder !== undefined && object.limitOrder !== null ? DerivativeLimitOrder.fromPartial(object.limitOrder) : undefined; + message.marketOrder = object.marketOrder !== undefined && object.marketOrder !== null ? DerivativeMarketOrder.fromPartial(object.marketOrder) : undefined; + return message; + }, + fromAmino(object: EventCancelConditionalDerivativeOrderAmino): EventCancelConditionalDerivativeOrder { + const message = createBaseEventCancelConditionalDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isLimitCancel !== undefined && object.isLimitCancel !== null) { + message.isLimitCancel = object.isLimitCancel; + } + if (object.limit_order !== undefined && object.limit_order !== null) { + message.limitOrder = DerivativeLimitOrder.fromAmino(object.limit_order); + } + if (object.market_order !== undefined && object.market_order !== null) { + message.marketOrder = DerivativeMarketOrder.fromAmino(object.market_order); + } + return message; + }, + toAmino(message: EventCancelConditionalDerivativeOrder): EventCancelConditionalDerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isLimitCancel = message.isLimitCancel === false ? undefined : message.isLimitCancel; + obj.limit_order = message.limitOrder ? DerivativeLimitOrder.toAmino(message.limitOrder) : undefined; + obj.market_order = message.marketOrder ? DerivativeMarketOrder.toAmino(message.marketOrder) : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelConditionalDerivativeOrderAminoMsg): EventCancelConditionalDerivativeOrder { + return EventCancelConditionalDerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelConditionalDerivativeOrderProtoMsg): EventCancelConditionalDerivativeOrder { + return EventCancelConditionalDerivativeOrder.decode(message.value); + }, + toProto(message: EventCancelConditionalDerivativeOrder): Uint8Array { + return EventCancelConditionalDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: EventCancelConditionalDerivativeOrder): EventCancelConditionalDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventCancelConditionalDerivativeOrder", + value: EventCancelConditionalDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelConditionalDerivativeOrder.typeUrl, EventCancelConditionalDerivativeOrder); +function createBaseEventConditionalDerivativeOrderTrigger(): EventConditionalDerivativeOrderTrigger { + return { + marketId: new Uint8Array(), + isLimitTrigger: false, + triggeredOrderHash: new Uint8Array(), + placedOrderHash: new Uint8Array(), + triggeredOrderCid: "" + }; +} +export const EventConditionalDerivativeOrderTrigger = { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger", + is(o: any): o is EventConditionalDerivativeOrderTrigger { + return o && (o.$typeUrl === EventConditionalDerivativeOrderTrigger.typeUrl || (o.marketId instanceof Uint8Array || typeof o.marketId === "string") && typeof o.isLimitTrigger === "boolean" && (o.triggeredOrderHash instanceof Uint8Array || typeof o.triggeredOrderHash === "string") && (o.placedOrderHash instanceof Uint8Array || typeof o.placedOrderHash === "string") && typeof o.triggeredOrderCid === "string"); + }, + isAmino(o: any): o is EventConditionalDerivativeOrderTriggerAmino { + return o && (o.$typeUrl === EventConditionalDerivativeOrderTrigger.typeUrl || (o.market_id instanceof Uint8Array || typeof o.market_id === "string") && typeof o.isLimitTrigger === "boolean" && (o.triggered_order_hash instanceof Uint8Array || typeof o.triggered_order_hash === "string") && (o.placed_order_hash instanceof Uint8Array || typeof o.placed_order_hash === "string") && typeof o.triggered_order_cid === "string"); + }, + encode(message: EventConditionalDerivativeOrderTrigger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId.length !== 0) { + writer.uint32(10).bytes(message.marketId); + } + if (message.isLimitTrigger === true) { + writer.uint32(16).bool(message.isLimitTrigger); + } + if (message.triggeredOrderHash.length !== 0) { + writer.uint32(26).bytes(message.triggeredOrderHash); + } + if (message.placedOrderHash.length !== 0) { + writer.uint32(34).bytes(message.placedOrderHash); + } + if (message.triggeredOrderCid !== "") { + writer.uint32(42).string(message.triggeredOrderCid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConditionalDerivativeOrderTrigger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConditionalDerivativeOrderTrigger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.bytes(); + break; + case 2: + message.isLimitTrigger = reader.bool(); + break; + case 3: + message.triggeredOrderHash = reader.bytes(); + break; + case 4: + message.placedOrderHash = reader.bytes(); + break; + case 5: + message.triggeredOrderCid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConditionalDerivativeOrderTrigger { + const message = createBaseEventConditionalDerivativeOrderTrigger(); + message.marketId = object.marketId ?? new Uint8Array(); + message.isLimitTrigger = object.isLimitTrigger ?? false; + message.triggeredOrderHash = object.triggeredOrderHash ?? new Uint8Array(); + message.placedOrderHash = object.placedOrderHash ?? new Uint8Array(); + message.triggeredOrderCid = object.triggeredOrderCid ?? ""; + return message; + }, + fromAmino(object: EventConditionalDerivativeOrderTriggerAmino): EventConditionalDerivativeOrderTrigger { + const message = createBaseEventConditionalDerivativeOrderTrigger(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = bytesFromBase64(object.market_id); + } + if (object.isLimitTrigger !== undefined && object.isLimitTrigger !== null) { + message.isLimitTrigger = object.isLimitTrigger; + } + if (object.triggered_order_hash !== undefined && object.triggered_order_hash !== null) { + message.triggeredOrderHash = bytesFromBase64(object.triggered_order_hash); + } + if (object.placed_order_hash !== undefined && object.placed_order_hash !== null) { + message.placedOrderHash = bytesFromBase64(object.placed_order_hash); + } + if (object.triggered_order_cid !== undefined && object.triggered_order_cid !== null) { + message.triggeredOrderCid = object.triggered_order_cid; + } + return message; + }, + toAmino(message: EventConditionalDerivativeOrderTrigger): EventConditionalDerivativeOrderTriggerAmino { + const obj: any = {}; + obj.market_id = message.marketId ? base64FromBytes(message.marketId) : undefined; + obj.isLimitTrigger = message.isLimitTrigger === false ? undefined : message.isLimitTrigger; + obj.triggered_order_hash = message.triggeredOrderHash ? base64FromBytes(message.triggeredOrderHash) : undefined; + obj.placed_order_hash = message.placedOrderHash ? base64FromBytes(message.placedOrderHash) : undefined; + obj.triggered_order_cid = message.triggeredOrderCid === "" ? undefined : message.triggeredOrderCid; + return obj; + }, + fromAminoMsg(object: EventConditionalDerivativeOrderTriggerAminoMsg): EventConditionalDerivativeOrderTrigger { + return EventConditionalDerivativeOrderTrigger.fromAmino(object.value); + }, + fromProtoMsg(message: EventConditionalDerivativeOrderTriggerProtoMsg): EventConditionalDerivativeOrderTrigger { + return EventConditionalDerivativeOrderTrigger.decode(message.value); + }, + toProto(message: EventConditionalDerivativeOrderTrigger): Uint8Array { + return EventConditionalDerivativeOrderTrigger.encode(message).finish(); + }, + toProtoMsg(message: EventConditionalDerivativeOrderTrigger): EventConditionalDerivativeOrderTriggerProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventConditionalDerivativeOrderTrigger", + value: EventConditionalDerivativeOrderTrigger.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConditionalDerivativeOrderTrigger.typeUrl, EventConditionalDerivativeOrderTrigger); +function createBaseEventOrderFail(): EventOrderFail { + return { + account: new Uint8Array(), + hashes: [], + flags: [], + cids: [] + }; +} +export const EventOrderFail = { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail", + is(o: any): o is EventOrderFail { + return o && (o.$typeUrl === EventOrderFail.typeUrl || (o.account instanceof Uint8Array || typeof o.account === "string") && Array.isArray(o.hashes) && (!o.hashes.length || o.hashes[0] instanceof Uint8Array || typeof o.hashes[0] === "string") && Array.isArray(o.flags) && (!o.flags.length || typeof o.flags[0] === "number") && Array.isArray(o.cids) && (!o.cids.length || typeof o.cids[0] === "string")); + }, + isAmino(o: any): o is EventOrderFailAmino { + return o && (o.$typeUrl === EventOrderFail.typeUrl || (o.account instanceof Uint8Array || typeof o.account === "string") && Array.isArray(o.hashes) && (!o.hashes.length || o.hashes[0] instanceof Uint8Array || typeof o.hashes[0] === "string") && Array.isArray(o.flags) && (!o.flags.length || typeof o.flags[0] === "number") && Array.isArray(o.cids) && (!o.cids.length || typeof o.cids[0] === "string")); + }, + encode(message: EventOrderFail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account.length !== 0) { + writer.uint32(10).bytes(message.account); + } + for (const v of message.hashes) { + writer.uint32(18).bytes(v!); + } + writer.uint32(26).fork(); + for (const v of message.flags) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.cids) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderFail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderFail(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.bytes(); + break; + case 2: + message.hashes.push(reader.bytes()); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.flags.push(reader.uint32()); + } + } else { + message.flags.push(reader.uint32()); + } + break; + case 4: + message.cids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderFail { + const message = createBaseEventOrderFail(); + message.account = object.account ?? new Uint8Array(); + message.hashes = object.hashes?.map(e => e) || []; + message.flags = object.flags?.map(e => e) || []; + message.cids = object.cids?.map(e => e) || []; + return message; + }, + fromAmino(object: EventOrderFailAmino): EventOrderFail { + const message = createBaseEventOrderFail(); + if (object.account !== undefined && object.account !== null) { + message.account = bytesFromBase64(object.account); + } + message.hashes = object.hashes?.map(e => bytesFromBase64(e)) || []; + message.flags = object.flags?.map(e => e) || []; + message.cids = object.cids?.map(e => e) || []; + return message; + }, + toAmino(message: EventOrderFail): EventOrderFailAmino { + const obj: any = {}; + obj.account = message.account ? base64FromBytes(message.account) : undefined; + if (message.hashes) { + obj.hashes = message.hashes.map(e => base64FromBytes(e)); + } else { + obj.hashes = message.hashes; + } + if (message.flags) { + obj.flags = message.flags.map(e => e); + } else { + obj.flags = message.flags; + } + if (message.cids) { + obj.cids = message.cids.map(e => e); + } else { + obj.cids = message.cids; + } + return obj; + }, + fromAminoMsg(object: EventOrderFailAminoMsg): EventOrderFail { + return EventOrderFail.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderFailProtoMsg): EventOrderFail { + return EventOrderFail.decode(message.value); + }, + toProto(message: EventOrderFail): Uint8Array { + return EventOrderFail.encode(message).finish(); + }, + toProtoMsg(message: EventOrderFail): EventOrderFailProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderFail", + value: EventOrderFail.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderFail.typeUrl, EventOrderFail); +function createBaseEventAtomicMarketOrderFeeMultipliersUpdated(): EventAtomicMarketOrderFeeMultipliersUpdated { + return { + marketFeeMultipliers: [] + }; +} +export const EventAtomicMarketOrderFeeMultipliersUpdated = { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated", + is(o: any): o is EventAtomicMarketOrderFeeMultipliersUpdated { + return o && (o.$typeUrl === EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl || Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0]))); + }, + isAmino(o: any): o is EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + return o && (o.$typeUrl === EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl || Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0]))); + }, + encode(message: EventAtomicMarketOrderFeeMultipliersUpdated, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAtomicMarketOrderFeeMultipliersUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAtomicMarketOrderFeeMultipliersUpdated { + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAtomicMarketOrderFeeMultipliersUpdatedAmino): EventAtomicMarketOrderFeeMultipliersUpdated { + const message = createBaseEventAtomicMarketOrderFeeMultipliersUpdated(); + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventAtomicMarketOrderFeeMultipliersUpdated): EventAtomicMarketOrderFeeMultipliersUpdatedAmino { + const obj: any = {}; + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + return obj; + }, + fromAminoMsg(object: EventAtomicMarketOrderFeeMultipliersUpdatedAminoMsg): EventAtomicMarketOrderFeeMultipliersUpdated { + return EventAtomicMarketOrderFeeMultipliersUpdated.fromAmino(object.value); + }, + fromProtoMsg(message: EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg): EventAtomicMarketOrderFeeMultipliersUpdated { + return EventAtomicMarketOrderFeeMultipliersUpdated.decode(message.value); + }, + toProto(message: EventAtomicMarketOrderFeeMultipliersUpdated): Uint8Array { + return EventAtomicMarketOrderFeeMultipliersUpdated.encode(message).finish(); + }, + toProtoMsg(message: EventAtomicMarketOrderFeeMultipliersUpdated): EventAtomicMarketOrderFeeMultipliersUpdatedProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventAtomicMarketOrderFeeMultipliersUpdated", + value: EventAtomicMarketOrderFeeMultipliersUpdated.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAtomicMarketOrderFeeMultipliersUpdated.typeUrl, EventAtomicMarketOrderFeeMultipliersUpdated); +function createBaseEventOrderbookUpdate(): EventOrderbookUpdate { + return { + spotUpdates: [], + derivativeUpdates: [] + }; +} +export const EventOrderbookUpdate = { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate", + is(o: any): o is EventOrderbookUpdate { + return o && (o.$typeUrl === EventOrderbookUpdate.typeUrl || Array.isArray(o.spotUpdates) && (!o.spotUpdates.length || OrderbookUpdate.is(o.spotUpdates[0])) && Array.isArray(o.derivativeUpdates) && (!o.derivativeUpdates.length || OrderbookUpdate.is(o.derivativeUpdates[0]))); + }, + isAmino(o: any): o is EventOrderbookUpdateAmino { + return o && (o.$typeUrl === EventOrderbookUpdate.typeUrl || Array.isArray(o.spot_updates) && (!o.spot_updates.length || OrderbookUpdate.isAmino(o.spot_updates[0])) && Array.isArray(o.derivative_updates) && (!o.derivative_updates.length || OrderbookUpdate.isAmino(o.derivative_updates[0]))); + }, + encode(message: EventOrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.spotUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.derivativeUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spotUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.derivativeUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderbookUpdate { + const message = createBaseEventOrderbookUpdate(); + message.spotUpdates = object.spotUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.derivativeUpdates = object.derivativeUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventOrderbookUpdateAmino): EventOrderbookUpdate { + const message = createBaseEventOrderbookUpdate(); + message.spotUpdates = object.spot_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.derivativeUpdates = object.derivative_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventOrderbookUpdate): EventOrderbookUpdateAmino { + const obj: any = {}; + if (message.spotUpdates) { + obj.spot_updates = message.spotUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.spot_updates = message.spotUpdates; + } + if (message.derivativeUpdates) { + obj.derivative_updates = message.derivativeUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.derivative_updates = message.derivativeUpdates; + } + return obj; + }, + fromAminoMsg(object: EventOrderbookUpdateAminoMsg): EventOrderbookUpdate { + return EventOrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderbookUpdateProtoMsg): EventOrderbookUpdate { + return EventOrderbookUpdate.decode(message.value); + }, + toProto(message: EventOrderbookUpdate): Uint8Array { + return EventOrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventOrderbookUpdate): EventOrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderbookUpdate", + value: EventOrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderbookUpdate.typeUrl, EventOrderbookUpdate); +function createBaseOrderbookUpdate(): OrderbookUpdate { + return { + seq: BigInt(0), + orderbook: undefined + }; +} +export const OrderbookUpdate = { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate", + is(o: any): o is OrderbookUpdate { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + isAmino(o: any): o is OrderbookUpdateAmino { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + encode(message: OrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seq !== BigInt(0)) { + writer.uint32(8).uint64(message.seq); + } + if (message.orderbook !== undefined) { + Orderbook.encode(message.orderbook, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seq = reader.uint64(); + break; + case 2: + message.orderbook = Orderbook.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + message.seq = object.seq !== undefined && object.seq !== null ? BigInt(object.seq.toString()) : BigInt(0); + message.orderbook = object.orderbook !== undefined && object.orderbook !== null ? Orderbook.fromPartial(object.orderbook) : undefined; + return message; + }, + fromAmino(object: OrderbookUpdateAmino): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + if (object.seq !== undefined && object.seq !== null) { + message.seq = BigInt(object.seq); + } + if (object.orderbook !== undefined && object.orderbook !== null) { + message.orderbook = Orderbook.fromAmino(object.orderbook); + } + return message; + }, + toAmino(message: OrderbookUpdate): OrderbookUpdateAmino { + const obj: any = {}; + obj.seq = message.seq !== BigInt(0) ? message.seq?.toString() : undefined; + obj.orderbook = message.orderbook ? Orderbook.toAmino(message.orderbook) : undefined; + return obj; + }, + fromAminoMsg(object: OrderbookUpdateAminoMsg): OrderbookUpdate { + return OrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookUpdateProtoMsg): OrderbookUpdate { + return OrderbookUpdate.decode(message.value); + }, + toProto(message: OrderbookUpdate): Uint8Array { + return OrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: OrderbookUpdate): OrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderbookUpdate", + value: OrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookUpdate.typeUrl, OrderbookUpdate); +function createBaseOrderbook(): Orderbook { + return { + marketId: new Uint8Array(), + buyLevels: [], + sellLevels: [] + }; +} +export const Orderbook = { + typeUrl: "/injective.exchange.v1beta1.Orderbook", + is(o: any): o is Orderbook { + return o && (o.$typeUrl === Orderbook.typeUrl || (o.marketId instanceof Uint8Array || typeof o.marketId === "string") && Array.isArray(o.buyLevels) && (!o.buyLevels.length || Level.is(o.buyLevels[0])) && Array.isArray(o.sellLevels) && (!o.sellLevels.length || Level.is(o.sellLevels[0]))); + }, + isAmino(o: any): o is OrderbookAmino { + return o && (o.$typeUrl === Orderbook.typeUrl || (o.market_id instanceof Uint8Array || typeof o.market_id === "string") && Array.isArray(o.buy_levels) && (!o.buy_levels.length || Level.isAmino(o.buy_levels[0])) && Array.isArray(o.sell_levels) && (!o.sell_levels.length || Level.isAmino(o.sell_levels[0]))); + }, + encode(message: Orderbook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId.length !== 0) { + writer.uint32(10).bytes(message.marketId); + } + for (const v of message.buyLevels) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellLevels) { + Level.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Orderbook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.bytes(); + break; + case 2: + message.buyLevels.push(Level.decode(reader, reader.uint32())); + break; + case 3: + message.sellLevels.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Orderbook { + const message = createBaseOrderbook(); + message.marketId = object.marketId ?? new Uint8Array(); + message.buyLevels = object.buyLevels?.map(e => Level.fromPartial(e)) || []; + message.sellLevels = object.sellLevels?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OrderbookAmino): Orderbook { + const message = createBaseOrderbook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = bytesFromBase64(object.market_id); + } + message.buyLevels = object.buy_levels?.map(e => Level.fromAmino(e)) || []; + message.sellLevels = object.sell_levels?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: Orderbook): OrderbookAmino { + const obj: any = {}; + obj.market_id = message.marketId ? base64FromBytes(message.marketId) : undefined; + if (message.buyLevels) { + obj.buy_levels = message.buyLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buy_levels = message.buyLevels; + } + if (message.sellLevels) { + obj.sell_levels = message.sellLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sell_levels = message.sellLevels; + } + return obj; + }, + fromAminoMsg(object: OrderbookAminoMsg): Orderbook { + return Orderbook.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookProtoMsg): Orderbook { + return Orderbook.decode(message.value); + }, + toProto(message: Orderbook): Uint8Array { + return Orderbook.encode(message).finish(); + }, + toProtoMsg(message: Orderbook): OrderbookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Orderbook", + value: Orderbook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Orderbook.typeUrl, Orderbook); +function createBaseEventGrantAuthorizations(): EventGrantAuthorizations { + return { + granter: "", + grants: [] + }; +} +export const EventGrantAuthorizations = { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations", + is(o: any): o is EventGrantAuthorizations { + return o && (o.$typeUrl === EventGrantAuthorizations.typeUrl || typeof o.granter === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is EventGrantAuthorizationsAmino { + return o && (o.$typeUrl === EventGrantAuthorizations.typeUrl || typeof o.granter === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: EventGrantAuthorizations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventGrantAuthorizations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGrantAuthorizations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventGrantAuthorizations { + const message = createBaseEventGrantAuthorizations(); + message.granter = object.granter ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventGrantAuthorizationsAmino): EventGrantAuthorizations { + const message = createBaseEventGrantAuthorizations(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventGrantAuthorizations): EventGrantAuthorizationsAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: EventGrantAuthorizationsAminoMsg): EventGrantAuthorizations { + return EventGrantAuthorizations.fromAmino(object.value); + }, + fromProtoMsg(message: EventGrantAuthorizationsProtoMsg): EventGrantAuthorizations { + return EventGrantAuthorizations.decode(message.value); + }, + toProto(message: EventGrantAuthorizations): Uint8Array { + return EventGrantAuthorizations.encode(message).finish(); + }, + toProtoMsg(message: EventGrantAuthorizations): EventGrantAuthorizationsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventGrantAuthorizations", + value: EventGrantAuthorizations.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventGrantAuthorizations.typeUrl, EventGrantAuthorizations); +function createBaseEventGrantActivation(): EventGrantActivation { + return { + grantee: "", + granter: "", + amount: "" + }; +} +export const EventGrantActivation = { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation", + is(o: any): o is EventGrantActivation { + return o && (o.$typeUrl === EventGrantActivation.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is EventGrantActivationAmino { + return o && (o.$typeUrl === EventGrantActivation.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string" && typeof o.amount === "string"); + }, + encode(message: EventGrantActivation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventGrantActivation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGrantActivation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventGrantActivation { + const message = createBaseEventGrantActivation(); + message.grantee = object.grantee ?? ""; + message.granter = object.granter ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: EventGrantActivationAmino): EventGrantActivation { + const message = createBaseEventGrantActivation(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: EventGrantActivation): EventGrantActivationAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: EventGrantActivationAminoMsg): EventGrantActivation { + return EventGrantActivation.fromAmino(object.value); + }, + fromProtoMsg(message: EventGrantActivationProtoMsg): EventGrantActivation { + return EventGrantActivation.decode(message.value); + }, + toProto(message: EventGrantActivation): Uint8Array { + return EventGrantActivation.encode(message).finish(); + }, + toProtoMsg(message: EventGrantActivation): EventGrantActivationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventGrantActivation", + value: EventGrantActivation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventGrantActivation.typeUrl, EventGrantActivation); +function createBaseEventInvalidGrant(): EventInvalidGrant { + return { + grantee: "", + granter: "" + }; +} +export const EventInvalidGrant = { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant", + is(o: any): o is EventInvalidGrant { + return o && (o.$typeUrl === EventInvalidGrant.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is EventInvalidGrantAmino { + return o && (o.$typeUrl === EventInvalidGrant.typeUrl || typeof o.grantee === "string" && typeof o.granter === "string"); + }, + encode(message: EventInvalidGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInvalidGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInvalidGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInvalidGrant { + const message = createBaseEventInvalidGrant(); + message.grantee = object.grantee ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: EventInvalidGrantAmino): EventInvalidGrant { + const message = createBaseEventInvalidGrant(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: EventInvalidGrant): EventInvalidGrantAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: EventInvalidGrantAminoMsg): EventInvalidGrant { + return EventInvalidGrant.fromAmino(object.value); + }, + fromProtoMsg(message: EventInvalidGrantProtoMsg): EventInvalidGrant { + return EventInvalidGrant.decode(message.value); + }, + toProto(message: EventInvalidGrant): Uint8Array { + return EventInvalidGrant.encode(message).finish(); + }, + toProtoMsg(message: EventInvalidGrant): EventInvalidGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventInvalidGrant", + value: EventInvalidGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInvalidGrant.typeUrl, EventInvalidGrant); +function createBaseEventOrderCancelFail(): EventOrderCancelFail { + return { + marketId: "", + subaccountId: "", + orderHash: "", + cid: "", + description: "" + }; +} +export const EventOrderCancelFail = { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail", + is(o: any): o is EventOrderCancelFail { + return o && (o.$typeUrl === EventOrderCancelFail.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.cid === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is EventOrderCancelFailAmino { + return o && (o.$typeUrl === EventOrderCancelFail.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.cid === "string" && typeof o.description === "string"); + }, + encode(message: EventOrderCancelFail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(26).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(34).string(message.cid); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOrderCancelFail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOrderCancelFail(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHash = reader.string(); + break; + case 4: + message.cid = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOrderCancelFail { + const message = createBaseEventOrderCancelFail(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: EventOrderCancelFailAmino): EventOrderCancelFail { + const message = createBaseEventOrderCancelFail(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: EventOrderCancelFail): EventOrderCancelFailAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: EventOrderCancelFailAminoMsg): EventOrderCancelFail { + return EventOrderCancelFail.fromAmino(object.value); + }, + fromProtoMsg(message: EventOrderCancelFailProtoMsg): EventOrderCancelFail { + return EventOrderCancelFail.decode(message.value); + }, + toProto(message: EventOrderCancelFail): Uint8Array { + return EventOrderCancelFail.encode(message).finish(); + }, + toProtoMsg(message: EventOrderCancelFail): EventOrderCancelFailProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EventOrderCancelFail", + value: EventOrderCancelFail.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOrderCancelFail.typeUrl, EventOrderCancelFail); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/exchange.ts b/libs/injectivejs/src/injective/exchange/v1beta1/exchange.ts new file mode 100644 index 00000000..a91677d5 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/exchange.ts @@ -0,0 +1,7789 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum AtomicMarketOrderAccessLevel { + Nobody = 0, + /** BeginBlockerSmartContractsOnly - currently unsupported */ + BeginBlockerSmartContractsOnly = 1, + SmartContractsOnly = 2, + Everyone = 3, + UNRECOGNIZED = -1, +} +export const AtomicMarketOrderAccessLevelAmino = AtomicMarketOrderAccessLevel; +export function atomicMarketOrderAccessLevelFromJSON(object: any): AtomicMarketOrderAccessLevel { + switch (object) { + case 0: + case "Nobody": + return AtomicMarketOrderAccessLevel.Nobody; + case 1: + case "BeginBlockerSmartContractsOnly": + return AtomicMarketOrderAccessLevel.BeginBlockerSmartContractsOnly; + case 2: + case "SmartContractsOnly": + return AtomicMarketOrderAccessLevel.SmartContractsOnly; + case 3: + case "Everyone": + return AtomicMarketOrderAccessLevel.Everyone; + case -1: + case "UNRECOGNIZED": + default: + return AtomicMarketOrderAccessLevel.UNRECOGNIZED; + } +} +export function atomicMarketOrderAccessLevelToJSON(object: AtomicMarketOrderAccessLevel): string { + switch (object) { + case AtomicMarketOrderAccessLevel.Nobody: + return "Nobody"; + case AtomicMarketOrderAccessLevel.BeginBlockerSmartContractsOnly: + return "BeginBlockerSmartContractsOnly"; + case AtomicMarketOrderAccessLevel.SmartContractsOnly: + return "SmartContractsOnly"; + case AtomicMarketOrderAccessLevel.Everyone: + return "Everyone"; + case AtomicMarketOrderAccessLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MarketStatus { + Unspecified = 0, + Active = 1, + Paused = 2, + Demolished = 3, + Expired = 4, + UNRECOGNIZED = -1, +} +export const MarketStatusAmino = MarketStatus; +export function marketStatusFromJSON(object: any): MarketStatus { + switch (object) { + case 0: + case "Unspecified": + return MarketStatus.Unspecified; + case 1: + case "Active": + return MarketStatus.Active; + case 2: + case "Paused": + return MarketStatus.Paused; + case 3: + case "Demolished": + return MarketStatus.Demolished; + case 4: + case "Expired": + return MarketStatus.Expired; + case -1: + case "UNRECOGNIZED": + default: + return MarketStatus.UNRECOGNIZED; + } +} +export function marketStatusToJSON(object: MarketStatus): string { + switch (object) { + case MarketStatus.Unspecified: + return "Unspecified"; + case MarketStatus.Active: + return "Active"; + case MarketStatus.Paused: + return "Paused"; + case MarketStatus.Demolished: + return "Demolished"; + case MarketStatus.Expired: + return "Expired"; + case MarketStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum OrderType { + UNSPECIFIED = 0, + BUY = 1, + SELL = 2, + STOP_BUY = 3, + STOP_SELL = 4, + TAKE_BUY = 5, + TAKE_SELL = 6, + BUY_PO = 7, + SELL_PO = 8, + BUY_ATOMIC = 9, + SELL_ATOMIC = 10, + UNRECOGNIZED = -1, +} +export const OrderTypeAmino = OrderType; +export function orderTypeFromJSON(object: any): OrderType { + switch (object) { + case 0: + case "UNSPECIFIED": + return OrderType.UNSPECIFIED; + case 1: + case "BUY": + return OrderType.BUY; + case 2: + case "SELL": + return OrderType.SELL; + case 3: + case "STOP_BUY": + return OrderType.STOP_BUY; + case 4: + case "STOP_SELL": + return OrderType.STOP_SELL; + case 5: + case "TAKE_BUY": + return OrderType.TAKE_BUY; + case 6: + case "TAKE_SELL": + return OrderType.TAKE_SELL; + case 7: + case "BUY_PO": + return OrderType.BUY_PO; + case 8: + case "SELL_PO": + return OrderType.SELL_PO; + case 9: + case "BUY_ATOMIC": + return OrderType.BUY_ATOMIC; + case 10: + case "SELL_ATOMIC": + return OrderType.SELL_ATOMIC; + case -1: + case "UNRECOGNIZED": + default: + return OrderType.UNRECOGNIZED; + } +} +export function orderTypeToJSON(object: OrderType): string { + switch (object) { + case OrderType.UNSPECIFIED: + return "UNSPECIFIED"; + case OrderType.BUY: + return "BUY"; + case OrderType.SELL: + return "SELL"; + case OrderType.STOP_BUY: + return "STOP_BUY"; + case OrderType.STOP_SELL: + return "STOP_SELL"; + case OrderType.TAKE_BUY: + return "TAKE_BUY"; + case OrderType.TAKE_SELL: + return "TAKE_SELL"; + case OrderType.BUY_PO: + return "BUY_PO"; + case OrderType.SELL_PO: + return "SELL_PO"; + case OrderType.BUY_ATOMIC: + return "BUY_ATOMIC"; + case OrderType.SELL_ATOMIC: + return "SELL_ATOMIC"; + case OrderType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ExecutionType { + UnspecifiedExecutionType = 0, + Market = 1, + LimitFill = 2, + LimitMatchRestingOrder = 3, + LimitMatchNewOrder = 4, + MarketLiquidation = 5, + ExpiryMarketSettlement = 6, + UNRECOGNIZED = -1, +} +export const ExecutionTypeAmino = ExecutionType; +export function executionTypeFromJSON(object: any): ExecutionType { + switch (object) { + case 0: + case "UnspecifiedExecutionType": + return ExecutionType.UnspecifiedExecutionType; + case 1: + case "Market": + return ExecutionType.Market; + case 2: + case "LimitFill": + return ExecutionType.LimitFill; + case 3: + case "LimitMatchRestingOrder": + return ExecutionType.LimitMatchRestingOrder; + case 4: + case "LimitMatchNewOrder": + return ExecutionType.LimitMatchNewOrder; + case 5: + case "MarketLiquidation": + return ExecutionType.MarketLiquidation; + case 6: + case "ExpiryMarketSettlement": + return ExecutionType.ExpiryMarketSettlement; + case -1: + case "UNRECOGNIZED": + default: + return ExecutionType.UNRECOGNIZED; + } +} +export function executionTypeToJSON(object: ExecutionType): string { + switch (object) { + case ExecutionType.UnspecifiedExecutionType: + return "UnspecifiedExecutionType"; + case ExecutionType.Market: + return "Market"; + case ExecutionType.LimitFill: + return "LimitFill"; + case ExecutionType.LimitMatchRestingOrder: + return "LimitMatchRestingOrder"; + case ExecutionType.LimitMatchNewOrder: + return "LimitMatchNewOrder"; + case ExecutionType.MarketLiquidation: + return "MarketLiquidation"; + case ExecutionType.ExpiryMarketSettlement: + return "ExpiryMarketSettlement"; + case ExecutionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum OrderMask { + UNUSED = 0, + ANY = 1, + REGULAR = 2, + CONDITIONAL = 4, + DIRECTION_BUY_OR_HIGHER = 8, + DIRECTION_SELL_OR_LOWER = 16, + TYPE_MARKET = 32, + TYPE_LIMIT = 64, + UNRECOGNIZED = -1, +} +export const OrderMaskAmino = OrderMask; +export function orderMaskFromJSON(object: any): OrderMask { + switch (object) { + case 0: + case "UNUSED": + return OrderMask.UNUSED; + case 1: + case "ANY": + return OrderMask.ANY; + case 2: + case "REGULAR": + return OrderMask.REGULAR; + case 4: + case "CONDITIONAL": + return OrderMask.CONDITIONAL; + case 8: + case "DIRECTION_BUY_OR_HIGHER": + return OrderMask.DIRECTION_BUY_OR_HIGHER; + case 16: + case "DIRECTION_SELL_OR_LOWER": + return OrderMask.DIRECTION_SELL_OR_LOWER; + case 32: + case "TYPE_MARKET": + return OrderMask.TYPE_MARKET; + case 64: + case "TYPE_LIMIT": + return OrderMask.TYPE_LIMIT; + case -1: + case "UNRECOGNIZED": + default: + return OrderMask.UNRECOGNIZED; + } +} +export function orderMaskToJSON(object: OrderMask): string { + switch (object) { + case OrderMask.UNUSED: + return "UNUSED"; + case OrderMask.ANY: + return "ANY"; + case OrderMask.REGULAR: + return "REGULAR"; + case OrderMask.CONDITIONAL: + return "CONDITIONAL"; + case OrderMask.DIRECTION_BUY_OR_HIGHER: + return "DIRECTION_BUY_OR_HIGHER"; + case OrderMask.DIRECTION_SELL_OR_LOWER: + return "DIRECTION_SELL_OR_LOWER"; + case OrderMask.TYPE_MARKET: + return "TYPE_MARKET"; + case OrderMask.TYPE_LIMIT: + return "TYPE_LIMIT"; + case OrderMask.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Params { + /** + * spot_market_instant_listing_fee defines the expedited fee in INJ required + * to create a spot market by bypassing governance + */ + spotMarketInstantListingFee: Coin; + /** + * derivative_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + derivativeMarketInstantListingFee: Coin; + /** + * default_spot_maker_fee defines the default exchange trade fee for makers on + * a spot market + */ + defaultSpotMakerFeeRate: string; + /** + * default_spot_taker_fee_rate defines the default exchange trade fee rate for + * takers on a new spot market + */ + defaultSpotTakerFeeRate: string; + /** + * default_derivative_maker_fee defines the default exchange trade fee for + * makers on a new derivative market + */ + defaultDerivativeMakerFeeRate: string; + /** + * default_derivative_taker_fee defines the default exchange trade fee for + * takers on a new derivative market + */ + defaultDerivativeTakerFeeRate: string; + /** + * default_initial_margin_ratio defines the default initial margin ratio on a + * new derivative market + */ + defaultInitialMarginRatio: string; + /** + * default_maintenance_margin_ratio defines the default maintenance margin + * ratio on a new derivative market + */ + defaultMaintenanceMarginRatio: string; + /** + * default_funding_interval defines the default funding interval on a + * derivative market + */ + defaultFundingInterval: bigint; + /** + * funding_multiple defines the timestamp multiple that the funding timestamp + * should be a multiple of + */ + fundingMultiple: bigint; + /** + * relayer_fee_share_rate defines the trade fee share percentage that goes to + * relayers + */ + relayerFeeShareRate: string; + /** + * default_hourly_funding_rate_cap defines the default maximum absolute value + * of the hourly funding rate + */ + defaultHourlyFundingRateCap: string; + /** hourly_interest_rate defines the hourly interest rate */ + defaultHourlyInterestRate: string; + /** + * max_derivative_order_side_count defines the maximum number of derivative + * active orders a subaccount can have for a given orderbook side + */ + maxDerivativeOrderSideCount: number; + /** + * inj_reward_staked_requirement_threshold defines the threshold on INJ + * rewards after which one also needs staked INJ to receive more + */ + injRewardStakedRequirementThreshold: string; + /** + * the trading_rewards_vesting_duration defines the vesting times for trading + * rewards + */ + tradingRewardsVestingDuration: bigint; + /** + * liquidator_reward_share_rate defines the ratio of the split of the surplus + * collateral that goes to the liquidator + */ + liquidatorRewardShareRate: string; + /** + * binary_options_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + binaryOptionsMarketInstantListingFee: Coin; + /** + * atomic_market_order_access_level defines the required access permissions + * for executing atomic market orders + */ + atomicMarketOrderAccessLevel: AtomicMarketOrderAccessLevel; + /** + * spot_atomic_market_order_fee_multiplier defines the default multiplier for + * executing atomic market orders in spot markets + */ + spotAtomicMarketOrderFeeMultiplier: string; + /** + * derivative_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in derivative markets + */ + derivativeAtomicMarketOrderFeeMultiplier: string; + /** + * binary_options_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in binary markets + */ + binaryOptionsAtomicMarketOrderFeeMultiplier: string; + /** minimal_protocol_fee_rate defines the minimal protocol fee rate */ + minimalProtocolFeeRate: string; + /** + * is_instant_derivative_market_launch_enabled defines whether instant + * derivative market launch is enabled + */ + isInstantDerivativeMarketLaunchEnabled: boolean; + postOnlyModeHeightThreshold: bigint; + /** + * Maximum time in seconds since the last mark price update to allow a + * decrease in margin + */ + marginDecreasePriceTimestampThresholdSeconds: bigint; + /** List of addresses that are allowed to perform exchange admin operations */ + exchangeAdmins: string[]; + /** inj_auction_max_cap defines the maximum cap for INJ sent to auction */ + injAuctionMaxCap: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * spot_market_instant_listing_fee defines the expedited fee in INJ required + * to create a spot market by bypassing governance + */ + spot_market_instant_listing_fee: CoinAmino; + /** + * derivative_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + derivative_market_instant_listing_fee: CoinAmino; + /** + * default_spot_maker_fee defines the default exchange trade fee for makers on + * a spot market + */ + default_spot_maker_fee_rate: string; + /** + * default_spot_taker_fee_rate defines the default exchange trade fee rate for + * takers on a new spot market + */ + default_spot_taker_fee_rate: string; + /** + * default_derivative_maker_fee defines the default exchange trade fee for + * makers on a new derivative market + */ + default_derivative_maker_fee_rate: string; + /** + * default_derivative_taker_fee defines the default exchange trade fee for + * takers on a new derivative market + */ + default_derivative_taker_fee_rate: string; + /** + * default_initial_margin_ratio defines the default initial margin ratio on a + * new derivative market + */ + default_initial_margin_ratio: string; + /** + * default_maintenance_margin_ratio defines the default maintenance margin + * ratio on a new derivative market + */ + default_maintenance_margin_ratio: string; + /** + * default_funding_interval defines the default funding interval on a + * derivative market + */ + default_funding_interval: string; + /** + * funding_multiple defines the timestamp multiple that the funding timestamp + * should be a multiple of + */ + funding_multiple: string; + /** + * relayer_fee_share_rate defines the trade fee share percentage that goes to + * relayers + */ + relayer_fee_share_rate: string; + /** + * default_hourly_funding_rate_cap defines the default maximum absolute value + * of the hourly funding rate + */ + default_hourly_funding_rate_cap: string; + /** hourly_interest_rate defines the hourly interest rate */ + default_hourly_interest_rate: string; + /** + * max_derivative_order_side_count defines the maximum number of derivative + * active orders a subaccount can have for a given orderbook side + */ + max_derivative_order_side_count: number; + /** + * inj_reward_staked_requirement_threshold defines the threshold on INJ + * rewards after which one also needs staked INJ to receive more + */ + inj_reward_staked_requirement_threshold: string; + /** + * the trading_rewards_vesting_duration defines the vesting times for trading + * rewards + */ + trading_rewards_vesting_duration: string; + /** + * liquidator_reward_share_rate defines the ratio of the split of the surplus + * collateral that goes to the liquidator + */ + liquidator_reward_share_rate: string; + /** + * binary_options_market_instant_listing_fee defines the expedited fee in INJ + * required to create a derivative market by bypassing governance + */ + binary_options_market_instant_listing_fee: CoinAmino; + /** + * atomic_market_order_access_level defines the required access permissions + * for executing atomic market orders + */ + atomic_market_order_access_level: AtomicMarketOrderAccessLevel; + /** + * spot_atomic_market_order_fee_multiplier defines the default multiplier for + * executing atomic market orders in spot markets + */ + spot_atomic_market_order_fee_multiplier: string; + /** + * derivative_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in derivative markets + */ + derivative_atomic_market_order_fee_multiplier: string; + /** + * binary_options_atomic_market_order_fee_multiplier defines the default + * multiplier for executing atomic market orders in binary markets + */ + binary_options_atomic_market_order_fee_multiplier: string; + /** minimal_protocol_fee_rate defines the minimal protocol fee rate */ + minimal_protocol_fee_rate: string; + /** + * is_instant_derivative_market_launch_enabled defines whether instant + * derivative market launch is enabled + */ + is_instant_derivative_market_launch_enabled: boolean; + post_only_mode_height_threshold: string; + /** + * Maximum time in seconds since the last mark price update to allow a + * decrease in margin + */ + margin_decrease_price_timestamp_threshold_seconds: string; + /** List of addresses that are allowed to perform exchange admin operations */ + exchange_admins: string[]; + /** inj_auction_max_cap defines the maximum cap for INJ sent to auction */ + inj_auction_max_cap: string; +} +export interface ParamsAminoMsg { + type: "exchange/Params"; + value: ParamsAmino; +} +export interface MarketFeeMultiplier { + marketId: string; + feeMultiplier: string; +} +export interface MarketFeeMultiplierProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier"; + value: Uint8Array; +} +export interface MarketFeeMultiplierAmino { + market_id: string; + fee_multiplier: string; +} +export interface MarketFeeMultiplierAminoMsg { + type: "/injective.exchange.v1beta1.MarketFeeMultiplier"; + value: MarketFeeMultiplierAmino; +} +/** An object describing a derivative market in the Injective Futures Protocol. */ +export interface DerivativeMarket { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Address of the quote currency denomination for the derivative contract */ + quoteDenom: string; + /** Unique market ID. */ + marketId: string; + /** + * initial_margin_ratio defines the initial margin ratio of a derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio of a + * derivative market + */ + maintenanceMarginRatio: string; + /** maker_fee_rate defines the maker fee rate of a derivative market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** + * true if the market is a perpetual market. false if the market is an expiry + * futures market + */ + isPerpetual: boolean; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface DerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket"; + value: Uint8Array; +} +/** An object describing a derivative market in the Injective Futures Protocol. */ +export interface DerivativeMarketAmino { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Address of the quote currency denomination for the derivative contract */ + quote_denom: string; + /** Unique market ID. */ + market_id: string; + /** + * initial_margin_ratio defines the initial margin ratio of a derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio of a + * derivative market + */ + maintenance_margin_ratio: string; + /** maker_fee_rate defines the maker fee rate of a derivative market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** + * true if the market is a perpetual market. false if the market is an expiry + * futures market + */ + isPerpetual: boolean; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface DerivativeMarketAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarket"; + value: DerivativeMarketAmino; +} +/** An object describing a binary options market in Injective Protocol. */ +export interface BinaryOptionsMarket { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** Unique market ID. */ + marketId: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + settlementPrice?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface BinaryOptionsMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket"; + value: Uint8Array; +} +/** An object describing a binary options market in Injective Protocol. */ +export interface BinaryOptionsMarketAmino { + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** Unique market ID. */ + market_id: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + settlement_price?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface BinaryOptionsMarketAminoMsg { + type: "/injective.exchange.v1beta1.BinaryOptionsMarket"; + value: BinaryOptionsMarketAmino; +} +export interface ExpiryFuturesMarketInfo { + /** market ID. */ + marketId: string; + /** + * expiration_timestamp defines the expiration time for a time expiry futures + * market. + */ + expirationTimestamp: bigint; + /** + * expiration_twap_start_timestamp defines the start time of the TWAP + * calculation window + */ + twapStartTimestamp: bigint; + /** + * expiration_twap_start_price_cumulative defines the cumulative price for the + * start of the TWAP window + */ + expirationTwapStartPriceCumulative: string; + /** + * settlement_price defines the settlement price for a time expiry futures + * market. + */ + settlementPrice: string; +} +export interface ExpiryFuturesMarketInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo"; + value: Uint8Array; +} +export interface ExpiryFuturesMarketInfoAmino { + /** market ID. */ + market_id: string; + /** + * expiration_timestamp defines the expiration time for a time expiry futures + * market. + */ + expiration_timestamp: string; + /** + * expiration_twap_start_timestamp defines the start time of the TWAP + * calculation window + */ + twap_start_timestamp: string; + /** + * expiration_twap_start_price_cumulative defines the cumulative price for the + * start of the TWAP window + */ + expiration_twap_start_price_cumulative: string; + /** + * settlement_price defines the settlement price for a time expiry futures + * market. + */ + settlement_price: string; +} +export interface ExpiryFuturesMarketInfoAminoMsg { + type: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo"; + value: ExpiryFuturesMarketInfoAmino; +} +export interface PerpetualMarketInfo { + /** market ID. */ + marketId: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourlyFundingRateCap: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourlyInterestRate: string; + /** + * next_funding_timestamp defines the next funding timestamp in seconds of a + * perpetual market + */ + nextFundingTimestamp: bigint; + /** + * funding_interval defines the next funding interval in seconds of a + * perpetual market. + */ + fundingInterval: bigint; +} +export interface PerpetualMarketInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo"; + value: Uint8Array; +} +export interface PerpetualMarketInfoAmino { + /** market ID. */ + market_id: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourly_funding_rate_cap: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourly_interest_rate: string; + /** + * next_funding_timestamp defines the next funding timestamp in seconds of a + * perpetual market + */ + next_funding_timestamp: string; + /** + * funding_interval defines the next funding interval in seconds of a + * perpetual market. + */ + funding_interval: string; +} +export interface PerpetualMarketInfoAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketInfo"; + value: PerpetualMarketInfoAmino; +} +export interface PerpetualMarketFunding { + /** cumulative_funding defines the cumulative funding of a perpetual market. */ + cumulativeFunding: string; + /** + * cumulative_price defines the cumulative price for the current hour up to + * the last timestamp + */ + cumulativePrice: string; + lastTimestamp: bigint; +} +export interface PerpetualMarketFundingProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding"; + value: Uint8Array; +} +export interface PerpetualMarketFundingAmino { + /** cumulative_funding defines the cumulative funding of a perpetual market. */ + cumulative_funding: string; + /** + * cumulative_price defines the cumulative price for the current hour up to + * the last timestamp + */ + cumulative_price: string; + last_timestamp: string; +} +export interface PerpetualMarketFundingAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketFunding"; + value: PerpetualMarketFundingAmino; +} +export interface DerivativeMarketSettlementInfo { + /** market ID. */ + marketId: string; + /** settlement_price defines the settlement price */ + settlementPrice: string; +} +export interface DerivativeMarketSettlementInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo"; + value: Uint8Array; +} +export interface DerivativeMarketSettlementInfoAmino { + /** market ID. */ + market_id: string; + /** settlement_price defines the settlement price */ + settlement_price: string; +} +export interface DerivativeMarketSettlementInfoAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo"; + value: DerivativeMarketSettlementInfoAmino; +} +export interface NextFundingTimestamp { + nextTimestamp: bigint; +} +export interface NextFundingTimestampProtoMsg { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp"; + value: Uint8Array; +} +export interface NextFundingTimestampAmino { + next_timestamp: string; +} +export interface NextFundingTimestampAminoMsg { + type: "/injective.exchange.v1beta1.NextFundingTimestamp"; + value: NextFundingTimestampAmino; +} +export interface MidPriceAndTOB { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface MidPriceAndTOBProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB"; + value: Uint8Array; +} +export interface MidPriceAndTOBAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface MidPriceAndTOBAminoMsg { + type: "/injective.exchange.v1beta1.MidPriceAndTOB"; + value: MidPriceAndTOBAmino; +} +/** An object describing trade pair of two assets. */ +export interface SpotMarket { + /** + * A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote + * asset. + */ + ticker: string; + /** Coin denom used for the base asset */ + baseDenom: string; + /** Coin used for the quote asset */ + quoteDenom: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + makerFeeRate: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + takerFeeRate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayerFeeShareRate: string; + /** Unique market ID. */ + marketId: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price required + * for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + adminPermissions: number; +} +export interface SpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarket"; + value: Uint8Array; +} +/** An object describing trade pair of two assets. */ +export interface SpotMarketAmino { + /** + * A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote + * asset. + */ + ticker: string; + /** Coin denom used for the base asset */ + base_denom: string; + /** Coin used for the quote asset */ + quote_denom: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + maker_fee_rate: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + taker_fee_rate: string; + /** + * relayer_fee_share_rate defines the percentage of the transaction fee shared + * with the relayer in a derivative market + */ + relayer_fee_share_rate: string; + /** Unique market ID. */ + market_id: string; + /** Status of the market */ + status: MarketStatus; + /** + * min_price_tick_size defines the minimum tick size that the price required + * for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + /** current market admin */ + admin: string; + /** level of admin permissions */ + admin_permissions: number; +} +export interface SpotMarketAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarket"; + value: SpotMarketAmino; +} +/** A subaccount's deposit for a given base currency */ +export interface Deposit { + availableBalance: string; + totalBalance: string; +} +export interface DepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Deposit"; + value: Uint8Array; +} +/** A subaccount's deposit for a given base currency */ +export interface DepositAmino { + available_balance: string; + total_balance: string; +} +export interface DepositAminoMsg { + type: "/injective.exchange.v1beta1.Deposit"; + value: DepositAmino; +} +export interface SubaccountTradeNonce { + nonce: number; +} +export interface SubaccountTradeNonceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce"; + value: Uint8Array; +} +export interface SubaccountTradeNonceAmino { + nonce: number; +} +export interface SubaccountTradeNonceAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountTradeNonce"; + value: SubaccountTradeNonceAmino; +} +export interface OrderInfo { + /** bytes32 subaccount ID that created the order */ + subaccountId: string; + /** address fee_recipient address that will receive fees for the order */ + feeRecipient: string; + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + cid: string; +} +export interface OrderInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderInfo"; + value: Uint8Array; +} +export interface OrderInfoAmino { + /** bytes32 subaccount ID that created the order */ + subaccount_id: string; + /** address fee_recipient address that will receive fees for the order */ + fee_recipient: string; + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + cid: string; +} +export interface OrderInfoAminoMsg { + type: "/injective.exchange.v1beta1.OrderInfo"; + value: OrderInfoAmino; +} +export interface SpotOrder { + /** market_id represents the unique ID of the market */ + marketId: string; + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface SpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotOrder"; + value: Uint8Array; +} +export interface SpotOrderAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface SpotOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotOrder"; + value: SpotOrderAmino; +} +/** A valid Spot limit order with Metadata. */ +export interface SpotLimitOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface SpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder"; + value: Uint8Array; +} +/** A valid Spot limit order with Metadata. */ +export interface SpotLimitOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface SpotLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotLimitOrder"; + value: SpotLimitOrderAmino; +} +/** A valid Spot market order with Metadata. */ +export interface SpotMarketOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + balanceHold: string; + orderHash: Uint8Array; + /** order types */ + orderType: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface SpotMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder"; + value: Uint8Array; +} +/** A valid Spot market order with Metadata. */ +export interface SpotMarketOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + balance_hold: string; + order_hash: string; + /** order types */ + order_type: OrderType; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface SpotMarketOrderAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarketOrder"; + value: SpotMarketOrderAmino; +} +export interface DerivativeOrder { + /** market_id represents the unique ID of the market */ + marketId: string; + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; +} +export interface DerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder"; + value: Uint8Array; +} +export interface DerivativeOrderAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; +} +export interface DerivativeOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeOrder"; + value: DerivativeOrderAmino; +} +export interface SubaccountOrderbookMetadata { + vanillaLimitOrderCount: number; + reduceOnlyLimitOrderCount: number; + /** + * AggregateReduceOnlyQuantity is the aggregate fillable quantity of the + * subaccount's reduce-only limit orders in the given direction. + */ + aggregateReduceOnlyQuantity: string; + /** + * AggregateVanillaQuantity is the aggregate fillable quantity of the + * subaccount's vanilla limit orders in the given direction. + */ + aggregateVanillaQuantity: string; + vanillaConditionalOrderCount: number; + reduceOnlyConditionalOrderCount: number; +} +export interface SubaccountOrderbookMetadataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata"; + value: Uint8Array; +} +export interface SubaccountOrderbookMetadataAmino { + vanilla_limit_order_count: number; + reduce_only_limit_order_count: number; + /** + * AggregateReduceOnlyQuantity is the aggregate fillable quantity of the + * subaccount's reduce-only limit orders in the given direction. + */ + aggregate_reduce_only_quantity: string; + /** + * AggregateVanillaQuantity is the aggregate fillable quantity of the + * subaccount's vanilla limit orders in the given direction. + */ + aggregate_vanilla_quantity: string; + vanilla_conditional_order_count: number; + reduce_only_conditional_order_count: number; +} +export interface SubaccountOrderbookMetadataAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata"; + value: SubaccountOrderbookMetadataAmino; +} +export interface SubaccountOrder { + /** price of the order */ + price: string; + /** the amount of the quantity remaining fillable */ + quantity: string; + isReduceOnly: boolean; + cid: string; +} +export interface SubaccountOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder"; + value: Uint8Array; +} +export interface SubaccountOrderAmino { + /** price of the order */ + price: string; + /** the amount of the quantity remaining fillable */ + quantity: string; + isReduceOnly: boolean; + cid: string; +} +export interface SubaccountOrderAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrder"; + value: SubaccountOrderAmino; +} +export interface SubaccountOrderData { + order?: SubaccountOrder; + orderHash: Uint8Array; +} +export interface SubaccountOrderDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData"; + value: Uint8Array; +} +export interface SubaccountOrderDataAmino { + order?: SubaccountOrderAmino; + order_hash: string; +} +export interface SubaccountOrderDataAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderData"; + value: SubaccountOrderDataAmino; +} +/** A valid Derivative limit order with Metadata. */ +export interface DerivativeLimitOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface DerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder"; + value: Uint8Array; +} +/** A valid Derivative limit order with Metadata. */ +export interface DerivativeLimitOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + /** margin is the margin used by the limit order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface DerivativeLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeLimitOrder"; + value: DerivativeLimitOrderAmino; +} +/** A valid Derivative market order with Metadata. */ +export interface DerivativeMarketOrder { + /** order_info contains the information of the order */ + orderInfo: OrderInfo; + /** order types */ + orderType: OrderType; + margin: string; + marginHold: string; + /** trigger_price is the trigger price used by stop/take orders */ + triggerPrice?: string; + orderHash: Uint8Array; +} +export interface DerivativeMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder"; + value: Uint8Array; +} +/** A valid Derivative market order with Metadata. */ +export interface DerivativeMarketOrderAmino { + /** order_info contains the information of the order */ + order_info: OrderInfoAmino; + /** order types */ + order_type: OrderType; + margin: string; + margin_hold: string; + /** trigger_price is the trigger price used by stop/take orders */ + trigger_price?: string; + order_hash: string; +} +export interface DerivativeMarketOrderAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrder"; + value: DerivativeMarketOrderAmino; +} +export interface Position { + isLong: boolean; + quantity: string; + entryPrice: string; + margin: string; + cumulativeFundingEntry: string; +} +export interface PositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + isLong: boolean; + quantity: string; + entry_price: string; + margin: string; + cumulative_funding_entry: string; +} +export interface PositionAminoMsg { + type: "/injective.exchange.v1beta1.Position"; + value: PositionAmino; +} +export interface MarketOrderIndicator { + /** market_id represents the unique ID of the market */ + marketId: string; + isBuy: boolean; +} +export interface MarketOrderIndicatorProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator"; + value: Uint8Array; +} +export interface MarketOrderIndicatorAmino { + /** market_id represents the unique ID of the market */ + market_id: string; + isBuy: boolean; +} +export interface MarketOrderIndicatorAminoMsg { + type: "/injective.exchange.v1beta1.MarketOrderIndicator"; + value: MarketOrderIndicatorAmino; +} +export interface TradeLog { + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccountId: Uint8Array; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: Uint8Array; + cid: string; +} +export interface TradeLogProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeLog"; + value: Uint8Array; +} +export interface TradeLogAmino { + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccount_id: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; +} +export interface TradeLogAminoMsg { + type: "/injective.exchange.v1beta1.TradeLog"; + value: TradeLogAmino; +} +export interface PositionDelta { + isLong: boolean; + executionQuantity: string; + executionMargin: string; + executionPrice: string; +} +export interface PositionDeltaProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PositionDelta"; + value: Uint8Array; +} +export interface PositionDeltaAmino { + is_long: boolean; + execution_quantity: string; + execution_margin: string; + execution_price: string; +} +export interface PositionDeltaAminoMsg { + type: "/injective.exchange.v1beta1.PositionDelta"; + value: PositionDeltaAmino; +} +export interface DerivativeTradeLog { + subaccountId: Uint8Array; + positionDelta?: PositionDelta; + payout: string; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: Uint8Array; + cid: string; + pnl: string; +} +export interface DerivativeTradeLogProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog"; + value: Uint8Array; +} +export interface DerivativeTradeLogAmino { + subaccount_id: string; + position_delta?: PositionDeltaAmino; + payout: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + pnl: string; +} +export interface DerivativeTradeLogAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeTradeLog"; + value: DerivativeTradeLogAmino; +} +export interface SubaccountPosition { + position?: Position; + subaccountId: Uint8Array; +} +export interface SubaccountPositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition"; + value: Uint8Array; +} +export interface SubaccountPositionAmino { + position?: PositionAmino; + subaccount_id: string; +} +export interface SubaccountPositionAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountPosition"; + value: SubaccountPositionAmino; +} +export interface SubaccountDeposit { + subaccountId: Uint8Array; + deposit?: Deposit; +} +export interface SubaccountDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit"; + value: Uint8Array; +} +export interface SubaccountDepositAmino { + subaccount_id: string; + deposit?: DepositAmino; +} +export interface SubaccountDepositAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountDeposit"; + value: SubaccountDepositAmino; +} +export interface DepositUpdate { + denom: string; + deposits: SubaccountDeposit[]; +} +export interface DepositUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate"; + value: Uint8Array; +} +export interface DepositUpdateAmino { + denom: string; + deposits: SubaccountDepositAmino[]; +} +export interface DepositUpdateAminoMsg { + type: "/injective.exchange.v1beta1.DepositUpdate"; + value: DepositUpdateAmino; +} +export interface PointsMultiplier { + makerPointsMultiplier: string; + takerPointsMultiplier: string; +} +export interface PointsMultiplierProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier"; + value: Uint8Array; +} +export interface PointsMultiplierAmino { + maker_points_multiplier: string; + taker_points_multiplier: string; +} +export interface PointsMultiplierAminoMsg { + type: "/injective.exchange.v1beta1.PointsMultiplier"; + value: PointsMultiplierAmino; +} +export interface TradingRewardCampaignBoostInfo { + boostedSpotMarketIds: string[]; + spotMarketMultipliers: PointsMultiplier[]; + boostedDerivativeMarketIds: string[]; + derivativeMarketMultipliers: PointsMultiplier[]; +} +export interface TradingRewardCampaignBoostInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo"; + value: Uint8Array; +} +export interface TradingRewardCampaignBoostInfoAmino { + boosted_spot_market_ids: string[]; + spot_market_multipliers: PointsMultiplierAmino[]; + boosted_derivative_market_ids: string[]; + derivative_market_multipliers: PointsMultiplierAmino[]; +} +export interface TradingRewardCampaignBoostInfoAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo"; + value: TradingRewardCampaignBoostInfoAmino; +} +export interface CampaignRewardPool { + startTimestamp: bigint; + /** + * max_campaign_rewards are the maximum reward amounts to be disbursed at the + * end of the campaign + */ + maxCampaignRewards: Coin[]; +} +export interface CampaignRewardPoolProtoMsg { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool"; + value: Uint8Array; +} +export interface CampaignRewardPoolAmino { + start_timestamp: string; + /** + * max_campaign_rewards are the maximum reward amounts to be disbursed at the + * end of the campaign + */ + max_campaign_rewards: CoinAmino[]; +} +export interface CampaignRewardPoolAminoMsg { + type: "/injective.exchange.v1beta1.CampaignRewardPool"; + value: CampaignRewardPoolAmino; +} +export interface TradingRewardCampaignInfo { + /** number of seconds of the duration of each campaign */ + campaignDurationSeconds: bigint; + /** the trading fee quote denoms which will be counted for the rewards */ + quoteDenoms: string[]; + /** the optional boost info for markets */ + tradingRewardBoostInfo?: TradingRewardCampaignBoostInfo; + /** the marketIDs which are disqualified from being rewarded */ + disqualifiedMarketIds: string[]; +} +export interface TradingRewardCampaignInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo"; + value: Uint8Array; +} +export interface TradingRewardCampaignInfoAmino { + /** number of seconds of the duration of each campaign */ + campaign_duration_seconds: string; + /** the trading fee quote denoms which will be counted for the rewards */ + quote_denoms: string[]; + /** the optional boost info for markets */ + trading_reward_boost_info?: TradingRewardCampaignBoostInfoAmino; + /** the marketIDs which are disqualified from being rewarded */ + disqualified_market_ids: string[]; +} +export interface TradingRewardCampaignInfoAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignInfo"; + value: TradingRewardCampaignInfoAmino; +} +export interface FeeDiscountTierInfo { + makerDiscountRate: string; + takerDiscountRate: string; + stakedAmount: string; + volume: string; +} +export interface FeeDiscountTierInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo"; + value: Uint8Array; +} +export interface FeeDiscountTierInfoAmino { + maker_discount_rate: string; + taker_discount_rate: string; + staked_amount: string; + volume: string; +} +export interface FeeDiscountTierInfoAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountTierInfo"; + value: FeeDiscountTierInfoAmino; +} +export interface FeeDiscountSchedule { + bucketCount: bigint; + bucketDuration: bigint; + /** + * the trading fee quote denoms which will be counted for the fee paid + * contribution + */ + quoteDenoms: string[]; + /** the fee discount tiers */ + tierInfos: FeeDiscountTierInfo[]; + /** + * the marketIDs which are disqualified from contributing to the fee paid + * amount + */ + disqualifiedMarketIds: string[]; +} +export interface FeeDiscountScheduleProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule"; + value: Uint8Array; +} +export interface FeeDiscountScheduleAmino { + bucket_count: string; + bucket_duration: string; + /** + * the trading fee quote denoms which will be counted for the fee paid + * contribution + */ + quote_denoms: string[]; + /** the fee discount tiers */ + tier_infos: FeeDiscountTierInfoAmino[]; + /** + * the marketIDs which are disqualified from contributing to the fee paid + * amount + */ + disqualified_market_ids: string[]; +} +export interface FeeDiscountScheduleAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountSchedule"; + value: FeeDiscountScheduleAmino; +} +export interface FeeDiscountTierTTL { + tier: bigint; + ttlTimestamp: bigint; +} +export interface FeeDiscountTierTTLProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL"; + value: Uint8Array; +} +export interface FeeDiscountTierTTLAmino { + tier: string; + ttl_timestamp: string; +} +export interface FeeDiscountTierTTLAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountTierTTL"; + value: FeeDiscountTierTTLAmino; +} +export interface VolumeRecord { + makerVolume: string; + takerVolume: string; +} +export interface VolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord"; + value: Uint8Array; +} +export interface VolumeRecordAmino { + maker_volume: string; + taker_volume: string; +} +export interface VolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.VolumeRecord"; + value: VolumeRecordAmino; +} +export interface AccountRewards { + account: string; + rewards: Coin[]; +} +export interface AccountRewardsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AccountRewards"; + value: Uint8Array; +} +export interface AccountRewardsAmino { + account: string; + rewards: CoinAmino[]; +} +export interface AccountRewardsAminoMsg { + type: "/injective.exchange.v1beta1.AccountRewards"; + value: AccountRewardsAmino; +} +export interface TradeRecords { + marketId: string; + latestTradeRecords: TradeRecord[]; +} +export interface TradeRecordsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeRecords"; + value: Uint8Array; +} +export interface TradeRecordsAmino { + market_id: string; + latest_trade_records: TradeRecordAmino[]; +} +export interface TradeRecordsAminoMsg { + type: "/injective.exchange.v1beta1.TradeRecords"; + value: TradeRecordsAmino; +} +export interface SubaccountIDs { + subaccountIds: Uint8Array[]; +} +export interface SubaccountIDsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs"; + value: Uint8Array; +} +export interface SubaccountIDsAmino { + subaccount_ids: string[]; +} +export interface SubaccountIDsAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountIDs"; + value: SubaccountIDsAmino; +} +export interface TradeRecord { + timestamp: bigint; + price: string; + quantity: string; +} +export interface TradeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeRecord"; + value: Uint8Array; +} +export interface TradeRecordAmino { + timestamp: string; + price: string; + quantity: string; +} +export interface TradeRecordAminoMsg { + type: "/injective.exchange.v1beta1.TradeRecord"; + value: TradeRecordAmino; +} +export interface Level { + /** price */ + p: string; + /** quantity */ + q: string; +} +export interface LevelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Level"; + value: Uint8Array; +} +export interface LevelAmino { + /** price */ + p: string; + /** quantity */ + q: string; +} +export interface LevelAminoMsg { + type: "/injective.exchange.v1beta1.Level"; + value: LevelAmino; +} +export interface AggregateSubaccountVolumeRecord { + subaccountId: string; + marketVolumes: MarketVolume[]; +} +export interface AggregateSubaccountVolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord"; + value: Uint8Array; +} +export interface AggregateSubaccountVolumeRecordAmino { + subaccount_id: string; + market_volumes: MarketVolumeAmino[]; +} +export interface AggregateSubaccountVolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord"; + value: AggregateSubaccountVolumeRecordAmino; +} +export interface AggregateAccountVolumeRecord { + account: string; + marketVolumes: MarketVolume[]; +} +export interface AggregateAccountVolumeRecordProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord"; + value: Uint8Array; +} +export interface AggregateAccountVolumeRecordAmino { + account: string; + market_volumes: MarketVolumeAmino[]; +} +export interface AggregateAccountVolumeRecordAminoMsg { + type: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord"; + value: AggregateAccountVolumeRecordAmino; +} +export interface MarketVolume { + marketId: string; + volume: VolumeRecord; +} +export interface MarketVolumeProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketVolume"; + value: Uint8Array; +} +export interface MarketVolumeAmino { + market_id: string; + volume: VolumeRecordAmino; +} +export interface MarketVolumeAminoMsg { + type: "/injective.exchange.v1beta1.MarketVolume"; + value: MarketVolumeAmino; +} +export interface DenomDecimals { + denom: string; + decimals: bigint; +} +export interface DenomDecimalsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals"; + value: Uint8Array; +} +export interface DenomDecimalsAmino { + denom: string; + decimals: string; +} +export interface DenomDecimalsAminoMsg { + type: "/injective.exchange.v1beta1.DenomDecimals"; + value: DenomDecimalsAmino; +} +export interface GrantAuthorization { + grantee: string; + amount: string; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +export interface GrantAuthorizationAmino { + grantee: string; + amount: string; +} +export interface GrantAuthorizationAminoMsg { + type: "/injective.exchange.v1beta1.GrantAuthorization"; + value: GrantAuthorizationAmino; +} +export interface ActiveGrant { + granter: string; + amount: string; +} +export interface ActiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant"; + value: Uint8Array; +} +export interface ActiveGrantAmino { + granter: string; + amount: string; +} +export interface ActiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.ActiveGrant"; + value: ActiveGrantAmino; +} +export interface EffectiveGrant { + granter: string; + netGrantedStake: string; + isValid: boolean; +} +export interface EffectiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant"; + value: Uint8Array; +} +export interface EffectiveGrantAmino { + granter: string; + net_granted_stake: string; + is_valid: boolean; +} +export interface EffectiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.EffectiveGrant"; + value: EffectiveGrantAmino; +} +function createBaseParams(): Params { + return { + spotMarketInstantListingFee: Coin.fromPartial({}), + derivativeMarketInstantListingFee: Coin.fromPartial({}), + defaultSpotMakerFeeRate: "", + defaultSpotTakerFeeRate: "", + defaultDerivativeMakerFeeRate: "", + defaultDerivativeTakerFeeRate: "", + defaultInitialMarginRatio: "", + defaultMaintenanceMarginRatio: "", + defaultFundingInterval: BigInt(0), + fundingMultiple: BigInt(0), + relayerFeeShareRate: "", + defaultHourlyFundingRateCap: "", + defaultHourlyInterestRate: "", + maxDerivativeOrderSideCount: 0, + injRewardStakedRequirementThreshold: "", + tradingRewardsVestingDuration: BigInt(0), + liquidatorRewardShareRate: "", + binaryOptionsMarketInstantListingFee: Coin.fromPartial({}), + atomicMarketOrderAccessLevel: 0, + spotAtomicMarketOrderFeeMultiplier: "", + derivativeAtomicMarketOrderFeeMultiplier: "", + binaryOptionsAtomicMarketOrderFeeMultiplier: "", + minimalProtocolFeeRate: "", + isInstantDerivativeMarketLaunchEnabled: false, + postOnlyModeHeightThreshold: BigInt(0), + marginDecreasePriceTimestampThresholdSeconds: BigInt(0), + exchangeAdmins: [], + injAuctionMaxCap: "" + }; +} +export const Params = { + typeUrl: "/injective.exchange.v1beta1.Params", + aminoType: "exchange/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Coin.is(o.spotMarketInstantListingFee) && Coin.is(o.derivativeMarketInstantListingFee) && typeof o.defaultSpotMakerFeeRate === "string" && typeof o.defaultSpotTakerFeeRate === "string" && typeof o.defaultDerivativeMakerFeeRate === "string" && typeof o.defaultDerivativeTakerFeeRate === "string" && typeof o.defaultInitialMarginRatio === "string" && typeof o.defaultMaintenanceMarginRatio === "string" && typeof o.defaultFundingInterval === "bigint" && typeof o.fundingMultiple === "bigint" && typeof o.relayerFeeShareRate === "string" && typeof o.defaultHourlyFundingRateCap === "string" && typeof o.defaultHourlyInterestRate === "string" && typeof o.maxDerivativeOrderSideCount === "number" && typeof o.injRewardStakedRequirementThreshold === "string" && typeof o.tradingRewardsVestingDuration === "bigint" && typeof o.liquidatorRewardShareRate === "string" && Coin.is(o.binaryOptionsMarketInstantListingFee) && isSet(o.atomicMarketOrderAccessLevel) && typeof o.spotAtomicMarketOrderFeeMultiplier === "string" && typeof o.derivativeAtomicMarketOrderFeeMultiplier === "string" && typeof o.binaryOptionsAtomicMarketOrderFeeMultiplier === "string" && typeof o.minimalProtocolFeeRate === "string" && typeof o.isInstantDerivativeMarketLaunchEnabled === "boolean" && typeof o.postOnlyModeHeightThreshold === "bigint" && typeof o.marginDecreasePriceTimestampThresholdSeconds === "bigint" && Array.isArray(o.exchangeAdmins) && (!o.exchangeAdmins.length || typeof o.exchangeAdmins[0] === "string") && typeof o.injAuctionMaxCap === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Coin.isAmino(o.spot_market_instant_listing_fee) && Coin.isAmino(o.derivative_market_instant_listing_fee) && typeof o.default_spot_maker_fee_rate === "string" && typeof o.default_spot_taker_fee_rate === "string" && typeof o.default_derivative_maker_fee_rate === "string" && typeof o.default_derivative_taker_fee_rate === "string" && typeof o.default_initial_margin_ratio === "string" && typeof o.default_maintenance_margin_ratio === "string" && typeof o.default_funding_interval === "bigint" && typeof o.funding_multiple === "bigint" && typeof o.relayer_fee_share_rate === "string" && typeof o.default_hourly_funding_rate_cap === "string" && typeof o.default_hourly_interest_rate === "string" && typeof o.max_derivative_order_side_count === "number" && typeof o.inj_reward_staked_requirement_threshold === "string" && typeof o.trading_rewards_vesting_duration === "bigint" && typeof o.liquidator_reward_share_rate === "string" && Coin.isAmino(o.binary_options_market_instant_listing_fee) && isSet(o.atomic_market_order_access_level) && typeof o.spot_atomic_market_order_fee_multiplier === "string" && typeof o.derivative_atomic_market_order_fee_multiplier === "string" && typeof o.binary_options_atomic_market_order_fee_multiplier === "string" && typeof o.minimal_protocol_fee_rate === "string" && typeof o.is_instant_derivative_market_launch_enabled === "boolean" && typeof o.post_only_mode_height_threshold === "bigint" && typeof o.margin_decrease_price_timestamp_threshold_seconds === "bigint" && Array.isArray(o.exchange_admins) && (!o.exchange_admins.length || typeof o.exchange_admins[0] === "string") && typeof o.inj_auction_max_cap === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.spotMarketInstantListingFee !== undefined) { + Coin.encode(message.spotMarketInstantListingFee, writer.uint32(10).fork()).ldelim(); + } + if (message.derivativeMarketInstantListingFee !== undefined) { + Coin.encode(message.derivativeMarketInstantListingFee, writer.uint32(18).fork()).ldelim(); + } + if (message.defaultSpotMakerFeeRate !== "") { + writer.uint32(26).string(message.defaultSpotMakerFeeRate); + } + if (message.defaultSpotTakerFeeRate !== "") { + writer.uint32(34).string(message.defaultSpotTakerFeeRate); + } + if (message.defaultDerivativeMakerFeeRate !== "") { + writer.uint32(42).string(message.defaultDerivativeMakerFeeRate); + } + if (message.defaultDerivativeTakerFeeRate !== "") { + writer.uint32(50).string(message.defaultDerivativeTakerFeeRate); + } + if (message.defaultInitialMarginRatio !== "") { + writer.uint32(58).string(message.defaultInitialMarginRatio); + } + if (message.defaultMaintenanceMarginRatio !== "") { + writer.uint32(66).string(message.defaultMaintenanceMarginRatio); + } + if (message.defaultFundingInterval !== BigInt(0)) { + writer.uint32(72).int64(message.defaultFundingInterval); + } + if (message.fundingMultiple !== BigInt(0)) { + writer.uint32(80).int64(message.fundingMultiple); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(90).string(message.relayerFeeShareRate); + } + if (message.defaultHourlyFundingRateCap !== "") { + writer.uint32(98).string(message.defaultHourlyFundingRateCap); + } + if (message.defaultHourlyInterestRate !== "") { + writer.uint32(106).string(message.defaultHourlyInterestRate); + } + if (message.maxDerivativeOrderSideCount !== 0) { + writer.uint32(112).uint32(message.maxDerivativeOrderSideCount); + } + if (message.injRewardStakedRequirementThreshold !== "") { + writer.uint32(122).string(message.injRewardStakedRequirementThreshold); + } + if (message.tradingRewardsVestingDuration !== BigInt(0)) { + writer.uint32(128).int64(message.tradingRewardsVestingDuration); + } + if (message.liquidatorRewardShareRate !== "") { + writer.uint32(138).string(message.liquidatorRewardShareRate); + } + if (message.binaryOptionsMarketInstantListingFee !== undefined) { + Coin.encode(message.binaryOptionsMarketInstantListingFee, writer.uint32(146).fork()).ldelim(); + } + if (message.atomicMarketOrderAccessLevel !== 0) { + writer.uint32(152).int32(message.atomicMarketOrderAccessLevel); + } + if (message.spotAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(162).string(message.spotAtomicMarketOrderFeeMultiplier); + } + if (message.derivativeAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(170).string(message.derivativeAtomicMarketOrderFeeMultiplier); + } + if (message.binaryOptionsAtomicMarketOrderFeeMultiplier !== "") { + writer.uint32(178).string(message.binaryOptionsAtomicMarketOrderFeeMultiplier); + } + if (message.minimalProtocolFeeRate !== "") { + writer.uint32(186).string(message.minimalProtocolFeeRate); + } + if (message.isInstantDerivativeMarketLaunchEnabled === true) { + writer.uint32(192).bool(message.isInstantDerivativeMarketLaunchEnabled); + } + if (message.postOnlyModeHeightThreshold !== BigInt(0)) { + writer.uint32(200).int64(message.postOnlyModeHeightThreshold); + } + if (message.marginDecreasePriceTimestampThresholdSeconds !== BigInt(0)) { + writer.uint32(208).int64(message.marginDecreasePriceTimestampThresholdSeconds); + } + for (const v of message.exchangeAdmins) { + writer.uint32(218).string(v!); + } + if (message.injAuctionMaxCap !== "") { + writer.uint32(226).string(message.injAuctionMaxCap); + } + 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.spotMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.derivativeMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.defaultSpotMakerFeeRate = reader.string(); + break; + case 4: + message.defaultSpotTakerFeeRate = reader.string(); + break; + case 5: + message.defaultDerivativeMakerFeeRate = reader.string(); + break; + case 6: + message.defaultDerivativeTakerFeeRate = reader.string(); + break; + case 7: + message.defaultInitialMarginRatio = reader.string(); + break; + case 8: + message.defaultMaintenanceMarginRatio = reader.string(); + break; + case 9: + message.defaultFundingInterval = reader.int64(); + break; + case 10: + message.fundingMultiple = reader.int64(); + break; + case 11: + message.relayerFeeShareRate = reader.string(); + break; + case 12: + message.defaultHourlyFundingRateCap = reader.string(); + break; + case 13: + message.defaultHourlyInterestRate = reader.string(); + break; + case 14: + message.maxDerivativeOrderSideCount = reader.uint32(); + break; + case 15: + message.injRewardStakedRequirementThreshold = reader.string(); + break; + case 16: + message.tradingRewardsVestingDuration = reader.int64(); + break; + case 17: + message.liquidatorRewardShareRate = reader.string(); + break; + case 18: + message.binaryOptionsMarketInstantListingFee = Coin.decode(reader, reader.uint32()); + break; + case 19: + message.atomicMarketOrderAccessLevel = (reader.int32() as any); + break; + case 20: + message.spotAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 21: + message.derivativeAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 22: + message.binaryOptionsAtomicMarketOrderFeeMultiplier = reader.string(); + break; + case 23: + message.minimalProtocolFeeRate = reader.string(); + break; + case 24: + message.isInstantDerivativeMarketLaunchEnabled = reader.bool(); + break; + case 25: + message.postOnlyModeHeightThreshold = reader.int64(); + break; + case 26: + message.marginDecreasePriceTimestampThresholdSeconds = reader.int64(); + break; + case 27: + message.exchangeAdmins.push(reader.string()); + break; + case 28: + message.injAuctionMaxCap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.spotMarketInstantListingFee = object.spotMarketInstantListingFee !== undefined && object.spotMarketInstantListingFee !== null ? Coin.fromPartial(object.spotMarketInstantListingFee) : undefined; + message.derivativeMarketInstantListingFee = object.derivativeMarketInstantListingFee !== undefined && object.derivativeMarketInstantListingFee !== null ? Coin.fromPartial(object.derivativeMarketInstantListingFee) : undefined; + message.defaultSpotMakerFeeRate = object.defaultSpotMakerFeeRate ?? ""; + message.defaultSpotTakerFeeRate = object.defaultSpotTakerFeeRate ?? ""; + message.defaultDerivativeMakerFeeRate = object.defaultDerivativeMakerFeeRate ?? ""; + message.defaultDerivativeTakerFeeRate = object.defaultDerivativeTakerFeeRate ?? ""; + message.defaultInitialMarginRatio = object.defaultInitialMarginRatio ?? ""; + message.defaultMaintenanceMarginRatio = object.defaultMaintenanceMarginRatio ?? ""; + message.defaultFundingInterval = object.defaultFundingInterval !== undefined && object.defaultFundingInterval !== null ? BigInt(object.defaultFundingInterval.toString()) : BigInt(0); + message.fundingMultiple = object.fundingMultiple !== undefined && object.fundingMultiple !== null ? BigInt(object.fundingMultiple.toString()) : BigInt(0); + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.defaultHourlyFundingRateCap = object.defaultHourlyFundingRateCap ?? ""; + message.defaultHourlyInterestRate = object.defaultHourlyInterestRate ?? ""; + message.maxDerivativeOrderSideCount = object.maxDerivativeOrderSideCount ?? 0; + message.injRewardStakedRequirementThreshold = object.injRewardStakedRequirementThreshold ?? ""; + message.tradingRewardsVestingDuration = object.tradingRewardsVestingDuration !== undefined && object.tradingRewardsVestingDuration !== null ? BigInt(object.tradingRewardsVestingDuration.toString()) : BigInt(0); + message.liquidatorRewardShareRate = object.liquidatorRewardShareRate ?? ""; + message.binaryOptionsMarketInstantListingFee = object.binaryOptionsMarketInstantListingFee !== undefined && object.binaryOptionsMarketInstantListingFee !== null ? Coin.fromPartial(object.binaryOptionsMarketInstantListingFee) : undefined; + message.atomicMarketOrderAccessLevel = object.atomicMarketOrderAccessLevel ?? 0; + message.spotAtomicMarketOrderFeeMultiplier = object.spotAtomicMarketOrderFeeMultiplier ?? ""; + message.derivativeAtomicMarketOrderFeeMultiplier = object.derivativeAtomicMarketOrderFeeMultiplier ?? ""; + message.binaryOptionsAtomicMarketOrderFeeMultiplier = object.binaryOptionsAtomicMarketOrderFeeMultiplier ?? ""; + message.minimalProtocolFeeRate = object.minimalProtocolFeeRate ?? ""; + message.isInstantDerivativeMarketLaunchEnabled = object.isInstantDerivativeMarketLaunchEnabled ?? false; + message.postOnlyModeHeightThreshold = object.postOnlyModeHeightThreshold !== undefined && object.postOnlyModeHeightThreshold !== null ? BigInt(object.postOnlyModeHeightThreshold.toString()) : BigInt(0); + message.marginDecreasePriceTimestampThresholdSeconds = object.marginDecreasePriceTimestampThresholdSeconds !== undefined && object.marginDecreasePriceTimestampThresholdSeconds !== null ? BigInt(object.marginDecreasePriceTimestampThresholdSeconds.toString()) : BigInt(0); + message.exchangeAdmins = object.exchangeAdmins?.map(e => e) || []; + message.injAuctionMaxCap = object.injAuctionMaxCap ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.spot_market_instant_listing_fee !== undefined && object.spot_market_instant_listing_fee !== null) { + message.spotMarketInstantListingFee = Coin.fromAmino(object.spot_market_instant_listing_fee); + } + if (object.derivative_market_instant_listing_fee !== undefined && object.derivative_market_instant_listing_fee !== null) { + message.derivativeMarketInstantListingFee = Coin.fromAmino(object.derivative_market_instant_listing_fee); + } + if (object.default_spot_maker_fee_rate !== undefined && object.default_spot_maker_fee_rate !== null) { + message.defaultSpotMakerFeeRate = object.default_spot_maker_fee_rate; + } + if (object.default_spot_taker_fee_rate !== undefined && object.default_spot_taker_fee_rate !== null) { + message.defaultSpotTakerFeeRate = object.default_spot_taker_fee_rate; + } + if (object.default_derivative_maker_fee_rate !== undefined && object.default_derivative_maker_fee_rate !== null) { + message.defaultDerivativeMakerFeeRate = object.default_derivative_maker_fee_rate; + } + if (object.default_derivative_taker_fee_rate !== undefined && object.default_derivative_taker_fee_rate !== null) { + message.defaultDerivativeTakerFeeRate = object.default_derivative_taker_fee_rate; + } + if (object.default_initial_margin_ratio !== undefined && object.default_initial_margin_ratio !== null) { + message.defaultInitialMarginRatio = object.default_initial_margin_ratio; + } + if (object.default_maintenance_margin_ratio !== undefined && object.default_maintenance_margin_ratio !== null) { + message.defaultMaintenanceMarginRatio = object.default_maintenance_margin_ratio; + } + if (object.default_funding_interval !== undefined && object.default_funding_interval !== null) { + message.defaultFundingInterval = BigInt(object.default_funding_interval); + } + if (object.funding_multiple !== undefined && object.funding_multiple !== null) { + message.fundingMultiple = BigInt(object.funding_multiple); + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.default_hourly_funding_rate_cap !== undefined && object.default_hourly_funding_rate_cap !== null) { + message.defaultHourlyFundingRateCap = object.default_hourly_funding_rate_cap; + } + if (object.default_hourly_interest_rate !== undefined && object.default_hourly_interest_rate !== null) { + message.defaultHourlyInterestRate = object.default_hourly_interest_rate; + } + if (object.max_derivative_order_side_count !== undefined && object.max_derivative_order_side_count !== null) { + message.maxDerivativeOrderSideCount = object.max_derivative_order_side_count; + } + if (object.inj_reward_staked_requirement_threshold !== undefined && object.inj_reward_staked_requirement_threshold !== null) { + message.injRewardStakedRequirementThreshold = object.inj_reward_staked_requirement_threshold; + } + if (object.trading_rewards_vesting_duration !== undefined && object.trading_rewards_vesting_duration !== null) { + message.tradingRewardsVestingDuration = BigInt(object.trading_rewards_vesting_duration); + } + if (object.liquidator_reward_share_rate !== undefined && object.liquidator_reward_share_rate !== null) { + message.liquidatorRewardShareRate = object.liquidator_reward_share_rate; + } + if (object.binary_options_market_instant_listing_fee !== undefined && object.binary_options_market_instant_listing_fee !== null) { + message.binaryOptionsMarketInstantListingFee = Coin.fromAmino(object.binary_options_market_instant_listing_fee); + } + if (object.atomic_market_order_access_level !== undefined && object.atomic_market_order_access_level !== null) { + message.atomicMarketOrderAccessLevel = object.atomic_market_order_access_level; + } + if (object.spot_atomic_market_order_fee_multiplier !== undefined && object.spot_atomic_market_order_fee_multiplier !== null) { + message.spotAtomicMarketOrderFeeMultiplier = object.spot_atomic_market_order_fee_multiplier; + } + if (object.derivative_atomic_market_order_fee_multiplier !== undefined && object.derivative_atomic_market_order_fee_multiplier !== null) { + message.derivativeAtomicMarketOrderFeeMultiplier = object.derivative_atomic_market_order_fee_multiplier; + } + if (object.binary_options_atomic_market_order_fee_multiplier !== undefined && object.binary_options_atomic_market_order_fee_multiplier !== null) { + message.binaryOptionsAtomicMarketOrderFeeMultiplier = object.binary_options_atomic_market_order_fee_multiplier; + } + if (object.minimal_protocol_fee_rate !== undefined && object.minimal_protocol_fee_rate !== null) { + message.minimalProtocolFeeRate = object.minimal_protocol_fee_rate; + } + if (object.is_instant_derivative_market_launch_enabled !== undefined && object.is_instant_derivative_market_launch_enabled !== null) { + message.isInstantDerivativeMarketLaunchEnabled = object.is_instant_derivative_market_launch_enabled; + } + if (object.post_only_mode_height_threshold !== undefined && object.post_only_mode_height_threshold !== null) { + message.postOnlyModeHeightThreshold = BigInt(object.post_only_mode_height_threshold); + } + if (object.margin_decrease_price_timestamp_threshold_seconds !== undefined && object.margin_decrease_price_timestamp_threshold_seconds !== null) { + message.marginDecreasePriceTimestampThresholdSeconds = BigInt(object.margin_decrease_price_timestamp_threshold_seconds); + } + message.exchangeAdmins = object.exchange_admins?.map(e => e) || []; + if (object.inj_auction_max_cap !== undefined && object.inj_auction_max_cap !== null) { + message.injAuctionMaxCap = object.inj_auction_max_cap; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.spot_market_instant_listing_fee = message.spotMarketInstantListingFee ? Coin.toAmino(message.spotMarketInstantListingFee) : undefined; + obj.derivative_market_instant_listing_fee = message.derivativeMarketInstantListingFee ? Coin.toAmino(message.derivativeMarketInstantListingFee) : undefined; + obj.default_spot_maker_fee_rate = message.defaultSpotMakerFeeRate === "" ? undefined : message.defaultSpotMakerFeeRate; + obj.default_spot_taker_fee_rate = message.defaultSpotTakerFeeRate === "" ? undefined : message.defaultSpotTakerFeeRate; + obj.default_derivative_maker_fee_rate = message.defaultDerivativeMakerFeeRate === "" ? undefined : message.defaultDerivativeMakerFeeRate; + obj.default_derivative_taker_fee_rate = message.defaultDerivativeTakerFeeRate === "" ? undefined : message.defaultDerivativeTakerFeeRate; + obj.default_initial_margin_ratio = message.defaultInitialMarginRatio === "" ? undefined : message.defaultInitialMarginRatio; + obj.default_maintenance_margin_ratio = message.defaultMaintenanceMarginRatio === "" ? undefined : message.defaultMaintenanceMarginRatio; + obj.default_funding_interval = message.defaultFundingInterval !== BigInt(0) ? message.defaultFundingInterval?.toString() : undefined; + obj.funding_multiple = message.fundingMultiple !== BigInt(0) ? message.fundingMultiple?.toString() : undefined; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.default_hourly_funding_rate_cap = message.defaultHourlyFundingRateCap === "" ? undefined : message.defaultHourlyFundingRateCap; + obj.default_hourly_interest_rate = message.defaultHourlyInterestRate === "" ? undefined : message.defaultHourlyInterestRate; + obj.max_derivative_order_side_count = message.maxDerivativeOrderSideCount === 0 ? undefined : message.maxDerivativeOrderSideCount; + obj.inj_reward_staked_requirement_threshold = message.injRewardStakedRequirementThreshold === "" ? undefined : message.injRewardStakedRequirementThreshold; + obj.trading_rewards_vesting_duration = message.tradingRewardsVestingDuration !== BigInt(0) ? message.tradingRewardsVestingDuration?.toString() : undefined; + obj.liquidator_reward_share_rate = message.liquidatorRewardShareRate === "" ? undefined : message.liquidatorRewardShareRate; + obj.binary_options_market_instant_listing_fee = message.binaryOptionsMarketInstantListingFee ? Coin.toAmino(message.binaryOptionsMarketInstantListingFee) : undefined; + obj.atomic_market_order_access_level = message.atomicMarketOrderAccessLevel === 0 ? undefined : message.atomicMarketOrderAccessLevel; + obj.spot_atomic_market_order_fee_multiplier = message.spotAtomicMarketOrderFeeMultiplier === "" ? undefined : message.spotAtomicMarketOrderFeeMultiplier; + obj.derivative_atomic_market_order_fee_multiplier = message.derivativeAtomicMarketOrderFeeMultiplier === "" ? undefined : message.derivativeAtomicMarketOrderFeeMultiplier; + obj.binary_options_atomic_market_order_fee_multiplier = message.binaryOptionsAtomicMarketOrderFeeMultiplier === "" ? undefined : message.binaryOptionsAtomicMarketOrderFeeMultiplier; + obj.minimal_protocol_fee_rate = message.minimalProtocolFeeRate === "" ? undefined : message.minimalProtocolFeeRate; + obj.is_instant_derivative_market_launch_enabled = message.isInstantDerivativeMarketLaunchEnabled === false ? undefined : message.isInstantDerivativeMarketLaunchEnabled; + obj.post_only_mode_height_threshold = message.postOnlyModeHeightThreshold !== BigInt(0) ? message.postOnlyModeHeightThreshold?.toString() : undefined; + obj.margin_decrease_price_timestamp_threshold_seconds = message.marginDecreasePriceTimestampThresholdSeconds !== BigInt(0) ? message.marginDecreasePriceTimestampThresholdSeconds?.toString() : undefined; + if (message.exchangeAdmins) { + obj.exchange_admins = message.exchangeAdmins.map(e => e); + } else { + obj.exchange_admins = message.exchangeAdmins; + } + obj.inj_auction_max_cap = message.injAuctionMaxCap === "" ? undefined : message.injAuctionMaxCap; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "exchange/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: "/injective.exchange.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseMarketFeeMultiplier(): MarketFeeMultiplier { + return { + marketId: "", + feeMultiplier: "" + }; +} +export const MarketFeeMultiplier = { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier", + is(o: any): o is MarketFeeMultiplier { + return o && (o.$typeUrl === MarketFeeMultiplier.typeUrl || typeof o.marketId === "string" && typeof o.feeMultiplier === "string"); + }, + isAmino(o: any): o is MarketFeeMultiplierAmino { + return o && (o.$typeUrl === MarketFeeMultiplier.typeUrl || typeof o.market_id === "string" && typeof o.fee_multiplier === "string"); + }, + encode(message: MarketFeeMultiplier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.feeMultiplier !== "") { + writer.uint32(18).string(message.feeMultiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketFeeMultiplier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketFeeMultiplier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.feeMultiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketFeeMultiplier { + const message = createBaseMarketFeeMultiplier(); + message.marketId = object.marketId ?? ""; + message.feeMultiplier = object.feeMultiplier ?? ""; + return message; + }, + fromAmino(object: MarketFeeMultiplierAmino): MarketFeeMultiplier { + const message = createBaseMarketFeeMultiplier(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.fee_multiplier !== undefined && object.fee_multiplier !== null) { + message.feeMultiplier = object.fee_multiplier; + } + return message; + }, + toAmino(message: MarketFeeMultiplier): MarketFeeMultiplierAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.fee_multiplier = message.feeMultiplier === "" ? undefined : message.feeMultiplier; + return obj; + }, + fromAminoMsg(object: MarketFeeMultiplierAminoMsg): MarketFeeMultiplier { + return MarketFeeMultiplier.fromAmino(object.value); + }, + fromProtoMsg(message: MarketFeeMultiplierProtoMsg): MarketFeeMultiplier { + return MarketFeeMultiplier.decode(message.value); + }, + toProto(message: MarketFeeMultiplier): Uint8Array { + return MarketFeeMultiplier.encode(message).finish(); + }, + toProtoMsg(message: MarketFeeMultiplier): MarketFeeMultiplierProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketFeeMultiplier", + value: MarketFeeMultiplier.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketFeeMultiplier.typeUrl, MarketFeeMultiplier); +function createBaseDerivativeMarket(): DerivativeMarket { + return { + ticker: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + oracleScaleFactor: 0, + quoteDenom: "", + marketId: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + isPerpetual: false, + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + admin: "", + adminPermissions: 0 + }; +} +export const DerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket", + is(o: any): o is DerivativeMarket { + return o && (o.$typeUrl === DerivativeMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.quoteDenom === "string" && typeof o.marketId === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && typeof o.isPerpetual === "boolean" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is DerivativeMarketAmino { + return o && (o.$typeUrl === DerivativeMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.quote_denom === "string" && typeof o.market_id === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && typeof o.isPerpetual === "boolean" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: DerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.oracleBase !== "") { + writer.uint32(18).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(26).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(40).uint32(message.oracleScaleFactor); + } + if (message.quoteDenom !== "") { + writer.uint32(50).string(message.quoteDenom); + } + if (message.marketId !== "") { + writer.uint32(58).string(message.marketId); + } + if (message.initialMarginRatio !== "") { + writer.uint32(66).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(74).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(82).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(90).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(98).string(message.relayerFeeShareRate); + } + if (message.isPerpetual === true) { + writer.uint32(104).bool(message.isPerpetual); + } + if (message.status !== 0) { + writer.uint32(112).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(122).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(130).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(138).string(message.minNotional); + } + if (message.admin !== "") { + writer.uint32(146).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(152).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.oracleBase = reader.string(); + break; + case 3: + message.oracleQuote = reader.string(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + case 5: + message.oracleScaleFactor = reader.uint32(); + break; + case 6: + message.quoteDenom = reader.string(); + break; + case 7: + message.marketId = reader.string(); + break; + case 8: + message.initialMarginRatio = reader.string(); + break; + case 9: + message.maintenanceMarginRatio = reader.string(); + break; + case 10: + message.makerFeeRate = reader.string(); + break; + case 11: + message.takerFeeRate = reader.string(); + break; + case 12: + message.relayerFeeShareRate = reader.string(); + break; + case 13: + message.isPerpetual = reader.bool(); + break; + case 14: + message.status = (reader.int32() as any); + break; + case 15: + message.minPriceTickSize = reader.string(); + break; + case 16: + message.minQuantityTickSize = reader.string(); + break; + case 17: + message.minNotional = reader.string(); + break; + case 18: + message.admin = reader.string(); + break; + case 19: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarket { + const message = createBaseDerivativeMarket(); + message.ticker = object.ticker ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.quoteDenom = object.quoteDenom ?? ""; + message.marketId = object.marketId ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.isPerpetual = object.isPerpetual ?? false; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: DerivativeMarketAmino): DerivativeMarket { + const message = createBaseDerivativeMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.isPerpetual !== undefined && object.isPerpetual !== null) { + message.isPerpetual = object.isPerpetual; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: DerivativeMarket): DerivativeMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.isPerpetual = message.isPerpetual === false ? undefined : message.isPerpetual; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: DerivativeMarketAminoMsg): DerivativeMarket { + return DerivativeMarket.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketProtoMsg): DerivativeMarket { + return DerivativeMarket.decode(message.value); + }, + toProto(message: DerivativeMarket): Uint8Array { + return DerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarket): DerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarket", + value: DerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarket.typeUrl, DerivativeMarket); +function createBaseBinaryOptionsMarket(): BinaryOptionsMarket { + return { + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + marketId: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + settlementPrice: undefined, + minNotional: "", + adminPermissions: 0 + }; +} +export const BinaryOptionsMarket = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket", + is(o: any): o is BinaryOptionsMarket { + return o && (o.$typeUrl === BinaryOptionsMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.marketId === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is BinaryOptionsMarketAmino { + return o && (o.$typeUrl === BinaryOptionsMarket.typeUrl || typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.market_id === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: BinaryOptionsMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(18).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(26).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(40).uint32(message.oracleScaleFactor); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(56).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(66).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(74).string(message.quoteDenom); + } + if (message.marketId !== "") { + writer.uint32(82).string(message.marketId); + } + if (message.makerFeeRate !== "") { + writer.uint32(90).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(98).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(106).string(message.relayerFeeShareRate); + } + if (message.status !== 0) { + writer.uint32(112).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(122).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(130).string(message.minQuantityTickSize); + } + if (message.settlementPrice !== undefined) { + writer.uint32(138).string(message.settlementPrice); + } + if (message.minNotional !== "") { + writer.uint32(146).string(message.minNotional); + } + if (message.adminPermissions !== 0) { + writer.uint32(152).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.oracleSymbol = reader.string(); + break; + case 3: + message.oracleProvider = reader.string(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + case 5: + message.oracleScaleFactor = reader.uint32(); + break; + case 6: + message.expirationTimestamp = reader.int64(); + break; + case 7: + message.settlementTimestamp = reader.int64(); + break; + case 8: + message.admin = reader.string(); + break; + case 9: + message.quoteDenom = reader.string(); + break; + case 10: + message.marketId = reader.string(); + break; + case 11: + message.makerFeeRate = reader.string(); + break; + case 12: + message.takerFeeRate = reader.string(); + break; + case 13: + message.relayerFeeShareRate = reader.string(); + break; + case 14: + message.status = (reader.int32() as any); + break; + case 15: + message.minPriceTickSize = reader.string(); + break; + case 16: + message.minQuantityTickSize = reader.string(); + break; + case 17: + message.settlementPrice = reader.string(); + break; + case 18: + message.minNotional = reader.string(); + break; + case 19: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarket { + const message = createBaseBinaryOptionsMarket(); + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + message.minNotional = object.minNotional ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: BinaryOptionsMarketAmino): BinaryOptionsMarket { + const message = createBaseBinaryOptionsMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: BinaryOptionsMarket): BinaryOptionsMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketAminoMsg): BinaryOptionsMarket { + return BinaryOptionsMarket.fromAmino(object.value); + }, + fromProtoMsg(message: BinaryOptionsMarketProtoMsg): BinaryOptionsMarket { + return BinaryOptionsMarket.decode(message.value); + }, + toProto(message: BinaryOptionsMarket): Uint8Array { + return BinaryOptionsMarket.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarket): BinaryOptionsMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarket", + value: BinaryOptionsMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarket.typeUrl, BinaryOptionsMarket); +function createBaseExpiryFuturesMarketInfo(): ExpiryFuturesMarketInfo { + return { + marketId: "", + expirationTimestamp: BigInt(0), + twapStartTimestamp: BigInt(0), + expirationTwapStartPriceCumulative: "", + settlementPrice: "" + }; +} +export const ExpiryFuturesMarketInfo = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo", + is(o: any): o is ExpiryFuturesMarketInfo { + return o && (o.$typeUrl === ExpiryFuturesMarketInfo.typeUrl || typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.twapStartTimestamp === "bigint" && typeof o.expirationTwapStartPriceCumulative === "string" && typeof o.settlementPrice === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketInfoAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketInfo.typeUrl || typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.twap_start_timestamp === "bigint" && typeof o.expiration_twap_start_price_cumulative === "string" && typeof o.settlement_price === "string"); + }, + encode(message: ExpiryFuturesMarketInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.expirationTimestamp); + } + if (message.twapStartTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.twapStartTimestamp); + } + if (message.expirationTwapStartPriceCumulative !== "") { + writer.uint32(34).string(message.expirationTwapStartPriceCumulative); + } + if (message.settlementPrice !== "") { + writer.uint32(42).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.expirationTimestamp = reader.int64(); + break; + case 3: + message.twapStartTimestamp = reader.int64(); + break; + case 4: + message.expirationTwapStartPriceCumulative = reader.string(); + break; + case 5: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketInfo { + const message = createBaseExpiryFuturesMarketInfo(); + message.marketId = object.marketId ?? ""; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.twapStartTimestamp = object.twapStartTimestamp !== undefined && object.twapStartTimestamp !== null ? BigInt(object.twapStartTimestamp.toString()) : BigInt(0); + message.expirationTwapStartPriceCumulative = object.expirationTwapStartPriceCumulative ?? ""; + message.settlementPrice = object.settlementPrice ?? ""; + return message; + }, + fromAmino(object: ExpiryFuturesMarketInfoAmino): ExpiryFuturesMarketInfo { + const message = createBaseExpiryFuturesMarketInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.twap_start_timestamp !== undefined && object.twap_start_timestamp !== null) { + message.twapStartTimestamp = BigInt(object.twap_start_timestamp); + } + if (object.expiration_twap_start_price_cumulative !== undefined && object.expiration_twap_start_price_cumulative !== null) { + message.expirationTwapStartPriceCumulative = object.expiration_twap_start_price_cumulative; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: ExpiryFuturesMarketInfo): ExpiryFuturesMarketInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.twap_start_timestamp = message.twapStartTimestamp !== BigInt(0) ? message.twapStartTimestamp?.toString() : undefined; + obj.expiration_twap_start_price_cumulative = message.expirationTwapStartPriceCumulative === "" ? undefined : message.expirationTwapStartPriceCumulative; + obj.settlement_price = message.settlementPrice === "" ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketInfoAminoMsg): ExpiryFuturesMarketInfo { + return ExpiryFuturesMarketInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExpiryFuturesMarketInfoProtoMsg): ExpiryFuturesMarketInfo { + return ExpiryFuturesMarketInfo.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketInfo): Uint8Array { + return ExpiryFuturesMarketInfo.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketInfo): ExpiryFuturesMarketInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfo", + value: ExpiryFuturesMarketInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketInfo.typeUrl, ExpiryFuturesMarketInfo); +function createBasePerpetualMarketInfo(): PerpetualMarketInfo { + return { + marketId: "", + hourlyFundingRateCap: "", + hourlyInterestRate: "", + nextFundingTimestamp: BigInt(0), + fundingInterval: BigInt(0) + }; +} +export const PerpetualMarketInfo = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo", + is(o: any): o is PerpetualMarketInfo { + return o && (o.$typeUrl === PerpetualMarketInfo.typeUrl || typeof o.marketId === "string" && typeof o.hourlyFundingRateCap === "string" && typeof o.hourlyInterestRate === "string" && typeof o.nextFundingTimestamp === "bigint" && typeof o.fundingInterval === "bigint"); + }, + isAmino(o: any): o is PerpetualMarketInfoAmino { + return o && (o.$typeUrl === PerpetualMarketInfo.typeUrl || typeof o.market_id === "string" && typeof o.hourly_funding_rate_cap === "string" && typeof o.hourly_interest_rate === "string" && typeof o.next_funding_timestamp === "bigint" && typeof o.funding_interval === "bigint"); + }, + encode(message: PerpetualMarketInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.hourlyFundingRateCap !== "") { + writer.uint32(18).string(message.hourlyFundingRateCap); + } + if (message.hourlyInterestRate !== "") { + writer.uint32(26).string(message.hourlyInterestRate); + } + if (message.nextFundingTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.nextFundingTimestamp); + } + if (message.fundingInterval !== BigInt(0)) { + writer.uint32(40).int64(message.fundingInterval); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.hourlyFundingRateCap = reader.string(); + break; + case 3: + message.hourlyInterestRate = reader.string(); + break; + case 4: + message.nextFundingTimestamp = reader.int64(); + break; + case 5: + message.fundingInterval = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketInfo { + const message = createBasePerpetualMarketInfo(); + message.marketId = object.marketId ?? ""; + message.hourlyFundingRateCap = object.hourlyFundingRateCap ?? ""; + message.hourlyInterestRate = object.hourlyInterestRate ?? ""; + message.nextFundingTimestamp = object.nextFundingTimestamp !== undefined && object.nextFundingTimestamp !== null ? BigInt(object.nextFundingTimestamp.toString()) : BigInt(0); + message.fundingInterval = object.fundingInterval !== undefined && object.fundingInterval !== null ? BigInt(object.fundingInterval.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PerpetualMarketInfoAmino): PerpetualMarketInfo { + const message = createBasePerpetualMarketInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.hourly_funding_rate_cap !== undefined && object.hourly_funding_rate_cap !== null) { + message.hourlyFundingRateCap = object.hourly_funding_rate_cap; + } + if (object.hourly_interest_rate !== undefined && object.hourly_interest_rate !== null) { + message.hourlyInterestRate = object.hourly_interest_rate; + } + if (object.next_funding_timestamp !== undefined && object.next_funding_timestamp !== null) { + message.nextFundingTimestamp = BigInt(object.next_funding_timestamp); + } + if (object.funding_interval !== undefined && object.funding_interval !== null) { + message.fundingInterval = BigInt(object.funding_interval); + } + return message; + }, + toAmino(message: PerpetualMarketInfo): PerpetualMarketInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.hourly_funding_rate_cap = message.hourlyFundingRateCap === "" ? undefined : message.hourlyFundingRateCap; + obj.hourly_interest_rate = message.hourlyInterestRate === "" ? undefined : message.hourlyInterestRate; + obj.next_funding_timestamp = message.nextFundingTimestamp !== BigInt(0) ? message.nextFundingTimestamp?.toString() : undefined; + obj.funding_interval = message.fundingInterval !== BigInt(0) ? message.fundingInterval?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketInfoAminoMsg): PerpetualMarketInfo { + return PerpetualMarketInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketInfoProtoMsg): PerpetualMarketInfo { + return PerpetualMarketInfo.decode(message.value); + }, + toProto(message: PerpetualMarketInfo): Uint8Array { + return PerpetualMarketInfo.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketInfo): PerpetualMarketInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketInfo", + value: PerpetualMarketInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketInfo.typeUrl, PerpetualMarketInfo); +function createBasePerpetualMarketFunding(): PerpetualMarketFunding { + return { + cumulativeFunding: "", + cumulativePrice: "", + lastTimestamp: BigInt(0) + }; +} +export const PerpetualMarketFunding = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding", + is(o: any): o is PerpetualMarketFunding { + return o && (o.$typeUrl === PerpetualMarketFunding.typeUrl || typeof o.cumulativeFunding === "string" && typeof o.cumulativePrice === "string" && typeof o.lastTimestamp === "bigint"); + }, + isAmino(o: any): o is PerpetualMarketFundingAmino { + return o && (o.$typeUrl === PerpetualMarketFunding.typeUrl || typeof o.cumulative_funding === "string" && typeof o.cumulative_price === "string" && typeof o.last_timestamp === "bigint"); + }, + encode(message: PerpetualMarketFunding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cumulativeFunding !== "") { + writer.uint32(10).string(message.cumulativeFunding); + } + if (message.cumulativePrice !== "") { + writer.uint32(18).string(message.cumulativePrice); + } + if (message.lastTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.lastTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketFunding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketFunding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeFunding = reader.string(); + break; + case 2: + message.cumulativePrice = reader.string(); + break; + case 3: + message.lastTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketFunding { + const message = createBasePerpetualMarketFunding(); + message.cumulativeFunding = object.cumulativeFunding ?? ""; + message.cumulativePrice = object.cumulativePrice ?? ""; + message.lastTimestamp = object.lastTimestamp !== undefined && object.lastTimestamp !== null ? BigInt(object.lastTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PerpetualMarketFundingAmino): PerpetualMarketFunding { + const message = createBasePerpetualMarketFunding(); + if (object.cumulative_funding !== undefined && object.cumulative_funding !== null) { + message.cumulativeFunding = object.cumulative_funding; + } + if (object.cumulative_price !== undefined && object.cumulative_price !== null) { + message.cumulativePrice = object.cumulative_price; + } + if (object.last_timestamp !== undefined && object.last_timestamp !== null) { + message.lastTimestamp = BigInt(object.last_timestamp); + } + return message; + }, + toAmino(message: PerpetualMarketFunding): PerpetualMarketFundingAmino { + const obj: any = {}; + obj.cumulative_funding = message.cumulativeFunding === "" ? undefined : message.cumulativeFunding; + obj.cumulative_price = message.cumulativePrice === "" ? undefined : message.cumulativePrice; + obj.last_timestamp = message.lastTimestamp !== BigInt(0) ? message.lastTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketFundingAminoMsg): PerpetualMarketFunding { + return PerpetualMarketFunding.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketFundingProtoMsg): PerpetualMarketFunding { + return PerpetualMarketFunding.decode(message.value); + }, + toProto(message: PerpetualMarketFunding): Uint8Array { + return PerpetualMarketFunding.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketFunding): PerpetualMarketFundingProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFunding", + value: PerpetualMarketFunding.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketFunding.typeUrl, PerpetualMarketFunding); +function createBaseDerivativeMarketSettlementInfo(): DerivativeMarketSettlementInfo { + return { + marketId: "", + settlementPrice: "" + }; +} +export const DerivativeMarketSettlementInfo = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo", + is(o: any): o is DerivativeMarketSettlementInfo { + return o && (o.$typeUrl === DerivativeMarketSettlementInfo.typeUrl || typeof o.marketId === "string" && typeof o.settlementPrice === "string"); + }, + isAmino(o: any): o is DerivativeMarketSettlementInfoAmino { + return o && (o.$typeUrl === DerivativeMarketSettlementInfo.typeUrl || typeof o.market_id === "string" && typeof o.settlement_price === "string"); + }, + encode(message: DerivativeMarketSettlementInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.settlementPrice !== "") { + writer.uint32(18).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketSettlementInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketSettlementInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketSettlementInfo { + const message = createBaseDerivativeMarketSettlementInfo(); + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketSettlementInfoAmino): DerivativeMarketSettlementInfo { + const message = createBaseDerivativeMarketSettlementInfo(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: DerivativeMarketSettlementInfo): DerivativeMarketSettlementInfoAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === "" ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: DerivativeMarketSettlementInfoAminoMsg): DerivativeMarketSettlementInfo { + return DerivativeMarketSettlementInfo.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketSettlementInfoProtoMsg): DerivativeMarketSettlementInfo { + return DerivativeMarketSettlementInfo.decode(message.value); + }, + toProto(message: DerivativeMarketSettlementInfo): Uint8Array { + return DerivativeMarketSettlementInfo.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketSettlementInfo): DerivativeMarketSettlementInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketSettlementInfo", + value: DerivativeMarketSettlementInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketSettlementInfo.typeUrl, DerivativeMarketSettlementInfo); +function createBaseNextFundingTimestamp(): NextFundingTimestamp { + return { + nextTimestamp: BigInt(0) + }; +} +export const NextFundingTimestamp = { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp", + is(o: any): o is NextFundingTimestamp { + return o && (o.$typeUrl === NextFundingTimestamp.typeUrl || typeof o.nextTimestamp === "bigint"); + }, + isAmino(o: any): o is NextFundingTimestampAmino { + return o && (o.$typeUrl === NextFundingTimestamp.typeUrl || typeof o.next_timestamp === "bigint"); + }, + encode(message: NextFundingTimestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.nextTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NextFundingTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextFundingTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): NextFundingTimestamp { + const message = createBaseNextFundingTimestamp(); + message.nextTimestamp = object.nextTimestamp !== undefined && object.nextTimestamp !== null ? BigInt(object.nextTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NextFundingTimestampAmino): NextFundingTimestamp { + const message = createBaseNextFundingTimestamp(); + if (object.next_timestamp !== undefined && object.next_timestamp !== null) { + message.nextTimestamp = BigInt(object.next_timestamp); + } + return message; + }, + toAmino(message: NextFundingTimestamp): NextFundingTimestampAmino { + const obj: any = {}; + obj.next_timestamp = message.nextTimestamp !== BigInt(0) ? message.nextTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NextFundingTimestampAminoMsg): NextFundingTimestamp { + return NextFundingTimestamp.fromAmino(object.value); + }, + fromProtoMsg(message: NextFundingTimestampProtoMsg): NextFundingTimestamp { + return NextFundingTimestamp.decode(message.value); + }, + toProto(message: NextFundingTimestamp): Uint8Array { + return NextFundingTimestamp.encode(message).finish(); + }, + toProtoMsg(message: NextFundingTimestamp): NextFundingTimestampProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.NextFundingTimestamp", + value: NextFundingTimestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(NextFundingTimestamp.typeUrl, NextFundingTimestamp); +function createBaseMidPriceAndTOB(): MidPriceAndTOB { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const MidPriceAndTOB = { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB", + is(o: any): o is MidPriceAndTOB { + return o && o.$typeUrl === MidPriceAndTOB.typeUrl; + }, + isAmino(o: any): o is MidPriceAndTOBAmino { + return o && o.$typeUrl === MidPriceAndTOB.typeUrl; + }, + encode(message: MidPriceAndTOB, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MidPriceAndTOB { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMidPriceAndTOB(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MidPriceAndTOB { + const message = createBaseMidPriceAndTOB(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: MidPriceAndTOBAmino): MidPriceAndTOB { + const message = createBaseMidPriceAndTOB(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: MidPriceAndTOB): MidPriceAndTOBAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: MidPriceAndTOBAminoMsg): MidPriceAndTOB { + return MidPriceAndTOB.fromAmino(object.value); + }, + fromProtoMsg(message: MidPriceAndTOBProtoMsg): MidPriceAndTOB { + return MidPriceAndTOB.decode(message.value); + }, + toProto(message: MidPriceAndTOB): Uint8Array { + return MidPriceAndTOB.encode(message).finish(); + }, + toProtoMsg(message: MidPriceAndTOB): MidPriceAndTOBProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MidPriceAndTOB", + value: MidPriceAndTOB.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MidPriceAndTOB.typeUrl, MidPriceAndTOB); +function createBaseSpotMarket(): SpotMarket { + return { + ticker: "", + baseDenom: "", + quoteDenom: "", + makerFeeRate: "", + takerFeeRate: "", + relayerFeeShareRate: "", + marketId: "", + status: 0, + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + admin: "", + adminPermissions: 0 + }; +} +export const SpotMarket = { + typeUrl: "/injective.exchange.v1beta1.SpotMarket", + is(o: any): o is SpotMarket { + return o && (o.$typeUrl === SpotMarket.typeUrl || typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.relayerFeeShareRate === "string" && typeof o.marketId === "string" && isSet(o.status) && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is SpotMarketAmino { + return o && (o.$typeUrl === SpotMarket.typeUrl || typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.relayer_fee_share_rate === "string" && typeof o.market_id === "string" && isSet(o.status) && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: SpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(18).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.makerFeeRate !== "") { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== "") { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.marketId !== "") { + writer.uint32(58).string(message.marketId); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.minPriceTickSize !== "") { + writer.uint32(74).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(82).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(90).string(message.minNotional); + } + if (message.admin !== "") { + writer.uint32(98).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(104).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.marketId = reader.string(); + break; + case 8: + message.status = (reader.int32() as any); + break; + case 9: + message.minPriceTickSize = reader.string(); + break; + case 10: + message.minQuantityTickSize = reader.string(); + break; + case 11: + message.minNotional = reader.string(); + break; + case 12: + message.admin = reader.string(); + break; + case 13: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarket { + const message = createBaseSpotMarket(); + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? ""; + message.marketId = object.marketId ?? ""; + message.status = object.status ?? 0; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: SpotMarketAmino): SpotMarket { + const message = createBaseSpotMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: SpotMarket): SpotMarketAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === "" ? undefined : message.relayerFeeShareRate; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.status = message.status === 0 ? undefined : message.status; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: SpotMarketAminoMsg): SpotMarket { + return SpotMarket.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketProtoMsg): SpotMarket { + return SpotMarket.decode(message.value); + }, + toProto(message: SpotMarket): Uint8Array { + return SpotMarket.encode(message).finish(); + }, + toProtoMsg(message: SpotMarket): SpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarket", + value: SpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarket.typeUrl, SpotMarket); +function createBaseDeposit(): Deposit { + return { + availableBalance: "", + totalBalance: "" + }; +} +export const Deposit = { + typeUrl: "/injective.exchange.v1beta1.Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.availableBalance === "string" && typeof o.totalBalance === "string"); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.available_balance === "string" && typeof o.total_balance === "string"); + }, + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.availableBalance !== "") { + writer.uint32(10).string(message.availableBalance); + } + if (message.totalBalance !== "") { + writer.uint32(18).string(message.totalBalance); + } + 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.availableBalance = reader.string(); + break; + case 2: + message.totalBalance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Deposit { + const message = createBaseDeposit(); + message.availableBalance = object.availableBalance ?? ""; + message.totalBalance = object.totalBalance ?? ""; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.available_balance !== undefined && object.available_balance !== null) { + message.availableBalance = object.available_balance; + } + if (object.total_balance !== undefined && object.total_balance !== null) { + message.totalBalance = object.total_balance; + } + return message; + }, + toAmino(message: Deposit): DepositAmino { + const obj: any = {}; + obj.available_balance = message.availableBalance === "" ? undefined : message.availableBalance; + obj.total_balance = message.totalBalance === "" ? undefined : message.totalBalance; + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +function createBaseSubaccountTradeNonce(): SubaccountTradeNonce { + return { + nonce: 0 + }; +} +export const SubaccountTradeNonce = { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce", + is(o: any): o is SubaccountTradeNonce { + return o && (o.$typeUrl === SubaccountTradeNonce.typeUrl || typeof o.nonce === "number"); + }, + isAmino(o: any): o is SubaccountTradeNonceAmino { + return o && (o.$typeUrl === SubaccountTradeNonce.typeUrl || typeof o.nonce === "number"); + }, + encode(message: SubaccountTradeNonce, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== 0) { + writer.uint32(8).uint32(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountTradeNonce { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountTradeNonce(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountTradeNonce { + const message = createBaseSubaccountTradeNonce(); + message.nonce = object.nonce ?? 0; + return message; + }, + fromAmino(object: SubaccountTradeNonceAmino): SubaccountTradeNonce { + const message = createBaseSubaccountTradeNonce(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = object.nonce; + } + return message; + }, + toAmino(message: SubaccountTradeNonce): SubaccountTradeNonceAmino { + const obj: any = {}; + obj.nonce = message.nonce === 0 ? undefined : message.nonce; + return obj; + }, + fromAminoMsg(object: SubaccountTradeNonceAminoMsg): SubaccountTradeNonce { + return SubaccountTradeNonce.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountTradeNonceProtoMsg): SubaccountTradeNonce { + return SubaccountTradeNonce.decode(message.value); + }, + toProto(message: SubaccountTradeNonce): Uint8Array { + return SubaccountTradeNonce.encode(message).finish(); + }, + toProtoMsg(message: SubaccountTradeNonce): SubaccountTradeNonceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountTradeNonce", + value: SubaccountTradeNonce.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountTradeNonce.typeUrl, SubaccountTradeNonce); +function createBaseOrderInfo(): OrderInfo { + return { + subaccountId: "", + feeRecipient: "", + price: "", + quantity: "", + cid: "" + }; +} +export const OrderInfo = { + typeUrl: "/injective.exchange.v1beta1.OrderInfo", + is(o: any): o is OrderInfo { + return o && (o.$typeUrl === OrderInfo.typeUrl || typeof o.subaccountId === "string" && typeof o.feeRecipient === "string" && typeof o.price === "string" && typeof o.quantity === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is OrderInfoAmino { + return o && (o.$typeUrl === OrderInfo.typeUrl || typeof o.subaccount_id === "string" && typeof o.fee_recipient === "string" && typeof o.price === "string" && typeof o.quantity === "string" && typeof o.cid === "string"); + }, + encode(message: OrderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.feeRecipient !== "") { + writer.uint32(18).string(message.feeRecipient); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.feeRecipient = reader.string(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderInfo { + const message = createBaseOrderInfo(); + message.subaccountId = object.subaccountId ?? ""; + message.feeRecipient = object.feeRecipient ?? ""; + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: OrderInfoAmino): OrderInfo { + const message = createBaseOrderInfo(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.fee_recipient !== undefined && object.fee_recipient !== null) { + message.feeRecipient = object.fee_recipient; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: OrderInfo): OrderInfoAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.fee_recipient = message.feeRecipient === "" ? undefined : message.feeRecipient; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: OrderInfoAminoMsg): OrderInfo { + return OrderInfo.fromAmino(object.value); + }, + fromProtoMsg(message: OrderInfoProtoMsg): OrderInfo { + return OrderInfo.decode(message.value); + }, + toProto(message: OrderInfo): Uint8Array { + return OrderInfo.encode(message).finish(); + }, + toProtoMsg(message: OrderInfo): OrderInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderInfo", + value: OrderInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderInfo.typeUrl, OrderInfo); +function createBaseSpotOrder(): SpotOrder { + return { + marketId: "", + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + triggerPrice: undefined + }; +} +export const SpotOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotOrder", + is(o: any): o is SpotOrder { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.marketId === "string" && OrderInfo.is(o.orderInfo) && isSet(o.orderType)); + }, + isAmino(o: any): o is SpotOrderAmino { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.market_id === "string" && OrderInfo.isAmino(o.order_info) && isSet(o.order_type)); + }, + encode(message: SpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(24).int32(message.orderType); + } + if (message.triggerPrice !== undefined) { + writer.uint32(34).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 3: + message.orderType = (reader.int32() as any); + break; + case 4: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrder { + const message = createBaseSpotOrder(); + message.marketId = object.marketId ?? ""; + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: SpotOrderAmino): SpotOrder { + const message = createBaseSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: SpotOrder): SpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: SpotOrderAminoMsg): SpotOrder { + return SpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderProtoMsg): SpotOrder { + return SpotOrder.decode(message.value); + }, + toProto(message: SpotOrder): Uint8Array { + return SpotOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotOrder): SpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotOrder", + value: SpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrder.typeUrl, SpotOrder); +function createBaseSpotLimitOrder(): SpotLimitOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + fillable: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const SpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder", + is(o: any): o is SpotLimitOrder { + return o && (o.$typeUrl === SpotLimitOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.fillable === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is SpotLimitOrderAmino { + return o && (o.$typeUrl === SpotLimitOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.fillable === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: SpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.fillable !== "") { + writer.uint32(26).string(message.fillable); + } + if (message.triggerPrice !== undefined) { + writer.uint32(34).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.fillable = reader.string(); + break; + case 4: + message.triggerPrice = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotLimitOrder { + const message = createBaseSpotLimitOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.fillable = object.fillable ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: SpotLimitOrderAmino): SpotLimitOrder { + const message = createBaseSpotLimitOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: SpotLimitOrder): SpotLimitOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: SpotLimitOrderAminoMsg): SpotLimitOrder { + return SpotLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotLimitOrderProtoMsg): SpotLimitOrder { + return SpotLimitOrder.decode(message.value); + }, + toProto(message: SpotLimitOrder): Uint8Array { + return SpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotLimitOrder): SpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotLimitOrder", + value: SpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotLimitOrder.typeUrl, SpotLimitOrder); +function createBaseSpotMarketOrder(): SpotMarketOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + balanceHold: "", + orderHash: new Uint8Array(), + orderType: 0, + triggerPrice: undefined + }; +} +export const SpotMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder", + is(o: any): o is SpotMarketOrder { + return o && (o.$typeUrl === SpotMarketOrder.typeUrl || OrderInfo.is(o.orderInfo) && typeof o.balanceHold === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && isSet(o.orderType)); + }, + isAmino(o: any): o is SpotMarketOrderAmino { + return o && (o.$typeUrl === SpotMarketOrder.typeUrl || OrderInfo.isAmino(o.order_info) && typeof o.balance_hold === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && isSet(o.order_type)); + }, + encode(message: SpotMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.balanceHold !== "") { + writer.uint32(18).string(message.balanceHold); + } + if (message.orderHash.length !== 0) { + writer.uint32(26).bytes(message.orderHash); + } + if (message.orderType !== 0) { + writer.uint32(32).int32(message.orderType); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.balanceHold = reader.string(); + break; + case 3: + message.orderHash = reader.bytes(); + break; + case 4: + message.orderType = (reader.int32() as any); + break; + case 5: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketOrder { + const message = createBaseSpotMarketOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.balanceHold = object.balanceHold ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.orderType = object.orderType ?? 0; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: SpotMarketOrderAmino): SpotMarketOrder { + const message = createBaseSpotMarketOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: SpotMarketOrder): SpotMarketOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: SpotMarketOrderAminoMsg): SpotMarketOrder { + return SpotMarketOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketOrderProtoMsg): SpotMarketOrder { + return SpotMarketOrder.decode(message.value); + }, + toProto(message: SpotMarketOrder): Uint8Array { + return SpotMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketOrder): SpotMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrder", + value: SpotMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketOrder.typeUrl, SpotMarketOrder); +function createBaseDerivativeOrder(): DerivativeOrder { + return { + marketId: "", + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + triggerPrice: undefined + }; +} +export const DerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder", + is(o: any): o is DerivativeOrder { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.marketId === "string" && OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string"); + }, + isAmino(o: any): o is DerivativeOrderAmino { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.market_id === "string" && OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string"); + }, + encode(message: DerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(24).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(34).string(message.margin); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 3: + message.orderType = (reader.int32() as any); + break; + case 4: + message.margin = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrder { + const message = createBaseDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + return message; + }, + fromAmino(object: DerivativeOrderAmino): DerivativeOrder { + const message = createBaseDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + return message; + }, + toAmino(message: DerivativeOrder): DerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + return obj; + }, + fromAminoMsg(object: DerivativeOrderAminoMsg): DerivativeOrder { + return DerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderProtoMsg): DerivativeOrder { + return DerivativeOrder.decode(message.value); + }, + toProto(message: DerivativeOrder): Uint8Array { + return DerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrder): DerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrder", + value: DerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrder.typeUrl, DerivativeOrder); +function createBaseSubaccountOrderbookMetadata(): SubaccountOrderbookMetadata { + return { + vanillaLimitOrderCount: 0, + reduceOnlyLimitOrderCount: 0, + aggregateReduceOnlyQuantity: "", + aggregateVanillaQuantity: "", + vanillaConditionalOrderCount: 0, + reduceOnlyConditionalOrderCount: 0 + }; +} +export const SubaccountOrderbookMetadata = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata", + is(o: any): o is SubaccountOrderbookMetadata { + return o && (o.$typeUrl === SubaccountOrderbookMetadata.typeUrl || typeof o.vanillaLimitOrderCount === "number" && typeof o.reduceOnlyLimitOrderCount === "number" && typeof o.aggregateReduceOnlyQuantity === "string" && typeof o.aggregateVanillaQuantity === "string" && typeof o.vanillaConditionalOrderCount === "number" && typeof o.reduceOnlyConditionalOrderCount === "number"); + }, + isAmino(o: any): o is SubaccountOrderbookMetadataAmino { + return o && (o.$typeUrl === SubaccountOrderbookMetadata.typeUrl || typeof o.vanilla_limit_order_count === "number" && typeof o.reduce_only_limit_order_count === "number" && typeof o.aggregate_reduce_only_quantity === "string" && typeof o.aggregate_vanilla_quantity === "string" && typeof o.vanilla_conditional_order_count === "number" && typeof o.reduce_only_conditional_order_count === "number"); + }, + encode(message: SubaccountOrderbookMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vanillaLimitOrderCount !== 0) { + writer.uint32(8).uint32(message.vanillaLimitOrderCount); + } + if (message.reduceOnlyLimitOrderCount !== 0) { + writer.uint32(16).uint32(message.reduceOnlyLimitOrderCount); + } + if (message.aggregateReduceOnlyQuantity !== "") { + writer.uint32(26).string(message.aggregateReduceOnlyQuantity); + } + if (message.aggregateVanillaQuantity !== "") { + writer.uint32(34).string(message.aggregateVanillaQuantity); + } + if (message.vanillaConditionalOrderCount !== 0) { + writer.uint32(40).uint32(message.vanillaConditionalOrderCount); + } + if (message.reduceOnlyConditionalOrderCount !== 0) { + writer.uint32(48).uint32(message.reduceOnlyConditionalOrderCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderbookMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderbookMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vanillaLimitOrderCount = reader.uint32(); + break; + case 2: + message.reduceOnlyLimitOrderCount = reader.uint32(); + break; + case 3: + message.aggregateReduceOnlyQuantity = reader.string(); + break; + case 4: + message.aggregateVanillaQuantity = reader.string(); + break; + case 5: + message.vanillaConditionalOrderCount = reader.uint32(); + break; + case 6: + message.reduceOnlyConditionalOrderCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderbookMetadata { + const message = createBaseSubaccountOrderbookMetadata(); + message.vanillaLimitOrderCount = object.vanillaLimitOrderCount ?? 0; + message.reduceOnlyLimitOrderCount = object.reduceOnlyLimitOrderCount ?? 0; + message.aggregateReduceOnlyQuantity = object.aggregateReduceOnlyQuantity ?? ""; + message.aggregateVanillaQuantity = object.aggregateVanillaQuantity ?? ""; + message.vanillaConditionalOrderCount = object.vanillaConditionalOrderCount ?? 0; + message.reduceOnlyConditionalOrderCount = object.reduceOnlyConditionalOrderCount ?? 0; + return message; + }, + fromAmino(object: SubaccountOrderbookMetadataAmino): SubaccountOrderbookMetadata { + const message = createBaseSubaccountOrderbookMetadata(); + if (object.vanilla_limit_order_count !== undefined && object.vanilla_limit_order_count !== null) { + message.vanillaLimitOrderCount = object.vanilla_limit_order_count; + } + if (object.reduce_only_limit_order_count !== undefined && object.reduce_only_limit_order_count !== null) { + message.reduceOnlyLimitOrderCount = object.reduce_only_limit_order_count; + } + if (object.aggregate_reduce_only_quantity !== undefined && object.aggregate_reduce_only_quantity !== null) { + message.aggregateReduceOnlyQuantity = object.aggregate_reduce_only_quantity; + } + if (object.aggregate_vanilla_quantity !== undefined && object.aggregate_vanilla_quantity !== null) { + message.aggregateVanillaQuantity = object.aggregate_vanilla_quantity; + } + if (object.vanilla_conditional_order_count !== undefined && object.vanilla_conditional_order_count !== null) { + message.vanillaConditionalOrderCount = object.vanilla_conditional_order_count; + } + if (object.reduce_only_conditional_order_count !== undefined && object.reduce_only_conditional_order_count !== null) { + message.reduceOnlyConditionalOrderCount = object.reduce_only_conditional_order_count; + } + return message; + }, + toAmino(message: SubaccountOrderbookMetadata): SubaccountOrderbookMetadataAmino { + const obj: any = {}; + obj.vanilla_limit_order_count = message.vanillaLimitOrderCount === 0 ? undefined : message.vanillaLimitOrderCount; + obj.reduce_only_limit_order_count = message.reduceOnlyLimitOrderCount === 0 ? undefined : message.reduceOnlyLimitOrderCount; + obj.aggregate_reduce_only_quantity = message.aggregateReduceOnlyQuantity === "" ? undefined : message.aggregateReduceOnlyQuantity; + obj.aggregate_vanilla_quantity = message.aggregateVanillaQuantity === "" ? undefined : message.aggregateVanillaQuantity; + obj.vanilla_conditional_order_count = message.vanillaConditionalOrderCount === 0 ? undefined : message.vanillaConditionalOrderCount; + obj.reduce_only_conditional_order_count = message.reduceOnlyConditionalOrderCount === 0 ? undefined : message.reduceOnlyConditionalOrderCount; + return obj; + }, + fromAminoMsg(object: SubaccountOrderbookMetadataAminoMsg): SubaccountOrderbookMetadata { + return SubaccountOrderbookMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderbookMetadataProtoMsg): SubaccountOrderbookMetadata { + return SubaccountOrderbookMetadata.decode(message.value); + }, + toProto(message: SubaccountOrderbookMetadata): Uint8Array { + return SubaccountOrderbookMetadata.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderbookMetadata): SubaccountOrderbookMetadataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadata", + value: SubaccountOrderbookMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderbookMetadata.typeUrl, SubaccountOrderbookMetadata); +function createBaseSubaccountOrder(): SubaccountOrder { + return { + price: "", + quantity: "", + isReduceOnly: false, + cid: "" + }; +} +export const SubaccountOrder = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder", + is(o: any): o is SubaccountOrder { + return o && (o.$typeUrl === SubaccountOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.isReduceOnly === "boolean" && typeof o.cid === "string"); + }, + isAmino(o: any): o is SubaccountOrderAmino { + return o && (o.$typeUrl === SubaccountOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.isReduceOnly === "boolean" && typeof o.cid === "string"); + }, + encode(message: SubaccountOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.isReduceOnly === true) { + writer.uint32(24).bool(message.isReduceOnly); + } + if (message.cid !== "") { + writer.uint32(34).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.isReduceOnly = reader.bool(); + break; + case 4: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrder { + const message = createBaseSubaccountOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.isReduceOnly = object.isReduceOnly ?? false; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: SubaccountOrderAmino): SubaccountOrder { + const message = createBaseSubaccountOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.isReduceOnly !== undefined && object.isReduceOnly !== null) { + message.isReduceOnly = object.isReduceOnly; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: SubaccountOrder): SubaccountOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.isReduceOnly = message.isReduceOnly === false ? undefined : message.isReduceOnly; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: SubaccountOrderAminoMsg): SubaccountOrder { + return SubaccountOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderProtoMsg): SubaccountOrder { + return SubaccountOrder.decode(message.value); + }, + toProto(message: SubaccountOrder): Uint8Array { + return SubaccountOrder.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrder): SubaccountOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrder", + value: SubaccountOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrder.typeUrl, SubaccountOrder); +function createBaseSubaccountOrderData(): SubaccountOrderData { + return { + order: undefined, + orderHash: new Uint8Array() + }; +} +export const SubaccountOrderData = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData", + is(o: any): o is SubaccountOrderData { + return o && (o.$typeUrl === SubaccountOrderData.typeUrl || o.orderHash instanceof Uint8Array || typeof o.orderHash === "string"); + }, + isAmino(o: any): o is SubaccountOrderDataAmino { + return o && (o.$typeUrl === SubaccountOrderData.typeUrl || o.order_hash instanceof Uint8Array || typeof o.order_hash === "string"); + }, + encode(message: SubaccountOrderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + SubaccountOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = SubaccountOrder.decode(reader, reader.uint32()); + break; + case 2: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderData { + const message = createBaseSubaccountOrderData(); + message.order = object.order !== undefined && object.order !== null ? SubaccountOrder.fromPartial(object.order) : undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: SubaccountOrderDataAmino): SubaccountOrderData { + const message = createBaseSubaccountOrderData(); + if (object.order !== undefined && object.order !== null) { + message.order = SubaccountOrder.fromAmino(object.order); + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: SubaccountOrderData): SubaccountOrderDataAmino { + const obj: any = {}; + obj.order = message.order ? SubaccountOrder.toAmino(message.order) : undefined; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountOrderDataAminoMsg): SubaccountOrderData { + return SubaccountOrderData.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderDataProtoMsg): SubaccountOrderData { + return SubaccountOrderData.decode(message.value); + }, + toProto(message: SubaccountOrderData): Uint8Array { + return SubaccountOrderData.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderData): SubaccountOrderDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderData", + value: SubaccountOrderData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderData.typeUrl, SubaccountOrderData); +function createBaseDerivativeLimitOrder(): DerivativeLimitOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + fillable: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const DerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder", + is(o: any): o is DerivativeLimitOrder { + return o && (o.$typeUrl === DerivativeLimitOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string" && typeof o.fillable === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is DerivativeLimitOrderAmino { + return o && (o.$typeUrl === DerivativeLimitOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string" && typeof o.fillable === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: DerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.fillable !== "") { + writer.uint32(34).string(message.fillable); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(50).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.fillable = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + case 6: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeLimitOrder { + const message = createBaseDerivativeLimitOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.fillable = object.fillable ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: DerivativeLimitOrderAmino): DerivativeLimitOrder { + const message = createBaseDerivativeLimitOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: DerivativeLimitOrder): DerivativeLimitOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeLimitOrderAminoMsg): DerivativeLimitOrder { + return DerivativeLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeLimitOrderProtoMsg): DerivativeLimitOrder { + return DerivativeLimitOrder.decode(message.value); + }, + toProto(message: DerivativeLimitOrder): Uint8Array { + return DerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeLimitOrder): DerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeLimitOrder", + value: DerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeLimitOrder.typeUrl, DerivativeLimitOrder); +function createBaseDerivativeMarketOrder(): DerivativeMarketOrder { + return { + orderInfo: OrderInfo.fromPartial({}), + orderType: 0, + margin: "", + marginHold: "", + triggerPrice: undefined, + orderHash: new Uint8Array() + }; +} +export const DerivativeMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder", + is(o: any): o is DerivativeMarketOrder { + return o && (o.$typeUrl === DerivativeMarketOrder.typeUrl || OrderInfo.is(o.orderInfo) && isSet(o.orderType) && typeof o.margin === "string" && typeof o.marginHold === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string")); + }, + isAmino(o: any): o is DerivativeMarketOrderAmino { + return o && (o.$typeUrl === DerivativeMarketOrder.typeUrl || OrderInfo.isAmino(o.order_info) && isSet(o.order_type) && typeof o.margin === "string" && typeof o.margin_hold === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string")); + }, + encode(message: DerivativeMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderInfo !== undefined) { + OrderInfo.encode(message.orderInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.orderType !== 0) { + writer.uint32(16).int32(message.orderType); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.marginHold !== "") { + writer.uint32(34).string(message.marginHold); + } + if (message.triggerPrice !== undefined) { + writer.uint32(42).string(message.triggerPrice); + } + if (message.orderHash.length !== 0) { + writer.uint32(50).bytes(message.orderHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderInfo = OrderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.orderType = (reader.int32() as any); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.marginHold = reader.string(); + break; + case 5: + message.triggerPrice = reader.string(); + break; + case 6: + message.orderHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrder { + const message = createBaseDerivativeMarketOrder(); + message.orderInfo = object.orderInfo !== undefined && object.orderInfo !== null ? OrderInfo.fromPartial(object.orderInfo) : undefined; + message.orderType = object.orderType ?? 0; + message.margin = object.margin ?? ""; + message.marginHold = object.marginHold ?? ""; + message.triggerPrice = object.triggerPrice ?? undefined; + message.orderHash = object.orderHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: DerivativeMarketOrderAmino): DerivativeMarketOrder { + const message = createBaseDerivativeMarketOrder(); + if (object.order_info !== undefined && object.order_info !== null) { + message.orderInfo = OrderInfo.fromAmino(object.order_info); + } + if (object.order_type !== undefined && object.order_type !== null) { + message.orderType = object.order_type; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.margin_hold !== undefined && object.margin_hold !== null) { + message.marginHold = object.margin_hold; + } + if (object.trigger_price !== undefined && object.trigger_price !== null) { + message.triggerPrice = object.trigger_price; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + return message; + }, + toAmino(message: DerivativeMarketOrder): DerivativeMarketOrderAmino { + const obj: any = {}; + obj.order_info = message.orderInfo ? OrderInfo.toAmino(message.orderInfo) : undefined; + obj.order_type = message.orderType === 0 ? undefined : message.orderType; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.margin_hold = message.marginHold === "" ? undefined : message.marginHold; + obj.trigger_price = message.triggerPrice === null ? undefined : message.triggerPrice; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderAminoMsg): DerivativeMarketOrder { + return DerivativeMarketOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderProtoMsg): DerivativeMarketOrder { + return DerivativeMarketOrder.decode(message.value); + }, + toProto(message: DerivativeMarketOrder): Uint8Array { + return DerivativeMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrder): DerivativeMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrder", + value: DerivativeMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrder.typeUrl, DerivativeMarketOrder); +function createBasePosition(): Position { + return { + isLong: false, + quantity: "", + entryPrice: "", + margin: "", + cumulativeFundingEntry: "" + }; +} +export const Position = { + typeUrl: "/injective.exchange.v1beta1.Position", + is(o: any): o is Position { + return o && (o.$typeUrl === Position.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.margin === "string" && typeof o.cumulativeFundingEntry === "string"); + }, + isAmino(o: any): o is PositionAmino { + return o && (o.$typeUrl === Position.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.margin === "string" && typeof o.cumulative_funding_entry === "string"); + }, + encode(message: Position, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(26).string(message.entryPrice); + } + if (message.margin !== "") { + writer.uint32(34).string(message.margin); + } + if (message.cumulativeFundingEntry !== "") { + writer.uint32(42).string(message.cumulativeFundingEntry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Position { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.entryPrice = reader.string(); + break; + case 4: + message.margin = reader.string(); + break; + case 5: + message.cumulativeFundingEntry = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Position { + const message = createBasePosition(); + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.margin = object.margin ?? ""; + message.cumulativeFundingEntry = object.cumulativeFundingEntry ?? ""; + return message; + }, + fromAmino(object: PositionAmino): Position { + const message = createBasePosition(); + if (object.isLong !== undefined && object.isLong !== null) { + message.isLong = object.isLong; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.cumulative_funding_entry !== undefined && object.cumulative_funding_entry !== null) { + message.cumulativeFundingEntry = object.cumulative_funding_entry; + } + return message; + }, + toAmino(message: Position): PositionAmino { + const obj: any = {}; + obj.isLong = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.cumulative_funding_entry = message.cumulativeFundingEntry === "" ? undefined : message.cumulativeFundingEntry; + return obj; + }, + fromAminoMsg(object: PositionAminoMsg): Position { + return Position.fromAmino(object.value); + }, + fromProtoMsg(message: PositionProtoMsg): Position { + return Position.decode(message.value); + }, + toProto(message: Position): Uint8Array { + return Position.encode(message).finish(); + }, + toProtoMsg(message: Position): PositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Position", + value: Position.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Position.typeUrl, Position); +function createBaseMarketOrderIndicator(): MarketOrderIndicator { + return { + marketId: "", + isBuy: false + }; +} +export const MarketOrderIndicator = { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator", + is(o: any): o is MarketOrderIndicator { + return o && (o.$typeUrl === MarketOrderIndicator.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean"); + }, + isAmino(o: any): o is MarketOrderIndicatorAmino { + return o && (o.$typeUrl === MarketOrderIndicator.typeUrl || typeof o.market_id === "string" && typeof o.isBuy === "boolean"); + }, + encode(message: MarketOrderIndicator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketOrderIndicator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketOrderIndicator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketOrderIndicator { + const message = createBaseMarketOrderIndicator(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + return message; + }, + fromAmino(object: MarketOrderIndicatorAmino): MarketOrderIndicator { + const message = createBaseMarketOrderIndicator(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + return message; + }, + toAmino(message: MarketOrderIndicator): MarketOrderIndicatorAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + return obj; + }, + fromAminoMsg(object: MarketOrderIndicatorAminoMsg): MarketOrderIndicator { + return MarketOrderIndicator.fromAmino(object.value); + }, + fromProtoMsg(message: MarketOrderIndicatorProtoMsg): MarketOrderIndicator { + return MarketOrderIndicator.decode(message.value); + }, + toProto(message: MarketOrderIndicator): Uint8Array { + return MarketOrderIndicator.encode(message).finish(); + }, + toProtoMsg(message: MarketOrderIndicator): MarketOrderIndicatorProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketOrderIndicator", + value: MarketOrderIndicator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketOrderIndicator.typeUrl, MarketOrderIndicator); +function createBaseTradeLog(): TradeLog { + return { + quantity: "", + price: "", + subaccountId: new Uint8Array(), + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "" + }; +} +export const TradeLog = { + typeUrl: "/injective.exchange.v1beta1.TradeLog", + is(o: any): o is TradeLog { + return o && (o.$typeUrl === TradeLog.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is TradeLogAmino { + return o && (o.$typeUrl === TradeLog.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: TradeLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.subaccountId.length !== 0) { + writer.uint32(26).bytes(message.subaccountId); + } + if (message.fee !== "") { + writer.uint32(34).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(50).bytes(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.subaccountId = reader.bytes(); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + case 6: + message.feeRecipientAddress = reader.bytes(); + break; + case 7: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeLog { + const message = createBaseTradeLog(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TradeLogAmino): TradeLog { + const message = createBaseTradeLog(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = bytesFromBase64(object.fee_recipient_address); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TradeLog): TradeLogAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress ? base64FromBytes(message.feeRecipientAddress) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TradeLogAminoMsg): TradeLog { + return TradeLog.fromAmino(object.value); + }, + fromProtoMsg(message: TradeLogProtoMsg): TradeLog { + return TradeLog.decode(message.value); + }, + toProto(message: TradeLog): Uint8Array { + return TradeLog.encode(message).finish(); + }, + toProtoMsg(message: TradeLog): TradeLogProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeLog", + value: TradeLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeLog.typeUrl, TradeLog); +function createBasePositionDelta(): PositionDelta { + return { + isLong: false, + executionQuantity: "", + executionMargin: "", + executionPrice: "" + }; +} +export const PositionDelta = { + typeUrl: "/injective.exchange.v1beta1.PositionDelta", + is(o: any): o is PositionDelta { + return o && (o.$typeUrl === PositionDelta.typeUrl || typeof o.isLong === "boolean" && typeof o.executionQuantity === "string" && typeof o.executionMargin === "string" && typeof o.executionPrice === "string"); + }, + isAmino(o: any): o is PositionDeltaAmino { + return o && (o.$typeUrl === PositionDelta.typeUrl || typeof o.is_long === "boolean" && typeof o.execution_quantity === "string" && typeof o.execution_margin === "string" && typeof o.execution_price === "string"); + }, + encode(message: PositionDelta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.executionQuantity !== "") { + writer.uint32(18).string(message.executionQuantity); + } + if (message.executionMargin !== "") { + writer.uint32(26).string(message.executionMargin); + } + if (message.executionPrice !== "") { + writer.uint32(34).string(message.executionPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionDelta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionDelta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.executionQuantity = reader.string(); + break; + case 3: + message.executionMargin = reader.string(); + break; + case 4: + message.executionPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PositionDelta { + const message = createBasePositionDelta(); + message.isLong = object.isLong ?? false; + message.executionQuantity = object.executionQuantity ?? ""; + message.executionMargin = object.executionMargin ?? ""; + message.executionPrice = object.executionPrice ?? ""; + return message; + }, + fromAmino(object: PositionDeltaAmino): PositionDelta { + const message = createBasePositionDelta(); + if (object.is_long !== undefined && object.is_long !== null) { + message.isLong = object.is_long; + } + if (object.execution_quantity !== undefined && object.execution_quantity !== null) { + message.executionQuantity = object.execution_quantity; + } + if (object.execution_margin !== undefined && object.execution_margin !== null) { + message.executionMargin = object.execution_margin; + } + if (object.execution_price !== undefined && object.execution_price !== null) { + message.executionPrice = object.execution_price; + } + return message; + }, + toAmino(message: PositionDelta): PositionDeltaAmino { + const obj: any = {}; + obj.is_long = message.isLong === false ? undefined : message.isLong; + obj.execution_quantity = message.executionQuantity === "" ? undefined : message.executionQuantity; + obj.execution_margin = message.executionMargin === "" ? undefined : message.executionMargin; + obj.execution_price = message.executionPrice === "" ? undefined : message.executionPrice; + return obj; + }, + fromAminoMsg(object: PositionDeltaAminoMsg): PositionDelta { + return PositionDelta.fromAmino(object.value); + }, + fromProtoMsg(message: PositionDeltaProtoMsg): PositionDelta { + return PositionDelta.decode(message.value); + }, + toProto(message: PositionDelta): Uint8Array { + return PositionDelta.encode(message).finish(); + }, + toProtoMsg(message: PositionDelta): PositionDeltaProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PositionDelta", + value: PositionDelta.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PositionDelta.typeUrl, PositionDelta); +function createBaseDerivativeTradeLog(): DerivativeTradeLog { + return { + subaccountId: new Uint8Array(), + positionDelta: undefined, + payout: "", + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "", + pnl: "" + }; +} +export const DerivativeTradeLog = { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog", + is(o: any): o is DerivativeTradeLog { + return o && (o.$typeUrl === DerivativeTradeLog.typeUrl || (o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string") && typeof o.payout === "string" && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string" && typeof o.pnl === "string"); + }, + isAmino(o: any): o is DerivativeTradeLogAmino { + return o && (o.$typeUrl === DerivativeTradeLog.typeUrl || (o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string") && typeof o.payout === "string" && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string" && typeof o.pnl === "string"); + }, + encode(message: DerivativeTradeLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(18).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(26).string(message.payout); + } + if (message.fee !== "") { + writer.uint32(34).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(42).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(50).bytes(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + if (message.pnl !== "") { + writer.uint32(66).string(message.pnl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeTradeLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeTradeLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 3: + message.payout = reader.string(); + break; + case 4: + message.fee = reader.string(); + break; + case 5: + message.orderHash = reader.bytes(); + break; + case 6: + message.feeRecipientAddress = reader.bytes(); + break; + case 7: + message.cid = reader.string(); + break; + case 8: + message.pnl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeTradeLog { + const message = createBaseDerivativeTradeLog(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.pnl = object.pnl ?? ""; + return message; + }, + fromAmino(object: DerivativeTradeLogAmino): DerivativeTradeLog { + const message = createBaseDerivativeTradeLog(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = bytesFromBase64(object.fee_recipient_address); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.pnl !== undefined && object.pnl !== null) { + message.pnl = object.pnl; + } + return message; + }, + toAmino(message: DerivativeTradeLog): DerivativeTradeLogAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress ? base64FromBytes(message.feeRecipientAddress) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.pnl = message.pnl === "" ? undefined : message.pnl; + return obj; + }, + fromAminoMsg(object: DerivativeTradeLogAminoMsg): DerivativeTradeLog { + return DerivativeTradeLog.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeTradeLogProtoMsg): DerivativeTradeLog { + return DerivativeTradeLog.decode(message.value); + }, + toProto(message: DerivativeTradeLog): Uint8Array { + return DerivativeTradeLog.encode(message).finish(); + }, + toProtoMsg(message: DerivativeTradeLog): DerivativeTradeLogProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeTradeLog", + value: DerivativeTradeLog.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeTradeLog.typeUrl, DerivativeTradeLog); +function createBaseSubaccountPosition(): SubaccountPosition { + return { + position: undefined, + subaccountId: new Uint8Array() + }; +} +export const SubaccountPosition = { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition", + is(o: any): o is SubaccountPosition { + return o && (o.$typeUrl === SubaccountPosition.typeUrl || o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is SubaccountPositionAmino { + return o && (o.$typeUrl === SubaccountPosition.typeUrl || o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string"); + }, + encode(message: SubaccountPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.position !== undefined) { + Position.encode(message.position, writer.uint32(10).fork()).ldelim(); + } + if (message.subaccountId.length !== 0) { + writer.uint32(18).bytes(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.position = Position.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountPosition { + const message = createBaseSubaccountPosition(); + message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; + message.subaccountId = object.subaccountId ?? new Uint8Array(); + return message; + }, + fromAmino(object: SubaccountPositionAmino): SubaccountPosition { + const message = createBaseSubaccountPosition(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + return message; + }, + toAmino(message: SubaccountPosition): SubaccountPositionAmino { + const obj: any = {}; + obj.position = message.position ? Position.toAmino(message.position) : undefined; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountPositionAminoMsg): SubaccountPosition { + return SubaccountPosition.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountPositionProtoMsg): SubaccountPosition { + return SubaccountPosition.decode(message.value); + }, + toProto(message: SubaccountPosition): Uint8Array { + return SubaccountPosition.encode(message).finish(); + }, + toProtoMsg(message: SubaccountPosition): SubaccountPositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountPosition", + value: SubaccountPosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountPosition.typeUrl, SubaccountPosition); +function createBaseSubaccountDeposit(): SubaccountDeposit { + return { + subaccountId: new Uint8Array(), + deposit: undefined + }; +} +export const SubaccountDeposit = { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit", + is(o: any): o is SubaccountDeposit { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || o.subaccountId instanceof Uint8Array || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is SubaccountDepositAmino { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || o.subaccount_id instanceof Uint8Array || typeof o.subaccount_id === "string"); + }, + encode(message: SubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId.length !== 0) { + writer.uint32(10).bytes(message.subaccountId); + } + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.bytes(); + break; + case 2: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + message.subaccountId = object.subaccountId ?? new Uint8Array(); + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: SubaccountDepositAmino): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = bytesFromBase64(object.subaccount_id); + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: SubaccountDeposit): SubaccountDepositAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? base64FromBytes(message.subaccountId) : undefined; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountDepositAminoMsg): SubaccountDeposit { + return SubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositProtoMsg): SubaccountDeposit { + return SubaccountDeposit.decode(message.value); + }, + toProto(message: SubaccountDeposit): Uint8Array { + return SubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposit): SubaccountDepositProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountDeposit", + value: SubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposit.typeUrl, SubaccountDeposit); +function createBaseDepositUpdate(): DepositUpdate { + return { + denom: "", + deposits: [] + }; +} +export const DepositUpdate = { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate", + is(o: any): o is DepositUpdate { + return o && (o.$typeUrl === DepositUpdate.typeUrl || typeof o.denom === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is DepositUpdateAmino { + return o && (o.$typeUrl === DepositUpdate.typeUrl || typeof o.denom === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.isAmino(o.deposits[0]))); + }, + encode(message: DepositUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.deposits) { + SubaccountDeposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.deposits.push(SubaccountDeposit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DepositUpdate { + const message = createBaseDepositUpdate(); + message.denom = object.denom ?? ""; + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DepositUpdateAmino): DepositUpdate { + const message = createBaseDepositUpdate(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: DepositUpdate): DepositUpdateAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? SubaccountDeposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + return obj; + }, + fromAminoMsg(object: DepositUpdateAminoMsg): DepositUpdate { + return DepositUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: DepositUpdateProtoMsg): DepositUpdate { + return DepositUpdate.decode(message.value); + }, + toProto(message: DepositUpdate): Uint8Array { + return DepositUpdate.encode(message).finish(); + }, + toProtoMsg(message: DepositUpdate): DepositUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DepositUpdate", + value: DepositUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DepositUpdate.typeUrl, DepositUpdate); +function createBasePointsMultiplier(): PointsMultiplier { + return { + makerPointsMultiplier: "", + takerPointsMultiplier: "" + }; +} +export const PointsMultiplier = { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier", + is(o: any): o is PointsMultiplier { + return o && (o.$typeUrl === PointsMultiplier.typeUrl || typeof o.makerPointsMultiplier === "string" && typeof o.takerPointsMultiplier === "string"); + }, + isAmino(o: any): o is PointsMultiplierAmino { + return o && (o.$typeUrl === PointsMultiplier.typeUrl || typeof o.maker_points_multiplier === "string" && typeof o.taker_points_multiplier === "string"); + }, + encode(message: PointsMultiplier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerPointsMultiplier !== "") { + writer.uint32(10).string(message.makerPointsMultiplier); + } + if (message.takerPointsMultiplier !== "") { + writer.uint32(18).string(message.takerPointsMultiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PointsMultiplier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePointsMultiplier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerPointsMultiplier = reader.string(); + break; + case 2: + message.takerPointsMultiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PointsMultiplier { + const message = createBasePointsMultiplier(); + message.makerPointsMultiplier = object.makerPointsMultiplier ?? ""; + message.takerPointsMultiplier = object.takerPointsMultiplier ?? ""; + return message; + }, + fromAmino(object: PointsMultiplierAmino): PointsMultiplier { + const message = createBasePointsMultiplier(); + if (object.maker_points_multiplier !== undefined && object.maker_points_multiplier !== null) { + message.makerPointsMultiplier = object.maker_points_multiplier; + } + if (object.taker_points_multiplier !== undefined && object.taker_points_multiplier !== null) { + message.takerPointsMultiplier = object.taker_points_multiplier; + } + return message; + }, + toAmino(message: PointsMultiplier): PointsMultiplierAmino { + const obj: any = {}; + obj.maker_points_multiplier = message.makerPointsMultiplier === "" ? undefined : message.makerPointsMultiplier; + obj.taker_points_multiplier = message.takerPointsMultiplier === "" ? undefined : message.takerPointsMultiplier; + return obj; + }, + fromAminoMsg(object: PointsMultiplierAminoMsg): PointsMultiplier { + return PointsMultiplier.fromAmino(object.value); + }, + fromProtoMsg(message: PointsMultiplierProtoMsg): PointsMultiplier { + return PointsMultiplier.decode(message.value); + }, + toProto(message: PointsMultiplier): Uint8Array { + return PointsMultiplier.encode(message).finish(); + }, + toProtoMsg(message: PointsMultiplier): PointsMultiplierProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PointsMultiplier", + value: PointsMultiplier.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PointsMultiplier.typeUrl, PointsMultiplier); +function createBaseTradingRewardCampaignBoostInfo(): TradingRewardCampaignBoostInfo { + return { + boostedSpotMarketIds: [], + spotMarketMultipliers: [], + boostedDerivativeMarketIds: [], + derivativeMarketMultipliers: [] + }; +} +export const TradingRewardCampaignBoostInfo = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo", + is(o: any): o is TradingRewardCampaignBoostInfo { + return o && (o.$typeUrl === TradingRewardCampaignBoostInfo.typeUrl || Array.isArray(o.boostedSpotMarketIds) && (!o.boostedSpotMarketIds.length || typeof o.boostedSpotMarketIds[0] === "string") && Array.isArray(o.spotMarketMultipliers) && (!o.spotMarketMultipliers.length || PointsMultiplier.is(o.spotMarketMultipliers[0])) && Array.isArray(o.boostedDerivativeMarketIds) && (!o.boostedDerivativeMarketIds.length || typeof o.boostedDerivativeMarketIds[0] === "string") && Array.isArray(o.derivativeMarketMultipliers) && (!o.derivativeMarketMultipliers.length || PointsMultiplier.is(o.derivativeMarketMultipliers[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignBoostInfoAmino { + return o && (o.$typeUrl === TradingRewardCampaignBoostInfo.typeUrl || Array.isArray(o.boosted_spot_market_ids) && (!o.boosted_spot_market_ids.length || typeof o.boosted_spot_market_ids[0] === "string") && Array.isArray(o.spot_market_multipliers) && (!o.spot_market_multipliers.length || PointsMultiplier.isAmino(o.spot_market_multipliers[0])) && Array.isArray(o.boosted_derivative_market_ids) && (!o.boosted_derivative_market_ids.length || typeof o.boosted_derivative_market_ids[0] === "string") && Array.isArray(o.derivative_market_multipliers) && (!o.derivative_market_multipliers.length || PointsMultiplier.isAmino(o.derivative_market_multipliers[0]))); + }, + encode(message: TradingRewardCampaignBoostInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.boostedSpotMarketIds) { + writer.uint32(10).string(v!); + } + for (const v of message.spotMarketMultipliers) { + PointsMultiplier.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.boostedDerivativeMarketIds) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeMarketMultipliers) { + PointsMultiplier.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignBoostInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignBoostInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boostedSpotMarketIds.push(reader.string()); + break; + case 2: + message.spotMarketMultipliers.push(PointsMultiplier.decode(reader, reader.uint32())); + break; + case 3: + message.boostedDerivativeMarketIds.push(reader.string()); + break; + case 4: + message.derivativeMarketMultipliers.push(PointsMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignBoostInfo { + const message = createBaseTradingRewardCampaignBoostInfo(); + message.boostedSpotMarketIds = object.boostedSpotMarketIds?.map(e => e) || []; + message.spotMarketMultipliers = object.spotMarketMultipliers?.map(e => PointsMultiplier.fromPartial(e)) || []; + message.boostedDerivativeMarketIds = object.boostedDerivativeMarketIds?.map(e => e) || []; + message.derivativeMarketMultipliers = object.derivativeMarketMultipliers?.map(e => PointsMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignBoostInfoAmino): TradingRewardCampaignBoostInfo { + const message = createBaseTradingRewardCampaignBoostInfo(); + message.boostedSpotMarketIds = object.boosted_spot_market_ids?.map(e => e) || []; + message.spotMarketMultipliers = object.spot_market_multipliers?.map(e => PointsMultiplier.fromAmino(e)) || []; + message.boostedDerivativeMarketIds = object.boosted_derivative_market_ids?.map(e => e) || []; + message.derivativeMarketMultipliers = object.derivative_market_multipliers?.map(e => PointsMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignBoostInfo): TradingRewardCampaignBoostInfoAmino { + const obj: any = {}; + if (message.boostedSpotMarketIds) { + obj.boosted_spot_market_ids = message.boostedSpotMarketIds.map(e => e); + } else { + obj.boosted_spot_market_ids = message.boostedSpotMarketIds; + } + if (message.spotMarketMultipliers) { + obj.spot_market_multipliers = message.spotMarketMultipliers.map(e => e ? PointsMultiplier.toAmino(e) : undefined); + } else { + obj.spot_market_multipliers = message.spotMarketMultipliers; + } + if (message.boostedDerivativeMarketIds) { + obj.boosted_derivative_market_ids = message.boostedDerivativeMarketIds.map(e => e); + } else { + obj.boosted_derivative_market_ids = message.boostedDerivativeMarketIds; + } + if (message.derivativeMarketMultipliers) { + obj.derivative_market_multipliers = message.derivativeMarketMultipliers.map(e => e ? PointsMultiplier.toAmino(e) : undefined); + } else { + obj.derivative_market_multipliers = message.derivativeMarketMultipliers; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignBoostInfoAminoMsg): TradingRewardCampaignBoostInfo { + return TradingRewardCampaignBoostInfo.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignBoostInfoProtoMsg): TradingRewardCampaignBoostInfo { + return TradingRewardCampaignBoostInfo.decode(message.value); + }, + toProto(message: TradingRewardCampaignBoostInfo): Uint8Array { + return TradingRewardCampaignBoostInfo.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignBoostInfo): TradingRewardCampaignBoostInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignBoostInfo", + value: TradingRewardCampaignBoostInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignBoostInfo.typeUrl, TradingRewardCampaignBoostInfo); +function createBaseCampaignRewardPool(): CampaignRewardPool { + return { + startTimestamp: BigInt(0), + maxCampaignRewards: [] + }; +} +export const CampaignRewardPool = { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool", + is(o: any): o is CampaignRewardPool { + return o && (o.$typeUrl === CampaignRewardPool.typeUrl || typeof o.startTimestamp === "bigint" && Array.isArray(o.maxCampaignRewards) && (!o.maxCampaignRewards.length || Coin.is(o.maxCampaignRewards[0]))); + }, + isAmino(o: any): o is CampaignRewardPoolAmino { + return o && (o.$typeUrl === CampaignRewardPool.typeUrl || typeof o.start_timestamp === "bigint" && Array.isArray(o.max_campaign_rewards) && (!o.max_campaign_rewards.length || Coin.isAmino(o.max_campaign_rewards[0]))); + }, + encode(message: CampaignRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.startTimestamp); + } + for (const v of message.maxCampaignRewards) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CampaignRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCampaignRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimestamp = reader.int64(); + break; + case 2: + message.maxCampaignRewards.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CampaignRewardPool { + const message = createBaseCampaignRewardPool(); + message.startTimestamp = object.startTimestamp !== undefined && object.startTimestamp !== null ? BigInt(object.startTimestamp.toString()) : BigInt(0); + message.maxCampaignRewards = object.maxCampaignRewards?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CampaignRewardPoolAmino): CampaignRewardPool { + const message = createBaseCampaignRewardPool(); + if (object.start_timestamp !== undefined && object.start_timestamp !== null) { + message.startTimestamp = BigInt(object.start_timestamp); + } + message.maxCampaignRewards = object.max_campaign_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CampaignRewardPool): CampaignRewardPoolAmino { + const obj: any = {}; + obj.start_timestamp = message.startTimestamp !== BigInt(0) ? message.startTimestamp?.toString() : undefined; + if (message.maxCampaignRewards) { + obj.max_campaign_rewards = message.maxCampaignRewards.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.max_campaign_rewards = message.maxCampaignRewards; + } + return obj; + }, + fromAminoMsg(object: CampaignRewardPoolAminoMsg): CampaignRewardPool { + return CampaignRewardPool.fromAmino(object.value); + }, + fromProtoMsg(message: CampaignRewardPoolProtoMsg): CampaignRewardPool { + return CampaignRewardPool.decode(message.value); + }, + toProto(message: CampaignRewardPool): Uint8Array { + return CampaignRewardPool.encode(message).finish(); + }, + toProtoMsg(message: CampaignRewardPool): CampaignRewardPoolProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.CampaignRewardPool", + value: CampaignRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CampaignRewardPool.typeUrl, CampaignRewardPool); +function createBaseTradingRewardCampaignInfo(): TradingRewardCampaignInfo { + return { + campaignDurationSeconds: BigInt(0), + quoteDenoms: [], + tradingRewardBoostInfo: undefined, + disqualifiedMarketIds: [] + }; +} +export const TradingRewardCampaignInfo = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo", + is(o: any): o is TradingRewardCampaignInfo { + return o && (o.$typeUrl === TradingRewardCampaignInfo.typeUrl || typeof o.campaignDurationSeconds === "bigint" && Array.isArray(o.quoteDenoms) && (!o.quoteDenoms.length || typeof o.quoteDenoms[0] === "string") && Array.isArray(o.disqualifiedMarketIds) && (!o.disqualifiedMarketIds.length || typeof o.disqualifiedMarketIds[0] === "string")); + }, + isAmino(o: any): o is TradingRewardCampaignInfoAmino { + return o && (o.$typeUrl === TradingRewardCampaignInfo.typeUrl || typeof o.campaign_duration_seconds === "bigint" && Array.isArray(o.quote_denoms) && (!o.quote_denoms.length || typeof o.quote_denoms[0] === "string") && Array.isArray(o.disqualified_market_ids) && (!o.disqualified_market_ids.length || typeof o.disqualified_market_ids[0] === "string")); + }, + encode(message: TradingRewardCampaignInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.campaignDurationSeconds !== BigInt(0)) { + writer.uint32(8).int64(message.campaignDurationSeconds); + } + for (const v of message.quoteDenoms) { + writer.uint32(18).string(v!); + } + if (message.tradingRewardBoostInfo !== undefined) { + TradingRewardCampaignBoostInfo.encode(message.tradingRewardBoostInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.disqualifiedMarketIds) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.campaignDurationSeconds = reader.int64(); + break; + case 2: + message.quoteDenoms.push(reader.string()); + break; + case 3: + message.tradingRewardBoostInfo = TradingRewardCampaignBoostInfo.decode(reader, reader.uint32()); + break; + case 4: + message.disqualifiedMarketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignInfo { + const message = createBaseTradingRewardCampaignInfo(); + message.campaignDurationSeconds = object.campaignDurationSeconds !== undefined && object.campaignDurationSeconds !== null ? BigInt(object.campaignDurationSeconds.toString()) : BigInt(0); + message.quoteDenoms = object.quoteDenoms?.map(e => e) || []; + message.tradingRewardBoostInfo = object.tradingRewardBoostInfo !== undefined && object.tradingRewardBoostInfo !== null ? TradingRewardCampaignBoostInfo.fromPartial(object.tradingRewardBoostInfo) : undefined; + message.disqualifiedMarketIds = object.disqualifiedMarketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignInfoAmino): TradingRewardCampaignInfo { + const message = createBaseTradingRewardCampaignInfo(); + if (object.campaign_duration_seconds !== undefined && object.campaign_duration_seconds !== null) { + message.campaignDurationSeconds = BigInt(object.campaign_duration_seconds); + } + message.quoteDenoms = object.quote_denoms?.map(e => e) || []; + if (object.trading_reward_boost_info !== undefined && object.trading_reward_boost_info !== null) { + message.tradingRewardBoostInfo = TradingRewardCampaignBoostInfo.fromAmino(object.trading_reward_boost_info); + } + message.disqualifiedMarketIds = object.disqualified_market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: TradingRewardCampaignInfo): TradingRewardCampaignInfoAmino { + const obj: any = {}; + obj.campaign_duration_seconds = message.campaignDurationSeconds !== BigInt(0) ? message.campaignDurationSeconds?.toString() : undefined; + if (message.quoteDenoms) { + obj.quote_denoms = message.quoteDenoms.map(e => e); + } else { + obj.quote_denoms = message.quoteDenoms; + } + obj.trading_reward_boost_info = message.tradingRewardBoostInfo ? TradingRewardCampaignBoostInfo.toAmino(message.tradingRewardBoostInfo) : undefined; + if (message.disqualifiedMarketIds) { + obj.disqualified_market_ids = message.disqualifiedMarketIds.map(e => e); + } else { + obj.disqualified_market_ids = message.disqualifiedMarketIds; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignInfoAminoMsg): TradingRewardCampaignInfo { + return TradingRewardCampaignInfo.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignInfoProtoMsg): TradingRewardCampaignInfo { + return TradingRewardCampaignInfo.decode(message.value); + }, + toProto(message: TradingRewardCampaignInfo): Uint8Array { + return TradingRewardCampaignInfo.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignInfo): TradingRewardCampaignInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignInfo", + value: TradingRewardCampaignInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignInfo.typeUrl, TradingRewardCampaignInfo); +function createBaseFeeDiscountTierInfo(): FeeDiscountTierInfo { + return { + makerDiscountRate: "", + takerDiscountRate: "", + stakedAmount: "", + volume: "" + }; +} +export const FeeDiscountTierInfo = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo", + is(o: any): o is FeeDiscountTierInfo { + return o && (o.$typeUrl === FeeDiscountTierInfo.typeUrl || typeof o.makerDiscountRate === "string" && typeof o.takerDiscountRate === "string" && typeof o.stakedAmount === "string" && typeof o.volume === "string"); + }, + isAmino(o: any): o is FeeDiscountTierInfoAmino { + return o && (o.$typeUrl === FeeDiscountTierInfo.typeUrl || typeof o.maker_discount_rate === "string" && typeof o.taker_discount_rate === "string" && typeof o.staked_amount === "string" && typeof o.volume === "string"); + }, + encode(message: FeeDiscountTierInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerDiscountRate !== "") { + writer.uint32(10).string(message.makerDiscountRate); + } + if (message.takerDiscountRate !== "") { + writer.uint32(18).string(message.takerDiscountRate); + } + if (message.stakedAmount !== "") { + writer.uint32(26).string(message.stakedAmount); + } + if (message.volume !== "") { + writer.uint32(34).string(message.volume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountTierInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountTierInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerDiscountRate = reader.string(); + break; + case 2: + message.takerDiscountRate = reader.string(); + break; + case 3: + message.stakedAmount = reader.string(); + break; + case 4: + message.volume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountTierInfo { + const message = createBaseFeeDiscountTierInfo(); + message.makerDiscountRate = object.makerDiscountRate ?? ""; + message.takerDiscountRate = object.takerDiscountRate ?? ""; + message.stakedAmount = object.stakedAmount ?? ""; + message.volume = object.volume ?? ""; + return message; + }, + fromAmino(object: FeeDiscountTierInfoAmino): FeeDiscountTierInfo { + const message = createBaseFeeDiscountTierInfo(); + if (object.maker_discount_rate !== undefined && object.maker_discount_rate !== null) { + message.makerDiscountRate = object.maker_discount_rate; + } + if (object.taker_discount_rate !== undefined && object.taker_discount_rate !== null) { + message.takerDiscountRate = object.taker_discount_rate; + } + if (object.staked_amount !== undefined && object.staked_amount !== null) { + message.stakedAmount = object.staked_amount; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = object.volume; + } + return message; + }, + toAmino(message: FeeDiscountTierInfo): FeeDiscountTierInfoAmino { + const obj: any = {}; + obj.maker_discount_rate = message.makerDiscountRate === "" ? undefined : message.makerDiscountRate; + obj.taker_discount_rate = message.takerDiscountRate === "" ? undefined : message.takerDiscountRate; + obj.staked_amount = message.stakedAmount === "" ? undefined : message.stakedAmount; + obj.volume = message.volume === "" ? undefined : message.volume; + return obj; + }, + fromAminoMsg(object: FeeDiscountTierInfoAminoMsg): FeeDiscountTierInfo { + return FeeDiscountTierInfo.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountTierInfoProtoMsg): FeeDiscountTierInfo { + return FeeDiscountTierInfo.decode(message.value); + }, + toProto(message: FeeDiscountTierInfo): Uint8Array { + return FeeDiscountTierInfo.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountTierInfo): FeeDiscountTierInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierInfo", + value: FeeDiscountTierInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountTierInfo.typeUrl, FeeDiscountTierInfo); +function createBaseFeeDiscountSchedule(): FeeDiscountSchedule { + return { + bucketCount: BigInt(0), + bucketDuration: BigInt(0), + quoteDenoms: [], + tierInfos: [], + disqualifiedMarketIds: [] + }; +} +export const FeeDiscountSchedule = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule", + is(o: any): o is FeeDiscountSchedule { + return o && (o.$typeUrl === FeeDiscountSchedule.typeUrl || typeof o.bucketCount === "bigint" && typeof o.bucketDuration === "bigint" && Array.isArray(o.quoteDenoms) && (!o.quoteDenoms.length || typeof o.quoteDenoms[0] === "string") && Array.isArray(o.tierInfos) && (!o.tierInfos.length || FeeDiscountTierInfo.is(o.tierInfos[0])) && Array.isArray(o.disqualifiedMarketIds) && (!o.disqualifiedMarketIds.length || typeof o.disqualifiedMarketIds[0] === "string")); + }, + isAmino(o: any): o is FeeDiscountScheduleAmino { + return o && (o.$typeUrl === FeeDiscountSchedule.typeUrl || typeof o.bucket_count === "bigint" && typeof o.bucket_duration === "bigint" && Array.isArray(o.quote_denoms) && (!o.quote_denoms.length || typeof o.quote_denoms[0] === "string") && Array.isArray(o.tier_infos) && (!o.tier_infos.length || FeeDiscountTierInfo.isAmino(o.tier_infos[0])) && Array.isArray(o.disqualified_market_ids) && (!o.disqualified_market_ids.length || typeof o.disqualified_market_ids[0] === "string")); + }, + encode(message: FeeDiscountSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bucketCount !== BigInt(0)) { + writer.uint32(8).uint64(message.bucketCount); + } + if (message.bucketDuration !== BigInt(0)) { + writer.uint32(16).int64(message.bucketDuration); + } + for (const v of message.quoteDenoms) { + writer.uint32(26).string(v!); + } + for (const v of message.tierInfos) { + FeeDiscountTierInfo.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.disqualifiedMarketIds) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketCount = reader.uint64(); + break; + case 2: + message.bucketDuration = reader.int64(); + break; + case 3: + message.quoteDenoms.push(reader.string()); + break; + case 4: + message.tierInfos.push(FeeDiscountTierInfo.decode(reader, reader.uint32())); + break; + case 5: + message.disqualifiedMarketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountSchedule { + const message = createBaseFeeDiscountSchedule(); + message.bucketCount = object.bucketCount !== undefined && object.bucketCount !== null ? BigInt(object.bucketCount.toString()) : BigInt(0); + message.bucketDuration = object.bucketDuration !== undefined && object.bucketDuration !== null ? BigInt(object.bucketDuration.toString()) : BigInt(0); + message.quoteDenoms = object.quoteDenoms?.map(e => e) || []; + message.tierInfos = object.tierInfos?.map(e => FeeDiscountTierInfo.fromPartial(e)) || []; + message.disqualifiedMarketIds = object.disqualifiedMarketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: FeeDiscountScheduleAmino): FeeDiscountSchedule { + const message = createBaseFeeDiscountSchedule(); + if (object.bucket_count !== undefined && object.bucket_count !== null) { + message.bucketCount = BigInt(object.bucket_count); + } + if (object.bucket_duration !== undefined && object.bucket_duration !== null) { + message.bucketDuration = BigInt(object.bucket_duration); + } + message.quoteDenoms = object.quote_denoms?.map(e => e) || []; + message.tierInfos = object.tier_infos?.map(e => FeeDiscountTierInfo.fromAmino(e)) || []; + message.disqualifiedMarketIds = object.disqualified_market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: FeeDiscountSchedule): FeeDiscountScheduleAmino { + const obj: any = {}; + obj.bucket_count = message.bucketCount !== BigInt(0) ? message.bucketCount?.toString() : undefined; + obj.bucket_duration = message.bucketDuration !== BigInt(0) ? message.bucketDuration?.toString() : undefined; + if (message.quoteDenoms) { + obj.quote_denoms = message.quoteDenoms.map(e => e); + } else { + obj.quote_denoms = message.quoteDenoms; + } + if (message.tierInfos) { + obj.tier_infos = message.tierInfos.map(e => e ? FeeDiscountTierInfo.toAmino(e) : undefined); + } else { + obj.tier_infos = message.tierInfos; + } + if (message.disqualifiedMarketIds) { + obj.disqualified_market_ids = message.disqualifiedMarketIds.map(e => e); + } else { + obj.disqualified_market_ids = message.disqualifiedMarketIds; + } + return obj; + }, + fromAminoMsg(object: FeeDiscountScheduleAminoMsg): FeeDiscountSchedule { + return FeeDiscountSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountScheduleProtoMsg): FeeDiscountSchedule { + return FeeDiscountSchedule.decode(message.value); + }, + toProto(message: FeeDiscountSchedule): Uint8Array { + return FeeDiscountSchedule.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountSchedule): FeeDiscountScheduleProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountSchedule", + value: FeeDiscountSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountSchedule.typeUrl, FeeDiscountSchedule); +function createBaseFeeDiscountTierTTL(): FeeDiscountTierTTL { + return { + tier: BigInt(0), + ttlTimestamp: BigInt(0) + }; +} +export const FeeDiscountTierTTL = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL", + is(o: any): o is FeeDiscountTierTTL { + return o && (o.$typeUrl === FeeDiscountTierTTL.typeUrl || typeof o.tier === "bigint" && typeof o.ttlTimestamp === "bigint"); + }, + isAmino(o: any): o is FeeDiscountTierTTLAmino { + return o && (o.$typeUrl === FeeDiscountTierTTL.typeUrl || typeof o.tier === "bigint" && typeof o.ttl_timestamp === "bigint"); + }, + encode(message: FeeDiscountTierTTL, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tier !== BigInt(0)) { + writer.uint32(8).uint64(message.tier); + } + if (message.ttlTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.ttlTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountTierTTL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountTierTTL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tier = reader.uint64(); + break; + case 2: + message.ttlTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountTierTTL { + const message = createBaseFeeDiscountTierTTL(); + message.tier = object.tier !== undefined && object.tier !== null ? BigInt(object.tier.toString()) : BigInt(0); + message.ttlTimestamp = object.ttlTimestamp !== undefined && object.ttlTimestamp !== null ? BigInt(object.ttlTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeeDiscountTierTTLAmino): FeeDiscountTierTTL { + const message = createBaseFeeDiscountTierTTL(); + if (object.tier !== undefined && object.tier !== null) { + message.tier = BigInt(object.tier); + } + if (object.ttl_timestamp !== undefined && object.ttl_timestamp !== null) { + message.ttlTimestamp = BigInt(object.ttl_timestamp); + } + return message; + }, + toAmino(message: FeeDiscountTierTTL): FeeDiscountTierTTLAmino { + const obj: any = {}; + obj.tier = message.tier !== BigInt(0) ? message.tier?.toString() : undefined; + obj.ttl_timestamp = message.ttlTimestamp !== BigInt(0) ? message.ttlTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountTierTTLAminoMsg): FeeDiscountTierTTL { + return FeeDiscountTierTTL.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountTierTTLProtoMsg): FeeDiscountTierTTL { + return FeeDiscountTierTTL.decode(message.value); + }, + toProto(message: FeeDiscountTierTTL): Uint8Array { + return FeeDiscountTierTTL.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountTierTTL): FeeDiscountTierTTLProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountTierTTL", + value: FeeDiscountTierTTL.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountTierTTL.typeUrl, FeeDiscountTierTTL); +function createBaseVolumeRecord(): VolumeRecord { + return { + makerVolume: "", + takerVolume: "" + }; +} +export const VolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord", + is(o: any): o is VolumeRecord { + return o && (o.$typeUrl === VolumeRecord.typeUrl || typeof o.makerVolume === "string" && typeof o.takerVolume === "string"); + }, + isAmino(o: any): o is VolumeRecordAmino { + return o && (o.$typeUrl === VolumeRecord.typeUrl || typeof o.maker_volume === "string" && typeof o.taker_volume === "string"); + }, + encode(message: VolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerVolume !== "") { + writer.uint32(10).string(message.makerVolume); + } + if (message.takerVolume !== "") { + writer.uint32(18).string(message.takerVolume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerVolume = reader.string(); + break; + case 2: + message.takerVolume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VolumeRecord { + const message = createBaseVolumeRecord(); + message.makerVolume = object.makerVolume ?? ""; + message.takerVolume = object.takerVolume ?? ""; + return message; + }, + fromAmino(object: VolumeRecordAmino): VolumeRecord { + const message = createBaseVolumeRecord(); + if (object.maker_volume !== undefined && object.maker_volume !== null) { + message.makerVolume = object.maker_volume; + } + if (object.taker_volume !== undefined && object.taker_volume !== null) { + message.takerVolume = object.taker_volume; + } + return message; + }, + toAmino(message: VolumeRecord): VolumeRecordAmino { + const obj: any = {}; + obj.maker_volume = message.makerVolume === "" ? undefined : message.makerVolume; + obj.taker_volume = message.takerVolume === "" ? undefined : message.takerVolume; + return obj; + }, + fromAminoMsg(object: VolumeRecordAminoMsg): VolumeRecord { + return VolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: VolumeRecordProtoMsg): VolumeRecord { + return VolumeRecord.decode(message.value); + }, + toProto(message: VolumeRecord): Uint8Array { + return VolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: VolumeRecord): VolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.VolumeRecord", + value: VolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VolumeRecord.typeUrl, VolumeRecord); +function createBaseAccountRewards(): AccountRewards { + return { + account: "", + rewards: [] + }; +} +export const AccountRewards = { + typeUrl: "/injective.exchange.v1beta1.AccountRewards", + is(o: any): o is AccountRewards { + return o && (o.$typeUrl === AccountRewards.typeUrl || typeof o.account === "string" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.is(o.rewards[0]))); + }, + isAmino(o: any): o is AccountRewardsAmino { + return o && (o.$typeUrl === AccountRewards.typeUrl || typeof o.account === "string" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.isAmino(o.rewards[0]))); + }, + encode(message: AccountRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.rewards) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.rewards.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccountRewards { + const message = createBaseAccountRewards(); + message.account = object.account ?? ""; + message.rewards = object.rewards?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AccountRewardsAmino): AccountRewards { + const message = createBaseAccountRewards(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.rewards = object.rewards?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: AccountRewards): AccountRewardsAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: AccountRewardsAminoMsg): AccountRewards { + return AccountRewards.fromAmino(object.value); + }, + fromProtoMsg(message: AccountRewardsProtoMsg): AccountRewards { + return AccountRewards.decode(message.value); + }, + toProto(message: AccountRewards): Uint8Array { + return AccountRewards.encode(message).finish(); + }, + toProtoMsg(message: AccountRewards): AccountRewardsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AccountRewards", + value: AccountRewards.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccountRewards.typeUrl, AccountRewards); +function createBaseTradeRecords(): TradeRecords { + return { + marketId: "", + latestTradeRecords: [] + }; +} +export const TradeRecords = { + typeUrl: "/injective.exchange.v1beta1.TradeRecords", + is(o: any): o is TradeRecords { + return o && (o.$typeUrl === TradeRecords.typeUrl || typeof o.marketId === "string" && Array.isArray(o.latestTradeRecords) && (!o.latestTradeRecords.length || TradeRecord.is(o.latestTradeRecords[0]))); + }, + isAmino(o: any): o is TradeRecordsAmino { + return o && (o.$typeUrl === TradeRecords.typeUrl || typeof o.market_id === "string" && Array.isArray(o.latest_trade_records) && (!o.latest_trade_records.length || TradeRecord.isAmino(o.latest_trade_records[0]))); + }, + encode(message: TradeRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.latestTradeRecords) { + TradeRecord.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeRecords { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeRecords(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.latestTradeRecords.push(TradeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeRecords { + const message = createBaseTradeRecords(); + message.marketId = object.marketId ?? ""; + message.latestTradeRecords = object.latestTradeRecords?.map(e => TradeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradeRecordsAmino): TradeRecords { + const message = createBaseTradeRecords(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.latestTradeRecords = object.latest_trade_records?.map(e => TradeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradeRecords): TradeRecordsAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.latestTradeRecords) { + obj.latest_trade_records = message.latestTradeRecords.map(e => e ? TradeRecord.toAmino(e) : undefined); + } else { + obj.latest_trade_records = message.latestTradeRecords; + } + return obj; + }, + fromAminoMsg(object: TradeRecordsAminoMsg): TradeRecords { + return TradeRecords.fromAmino(object.value); + }, + fromProtoMsg(message: TradeRecordsProtoMsg): TradeRecords { + return TradeRecords.decode(message.value); + }, + toProto(message: TradeRecords): Uint8Array { + return TradeRecords.encode(message).finish(); + }, + toProtoMsg(message: TradeRecords): TradeRecordsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeRecords", + value: TradeRecords.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeRecords.typeUrl, TradeRecords); +function createBaseSubaccountIDs(): SubaccountIDs { + return { + subaccountIds: [] + }; +} +export const SubaccountIDs = { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs", + is(o: any): o is SubaccountIDs { + return o && (o.$typeUrl === SubaccountIDs.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || o.subaccountIds[0] instanceof Uint8Array || typeof o.subaccountIds[0] === "string")); + }, + isAmino(o: any): o is SubaccountIDsAmino { + return o && (o.$typeUrl === SubaccountIDs.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || o.subaccount_ids[0] instanceof Uint8Array || typeof o.subaccount_ids[0] === "string")); + }, + encode(message: SubaccountIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountIDs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountIDs { + const message = createBaseSubaccountIDs(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + return message; + }, + fromAmino(object: SubaccountIDsAmino): SubaccountIDs { + const message = createBaseSubaccountIDs(); + message.subaccountIds = object.subaccount_ids?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: SubaccountIDs): SubaccountIDsAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => base64FromBytes(e)); + } else { + obj.subaccount_ids = message.subaccountIds; + } + return obj; + }, + fromAminoMsg(object: SubaccountIDsAminoMsg): SubaccountIDs { + return SubaccountIDs.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountIDsProtoMsg): SubaccountIDs { + return SubaccountIDs.decode(message.value); + }, + toProto(message: SubaccountIDs): Uint8Array { + return SubaccountIDs.encode(message).finish(); + }, + toProtoMsg(message: SubaccountIDs): SubaccountIDsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountIDs", + value: SubaccountIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountIDs.typeUrl, SubaccountIDs); +function createBaseTradeRecord(): TradeRecord { + return { + timestamp: BigInt(0), + price: "", + quantity: "" + }; +} +export const TradeRecord = { + typeUrl: "/injective.exchange.v1beta1.TradeRecord", + is(o: any): o is TradeRecord { + return o && (o.$typeUrl === TradeRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string" && typeof o.quantity === "string"); + }, + isAmino(o: any): o is TradeRecordAmino { + return o && (o.$typeUrl === TradeRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string" && typeof o.quantity === "string"); + }, + encode(message: TradeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).int64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(26).string(message.quantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.int64(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.quantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeRecord { + const message = createBaseTradeRecord(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + return message; + }, + fromAmino(object: TradeRecordAmino): TradeRecord { + const message = createBaseTradeRecord(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + return message; + }, + toAmino(message: TradeRecord): TradeRecordAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + return obj; + }, + fromAminoMsg(object: TradeRecordAminoMsg): TradeRecord { + return TradeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: TradeRecordProtoMsg): TradeRecord { + return TradeRecord.decode(message.value); + }, + toProto(message: TradeRecord): Uint8Array { + return TradeRecord.encode(message).finish(); + }, + toProtoMsg(message: TradeRecord): TradeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeRecord", + value: TradeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeRecord.typeUrl, TradeRecord); +function createBaseLevel(): Level { + return { + p: "", + q: "" + }; +} +export const Level = { + typeUrl: "/injective.exchange.v1beta1.Level", + is(o: any): o is Level { + return o && (o.$typeUrl === Level.typeUrl || typeof o.p === "string" && typeof o.q === "string"); + }, + isAmino(o: any): o is LevelAmino { + return o && (o.$typeUrl === Level.typeUrl || typeof o.p === "string" && typeof o.q === "string"); + }, + encode(message: Level, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.p !== "") { + writer.uint32(10).string(message.p); + } + if (message.q !== "") { + writer.uint32(18).string(message.q); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Level { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLevel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p = reader.string(); + break; + case 2: + message.q = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Level { + const message = createBaseLevel(); + message.p = object.p ?? ""; + message.q = object.q ?? ""; + return message; + }, + fromAmino(object: LevelAmino): Level { + const message = createBaseLevel(); + if (object.p !== undefined && object.p !== null) { + message.p = object.p; + } + if (object.q !== undefined && object.q !== null) { + message.q = object.q; + } + return message; + }, + toAmino(message: Level): LevelAmino { + const obj: any = {}; + obj.p = message.p === "" ? undefined : message.p; + obj.q = message.q === "" ? undefined : message.q; + return obj; + }, + fromAminoMsg(object: LevelAminoMsg): Level { + return Level.fromAmino(object.value); + }, + fromProtoMsg(message: LevelProtoMsg): Level { + return Level.decode(message.value); + }, + toProto(message: Level): Uint8Array { + return Level.encode(message).finish(); + }, + toProtoMsg(message: Level): LevelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Level", + value: Level.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Level.typeUrl, Level); +function createBaseAggregateSubaccountVolumeRecord(): AggregateSubaccountVolumeRecord { + return { + subaccountId: "", + marketVolumes: [] + }; +} +export const AggregateSubaccountVolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord", + is(o: any): o is AggregateSubaccountVolumeRecord { + return o && (o.$typeUrl === AggregateSubaccountVolumeRecord.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0]))); + }, + isAmino(o: any): o is AggregateSubaccountVolumeRecordAmino { + return o && (o.$typeUrl === AggregateSubaccountVolumeRecord.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0]))); + }, + encode(message: AggregateSubaccountVolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AggregateSubaccountVolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateSubaccountVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AggregateSubaccountVolumeRecord { + const message = createBaseAggregateSubaccountVolumeRecord(); + message.subaccountId = object.subaccountId ?? ""; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AggregateSubaccountVolumeRecordAmino): AggregateSubaccountVolumeRecord { + const message = createBaseAggregateSubaccountVolumeRecord(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: AggregateSubaccountVolumeRecord): AggregateSubaccountVolumeRecordAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + return obj; + }, + fromAminoMsg(object: AggregateSubaccountVolumeRecordAminoMsg): AggregateSubaccountVolumeRecord { + return AggregateSubaccountVolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateSubaccountVolumeRecordProtoMsg): AggregateSubaccountVolumeRecord { + return AggregateSubaccountVolumeRecord.decode(message.value); + }, + toProto(message: AggregateSubaccountVolumeRecord): Uint8Array { + return AggregateSubaccountVolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: AggregateSubaccountVolumeRecord): AggregateSubaccountVolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AggregateSubaccountVolumeRecord", + value: AggregateSubaccountVolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AggregateSubaccountVolumeRecord.typeUrl, AggregateSubaccountVolumeRecord); +function createBaseAggregateAccountVolumeRecord(): AggregateAccountVolumeRecord { + return { + account: "", + marketVolumes: [] + }; +} +export const AggregateAccountVolumeRecord = { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord", + is(o: any): o is AggregateAccountVolumeRecord { + return o && (o.$typeUrl === AggregateAccountVolumeRecord.typeUrl || typeof o.account === "string" && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0]))); + }, + isAmino(o: any): o is AggregateAccountVolumeRecordAmino { + return o && (o.$typeUrl === AggregateAccountVolumeRecord.typeUrl || typeof o.account === "string" && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0]))); + }, + encode(message: AggregateAccountVolumeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AggregateAccountVolumeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateAccountVolumeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AggregateAccountVolumeRecord { + const message = createBaseAggregateAccountVolumeRecord(); + message.account = object.account ?? ""; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AggregateAccountVolumeRecordAmino): AggregateAccountVolumeRecord { + const message = createBaseAggregateAccountVolumeRecord(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: AggregateAccountVolumeRecord): AggregateAccountVolumeRecordAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + return obj; + }, + fromAminoMsg(object: AggregateAccountVolumeRecordAminoMsg): AggregateAccountVolumeRecord { + return AggregateAccountVolumeRecord.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateAccountVolumeRecordProtoMsg): AggregateAccountVolumeRecord { + return AggregateAccountVolumeRecord.decode(message.value); + }, + toProto(message: AggregateAccountVolumeRecord): Uint8Array { + return AggregateAccountVolumeRecord.encode(message).finish(); + }, + toProtoMsg(message: AggregateAccountVolumeRecord): AggregateAccountVolumeRecordProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AggregateAccountVolumeRecord", + value: AggregateAccountVolumeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AggregateAccountVolumeRecord.typeUrl, AggregateAccountVolumeRecord); +function createBaseMarketVolume(): MarketVolume { + return { + marketId: "", + volume: VolumeRecord.fromPartial({}) + }; +} +export const MarketVolume = { + typeUrl: "/injective.exchange.v1beta1.MarketVolume", + is(o: any): o is MarketVolume { + return o && (o.$typeUrl === MarketVolume.typeUrl || typeof o.marketId === "string" && VolumeRecord.is(o.volume)); + }, + isAmino(o: any): o is MarketVolumeAmino { + return o && (o.$typeUrl === MarketVolume.typeUrl || typeof o.market_id === "string" && VolumeRecord.isAmino(o.volume)); + }, + encode(message: MarketVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.volume !== undefined) { + VolumeRecord.encode(message.volume, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.volume = VolumeRecord.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketVolume { + const message = createBaseMarketVolume(); + message.marketId = object.marketId ?? ""; + message.volume = object.volume !== undefined && object.volume !== null ? VolumeRecord.fromPartial(object.volume) : undefined; + return message; + }, + fromAmino(object: MarketVolumeAmino): MarketVolume { + const message = createBaseMarketVolume(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = VolumeRecord.fromAmino(object.volume); + } + return message; + }, + toAmino(message: MarketVolume): MarketVolumeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.volume = message.volume ? VolumeRecord.toAmino(message.volume) : undefined; + return obj; + }, + fromAminoMsg(object: MarketVolumeAminoMsg): MarketVolume { + return MarketVolume.fromAmino(object.value); + }, + fromProtoMsg(message: MarketVolumeProtoMsg): MarketVolume { + return MarketVolume.decode(message.value); + }, + toProto(message: MarketVolume): Uint8Array { + return MarketVolume.encode(message).finish(); + }, + toProtoMsg(message: MarketVolume): MarketVolumeProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketVolume", + value: MarketVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketVolume.typeUrl, MarketVolume); +function createBaseDenomDecimals(): DenomDecimals { + return { + denom: "", + decimals: BigInt(0) + }; +} +export const DenomDecimals = { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals", + is(o: any): o is DenomDecimals { + return o && (o.$typeUrl === DenomDecimals.typeUrl || typeof o.denom === "string" && typeof o.decimals === "bigint"); + }, + isAmino(o: any): o is DenomDecimalsAmino { + return o && (o.$typeUrl === DenomDecimals.typeUrl || typeof o.denom === "string" && typeof o.decimals === "bigint"); + }, + encode(message: DenomDecimals, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(16).uint64(message.decimals); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomDecimals { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomDecimals(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.decimals = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DenomDecimals { + const message = createBaseDenomDecimals(); + message.denom = object.denom ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DenomDecimalsAmino): DenomDecimals { + const message = createBaseDenomDecimals(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + return message; + }, + toAmino(message: DenomDecimals): DenomDecimalsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: DenomDecimalsAminoMsg): DenomDecimals { + return DenomDecimals.fromAmino(object.value); + }, + fromProtoMsg(message: DenomDecimalsProtoMsg): DenomDecimals { + return DenomDecimals.decode(message.value); + }, + toProto(message: DenomDecimals): Uint8Array { + return DenomDecimals.encode(message).finish(); + }, + toProtoMsg(message: DenomDecimals): DenomDecimalsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DenomDecimals", + value: DenomDecimals.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomDecimals.typeUrl, DenomDecimals); +function createBaseGrantAuthorization(): GrantAuthorization { + return { + grantee: "", + amount: "" + }; +} +export const GrantAuthorization = { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization", + is(o: any): o is GrantAuthorization { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.grantee === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is GrantAuthorizationAmino { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.grantee === "string" && typeof o.amount === "string"); + }, + encode(message: GrantAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantAuthorization { + const message = createBaseGrantAuthorization(); + message.grantee = object.grantee ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + const message = createBaseGrantAuthorization(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: GrantAuthorization): GrantAuthorizationAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { + return GrantAuthorization.fromAmino(object.value); + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value); + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.GrantAuthorization", + value: GrantAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantAuthorization.typeUrl, GrantAuthorization); +function createBaseActiveGrant(): ActiveGrant { + return { + granter: "", + amount: "" + }; +} +export const ActiveGrant = { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant", + is(o: any): o is ActiveGrant { + return o && (o.$typeUrl === ActiveGrant.typeUrl || typeof o.granter === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is ActiveGrantAmino { + return o && (o.$typeUrl === ActiveGrant.typeUrl || typeof o.granter === "string" && typeof o.amount === "string"); + }, + encode(message: ActiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ActiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ActiveGrant { + const message = createBaseActiveGrant(); + message.granter = object.granter ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: ActiveGrantAmino): ActiveGrant { + const message = createBaseActiveGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: ActiveGrant): ActiveGrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: ActiveGrantAminoMsg): ActiveGrant { + return ActiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: ActiveGrantProtoMsg): ActiveGrant { + return ActiveGrant.decode(message.value); + }, + toProto(message: ActiveGrant): Uint8Array { + return ActiveGrant.encode(message).finish(); + }, + toProtoMsg(message: ActiveGrant): ActiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ActiveGrant", + value: ActiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ActiveGrant.typeUrl, ActiveGrant); +function createBaseEffectiveGrant(): EffectiveGrant { + return { + granter: "", + netGrantedStake: "", + isValid: false + }; +} +export const EffectiveGrant = { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant", + is(o: any): o is EffectiveGrant { + return o && (o.$typeUrl === EffectiveGrant.typeUrl || typeof o.granter === "string" && typeof o.netGrantedStake === "string" && typeof o.isValid === "boolean"); + }, + isAmino(o: any): o is EffectiveGrantAmino { + return o && (o.$typeUrl === EffectiveGrant.typeUrl || typeof o.granter === "string" && typeof o.net_granted_stake === "string" && typeof o.is_valid === "boolean"); + }, + encode(message: EffectiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.netGrantedStake !== "") { + writer.uint32(18).string(message.netGrantedStake); + } + if (message.isValid === true) { + writer.uint32(24).bool(message.isValid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EffectiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEffectiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.netGrantedStake = reader.string(); + break; + case 3: + message.isValid = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EffectiveGrant { + const message = createBaseEffectiveGrant(); + message.granter = object.granter ?? ""; + message.netGrantedStake = object.netGrantedStake ?? ""; + message.isValid = object.isValid ?? false; + return message; + }, + fromAmino(object: EffectiveGrantAmino): EffectiveGrant { + const message = createBaseEffectiveGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.net_granted_stake !== undefined && object.net_granted_stake !== null) { + message.netGrantedStake = object.net_granted_stake; + } + if (object.is_valid !== undefined && object.is_valid !== null) { + message.isValid = object.is_valid; + } + return message; + }, + toAmino(message: EffectiveGrant): EffectiveGrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.net_granted_stake = message.netGrantedStake === "" ? undefined : message.netGrantedStake; + obj.is_valid = message.isValid === false ? undefined : message.isValid; + return obj; + }, + fromAminoMsg(object: EffectiveGrantAminoMsg): EffectiveGrant { + return EffectiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: EffectiveGrantProtoMsg): EffectiveGrant { + return EffectiveGrant.decode(message.value); + }, + toProto(message: EffectiveGrant): Uint8Array { + return EffectiveGrant.encode(message).finish(); + }, + toProtoMsg(message: EffectiveGrant): EffectiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EffectiveGrant", + value: EffectiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EffectiveGrant.typeUrl, EffectiveGrant); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/genesis.ts b/libs/injectivejs/src/injective/exchange/v1beta1/genesis.ts new file mode 100644 index 00000000..9e4a2e86 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/genesis.ts @@ -0,0 +1,2460 @@ +import { Params, ParamsAmino, SpotMarket, SpotMarketAmino, DerivativeMarket, DerivativeMarketAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, DerivativeMarketSettlementInfo, DerivativeMarketSettlementInfoAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradeRecords, TradeRecordsAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, DenomDecimals, DenomDecimalsAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino, AggregateSubaccountVolumeRecord, AggregateSubaccountVolumeRecordAmino, MarketVolume, MarketVolumeAmino, FeeDiscountTierTTL, FeeDiscountTierTTLAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, DerivativeMarketOrder, DerivativeMarketOrderAmino, Deposit, DepositAmino, Position, PositionAmino, SubaccountTradeNonce, SubaccountTradeNonceAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, GrantAuthorization, GrantAuthorizationAmino, ActiveGrant, ActiveGrantAmino } from "./exchange"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the exchange module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to exchange. */ + params: Params; + /** spot_markets is an array containing the genesis trade pairs */ + spotMarkets: SpotMarket[]; + /** derivative_markets is an array containing the genesis derivative markets */ + derivativeMarkets: DerivativeMarket[]; + /** spot_orderbook defines the spot exchange limit orderbook active at genesis. */ + spotOrderbook: SpotOrderBook[]; + /** + * derivative_orderbook defines the derivative exchange limit orderbook active + * at genesis. + */ + derivativeOrderbook: DerivativeOrderBook[]; + /** balances defines the exchange users balances active at genesis. */ + balances: Balance[]; + /** positions defines the exchange derivative positions at genesis */ + positions: DerivativePosition[]; + /** + * subaccount_trade_nonces defines the subaccount trade nonces for the + * subaccounts at genesis + */ + subaccountTradeNonces: SubaccountNonce[]; + /** + * expiry_futures_market_info defines the market info for the expiry futures + * markets at genesis + */ + expiryFuturesMarketInfoState: ExpiryFuturesMarketInfoState[]; + /** + * perpetual_market_info defines the market info for the perpetual derivative + * markets at genesis + */ + perpetualMarketInfo: PerpetualMarketInfo[]; + /** + * perpetual_market_funding_state defines the funding state for the perpetual + * derivative markets at genesis + */ + perpetualMarketFundingState: PerpetualMarketFundingState[]; + derivativeMarketSettlementScheduled: DerivativeMarketSettlementInfo[]; + /** sets spot markets as enabled */ + isSpotExchangeEnabled: boolean; + /** sets derivative markets as enabled */ + isDerivativesExchangeEnabled: boolean; + /** the current trading reward campaign info */ + tradingRewardCampaignInfo?: TradingRewardCampaignInfo; + /** the current and upcoming trading reward campaign pools */ + tradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + tradingRewardCampaignAccountPoints: TradingRewardCampaignAccountPoints[]; + /** the fee discount schedule */ + feeDiscountSchedule?: FeeDiscountSchedule; + /** the cached fee discount account tiers with TTL */ + feeDiscountAccountTierTtl: FeeDiscountAccountTierTTL[]; + feeDiscountBucketVolumeAccounts: FeeDiscountBucketVolumeAccounts[]; + /** sets the first fee cycle as finished */ + isFirstFeeCycleFinished: boolean; + pendingTradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + pendingTradingRewardCampaignAccountPoints: TradingRewardCampaignAccountPendingPoints[]; + /** the addresses opting out of trading rewards */ + rewardsOptOutAddresses: string[]; + historicalTradeRecords: TradeRecords[]; + /** + * binary_options_markets is an array containing the genesis binary options + * markets + */ + binaryOptionsMarkets: BinaryOptionsMarket[]; + /** + * binary_options_markets_scheduled_for_settlement contains the marketIDs of + * binary options markets scheduled for next-block settlement + */ + binaryOptionsMarketIdsScheduledForSettlement: string[]; + /** + * spot_market_ids_scheduled_to_force_close defines the scheduled markets for + * forced closings at genesis + */ + spotMarketIdsScheduledToForceClose: string[]; + /** denom_decimals defines the denom decimals for the exchange. */ + denomDecimals: DenomDecimals[]; + conditionalDerivativeOrderbooks: ConditionalDerivativeOrderBook[]; + /** + * market_fee_multipliers contains any non-default atomic order fee + * multipliers + */ + marketFeeMultipliers: MarketFeeMultiplier[]; + orderbookSequences: OrderbookSequence[]; + subaccountVolumes: AggregateSubaccountVolumeRecord[]; + marketVolumes: MarketVolume[]; + grantAuthorizations: FullGrantAuthorizations[]; + activeGrants: FullActiveGrant[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the exchange module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to exchange. */ + params: ParamsAmino; + /** spot_markets is an array containing the genesis trade pairs */ + spot_markets: SpotMarketAmino[]; + /** derivative_markets is an array containing the genesis derivative markets */ + derivative_markets: DerivativeMarketAmino[]; + /** spot_orderbook defines the spot exchange limit orderbook active at genesis. */ + spot_orderbook: SpotOrderBookAmino[]; + /** + * derivative_orderbook defines the derivative exchange limit orderbook active + * at genesis. + */ + derivative_orderbook: DerivativeOrderBookAmino[]; + /** balances defines the exchange users balances active at genesis. */ + balances: BalanceAmino[]; + /** positions defines the exchange derivative positions at genesis */ + positions: DerivativePositionAmino[]; + /** + * subaccount_trade_nonces defines the subaccount trade nonces for the + * subaccounts at genesis + */ + subaccount_trade_nonces: SubaccountNonceAmino[]; + /** + * expiry_futures_market_info defines the market info for the expiry futures + * markets at genesis + */ + expiry_futures_market_info_state: ExpiryFuturesMarketInfoStateAmino[]; + /** + * perpetual_market_info defines the market info for the perpetual derivative + * markets at genesis + */ + perpetual_market_info: PerpetualMarketInfoAmino[]; + /** + * perpetual_market_funding_state defines the funding state for the perpetual + * derivative markets at genesis + */ + perpetual_market_funding_state: PerpetualMarketFundingStateAmino[]; + derivative_market_settlement_scheduled: DerivativeMarketSettlementInfoAmino[]; + /** sets spot markets as enabled */ + is_spot_exchange_enabled: boolean; + /** sets derivative markets as enabled */ + is_derivatives_exchange_enabled: boolean; + /** the current trading reward campaign info */ + trading_reward_campaign_info?: TradingRewardCampaignInfoAmino; + /** the current and upcoming trading reward campaign pools */ + trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + trading_reward_campaign_account_points: TradingRewardCampaignAccountPointsAmino[]; + /** the fee discount schedule */ + fee_discount_schedule?: FeeDiscountScheduleAmino; + /** the cached fee discount account tiers with TTL */ + fee_discount_account_tier_ttl: FeeDiscountAccountTierTTLAmino[]; + fee_discount_bucket_volume_accounts: FeeDiscountBucketVolumeAccountsAmino[]; + /** sets the first fee cycle as finished */ + is_first_fee_cycle_finished: boolean; + pending_trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + pending_trading_reward_campaign_account_points: TradingRewardCampaignAccountPendingPointsAmino[]; + /** the addresses opting out of trading rewards */ + rewards_opt_out_addresses: string[]; + historical_trade_records: TradeRecordsAmino[]; + /** + * binary_options_markets is an array containing the genesis binary options + * markets + */ + binary_options_markets: BinaryOptionsMarketAmino[]; + /** + * binary_options_markets_scheduled_for_settlement contains the marketIDs of + * binary options markets scheduled for next-block settlement + */ + binary_options_market_ids_scheduled_for_settlement: string[]; + /** + * spot_market_ids_scheduled_to_force_close defines the scheduled markets for + * forced closings at genesis + */ + spot_market_ids_scheduled_to_force_close: string[]; + /** denom_decimals defines the denom decimals for the exchange. */ + denom_decimals: DenomDecimalsAmino[]; + conditional_derivative_orderbooks: ConditionalDerivativeOrderBookAmino[]; + /** + * market_fee_multipliers contains any non-default atomic order fee + * multipliers + */ + market_fee_multipliers: MarketFeeMultiplierAmino[]; + orderbook_sequences: OrderbookSequenceAmino[]; + subaccount_volumes: AggregateSubaccountVolumeRecordAmino[]; + market_volumes: MarketVolumeAmino[]; + grant_authorizations: FullGrantAuthorizationsAmino[]; + active_grants: FullActiveGrantAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.exchange.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface OrderbookSequence { + sequence: bigint; + marketId: string; +} +export interface OrderbookSequenceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence"; + value: Uint8Array; +} +export interface OrderbookSequenceAmino { + sequence: string; + market_id: string; +} +export interface OrderbookSequenceAminoMsg { + type: "/injective.exchange.v1beta1.OrderbookSequence"; + value: OrderbookSequenceAmino; +} +export interface FeeDiscountAccountTierTTL { + account: string; + tierTtl?: FeeDiscountTierTTL; +} +export interface FeeDiscountAccountTierTTLProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL"; + value: Uint8Array; +} +export interface FeeDiscountAccountTierTTLAmino { + account: string; + tier_ttl?: FeeDiscountTierTTLAmino; +} +export interface FeeDiscountAccountTierTTLAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL"; + value: FeeDiscountAccountTierTTLAmino; +} +export interface FeeDiscountBucketVolumeAccounts { + bucketStartTimestamp: bigint; + accountVolume: AccountVolume[]; +} +export interface FeeDiscountBucketVolumeAccountsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts"; + value: Uint8Array; +} +export interface FeeDiscountBucketVolumeAccountsAmino { + bucket_start_timestamp: string; + account_volume: AccountVolumeAmino[]; +} +export interface FeeDiscountBucketVolumeAccountsAminoMsg { + type: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts"; + value: FeeDiscountBucketVolumeAccountsAmino; +} +export interface AccountVolume { + account: string; + volume: string; +} +export interface AccountVolumeProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AccountVolume"; + value: Uint8Array; +} +export interface AccountVolumeAmino { + account: string; + volume: string; +} +export interface AccountVolumeAminoMsg { + type: "/injective.exchange.v1beta1.AccountVolume"; + value: AccountVolumeAmino; +} +export interface TradingRewardCampaignAccountPoints { + account: string; + points: string; +} +export interface TradingRewardCampaignAccountPointsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints"; + value: Uint8Array; +} +export interface TradingRewardCampaignAccountPointsAmino { + account: string; + points: string; +} +export interface TradingRewardCampaignAccountPointsAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints"; + value: TradingRewardCampaignAccountPointsAmino; +} +export interface TradingRewardCampaignAccountPendingPoints { + rewardPoolStartTimestamp: bigint; + accountPoints: TradingRewardCampaignAccountPoints[]; +} +export interface TradingRewardCampaignAccountPendingPointsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints"; + value: Uint8Array; +} +export interface TradingRewardCampaignAccountPendingPointsAmino { + reward_pool_start_timestamp: string; + account_points: TradingRewardCampaignAccountPointsAmino[]; +} +export interface TradingRewardCampaignAccountPendingPointsAminoMsg { + type: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints"; + value: TradingRewardCampaignAccountPendingPointsAmino; +} +/** Spot Exchange Limit Orderbook */ +export interface SpotOrderBook { + marketId: string; + isBuySide: boolean; + orders: SpotLimitOrder[]; +} +export interface SpotOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook"; + value: Uint8Array; +} +/** Spot Exchange Limit Orderbook */ +export interface SpotOrderBookAmino { + market_id: string; + isBuySide: boolean; + orders: SpotLimitOrderAmino[]; +} +export interface SpotOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.SpotOrderBook"; + value: SpotOrderBookAmino; +} +/** Derivative Exchange Limit Orderbook */ +export interface DerivativeOrderBook { + marketId: string; + isBuySide: boolean; + orders: DerivativeLimitOrder[]; +} +export interface DerivativeOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook"; + value: Uint8Array; +} +/** Derivative Exchange Limit Orderbook */ +export interface DerivativeOrderBookAmino { + market_id: string; + isBuySide: boolean; + orders: DerivativeLimitOrderAmino[]; +} +export interface DerivativeOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeOrderBook"; + value: DerivativeOrderBookAmino; +} +/** Orderbook containing limit & market conditional orders */ +export interface ConditionalDerivativeOrderBook { + marketId: string; + limitBuyOrders: DerivativeLimitOrder[]; + marketBuyOrders: DerivativeMarketOrder[]; + limitSellOrders: DerivativeLimitOrder[]; + marketSellOrders: DerivativeMarketOrder[]; +} +export interface ConditionalDerivativeOrderBookProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook"; + value: Uint8Array; +} +/** Orderbook containing limit & market conditional orders */ +export interface ConditionalDerivativeOrderBookAmino { + market_id: string; + limit_buy_orders: DerivativeLimitOrderAmino[]; + market_buy_orders: DerivativeMarketOrderAmino[]; + limit_sell_orders: DerivativeLimitOrderAmino[]; + market_sell_orders: DerivativeMarketOrderAmino[]; +} +export interface ConditionalDerivativeOrderBookAminoMsg { + type: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook"; + value: ConditionalDerivativeOrderBookAmino; +} +export interface Balance { + subaccountId: string; + denom: string; + deposits?: Deposit; +} +export interface BalanceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Balance"; + value: Uint8Array; +} +export interface BalanceAmino { + subaccount_id: string; + denom: string; + deposits?: DepositAmino; +} +export interface BalanceAminoMsg { + type: "/injective.exchange.v1beta1.Balance"; + value: BalanceAmino; +} +export interface DerivativePosition { + subaccountId: string; + marketId: string; + position?: Position; +} +export interface DerivativePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition"; + value: Uint8Array; +} +export interface DerivativePositionAmino { + subaccount_id: string; + market_id: string; + position?: PositionAmino; +} +export interface DerivativePositionAminoMsg { + type: "/injective.exchange.v1beta1.DerivativePosition"; + value: DerivativePositionAmino; +} +export interface SubaccountNonce { + subaccountId: string; + subaccountTradeNonce: SubaccountTradeNonce; +} +export interface SubaccountNonceProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce"; + value: Uint8Array; +} +export interface SubaccountNonceAmino { + subaccount_id: string; + subaccount_trade_nonce: SubaccountTradeNonceAmino; +} +export interface SubaccountNonceAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountNonce"; + value: SubaccountNonceAmino; +} +export interface ExpiryFuturesMarketInfoState { + marketId: string; + marketInfo?: ExpiryFuturesMarketInfo; +} +export interface ExpiryFuturesMarketInfoStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState"; + value: Uint8Array; +} +export interface ExpiryFuturesMarketInfoStateAmino { + market_id: string; + market_info?: ExpiryFuturesMarketInfoAmino; +} +export interface ExpiryFuturesMarketInfoStateAminoMsg { + type: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState"; + value: ExpiryFuturesMarketInfoStateAmino; +} +export interface PerpetualMarketFundingState { + marketId: string; + funding?: PerpetualMarketFunding; +} +export interface PerpetualMarketFundingStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState"; + value: Uint8Array; +} +export interface PerpetualMarketFundingStateAmino { + market_id: string; + funding?: PerpetualMarketFundingAmino; +} +export interface PerpetualMarketFundingStateAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketFundingState"; + value: PerpetualMarketFundingStateAmino; +} +export interface FullGrantAuthorizations { + granter: string; + totalGrantAmount: string; + lastDelegationsCheckedTime: bigint; + grants: GrantAuthorization[]; +} +export interface FullGrantAuthorizationsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations"; + value: Uint8Array; +} +export interface FullGrantAuthorizationsAmino { + granter: string; + total_grant_amount: string; + last_delegations_checked_time: string; + grants: GrantAuthorizationAmino[]; +} +export interface FullGrantAuthorizationsAminoMsg { + type: "/injective.exchange.v1beta1.FullGrantAuthorizations"; + value: FullGrantAuthorizationsAmino; +} +export interface FullActiveGrant { + grantee: string; + activeGrant?: ActiveGrant; +} +export interface FullActiveGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant"; + value: Uint8Array; +} +export interface FullActiveGrantAmino { + grantee: string; + active_grant?: ActiveGrantAmino; +} +export interface FullActiveGrantAminoMsg { + type: "/injective.exchange.v1beta1.FullActiveGrant"; + value: FullActiveGrantAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + spotMarkets: [], + derivativeMarkets: [], + spotOrderbook: [], + derivativeOrderbook: [], + balances: [], + positions: [], + subaccountTradeNonces: [], + expiryFuturesMarketInfoState: [], + perpetualMarketInfo: [], + perpetualMarketFundingState: [], + derivativeMarketSettlementScheduled: [], + isSpotExchangeEnabled: false, + isDerivativesExchangeEnabled: false, + tradingRewardCampaignInfo: undefined, + tradingRewardPoolCampaignSchedule: [], + tradingRewardCampaignAccountPoints: [], + feeDiscountSchedule: undefined, + feeDiscountAccountTierTtl: [], + feeDiscountBucketVolumeAccounts: [], + isFirstFeeCycleFinished: false, + pendingTradingRewardPoolCampaignSchedule: [], + pendingTradingRewardCampaignAccountPoints: [], + rewardsOptOutAddresses: [], + historicalTradeRecords: [], + binaryOptionsMarkets: [], + binaryOptionsMarketIdsScheduledForSettlement: [], + spotMarketIdsScheduledToForceClose: [], + denomDecimals: [], + conditionalDerivativeOrderbooks: [], + marketFeeMultipliers: [], + orderbookSequences: [], + subaccountVolumes: [], + marketVolumes: [], + grantAuthorizations: [], + activeGrants: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.exchange.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.spotMarkets) && (!o.spotMarkets.length || SpotMarket.is(o.spotMarkets[0])) && Array.isArray(o.derivativeMarkets) && (!o.derivativeMarkets.length || DerivativeMarket.is(o.derivativeMarkets[0])) && Array.isArray(o.spotOrderbook) && (!o.spotOrderbook.length || SpotOrderBook.is(o.spotOrderbook[0])) && Array.isArray(o.derivativeOrderbook) && (!o.derivativeOrderbook.length || DerivativeOrderBook.is(o.derivativeOrderbook[0])) && Array.isArray(o.balances) && (!o.balances.length || Balance.is(o.balances[0])) && Array.isArray(o.positions) && (!o.positions.length || DerivativePosition.is(o.positions[0])) && Array.isArray(o.subaccountTradeNonces) && (!o.subaccountTradeNonces.length || SubaccountNonce.is(o.subaccountTradeNonces[0])) && Array.isArray(o.expiryFuturesMarketInfoState) && (!o.expiryFuturesMarketInfoState.length || ExpiryFuturesMarketInfoState.is(o.expiryFuturesMarketInfoState[0])) && Array.isArray(o.perpetualMarketInfo) && (!o.perpetualMarketInfo.length || PerpetualMarketInfo.is(o.perpetualMarketInfo[0])) && Array.isArray(o.perpetualMarketFundingState) && (!o.perpetualMarketFundingState.length || PerpetualMarketFundingState.is(o.perpetualMarketFundingState[0])) && Array.isArray(o.derivativeMarketSettlementScheduled) && (!o.derivativeMarketSettlementScheduled.length || DerivativeMarketSettlementInfo.is(o.derivativeMarketSettlementScheduled[0])) && typeof o.isSpotExchangeEnabled === "boolean" && typeof o.isDerivativesExchangeEnabled === "boolean" && Array.isArray(o.tradingRewardPoolCampaignSchedule) && (!o.tradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.tradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.tradingRewardCampaignAccountPoints) && (!o.tradingRewardCampaignAccountPoints.length || TradingRewardCampaignAccountPoints.is(o.tradingRewardCampaignAccountPoints[0])) && Array.isArray(o.feeDiscountAccountTierTtl) && (!o.feeDiscountAccountTierTtl.length || FeeDiscountAccountTierTTL.is(o.feeDiscountAccountTierTtl[0])) && Array.isArray(o.feeDiscountBucketVolumeAccounts) && (!o.feeDiscountBucketVolumeAccounts.length || FeeDiscountBucketVolumeAccounts.is(o.feeDiscountBucketVolumeAccounts[0])) && typeof o.isFirstFeeCycleFinished === "boolean" && Array.isArray(o.pendingTradingRewardPoolCampaignSchedule) && (!o.pendingTradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.pendingTradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.pendingTradingRewardCampaignAccountPoints) && (!o.pendingTradingRewardCampaignAccountPoints.length || TradingRewardCampaignAccountPendingPoints.is(o.pendingTradingRewardCampaignAccountPoints[0])) && Array.isArray(o.rewardsOptOutAddresses) && (!o.rewardsOptOutAddresses.length || typeof o.rewardsOptOutAddresses[0] === "string") && Array.isArray(o.historicalTradeRecords) && (!o.historicalTradeRecords.length || TradeRecords.is(o.historicalTradeRecords[0])) && Array.isArray(o.binaryOptionsMarkets) && (!o.binaryOptionsMarkets.length || BinaryOptionsMarket.is(o.binaryOptionsMarkets[0])) && Array.isArray(o.binaryOptionsMarketIdsScheduledForSettlement) && (!o.binaryOptionsMarketIdsScheduledForSettlement.length || typeof o.binaryOptionsMarketIdsScheduledForSettlement[0] === "string") && Array.isArray(o.spotMarketIdsScheduledToForceClose) && (!o.spotMarketIdsScheduledToForceClose.length || typeof o.spotMarketIdsScheduledToForceClose[0] === "string") && Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0])) && Array.isArray(o.conditionalDerivativeOrderbooks) && (!o.conditionalDerivativeOrderbooks.length || ConditionalDerivativeOrderBook.is(o.conditionalDerivativeOrderbooks[0])) && Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0])) && Array.isArray(o.orderbookSequences) && (!o.orderbookSequences.length || OrderbookSequence.is(o.orderbookSequences[0])) && Array.isArray(o.subaccountVolumes) && (!o.subaccountVolumes.length || AggregateSubaccountVolumeRecord.is(o.subaccountVolumes[0])) && Array.isArray(o.marketVolumes) && (!o.marketVolumes.length || MarketVolume.is(o.marketVolumes[0])) && Array.isArray(o.grantAuthorizations) && (!o.grantAuthorizations.length || FullGrantAuthorizations.is(o.grantAuthorizations[0])) && Array.isArray(o.activeGrants) && (!o.activeGrants.length || FullActiveGrant.is(o.activeGrants[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.spot_markets) && (!o.spot_markets.length || SpotMarket.isAmino(o.spot_markets[0])) && Array.isArray(o.derivative_markets) && (!o.derivative_markets.length || DerivativeMarket.isAmino(o.derivative_markets[0])) && Array.isArray(o.spot_orderbook) && (!o.spot_orderbook.length || SpotOrderBook.isAmino(o.spot_orderbook[0])) && Array.isArray(o.derivative_orderbook) && (!o.derivative_orderbook.length || DerivativeOrderBook.isAmino(o.derivative_orderbook[0])) && Array.isArray(o.balances) && (!o.balances.length || Balance.isAmino(o.balances[0])) && Array.isArray(o.positions) && (!o.positions.length || DerivativePosition.isAmino(o.positions[0])) && Array.isArray(o.subaccount_trade_nonces) && (!o.subaccount_trade_nonces.length || SubaccountNonce.isAmino(o.subaccount_trade_nonces[0])) && Array.isArray(o.expiry_futures_market_info_state) && (!o.expiry_futures_market_info_state.length || ExpiryFuturesMarketInfoState.isAmino(o.expiry_futures_market_info_state[0])) && Array.isArray(o.perpetual_market_info) && (!o.perpetual_market_info.length || PerpetualMarketInfo.isAmino(o.perpetual_market_info[0])) && Array.isArray(o.perpetual_market_funding_state) && (!o.perpetual_market_funding_state.length || PerpetualMarketFundingState.isAmino(o.perpetual_market_funding_state[0])) && Array.isArray(o.derivative_market_settlement_scheduled) && (!o.derivative_market_settlement_scheduled.length || DerivativeMarketSettlementInfo.isAmino(o.derivative_market_settlement_scheduled[0])) && typeof o.is_spot_exchange_enabled === "boolean" && typeof o.is_derivatives_exchange_enabled === "boolean" && Array.isArray(o.trading_reward_pool_campaign_schedule) && (!o.trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.trading_reward_campaign_account_points) && (!o.trading_reward_campaign_account_points.length || TradingRewardCampaignAccountPoints.isAmino(o.trading_reward_campaign_account_points[0])) && Array.isArray(o.fee_discount_account_tier_ttl) && (!o.fee_discount_account_tier_ttl.length || FeeDiscountAccountTierTTL.isAmino(o.fee_discount_account_tier_ttl[0])) && Array.isArray(o.fee_discount_bucket_volume_accounts) && (!o.fee_discount_bucket_volume_accounts.length || FeeDiscountBucketVolumeAccounts.isAmino(o.fee_discount_bucket_volume_accounts[0])) && typeof o.is_first_fee_cycle_finished === "boolean" && Array.isArray(o.pending_trading_reward_pool_campaign_schedule) && (!o.pending_trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.pending_trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.pending_trading_reward_campaign_account_points) && (!o.pending_trading_reward_campaign_account_points.length || TradingRewardCampaignAccountPendingPoints.isAmino(o.pending_trading_reward_campaign_account_points[0])) && Array.isArray(o.rewards_opt_out_addresses) && (!o.rewards_opt_out_addresses.length || typeof o.rewards_opt_out_addresses[0] === "string") && Array.isArray(o.historical_trade_records) && (!o.historical_trade_records.length || TradeRecords.isAmino(o.historical_trade_records[0])) && Array.isArray(o.binary_options_markets) && (!o.binary_options_markets.length || BinaryOptionsMarket.isAmino(o.binary_options_markets[0])) && Array.isArray(o.binary_options_market_ids_scheduled_for_settlement) && (!o.binary_options_market_ids_scheduled_for_settlement.length || typeof o.binary_options_market_ids_scheduled_for_settlement[0] === "string") && Array.isArray(o.spot_market_ids_scheduled_to_force_close) && (!o.spot_market_ids_scheduled_to_force_close.length || typeof o.spot_market_ids_scheduled_to_force_close[0] === "string") && Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0])) && Array.isArray(o.conditional_derivative_orderbooks) && (!o.conditional_derivative_orderbooks.length || ConditionalDerivativeOrderBook.isAmino(o.conditional_derivative_orderbooks[0])) && Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0])) && Array.isArray(o.orderbook_sequences) && (!o.orderbook_sequences.length || OrderbookSequence.isAmino(o.orderbook_sequences[0])) && Array.isArray(o.subaccount_volumes) && (!o.subaccount_volumes.length || AggregateSubaccountVolumeRecord.isAmino(o.subaccount_volumes[0])) && Array.isArray(o.market_volumes) && (!o.market_volumes.length || MarketVolume.isAmino(o.market_volumes[0])) && Array.isArray(o.grant_authorizations) && (!o.grant_authorizations.length || FullGrantAuthorizations.isAmino(o.grant_authorizations[0])) && Array.isArray(o.active_grants) && (!o.active_grants.length || FullActiveGrant.isAmino(o.active_grants[0]))); + }, + 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.spotMarkets) { + SpotMarket.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.derivativeMarkets) { + DerivativeMarket.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.spotOrderbook) { + SpotOrderBook.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.derivativeOrderbook) { + DerivativeOrderBook.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.positions) { + DerivativePosition.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.subaccountTradeNonces) { + SubaccountNonce.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.expiryFuturesMarketInfoState) { + ExpiryFuturesMarketInfoState.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.perpetualMarketInfo) { + PerpetualMarketInfo.encode(v!, writer.uint32(82).fork()).ldelim(); + } + for (const v of message.perpetualMarketFundingState) { + PerpetualMarketFundingState.encode(v!, writer.uint32(90).fork()).ldelim(); + } + for (const v of message.derivativeMarketSettlementScheduled) { + DerivativeMarketSettlementInfo.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.isSpotExchangeEnabled === true) { + writer.uint32(104).bool(message.isSpotExchangeEnabled); + } + if (message.isDerivativesExchangeEnabled === true) { + writer.uint32(112).bool(message.isDerivativesExchangeEnabled); + } + if (message.tradingRewardCampaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.tradingRewardCampaignInfo, writer.uint32(122).fork()).ldelim(); + } + for (const v of message.tradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(130).fork()).ldelim(); + } + for (const v of message.tradingRewardCampaignAccountPoints) { + TradingRewardCampaignAccountPoints.encode(v!, writer.uint32(138).fork()).ldelim(); + } + if (message.feeDiscountSchedule !== undefined) { + FeeDiscountSchedule.encode(message.feeDiscountSchedule, writer.uint32(146).fork()).ldelim(); + } + for (const v of message.feeDiscountAccountTierTtl) { + FeeDiscountAccountTierTTL.encode(v!, writer.uint32(154).fork()).ldelim(); + } + for (const v of message.feeDiscountBucketVolumeAccounts) { + FeeDiscountBucketVolumeAccounts.encode(v!, writer.uint32(162).fork()).ldelim(); + } + if (message.isFirstFeeCycleFinished === true) { + writer.uint32(168).bool(message.isFirstFeeCycleFinished); + } + for (const v of message.pendingTradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(178).fork()).ldelim(); + } + for (const v of message.pendingTradingRewardCampaignAccountPoints) { + TradingRewardCampaignAccountPendingPoints.encode(v!, writer.uint32(186).fork()).ldelim(); + } + for (const v of message.rewardsOptOutAddresses) { + writer.uint32(194).string(v!); + } + for (const v of message.historicalTradeRecords) { + TradeRecords.encode(v!, writer.uint32(202).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarkets) { + BinaryOptionsMarket.encode(v!, writer.uint32(210).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketIdsScheduledForSettlement) { + writer.uint32(218).string(v!); + } + for (const v of message.spotMarketIdsScheduledToForceClose) { + writer.uint32(226).string(v!); + } + for (const v of message.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(234).fork()).ldelim(); + } + for (const v of message.conditionalDerivativeOrderbooks) { + ConditionalDerivativeOrderBook.encode(v!, writer.uint32(242).fork()).ldelim(); + } + for (const v of message.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(250).fork()).ldelim(); + } + for (const v of message.orderbookSequences) { + OrderbookSequence.encode(v!, writer.uint32(258).fork()).ldelim(); + } + for (const v of message.subaccountVolumes) { + AggregateSubaccountVolumeRecord.encode(v!, writer.uint32(266).fork()).ldelim(); + } + for (const v of message.marketVolumes) { + MarketVolume.encode(v!, writer.uint32(274).fork()).ldelim(); + } + for (const v of message.grantAuthorizations) { + FullGrantAuthorizations.encode(v!, writer.uint32(282).fork()).ldelim(); + } + for (const v of message.activeGrants) { + FullActiveGrant.encode(v!, writer.uint32(290).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.spotMarkets.push(SpotMarket.decode(reader, reader.uint32())); + break; + case 3: + message.derivativeMarkets.push(DerivativeMarket.decode(reader, reader.uint32())); + break; + case 4: + message.spotOrderbook.push(SpotOrderBook.decode(reader, reader.uint32())); + break; + case 5: + message.derivativeOrderbook.push(DerivativeOrderBook.decode(reader, reader.uint32())); + break; + case 6: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + case 7: + message.positions.push(DerivativePosition.decode(reader, reader.uint32())); + break; + case 8: + message.subaccountTradeNonces.push(SubaccountNonce.decode(reader, reader.uint32())); + break; + case 9: + message.expiryFuturesMarketInfoState.push(ExpiryFuturesMarketInfoState.decode(reader, reader.uint32())); + break; + case 10: + message.perpetualMarketInfo.push(PerpetualMarketInfo.decode(reader, reader.uint32())); + break; + case 11: + message.perpetualMarketFundingState.push(PerpetualMarketFundingState.decode(reader, reader.uint32())); + break; + case 12: + message.derivativeMarketSettlementScheduled.push(DerivativeMarketSettlementInfo.decode(reader, reader.uint32())); + break; + case 13: + message.isSpotExchangeEnabled = reader.bool(); + break; + case 14: + message.isDerivativesExchangeEnabled = reader.bool(); + break; + case 15: + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 16: + message.tradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 17: + message.tradingRewardCampaignAccountPoints.push(TradingRewardCampaignAccountPoints.decode(reader, reader.uint32())); + break; + case 18: + message.feeDiscountSchedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + case 19: + message.feeDiscountAccountTierTtl.push(FeeDiscountAccountTierTTL.decode(reader, reader.uint32())); + break; + case 20: + message.feeDiscountBucketVolumeAccounts.push(FeeDiscountBucketVolumeAccounts.decode(reader, reader.uint32())); + break; + case 21: + message.isFirstFeeCycleFinished = reader.bool(); + break; + case 22: + message.pendingTradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 23: + message.pendingTradingRewardCampaignAccountPoints.push(TradingRewardCampaignAccountPendingPoints.decode(reader, reader.uint32())); + break; + case 24: + message.rewardsOptOutAddresses.push(reader.string()); + break; + case 25: + message.historicalTradeRecords.push(TradeRecords.decode(reader, reader.uint32())); + break; + case 26: + message.binaryOptionsMarkets.push(BinaryOptionsMarket.decode(reader, reader.uint32())); + break; + case 27: + message.binaryOptionsMarketIdsScheduledForSettlement.push(reader.string()); + break; + case 28: + message.spotMarketIdsScheduledToForceClose.push(reader.string()); + break; + case 29: + message.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + case 30: + message.conditionalDerivativeOrderbooks.push(ConditionalDerivativeOrderBook.decode(reader, reader.uint32())); + break; + case 31: + message.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + case 32: + message.orderbookSequences.push(OrderbookSequence.decode(reader, reader.uint32())); + break; + case 33: + message.subaccountVolumes.push(AggregateSubaccountVolumeRecord.decode(reader, reader.uint32())); + break; + case 34: + message.marketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + case 35: + message.grantAuthorizations.push(FullGrantAuthorizations.decode(reader, reader.uint32())); + break; + case 36: + message.activeGrants.push(FullActiveGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.spotMarkets = object.spotMarkets?.map(e => SpotMarket.fromPartial(e)) || []; + message.derivativeMarkets = object.derivativeMarkets?.map(e => DerivativeMarket.fromPartial(e)) || []; + message.spotOrderbook = object.spotOrderbook?.map(e => SpotOrderBook.fromPartial(e)) || []; + message.derivativeOrderbook = object.derivativeOrderbook?.map(e => DerivativeOrderBook.fromPartial(e)) || []; + message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; + message.positions = object.positions?.map(e => DerivativePosition.fromPartial(e)) || []; + message.subaccountTradeNonces = object.subaccountTradeNonces?.map(e => SubaccountNonce.fromPartial(e)) || []; + message.expiryFuturesMarketInfoState = object.expiryFuturesMarketInfoState?.map(e => ExpiryFuturesMarketInfoState.fromPartial(e)) || []; + message.perpetualMarketInfo = object.perpetualMarketInfo?.map(e => PerpetualMarketInfo.fromPartial(e)) || []; + message.perpetualMarketFundingState = object.perpetualMarketFundingState?.map(e => PerpetualMarketFundingState.fromPartial(e)) || []; + message.derivativeMarketSettlementScheduled = object.derivativeMarketSettlementScheduled?.map(e => DerivativeMarketSettlementInfo.fromPartial(e)) || []; + message.isSpotExchangeEnabled = object.isSpotExchangeEnabled ?? false; + message.isDerivativesExchangeEnabled = object.isDerivativesExchangeEnabled ?? false; + message.tradingRewardCampaignInfo = object.tradingRewardCampaignInfo !== undefined && object.tradingRewardCampaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.tradingRewardCampaignInfo) : undefined; + message.tradingRewardPoolCampaignSchedule = object.tradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.tradingRewardCampaignAccountPoints = object.tradingRewardCampaignAccountPoints?.map(e => TradingRewardCampaignAccountPoints.fromPartial(e)) || []; + message.feeDiscountSchedule = object.feeDiscountSchedule !== undefined && object.feeDiscountSchedule !== null ? FeeDiscountSchedule.fromPartial(object.feeDiscountSchedule) : undefined; + message.feeDiscountAccountTierTtl = object.feeDiscountAccountTierTtl?.map(e => FeeDiscountAccountTierTTL.fromPartial(e)) || []; + message.feeDiscountBucketVolumeAccounts = object.feeDiscountBucketVolumeAccounts?.map(e => FeeDiscountBucketVolumeAccounts.fromPartial(e)) || []; + message.isFirstFeeCycleFinished = object.isFirstFeeCycleFinished ?? false; + message.pendingTradingRewardPoolCampaignSchedule = object.pendingTradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.pendingTradingRewardCampaignAccountPoints = object.pendingTradingRewardCampaignAccountPoints?.map(e => TradingRewardCampaignAccountPendingPoints.fromPartial(e)) || []; + message.rewardsOptOutAddresses = object.rewardsOptOutAddresses?.map(e => e) || []; + message.historicalTradeRecords = object.historicalTradeRecords?.map(e => TradeRecords.fromPartial(e)) || []; + message.binaryOptionsMarkets = object.binaryOptionsMarkets?.map(e => BinaryOptionsMarket.fromPartial(e)) || []; + message.binaryOptionsMarketIdsScheduledForSettlement = object.binaryOptionsMarketIdsScheduledForSettlement?.map(e => e) || []; + message.spotMarketIdsScheduledToForceClose = object.spotMarketIdsScheduledToForceClose?.map(e => e) || []; + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + message.conditionalDerivativeOrderbooks = object.conditionalDerivativeOrderbooks?.map(e => ConditionalDerivativeOrderBook.fromPartial(e)) || []; + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + message.orderbookSequences = object.orderbookSequences?.map(e => OrderbookSequence.fromPartial(e)) || []; + message.subaccountVolumes = object.subaccountVolumes?.map(e => AggregateSubaccountVolumeRecord.fromPartial(e)) || []; + message.marketVolumes = object.marketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + message.grantAuthorizations = object.grantAuthorizations?.map(e => FullGrantAuthorizations.fromPartial(e)) || []; + message.activeGrants = object.activeGrants?.map(e => FullActiveGrant.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.spotMarkets = object.spot_markets?.map(e => SpotMarket.fromAmino(e)) || []; + message.derivativeMarkets = object.derivative_markets?.map(e => DerivativeMarket.fromAmino(e)) || []; + message.spotOrderbook = object.spot_orderbook?.map(e => SpotOrderBook.fromAmino(e)) || []; + message.derivativeOrderbook = object.derivative_orderbook?.map(e => DerivativeOrderBook.fromAmino(e)) || []; + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.positions = object.positions?.map(e => DerivativePosition.fromAmino(e)) || []; + message.subaccountTradeNonces = object.subaccount_trade_nonces?.map(e => SubaccountNonce.fromAmino(e)) || []; + message.expiryFuturesMarketInfoState = object.expiry_futures_market_info_state?.map(e => ExpiryFuturesMarketInfoState.fromAmino(e)) || []; + message.perpetualMarketInfo = object.perpetual_market_info?.map(e => PerpetualMarketInfo.fromAmino(e)) || []; + message.perpetualMarketFundingState = object.perpetual_market_funding_state?.map(e => PerpetualMarketFundingState.fromAmino(e)) || []; + message.derivativeMarketSettlementScheduled = object.derivative_market_settlement_scheduled?.map(e => DerivativeMarketSettlementInfo.fromAmino(e)) || []; + if (object.is_spot_exchange_enabled !== undefined && object.is_spot_exchange_enabled !== null) { + message.isSpotExchangeEnabled = object.is_spot_exchange_enabled; + } + if (object.is_derivatives_exchange_enabled !== undefined && object.is_derivatives_exchange_enabled !== null) { + message.isDerivativesExchangeEnabled = object.is_derivatives_exchange_enabled; + } + if (object.trading_reward_campaign_info !== undefined && object.trading_reward_campaign_info !== null) { + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.fromAmino(object.trading_reward_campaign_info); + } + message.tradingRewardPoolCampaignSchedule = object.trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.tradingRewardCampaignAccountPoints = object.trading_reward_campaign_account_points?.map(e => TradingRewardCampaignAccountPoints.fromAmino(e)) || []; + if (object.fee_discount_schedule !== undefined && object.fee_discount_schedule !== null) { + message.feeDiscountSchedule = FeeDiscountSchedule.fromAmino(object.fee_discount_schedule); + } + message.feeDiscountAccountTierTtl = object.fee_discount_account_tier_ttl?.map(e => FeeDiscountAccountTierTTL.fromAmino(e)) || []; + message.feeDiscountBucketVolumeAccounts = object.fee_discount_bucket_volume_accounts?.map(e => FeeDiscountBucketVolumeAccounts.fromAmino(e)) || []; + if (object.is_first_fee_cycle_finished !== undefined && object.is_first_fee_cycle_finished !== null) { + message.isFirstFeeCycleFinished = object.is_first_fee_cycle_finished; + } + message.pendingTradingRewardPoolCampaignSchedule = object.pending_trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.pendingTradingRewardCampaignAccountPoints = object.pending_trading_reward_campaign_account_points?.map(e => TradingRewardCampaignAccountPendingPoints.fromAmino(e)) || []; + message.rewardsOptOutAddresses = object.rewards_opt_out_addresses?.map(e => e) || []; + message.historicalTradeRecords = object.historical_trade_records?.map(e => TradeRecords.fromAmino(e)) || []; + message.binaryOptionsMarkets = object.binary_options_markets?.map(e => BinaryOptionsMarket.fromAmino(e)) || []; + message.binaryOptionsMarketIdsScheduledForSettlement = object.binary_options_market_ids_scheduled_for_settlement?.map(e => e) || []; + message.spotMarketIdsScheduledToForceClose = object.spot_market_ids_scheduled_to_force_close?.map(e => e) || []; + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + message.conditionalDerivativeOrderbooks = object.conditional_derivative_orderbooks?.map(e => ConditionalDerivativeOrderBook.fromAmino(e)) || []; + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + message.orderbookSequences = object.orderbook_sequences?.map(e => OrderbookSequence.fromAmino(e)) || []; + message.subaccountVolumes = object.subaccount_volumes?.map(e => AggregateSubaccountVolumeRecord.fromAmino(e)) || []; + message.marketVolumes = object.market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + message.grantAuthorizations = object.grant_authorizations?.map(e => FullGrantAuthorizations.fromAmino(e)) || []; + message.activeGrants = object.active_grants?.map(e => FullActiveGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.spotMarkets) { + obj.spot_markets = message.spotMarkets.map(e => e ? SpotMarket.toAmino(e) : undefined); + } else { + obj.spot_markets = message.spotMarkets; + } + if (message.derivativeMarkets) { + obj.derivative_markets = message.derivativeMarkets.map(e => e ? DerivativeMarket.toAmino(e) : undefined); + } else { + obj.derivative_markets = message.derivativeMarkets; + } + if (message.spotOrderbook) { + obj.spot_orderbook = message.spotOrderbook.map(e => e ? SpotOrderBook.toAmino(e) : undefined); + } else { + obj.spot_orderbook = message.spotOrderbook; + } + if (message.derivativeOrderbook) { + obj.derivative_orderbook = message.derivativeOrderbook.map(e => e ? DerivativeOrderBook.toAmino(e) : undefined); + } else { + obj.derivative_orderbook = message.derivativeOrderbook; + } + if (message.balances) { + obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + if (message.positions) { + obj.positions = message.positions.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + if (message.subaccountTradeNonces) { + obj.subaccount_trade_nonces = message.subaccountTradeNonces.map(e => e ? SubaccountNonce.toAmino(e) : undefined); + } else { + obj.subaccount_trade_nonces = message.subaccountTradeNonces; + } + if (message.expiryFuturesMarketInfoState) { + obj.expiry_futures_market_info_state = message.expiryFuturesMarketInfoState.map(e => e ? ExpiryFuturesMarketInfoState.toAmino(e) : undefined); + } else { + obj.expiry_futures_market_info_state = message.expiryFuturesMarketInfoState; + } + if (message.perpetualMarketInfo) { + obj.perpetual_market_info = message.perpetualMarketInfo.map(e => e ? PerpetualMarketInfo.toAmino(e) : undefined); + } else { + obj.perpetual_market_info = message.perpetualMarketInfo; + } + if (message.perpetualMarketFundingState) { + obj.perpetual_market_funding_state = message.perpetualMarketFundingState.map(e => e ? PerpetualMarketFundingState.toAmino(e) : undefined); + } else { + obj.perpetual_market_funding_state = message.perpetualMarketFundingState; + } + if (message.derivativeMarketSettlementScheduled) { + obj.derivative_market_settlement_scheduled = message.derivativeMarketSettlementScheduled.map(e => e ? DerivativeMarketSettlementInfo.toAmino(e) : undefined); + } else { + obj.derivative_market_settlement_scheduled = message.derivativeMarketSettlementScheduled; + } + obj.is_spot_exchange_enabled = message.isSpotExchangeEnabled === false ? undefined : message.isSpotExchangeEnabled; + obj.is_derivatives_exchange_enabled = message.isDerivativesExchangeEnabled === false ? undefined : message.isDerivativesExchangeEnabled; + obj.trading_reward_campaign_info = message.tradingRewardCampaignInfo ? TradingRewardCampaignInfo.toAmino(message.tradingRewardCampaignInfo) : undefined; + if (message.tradingRewardPoolCampaignSchedule) { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule; + } + if (message.tradingRewardCampaignAccountPoints) { + obj.trading_reward_campaign_account_points = message.tradingRewardCampaignAccountPoints.map(e => e ? TradingRewardCampaignAccountPoints.toAmino(e) : undefined); + } else { + obj.trading_reward_campaign_account_points = message.tradingRewardCampaignAccountPoints; + } + obj.fee_discount_schedule = message.feeDiscountSchedule ? FeeDiscountSchedule.toAmino(message.feeDiscountSchedule) : undefined; + if (message.feeDiscountAccountTierTtl) { + obj.fee_discount_account_tier_ttl = message.feeDiscountAccountTierTtl.map(e => e ? FeeDiscountAccountTierTTL.toAmino(e) : undefined); + } else { + obj.fee_discount_account_tier_ttl = message.feeDiscountAccountTierTtl; + } + if (message.feeDiscountBucketVolumeAccounts) { + obj.fee_discount_bucket_volume_accounts = message.feeDiscountBucketVolumeAccounts.map(e => e ? FeeDiscountBucketVolumeAccounts.toAmino(e) : undefined); + } else { + obj.fee_discount_bucket_volume_accounts = message.feeDiscountBucketVolumeAccounts; + } + obj.is_first_fee_cycle_finished = message.isFirstFeeCycleFinished === false ? undefined : message.isFirstFeeCycleFinished; + if (message.pendingTradingRewardPoolCampaignSchedule) { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule; + } + if (message.pendingTradingRewardCampaignAccountPoints) { + obj.pending_trading_reward_campaign_account_points = message.pendingTradingRewardCampaignAccountPoints.map(e => e ? TradingRewardCampaignAccountPendingPoints.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_campaign_account_points = message.pendingTradingRewardCampaignAccountPoints; + } + if (message.rewardsOptOutAddresses) { + obj.rewards_opt_out_addresses = message.rewardsOptOutAddresses.map(e => e); + } else { + obj.rewards_opt_out_addresses = message.rewardsOptOutAddresses; + } + if (message.historicalTradeRecords) { + obj.historical_trade_records = message.historicalTradeRecords.map(e => e ? TradeRecords.toAmino(e) : undefined); + } else { + obj.historical_trade_records = message.historicalTradeRecords; + } + if (message.binaryOptionsMarkets) { + obj.binary_options_markets = message.binaryOptionsMarkets.map(e => e ? BinaryOptionsMarket.toAmino(e) : undefined); + } else { + obj.binary_options_markets = message.binaryOptionsMarkets; + } + if (message.binaryOptionsMarketIdsScheduledForSettlement) { + obj.binary_options_market_ids_scheduled_for_settlement = message.binaryOptionsMarketIdsScheduledForSettlement.map(e => e); + } else { + obj.binary_options_market_ids_scheduled_for_settlement = message.binaryOptionsMarketIdsScheduledForSettlement; + } + if (message.spotMarketIdsScheduledToForceClose) { + obj.spot_market_ids_scheduled_to_force_close = message.spotMarketIdsScheduledToForceClose.map(e => e); + } else { + obj.spot_market_ids_scheduled_to_force_close = message.spotMarketIdsScheduledToForceClose; + } + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + if (message.conditionalDerivativeOrderbooks) { + obj.conditional_derivative_orderbooks = message.conditionalDerivativeOrderbooks.map(e => e ? ConditionalDerivativeOrderBook.toAmino(e) : undefined); + } else { + obj.conditional_derivative_orderbooks = message.conditionalDerivativeOrderbooks; + } + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + if (message.orderbookSequences) { + obj.orderbook_sequences = message.orderbookSequences.map(e => e ? OrderbookSequence.toAmino(e) : undefined); + } else { + obj.orderbook_sequences = message.orderbookSequences; + } + if (message.subaccountVolumes) { + obj.subaccount_volumes = message.subaccountVolumes.map(e => e ? AggregateSubaccountVolumeRecord.toAmino(e) : undefined); + } else { + obj.subaccount_volumes = message.subaccountVolumes; + } + if (message.marketVolumes) { + obj.market_volumes = message.marketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.market_volumes = message.marketVolumes; + } + if (message.grantAuthorizations) { + obj.grant_authorizations = message.grantAuthorizations.map(e => e ? FullGrantAuthorizations.toAmino(e) : undefined); + } else { + obj.grant_authorizations = message.grantAuthorizations; + } + if (message.activeGrants) { + obj.active_grants = message.activeGrants.map(e => e ? FullActiveGrant.toAmino(e) : undefined); + } else { + obj.active_grants = message.activeGrants; + } + 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: "/injective.exchange.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseOrderbookSequence(): OrderbookSequence { + return { + sequence: BigInt(0), + marketId: "" + }; +} +export const OrderbookSequence = { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence", + is(o: any): o is OrderbookSequence { + return o && (o.$typeUrl === OrderbookSequence.typeUrl || typeof o.sequence === "bigint" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is OrderbookSequenceAmino { + return o && (o.$typeUrl === OrderbookSequence.typeUrl || typeof o.sequence === "bigint" && typeof o.market_id === "string"); + }, + encode(message: OrderbookSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookSequence { + const message = createBaseOrderbookSequence(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: OrderbookSequenceAmino): OrderbookSequence { + const message = createBaseOrderbookSequence(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: OrderbookSequence): OrderbookSequenceAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: OrderbookSequenceAminoMsg): OrderbookSequence { + return OrderbookSequence.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookSequenceProtoMsg): OrderbookSequence { + return OrderbookSequence.decode(message.value); + }, + toProto(message: OrderbookSequence): Uint8Array { + return OrderbookSequence.encode(message).finish(); + }, + toProtoMsg(message: OrderbookSequence): OrderbookSequenceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderbookSequence", + value: OrderbookSequence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookSequence.typeUrl, OrderbookSequence); +function createBaseFeeDiscountAccountTierTTL(): FeeDiscountAccountTierTTL { + return { + account: "", + tierTtl: undefined + }; +} +export const FeeDiscountAccountTierTTL = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL", + is(o: any): o is FeeDiscountAccountTierTTL { + return o && (o.$typeUrl === FeeDiscountAccountTierTTL.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is FeeDiscountAccountTierTTLAmino { + return o && (o.$typeUrl === FeeDiscountAccountTierTTL.typeUrl || typeof o.account === "string"); + }, + encode(message: FeeDiscountAccountTierTTL, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.tierTtl !== undefined) { + FeeDiscountTierTTL.encode(message.tierTtl, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountAccountTierTTL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountAccountTierTTL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.tierTtl = FeeDiscountTierTTL.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountAccountTierTTL { + const message = createBaseFeeDiscountAccountTierTTL(); + message.account = object.account ?? ""; + message.tierTtl = object.tierTtl !== undefined && object.tierTtl !== null ? FeeDiscountTierTTL.fromPartial(object.tierTtl) : undefined; + return message; + }, + fromAmino(object: FeeDiscountAccountTierTTLAmino): FeeDiscountAccountTierTTL { + const message = createBaseFeeDiscountAccountTierTTL(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.tier_ttl !== undefined && object.tier_ttl !== null) { + message.tierTtl = FeeDiscountTierTTL.fromAmino(object.tier_ttl); + } + return message; + }, + toAmino(message: FeeDiscountAccountTierTTL): FeeDiscountAccountTierTTLAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.tier_ttl = message.tierTtl ? FeeDiscountTierTTL.toAmino(message.tierTtl) : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountAccountTierTTLAminoMsg): FeeDiscountAccountTierTTL { + return FeeDiscountAccountTierTTL.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountAccountTierTTLProtoMsg): FeeDiscountAccountTierTTL { + return FeeDiscountAccountTierTTL.decode(message.value); + }, + toProto(message: FeeDiscountAccountTierTTL): Uint8Array { + return FeeDiscountAccountTierTTL.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountAccountTierTTL): FeeDiscountAccountTierTTLProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountAccountTierTTL", + value: FeeDiscountAccountTierTTL.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountAccountTierTTL.typeUrl, FeeDiscountAccountTierTTL); +function createBaseFeeDiscountBucketVolumeAccounts(): FeeDiscountBucketVolumeAccounts { + return { + bucketStartTimestamp: BigInt(0), + accountVolume: [] + }; +} +export const FeeDiscountBucketVolumeAccounts = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts", + is(o: any): o is FeeDiscountBucketVolumeAccounts { + return o && (o.$typeUrl === FeeDiscountBucketVolumeAccounts.typeUrl || typeof o.bucketStartTimestamp === "bigint" && Array.isArray(o.accountVolume) && (!o.accountVolume.length || AccountVolume.is(o.accountVolume[0]))); + }, + isAmino(o: any): o is FeeDiscountBucketVolumeAccountsAmino { + return o && (o.$typeUrl === FeeDiscountBucketVolumeAccounts.typeUrl || typeof o.bucket_start_timestamp === "bigint" && Array.isArray(o.account_volume) && (!o.account_volume.length || AccountVolume.isAmino(o.account_volume[0]))); + }, + encode(message: FeeDiscountBucketVolumeAccounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bucketStartTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.bucketStartTimestamp); + } + for (const v of message.accountVolume) { + AccountVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountBucketVolumeAccounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountBucketVolumeAccounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketStartTimestamp = reader.int64(); + break; + case 2: + message.accountVolume.push(AccountVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountBucketVolumeAccounts { + const message = createBaseFeeDiscountBucketVolumeAccounts(); + message.bucketStartTimestamp = object.bucketStartTimestamp !== undefined && object.bucketStartTimestamp !== null ? BigInt(object.bucketStartTimestamp.toString()) : BigInt(0); + message.accountVolume = object.accountVolume?.map(e => AccountVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeeDiscountBucketVolumeAccountsAmino): FeeDiscountBucketVolumeAccounts { + const message = createBaseFeeDiscountBucketVolumeAccounts(); + if (object.bucket_start_timestamp !== undefined && object.bucket_start_timestamp !== null) { + message.bucketStartTimestamp = BigInt(object.bucket_start_timestamp); + } + message.accountVolume = object.account_volume?.map(e => AccountVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeeDiscountBucketVolumeAccounts): FeeDiscountBucketVolumeAccountsAmino { + const obj: any = {}; + obj.bucket_start_timestamp = message.bucketStartTimestamp !== BigInt(0) ? message.bucketStartTimestamp?.toString() : undefined; + if (message.accountVolume) { + obj.account_volume = message.accountVolume.map(e => e ? AccountVolume.toAmino(e) : undefined); + } else { + obj.account_volume = message.accountVolume; + } + return obj; + }, + fromAminoMsg(object: FeeDiscountBucketVolumeAccountsAminoMsg): FeeDiscountBucketVolumeAccounts { + return FeeDiscountBucketVolumeAccounts.fromAmino(object.value); + }, + fromProtoMsg(message: FeeDiscountBucketVolumeAccountsProtoMsg): FeeDiscountBucketVolumeAccounts { + return FeeDiscountBucketVolumeAccounts.decode(message.value); + }, + toProto(message: FeeDiscountBucketVolumeAccounts): Uint8Array { + return FeeDiscountBucketVolumeAccounts.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountBucketVolumeAccounts): FeeDiscountBucketVolumeAccountsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountBucketVolumeAccounts", + value: FeeDiscountBucketVolumeAccounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountBucketVolumeAccounts.typeUrl, FeeDiscountBucketVolumeAccounts); +function createBaseAccountVolume(): AccountVolume { + return { + account: "", + volume: "" + }; +} +export const AccountVolume = { + typeUrl: "/injective.exchange.v1beta1.AccountVolume", + is(o: any): o is AccountVolume { + return o && (o.$typeUrl === AccountVolume.typeUrl || typeof o.account === "string" && typeof o.volume === "string"); + }, + isAmino(o: any): o is AccountVolumeAmino { + return o && (o.$typeUrl === AccountVolume.typeUrl || typeof o.account === "string" && typeof o.volume === "string"); + }, + encode(message: AccountVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.volume !== "") { + writer.uint32(18).string(message.volume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.volume = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AccountVolume { + const message = createBaseAccountVolume(); + message.account = object.account ?? ""; + message.volume = object.volume ?? ""; + return message; + }, + fromAmino(object: AccountVolumeAmino): AccountVolume { + const message = createBaseAccountVolume(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = object.volume; + } + return message; + }, + toAmino(message: AccountVolume): AccountVolumeAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.volume = message.volume === "" ? undefined : message.volume; + return obj; + }, + fromAminoMsg(object: AccountVolumeAminoMsg): AccountVolume { + return AccountVolume.fromAmino(object.value); + }, + fromProtoMsg(message: AccountVolumeProtoMsg): AccountVolume { + return AccountVolume.decode(message.value); + }, + toProto(message: AccountVolume): Uint8Array { + return AccountVolume.encode(message).finish(); + }, + toProtoMsg(message: AccountVolume): AccountVolumeProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AccountVolume", + value: AccountVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AccountVolume.typeUrl, AccountVolume); +function createBaseTradingRewardCampaignAccountPoints(): TradingRewardCampaignAccountPoints { + return { + account: "", + points: "" + }; +} +export const TradingRewardCampaignAccountPoints = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints", + is(o: any): o is TradingRewardCampaignAccountPoints { + return o && (o.$typeUrl === TradingRewardCampaignAccountPoints.typeUrl || typeof o.account === "string" && typeof o.points === "string"); + }, + isAmino(o: any): o is TradingRewardCampaignAccountPointsAmino { + return o && (o.$typeUrl === TradingRewardCampaignAccountPoints.typeUrl || typeof o.account === "string" && typeof o.points === "string"); + }, + encode(message: TradingRewardCampaignAccountPoints, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.points !== "") { + writer.uint32(18).string(message.points); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignAccountPoints { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignAccountPoints(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.points = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignAccountPoints { + const message = createBaseTradingRewardCampaignAccountPoints(); + message.account = object.account ?? ""; + message.points = object.points ?? ""; + return message; + }, + fromAmino(object: TradingRewardCampaignAccountPointsAmino): TradingRewardCampaignAccountPoints { + const message = createBaseTradingRewardCampaignAccountPoints(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.points !== undefined && object.points !== null) { + message.points = object.points; + } + return message; + }, + toAmino(message: TradingRewardCampaignAccountPoints): TradingRewardCampaignAccountPointsAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.points = message.points === "" ? undefined : message.points; + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignAccountPointsAminoMsg): TradingRewardCampaignAccountPoints { + return TradingRewardCampaignAccountPoints.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignAccountPointsProtoMsg): TradingRewardCampaignAccountPoints { + return TradingRewardCampaignAccountPoints.decode(message.value); + }, + toProto(message: TradingRewardCampaignAccountPoints): Uint8Array { + return TradingRewardCampaignAccountPoints.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignAccountPoints): TradingRewardCampaignAccountPointsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPoints", + value: TradingRewardCampaignAccountPoints.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignAccountPoints.typeUrl, TradingRewardCampaignAccountPoints); +function createBaseTradingRewardCampaignAccountPendingPoints(): TradingRewardCampaignAccountPendingPoints { + return { + rewardPoolStartTimestamp: BigInt(0), + accountPoints: [] + }; +} +export const TradingRewardCampaignAccountPendingPoints = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints", + is(o: any): o is TradingRewardCampaignAccountPendingPoints { + return o && (o.$typeUrl === TradingRewardCampaignAccountPendingPoints.typeUrl || typeof o.rewardPoolStartTimestamp === "bigint" && Array.isArray(o.accountPoints) && (!o.accountPoints.length || TradingRewardCampaignAccountPoints.is(o.accountPoints[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignAccountPendingPointsAmino { + return o && (o.$typeUrl === TradingRewardCampaignAccountPendingPoints.typeUrl || typeof o.reward_pool_start_timestamp === "bigint" && Array.isArray(o.account_points) && (!o.account_points.length || TradingRewardCampaignAccountPoints.isAmino(o.account_points[0]))); + }, + encode(message: TradingRewardCampaignAccountPendingPoints, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardPoolStartTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.rewardPoolStartTimestamp); + } + for (const v of message.accountPoints) { + TradingRewardCampaignAccountPoints.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignAccountPendingPoints { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardPoolStartTimestamp = reader.int64(); + break; + case 2: + message.accountPoints.push(TradingRewardCampaignAccountPoints.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignAccountPendingPoints { + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + message.rewardPoolStartTimestamp = object.rewardPoolStartTimestamp !== undefined && object.rewardPoolStartTimestamp !== null ? BigInt(object.rewardPoolStartTimestamp.toString()) : BigInt(0); + message.accountPoints = object.accountPoints?.map(e => TradingRewardCampaignAccountPoints.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignAccountPendingPointsAmino): TradingRewardCampaignAccountPendingPoints { + const message = createBaseTradingRewardCampaignAccountPendingPoints(); + if (object.reward_pool_start_timestamp !== undefined && object.reward_pool_start_timestamp !== null) { + message.rewardPoolStartTimestamp = BigInt(object.reward_pool_start_timestamp); + } + message.accountPoints = object.account_points?.map(e => TradingRewardCampaignAccountPoints.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignAccountPendingPoints): TradingRewardCampaignAccountPendingPointsAmino { + const obj: any = {}; + obj.reward_pool_start_timestamp = message.rewardPoolStartTimestamp !== BigInt(0) ? message.rewardPoolStartTimestamp?.toString() : undefined; + if (message.accountPoints) { + obj.account_points = message.accountPoints.map(e => e ? TradingRewardCampaignAccountPoints.toAmino(e) : undefined); + } else { + obj.account_points = message.accountPoints; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignAccountPendingPointsAminoMsg): TradingRewardCampaignAccountPendingPoints { + return TradingRewardCampaignAccountPendingPoints.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardCampaignAccountPendingPointsProtoMsg): TradingRewardCampaignAccountPendingPoints { + return TradingRewardCampaignAccountPendingPoints.decode(message.value); + }, + toProto(message: TradingRewardCampaignAccountPendingPoints): Uint8Array { + return TradingRewardCampaignAccountPendingPoints.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignAccountPendingPoints): TradingRewardCampaignAccountPendingPointsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPoints", + value: TradingRewardCampaignAccountPendingPoints.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignAccountPendingPoints.typeUrl, TradingRewardCampaignAccountPendingPoints); +function createBaseSpotOrderBook(): SpotOrderBook { + return { + marketId: "", + isBuySide: false, + orders: [] + }; +} +export const SpotOrderBook = { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook", + is(o: any): o is SpotOrderBook { + return o && (o.$typeUrl === SpotOrderBook.typeUrl || typeof o.marketId === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || SpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is SpotOrderBookAmino { + return o && (o.$typeUrl === SpotOrderBook.typeUrl || typeof o.market_id === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || SpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: SpotOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuySide === true) { + writer.uint32(16).bool(message.isBuySide); + } + for (const v of message.orders) { + SpotLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuySide = reader.bool(); + break; + case 3: + message.orders.push(SpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrderBook { + const message = createBaseSpotOrderBook(); + message.marketId = object.marketId ?? ""; + message.isBuySide = object.isBuySide ?? false; + message.orders = object.orders?.map(e => SpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SpotOrderBookAmino): SpotOrderBook { + const message = createBaseSpotOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuySide !== undefined && object.isBuySide !== null) { + message.isBuySide = object.isBuySide; + } + message.orders = object.orders?.map(e => SpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: SpotOrderBook): SpotOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuySide = message.isBuySide === false ? undefined : message.isBuySide; + if (message.orders) { + obj.orders = message.orders.map(e => e ? SpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: SpotOrderBookAminoMsg): SpotOrderBook { + return SpotOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderBookProtoMsg): SpotOrderBook { + return SpotOrderBook.decode(message.value); + }, + toProto(message: SpotOrderBook): Uint8Array { + return SpotOrderBook.encode(message).finish(); + }, + toProtoMsg(message: SpotOrderBook): SpotOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotOrderBook", + value: SpotOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrderBook.typeUrl, SpotOrderBook); +function createBaseDerivativeOrderBook(): DerivativeOrderBook { + return { + marketId: "", + isBuySide: false, + orders: [] + }; +} +export const DerivativeOrderBook = { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook", + is(o: any): o is DerivativeOrderBook { + return o && (o.$typeUrl === DerivativeOrderBook.typeUrl || typeof o.marketId === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || DerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is DerivativeOrderBookAmino { + return o && (o.$typeUrl === DerivativeOrderBook.typeUrl || typeof o.market_id === "string" && typeof o.isBuySide === "boolean" && Array.isArray(o.orders) && (!o.orders.length || DerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: DerivativeOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuySide === true) { + writer.uint32(16).bool(message.isBuySide); + } + for (const v of message.orders) { + DerivativeLimitOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuySide = reader.bool(); + break; + case 3: + message.orders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrderBook { + const message = createBaseDerivativeOrderBook(); + message.marketId = object.marketId ?? ""; + message.isBuySide = object.isBuySide ?? false; + message.orders = object.orders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DerivativeOrderBookAmino): DerivativeOrderBook { + const message = createBaseDerivativeOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuySide !== undefined && object.isBuySide !== null) { + message.isBuySide = object.isBuySide; + } + message.orders = object.orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: DerivativeOrderBook): DerivativeOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuySide = message.isBuySide === false ? undefined : message.isBuySide; + if (message.orders) { + obj.orders = message.orders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: DerivativeOrderBookAminoMsg): DerivativeOrderBook { + return DerivativeOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderBookProtoMsg): DerivativeOrderBook { + return DerivativeOrderBook.decode(message.value); + }, + toProto(message: DerivativeOrderBook): Uint8Array { + return DerivativeOrderBook.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrderBook): DerivativeOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeOrderBook", + value: DerivativeOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrderBook.typeUrl, DerivativeOrderBook); +function createBaseConditionalDerivativeOrderBook(): ConditionalDerivativeOrderBook { + return { + marketId: "", + limitBuyOrders: [], + marketBuyOrders: [], + limitSellOrders: [], + marketSellOrders: [] + }; +} +export const ConditionalDerivativeOrderBook = { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook", + is(o: any): o is ConditionalDerivativeOrderBook { + return o && (o.$typeUrl === ConditionalDerivativeOrderBook.typeUrl || typeof o.marketId === "string" && Array.isArray(o.limitBuyOrders) && (!o.limitBuyOrders.length || DerivativeLimitOrder.is(o.limitBuyOrders[0])) && Array.isArray(o.marketBuyOrders) && (!o.marketBuyOrders.length || DerivativeMarketOrder.is(o.marketBuyOrders[0])) && Array.isArray(o.limitSellOrders) && (!o.limitSellOrders.length || DerivativeLimitOrder.is(o.limitSellOrders[0])) && Array.isArray(o.marketSellOrders) && (!o.marketSellOrders.length || DerivativeMarketOrder.is(o.marketSellOrders[0]))); + }, + isAmino(o: any): o is ConditionalDerivativeOrderBookAmino { + return o && (o.$typeUrl === ConditionalDerivativeOrderBook.typeUrl || typeof o.market_id === "string" && Array.isArray(o.limit_buy_orders) && (!o.limit_buy_orders.length || DerivativeLimitOrder.isAmino(o.limit_buy_orders[0])) && Array.isArray(o.market_buy_orders) && (!o.market_buy_orders.length || DerivativeMarketOrder.isAmino(o.market_buy_orders[0])) && Array.isArray(o.limit_sell_orders) && (!o.limit_sell_orders.length || DerivativeLimitOrder.isAmino(o.limit_sell_orders[0])) && Array.isArray(o.market_sell_orders) && (!o.market_sell_orders.length || DerivativeMarketOrder.isAmino(o.market_sell_orders[0]))); + }, + encode(message: ConditionalDerivativeOrderBook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.limitBuyOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.marketBuyOrders) { + DerivativeMarketOrder.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.limitSellOrders) { + DerivativeLimitOrder.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.marketSellOrders) { + DerivativeMarketOrder.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConditionalDerivativeOrderBook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConditionalDerivativeOrderBook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limitBuyOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 3: + message.marketBuyOrders.push(DerivativeMarketOrder.decode(reader, reader.uint32())); + break; + case 4: + message.limitSellOrders.push(DerivativeLimitOrder.decode(reader, reader.uint32())); + break; + case 5: + message.marketSellOrders.push(DerivativeMarketOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ConditionalDerivativeOrderBook { + const message = createBaseConditionalDerivativeOrderBook(); + message.marketId = object.marketId ?? ""; + message.limitBuyOrders = object.limitBuyOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.marketBuyOrders = object.marketBuyOrders?.map(e => DerivativeMarketOrder.fromPartial(e)) || []; + message.limitSellOrders = object.limitSellOrders?.map(e => DerivativeLimitOrder.fromPartial(e)) || []; + message.marketSellOrders = object.marketSellOrders?.map(e => DerivativeMarketOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConditionalDerivativeOrderBookAmino): ConditionalDerivativeOrderBook { + const message = createBaseConditionalDerivativeOrderBook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.limitBuyOrders = object.limit_buy_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.marketBuyOrders = object.market_buy_orders?.map(e => DerivativeMarketOrder.fromAmino(e)) || []; + message.limitSellOrders = object.limit_sell_orders?.map(e => DerivativeLimitOrder.fromAmino(e)) || []; + message.marketSellOrders = object.market_sell_orders?.map(e => DerivativeMarketOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: ConditionalDerivativeOrderBook): ConditionalDerivativeOrderBookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.limitBuyOrders) { + obj.limit_buy_orders = message.limitBuyOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.limit_buy_orders = message.limitBuyOrders; + } + if (message.marketBuyOrders) { + obj.market_buy_orders = message.marketBuyOrders.map(e => e ? DerivativeMarketOrder.toAmino(e) : undefined); + } else { + obj.market_buy_orders = message.marketBuyOrders; + } + if (message.limitSellOrders) { + obj.limit_sell_orders = message.limitSellOrders.map(e => e ? DerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.limit_sell_orders = message.limitSellOrders; + } + if (message.marketSellOrders) { + obj.market_sell_orders = message.marketSellOrders.map(e => e ? DerivativeMarketOrder.toAmino(e) : undefined); + } else { + obj.market_sell_orders = message.marketSellOrders; + } + return obj; + }, + fromAminoMsg(object: ConditionalDerivativeOrderBookAminoMsg): ConditionalDerivativeOrderBook { + return ConditionalDerivativeOrderBook.fromAmino(object.value); + }, + fromProtoMsg(message: ConditionalDerivativeOrderBookProtoMsg): ConditionalDerivativeOrderBook { + return ConditionalDerivativeOrderBook.decode(message.value); + }, + toProto(message: ConditionalDerivativeOrderBook): Uint8Array { + return ConditionalDerivativeOrderBook.encode(message).finish(); + }, + toProtoMsg(message: ConditionalDerivativeOrderBook): ConditionalDerivativeOrderBookProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ConditionalDerivativeOrderBook", + value: ConditionalDerivativeOrderBook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConditionalDerivativeOrderBook.typeUrl, ConditionalDerivativeOrderBook); +function createBaseBalance(): Balance { + return { + subaccountId: "", + denom: "", + deposits: undefined + }; +} +export const Balance = { + typeUrl: "/injective.exchange.v1beta1.Balance", + is(o: any): o is Balance { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is BalanceAmino { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.subaccount_id === "string" && typeof o.denom === "string"); + }, + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.deposits !== undefined) { + Deposit.encode(message.deposits, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.deposits = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Balance { + const message = createBaseBalance(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.deposits = object.deposits !== undefined && object.deposits !== null ? Deposit.fromPartial(object.deposits) : undefined; + return message; + }, + fromAmino(object: BalanceAmino): Balance { + const message = createBaseBalance(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.deposits !== undefined && object.deposits !== null) { + message.deposits = Deposit.fromAmino(object.deposits); + } + return message; + }, + toAmino(message: Balance): BalanceAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.deposits = message.deposits ? Deposit.toAmino(message.deposits) : undefined; + return obj; + }, + fromAminoMsg(object: BalanceAminoMsg): Balance { + return Balance.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceProtoMsg): Balance { + return Balance.decode(message.value); + }, + toProto(message: Balance): Uint8Array { + return Balance.encode(message).finish(); + }, + toProtoMsg(message: Balance): BalanceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Balance", + value: Balance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Balance.typeUrl, Balance); +function createBaseDerivativePosition(): DerivativePosition { + return { + subaccountId: "", + marketId: "", + position: undefined + }; +} +export const DerivativePosition = { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition", + is(o: any): o is DerivativePosition { + return o && (o.$typeUrl === DerivativePosition.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is DerivativePositionAmino { + return o && (o.$typeUrl === DerivativePosition.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: DerivativePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.position !== undefined) { + Position.encode(message.position, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.position = Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativePosition { + const message = createBaseDerivativePosition(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; + return message; + }, + fromAmino(object: DerivativePositionAmino): DerivativePosition { + const message = createBaseDerivativePosition(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + return message; + }, + toAmino(message: DerivativePosition): DerivativePositionAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.position = message.position ? Position.toAmino(message.position) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativePositionAminoMsg): DerivativePosition { + return DerivativePosition.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativePositionProtoMsg): DerivativePosition { + return DerivativePosition.decode(message.value); + }, + toProto(message: DerivativePosition): Uint8Array { + return DerivativePosition.encode(message).finish(); + }, + toProtoMsg(message: DerivativePosition): DerivativePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativePosition", + value: DerivativePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativePosition.typeUrl, DerivativePosition); +function createBaseSubaccountNonce(): SubaccountNonce { + return { + subaccountId: "", + subaccountTradeNonce: SubaccountTradeNonce.fromPartial({}) + }; +} +export const SubaccountNonce = { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce", + is(o: any): o is SubaccountNonce { + return o && (o.$typeUrl === SubaccountNonce.typeUrl || typeof o.subaccountId === "string" && SubaccountTradeNonce.is(o.subaccountTradeNonce)); + }, + isAmino(o: any): o is SubaccountNonceAmino { + return o && (o.$typeUrl === SubaccountNonce.typeUrl || typeof o.subaccount_id === "string" && SubaccountTradeNonce.isAmino(o.subaccount_trade_nonce)); + }, + encode(message: SubaccountNonce, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.subaccountTradeNonce !== undefined) { + SubaccountTradeNonce.encode(message.subaccountTradeNonce, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountNonce { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountNonce(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.subaccountTradeNonce = SubaccountTradeNonce.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountNonce { + const message = createBaseSubaccountNonce(); + message.subaccountId = object.subaccountId ?? ""; + message.subaccountTradeNonce = object.subaccountTradeNonce !== undefined && object.subaccountTradeNonce !== null ? SubaccountTradeNonce.fromPartial(object.subaccountTradeNonce) : undefined; + return message; + }, + fromAmino(object: SubaccountNonceAmino): SubaccountNonce { + const message = createBaseSubaccountNonce(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.subaccount_trade_nonce !== undefined && object.subaccount_trade_nonce !== null) { + message.subaccountTradeNonce = SubaccountTradeNonce.fromAmino(object.subaccount_trade_nonce); + } + return message; + }, + toAmino(message: SubaccountNonce): SubaccountNonceAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.subaccount_trade_nonce = message.subaccountTradeNonce ? SubaccountTradeNonce.toAmino(message.subaccountTradeNonce) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountNonceAminoMsg): SubaccountNonce { + return SubaccountNonce.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountNonceProtoMsg): SubaccountNonce { + return SubaccountNonce.decode(message.value); + }, + toProto(message: SubaccountNonce): Uint8Array { + return SubaccountNonce.encode(message).finish(); + }, + toProtoMsg(message: SubaccountNonce): SubaccountNonceProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountNonce", + value: SubaccountNonce.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountNonce.typeUrl, SubaccountNonce); +function createBaseExpiryFuturesMarketInfoState(): ExpiryFuturesMarketInfoState { + return { + marketId: "", + marketInfo: undefined + }; +} +export const ExpiryFuturesMarketInfoState = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState", + is(o: any): o is ExpiryFuturesMarketInfoState { + return o && (o.$typeUrl === ExpiryFuturesMarketInfoState.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketInfoStateAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketInfoState.typeUrl || typeof o.market_id === "string"); + }, + encode(message: ExpiryFuturesMarketInfoState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.marketInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.marketInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketInfoState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketInfoState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.marketInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketInfoState { + const message = createBaseExpiryFuturesMarketInfoState(); + message.marketId = object.marketId ?? ""; + message.marketInfo = object.marketInfo !== undefined && object.marketInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.marketInfo) : undefined; + return message; + }, + fromAmino(object: ExpiryFuturesMarketInfoStateAmino): ExpiryFuturesMarketInfoState { + const message = createBaseExpiryFuturesMarketInfoState(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_info !== undefined && object.market_info !== null) { + message.marketInfo = ExpiryFuturesMarketInfo.fromAmino(object.market_info); + } + return message; + }, + toAmino(message: ExpiryFuturesMarketInfoState): ExpiryFuturesMarketInfoStateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_info = message.marketInfo ? ExpiryFuturesMarketInfo.toAmino(message.marketInfo) : undefined; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketInfoStateAminoMsg): ExpiryFuturesMarketInfoState { + return ExpiryFuturesMarketInfoState.fromAmino(object.value); + }, + fromProtoMsg(message: ExpiryFuturesMarketInfoStateProtoMsg): ExpiryFuturesMarketInfoState { + return ExpiryFuturesMarketInfoState.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketInfoState): Uint8Array { + return ExpiryFuturesMarketInfoState.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketInfoState): ExpiryFuturesMarketInfoStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketInfoState", + value: ExpiryFuturesMarketInfoState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketInfoState.typeUrl, ExpiryFuturesMarketInfoState); +function createBasePerpetualMarketFundingState(): PerpetualMarketFundingState { + return { + marketId: "", + funding: undefined + }; +} +export const PerpetualMarketFundingState = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState", + is(o: any): o is PerpetualMarketFundingState { + return o && (o.$typeUrl === PerpetualMarketFundingState.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is PerpetualMarketFundingStateAmino { + return o && (o.$typeUrl === PerpetualMarketFundingState.typeUrl || typeof o.market_id === "string"); + }, + encode(message: PerpetualMarketFundingState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.funding !== undefined) { + PerpetualMarketFunding.encode(message.funding, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketFundingState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketFundingState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.funding = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketFundingState { + const message = createBasePerpetualMarketFundingState(); + message.marketId = object.marketId ?? ""; + message.funding = object.funding !== undefined && object.funding !== null ? PerpetualMarketFunding.fromPartial(object.funding) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketFundingStateAmino): PerpetualMarketFundingState { + const message = createBasePerpetualMarketFundingState(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.funding !== undefined && object.funding !== null) { + message.funding = PerpetualMarketFunding.fromAmino(object.funding); + } + return message; + }, + toAmino(message: PerpetualMarketFundingState): PerpetualMarketFundingStateAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.funding = message.funding ? PerpetualMarketFunding.toAmino(message.funding) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketFundingStateAminoMsg): PerpetualMarketFundingState { + return PerpetualMarketFundingState.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketFundingStateProtoMsg): PerpetualMarketFundingState { + return PerpetualMarketFundingState.decode(message.value); + }, + toProto(message: PerpetualMarketFundingState): Uint8Array { + return PerpetualMarketFundingState.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketFundingState): PerpetualMarketFundingStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketFundingState", + value: PerpetualMarketFundingState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketFundingState.typeUrl, PerpetualMarketFundingState); +function createBaseFullGrantAuthorizations(): FullGrantAuthorizations { + return { + granter: "", + totalGrantAmount: "", + lastDelegationsCheckedTime: BigInt(0), + grants: [] + }; +} +export const FullGrantAuthorizations = { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations", + is(o: any): o is FullGrantAuthorizations { + return o && (o.$typeUrl === FullGrantAuthorizations.typeUrl || typeof o.granter === "string" && typeof o.totalGrantAmount === "string" && typeof o.lastDelegationsCheckedTime === "bigint" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is FullGrantAuthorizationsAmino { + return o && (o.$typeUrl === FullGrantAuthorizations.typeUrl || typeof o.granter === "string" && typeof o.total_grant_amount === "string" && typeof o.last_delegations_checked_time === "bigint" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: FullGrantAuthorizations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.totalGrantAmount !== "") { + writer.uint32(18).string(message.totalGrantAmount); + } + if (message.lastDelegationsCheckedTime !== BigInt(0)) { + writer.uint32(24).int64(message.lastDelegationsCheckedTime); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullGrantAuthorizations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullGrantAuthorizations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.totalGrantAmount = reader.string(); + break; + case 3: + message.lastDelegationsCheckedTime = reader.int64(); + break; + case 4: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullGrantAuthorizations { + const message = createBaseFullGrantAuthorizations(); + message.granter = object.granter ?? ""; + message.totalGrantAmount = object.totalGrantAmount ?? ""; + message.lastDelegationsCheckedTime = object.lastDelegationsCheckedTime !== undefined && object.lastDelegationsCheckedTime !== null ? BigInt(object.lastDelegationsCheckedTime.toString()) : BigInt(0); + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FullGrantAuthorizationsAmino): FullGrantAuthorizations { + const message = createBaseFullGrantAuthorizations(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.total_grant_amount !== undefined && object.total_grant_amount !== null) { + message.totalGrantAmount = object.total_grant_amount; + } + if (object.last_delegations_checked_time !== undefined && object.last_delegations_checked_time !== null) { + message.lastDelegationsCheckedTime = BigInt(object.last_delegations_checked_time); + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: FullGrantAuthorizations): FullGrantAuthorizationsAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.total_grant_amount = message.totalGrantAmount === "" ? undefined : message.totalGrantAmount; + obj.last_delegations_checked_time = message.lastDelegationsCheckedTime !== BigInt(0) ? message.lastDelegationsCheckedTime?.toString() : undefined; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: FullGrantAuthorizationsAminoMsg): FullGrantAuthorizations { + return FullGrantAuthorizations.fromAmino(object.value); + }, + fromProtoMsg(message: FullGrantAuthorizationsProtoMsg): FullGrantAuthorizations { + return FullGrantAuthorizations.decode(message.value); + }, + toProto(message: FullGrantAuthorizations): Uint8Array { + return FullGrantAuthorizations.encode(message).finish(); + }, + toProtoMsg(message: FullGrantAuthorizations): FullGrantAuthorizationsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullGrantAuthorizations", + value: FullGrantAuthorizations.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullGrantAuthorizations.typeUrl, FullGrantAuthorizations); +function createBaseFullActiveGrant(): FullActiveGrant { + return { + grantee: "", + activeGrant: undefined + }; +} +export const FullActiveGrant = { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant", + is(o: any): o is FullActiveGrant { + return o && (o.$typeUrl === FullActiveGrant.typeUrl || typeof o.grantee === "string"); + }, + isAmino(o: any): o is FullActiveGrantAmino { + return o && (o.$typeUrl === FullActiveGrant.typeUrl || typeof o.grantee === "string"); + }, + encode(message: FullActiveGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.activeGrant !== undefined) { + ActiveGrant.encode(message.activeGrant, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullActiveGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullActiveGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.activeGrant = ActiveGrant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullActiveGrant { + const message = createBaseFullActiveGrant(); + message.grantee = object.grantee ?? ""; + message.activeGrant = object.activeGrant !== undefined && object.activeGrant !== null ? ActiveGrant.fromPartial(object.activeGrant) : undefined; + return message; + }, + fromAmino(object: FullActiveGrantAmino): FullActiveGrant { + const message = createBaseFullActiveGrant(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.active_grant !== undefined && object.active_grant !== null) { + message.activeGrant = ActiveGrant.fromAmino(object.active_grant); + } + return message; + }, + toAmino(message: FullActiveGrant): FullActiveGrantAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.active_grant = message.activeGrant ? ActiveGrant.toAmino(message.activeGrant) : undefined; + return obj; + }, + fromAminoMsg(object: FullActiveGrantAminoMsg): FullActiveGrant { + return FullActiveGrant.fromAmino(object.value); + }, + fromProtoMsg(message: FullActiveGrantProtoMsg): FullActiveGrant { + return FullActiveGrant.decode(message.value); + }, + toProto(message: FullActiveGrant): Uint8Array { + return FullActiveGrant.encode(message).finish(); + }, + toProtoMsg(message: FullActiveGrant): FullActiveGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullActiveGrant", + value: FullActiveGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullActiveGrant.typeUrl, FullActiveGrant); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/proposal.ts b/libs/injectivejs/src/injective/exchange/v1beta1/proposal.ts new file mode 100644 index 00000000..320d2ad9 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/proposal.ts @@ -0,0 +1,4383 @@ +import { MarketStatus, DenomDecimals, DenomDecimalsAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, MarketFeeMultiplier, MarketFeeMultiplierAmino } from "./exchange"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalAmino } from "../../../cosmos/distribution/v1beta1/distribution"; +import { isSet, DeepPartial } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum ExchangeType { + EXCHANGE_UNSPECIFIED = 0, + SPOT = 1, + DERIVATIVES = 2, + UNRECOGNIZED = -1, +} +export const ExchangeTypeAmino = ExchangeType; +export function exchangeTypeFromJSON(object: any): ExchangeType { + switch (object) { + case 0: + case "EXCHANGE_UNSPECIFIED": + return ExchangeType.EXCHANGE_UNSPECIFIED; + case 1: + case "SPOT": + return ExchangeType.SPOT; + case 2: + case "DERIVATIVES": + return ExchangeType.DERIVATIVES; + case -1: + case "UNRECOGNIZED": + default: + return ExchangeType.UNRECOGNIZED; + } +} +export function exchangeTypeToJSON(object: ExchangeType): string { + switch (object) { + case ExchangeType.EXCHANGE_UNSPECIFIED: + return "EXCHANGE_UNSPECIFIED"; + case ExchangeType.SPOT: + return "SPOT"; + case ExchangeType.DERIVATIVES: + return "DERIVATIVES"; + case ExchangeType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface SpotMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** maker_fee_rate defines the trade fee rate for makers on the spot market */ + makerFeeRate?: string; + /** taker_fee_rate defines the trade fee rate for takers on the spot market */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the spot + * market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + status: MarketStatus; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; + adminInfo?: AdminInfo; +} +export interface SpotMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface SpotMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** maker_fee_rate defines the trade fee rate for makers on the spot market */ + maker_fee_rate?: string; + /** taker_fee_rate defines the trade fee rate for takers on the spot market */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the spot + * market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + status: MarketStatus; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; + admin_info?: AdminInfoAmino; +} +export interface SpotMarketParamUpdateProposalAminoMsg { + type: "exchange/SpotMarketParamUpdateProposal"; + value: SpotMarketParamUpdateProposalAmino; +} +export interface ExchangeEnableProposal { + title: string; + description: string; + exchangeType: ExchangeType; +} +export interface ExchangeEnableProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal"; + value: Uint8Array; +} +export interface ExchangeEnableProposalAmino { + title: string; + description: string; + exchangeType: ExchangeType; +} +export interface ExchangeEnableProposalAminoMsg { + type: "exchange/ExchangeEnableProposal"; + value: ExchangeEnableProposalAmino; +} +export interface BatchExchangeModificationProposal { + title: string; + description: string; + spotMarketParamUpdateProposals: SpotMarketParamUpdateProposal[]; + derivativeMarketParamUpdateProposals: DerivativeMarketParamUpdateProposal[]; + spotMarketLaunchProposals: SpotMarketLaunchProposal[]; + perpetualMarketLaunchProposals: PerpetualMarketLaunchProposal[]; + expiryFuturesMarketLaunchProposals: ExpiryFuturesMarketLaunchProposal[]; + tradingRewardCampaignUpdateProposal?: TradingRewardCampaignUpdateProposal; + binaryOptionsMarketLaunchProposals: BinaryOptionsMarketLaunchProposal[]; + binaryOptionsParamUpdateProposals: BinaryOptionsMarketParamUpdateProposal[]; + denomDecimalsUpdateProposal?: UpdateDenomDecimalsProposal; + feeDiscountProposal?: FeeDiscountProposal; + marketForcedSettlementProposals: MarketForcedSettlementProposal[]; +} +export interface BatchExchangeModificationProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal"; + value: Uint8Array; +} +export interface BatchExchangeModificationProposalAmino { + title: string; + description: string; + spot_market_param_update_proposals: SpotMarketParamUpdateProposalAmino[]; + derivative_market_param_update_proposals: DerivativeMarketParamUpdateProposalAmino[]; + spot_market_launch_proposals: SpotMarketLaunchProposalAmino[]; + perpetual_market_launch_proposals: PerpetualMarketLaunchProposalAmino[]; + expiry_futures_market_launch_proposals: ExpiryFuturesMarketLaunchProposalAmino[]; + trading_reward_campaign_update_proposal?: TradingRewardCampaignUpdateProposalAmino; + binary_options_market_launch_proposals: BinaryOptionsMarketLaunchProposalAmino[]; + binary_options_param_update_proposals: BinaryOptionsMarketParamUpdateProposalAmino[]; + denom_decimals_update_proposal?: UpdateDenomDecimalsProposalAmino; + fee_discount_proposal?: FeeDiscountProposalAmino; + market_forced_settlement_proposals: MarketForcedSettlementProposalAmino[]; +} +export interface BatchExchangeModificationProposalAminoMsg { + type: "exchange/BatchExchangeModificationProposal"; + value: BatchExchangeModificationProposalAmino; +} +/** + * SpotMarketLaunchProposal defines a SDK message for proposing a new spot + * market through governance + */ +export interface SpotMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + baseDenom: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + makerFeeRate?: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + takerFeeRate?: string; + /** min_notional defines the minimum notional for orders in the market */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface SpotMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal"; + value: Uint8Array; +} +/** + * SpotMarketLaunchProposal defines a SDK message for proposing a new spot + * market through governance + */ +export interface SpotMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + base_denom: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** maker_fee_rate defines the fee percentage makers pay when trading */ + maker_fee_rate?: string; + /** taker_fee_rate defines the fee percentage takers pay when trading */ + taker_fee_rate?: string; + /** min_notional defines the minimum notional for orders in the market */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface SpotMarketLaunchProposalAminoMsg { + type: "exchange/SpotMarketLaunchProposal"; + value: SpotMarketLaunchProposalAmino; +} +/** + * PerpetualMarketLaunchProposal defines a SDK message for proposing a new + * perpetual futures market through governance + */ +export interface PerpetualMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface PerpetualMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal"; + value: Uint8Array; +} +/** + * PerpetualMarketLaunchProposal defines a SDK message for proposing a new + * perpetual futures market through governance + */ +export interface PerpetualMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface PerpetualMarketLaunchProposalAminoMsg { + type: "exchange/PerpetualMarketLaunchProposal"; + value: PerpetualMarketLaunchProposalAmino; +} +export interface BinaryOptionsMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + makerFeeRate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminPermissions: number; +} +export interface BinaryOptionsMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal"; + value: Uint8Array; +} +export interface BinaryOptionsMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** maker_fee_rate defines the maker fee rate of a binary options market */ + maker_fee_rate: string; + /** taker_fee_rate defines the taker fee rate of a derivative market */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_permissions: number; +} +export interface BinaryOptionsMarketLaunchProposalAminoMsg { + type: "exchange/BinaryOptionsMarketLaunchProposal"; + value: BinaryOptionsMarketLaunchProposalAmino; +} +/** + * ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new + * expiry futures market through governance + */ +export interface ExpiryFuturesMarketLaunchProposal { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** Expiration time of the market */ + expiry: bigint; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; + adminInfo?: AdminInfo; +} +export interface ExpiryFuturesMarketLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal"; + value: Uint8Array; +} +/** + * ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new + * expiry futures market through governance + */ +export interface ExpiryFuturesMarketLaunchProposalAmino { + title: string; + description: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** Expiration time of the market */ + expiry: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; + admin_info?: AdminInfoAmino; +} +export interface ExpiryFuturesMarketLaunchProposalAminoMsg { + type: "exchange/ExpiryFuturesMarketLaunchProposal"; + value: ExpiryFuturesMarketLaunchProposalAmino; +} +export interface DerivativeMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio?: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio?: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + /** hourly_interest_rate defines the hourly interest rate */ + hourlyInterestRate?: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + hourlyFundingRateCap?: string; + status: MarketStatus; + oracleParams?: OracleParams; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; + adminInfo?: AdminInfo; +} +export interface DerivativeMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface DerivativeMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio?: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio?: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + /** hourly_interest_rate defines the hourly interest rate */ + HourlyInterestRate?: string; + /** + * hourly_funding_rate_cap defines the maximum absolute value of the hourly + * funding rate + */ + HourlyFundingRateCap?: string; + status: MarketStatus; + oracle_params?: OracleParamsAmino; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; + admin_info?: AdminInfoAmino; +} +export interface DerivativeMarketParamUpdateProposalAminoMsg { + type: "exchange/DerivativeMarketParamUpdateProposal"; + value: DerivativeMarketParamUpdateProposalAmino; +} +export interface AdminInfo { + admin: string; + adminPermissions: number; +} +export interface AdminInfoProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AdminInfo"; + value: Uint8Array; +} +export interface AdminInfoAmino { + admin: string; + admin_permissions: number; +} +export interface AdminInfoAminoMsg { + type: "/injective.exchange.v1beta1.AdminInfo"; + value: AdminInfoAmino; +} +export interface MarketForcedSettlementProposal { + title: string; + description: string; + marketId: string; + settlementPrice?: string; +} +export interface MarketForcedSettlementProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal"; + value: Uint8Array; +} +export interface MarketForcedSettlementProposalAmino { + title: string; + description: string; + market_id: string; + settlement_price?: string; +} +export interface MarketForcedSettlementProposalAminoMsg { + type: "exchange/MarketForcedSettlementProposal"; + value: MarketForcedSettlementProposalAmino; +} +export interface UpdateDenomDecimalsProposal { + title: string; + description: string; + denomDecimals: DenomDecimals[]; +} +export interface UpdateDenomDecimalsProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal"; + value: Uint8Array; +} +export interface UpdateDenomDecimalsProposalAmino { + title: string; + description: string; + denom_decimals: DenomDecimalsAmino[]; +} +export interface UpdateDenomDecimalsProposalAminoMsg { + type: "exchange/UpdateDenomDecimalsProposal"; + value: UpdateDenomDecimalsProposalAmino; +} +export interface BinaryOptionsMarketParamUpdateProposal { + title: string; + description: string; + marketId: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + makerFeeRate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + takerFeeRate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayerFeeShareRate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize?: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** new price at which market will be settled */ + settlementPrice?: string; + /** admin of the market */ + admin: string; + status: MarketStatus; + oracleParams?: ProviderOracleParams; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional?: string; +} +export interface BinaryOptionsMarketParamUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal"; + value: Uint8Array; +} +export interface BinaryOptionsMarketParamUpdateProposalAmino { + title: string; + description: string; + market_id: string; + /** + * maker_fee_rate defines the exchange trade fee for makers for the derivative + * market + */ + maker_fee_rate?: string; + /** + * taker_fee_rate defines the exchange trade fee for takers for the derivative + * market + */ + taker_fee_rate?: string; + /** + * relayer_fee_share_rate defines the relayer fee share rate for the + * derivative market + */ + relayer_fee_share_rate?: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size?: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size?: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** new price at which market will be settled */ + settlement_price?: string; + /** admin of the market */ + admin: string; + status: MarketStatus; + oracle_params?: ProviderOracleParamsAmino; + ticker?: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional?: string; +} +export interface BinaryOptionsMarketParamUpdateProposalAminoMsg { + type: "exchange/BinaryOptionsMarketParamUpdateProposal"; + value: BinaryOptionsMarketParamUpdateProposalAmino; +} +export interface ProviderOracleParams { + /** Oracle base currency */ + symbol: string; + /** Oracle quote currency */ + provider: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; +} +export interface ProviderOracleParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams"; + value: Uint8Array; +} +export interface ProviderOracleParamsAmino { + /** Oracle base currency */ + symbol: string; + /** Oracle quote currency */ + provider: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; +} +export interface ProviderOracleParamsAminoMsg { + type: "/injective.exchange.v1beta1.ProviderOracleParams"; + value: ProviderOracleParamsAmino; +} +export interface OracleParams { + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; +} +export interface OracleParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OracleParams"; + value: Uint8Array; +} +export interface OracleParamsAmino { + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; +} +export interface OracleParamsAminoMsg { + type: "/injective.exchange.v1beta1.OracleParams"; + value: OracleParamsAmino; +} +export interface TradingRewardCampaignLaunchProposal { + title: string; + description: string; + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPools: CampaignRewardPool[]; +} +export interface TradingRewardCampaignLaunchProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal"; + value: Uint8Array; +} +export interface TradingRewardCampaignLaunchProposalAmino { + title: string; + description: string; + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools: CampaignRewardPoolAmino[]; +} +export interface TradingRewardCampaignLaunchProposalAminoMsg { + type: "exchange/TradingRewardCampaignLaunchProposal"; + value: TradingRewardCampaignLaunchProposalAmino; +} +export interface TradingRewardCampaignUpdateProposal { + title: string; + description: string; + campaignInfo?: TradingRewardCampaignInfo; + campaignRewardPoolsAdditions: CampaignRewardPool[]; + campaignRewardPoolsUpdates: CampaignRewardPool[]; +} +export interface TradingRewardCampaignUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal"; + value: Uint8Array; +} +export interface TradingRewardCampaignUpdateProposalAmino { + title: string; + description: string; + campaign_info?: TradingRewardCampaignInfoAmino; + campaign_reward_pools_additions: CampaignRewardPoolAmino[]; + campaign_reward_pools_updates: CampaignRewardPoolAmino[]; +} +export interface TradingRewardCampaignUpdateProposalAminoMsg { + type: "exchange/TradingRewardCampaignUpdateProposal"; + value: TradingRewardCampaignUpdateProposalAmino; +} +export interface RewardPointUpdate { + accountAddress: string; + /** new_points overwrites the current trading reward points for the account */ + newPoints: string; +} +export interface RewardPointUpdateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate"; + value: Uint8Array; +} +export interface RewardPointUpdateAmino { + account_address: string; + /** new_points overwrites the current trading reward points for the account */ + new_points: string; +} +export interface RewardPointUpdateAminoMsg { + type: "/injective.exchange.v1beta1.RewardPointUpdate"; + value: RewardPointUpdateAmino; +} +export interface TradingRewardPendingPointsUpdateProposal { + title: string; + description: string; + pendingPoolTimestamp: bigint; + rewardPointUpdates: RewardPointUpdate[]; +} +export interface TradingRewardPendingPointsUpdateProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal"; + value: Uint8Array; +} +export interface TradingRewardPendingPointsUpdateProposalAmino { + title: string; + description: string; + pending_pool_timestamp: string; + reward_point_updates: RewardPointUpdateAmino[]; +} +export interface TradingRewardPendingPointsUpdateProposalAminoMsg { + type: "exchange/TradingRewardPendingPointsUpdateProposal"; + value: TradingRewardPendingPointsUpdateProposalAmino; +} +export interface FeeDiscountProposal { + title: string; + description: string; + schedule?: FeeDiscountSchedule; +} +export interface FeeDiscountProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal"; + value: Uint8Array; +} +export interface FeeDiscountProposalAmino { + title: string; + description: string; + schedule?: FeeDiscountScheduleAmino; +} +export interface FeeDiscountProposalAminoMsg { + type: "exchange/FeeDiscountProposal"; + value: FeeDiscountProposalAmino; +} +export interface BatchCommunityPoolSpendProposal { + title: string; + description: string; + proposals: CommunityPoolSpendProposal[]; +} +export interface BatchCommunityPoolSpendProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal"; + value: Uint8Array; +} +export interface BatchCommunityPoolSpendProposalAmino { + title: string; + description: string; + proposals: CommunityPoolSpendProposalAmino[]; +} +export interface BatchCommunityPoolSpendProposalAminoMsg { + type: "exchange/BatchCommunityPoolSpendProposal"; + value: BatchCommunityPoolSpendProposalAmino; +} +/** + * AtomicMarketOrderFeeMultiplierScheduleProposal defines a SDK message for + * proposing new atomic take fee multipliers for specified markets + */ +export interface AtomicMarketOrderFeeMultiplierScheduleProposal { + title: string; + description: string; + marketFeeMultipliers: MarketFeeMultiplier[]; +} +export interface AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal"; + value: Uint8Array; +} +/** + * AtomicMarketOrderFeeMultiplierScheduleProposal defines a SDK message for + * proposing new atomic take fee multipliers for specified markets + */ +export interface AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + title: string; + description: string; + market_fee_multipliers: MarketFeeMultiplierAmino[]; +} +export interface AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg { + type: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal"; + value: AtomicMarketOrderFeeMultiplierScheduleProposalAmino; +} +function createBaseSpotMarketParamUpdateProposal(): SpotMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + status: 0, + ticker: undefined, + minNotional: undefined, + adminInfo: undefined + }; +} +export const SpotMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal", + aminoType: "exchange/SpotMarketParamUpdateProposal", + is(o: any): o is SpotMarketParamUpdateProposal { + return o && (o.$typeUrl === SpotMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && isSet(o.status)); + }, + isAmino(o: any): o is SpotMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === SpotMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && isSet(o.status)); + }, + encode(message: SpotMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(58).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(66).string(message.minQuantityTickSize); + } + if (message.status !== 0) { + writer.uint32(72).int32(message.status); + } + if (message.ticker !== undefined) { + writer.uint32(82).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(90).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(98).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.minPriceTickSize = reader.string(); + break; + case 8: + message.minQuantityTickSize = reader.string(); + break; + case 9: + message.status = (reader.int32() as any); + break; + case 10: + message.ticker = reader.string(); + break; + case 11: + message.minNotional = reader.string(); + break; + case 12: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketParamUpdateProposal { + const message = createBaseSpotMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.status = object.status ?? 0; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: SpotMarketParamUpdateProposalAmino): SpotMarketParamUpdateProposal { + const message = createBaseSpotMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.status = message.status === 0 ? undefined : message.status; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: SpotMarketParamUpdateProposalAminoMsg): SpotMarketParamUpdateProposal { + return SpotMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/SpotMarketParamUpdateProposal", + value: SpotMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SpotMarketParamUpdateProposalProtoMsg): SpotMarketParamUpdateProposal { + return SpotMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: SpotMarketParamUpdateProposal): Uint8Array { + return SpotMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketParamUpdateProposal): SpotMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketParamUpdateProposal", + value: SpotMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketParamUpdateProposal.typeUrl, SpotMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotMarketParamUpdateProposal.aminoType, SpotMarketParamUpdateProposal.typeUrl); +function createBaseExchangeEnableProposal(): ExchangeEnableProposal { + return { + title: "", + description: "", + exchangeType: 0 + }; +} +export const ExchangeEnableProposal = { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal", + aminoType: "exchange/ExchangeEnableProposal", + is(o: any): o is ExchangeEnableProposal { + return o && (o.$typeUrl === ExchangeEnableProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && isSet(o.exchangeType)); + }, + isAmino(o: any): o is ExchangeEnableProposalAmino { + return o && (o.$typeUrl === ExchangeEnableProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && isSet(o.exchangeType)); + }, + encode(message: ExchangeEnableProposal, 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.exchangeType !== 0) { + writer.uint32(24).int32(message.exchangeType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExchangeEnableProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeEnableProposal(); + 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.exchangeType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExchangeEnableProposal { + const message = createBaseExchangeEnableProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.exchangeType = object.exchangeType ?? 0; + return message; + }, + fromAmino(object: ExchangeEnableProposalAmino): ExchangeEnableProposal { + const message = createBaseExchangeEnableProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.exchangeType !== undefined && object.exchangeType !== null) { + message.exchangeType = object.exchangeType; + } + return message; + }, + toAmino(message: ExchangeEnableProposal): ExchangeEnableProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.exchangeType = message.exchangeType === 0 ? undefined : message.exchangeType; + return obj; + }, + fromAminoMsg(object: ExchangeEnableProposalAminoMsg): ExchangeEnableProposal { + return ExchangeEnableProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExchangeEnableProposal): ExchangeEnableProposalAminoMsg { + return { + type: "exchange/ExchangeEnableProposal", + value: ExchangeEnableProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExchangeEnableProposalProtoMsg): ExchangeEnableProposal { + return ExchangeEnableProposal.decode(message.value); + }, + toProto(message: ExchangeEnableProposal): Uint8Array { + return ExchangeEnableProposal.encode(message).finish(); + }, + toProtoMsg(message: ExchangeEnableProposal): ExchangeEnableProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExchangeEnableProposal", + value: ExchangeEnableProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExchangeEnableProposal.typeUrl, ExchangeEnableProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExchangeEnableProposal.aminoType, ExchangeEnableProposal.typeUrl); +function createBaseBatchExchangeModificationProposal(): BatchExchangeModificationProposal { + return { + title: "", + description: "", + spotMarketParamUpdateProposals: [], + derivativeMarketParamUpdateProposals: [], + spotMarketLaunchProposals: [], + perpetualMarketLaunchProposals: [], + expiryFuturesMarketLaunchProposals: [], + tradingRewardCampaignUpdateProposal: undefined, + binaryOptionsMarketLaunchProposals: [], + binaryOptionsParamUpdateProposals: [], + denomDecimalsUpdateProposal: undefined, + feeDiscountProposal: undefined, + marketForcedSettlementProposals: [] + }; +} +export const BatchExchangeModificationProposal = { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal", + aminoType: "exchange/BatchExchangeModificationProposal", + is(o: any): o is BatchExchangeModificationProposal { + return o && (o.$typeUrl === BatchExchangeModificationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.spotMarketParamUpdateProposals) && (!o.spotMarketParamUpdateProposals.length || SpotMarketParamUpdateProposal.is(o.spotMarketParamUpdateProposals[0])) && Array.isArray(o.derivativeMarketParamUpdateProposals) && (!o.derivativeMarketParamUpdateProposals.length || DerivativeMarketParamUpdateProposal.is(o.derivativeMarketParamUpdateProposals[0])) && Array.isArray(o.spotMarketLaunchProposals) && (!o.spotMarketLaunchProposals.length || SpotMarketLaunchProposal.is(o.spotMarketLaunchProposals[0])) && Array.isArray(o.perpetualMarketLaunchProposals) && (!o.perpetualMarketLaunchProposals.length || PerpetualMarketLaunchProposal.is(o.perpetualMarketLaunchProposals[0])) && Array.isArray(o.expiryFuturesMarketLaunchProposals) && (!o.expiryFuturesMarketLaunchProposals.length || ExpiryFuturesMarketLaunchProposal.is(o.expiryFuturesMarketLaunchProposals[0])) && Array.isArray(o.binaryOptionsMarketLaunchProposals) && (!o.binaryOptionsMarketLaunchProposals.length || BinaryOptionsMarketLaunchProposal.is(o.binaryOptionsMarketLaunchProposals[0])) && Array.isArray(o.binaryOptionsParamUpdateProposals) && (!o.binaryOptionsParamUpdateProposals.length || BinaryOptionsMarketParamUpdateProposal.is(o.binaryOptionsParamUpdateProposals[0])) && Array.isArray(o.marketForcedSettlementProposals) && (!o.marketForcedSettlementProposals.length || MarketForcedSettlementProposal.is(o.marketForcedSettlementProposals[0]))); + }, + isAmino(o: any): o is BatchExchangeModificationProposalAmino { + return o && (o.$typeUrl === BatchExchangeModificationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.spot_market_param_update_proposals) && (!o.spot_market_param_update_proposals.length || SpotMarketParamUpdateProposal.isAmino(o.spot_market_param_update_proposals[0])) && Array.isArray(o.derivative_market_param_update_proposals) && (!o.derivative_market_param_update_proposals.length || DerivativeMarketParamUpdateProposal.isAmino(o.derivative_market_param_update_proposals[0])) && Array.isArray(o.spot_market_launch_proposals) && (!o.spot_market_launch_proposals.length || SpotMarketLaunchProposal.isAmino(o.spot_market_launch_proposals[0])) && Array.isArray(o.perpetual_market_launch_proposals) && (!o.perpetual_market_launch_proposals.length || PerpetualMarketLaunchProposal.isAmino(o.perpetual_market_launch_proposals[0])) && Array.isArray(o.expiry_futures_market_launch_proposals) && (!o.expiry_futures_market_launch_proposals.length || ExpiryFuturesMarketLaunchProposal.isAmino(o.expiry_futures_market_launch_proposals[0])) && Array.isArray(o.binary_options_market_launch_proposals) && (!o.binary_options_market_launch_proposals.length || BinaryOptionsMarketLaunchProposal.isAmino(o.binary_options_market_launch_proposals[0])) && Array.isArray(o.binary_options_param_update_proposals) && (!o.binary_options_param_update_proposals.length || BinaryOptionsMarketParamUpdateProposal.isAmino(o.binary_options_param_update_proposals[0])) && Array.isArray(o.market_forced_settlement_proposals) && (!o.market_forced_settlement_proposals.length || MarketForcedSettlementProposal.isAmino(o.market_forced_settlement_proposals[0]))); + }, + encode(message: BatchExchangeModificationProposal, 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.spotMarketParamUpdateProposals) { + SpotMarketParamUpdateProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.derivativeMarketParamUpdateProposals) { + DerivativeMarketParamUpdateProposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.spotMarketLaunchProposals) { + SpotMarketLaunchProposal.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.perpetualMarketLaunchProposals) { + PerpetualMarketLaunchProposal.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.expiryFuturesMarketLaunchProposals) { + ExpiryFuturesMarketLaunchProposal.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.tradingRewardCampaignUpdateProposal !== undefined) { + TradingRewardCampaignUpdateProposal.encode(message.tradingRewardCampaignUpdateProposal, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketLaunchProposals) { + BinaryOptionsMarketLaunchProposal.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.binaryOptionsParamUpdateProposals) { + BinaryOptionsMarketParamUpdateProposal.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.denomDecimalsUpdateProposal !== undefined) { + UpdateDenomDecimalsProposal.encode(message.denomDecimalsUpdateProposal, writer.uint32(90).fork()).ldelim(); + } + if (message.feeDiscountProposal !== undefined) { + FeeDiscountProposal.encode(message.feeDiscountProposal, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.marketForcedSettlementProposals) { + MarketForcedSettlementProposal.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchExchangeModificationProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchExchangeModificationProposal(); + 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.spotMarketParamUpdateProposals.push(SpotMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 4: + message.derivativeMarketParamUpdateProposals.push(DerivativeMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 5: + message.spotMarketLaunchProposals.push(SpotMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 6: + message.perpetualMarketLaunchProposals.push(PerpetualMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 7: + message.expiryFuturesMarketLaunchProposals.push(ExpiryFuturesMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 8: + message.tradingRewardCampaignUpdateProposal = TradingRewardCampaignUpdateProposal.decode(reader, reader.uint32()); + break; + case 9: + message.binaryOptionsMarketLaunchProposals.push(BinaryOptionsMarketLaunchProposal.decode(reader, reader.uint32())); + break; + case 10: + message.binaryOptionsParamUpdateProposals.push(BinaryOptionsMarketParamUpdateProposal.decode(reader, reader.uint32())); + break; + case 11: + message.denomDecimalsUpdateProposal = UpdateDenomDecimalsProposal.decode(reader, reader.uint32()); + break; + case 12: + message.feeDiscountProposal = FeeDiscountProposal.decode(reader, reader.uint32()); + break; + case 13: + message.marketForcedSettlementProposals.push(MarketForcedSettlementProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchExchangeModificationProposal { + const message = createBaseBatchExchangeModificationProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.spotMarketParamUpdateProposals = object.spotMarketParamUpdateProposals?.map(e => SpotMarketParamUpdateProposal.fromPartial(e)) || []; + message.derivativeMarketParamUpdateProposals = object.derivativeMarketParamUpdateProposals?.map(e => DerivativeMarketParamUpdateProposal.fromPartial(e)) || []; + message.spotMarketLaunchProposals = object.spotMarketLaunchProposals?.map(e => SpotMarketLaunchProposal.fromPartial(e)) || []; + message.perpetualMarketLaunchProposals = object.perpetualMarketLaunchProposals?.map(e => PerpetualMarketLaunchProposal.fromPartial(e)) || []; + message.expiryFuturesMarketLaunchProposals = object.expiryFuturesMarketLaunchProposals?.map(e => ExpiryFuturesMarketLaunchProposal.fromPartial(e)) || []; + message.tradingRewardCampaignUpdateProposal = object.tradingRewardCampaignUpdateProposal !== undefined && object.tradingRewardCampaignUpdateProposal !== null ? TradingRewardCampaignUpdateProposal.fromPartial(object.tradingRewardCampaignUpdateProposal) : undefined; + message.binaryOptionsMarketLaunchProposals = object.binaryOptionsMarketLaunchProposals?.map(e => BinaryOptionsMarketLaunchProposal.fromPartial(e)) || []; + message.binaryOptionsParamUpdateProposals = object.binaryOptionsParamUpdateProposals?.map(e => BinaryOptionsMarketParamUpdateProposal.fromPartial(e)) || []; + message.denomDecimalsUpdateProposal = object.denomDecimalsUpdateProposal !== undefined && object.denomDecimalsUpdateProposal !== null ? UpdateDenomDecimalsProposal.fromPartial(object.denomDecimalsUpdateProposal) : undefined; + message.feeDiscountProposal = object.feeDiscountProposal !== undefined && object.feeDiscountProposal !== null ? FeeDiscountProposal.fromPartial(object.feeDiscountProposal) : undefined; + message.marketForcedSettlementProposals = object.marketForcedSettlementProposals?.map(e => MarketForcedSettlementProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchExchangeModificationProposalAmino): BatchExchangeModificationProposal { + const message = createBaseBatchExchangeModificationProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.spotMarketParamUpdateProposals = object.spot_market_param_update_proposals?.map(e => SpotMarketParamUpdateProposal.fromAmino(e)) || []; + message.derivativeMarketParamUpdateProposals = object.derivative_market_param_update_proposals?.map(e => DerivativeMarketParamUpdateProposal.fromAmino(e)) || []; + message.spotMarketLaunchProposals = object.spot_market_launch_proposals?.map(e => SpotMarketLaunchProposal.fromAmino(e)) || []; + message.perpetualMarketLaunchProposals = object.perpetual_market_launch_proposals?.map(e => PerpetualMarketLaunchProposal.fromAmino(e)) || []; + message.expiryFuturesMarketLaunchProposals = object.expiry_futures_market_launch_proposals?.map(e => ExpiryFuturesMarketLaunchProposal.fromAmino(e)) || []; + if (object.trading_reward_campaign_update_proposal !== undefined && object.trading_reward_campaign_update_proposal !== null) { + message.tradingRewardCampaignUpdateProposal = TradingRewardCampaignUpdateProposal.fromAmino(object.trading_reward_campaign_update_proposal); + } + message.binaryOptionsMarketLaunchProposals = object.binary_options_market_launch_proposals?.map(e => BinaryOptionsMarketLaunchProposal.fromAmino(e)) || []; + message.binaryOptionsParamUpdateProposals = object.binary_options_param_update_proposals?.map(e => BinaryOptionsMarketParamUpdateProposal.fromAmino(e)) || []; + if (object.denom_decimals_update_proposal !== undefined && object.denom_decimals_update_proposal !== null) { + message.denomDecimalsUpdateProposal = UpdateDenomDecimalsProposal.fromAmino(object.denom_decimals_update_proposal); + } + if (object.fee_discount_proposal !== undefined && object.fee_discount_proposal !== null) { + message.feeDiscountProposal = FeeDiscountProposal.fromAmino(object.fee_discount_proposal); + } + message.marketForcedSettlementProposals = object.market_forced_settlement_proposals?.map(e => MarketForcedSettlementProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.spotMarketParamUpdateProposals) { + obj.spot_market_param_update_proposals = message.spotMarketParamUpdateProposals.map(e => e ? SpotMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.spot_market_param_update_proposals = message.spotMarketParamUpdateProposals; + } + if (message.derivativeMarketParamUpdateProposals) { + obj.derivative_market_param_update_proposals = message.derivativeMarketParamUpdateProposals.map(e => e ? DerivativeMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.derivative_market_param_update_proposals = message.derivativeMarketParamUpdateProposals; + } + if (message.spotMarketLaunchProposals) { + obj.spot_market_launch_proposals = message.spotMarketLaunchProposals.map(e => e ? SpotMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.spot_market_launch_proposals = message.spotMarketLaunchProposals; + } + if (message.perpetualMarketLaunchProposals) { + obj.perpetual_market_launch_proposals = message.perpetualMarketLaunchProposals.map(e => e ? PerpetualMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.perpetual_market_launch_proposals = message.perpetualMarketLaunchProposals; + } + if (message.expiryFuturesMarketLaunchProposals) { + obj.expiry_futures_market_launch_proposals = message.expiryFuturesMarketLaunchProposals.map(e => e ? ExpiryFuturesMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.expiry_futures_market_launch_proposals = message.expiryFuturesMarketLaunchProposals; + } + obj.trading_reward_campaign_update_proposal = message.tradingRewardCampaignUpdateProposal ? TradingRewardCampaignUpdateProposal.toAmino(message.tradingRewardCampaignUpdateProposal) : undefined; + if (message.binaryOptionsMarketLaunchProposals) { + obj.binary_options_market_launch_proposals = message.binaryOptionsMarketLaunchProposals.map(e => e ? BinaryOptionsMarketLaunchProposal.toAmino(e) : undefined); + } else { + obj.binary_options_market_launch_proposals = message.binaryOptionsMarketLaunchProposals; + } + if (message.binaryOptionsParamUpdateProposals) { + obj.binary_options_param_update_proposals = message.binaryOptionsParamUpdateProposals.map(e => e ? BinaryOptionsMarketParamUpdateProposal.toAmino(e) : undefined); + } else { + obj.binary_options_param_update_proposals = message.binaryOptionsParamUpdateProposals; + } + obj.denom_decimals_update_proposal = message.denomDecimalsUpdateProposal ? UpdateDenomDecimalsProposal.toAmino(message.denomDecimalsUpdateProposal) : undefined; + obj.fee_discount_proposal = message.feeDiscountProposal ? FeeDiscountProposal.toAmino(message.feeDiscountProposal) : undefined; + if (message.marketForcedSettlementProposals) { + obj.market_forced_settlement_proposals = message.marketForcedSettlementProposals.map(e => e ? MarketForcedSettlementProposal.toAmino(e) : undefined); + } else { + obj.market_forced_settlement_proposals = message.marketForcedSettlementProposals; + } + return obj; + }, + fromAminoMsg(object: BatchExchangeModificationProposalAminoMsg): BatchExchangeModificationProposal { + return BatchExchangeModificationProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalAminoMsg { + return { + type: "exchange/BatchExchangeModificationProposal", + value: BatchExchangeModificationProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchExchangeModificationProposalProtoMsg): BatchExchangeModificationProposal { + return BatchExchangeModificationProposal.decode(message.value); + }, + toProto(message: BatchExchangeModificationProposal): Uint8Array { + return BatchExchangeModificationProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchExchangeModificationProposal): BatchExchangeModificationProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchExchangeModificationProposal", + value: BatchExchangeModificationProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchExchangeModificationProposal.typeUrl, BatchExchangeModificationProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchExchangeModificationProposal.aminoType, BatchExchangeModificationProposal.typeUrl); +function createBaseSpotMarketLaunchProposal(): SpotMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + baseDenom: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + minNotional: "", + adminInfo: undefined + }; +} +export const SpotMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal", + aminoType: "exchange/SpotMarketLaunchProposal", + is(o: any): o is SpotMarketLaunchProposal { + return o && (o.$typeUrl === SpotMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is SpotMarketLaunchProposalAmino { + return o && (o.$typeUrl === SpotMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: SpotMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(34).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(42).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(50).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(58).string(message.minQuantityTickSize); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(66).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(74).string(message.takerFeeRate); + } + if (message.minNotional !== "") { + writer.uint32(82).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.baseDenom = reader.string(); + break; + case 5: + message.quoteDenom = reader.string(); + break; + case 6: + message.minPriceTickSize = reader.string(); + break; + case 7: + message.minQuantityTickSize = reader.string(); + break; + case 8: + message.makerFeeRate = reader.string(); + break; + case 9: + message.takerFeeRate = reader.string(); + break; + case 10: + message.minNotional = reader.string(); + break; + case 11: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketLaunchProposal { + const message = createBaseSpotMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: SpotMarketLaunchProposalAmino): SpotMarketLaunchProposal { + const message = createBaseSpotMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: SpotMarketLaunchProposalAminoMsg): SpotMarketLaunchProposal { + return SpotMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalAminoMsg { + return { + type: "exchange/SpotMarketLaunchProposal", + value: SpotMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SpotMarketLaunchProposalProtoMsg): SpotMarketLaunchProposal { + return SpotMarketLaunchProposal.decode(message.value); + }, + toProto(message: SpotMarketLaunchProposal): Uint8Array { + return SpotMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketLaunchProposal): SpotMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketLaunchProposal", + value: SpotMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketLaunchProposal.typeUrl, SpotMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotMarketLaunchProposal.aminoType, SpotMarketLaunchProposal.typeUrl); +function createBasePerpetualMarketLaunchProposal(): PerpetualMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminInfo: undefined + }; +} +export const PerpetualMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal", + aminoType: "exchange/PerpetualMarketLaunchProposal", + is(o: any): o is PerpetualMarketLaunchProposal { + return o && (o.$typeUrl === PerpetualMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is PerpetualMarketLaunchProposalAmino { + return o && (o.$typeUrl === PerpetualMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: PerpetualMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(42).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(50).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(64).int32(message.oracleType); + } + if (message.initialMarginRatio !== "") { + writer.uint32(74).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(82).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(90).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(98).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.oracleBase = reader.string(); + break; + case 6: + message.oracleQuote = reader.string(); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.oracleType = (reader.int32() as any); + break; + case 9: + message.initialMarginRatio = reader.string(); + break; + case 10: + message.maintenanceMarginRatio = reader.string(); + break; + case 11: + message.makerFeeRate = reader.string(); + break; + case 12: + message.takerFeeRate = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + case 16: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketLaunchProposal { + const message = createBasePerpetualMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketLaunchProposalAmino): PerpetualMarketLaunchProposal { + const message = createBasePerpetualMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketLaunchProposalAminoMsg): PerpetualMarketLaunchProposal { + return PerpetualMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalAminoMsg { + return { + type: "exchange/PerpetualMarketLaunchProposal", + value: PerpetualMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: PerpetualMarketLaunchProposalProtoMsg): PerpetualMarketLaunchProposal { + return PerpetualMarketLaunchProposal.decode(message.value); + }, + toProto(message: PerpetualMarketLaunchProposal): Uint8Array { + return PerpetualMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketLaunchProposal): PerpetualMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketLaunchProposal", + value: PerpetualMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketLaunchProposal.typeUrl, PerpetualMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(PerpetualMarketLaunchProposal.aminoType, PerpetualMarketLaunchProposal.typeUrl); +function createBaseBinaryOptionsMarketLaunchProposal(): BinaryOptionsMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminPermissions: 0 + }; +} +export const BinaryOptionsMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal", + aminoType: "exchange/BinaryOptionsMarketLaunchProposal", + is(o: any): o is BinaryOptionsMarketLaunchProposal { + return o && (o.$typeUrl === BinaryOptionsMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is BinaryOptionsMarketLaunchProposalAmino { + return o && (o.$typeUrl === BinaryOptionsMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: BinaryOptionsMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(34).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(42).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(64).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(82).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(90).string(message.quoteDenom); + } + if (message.makerFeeRate !== "") { + writer.uint32(98).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(106).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(114).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(122).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(130).string(message.minNotional); + } + if (message.adminPermissions !== 0) { + writer.uint32(136).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.oracleSymbol = reader.string(); + break; + case 5: + message.oracleProvider = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.expirationTimestamp = reader.int64(); + break; + case 9: + message.settlementTimestamp = reader.int64(); + break; + case 10: + message.admin = reader.string(); + break; + case 11: + message.quoteDenom = reader.string(); + break; + case 12: + message.makerFeeRate = reader.string(); + break; + case 13: + message.takerFeeRate = reader.string(); + break; + case 14: + message.minPriceTickSize = reader.string(); + break; + case 15: + message.minQuantityTickSize = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarketLaunchProposal { + const message = createBaseBinaryOptionsMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: BinaryOptionsMarketLaunchProposalAmino): BinaryOptionsMarketLaunchProposal { + const message = createBaseBinaryOptionsMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketLaunchProposalAminoMsg): BinaryOptionsMarketLaunchProposal { + return BinaryOptionsMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalAminoMsg { + return { + type: "exchange/BinaryOptionsMarketLaunchProposal", + value: BinaryOptionsMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BinaryOptionsMarketLaunchProposalProtoMsg): BinaryOptionsMarketLaunchProposal { + return BinaryOptionsMarketLaunchProposal.decode(message.value); + }, + toProto(message: BinaryOptionsMarketLaunchProposal): Uint8Array { + return BinaryOptionsMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarketLaunchProposal): BinaryOptionsMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketLaunchProposal", + value: BinaryOptionsMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarketLaunchProposal.typeUrl, BinaryOptionsMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BinaryOptionsMarketLaunchProposal.aminoType, BinaryOptionsMarketLaunchProposal.typeUrl); +function createBaseExpiryFuturesMarketLaunchProposal(): ExpiryFuturesMarketLaunchProposal { + return { + title: "", + description: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + expiry: BigInt(0), + initialMarginRatio: "", + maintenanceMarginRatio: "", + makerFeeRate: "", + takerFeeRate: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "", + adminInfo: undefined + }; +} +export const ExpiryFuturesMarketLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal", + aminoType: "exchange/ExpiryFuturesMarketLaunchProposal", + is(o: any): o is ExpiryFuturesMarketLaunchProposal { + return o && (o.$typeUrl === ExpiryFuturesMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.expiry === "bigint" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is ExpiryFuturesMarketLaunchProposalAmino { + return o && (o.$typeUrl === ExpiryFuturesMarketLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.expiry === "bigint" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: ExpiryFuturesMarketLaunchProposal, 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.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(42).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(50).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(64).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(72).int64(message.expiry); + } + if (message.initialMarginRatio !== "") { + writer.uint32(82).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(90).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== "") { + writer.uint32(98).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(106).string(message.takerFeeRate); + } + if (message.minPriceTickSize !== "") { + writer.uint32(114).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(122).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(130).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExpiryFuturesMarketLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpiryFuturesMarketLaunchProposal(); + 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.ticker = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.oracleBase = reader.string(); + break; + case 6: + message.oracleQuote = reader.string(); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.oracleType = (reader.int32() as any); + break; + case 9: + message.expiry = reader.int64(); + break; + case 10: + message.initialMarginRatio = reader.string(); + break; + case 11: + message.maintenanceMarginRatio = reader.string(); + break; + case 12: + message.makerFeeRate = reader.string(); + break; + case 13: + message.takerFeeRate = reader.string(); + break; + case 14: + message.minPriceTickSize = reader.string(); + break; + case 15: + message.minQuantityTickSize = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExpiryFuturesMarketLaunchProposal { + const message = createBaseExpiryFuturesMarketLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: ExpiryFuturesMarketLaunchProposalAmino): ExpiryFuturesMarketLaunchProposal { + const message = createBaseExpiryFuturesMarketLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: ExpiryFuturesMarketLaunchProposalAminoMsg): ExpiryFuturesMarketLaunchProposal { + return ExpiryFuturesMarketLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalAminoMsg { + return { + type: "exchange/ExpiryFuturesMarketLaunchProposal", + value: ExpiryFuturesMarketLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExpiryFuturesMarketLaunchProposalProtoMsg): ExpiryFuturesMarketLaunchProposal { + return ExpiryFuturesMarketLaunchProposal.decode(message.value); + }, + toProto(message: ExpiryFuturesMarketLaunchProposal): Uint8Array { + return ExpiryFuturesMarketLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: ExpiryFuturesMarketLaunchProposal): ExpiryFuturesMarketLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ExpiryFuturesMarketLaunchProposal", + value: ExpiryFuturesMarketLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExpiryFuturesMarketLaunchProposal.typeUrl, ExpiryFuturesMarketLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExpiryFuturesMarketLaunchProposal.aminoType, ExpiryFuturesMarketLaunchProposal.typeUrl); +function createBaseDerivativeMarketParamUpdateProposal(): DerivativeMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + initialMarginRatio: undefined, + maintenanceMarginRatio: undefined, + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + hourlyInterestRate: undefined, + hourlyFundingRateCap: undefined, + status: 0, + oracleParams: undefined, + ticker: undefined, + minNotional: undefined, + adminInfo: undefined + }; +} +export const DerivativeMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal", + aminoType: "exchange/DerivativeMarketParamUpdateProposal", + is(o: any): o is DerivativeMarketParamUpdateProposal { + return o && (o.$typeUrl === DerivativeMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && isSet(o.status)); + }, + isAmino(o: any): o is DerivativeMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === DerivativeMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && isSet(o.status)); + }, + encode(message: DerivativeMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.initialMarginRatio !== undefined) { + writer.uint32(34).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== undefined) { + writer.uint32(42).string(message.maintenanceMarginRatio); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(50).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(58).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(66).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(74).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(82).string(message.minQuantityTickSize); + } + if (message.hourlyInterestRate !== undefined) { + writer.uint32(90).string(message.hourlyInterestRate); + } + if (message.hourlyFundingRateCap !== undefined) { + writer.uint32(98).string(message.hourlyFundingRateCap); + } + if (message.status !== 0) { + writer.uint32(104).int32(message.status); + } + if (message.oracleParams !== undefined) { + OracleParams.encode(message.oracleParams, writer.uint32(114).fork()).ldelim(); + } + if (message.ticker !== undefined) { + writer.uint32(122).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(130).string(message.minNotional); + } + if (message.adminInfo !== undefined) { + AdminInfo.encode(message.adminInfo, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.initialMarginRatio = reader.string(); + break; + case 5: + message.maintenanceMarginRatio = reader.string(); + break; + case 6: + message.makerFeeRate = reader.string(); + break; + case 7: + message.takerFeeRate = reader.string(); + break; + case 8: + message.relayerFeeShareRate = reader.string(); + break; + case 9: + message.minPriceTickSize = reader.string(); + break; + case 10: + message.minQuantityTickSize = reader.string(); + break; + case 11: + message.hourlyInterestRate = reader.string(); + break; + case 12: + message.hourlyFundingRateCap = reader.string(); + break; + case 13: + message.status = (reader.int32() as any); + break; + case 14: + message.oracleParams = OracleParams.decode(reader, reader.uint32()); + break; + case 15: + message.ticker = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + case 17: + message.adminInfo = AdminInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketParamUpdateProposal { + const message = createBaseDerivativeMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? undefined; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? undefined; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.hourlyInterestRate = object.hourlyInterestRate ?? undefined; + message.hourlyFundingRateCap = object.hourlyFundingRateCap ?? undefined; + message.status = object.status ?? 0; + message.oracleParams = object.oracleParams !== undefined && object.oracleParams !== null ? OracleParams.fromPartial(object.oracleParams) : undefined; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + message.adminInfo = object.adminInfo !== undefined && object.adminInfo !== null ? AdminInfo.fromPartial(object.adminInfo) : undefined; + return message; + }, + fromAmino(object: DerivativeMarketParamUpdateProposalAmino): DerivativeMarketParamUpdateProposal { + const message = createBaseDerivativeMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.HourlyInterestRate !== undefined && object.HourlyInterestRate !== null) { + message.hourlyInterestRate = object.HourlyInterestRate; + } + if (object.HourlyFundingRateCap !== undefined && object.HourlyFundingRateCap !== null) { + message.hourlyFundingRateCap = object.HourlyFundingRateCap; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.oracle_params !== undefined && object.oracle_params !== null) { + message.oracleParams = OracleParams.fromAmino(object.oracle_params); + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + if (object.admin_info !== undefined && object.admin_info !== null) { + message.adminInfo = AdminInfo.fromAmino(object.admin_info); + } + return message; + }, + toAmino(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.initial_margin_ratio = message.initialMarginRatio === null ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === null ? undefined : message.maintenanceMarginRatio; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.HourlyInterestRate = message.hourlyInterestRate === null ? undefined : message.hourlyInterestRate; + obj.HourlyFundingRateCap = message.hourlyFundingRateCap === null ? undefined : message.hourlyFundingRateCap; + obj.status = message.status === 0 ? undefined : message.status; + obj.oracle_params = message.oracleParams ? OracleParams.toAmino(message.oracleParams) : undefined; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + obj.admin_info = message.adminInfo ? AdminInfo.toAmino(message.adminInfo) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeMarketParamUpdateProposalAminoMsg): DerivativeMarketParamUpdateProposal { + return DerivativeMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/DerivativeMarketParamUpdateProposal", + value: DerivativeMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: DerivativeMarketParamUpdateProposalProtoMsg): DerivativeMarketParamUpdateProposal { + return DerivativeMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: DerivativeMarketParamUpdateProposal): Uint8Array { + return DerivativeMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketParamUpdateProposal): DerivativeMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketParamUpdateProposal", + value: DerivativeMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketParamUpdateProposal.typeUrl, DerivativeMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(DerivativeMarketParamUpdateProposal.aminoType, DerivativeMarketParamUpdateProposal.typeUrl); +function createBaseAdminInfo(): AdminInfo { + return { + admin: "", + adminPermissions: 0 + }; +} +export const AdminInfo = { + typeUrl: "/injective.exchange.v1beta1.AdminInfo", + is(o: any): o is AdminInfo { + return o && (o.$typeUrl === AdminInfo.typeUrl || typeof o.admin === "string" && typeof o.adminPermissions === "number"); + }, + isAmino(o: any): o is AdminInfoAmino { + return o && (o.$typeUrl === AdminInfo.typeUrl || typeof o.admin === "string" && typeof o.admin_permissions === "number"); + }, + encode(message: AdminInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.adminPermissions !== 0) { + writer.uint32(16).uint32(message.adminPermissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AdminInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAdminInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.adminPermissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AdminInfo { + const message = createBaseAdminInfo(); + message.admin = object.admin ?? ""; + message.adminPermissions = object.adminPermissions ?? 0; + return message; + }, + fromAmino(object: AdminInfoAmino): AdminInfo { + const message = createBaseAdminInfo(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_permissions !== undefined && object.admin_permissions !== null) { + message.adminPermissions = object.admin_permissions; + } + return message; + }, + toAmino(message: AdminInfo): AdminInfoAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.admin_permissions = message.adminPermissions === 0 ? undefined : message.adminPermissions; + return obj; + }, + fromAminoMsg(object: AdminInfoAminoMsg): AdminInfo { + return AdminInfo.fromAmino(object.value); + }, + fromProtoMsg(message: AdminInfoProtoMsg): AdminInfo { + return AdminInfo.decode(message.value); + }, + toProto(message: AdminInfo): Uint8Array { + return AdminInfo.encode(message).finish(); + }, + toProtoMsg(message: AdminInfo): AdminInfoProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AdminInfo", + value: AdminInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AdminInfo.typeUrl, AdminInfo); +function createBaseMarketForcedSettlementProposal(): MarketForcedSettlementProposal { + return { + title: "", + description: "", + marketId: "", + settlementPrice: undefined + }; +} +export const MarketForcedSettlementProposal = { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal", + aminoType: "exchange/MarketForcedSettlementProposal", + is(o: any): o is MarketForcedSettlementProposal { + return o && (o.$typeUrl === MarketForcedSettlementProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MarketForcedSettlementProposalAmino { + return o && (o.$typeUrl === MarketForcedSettlementProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string"); + }, + encode(message: MarketForcedSettlementProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.settlementPrice !== undefined) { + writer.uint32(34).string(message.settlementPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketForcedSettlementProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketForcedSettlementProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.settlementPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MarketForcedSettlementProposal { + const message = createBaseMarketForcedSettlementProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + return message; + }, + fromAmino(object: MarketForcedSettlementProposalAmino): MarketForcedSettlementProposal { + const message = createBaseMarketForcedSettlementProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + return message; + }, + toAmino(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + return obj; + }, + fromAminoMsg(object: MarketForcedSettlementProposalAminoMsg): MarketForcedSettlementProposal { + return MarketForcedSettlementProposal.fromAmino(object.value); + }, + toAminoMsg(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalAminoMsg { + return { + type: "exchange/MarketForcedSettlementProposal", + value: MarketForcedSettlementProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MarketForcedSettlementProposalProtoMsg): MarketForcedSettlementProposal { + return MarketForcedSettlementProposal.decode(message.value); + }, + toProto(message: MarketForcedSettlementProposal): Uint8Array { + return MarketForcedSettlementProposal.encode(message).finish(); + }, + toProtoMsg(message: MarketForcedSettlementProposal): MarketForcedSettlementProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MarketForcedSettlementProposal", + value: MarketForcedSettlementProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MarketForcedSettlementProposal.typeUrl, MarketForcedSettlementProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MarketForcedSettlementProposal.aminoType, MarketForcedSettlementProposal.typeUrl); +function createBaseUpdateDenomDecimalsProposal(): UpdateDenomDecimalsProposal { + return { + title: "", + description: "", + denomDecimals: [] + }; +} +export const UpdateDenomDecimalsProposal = { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal", + aminoType: "exchange/UpdateDenomDecimalsProposal", + is(o: any): o is UpdateDenomDecimalsProposal { + return o && (o.$typeUrl === UpdateDenomDecimalsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0]))); + }, + isAmino(o: any): o is UpdateDenomDecimalsProposalAmino { + return o && (o.$typeUrl === UpdateDenomDecimalsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0]))); + }, + encode(message: UpdateDenomDecimalsProposal, 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.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateDenomDecimalsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateDenomDecimalsProposal(); + 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.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UpdateDenomDecimalsProposal { + const message = createBaseUpdateDenomDecimalsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateDenomDecimalsProposalAmino): UpdateDenomDecimalsProposal { + const message = createBaseUpdateDenomDecimalsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + return obj; + }, + fromAminoMsg(object: UpdateDenomDecimalsProposalAminoMsg): UpdateDenomDecimalsProposal { + return UpdateDenomDecimalsProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalAminoMsg { + return { + type: "exchange/UpdateDenomDecimalsProposal", + value: UpdateDenomDecimalsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateDenomDecimalsProposalProtoMsg): UpdateDenomDecimalsProposal { + return UpdateDenomDecimalsProposal.decode(message.value); + }, + toProto(message: UpdateDenomDecimalsProposal): Uint8Array { + return UpdateDenomDecimalsProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateDenomDecimalsProposal): UpdateDenomDecimalsProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.UpdateDenomDecimalsProposal", + value: UpdateDenomDecimalsProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UpdateDenomDecimalsProposal.typeUrl, UpdateDenomDecimalsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateDenomDecimalsProposal.aminoType, UpdateDenomDecimalsProposal.typeUrl); +function createBaseBinaryOptionsMarketParamUpdateProposal(): BinaryOptionsMarketParamUpdateProposal { + return { + title: "", + description: "", + marketId: "", + makerFeeRate: undefined, + takerFeeRate: undefined, + relayerFeeShareRate: undefined, + minPriceTickSize: undefined, + minQuantityTickSize: undefined, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + settlementPrice: undefined, + admin: "", + status: 0, + oracleParams: undefined, + ticker: undefined, + minNotional: undefined + }; +} +export const BinaryOptionsMarketParamUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal", + aminoType: "exchange/BinaryOptionsMarketParamUpdateProposal", + is(o: any): o is BinaryOptionsMarketParamUpdateProposal { + return o && (o.$typeUrl === BinaryOptionsMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && isSet(o.status)); + }, + isAmino(o: any): o is BinaryOptionsMarketParamUpdateProposalAmino { + return o && (o.$typeUrl === BinaryOptionsMarketParamUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && isSet(o.status)); + }, + encode(message: BinaryOptionsMarketParamUpdateProposal, 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.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.makerFeeRate !== undefined) { + writer.uint32(34).string(message.makerFeeRate); + } + if (message.takerFeeRate !== undefined) { + writer.uint32(42).string(message.takerFeeRate); + } + if (message.relayerFeeShareRate !== undefined) { + writer.uint32(50).string(message.relayerFeeShareRate); + } + if (message.minPriceTickSize !== undefined) { + writer.uint32(58).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== undefined) { + writer.uint32(66).string(message.minQuantityTickSize); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(80).int64(message.settlementTimestamp); + } + if (message.settlementPrice !== undefined) { + writer.uint32(90).string(message.settlementPrice); + } + if (message.admin !== "") { + writer.uint32(98).string(message.admin); + } + if (message.status !== 0) { + writer.uint32(104).int32(message.status); + } + if (message.oracleParams !== undefined) { + ProviderOracleParams.encode(message.oracleParams, writer.uint32(114).fork()).ldelim(); + } + if (message.ticker !== undefined) { + writer.uint32(122).string(message.ticker); + } + if (message.minNotional !== undefined) { + writer.uint32(130).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BinaryOptionsMarketParamUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + 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.marketId = reader.string(); + break; + case 4: + message.makerFeeRate = reader.string(); + break; + case 5: + message.takerFeeRate = reader.string(); + break; + case 6: + message.relayerFeeShareRate = reader.string(); + break; + case 7: + message.minPriceTickSize = reader.string(); + break; + case 8: + message.minQuantityTickSize = reader.string(); + break; + case 9: + message.expirationTimestamp = reader.int64(); + break; + case 10: + message.settlementTimestamp = reader.int64(); + break; + case 11: + message.settlementPrice = reader.string(); + break; + case 12: + message.admin = reader.string(); + break; + case 13: + message.status = (reader.int32() as any); + break; + case 14: + message.oracleParams = ProviderOracleParams.decode(reader, reader.uint32()); + break; + case 15: + message.ticker = reader.string(); + break; + case 16: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BinaryOptionsMarketParamUpdateProposal { + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketId = object.marketId ?? ""; + message.makerFeeRate = object.makerFeeRate ?? undefined; + message.takerFeeRate = object.takerFeeRate ?? undefined; + message.relayerFeeShareRate = object.relayerFeeShareRate ?? undefined; + message.minPriceTickSize = object.minPriceTickSize ?? undefined; + message.minQuantityTickSize = object.minQuantityTickSize ?? undefined; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.settlementPrice = object.settlementPrice ?? undefined; + message.admin = object.admin ?? ""; + message.status = object.status ?? 0; + message.oracleParams = object.oracleParams !== undefined && object.oracleParams !== null ? ProviderOracleParams.fromPartial(object.oracleParams) : undefined; + message.ticker = object.ticker ?? undefined; + message.minNotional = object.minNotional ?? undefined; + return message; + }, + fromAmino(object: BinaryOptionsMarketParamUpdateProposalAmino): BinaryOptionsMarketParamUpdateProposal { + const message = createBaseBinaryOptionsMarketParamUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.relayer_fee_share_rate !== undefined && object.relayer_fee_share_rate !== null) { + message.relayerFeeShareRate = object.relayer_fee_share_rate; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.oracle_params !== undefined && object.oracle_params !== null) { + message.oracleParams = ProviderOracleParams.fromAmino(object.oracle_params); + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.maker_fee_rate = message.makerFeeRate === null ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === null ? undefined : message.takerFeeRate; + obj.relayer_fee_share_rate = message.relayerFeeShareRate === null ? undefined : message.relayerFeeShareRate; + obj.min_price_tick_size = message.minPriceTickSize === null ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === null ? undefined : message.minQuantityTickSize; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.status = message.status === 0 ? undefined : message.status; + obj.oracle_params = message.oracleParams ? ProviderOracleParams.toAmino(message.oracleParams) : undefined; + obj.ticker = message.ticker === null ? undefined : message.ticker; + obj.min_notional = message.minNotional === null ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: BinaryOptionsMarketParamUpdateProposalAminoMsg): BinaryOptionsMarketParamUpdateProposal { + return BinaryOptionsMarketParamUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalAminoMsg { + return { + type: "exchange/BinaryOptionsMarketParamUpdateProposal", + value: BinaryOptionsMarketParamUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BinaryOptionsMarketParamUpdateProposalProtoMsg): BinaryOptionsMarketParamUpdateProposal { + return BinaryOptionsMarketParamUpdateProposal.decode(message.value); + }, + toProto(message: BinaryOptionsMarketParamUpdateProposal): Uint8Array { + return BinaryOptionsMarketParamUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: BinaryOptionsMarketParamUpdateProposal): BinaryOptionsMarketParamUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BinaryOptionsMarketParamUpdateProposal", + value: BinaryOptionsMarketParamUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BinaryOptionsMarketParamUpdateProposal.typeUrl, BinaryOptionsMarketParamUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BinaryOptionsMarketParamUpdateProposal.aminoType, BinaryOptionsMarketParamUpdateProposal.typeUrl); +function createBaseProviderOracleParams(): ProviderOracleParams { + return { + symbol: "", + provider: "", + oracleScaleFactor: 0, + oracleType: 0 + }; +} +export const ProviderOracleParams = { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams", + is(o: any): o is ProviderOracleParams { + return o && (o.$typeUrl === ProviderOracleParams.typeUrl || typeof o.symbol === "string" && typeof o.provider === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType)); + }, + isAmino(o: any): o is ProviderOracleParamsAmino { + return o && (o.$typeUrl === ProviderOracleParams.typeUrl || typeof o.symbol === "string" && typeof o.provider === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type)); + }, + encode(message: ProviderOracleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.provider !== "") { + writer.uint32(18).string(message.provider); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(24).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderOracleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderOracleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.provider = reader.string(); + break; + case 3: + message.oracleScaleFactor = reader.uint32(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderOracleParams { + const message = createBaseProviderOracleParams(); + message.symbol = object.symbol ?? ""; + message.provider = object.provider ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: ProviderOracleParamsAmino): ProviderOracleParams { + const message = createBaseProviderOracleParams(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: ProviderOracleParams): ProviderOracleParamsAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: ProviderOracleParamsAminoMsg): ProviderOracleParams { + return ProviderOracleParams.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderOracleParamsProtoMsg): ProviderOracleParams { + return ProviderOracleParams.decode(message.value); + }, + toProto(message: ProviderOracleParams): Uint8Array { + return ProviderOracleParams.encode(message).finish(); + }, + toProtoMsg(message: ProviderOracleParams): ProviderOracleParamsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.ProviderOracleParams", + value: ProviderOracleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderOracleParams.typeUrl, ProviderOracleParams); +function createBaseOracleParams(): OracleParams { + return { + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0 + }; +} +export const OracleParams = { + typeUrl: "/injective.exchange.v1beta1.OracleParams", + is(o: any): o is OracleParams { + return o && (o.$typeUrl === OracleParams.typeUrl || typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType)); + }, + isAmino(o: any): o is OracleParamsAmino { + return o && (o.$typeUrl === OracleParams.typeUrl || typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type)); + }, + encode(message: OracleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracleBase !== "") { + writer.uint32(10).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(18).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(24).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(32).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracleBase = reader.string(); + break; + case 2: + message.oracleQuote = reader.string(); + break; + case 3: + message.oracleScaleFactor = reader.uint32(); + break; + case 4: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleParams { + const message = createBaseOracleParams(); + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: OracleParamsAmino): OracleParams { + const message = createBaseOracleParams(); + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: OracleParams): OracleParamsAmino { + const obj: any = {}; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: OracleParamsAminoMsg): OracleParams { + return OracleParams.fromAmino(object.value); + }, + fromProtoMsg(message: OracleParamsProtoMsg): OracleParams { + return OracleParams.decode(message.value); + }, + toProto(message: OracleParams): Uint8Array { + return OracleParams.encode(message).finish(); + }, + toProtoMsg(message: OracleParams): OracleParamsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OracleParams", + value: OracleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleParams.typeUrl, OracleParams); +function createBaseTradingRewardCampaignLaunchProposal(): TradingRewardCampaignLaunchProposal { + return { + title: "", + description: "", + campaignInfo: undefined, + campaignRewardPools: [] + }; +} +export const TradingRewardCampaignLaunchProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal", + aminoType: "exchange/TradingRewardCampaignLaunchProposal", + is(o: any): o is TradingRewardCampaignLaunchProposal { + return o && (o.$typeUrl === TradingRewardCampaignLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaignRewardPools) && (!o.campaignRewardPools.length || CampaignRewardPool.is(o.campaignRewardPools[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignLaunchProposalAmino { + return o && (o.$typeUrl === TradingRewardCampaignLaunchProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaign_reward_pools) && (!o.campaign_reward_pools.length || CampaignRewardPool.isAmino(o.campaign_reward_pools[0]))); + }, + encode(message: TradingRewardCampaignLaunchProposal, 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.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.campaignRewardPools) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignLaunchProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignLaunchProposal(); + 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.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 4: + message.campaignRewardPools.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignLaunchProposal { + const message = createBaseTradingRewardCampaignLaunchProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPools = object.campaignRewardPools?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignLaunchProposalAmino): TradingRewardCampaignLaunchProposal { + const message = createBaseTradingRewardCampaignLaunchProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPools = object.campaign_reward_pools?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPools) { + obj.campaign_reward_pools = message.campaignRewardPools.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools = message.campaignRewardPools; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignLaunchProposalAminoMsg): TradingRewardCampaignLaunchProposal { + return TradingRewardCampaignLaunchProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalAminoMsg { + return { + type: "exchange/TradingRewardCampaignLaunchProposal", + value: TradingRewardCampaignLaunchProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardCampaignLaunchProposalProtoMsg): TradingRewardCampaignLaunchProposal { + return TradingRewardCampaignLaunchProposal.decode(message.value); + }, + toProto(message: TradingRewardCampaignLaunchProposal): Uint8Array { + return TradingRewardCampaignLaunchProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignLaunchProposal): TradingRewardCampaignLaunchProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignLaunchProposal", + value: TradingRewardCampaignLaunchProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignLaunchProposal.typeUrl, TradingRewardCampaignLaunchProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardCampaignLaunchProposal.aminoType, TradingRewardCampaignLaunchProposal.typeUrl); +function createBaseTradingRewardCampaignUpdateProposal(): TradingRewardCampaignUpdateProposal { + return { + title: "", + description: "", + campaignInfo: undefined, + campaignRewardPoolsAdditions: [], + campaignRewardPoolsUpdates: [] + }; +} +export const TradingRewardCampaignUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal", + aminoType: "exchange/TradingRewardCampaignUpdateProposal", + is(o: any): o is TradingRewardCampaignUpdateProposal { + return o && (o.$typeUrl === TradingRewardCampaignUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaignRewardPoolsAdditions) && (!o.campaignRewardPoolsAdditions.length || CampaignRewardPool.is(o.campaignRewardPoolsAdditions[0])) && Array.isArray(o.campaignRewardPoolsUpdates) && (!o.campaignRewardPoolsUpdates.length || CampaignRewardPool.is(o.campaignRewardPoolsUpdates[0]))); + }, + isAmino(o: any): o is TradingRewardCampaignUpdateProposalAmino { + return o && (o.$typeUrl === TradingRewardCampaignUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.campaign_reward_pools_additions) && (!o.campaign_reward_pools_additions.length || CampaignRewardPool.isAmino(o.campaign_reward_pools_additions[0])) && Array.isArray(o.campaign_reward_pools_updates) && (!o.campaign_reward_pools_updates.length || CampaignRewardPool.isAmino(o.campaign_reward_pools_updates[0]))); + }, + encode(message: TradingRewardCampaignUpdateProposal, 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.campaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.campaignInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.campaignRewardPoolsAdditions) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.campaignRewardPoolsUpdates) { + CampaignRewardPool.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardCampaignUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardCampaignUpdateProposal(); + 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.campaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 4: + message.campaignRewardPoolsAdditions.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 5: + message.campaignRewardPoolsUpdates.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardCampaignUpdateProposal { + const message = createBaseTradingRewardCampaignUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.campaignInfo = object.campaignInfo !== undefined && object.campaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.campaignInfo) : undefined; + message.campaignRewardPoolsAdditions = object.campaignRewardPoolsAdditions?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.campaignRewardPoolsUpdates = object.campaignRewardPoolsUpdates?.map(e => CampaignRewardPool.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardCampaignUpdateProposalAmino): TradingRewardCampaignUpdateProposal { + const message = createBaseTradingRewardCampaignUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.campaign_info !== undefined && object.campaign_info !== null) { + message.campaignInfo = TradingRewardCampaignInfo.fromAmino(object.campaign_info); + } + message.campaignRewardPoolsAdditions = object.campaign_reward_pools_additions?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.campaignRewardPoolsUpdates = object.campaign_reward_pools_updates?.map(e => CampaignRewardPool.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.campaign_info = message.campaignInfo ? TradingRewardCampaignInfo.toAmino(message.campaignInfo) : undefined; + if (message.campaignRewardPoolsAdditions) { + obj.campaign_reward_pools_additions = message.campaignRewardPoolsAdditions.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools_additions = message.campaignRewardPoolsAdditions; + } + if (message.campaignRewardPoolsUpdates) { + obj.campaign_reward_pools_updates = message.campaignRewardPoolsUpdates.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.campaign_reward_pools_updates = message.campaignRewardPoolsUpdates; + } + return obj; + }, + fromAminoMsg(object: TradingRewardCampaignUpdateProposalAminoMsg): TradingRewardCampaignUpdateProposal { + return TradingRewardCampaignUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalAminoMsg { + return { + type: "exchange/TradingRewardCampaignUpdateProposal", + value: TradingRewardCampaignUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardCampaignUpdateProposalProtoMsg): TradingRewardCampaignUpdateProposal { + return TradingRewardCampaignUpdateProposal.decode(message.value); + }, + toProto(message: TradingRewardCampaignUpdateProposal): Uint8Array { + return TradingRewardCampaignUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardCampaignUpdateProposal): TradingRewardCampaignUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardCampaignUpdateProposal", + value: TradingRewardCampaignUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardCampaignUpdateProposal.typeUrl, TradingRewardCampaignUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardCampaignUpdateProposal.aminoType, TradingRewardCampaignUpdateProposal.typeUrl); +function createBaseRewardPointUpdate(): RewardPointUpdate { + return { + accountAddress: "", + newPoints: "" + }; +} +export const RewardPointUpdate = { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate", + is(o: any): o is RewardPointUpdate { + return o && (o.$typeUrl === RewardPointUpdate.typeUrl || typeof o.accountAddress === "string" && typeof o.newPoints === "string"); + }, + isAmino(o: any): o is RewardPointUpdateAmino { + return o && (o.$typeUrl === RewardPointUpdate.typeUrl || typeof o.account_address === "string" && typeof o.new_points === "string"); + }, + encode(message: RewardPointUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + if (message.newPoints !== "") { + writer.uint32(98).string(message.newPoints); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RewardPointUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardPointUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + case 12: + message.newPoints = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RewardPointUpdate { + const message = createBaseRewardPointUpdate(); + message.accountAddress = object.accountAddress ?? ""; + message.newPoints = object.newPoints ?? ""; + return message; + }, + fromAmino(object: RewardPointUpdateAmino): RewardPointUpdate { + const message = createBaseRewardPointUpdate(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + if (object.new_points !== undefined && object.new_points !== null) { + message.newPoints = object.new_points; + } + return message; + }, + toAmino(message: RewardPointUpdate): RewardPointUpdateAmino { + const obj: any = {}; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + obj.new_points = message.newPoints === "" ? undefined : message.newPoints; + return obj; + }, + fromAminoMsg(object: RewardPointUpdateAminoMsg): RewardPointUpdate { + return RewardPointUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: RewardPointUpdateProtoMsg): RewardPointUpdate { + return RewardPointUpdate.decode(message.value); + }, + toProto(message: RewardPointUpdate): Uint8Array { + return RewardPointUpdate.encode(message).finish(); + }, + toProtoMsg(message: RewardPointUpdate): RewardPointUpdateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.RewardPointUpdate", + value: RewardPointUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RewardPointUpdate.typeUrl, RewardPointUpdate); +function createBaseTradingRewardPendingPointsUpdateProposal(): TradingRewardPendingPointsUpdateProposal { + return { + title: "", + description: "", + pendingPoolTimestamp: BigInt(0), + rewardPointUpdates: [] + }; +} +export const TradingRewardPendingPointsUpdateProposal = { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal", + aminoType: "exchange/TradingRewardPendingPointsUpdateProposal", + is(o: any): o is TradingRewardPendingPointsUpdateProposal { + return o && (o.$typeUrl === TradingRewardPendingPointsUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pendingPoolTimestamp === "bigint" && Array.isArray(o.rewardPointUpdates) && (!o.rewardPointUpdates.length || RewardPointUpdate.is(o.rewardPointUpdates[0]))); + }, + isAmino(o: any): o is TradingRewardPendingPointsUpdateProposalAmino { + return o && (o.$typeUrl === TradingRewardPendingPointsUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pending_pool_timestamp === "bigint" && Array.isArray(o.reward_point_updates) && (!o.reward_point_updates.length || RewardPointUpdate.isAmino(o.reward_point_updates[0]))); + }, + encode(message: TradingRewardPendingPointsUpdateProposal, 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.pendingPoolTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.pendingPoolTimestamp); + } + for (const v of message.rewardPointUpdates) { + RewardPointUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardPendingPointsUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + 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.pendingPoolTimestamp = reader.int64(); + break; + case 4: + message.rewardPointUpdates.push(RewardPointUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradingRewardPendingPointsUpdateProposal { + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.pendingPoolTimestamp = object.pendingPoolTimestamp !== undefined && object.pendingPoolTimestamp !== null ? BigInt(object.pendingPoolTimestamp.toString()) : BigInt(0); + message.rewardPointUpdates = object.rewardPointUpdates?.map(e => RewardPointUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardPendingPointsUpdateProposalAmino): TradingRewardPendingPointsUpdateProposal { + const message = createBaseTradingRewardPendingPointsUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.pending_pool_timestamp !== undefined && object.pending_pool_timestamp !== null) { + message.pendingPoolTimestamp = BigInt(object.pending_pool_timestamp); + } + message.rewardPointUpdates = object.reward_point_updates?.map(e => RewardPointUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.pending_pool_timestamp = message.pendingPoolTimestamp !== BigInt(0) ? message.pendingPoolTimestamp?.toString() : undefined; + if (message.rewardPointUpdates) { + obj.reward_point_updates = message.rewardPointUpdates.map(e => e ? RewardPointUpdate.toAmino(e) : undefined); + } else { + obj.reward_point_updates = message.rewardPointUpdates; + } + return obj; + }, + fromAminoMsg(object: TradingRewardPendingPointsUpdateProposalAminoMsg): TradingRewardPendingPointsUpdateProposal { + return TradingRewardPendingPointsUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalAminoMsg { + return { + type: "exchange/TradingRewardPendingPointsUpdateProposal", + value: TradingRewardPendingPointsUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TradingRewardPendingPointsUpdateProposalProtoMsg): TradingRewardPendingPointsUpdateProposal { + return TradingRewardPendingPointsUpdateProposal.decode(message.value); + }, + toProto(message: TradingRewardPendingPointsUpdateProposal): Uint8Array { + return TradingRewardPendingPointsUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardPendingPointsUpdateProposal): TradingRewardPendingPointsUpdateProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradingRewardPendingPointsUpdateProposal", + value: TradingRewardPendingPointsUpdateProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingRewardPendingPointsUpdateProposal.typeUrl, TradingRewardPendingPointsUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingRewardPendingPointsUpdateProposal.aminoType, TradingRewardPendingPointsUpdateProposal.typeUrl); +function createBaseFeeDiscountProposal(): FeeDiscountProposal { + return { + title: "", + description: "", + schedule: undefined + }; +} +export const FeeDiscountProposal = { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal", + aminoType: "exchange/FeeDiscountProposal", + is(o: any): o is FeeDiscountProposal { + return o && (o.$typeUrl === FeeDiscountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is FeeDiscountProposalAmino { + return o && (o.$typeUrl === FeeDiscountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: FeeDiscountProposal, 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.schedule !== undefined) { + FeeDiscountSchedule.encode(message.schedule, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeDiscountProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeeDiscountProposal(); + 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.schedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeeDiscountProposal { + const message = createBaseFeeDiscountProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.schedule = object.schedule !== undefined && object.schedule !== null ? FeeDiscountSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: FeeDiscountProposalAmino): FeeDiscountProposal { + const message = createBaseFeeDiscountProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = FeeDiscountSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: FeeDiscountProposal): FeeDiscountProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.schedule = message.schedule ? FeeDiscountSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: FeeDiscountProposalAminoMsg): FeeDiscountProposal { + return FeeDiscountProposal.fromAmino(object.value); + }, + toAminoMsg(message: FeeDiscountProposal): FeeDiscountProposalAminoMsg { + return { + type: "exchange/FeeDiscountProposal", + value: FeeDiscountProposal.toAmino(message) + }; + }, + fromProtoMsg(message: FeeDiscountProposalProtoMsg): FeeDiscountProposal { + return FeeDiscountProposal.decode(message.value); + }, + toProto(message: FeeDiscountProposal): Uint8Array { + return FeeDiscountProposal.encode(message).finish(); + }, + toProtoMsg(message: FeeDiscountProposal): FeeDiscountProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FeeDiscountProposal", + value: FeeDiscountProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeeDiscountProposal.typeUrl, FeeDiscountProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(FeeDiscountProposal.aminoType, FeeDiscountProposal.typeUrl); +function createBaseBatchCommunityPoolSpendProposal(): BatchCommunityPoolSpendProposal { + return { + title: "", + description: "", + proposals: [] + }; +} +export const BatchCommunityPoolSpendProposal = { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal", + aminoType: "exchange/BatchCommunityPoolSpendProposal", + is(o: any): o is BatchCommunityPoolSpendProposal { + return o && (o.$typeUrl === BatchCommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || CommunityPoolSpendProposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is BatchCommunityPoolSpendProposalAmino { + return o && (o.$typeUrl === BatchCommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || CommunityPoolSpendProposal.isAmino(o.proposals[0]))); + }, + encode(message: BatchCommunityPoolSpendProposal, 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.proposals) { + CommunityPoolSpendProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchCommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchCommunityPoolSpendProposal(); + 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.proposals.push(CommunityPoolSpendProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchCommunityPoolSpendProposal { + const message = createBaseBatchCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.proposals = object.proposals?.map(e => CommunityPoolSpendProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchCommunityPoolSpendProposalAmino): BatchCommunityPoolSpendProposal { + const message = createBaseBatchCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.proposals = object.proposals?.map(e => CommunityPoolSpendProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? CommunityPoolSpendProposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + return obj; + }, + fromAminoMsg(object: BatchCommunityPoolSpendProposalAminoMsg): BatchCommunityPoolSpendProposal { + return BatchCommunityPoolSpendProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalAminoMsg { + return { + type: "exchange/BatchCommunityPoolSpendProposal", + value: BatchCommunityPoolSpendProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchCommunityPoolSpendProposalProtoMsg): BatchCommunityPoolSpendProposal { + return BatchCommunityPoolSpendProposal.decode(message.value); + }, + toProto(message: BatchCommunityPoolSpendProposal): Uint8Array { + return BatchCommunityPoolSpendProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchCommunityPoolSpendProposal): BatchCommunityPoolSpendProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BatchCommunityPoolSpendProposal", + value: BatchCommunityPoolSpendProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchCommunityPoolSpendProposal.typeUrl, BatchCommunityPoolSpendProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchCommunityPoolSpendProposal.aminoType, BatchCommunityPoolSpendProposal.typeUrl); +function createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(): AtomicMarketOrderFeeMultiplierScheduleProposal { + return { + title: "", + description: "", + marketFeeMultipliers: [] + }; +} +export const AtomicMarketOrderFeeMultiplierScheduleProposal = { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal", + aminoType: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal", + is(o: any): o is AtomicMarketOrderFeeMultiplierScheduleProposal { + return o && (o.$typeUrl === AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.marketFeeMultipliers) && (!o.marketFeeMultipliers.length || MarketFeeMultiplier.is(o.marketFeeMultipliers[0]))); + }, + isAmino(o: any): o is AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + return o && (o.$typeUrl === AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.market_fee_multipliers) && (!o.market_fee_multipliers.length || MarketFeeMultiplier.isAmino(o.market_fee_multipliers[0]))); + }, + encode(message: AtomicMarketOrderFeeMultiplierScheduleProposal, 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.marketFeeMultipliers) { + MarketFeeMultiplier.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AtomicMarketOrderFeeMultiplierScheduleProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + 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.marketFeeMultipliers.push(MarketFeeMultiplier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AtomicMarketOrderFeeMultiplierScheduleProposal { + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.marketFeeMultipliers = object.marketFeeMultipliers?.map(e => MarketFeeMultiplier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AtomicMarketOrderFeeMultiplierScheduleProposalAmino): AtomicMarketOrderFeeMultiplierScheduleProposal { + const message = createBaseAtomicMarketOrderFeeMultiplierScheduleProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.marketFeeMultipliers = object.market_fee_multipliers?.map(e => MarketFeeMultiplier.fromAmino(e)) || []; + return message; + }, + toAmino(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.marketFeeMultipliers) { + obj.market_fee_multipliers = message.marketFeeMultipliers.map(e => e ? MarketFeeMultiplier.toAmino(e) : undefined); + } else { + obj.market_fee_multipliers = message.marketFeeMultipliers; + } + return obj; + }, + fromAminoMsg(object: AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg): AtomicMarketOrderFeeMultiplierScheduleProposal { + return AtomicMarketOrderFeeMultiplierScheduleProposal.fromAmino(object.value); + }, + toAminoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalAminoMsg { + return { + type: "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal", + value: AtomicMarketOrderFeeMultiplierScheduleProposal.toAmino(message) + }; + }, + fromProtoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg): AtomicMarketOrderFeeMultiplierScheduleProposal { + return AtomicMarketOrderFeeMultiplierScheduleProposal.decode(message.value); + }, + toProto(message: AtomicMarketOrderFeeMultiplierScheduleProposal): Uint8Array { + return AtomicMarketOrderFeeMultiplierScheduleProposal.encode(message).finish(); + }, + toProtoMsg(message: AtomicMarketOrderFeeMultiplierScheduleProposal): AtomicMarketOrderFeeMultiplierScheduleProposalProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.AtomicMarketOrderFeeMultiplierScheduleProposal", + value: AtomicMarketOrderFeeMultiplierScheduleProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl, AtomicMarketOrderFeeMultiplierScheduleProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(AtomicMarketOrderFeeMultiplierScheduleProposal.aminoType, AtomicMarketOrderFeeMultiplierScheduleProposal.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/exchange/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..d0f2be43 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/query.rpc.func.ts @@ -0,0 +1,422 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryExchangeParamsRequest, QueryExchangeParamsResponse, QuerySubaccountDepositsRequest, QuerySubaccountDepositsResponse, QuerySubaccountDepositRequest, QuerySubaccountDepositResponse, QueryExchangeBalancesRequest, QueryExchangeBalancesResponse, QueryAggregateVolumeRequest, QueryAggregateVolumeResponse, QueryAggregateVolumesRequest, QueryAggregateVolumesResponse, QueryAggregateMarketVolumeRequest, QueryAggregateMarketVolumeResponse, QueryAggregateMarketVolumesRequest, QueryAggregateMarketVolumesResponse, QueryDenomDecimalRequest, QueryDenomDecimalResponse, QueryDenomDecimalsRequest, QueryDenomDecimalsResponse, QuerySpotMarketsRequest, QuerySpotMarketsResponse, QuerySpotMarketRequest, QuerySpotMarketResponse, QueryFullSpotMarketsRequest, QueryFullSpotMarketsResponse, QueryFullSpotMarketRequest, QueryFullSpotMarketResponse, QuerySpotOrderbookRequest, QuerySpotOrderbookResponse, QueryTraderSpotOrdersRequest, QueryTraderSpotOrdersResponse, QueryAccountAddressSpotOrdersRequest, QueryAccountAddressSpotOrdersResponse, QuerySpotOrdersByHashesRequest, QuerySpotOrdersByHashesResponse, QuerySubaccountOrdersRequest, QuerySubaccountOrdersResponse, QuerySpotMidPriceAndTOBRequest, QuerySpotMidPriceAndTOBResponse, QueryDerivativeMidPriceAndTOBRequest, QueryDerivativeMidPriceAndTOBResponse, QueryDerivativeOrderbookRequest, QueryDerivativeOrderbookResponse, QueryTraderDerivativeOrdersRequest, QueryTraderDerivativeOrdersResponse, QueryAccountAddressDerivativeOrdersRequest, QueryAccountAddressDerivativeOrdersResponse, QueryDerivativeOrdersByHashesRequest, QueryDerivativeOrdersByHashesResponse, QueryDerivativeMarketsRequest, QueryDerivativeMarketsResponse, QueryDerivativeMarketRequest, QueryDerivativeMarketResponse, QueryDerivativeMarketAddressRequest, QueryDerivativeMarketAddressResponse, QuerySubaccountTradeNonceRequest, QuerySubaccountTradeNonceResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryPositionsRequest, QueryPositionsResponse, QuerySubaccountPositionsRequest, QuerySubaccountPositionsResponse, QuerySubaccountPositionInMarketRequest, QuerySubaccountPositionInMarketResponse, QuerySubaccountEffectivePositionInMarketRequest, QuerySubaccountEffectivePositionInMarketResponse, QueryPerpetualMarketInfoRequest, QueryPerpetualMarketInfoResponse, QueryExpiryFuturesMarketInfoRequest, QueryExpiryFuturesMarketInfoResponse, QueryPerpetualMarketFundingRequest, QueryPerpetualMarketFundingResponse, QuerySubaccountOrderMetadataRequest, QuerySubaccountOrderMetadataResponse, QueryTradeRewardPointsRequest, QueryTradeRewardPointsResponse, QueryTradeRewardCampaignRequest, QueryTradeRewardCampaignResponse, QueryFeeDiscountAccountInfoRequest, QueryFeeDiscountAccountInfoResponse, QueryFeeDiscountScheduleRequest, QueryFeeDiscountScheduleResponse, QueryBalanceMismatchesRequest, QueryBalanceMismatchesResponse, QueryBalanceWithBalanceHoldsRequest, QueryBalanceWithBalanceHoldsResponse, QueryFeeDiscountTierStatisticsRequest, QueryFeeDiscountTierStatisticsResponse, MitoVaultInfosRequest, MitoVaultInfosResponse, QueryMarketIDFromVaultRequest, QueryMarketIDFromVaultResponse, QueryHistoricalTradeRecordsRequest, QueryHistoricalTradeRecordsResponse, QueryIsOptedOutOfRewardsRequest, QueryIsOptedOutOfRewardsResponse, QueryOptedOutOfRewardsAccountsRequest, QueryOptedOutOfRewardsAccountsResponse, QueryMarketVolatilityRequest, QueryMarketVolatilityResponse, QueryBinaryMarketsRequest, QueryBinaryMarketsResponse, QueryTraderDerivativeConditionalOrdersRequest, QueryTraderDerivativeConditionalOrdersResponse, QueryMarketAtomicExecutionFeeMultiplierRequest, QueryMarketAtomicExecutionFeeMultiplierResponse, QueryActiveStakeGrantRequest, QueryActiveStakeGrantResponse, QueryGrantAuthorizationRequest, QueryGrantAuthorizationResponse, QueryGrantAuthorizationsRequest, QueryGrantAuthorizationsResponse } from "./query"; +export const createGetQueryExchangeParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeParamsRequest.encode, + decode: QueryExchangeParamsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryExchangeParams", + clientResolver +}); +export const createGetSubaccountDeposits = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositsRequest.encode, + decode: QuerySubaccountDepositsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposits", + clientResolver +}); +export const createGetSubaccountDeposit = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountDepositRequest.encode, + decode: QuerySubaccountDepositResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountDeposit", + clientResolver +}); +export const createGetExchangeBalances = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExchangeBalancesRequest.encode, + decode: QueryExchangeBalancesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeBalances", + clientResolver +}); +export const createGetAggregateVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumeRequest.encode, + decode: QueryAggregateVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolume", + clientResolver +}); +export const createGetAggregateVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateVolumesRequest.encode, + decode: QueryAggregateVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateVolumes", + clientResolver +}); +export const createGetAggregateMarketVolume = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumeRequest.encode, + decode: QueryAggregateMarketVolumeResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolume", + clientResolver +}); +export const createGetAggregateMarketVolumes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAggregateMarketVolumesRequest.encode, + decode: QueryAggregateMarketVolumesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AggregateMarketVolumes", + clientResolver +}); +export const createGetDenomDecimal = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalRequest.encode, + decode: QueryDenomDecimalResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimal", + clientResolver +}); +export const createGetDenomDecimals = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomDecimalsRequest.encode, + decode: QueryDenomDecimalsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DenomDecimals", + clientResolver +}); +export const createGetSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketsRequest.encode, + decode: QuerySpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarkets", + clientResolver +}); +export const createGetSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMarketRequest.encode, + decode: QuerySpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMarket", + clientResolver +}); +export const createGetFullSpotMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketsRequest.encode, + decode: QueryFullSpotMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarkets", + clientResolver +}); +export const createGetFullSpotMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFullSpotMarketRequest.encode, + decode: QueryFullSpotMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FullSpotMarket", + clientResolver +}); +export const createGetSpotOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrderbookRequest.encode, + decode: QuerySpotOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrderbook", + clientResolver +}); +export const createGetTraderSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotOrders", + clientResolver +}); +export const createGetAccountAddressSpotOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressSpotOrdersRequest.encode, + decode: QueryAccountAddressSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressSpotOrders", + clientResolver +}); +export const createGetSpotOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotOrdersByHashesRequest.encode, + decode: QuerySpotOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotOrdersByHashes", + clientResolver +}); +export const createGetSubaccountOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrdersRequest.encode, + decode: QuerySubaccountOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrders", + clientResolver +}); +export const createGetTraderSpotTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderSpotOrdersRequest.encode, + decode: QueryTraderSpotOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderSpotTransientOrders", + clientResolver +}); +export const createGetSpotMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySpotMidPriceAndTOBRequest.encode, + decode: QuerySpotMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SpotMidPriceAndTOB", + clientResolver +}); +export const createGetDerivativeMidPriceAndTOB = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMidPriceAndTOBRequest.encode, + decode: QueryDerivativeMidPriceAndTOBResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMidPriceAndTOB", + clientResolver +}); +export const createGetDerivativeOrderbook = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrderbookRequest.encode, + decode: QueryDerivativeOrderbookResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrderbook", + clientResolver +}); +export const createGetTraderDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeOrders", + clientResolver +}); +export const createGetAccountAddressDerivativeOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAccountAddressDerivativeOrdersRequest.encode, + decode: QueryAccountAddressDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "AccountAddressDerivativeOrders", + clientResolver +}); +export const createGetDerivativeOrdersByHashes = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeOrdersByHashesRequest.encode, + decode: QueryDerivativeOrdersByHashesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeOrdersByHashes", + clientResolver +}); +export const createGetTraderDerivativeTransientOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeOrdersRequest.encode, + decode: QueryTraderDerivativeOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeTransientOrders", + clientResolver +}); +export const createGetDerivativeMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketsRequest.encode, + decode: QueryDerivativeMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarkets", + clientResolver +}); +export const createGetDerivativeMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketRequest.encode, + decode: QueryDerivativeMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarket", + clientResolver +}); +export const createGetDerivativeMarketAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDerivativeMarketAddressRequest.encode, + decode: QueryDerivativeMarketAddressResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "DerivativeMarketAddress", + clientResolver +}); +export const createGetSubaccountTradeNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountTradeNonceRequest.encode, + decode: QuerySubaccountTradeNonceResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountTradeNonce", + clientResolver +}); +export const createGetExchangeModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExchangeModuleState", + clientResolver +}); +export const createGetPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPositionsRequest.encode, + decode: QueryPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "Positions", + clientResolver +}); +export const createGetSubaccountPositions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionsRequest.encode, + decode: QuerySubaccountPositionsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositions", + clientResolver +}); +export const createGetSubaccountPositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountPositionInMarketRequest.encode, + decode: QuerySubaccountPositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountPositionInMarket", + clientResolver +}); +export const createGetSubaccountEffectivePositionInMarket = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountEffectivePositionInMarketRequest.encode, + decode: QuerySubaccountEffectivePositionInMarketResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountEffectivePositionInMarket", + clientResolver +}); +export const createGetPerpetualMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketInfoRequest.encode, + decode: QueryPerpetualMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketInfo", + clientResolver +}); +export const createGetExpiryFuturesMarketInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryExpiryFuturesMarketInfoRequest.encode, + decode: QueryExpiryFuturesMarketInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ExpiryFuturesMarketInfo", + clientResolver +}); +export const createGetPerpetualMarketFunding = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPerpetualMarketFundingRequest.encode, + decode: QueryPerpetualMarketFundingResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PerpetualMarketFunding", + clientResolver +}); +export const createGetSubaccountOrderMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QuerySubaccountOrderMetadataRequest.encode, + decode: QuerySubaccountOrderMetadataResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "SubaccountOrderMetadata", + clientResolver +}); +export const createGetTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardPoints", + clientResolver +}); +export const createGetPendingTradeRewardPoints = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardPointsRequest.encode, + decode: QueryTradeRewardPointsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "PendingTradeRewardPoints", + clientResolver +}); +export const createGetTradeRewardCampaign = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTradeRewardCampaignRequest.encode, + decode: QueryTradeRewardCampaignResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TradeRewardCampaign", + clientResolver +}); +export const createGetFeeDiscountAccountInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountAccountInfoRequest.encode, + decode: QueryFeeDiscountAccountInfoResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountAccountInfo", + clientResolver +}); +export const createGetFeeDiscountSchedule = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountScheduleRequest.encode, + decode: QueryFeeDiscountScheduleResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountSchedule", + clientResolver +}); +export const createGetBalanceMismatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceMismatchesRequest.encode, + decode: QueryBalanceMismatchesResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceMismatches", + clientResolver +}); +export const createGetBalanceWithBalanceHolds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBalanceWithBalanceHoldsRequest.encode, + decode: QueryBalanceWithBalanceHoldsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BalanceWithBalanceHolds", + clientResolver +}); +export const createGetFeeDiscountTierStatistics = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeeDiscountTierStatisticsRequest.encode, + decode: QueryFeeDiscountTierStatisticsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "FeeDiscountTierStatistics", + clientResolver +}); +export const createGetMitoVaultInfos = (clientResolver?: RpcResolver) => buildQuery({ + encode: MitoVaultInfosRequest.encode, + decode: MitoVaultInfosResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MitoVaultInfos", + clientResolver +}); +export const createGetQueryMarketIDFromVault = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketIDFromVaultRequest.encode, + decode: QueryMarketIDFromVaultResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "QueryMarketIDFromVault", + clientResolver +}); +export const createGetHistoricalTradeRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalTradeRecordsRequest.encode, + decode: QueryHistoricalTradeRecordsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "HistoricalTradeRecords", + clientResolver +}); +export const createGetIsOptedOutOfRewards = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryIsOptedOutOfRewardsRequest.encode, + decode: QueryIsOptedOutOfRewardsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "IsOptedOutOfRewards", + clientResolver +}); +export const createGetOptedOutOfRewardsAccounts = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOptedOutOfRewardsAccountsRequest.encode, + decode: QueryOptedOutOfRewardsAccountsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "OptedOutOfRewardsAccounts", + clientResolver +}); +export const createGetMarketVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketVolatilityRequest.encode, + decode: QueryMarketVolatilityResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketVolatility", + clientResolver +}); +export const createGetBinaryOptionsMarkets = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBinaryMarketsRequest.encode, + decode: QueryBinaryMarketsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "BinaryOptionsMarkets", + clientResolver +}); +export const createGetTraderDerivativeConditionalOrders = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryTraderDerivativeConditionalOrdersRequest.encode, + decode: QueryTraderDerivativeConditionalOrdersResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "TraderDerivativeConditionalOrders", + clientResolver +}); +export const createGetMarketAtomicExecutionFeeMultiplier = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryMarketAtomicExecutionFeeMultiplierRequest.encode, + decode: QueryMarketAtomicExecutionFeeMultiplierResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "MarketAtomicExecutionFeeMultiplier", + clientResolver +}); +export const createGetActiveStakeGrant = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryActiveStakeGrantRequest.encode, + decode: QueryActiveStakeGrantResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "ActiveStakeGrant", + clientResolver +}); +export const createGetGrantAuthorization = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationRequest.encode, + decode: QueryGrantAuthorizationResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorization", + clientResolver +}); +export const createGetGrantAuthorizations = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryGrantAuthorizationsRequest.encode, + decode: QueryGrantAuthorizationsResponse.decode, + service: "injective.exchange.v1beta1.Query", + method: "GrantAuthorizations", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/query.ts b/libs/injectivejs/src/injective/exchange/v1beta1/query.ts new file mode 100644 index 00000000..a03e3cd0 --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/query.ts @@ -0,0 +1,13590 @@ +import { SubaccountOrderData, SubaccountOrderDataAmino, SubaccountOrderbookMetadata, SubaccountOrderbookMetadataAmino, Params, ParamsAmino, Deposit, DepositAmino, MarketVolume, MarketVolumeAmino, AggregateAccountVolumeRecord, AggregateAccountVolumeRecordAmino, VolumeRecord, VolumeRecordAmino, DenomDecimals, DenomDecimalsAmino, SpotMarket, SpotMarketAmino, Level, LevelAmino, MidPriceAndTOB, MidPriceAndTOBAmino, PerpetualMarketInfo, PerpetualMarketInfoAmino, PerpetualMarketFunding, PerpetualMarketFundingAmino, DerivativeMarket, DerivativeMarketAmino, ExpiryFuturesMarketInfo, ExpiryFuturesMarketInfoAmino, Position, PositionAmino, TradingRewardCampaignInfo, TradingRewardCampaignInfoAmino, CampaignRewardPool, CampaignRewardPoolAmino, FeeDiscountTierInfo, FeeDiscountTierInfoAmino, FeeDiscountTierTTL, FeeDiscountTierTTLAmino, FeeDiscountSchedule, FeeDiscountScheduleAmino, TradeRecords, TradeRecordsAmino, TradeRecord, TradeRecordAmino, BinaryOptionsMarket, BinaryOptionsMarketAmino, ActiveGrant, ActiveGrantAmino, EffectiveGrant, EffectiveGrantAmino, GrantAuthorization, GrantAuthorizationAmino } from "./exchange"; +import { Balance, BalanceAmino, DerivativePosition, DerivativePositionAmino, GenesisState, GenesisStateAmino } from "./genesis"; +import { MetadataStatistics, MetadataStatisticsAmino } from "../../oracle/v1beta1/oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OrderSide { + /** Side_Unspecified - will return both */ + Side_Unspecified = 0, + Buy = 1, + Sell = 2, + UNRECOGNIZED = -1, +} +export const OrderSideAmino = OrderSide; +export function orderSideFromJSON(object: any): OrderSide { + switch (object) { + case 0: + case "Side_Unspecified": + return OrderSide.Side_Unspecified; + case 1: + case "Buy": + return OrderSide.Buy; + case 2: + case "Sell": + return OrderSide.Sell; + case -1: + case "UNRECOGNIZED": + default: + return OrderSide.UNRECOGNIZED; + } +} +export function orderSideToJSON(object: OrderSide): string { + switch (object) { + case OrderSide.Side_Unspecified: + return "Side_Unspecified"; + case OrderSide.Buy: + return "Buy"; + case OrderSide.Sell: + return "Sell"; + case OrderSide.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** CancellationStrategy is the list of cancellation strategies. */ +export enum CancellationStrategy { + /** UnspecifiedOrder - just cancelling in random order in most efficient way */ + UnspecifiedOrder = 0, + /** FromWorstToBest - e.g. for buy orders from lowest to highest price */ + FromWorstToBest = 1, + /** FromBestToWorst - e.g. for buy orders from higest to lowest price */ + FromBestToWorst = 2, + UNRECOGNIZED = -1, +} +export const CancellationStrategyAmino = CancellationStrategy; +export function cancellationStrategyFromJSON(object: any): CancellationStrategy { + switch (object) { + case 0: + case "UnspecifiedOrder": + return CancellationStrategy.UnspecifiedOrder; + case 1: + case "FromWorstToBest": + return CancellationStrategy.FromWorstToBest; + case 2: + case "FromBestToWorst": + return CancellationStrategy.FromBestToWorst; + case -1: + case "UNRECOGNIZED": + default: + return CancellationStrategy.UNRECOGNIZED; + } +} +export function cancellationStrategyToJSON(object: CancellationStrategy): string { + switch (object) { + case CancellationStrategy.UnspecifiedOrder: + return "UnspecifiedOrder"; + case CancellationStrategy.FromWorstToBest: + return "FromWorstToBest"; + case CancellationStrategy.FromBestToWorst: + return "FromBestToWorst"; + case CancellationStrategy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Subaccount { + trader: string; + subaccountNonce: number; +} +export interface SubaccountProtoMsg { + typeUrl: "/injective.exchange.v1beta1.Subaccount"; + value: Uint8Array; +} +export interface SubaccountAmino { + trader: string; + subaccount_nonce: number; +} +export interface SubaccountAminoMsg { + type: "/injective.exchange.v1beta1.Subaccount"; + value: SubaccountAmino; +} +export interface QuerySubaccountOrdersRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest"; + value: Uint8Array; +} +export interface QuerySubaccountOrdersRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest"; + value: QuerySubaccountOrdersRequestAmino; +} +export interface QuerySubaccountOrdersResponse { + buyOrders: SubaccountOrderData[]; + sellOrders: SubaccountOrderData[]; +} +export interface QuerySubaccountOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse"; + value: Uint8Array; +} +export interface QuerySubaccountOrdersResponseAmino { + buy_orders: SubaccountOrderDataAmino[]; + sell_orders: SubaccountOrderDataAmino[]; +} +export interface QuerySubaccountOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse"; + value: QuerySubaccountOrdersResponseAmino; +} +export interface SubaccountOrderbookMetadataWithMarket { + metadata?: SubaccountOrderbookMetadata; + marketId: string; + isBuy: boolean; +} +export interface SubaccountOrderbookMetadataWithMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket"; + value: Uint8Array; +} +export interface SubaccountOrderbookMetadataWithMarketAmino { + metadata?: SubaccountOrderbookMetadataAmino; + market_id: string; + isBuy: boolean; +} +export interface SubaccountOrderbookMetadataWithMarketAminoMsg { + type: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket"; + value: SubaccountOrderbookMetadataWithMarketAmino; +} +/** + * QueryExchangeParamsRequest is the request type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsRequest {} +export interface QueryExchangeParamsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest"; + value: Uint8Array; +} +/** + * QueryExchangeParamsRequest is the request type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsRequestAmino {} +export interface QueryExchangeParamsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeParamsRequest"; + value: QueryExchangeParamsRequestAmino; +} +/** + * QueryExchangeParamsRequest is the response type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsResponse { + params: Params; +} +export interface QueryExchangeParamsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse"; + value: Uint8Array; +} +/** + * QueryExchangeParamsRequest is the response type for the Query/ExchangeParams + * RPC method. + */ +export interface QueryExchangeParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryExchangeParamsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeParamsResponse"; + value: QueryExchangeParamsResponseAmino; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsRequest { + subaccountId: string; + subaccount?: Subaccount; +} +export interface QuerySubaccountDepositsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsRequestAmino { + subaccount_id: string; + subaccount?: SubaccountAmino; +} +export interface QuerySubaccountDepositsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest"; + value: QuerySubaccountDepositsRequestAmino; +} +export interface QuerySubaccountDepositsResponse_DepositsEntry { + key: string; + value?: Deposit; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryAmino { + key: string; + value?: DepositAmino; +} +export interface QuerySubaccountDepositsResponse_DepositsEntryAminoMsg { + type: string; + value: QuerySubaccountDepositsResponse_DepositsEntryAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsResponse { + deposits: { + [key: string]: Deposit; + }; +} +export interface QuerySubaccountDepositsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositsResponseAmino { + deposits: { + [key: string]: DepositAmino; + }; +} +export interface QuerySubaccountDepositsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse"; + value: QuerySubaccountDepositsResponseAmino; +} +/** + * QueryExchangeBalancesRequest is the request type for the + * Query/ExchangeBalances RPC method. + */ +export interface QueryExchangeBalancesRequest {} +export interface QueryExchangeBalancesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest"; + value: Uint8Array; +} +/** + * QueryExchangeBalancesRequest is the request type for the + * Query/ExchangeBalances RPC method. + */ +export interface QueryExchangeBalancesRequestAmino {} +export interface QueryExchangeBalancesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest"; + value: QueryExchangeBalancesRequestAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QueryExchangeBalancesResponse { + balances: Balance[]; +} +export interface QueryExchangeBalancesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QueryExchangeBalancesResponseAmino { + balances: BalanceAmino[]; +} +export interface QueryExchangeBalancesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse"; + value: QueryExchangeBalancesResponseAmino; +} +/** + * QueryAggregateVolumeRequest is the request type for the Query/AggregateVolume + * RPC method. + */ +export interface QueryAggregateVolumeRequest { + /** can either be an address or a subaccount */ + account: string; +} +export interface QueryAggregateVolumeRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest"; + value: Uint8Array; +} +/** + * QueryAggregateVolumeRequest is the request type for the Query/AggregateVolume + * RPC method. + */ +export interface QueryAggregateVolumeRequestAmino { + /** can either be an address or a subaccount */ + account: string; +} +export interface QueryAggregateVolumeRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest"; + value: QueryAggregateVolumeRequestAmino; +} +/** + * QueryAggregateVolumeResponse is the response type for the + * Query/AggregateVolume RPC method. + */ +export interface QueryAggregateVolumeResponse { + /** + * if an address is specified, then the aggregate_volumes will aggregate the + * volumes across all subaccounts for the address + */ + aggregateVolumes: MarketVolume[]; +} +export interface QueryAggregateVolumeResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVolumeResponse is the response type for the + * Query/AggregateVolume RPC method. + */ +export interface QueryAggregateVolumeResponseAmino { + /** + * if an address is specified, then the aggregate_volumes will aggregate the + * volumes across all subaccounts for the address + */ + aggregate_volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateVolumeResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse"; + value: QueryAggregateVolumeResponseAmino; +} +/** + * QueryAggregateVolumesRequest is the request type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesRequest { + accounts: string[]; + marketIds: string[]; +} +export interface QueryAggregateVolumesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest"; + value: Uint8Array; +} +/** + * QueryAggregateVolumesRequest is the request type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesRequestAmino { + accounts: string[]; + market_ids: string[]; +} +export interface QueryAggregateVolumesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest"; + value: QueryAggregateVolumesRequestAmino; +} +/** + * QueryAggregateVolumesResponse is the response type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesResponse { + /** the aggregate volume records for the accounts specified */ + aggregateAccountVolumes: AggregateAccountVolumeRecord[]; + /** the aggregate volumes for the markets specified */ + aggregateMarketVolumes: MarketVolume[]; +} +export interface QueryAggregateVolumesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVolumesResponse is the response type for the + * Query/AggregateVolumes RPC method. + */ +export interface QueryAggregateVolumesResponseAmino { + /** the aggregate volume records for the accounts specified */ + aggregate_account_volumes: AggregateAccountVolumeRecordAmino[]; + /** the aggregate volumes for the markets specified */ + aggregate_market_volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateVolumesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse"; + value: QueryAggregateVolumesResponseAmino; +} +/** + * QueryAggregateMarketVolumeRequest is the request type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeRequest { + marketId: string; +} +export interface QueryAggregateMarketVolumeRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumeRequest is the request type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeRequestAmino { + market_id: string; +} +export interface QueryAggregateMarketVolumeRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest"; + value: QueryAggregateMarketVolumeRequestAmino; +} +/** + * QueryAggregateMarketVolumeResponse is the response type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeResponse { + volume: VolumeRecord; +} +export interface QueryAggregateMarketVolumeResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumeResponse is the response type for the + * Query/AggregateMarketVolume RPC method. + */ +export interface QueryAggregateMarketVolumeResponseAmino { + volume: VolumeRecordAmino; +} +export interface QueryAggregateMarketVolumeResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse"; + value: QueryAggregateMarketVolumeResponseAmino; +} +/** + * QueryDenomDecimalRequest is the request type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalRequest { + denom: string; +} +export interface QueryDenomDecimalRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest"; + value: Uint8Array; +} +/** + * QueryDenomDecimalRequest is the request type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalRequestAmino { + denom: string; +} +export interface QueryDenomDecimalRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalRequest"; + value: QueryDenomDecimalRequestAmino; +} +/** + * QueryDenomDecimalResponse is the response type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalResponse { + decimal: bigint; +} +export interface QueryDenomDecimalResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse"; + value: Uint8Array; +} +/** + * QueryDenomDecimalResponse is the response type for the Query/DenomDecimal RPC + * method. + */ +export interface QueryDenomDecimalResponseAmino { + decimal: string; +} +export interface QueryDenomDecimalResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalResponse"; + value: QueryDenomDecimalResponseAmino; +} +/** + * QueryDenomDecimalsRequest is the request type for the Query/DenomDecimals RPC + * method. + */ +export interface QueryDenomDecimalsRequest { + /** denoms can be empty to query all denom decimals */ + denoms: string[]; +} +export interface QueryDenomDecimalsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest"; + value: Uint8Array; +} +/** + * QueryDenomDecimalsRequest is the request type for the Query/DenomDecimals RPC + * method. + */ +export interface QueryDenomDecimalsRequestAmino { + /** denoms can be empty to query all denom decimals */ + denoms: string[]; +} +export interface QueryDenomDecimalsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest"; + value: QueryDenomDecimalsRequestAmino; +} +/** + * QueryDenomDecimalsRequest is the response type for the Query/DenomDecimals + * RPC method. + */ +export interface QueryDenomDecimalsResponse { + denomDecimals: DenomDecimals[]; +} +export interface QueryDenomDecimalsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse"; + value: Uint8Array; +} +/** + * QueryDenomDecimalsRequest is the response type for the Query/DenomDecimals + * RPC method. + */ +export interface QueryDenomDecimalsResponseAmino { + denom_decimals: DenomDecimalsAmino[]; +} +export interface QueryDenomDecimalsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse"; + value: QueryDenomDecimalsResponseAmino; +} +/** + * QueryAggregateMarketVolumesRequest is the request type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesRequest { + marketIds: string[]; +} +export interface QueryAggregateMarketVolumesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumesRequest is the request type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesRequestAmino { + market_ids: string[]; +} +export interface QueryAggregateMarketVolumesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest"; + value: QueryAggregateMarketVolumesRequestAmino; +} +/** + * QueryAggregateMarketVolumesResponse is the response type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesResponse { + /** the aggregate volumes for the entire market */ + volumes: MarketVolume[]; +} +export interface QueryAggregateMarketVolumesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse"; + value: Uint8Array; +} +/** + * QueryAggregateMarketVolumesResponse is the response type for the + * Query/AggregateMarketVolumes RPC method. + */ +export interface QueryAggregateMarketVolumesResponseAmino { + /** the aggregate volumes for the entire market */ + volumes: MarketVolumeAmino[]; +} +export interface QueryAggregateMarketVolumesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse"; + value: QueryAggregateMarketVolumesResponseAmino; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositRequest { + subaccountId: string; + denom: string; +} +export interface QuerySubaccountDepositRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsRequest is the request type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositRequestAmino { + subaccount_id: string; + denom: string; +} +export interface QuerySubaccountDepositRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest"; + value: QuerySubaccountDepositRequestAmino; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositResponse { + deposits?: Deposit; +} +export interface QuerySubaccountDepositResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountDepositsResponse is the response type for the + * Query/SubaccountDeposits RPC method. + */ +export interface QuerySubaccountDepositResponseAmino { + deposits?: DepositAmino; +} +export interface QuerySubaccountDepositResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse"; + value: QuerySubaccountDepositResponseAmino; +} +/** + * QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; +} +export interface QuerySpotMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; +} +export interface QuerySpotMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketsRequest"; + value: QuerySpotMarketsRequestAmino; +} +/** + * QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsResponse { + markets: SpotMarket[]; +} +export interface QuerySpotMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC + * method. + */ +export interface QuerySpotMarketsResponseAmino { + markets: SpotMarketAmino[]; +} +export interface QuerySpotMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketsResponse"; + value: QuerySpotMarketsResponseAmino; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QuerySpotMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QuerySpotMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketRequest"; + value: QuerySpotMarketRequestAmino; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketResponse { + market?: SpotMarket; +} +export interface QuerySpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QuerySpotMarketResponseAmino { + market?: SpotMarketAmino; +} +export interface QuerySpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMarketResponse"; + value: QuerySpotMarketResponseAmino; +} +/** + * QuerySpotOrderbookRequest is the request type for the Query/SpotOrderbook RPC + * method. + */ +export interface QuerySpotOrderbookRequest { + /** Market ID for the market */ + marketId: string; + limit: bigint; + orderSide: OrderSide; + limitCumulativeNotional?: string; + limitCumulativeQuantity?: string; +} +export interface QuerySpotOrderbookRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest"; + value: Uint8Array; +} +/** + * QuerySpotOrderbookRequest is the request type for the Query/SpotOrderbook RPC + * method. + */ +export interface QuerySpotOrderbookRequestAmino { + /** Market ID for the market */ + market_id: string; + limit: string; + order_side: OrderSide; + limit_cumulative_notional?: string; + limit_cumulative_quantity?: string; +} +export interface QuerySpotOrderbookRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest"; + value: QuerySpotOrderbookRequestAmino; +} +/** + * QuerySpotOrderbookResponse is the response type for the Query/SpotOrderbook + * RPC method. + */ +export interface QuerySpotOrderbookResponse { + buysPriceLevel: Level[]; + sellsPriceLevel: Level[]; +} +export interface QuerySpotOrderbookResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse"; + value: Uint8Array; +} +/** + * QuerySpotOrderbookResponse is the response type for the Query/SpotOrderbook + * RPC method. + */ +export interface QuerySpotOrderbookResponseAmino { + buys_price_level: LevelAmino[]; + sells_price_level: LevelAmino[]; +} +export interface QuerySpotOrderbookResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse"; + value: QuerySpotOrderbookResponseAmino; +} +export interface FullSpotMarket { + market?: SpotMarket; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + midPriceAndTob?: MidPriceAndTOB; +} +export interface FullSpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket"; + value: Uint8Array; +} +export interface FullSpotMarketAmino { + market?: SpotMarketAmino; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + mid_price_and_tob?: MidPriceAndTOBAmino; +} +export interface FullSpotMarketAminoMsg { + type: "/injective.exchange.v1beta1.FullSpotMarket"; + value: FullSpotMarketAmino; +} +/** + * QueryFullSpotMarketsRequest is the request type for the Query/FullSpotMarkets + * RPC method. + */ +export interface QueryFullSpotMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryFullSpotMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest"; + value: Uint8Array; +} +/** + * QueryFullSpotMarketsRequest is the request type for the Query/FullSpotMarkets + * RPC method. + */ +export interface QueryFullSpotMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryFullSpotMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest"; + value: QueryFullSpotMarketsRequestAmino; +} +/** + * QueryFullSpotMarketsResponse is the response type for the + * Query/FullSpotMarkets RPC method. + */ +export interface QueryFullSpotMarketsResponse { + markets: FullSpotMarket[]; +} +export interface QueryFullSpotMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse"; + value: Uint8Array; +} +/** + * QueryFullSpotMarketsResponse is the response type for the + * Query/FullSpotMarkets RPC method. + */ +export interface QueryFullSpotMarketsResponseAmino { + markets: FullSpotMarketAmino[]; +} +export interface QueryFullSpotMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse"; + value: QueryFullSpotMarketsResponseAmino; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketRequest { + /** Market ID for the market */ + marketId: string; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryFullSpotMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest"; + value: Uint8Array; +} +/** + * QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketRequestAmino { + /** Market ID for the market */ + market_id: string; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryFullSpotMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest"; + value: QueryFullSpotMarketRequestAmino; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketResponse { + market?: FullSpotMarket; +} +export interface QueryFullSpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse"; + value: Uint8Array; +} +/** + * QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC + * method. + */ +export interface QueryFullSpotMarketResponseAmino { + market?: FullSpotMarketAmino; +} +export interface QueryFullSpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse"; + value: QueryFullSpotMarketResponseAmino; +} +/** + * QuerySpotOrdersByHashesRequest is the request type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the order hashes */ + orderHashes: string[]; +} +export interface QuerySpotOrdersByHashesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest"; + value: Uint8Array; +} +/** + * QuerySpotOrdersByHashesRequest is the request type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the order hashes */ + order_hashes: string[]; +} +export interface QuerySpotOrdersByHashesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest"; + value: QuerySpotOrdersByHashesRequestAmino; +} +/** + * QuerySpotOrdersByHashesResponse is the response type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QuerySpotOrdersByHashesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse"; + value: Uint8Array; +} +/** + * QuerySpotOrdersByHashesResponse is the response type for the + * Query/SpotOrdersByHashes RPC method. + */ +export interface QuerySpotOrdersByHashesResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QuerySpotOrdersByHashesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse"; + value: QuerySpotOrdersByHashesResponseAmino; +} +/** + * QueryTraderSpotOrdersRequest is the request type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; +} +export interface QueryTraderSpotOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersRequest is the request type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; +} +export interface QueryTraderSpotOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest"; + value: QueryTraderSpotOrdersRequestAmino; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** Account address of the trader */ + accountAddress: string; +} +export interface QueryAccountAddressSpotOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** Account address of the trader */ + account_address: string; +} +export interface QueryAccountAddressSpotOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest"; + value: QueryAccountAddressSpotOrdersRequestAmino; +} +export interface TrimmedSpotLimitOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedSpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder"; + value: Uint8Array; +} +export interface TrimmedSpotLimitOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedSpotLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder"; + value: TrimmedSpotLimitOrderAmino; +} +/** + * QueryTraderSpotOrdersResponse is the response type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QueryTraderSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersResponse is the response type for the + * Query/TraderSpotOrders RPC method. + */ +export interface QueryTraderSpotOrdersResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QueryTraderSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse"; + value: QueryTraderSpotOrdersResponseAmino; +} +/** + * QueryAccountAddressSpotOrdersResponse is the response type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersResponse { + orders: TrimmedSpotLimitOrder[]; +} +export interface QueryAccountAddressSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersResponse is the response type for the + * Query/AccountAddressSpotOrders RPC method. + */ +export interface QueryAccountAddressSpotOrdersResponseAmino { + orders: TrimmedSpotLimitOrderAmino[]; +} +export interface QueryAccountAddressSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse"; + value: QueryAccountAddressSpotOrdersResponseAmino; +} +/** + * QuerySpotMidPriceAndTOBRequest is the request type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QuerySpotMidPriceAndTOBRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest"; + value: Uint8Array; +} +/** + * QuerySpotMidPriceAndTOBRequest is the request type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QuerySpotMidPriceAndTOBRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest"; + value: QuerySpotMidPriceAndTOBRequestAmino; +} +/** + * QuerySpotMidPriceAndTOBResponse is the response type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBResponse { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface QuerySpotMidPriceAndTOBResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse"; + value: Uint8Array; +} +/** + * QuerySpotMidPriceAndTOBResponse is the response type for the + * Query/SpotMidPriceAndTOB RPC method. + */ +export interface QuerySpotMidPriceAndTOBResponseAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface QuerySpotMidPriceAndTOBResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse"; + value: QuerySpotMidPriceAndTOBResponseAmino; +} +/** + * QueryDerivativeMidPriceAndTOBRequest is the request type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMidPriceAndTOBRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMidPriceAndTOBRequest is the request type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMidPriceAndTOBRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest"; + value: QueryDerivativeMidPriceAndTOBRequestAmino; +} +/** + * QueryDerivativeMidPriceAndTOBResponse is the response type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBResponse { + /** mid price of the market */ + midPrice?: string; + /** best buy price of the market */ + bestBuyPrice?: string; + /** best sell price of the market */ + bestSellPrice?: string; +} +export interface QueryDerivativeMidPriceAndTOBResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMidPriceAndTOBResponse is the response type for the + * Query/GetDerivativeMidPriceAndTOB RPC method. + */ +export interface QueryDerivativeMidPriceAndTOBResponseAmino { + /** mid price of the market */ + mid_price?: string; + /** best buy price of the market */ + best_buy_price?: string; + /** best sell price of the market */ + best_sell_price?: string; +} +export interface QueryDerivativeMidPriceAndTOBResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse"; + value: QueryDerivativeMidPriceAndTOBResponseAmino; +} +/** + * QueryDerivativeOrderbookRequest is the request type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookRequest { + /** Market ID for the market */ + marketId: string; + limit: bigint; + limitCumulativeNotional?: string; +} +export interface QueryDerivativeOrderbookRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeOrderbookRequest is the request type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookRequestAmino { + /** Market ID for the market */ + market_id: string; + limit: string; + limit_cumulative_notional?: string; +} +export interface QueryDerivativeOrderbookRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest"; + value: QueryDerivativeOrderbookRequestAmino; +} +/** + * QueryDerivativeOrderbookResponse is the response type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookResponse { + buysPriceLevel: Level[]; + sellsPriceLevel: Level[]; +} +export interface QueryDerivativeOrderbookResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeOrderbookResponse is the response type for the + * Query/DerivativeOrderbook RPC method. + */ +export interface QueryDerivativeOrderbookResponseAmino { + buys_price_level: LevelAmino[]; + sells_price_level: LevelAmino[]; +} +export interface QueryDerivativeOrderbookResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse"; + value: QueryDerivativeOrderbookResponseAmino; +} +/** + * QueryTraderSpotOrdersToCancelUpToAmountRequest is the request type for the + * Query/TraderSpotOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderSpotOrdersToCancelUpToAmountRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the base amount to cancel (free up) */ + baseAmount: string; + /** the quote amount to cancel (free up) */ + quoteAmount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + referencePrice?: string; +} +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest"; + value: Uint8Array; +} +/** + * QueryTraderSpotOrdersToCancelUpToAmountRequest is the request type for the + * Query/TraderSpotOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the base amount to cancel (free up) */ + base_amount: string; + /** the quote amount to cancel (free up) */ + quote_amount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + reference_price?: string; +} +export interface QueryTraderSpotOrdersToCancelUpToAmountRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest"; + value: QueryTraderSpotOrdersToCancelUpToAmountRequestAmino; +} +/** + * QueryTraderDerivativeOrdersToCancelUpToAmountRequest is the request type for + * the Query/TraderDerivativeOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the quote amount to cancel (free up) */ + quoteAmount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + referencePrice?: string; +} +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersToCancelUpToAmountRequest is the request type for + * the Query/TraderDerivativeOrdersToCancelUpToAmountRequest RPC method. + */ +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the quote amount to cancel (free up) */ + quote_amount: string; + /** The cancellation strategy */ + strategy: CancellationStrategy; + /** + * The reference price for the cancellation strategy, e.g. mid price or mark + * price + */ + reference_price?: string; +} +export interface QueryTraderDerivativeOrdersToCancelUpToAmountRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest"; + value: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; +} +export interface QueryTraderDerivativeOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; +} +export interface QueryTraderDerivativeOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest"; + value: QueryTraderDerivativeOrdersRequestAmino; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersRequest { + /** Market ID for the market */ + marketId: string; + /** Account address of the trader */ + accountAddress: string; +} +export interface QueryAccountAddressDerivativeOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressSpotOrdersRequest is the request type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersRequestAmino { + /** Market ID for the market */ + market_id: string; + /** Account address of the trader */ + account_address: string; +} +export interface QueryAccountAddressDerivativeOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest"; + value: QueryAccountAddressDerivativeOrdersRequestAmino; +} +export interface TrimmedDerivativeLimitOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedDerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder"; + value: Uint8Array; +} +export interface TrimmedDerivativeLimitOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** the amount of the quantity remaining fillable */ + fillable: string; + /** true if the order is a buy */ + isBuy: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedDerivativeLimitOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder"; + value: TrimmedDerivativeLimitOrderAmino; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryTraderDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeOrdersResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryTraderDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse"; + value: QueryTraderDerivativeOrdersResponseAmino; +} +/** + * QueryAccountAddressDerivativeOrdersResponse is the response type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryAccountAddressDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressDerivativeOrdersResponse is the response type for the + * Query/AccountAddressDerivativeOrders RPC method. + */ +export interface QueryAccountAddressDerivativeOrdersResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryAccountAddressDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse"; + value: QueryAccountAddressDerivativeOrdersResponseAmino; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryDerivativeOrdersByHashesRequest { + /** Market ID for the market */ + marketId: string; + /** SubaccountID of the trader */ + subaccountId: string; + /** the order hashes */ + orderHashes: string[]; +} +export interface QueryDerivativeOrdersByHashesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersRequest is the request type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryDerivativeOrdersByHashesRequestAmino { + /** Market ID for the market */ + market_id: string; + /** SubaccountID of the trader */ + subaccount_id: string; + /** the order hashes */ + order_hashes: string[]; +} +export interface QueryDerivativeOrdersByHashesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest"; + value: QueryDerivativeOrdersByHashesRequestAmino; +} +/** + * QueryDerivativeOrdersByHashesResponse is the response type for the + * Query/DerivativeOrdersByHashes RPC method. + */ +export interface QueryDerivativeOrdersByHashesResponse { + orders: TrimmedDerivativeLimitOrder[]; +} +export interface QueryDerivativeOrdersByHashesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeOrdersByHashesResponse is the response type for the + * Query/DerivativeOrdersByHashes RPC method. + */ +export interface QueryDerivativeOrdersByHashesResponseAmino { + orders: TrimmedDerivativeLimitOrderAmino[]; +} +export interface QueryDerivativeOrdersByHashesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse"; + value: QueryDerivativeOrdersByHashesResponseAmino; +} +/** + * QueryDerivativeMarketsRequest is the request type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + marketIds: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + withMidPriceAndTob: boolean; +} +export interface QueryDerivativeMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketsRequest is the request type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; + /** Filter by market IDs */ + market_ids: string[]; + /** + * Flag to return the markets mid price and top of the book buy and sell + * orders. + */ + with_mid_price_and_tob: boolean; +} +export interface QueryDerivativeMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest"; + value: QueryDerivativeMarketsRequestAmino; +} +export interface PriceLevel { + price: string; + /** quantity */ + quantity: string; +} +export interface PriceLevelProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PriceLevel"; + value: Uint8Array; +} +export interface PriceLevelAmino { + price: string; + /** quantity */ + quantity: string; +} +export interface PriceLevelAminoMsg { + type: "/injective.exchange.v1beta1.PriceLevel"; + value: PriceLevelAmino; +} +export interface PerpetualMarketState { + marketInfo?: PerpetualMarketInfo; + fundingInfo?: PerpetualMarketFunding; +} +export interface PerpetualMarketStateProtoMsg { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState"; + value: Uint8Array; +} +export interface PerpetualMarketStateAmino { + market_info?: PerpetualMarketInfoAmino; + funding_info?: PerpetualMarketFundingAmino; +} +export interface PerpetualMarketStateAminoMsg { + type: "/injective.exchange.v1beta1.PerpetualMarketState"; + value: PerpetualMarketStateAmino; +} +export interface FullDerivativeMarket { + market?: DerivativeMarket; + perpetualInfo?: PerpetualMarketState; + futuresInfo?: ExpiryFuturesMarketInfo; + markPrice: string; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + midPriceAndTob?: MidPriceAndTOB; +} +export interface FullDerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket"; + value: Uint8Array; +} +export interface FullDerivativeMarketAmino { + market?: DerivativeMarketAmino; + perpetual_info?: PerpetualMarketStateAmino; + futures_info?: ExpiryFuturesMarketInfoAmino; + mark_price: string; + /** + * mid_price_and_tob defines the mid price for this market and the best ask + * and bid orders + */ + mid_price_and_tob?: MidPriceAndTOBAmino; +} +export interface FullDerivativeMarketAminoMsg { + type: "/injective.exchange.v1beta1.FullDerivativeMarket"; + value: FullDerivativeMarketAmino; +} +/** + * QueryDerivativeMarketsResponse is the response type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsResponse { + markets: FullDerivativeMarket[]; +} +export interface QueryDerivativeMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketsResponse is the response type for the + * Query/DerivativeMarkets RPC method. + */ +export interface QueryDerivativeMarketsResponseAmino { + markets: FullDerivativeMarketAmino[]; +} +export interface QueryDerivativeMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse"; + value: QueryDerivativeMarketsResponseAmino; +} +/** + * QueryDerivativeMarketRequest is the request type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketRequest is the request type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest"; + value: QueryDerivativeMarketRequestAmino; +} +/** + * QueryDerivativeMarketResponse is the response type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketResponse { + market?: FullDerivativeMarket; +} +export interface QueryDerivativeMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketResponse is the response type for the + * Query/DerivativeMarket RPC method. + */ +export interface QueryDerivativeMarketResponseAmino { + market?: FullDerivativeMarketAmino; +} +export interface QueryDerivativeMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse"; + value: QueryDerivativeMarketResponseAmino; +} +/** + * QueryDerivativeMarketAddressRequest is the request type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryDerivativeMarketAddressRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketAddressRequest is the request type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryDerivativeMarketAddressRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest"; + value: QueryDerivativeMarketAddressRequestAmino; +} +/** + * QueryDerivativeMarketAddressResponse is the response type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressResponse { + /** address for the market */ + address: string; + /** subaccountID for the market */ + subaccountId: string; +} +export interface QueryDerivativeMarketAddressResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse"; + value: Uint8Array; +} +/** + * QueryDerivativeMarketAddressResponse is the response type for the + * Query/DerivativeMarketAddress RPC method. + */ +export interface QueryDerivativeMarketAddressResponseAmino { + /** address for the market */ + address: string; + /** subaccountID for the market */ + subaccount_id: string; +} +export interface QueryDerivativeMarketAddressResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse"; + value: QueryDerivativeMarketAddressResponseAmino; +} +/** + * QuerySubaccountTradeNonceRequest is the request type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceRequest { + subaccountId: string; +} +export interface QuerySubaccountTradeNonceRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountTradeNonceRequest is the request type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountTradeNonceRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest"; + value: QuerySubaccountTradeNonceRequestAmino; +} +/** + * QuerySubaccountPositionsRequest is the request type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsRequest { + subaccountId: string; +} +export interface QuerySubaccountPositionsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionsRequest is the request type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountPositionsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest"; + value: QuerySubaccountPositionsRequestAmino; +} +/** + * QuerySubaccountPositionInMarketRequest is the request type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountPositionInMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionInMarketRequest is the request type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountPositionInMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest"; + value: QuerySubaccountPositionInMarketRequestAmino; +} +/** + * QuerySubaccountEffectivePositionInMarketRequest is the request type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketRequest { + subaccountId: string; + marketId: string; +} +export interface QuerySubaccountEffectivePositionInMarketRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountEffectivePositionInMarketRequest is the request type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QuerySubaccountEffectivePositionInMarketRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest"; + value: QuerySubaccountEffectivePositionInMarketRequestAmino; +} +/** + * QuerySubaccountOrderMetadataRequest is the request type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataRequest { + subaccountId: string; +} +export interface QuerySubaccountOrderMetadataRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest"; + value: Uint8Array; +} +/** + * QuerySubaccountOrderMetadataRequest is the request type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataRequestAmino { + subaccount_id: string; +} +export interface QuerySubaccountOrderMetadataRequestAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest"; + value: QuerySubaccountOrderMetadataRequestAmino; +} +/** + * QuerySubaccountPositionsResponse is the response type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsResponse { + state: DerivativePosition[]; +} +export interface QuerySubaccountPositionsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionsResponse is the response type for the + * Query/SubaccountPositions RPC method. + */ +export interface QuerySubaccountPositionsResponseAmino { + state: DerivativePositionAmino[]; +} +export interface QuerySubaccountPositionsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse"; + value: QuerySubaccountPositionsResponseAmino; +} +/** + * QuerySubaccountPositionInMarketResponse is the response type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketResponse { + state?: Position; +} +export interface QuerySubaccountPositionInMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountPositionInMarketResponse is the response type for the + * Query/SubaccountPositionInMarket RPC method. + */ +export interface QuerySubaccountPositionInMarketResponseAmino { + state?: PositionAmino; +} +export interface QuerySubaccountPositionInMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse"; + value: QuerySubaccountPositionInMarketResponseAmino; +} +export interface EffectivePosition { + isLong: boolean; + quantity: string; + entryPrice: string; + effectiveMargin: string; +} +export interface EffectivePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition"; + value: Uint8Array; +} +export interface EffectivePositionAmino { + is_long: boolean; + quantity: string; + entry_price: string; + effective_margin: string; +} +export interface EffectivePositionAminoMsg { + type: "/injective.exchange.v1beta1.EffectivePosition"; + value: EffectivePositionAmino; +} +/** + * QuerySubaccountEffectivePositionInMarketResponse is the response type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketResponse { + state?: EffectivePosition; +} +export interface QuerySubaccountEffectivePositionInMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountEffectivePositionInMarketResponse is the response type for the + * Query/SubaccountEffectivePositionInMarket RPC method. + */ +export interface QuerySubaccountEffectivePositionInMarketResponseAmino { + state?: EffectivePositionAmino; +} +export interface QuerySubaccountEffectivePositionInMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse"; + value: QuerySubaccountEffectivePositionInMarketResponseAmino; +} +/** + * QueryPerpetualMarketInfoRequest is the request type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoRequest { + marketId: string; +} +export interface QueryPerpetualMarketInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketInfoRequest is the request type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoRequestAmino { + market_id: string; +} +export interface QueryPerpetualMarketInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest"; + value: QueryPerpetualMarketInfoRequestAmino; +} +/** + * QueryPerpetualMarketInfoResponse is the response type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoResponse { + info: PerpetualMarketInfo; +} +export interface QueryPerpetualMarketInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketInfoResponse is the response type for the + * Query/PerpetualMarketInfo RPC method. + */ +export interface QueryPerpetualMarketInfoResponseAmino { + info: PerpetualMarketInfoAmino; +} +export interface QueryPerpetualMarketInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse"; + value: QueryPerpetualMarketInfoResponseAmino; +} +/** + * QueryExpiryFuturesMarketInfoRequest is the request type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoRequest { + marketId: string; +} +export interface QueryExpiryFuturesMarketInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest"; + value: Uint8Array; +} +/** + * QueryExpiryFuturesMarketInfoRequest is the request type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoRequestAmino { + market_id: string; +} +export interface QueryExpiryFuturesMarketInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest"; + value: QueryExpiryFuturesMarketInfoRequestAmino; +} +/** + * QueryExpiryFuturesMarketInfoResponse is the response type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoResponse { + info: ExpiryFuturesMarketInfo; +} +export interface QueryExpiryFuturesMarketInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse"; + value: Uint8Array; +} +/** + * QueryExpiryFuturesMarketInfoResponse is the response type for the Query/ + * ExpiryFuturesMarketInfo RPC method. + */ +export interface QueryExpiryFuturesMarketInfoResponseAmino { + info: ExpiryFuturesMarketInfoAmino; +} +export interface QueryExpiryFuturesMarketInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse"; + value: QueryExpiryFuturesMarketInfoResponseAmino; +} +/** + * QueryPerpetualMarketFundingRequest is the request type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingRequest { + marketId: string; +} +export interface QueryPerpetualMarketFundingRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketFundingRequest is the request type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingRequestAmino { + market_id: string; +} +export interface QueryPerpetualMarketFundingRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest"; + value: QueryPerpetualMarketFundingRequestAmino; +} +/** + * QueryPerpetualMarketFundingResponse is the response type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingResponse { + state: PerpetualMarketFunding; +} +export interface QueryPerpetualMarketFundingResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse"; + value: Uint8Array; +} +/** + * QueryPerpetualMarketFundingResponse is the response type for the + * Query/PerpetualMarketFunding RPC method. + */ +export interface QueryPerpetualMarketFundingResponseAmino { + state: PerpetualMarketFundingAmino; +} +export interface QueryPerpetualMarketFundingResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse"; + value: QueryPerpetualMarketFundingResponseAmino; +} +/** + * QuerySubaccountOrderMetadataResponse is the response type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataResponse { + metadata: SubaccountOrderbookMetadataWithMarket[]; +} +export interface QuerySubaccountOrderMetadataResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountOrderMetadataResponse is the response type for the + * Query/SubaccountOrderMetadata RPC method. + */ +export interface QuerySubaccountOrderMetadataResponseAmino { + metadata: SubaccountOrderbookMetadataWithMarketAmino[]; +} +export interface QuerySubaccountOrderMetadataResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse"; + value: QuerySubaccountOrderMetadataResponseAmino; +} +/** + * QuerySubaccountTradeNonceResponse is the response type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceResponse { + nonce: number; +} +export interface QuerySubaccountTradeNonceResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse"; + value: Uint8Array; +} +/** + * QuerySubaccountTradeNonceResponse is the response type for the + * Query/SubaccountTradeNonce RPC method. + */ +export interface QuerySubaccountTradeNonceResponseAmino { + nonce: number; +} +export interface QuerySubaccountTradeNonceResponseAminoMsg { + type: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse"; + value: QuerySubaccountTradeNonceResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/ExchangeModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/ExchangeModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/ExchangeModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/ExchangeModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +/** QueryPositionsRequest is the request type for the Query/Positions RPC method. */ +export interface QueryPositionsRequest {} +export interface QueryPositionsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest"; + value: Uint8Array; +} +/** QueryPositionsRequest is the request type for the Query/Positions RPC method. */ +export interface QueryPositionsRequestAmino {} +export interface QueryPositionsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryPositionsRequest"; + value: QueryPositionsRequestAmino; +} +/** + * QueryPositionsResponse is the response type for the Query/Positions RPC + * method. + */ +export interface QueryPositionsResponse { + state: DerivativePosition[]; +} +export interface QueryPositionsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse"; + value: Uint8Array; +} +/** + * QueryPositionsResponse is the response type for the Query/Positions RPC + * method. + */ +export interface QueryPositionsResponseAmino { + state: DerivativePositionAmino[]; +} +export interface QueryPositionsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryPositionsResponse"; + value: QueryPositionsResponseAmino; +} +/** + * QueryTradeRewardPointsRequest is the request type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsRequest { + accounts: string[]; + pendingPoolTimestamp: bigint; +} +export interface QueryTradeRewardPointsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest"; + value: Uint8Array; +} +/** + * QueryTradeRewardPointsRequest is the request type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsRequestAmino { + accounts: string[]; + pending_pool_timestamp: string; +} +export interface QueryTradeRewardPointsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest"; + value: QueryTradeRewardPointsRequestAmino; +} +/** + * QueryTradeRewardPointsResponse is the response type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsResponse { + accountTradeRewardPoints: string[]; +} +export interface QueryTradeRewardPointsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse"; + value: Uint8Array; +} +/** + * QueryTradeRewardPointsResponse is the response type for the + * Query/TradeRewardPoints RPC method. + */ +export interface QueryTradeRewardPointsResponseAmino { + account_trade_reward_points: string[]; +} +export interface QueryTradeRewardPointsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse"; + value: QueryTradeRewardPointsResponseAmino; +} +/** + * QueryTradeRewardCampaignRequest is the request type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignRequest {} +export interface QueryTradeRewardCampaignRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest"; + value: Uint8Array; +} +/** + * QueryTradeRewardCampaignRequest is the request type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignRequestAmino {} +export interface QueryTradeRewardCampaignRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest"; + value: QueryTradeRewardCampaignRequestAmino; +} +/** + * QueryTradeRewardCampaignResponse is the response type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignResponse { + tradingRewardCampaignInfo?: TradingRewardCampaignInfo; + tradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + totalTradeRewardPoints: string; + pendingTradingRewardPoolCampaignSchedule: CampaignRewardPool[]; + pendingTotalTradeRewardPoints: string[]; +} +export interface QueryTradeRewardCampaignResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse"; + value: Uint8Array; +} +/** + * QueryTradeRewardCampaignResponse is the response type for the + * Query/TradeRewardCampaign RPC method. + */ +export interface QueryTradeRewardCampaignResponseAmino { + trading_reward_campaign_info?: TradingRewardCampaignInfoAmino; + trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + total_trade_reward_points: string; + pending_trading_reward_pool_campaign_schedule: CampaignRewardPoolAmino[]; + pending_total_trade_reward_points: string[]; +} +export interface QueryTradeRewardCampaignResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse"; + value: QueryTradeRewardCampaignResponseAmino; +} +/** + * QueryIsRegisteredDMMRequest is the request type for the Query/IsRegisteredDMM + * RPC method. + */ +export interface QueryIsOptedOutOfRewardsRequest { + account: string; +} +export interface QueryIsOptedOutOfRewardsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest"; + value: Uint8Array; +} +/** + * QueryIsRegisteredDMMRequest is the request type for the Query/IsRegisteredDMM + * RPC method. + */ +export interface QueryIsOptedOutOfRewardsRequestAmino { + account: string; +} +export interface QueryIsOptedOutOfRewardsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest"; + value: QueryIsOptedOutOfRewardsRequestAmino; +} +/** + * QueryIsRegisteredDMMResponse is the response type for the + * Query/IsRegisteredDMM RPC method. + */ +export interface QueryIsOptedOutOfRewardsResponse { + isOptedOut: boolean; +} +export interface QueryIsOptedOutOfRewardsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse"; + value: Uint8Array; +} +/** + * QueryIsRegisteredDMMResponse is the response type for the + * Query/IsRegisteredDMM RPC method. + */ +export interface QueryIsOptedOutOfRewardsResponseAmino { + is_opted_out: boolean; +} +export interface QueryIsOptedOutOfRewardsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse"; + value: QueryIsOptedOutOfRewardsResponseAmino; +} +/** + * QueryRegisteredDMMsRequest is the request type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsRequest {} +export interface QueryOptedOutOfRewardsAccountsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest"; + value: Uint8Array; +} +/** + * QueryRegisteredDMMsRequest is the request type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsRequestAmino {} +export interface QueryOptedOutOfRewardsAccountsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest"; + value: QueryOptedOutOfRewardsAccountsRequestAmino; +} +/** + * QueryRegisteredDMMsResponse is the response type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsResponse { + accounts: string[]; +} +export interface QueryOptedOutOfRewardsAccountsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse"; + value: Uint8Array; +} +/** + * QueryRegisteredDMMsResponse is the response type for the Query/RegisteredDMMs + * RPC method. + */ +export interface QueryOptedOutOfRewardsAccountsResponseAmino { + accounts: string[]; +} +export interface QueryOptedOutOfRewardsAccountsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse"; + value: QueryOptedOutOfRewardsAccountsResponseAmino; +} +/** + * QueryFeeDiscountAccountInfoRequest is the request type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoRequest { + account: string; +} +export interface QueryFeeDiscountAccountInfoRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountAccountInfoRequest is the request type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoRequestAmino { + account: string; +} +export interface QueryFeeDiscountAccountInfoRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest"; + value: QueryFeeDiscountAccountInfoRequestAmino; +} +/** + * QueryFeeDiscountAccountInfoResponse is the response type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoResponse { + tierLevel: bigint; + accountInfo?: FeeDiscountTierInfo; + accountTtl?: FeeDiscountTierTTL; +} +export interface QueryFeeDiscountAccountInfoResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountAccountInfoResponse is the response type for the + * Query/FeeDiscountAccountInfo RPC method. + */ +export interface QueryFeeDiscountAccountInfoResponseAmino { + tier_level: string; + account_info?: FeeDiscountTierInfoAmino; + account_ttl?: FeeDiscountTierTTLAmino; +} +export interface QueryFeeDiscountAccountInfoResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse"; + value: QueryFeeDiscountAccountInfoResponseAmino; +} +/** + * QueryFeeDiscountScheduleRequest is the request type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleRequest {} +export interface QueryFeeDiscountScheduleRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountScheduleRequest is the request type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleRequestAmino {} +export interface QueryFeeDiscountScheduleRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest"; + value: QueryFeeDiscountScheduleRequestAmino; +} +/** + * QueryFeeDiscountScheduleResponse is the response type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleResponse { + feeDiscountSchedule?: FeeDiscountSchedule; +} +export interface QueryFeeDiscountScheduleResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountScheduleResponse is the response type for the + * Query/FeeDiscountSchedule RPC method. + */ +export interface QueryFeeDiscountScheduleResponseAmino { + fee_discount_schedule?: FeeDiscountScheduleAmino; +} +export interface QueryFeeDiscountScheduleResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse"; + value: QueryFeeDiscountScheduleResponseAmino; +} +/** + * QueryBalanceMismatchesRequest is the request type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesRequest { + dustFactor: bigint; +} +export interface QueryBalanceMismatchesRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest"; + value: Uint8Array; +} +/** + * QueryBalanceMismatchesRequest is the request type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesRequestAmino { + dust_factor: string; +} +export interface QueryBalanceMismatchesRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest"; + value: QueryBalanceMismatchesRequestAmino; +} +export interface BalanceMismatch { + subaccountId: string; + denom: string; + available: string; + total: string; + balanceHold: string; + expectedTotal: string; + difference: string; +} +export interface BalanceMismatchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch"; + value: Uint8Array; +} +export interface BalanceMismatchAmino { + subaccountId: string; + denom: string; + available: string; + total: string; + balance_hold: string; + expected_total: string; + difference: string; +} +export interface BalanceMismatchAminoMsg { + type: "/injective.exchange.v1beta1.BalanceMismatch"; + value: BalanceMismatchAmino; +} +/** + * QueryBalanceMismatchesResponse is the response type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesResponse { + balanceMismatches: BalanceMismatch[]; +} +export interface QueryBalanceMismatchesResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse"; + value: Uint8Array; +} +/** + * QueryBalanceMismatchesResponse is the response type for the + * Query/QueryBalanceMismatches RPC method. + */ +export interface QueryBalanceMismatchesResponseAmino { + balance_mismatches: BalanceMismatchAmino[]; +} +export interface QueryBalanceMismatchesResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse"; + value: QueryBalanceMismatchesResponseAmino; +} +/** + * QueryBalanceWithBalanceHoldsRequest is the request type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsRequest {} +export interface QueryBalanceWithBalanceHoldsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest"; + value: Uint8Array; +} +/** + * QueryBalanceWithBalanceHoldsRequest is the request type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsRequestAmino {} +export interface QueryBalanceWithBalanceHoldsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest"; + value: QueryBalanceWithBalanceHoldsRequestAmino; +} +export interface BalanceWithMarginHold { + subaccountId: string; + denom: string; + available: string; + total: string; + balanceHold: string; +} +export interface BalanceWithMarginHoldProtoMsg { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold"; + value: Uint8Array; +} +export interface BalanceWithMarginHoldAmino { + subaccountId: string; + denom: string; + available: string; + total: string; + balance_hold: string; +} +export interface BalanceWithMarginHoldAminoMsg { + type: "/injective.exchange.v1beta1.BalanceWithMarginHold"; + value: BalanceWithMarginHoldAmino; +} +/** + * QueryBalanceWithBalanceHoldsResponse is the response type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsResponse { + balanceWithBalanceHolds: BalanceWithMarginHold[]; +} +export interface QueryBalanceWithBalanceHoldsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse"; + value: Uint8Array; +} +/** + * QueryBalanceWithBalanceHoldsResponse is the response type for the + * Query/QueryBalanceWithBalanceHolds RPC method. + */ +export interface QueryBalanceWithBalanceHoldsResponseAmino { + balance_with_balance_holds: BalanceWithMarginHoldAmino[]; +} +export interface QueryBalanceWithBalanceHoldsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse"; + value: QueryBalanceWithBalanceHoldsResponseAmino; +} +/** + * QueryFeeDiscountTierStatisticsRequest is the request type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsRequest {} +export interface QueryFeeDiscountTierStatisticsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest"; + value: Uint8Array; +} +/** + * QueryFeeDiscountTierStatisticsRequest is the request type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsRequestAmino {} +export interface QueryFeeDiscountTierStatisticsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest"; + value: QueryFeeDiscountTierStatisticsRequestAmino; +} +export interface TierStatistic { + tier: bigint; + count: bigint; +} +export interface TierStatisticProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TierStatistic"; + value: Uint8Array; +} +export interface TierStatisticAmino { + tier: string; + count: string; +} +export interface TierStatisticAminoMsg { + type: "/injective.exchange.v1beta1.TierStatistic"; + value: TierStatisticAmino; +} +/** + * QueryFeeDiscountTierStatisticsResponse is the response type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsResponse { + statistics: TierStatistic[]; +} +export interface QueryFeeDiscountTierStatisticsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse"; + value: Uint8Array; +} +/** + * QueryFeeDiscountTierStatisticsResponse is the response type for the + * Query/QueryFeeDiscountTierStatistics RPC method. + */ +export interface QueryFeeDiscountTierStatisticsResponseAmino { + statistics: TierStatisticAmino[]; +} +export interface QueryFeeDiscountTierStatisticsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse"; + value: QueryFeeDiscountTierStatisticsResponseAmino; +} +/** + * MitoVaultInfosRequest is the request type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosRequest {} +export interface MitoVaultInfosRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest"; + value: Uint8Array; +} +/** + * MitoVaultInfosRequest is the request type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosRequestAmino {} +export interface MitoVaultInfosRequestAminoMsg { + type: "/injective.exchange.v1beta1.MitoVaultInfosRequest"; + value: MitoVaultInfosRequestAmino; +} +/** + * MitoVaultInfosResponse is the response type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosResponse { + masterAddresses: string[]; + derivativeAddresses: string[]; + spotAddresses: string[]; + cw20Addresses: string[]; +} +export interface MitoVaultInfosResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse"; + value: Uint8Array; +} +/** + * MitoVaultInfosResponse is the response type for the Query/MitoVaultInfos RPC + * method. + */ +export interface MitoVaultInfosResponseAmino { + master_addresses: string[]; + derivative_addresses: string[]; + spot_addresses: string[]; + cw20_addresses: string[]; +} +export interface MitoVaultInfosResponseAminoMsg { + type: "/injective.exchange.v1beta1.MitoVaultInfosResponse"; + value: MitoVaultInfosResponseAmino; +} +/** + * QueryMarketIDFromVaultRequest is the request type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultRequest { + vaultAddress: string; +} +export interface QueryMarketIDFromVaultRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest"; + value: Uint8Array; +} +/** + * QueryMarketIDFromVaultRequest is the request type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultRequestAmino { + vault_address: string; +} +export interface QueryMarketIDFromVaultRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest"; + value: QueryMarketIDFromVaultRequestAmino; +} +/** + * QueryMarketIDFromVaultResponse is the response type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultResponse { + marketId: string; +} +export interface QueryMarketIDFromVaultResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse"; + value: Uint8Array; +} +/** + * QueryMarketIDFromVaultResponse is the response type for the + * Query/QueryMarketIDFromVault RPC method. + */ +export interface QueryMarketIDFromVaultResponseAmino { + market_id: string; +} +export interface QueryMarketIDFromVaultResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse"; + value: QueryMarketIDFromVaultResponseAmino; +} +export interface QueryHistoricalTradeRecordsRequest { + marketId: string; +} +export interface QueryHistoricalTradeRecordsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest"; + value: Uint8Array; +} +export interface QueryHistoricalTradeRecordsRequestAmino { + market_id: string; +} +export interface QueryHistoricalTradeRecordsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest"; + value: QueryHistoricalTradeRecordsRequestAmino; +} +export interface QueryHistoricalTradeRecordsResponse { + tradeRecords: TradeRecords[]; +} +export interface QueryHistoricalTradeRecordsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse"; + value: Uint8Array; +} +export interface QueryHistoricalTradeRecordsResponseAmino { + trade_records: TradeRecordsAmino[]; +} +export interface QueryHistoricalTradeRecordsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse"; + value: QueryHistoricalTradeRecordsResponseAmino; +} +/** + * TradeHistoryOptions are the optional params for Query/MarketVolatility RPC + * method. + */ +export interface TradeHistoryOptions { + /** TradeGroupingSec of 0 means use the chain's default grouping */ + tradeGroupingSec: bigint; + /** + * MaxAge restricts the trade records oldest age in seconds from the current + * block time to consider. A value of 0 means use all the records present on + * the chain. + */ + maxAge: bigint; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + includeRawHistory: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + includeMetadata: boolean; +} +export interface TradeHistoryOptionsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions"; + value: Uint8Array; +} +/** + * TradeHistoryOptions are the optional params for Query/MarketVolatility RPC + * method. + */ +export interface TradeHistoryOptionsAmino { + /** TradeGroupingSec of 0 means use the chain's default grouping */ + trade_grouping_sec: string; + /** + * MaxAge restricts the trade records oldest age in seconds from the current + * block time to consider. A value of 0 means use all the records present on + * the chain. + */ + max_age: string; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + include_raw_history: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + include_metadata: boolean; +} +export interface TradeHistoryOptionsAminoMsg { + type: "/injective.exchange.v1beta1.TradeHistoryOptions"; + value: TradeHistoryOptionsAmino; +} +/** + * QueryMarketVolatilityRequest are the request params for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityRequest { + marketId: string; + tradeHistoryOptions?: TradeHistoryOptions; +} +export interface QueryMarketVolatilityRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest"; + value: Uint8Array; +} +/** + * QueryMarketVolatilityRequest are the request params for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityRequestAmino { + market_id: string; + trade_history_options?: TradeHistoryOptionsAmino; +} +export interface QueryMarketVolatilityRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest"; + value: QueryMarketVolatilityRequestAmino; +} +/** + * QueryMarketVolatilityResponse is the response type for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityResponse { + volatility: string; + historyMetadata?: MetadataStatistics; + rawHistory: TradeRecord[]; +} +export interface QueryMarketVolatilityResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse"; + value: Uint8Array; +} +/** + * QueryMarketVolatilityResponse is the response type for the + * Query/MarketVolatility RPC method. + */ +export interface QueryMarketVolatilityResponseAmino { + volatility: string; + history_metadata?: MetadataStatisticsAmino; + raw_history: TradeRecordAmino[]; +} +export interface QueryMarketVolatilityResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse"; + value: QueryMarketVolatilityResponseAmino; +} +/** + * QuerBinaryMarketsRequest is the request type for the Query/BinaryMarkets RPC + * method. + */ +export interface QueryBinaryMarketsRequest { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; +} +export interface QueryBinaryMarketsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest"; + value: Uint8Array; +} +/** + * QuerBinaryMarketsRequest is the request type for the Query/BinaryMarkets RPC + * method. + */ +export interface QueryBinaryMarketsRequestAmino { + /** Status of the market, for convenience it is set to string - not enum */ + status: string; +} +export interface QueryBinaryMarketsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest"; + value: QueryBinaryMarketsRequestAmino; +} +/** + * QueryBinaryMarketsResponse is the response type for the Query/BinaryMarkets + * RPC method. + */ +export interface QueryBinaryMarketsResponse { + markets: BinaryOptionsMarket[]; +} +export interface QueryBinaryMarketsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse"; + value: Uint8Array; +} +/** + * QueryBinaryMarketsResponse is the response type for the Query/BinaryMarkets + * RPC method. + */ +export interface QueryBinaryMarketsResponseAmino { + markets: BinaryOptionsMarketAmino[]; +} +export interface QueryBinaryMarketsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse"; + value: QueryBinaryMarketsResponseAmino; +} +/** + * QueryConditionalOrdersRequest is the request type for the + * Query/ConditionalOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersRequest { + subaccountId: string; + marketId: string; +} +export interface QueryTraderDerivativeConditionalOrdersRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest"; + value: Uint8Array; +} +/** + * QueryConditionalOrdersRequest is the request type for the + * Query/ConditionalOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersRequestAmino { + subaccount_id: string; + market_id: string; +} +export interface QueryTraderDerivativeConditionalOrdersRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest"; + value: QueryTraderDerivativeConditionalOrdersRequestAmino; +} +export interface TrimmedDerivativeConditionalOrder { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** price to trigger the order */ + triggerPrice: string; + /** true if the order is a buy */ + isBuy: boolean; + isLimit: boolean; + orderHash: string; + cid: string; +} +export interface TrimmedDerivativeConditionalOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder"; + value: Uint8Array; +} +export interface TrimmedDerivativeConditionalOrderAmino { + /** price of the order */ + price: string; + /** quantity of the order */ + quantity: string; + /** margin of the order */ + margin: string; + /** price to trigger the order */ + triggerPrice: string; + /** true if the order is a buy */ + isBuy: boolean; + isLimit: boolean; + order_hash: string; + cid: string; +} +export interface TrimmedDerivativeConditionalOrderAminoMsg { + type: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder"; + value: TrimmedDerivativeConditionalOrderAmino; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersResponse { + orders: TrimmedDerivativeConditionalOrder[]; +} +export interface QueryTraderDerivativeConditionalOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse"; + value: Uint8Array; +} +/** + * QueryTraderDerivativeOrdersResponse is the response type for the + * Query/TraderDerivativeOrders RPC method. + */ +export interface QueryTraderDerivativeConditionalOrdersResponseAmino { + orders: TrimmedDerivativeConditionalOrderAmino[]; +} +export interface QueryTraderDerivativeConditionalOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse"; + value: QueryTraderDerivativeConditionalOrdersResponseAmino; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequest { + marketId: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest"; + value: Uint8Array; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + market_id: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest"; + value: QueryMarketAtomicExecutionFeeMultiplierRequestAmino; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponse { + multiplier: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse"; + value: Uint8Array; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + multiplier: string; +} +export interface QueryMarketAtomicExecutionFeeMultiplierResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse"; + value: QueryMarketAtomicExecutionFeeMultiplierResponseAmino; +} +export interface QueryActiveStakeGrantRequest { + grantee: string; +} +export interface QueryActiveStakeGrantRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest"; + value: Uint8Array; +} +export interface QueryActiveStakeGrantRequestAmino { + grantee: string; +} +export interface QueryActiveStakeGrantRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest"; + value: QueryActiveStakeGrantRequestAmino; +} +export interface QueryActiveStakeGrantResponse { + grant?: ActiveGrant; + effectiveGrant?: EffectiveGrant; +} +export interface QueryActiveStakeGrantResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse"; + value: Uint8Array; +} +export interface QueryActiveStakeGrantResponseAmino { + grant?: ActiveGrantAmino; + effective_grant?: EffectiveGrantAmino; +} +export interface QueryActiveStakeGrantResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse"; + value: QueryActiveStakeGrantResponseAmino; +} +export interface QueryGrantAuthorizationRequest { + granter: string; + grantee: string; +} +export interface QueryGrantAuthorizationRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationRequestAmino { + granter: string; + grantee: string; +} +export interface QueryGrantAuthorizationRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest"; + value: QueryGrantAuthorizationRequestAmino; +} +export interface QueryGrantAuthorizationResponse { + amount: string; +} +export interface QueryGrantAuthorizationResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationResponseAmino { + amount: string; +} +export interface QueryGrantAuthorizationResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse"; + value: QueryGrantAuthorizationResponseAmino; +} +export interface QueryGrantAuthorizationsRequest { + granter: string; +} +export interface QueryGrantAuthorizationsRequestProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationsRequestAmino { + granter: string; +} +export interface QueryGrantAuthorizationsRequestAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest"; + value: QueryGrantAuthorizationsRequestAmino; +} +export interface QueryGrantAuthorizationsResponse { + totalGrantAmount: string; + grants: GrantAuthorization[]; +} +export interface QueryGrantAuthorizationsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse"; + value: Uint8Array; +} +export interface QueryGrantAuthorizationsResponseAmino { + total_grant_amount: string; + grants: GrantAuthorizationAmino[]; +} +export interface QueryGrantAuthorizationsResponseAminoMsg { + type: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse"; + value: QueryGrantAuthorizationsResponseAmino; +} +function createBaseSubaccount(): Subaccount { + return { + trader: "", + subaccountNonce: 0 + }; +} +export const Subaccount = { + typeUrl: "/injective.exchange.v1beta1.Subaccount", + is(o: any): o is Subaccount { + return o && (o.$typeUrl === Subaccount.typeUrl || typeof o.trader === "string" && typeof o.subaccountNonce === "number"); + }, + isAmino(o: any): o is SubaccountAmino { + return o && (o.$typeUrl === Subaccount.typeUrl || typeof o.trader === "string" && typeof o.subaccount_nonce === "number"); + }, + encode(message: Subaccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.trader !== "") { + writer.uint32(10).string(message.trader); + } + if (message.subaccountNonce !== 0) { + writer.uint32(16).uint32(message.subaccountNonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subaccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trader = reader.string(); + break; + case 2: + message.subaccountNonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Subaccount { + const message = createBaseSubaccount(); + message.trader = object.trader ?? ""; + message.subaccountNonce = object.subaccountNonce ?? 0; + return message; + }, + fromAmino(object: SubaccountAmino): Subaccount { + const message = createBaseSubaccount(); + if (object.trader !== undefined && object.trader !== null) { + message.trader = object.trader; + } + if (object.subaccount_nonce !== undefined && object.subaccount_nonce !== null) { + message.subaccountNonce = object.subaccount_nonce; + } + return message; + }, + toAmino(message: Subaccount): SubaccountAmino { + const obj: any = {}; + obj.trader = message.trader === "" ? undefined : message.trader; + obj.subaccount_nonce = message.subaccountNonce === 0 ? undefined : message.subaccountNonce; + return obj; + }, + fromAminoMsg(object: SubaccountAminoMsg): Subaccount { + return Subaccount.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountProtoMsg): Subaccount { + return Subaccount.decode(message.value); + }, + toProto(message: Subaccount): Uint8Array { + return Subaccount.encode(message).finish(); + }, + toProtoMsg(message: Subaccount): SubaccountProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.Subaccount", + value: Subaccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Subaccount.typeUrl, Subaccount); +function createBaseQuerySubaccountOrdersRequest(): QuerySubaccountOrdersRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest", + is(o: any): o is QuerySubaccountOrdersRequest { + return o && (o.$typeUrl === QuerySubaccountOrdersRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountOrdersRequestAmino { + return o && (o.$typeUrl === QuerySubaccountOrdersRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrdersRequest { + const message = createBaseQuerySubaccountOrdersRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountOrdersRequestAmino): QuerySubaccountOrdersRequest { + const message = createBaseQuerySubaccountOrdersRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountOrdersRequest): QuerySubaccountOrdersRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrdersRequestAminoMsg): QuerySubaccountOrdersRequest { + return QuerySubaccountOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrdersRequestProtoMsg): QuerySubaccountOrdersRequest { + return QuerySubaccountOrdersRequest.decode(message.value); + }, + toProto(message: QuerySubaccountOrdersRequest): Uint8Array { + return QuerySubaccountOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrdersRequest): QuerySubaccountOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersRequest", + value: QuerySubaccountOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrdersRequest.typeUrl, QuerySubaccountOrdersRequest); +function createBaseQuerySubaccountOrdersResponse(): QuerySubaccountOrdersResponse { + return { + buyOrders: [], + sellOrders: [] + }; +} +export const QuerySubaccountOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse", + is(o: any): o is QuerySubaccountOrdersResponse { + return o && (o.$typeUrl === QuerySubaccountOrdersResponse.typeUrl || Array.isArray(o.buyOrders) && (!o.buyOrders.length || SubaccountOrderData.is(o.buyOrders[0])) && Array.isArray(o.sellOrders) && (!o.sellOrders.length || SubaccountOrderData.is(o.sellOrders[0]))); + }, + isAmino(o: any): o is QuerySubaccountOrdersResponseAmino { + return o && (o.$typeUrl === QuerySubaccountOrdersResponse.typeUrl || Array.isArray(o.buy_orders) && (!o.buy_orders.length || SubaccountOrderData.isAmino(o.buy_orders[0])) && Array.isArray(o.sell_orders) && (!o.sell_orders.length || SubaccountOrderData.isAmino(o.sell_orders[0]))); + }, + encode(message: QuerySubaccountOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buyOrders) { + SubaccountOrderData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellOrders) { + SubaccountOrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buyOrders.push(SubaccountOrderData.decode(reader, reader.uint32())); + break; + case 2: + message.sellOrders.push(SubaccountOrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrdersResponse { + const message = createBaseQuerySubaccountOrdersResponse(); + message.buyOrders = object.buyOrders?.map(e => SubaccountOrderData.fromPartial(e)) || []; + message.sellOrders = object.sellOrders?.map(e => SubaccountOrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountOrdersResponseAmino): QuerySubaccountOrdersResponse { + const message = createBaseQuerySubaccountOrdersResponse(); + message.buyOrders = object.buy_orders?.map(e => SubaccountOrderData.fromAmino(e)) || []; + message.sellOrders = object.sell_orders?.map(e => SubaccountOrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountOrdersResponse): QuerySubaccountOrdersResponseAmino { + const obj: any = {}; + if (message.buyOrders) { + obj.buy_orders = message.buyOrders.map(e => e ? SubaccountOrderData.toAmino(e) : undefined); + } else { + obj.buy_orders = message.buyOrders; + } + if (message.sellOrders) { + obj.sell_orders = message.sellOrders.map(e => e ? SubaccountOrderData.toAmino(e) : undefined); + } else { + obj.sell_orders = message.sellOrders; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrdersResponseAminoMsg): QuerySubaccountOrdersResponse { + return QuerySubaccountOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrdersResponseProtoMsg): QuerySubaccountOrdersResponse { + return QuerySubaccountOrdersResponse.decode(message.value); + }, + toProto(message: QuerySubaccountOrdersResponse): Uint8Array { + return QuerySubaccountOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrdersResponse): QuerySubaccountOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrdersResponse", + value: QuerySubaccountOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrdersResponse.typeUrl, QuerySubaccountOrdersResponse); +function createBaseSubaccountOrderbookMetadataWithMarket(): SubaccountOrderbookMetadataWithMarket { + return { + metadata: undefined, + marketId: "", + isBuy: false + }; +} +export const SubaccountOrderbookMetadataWithMarket = { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket", + is(o: any): o is SubaccountOrderbookMetadataWithMarket { + return o && (o.$typeUrl === SubaccountOrderbookMetadataWithMarket.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean"); + }, + isAmino(o: any): o is SubaccountOrderbookMetadataWithMarketAmino { + return o && (o.$typeUrl === SubaccountOrderbookMetadataWithMarket.typeUrl || typeof o.market_id === "string" && typeof o.isBuy === "boolean"); + }, + encode(message: SubaccountOrderbookMetadataWithMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.metadata !== undefined) { + SubaccountOrderbookMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(24).bool(message.isBuy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOrderbookMetadataWithMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = SubaccountOrderbookMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.isBuy = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountOrderbookMetadataWithMarket { + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? SubaccountOrderbookMetadata.fromPartial(object.metadata) : undefined; + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + return message; + }, + fromAmino(object: SubaccountOrderbookMetadataWithMarketAmino): SubaccountOrderbookMetadataWithMarket { + const message = createBaseSubaccountOrderbookMetadataWithMarket(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = SubaccountOrderbookMetadata.fromAmino(object.metadata); + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + return message; + }, + toAmino(message: SubaccountOrderbookMetadataWithMarket): SubaccountOrderbookMetadataWithMarketAmino { + const obj: any = {}; + obj.metadata = message.metadata ? SubaccountOrderbookMetadata.toAmino(message.metadata) : undefined; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + return obj; + }, + fromAminoMsg(object: SubaccountOrderbookMetadataWithMarketAminoMsg): SubaccountOrderbookMetadataWithMarket { + return SubaccountOrderbookMetadataWithMarket.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOrderbookMetadataWithMarketProtoMsg): SubaccountOrderbookMetadataWithMarket { + return SubaccountOrderbookMetadataWithMarket.decode(message.value); + }, + toProto(message: SubaccountOrderbookMetadataWithMarket): Uint8Array { + return SubaccountOrderbookMetadataWithMarket.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOrderbookMetadataWithMarket): SubaccountOrderbookMetadataWithMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SubaccountOrderbookMetadataWithMarket", + value: SubaccountOrderbookMetadataWithMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountOrderbookMetadataWithMarket.typeUrl, SubaccountOrderbookMetadataWithMarket); +function createBaseQueryExchangeParamsRequest(): QueryExchangeParamsRequest { + return {}; +} +export const QueryExchangeParamsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest", + is(o: any): o is QueryExchangeParamsRequest { + return o && o.$typeUrl === QueryExchangeParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryExchangeParamsRequestAmino { + return o && o.$typeUrl === QueryExchangeParamsRequest.typeUrl; + }, + encode(_: QueryExchangeParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryExchangeParamsRequest { + const message = createBaseQueryExchangeParamsRequest(); + return message; + }, + fromAmino(_: QueryExchangeParamsRequestAmino): QueryExchangeParamsRequest { + const message = createBaseQueryExchangeParamsRequest(); + return message; + }, + toAmino(_: QueryExchangeParamsRequest): QueryExchangeParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryExchangeParamsRequestAminoMsg): QueryExchangeParamsRequest { + return QueryExchangeParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeParamsRequestProtoMsg): QueryExchangeParamsRequest { + return QueryExchangeParamsRequest.decode(message.value); + }, + toProto(message: QueryExchangeParamsRequest): Uint8Array { + return QueryExchangeParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeParamsRequest): QueryExchangeParamsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsRequest", + value: QueryExchangeParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeParamsRequest.typeUrl, QueryExchangeParamsRequest); +function createBaseQueryExchangeParamsResponse(): QueryExchangeParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryExchangeParamsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse", + is(o: any): o is QueryExchangeParamsResponse { + return o && (o.$typeUrl === QueryExchangeParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryExchangeParamsResponseAmino { + return o && (o.$typeUrl === QueryExchangeParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryExchangeParamsResponse, 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): QueryExchangeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeParamsResponse(); + 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: DeepPartial): QueryExchangeParamsResponse { + const message = createBaseQueryExchangeParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryExchangeParamsResponseAmino): QueryExchangeParamsResponse { + const message = createBaseQueryExchangeParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryExchangeParamsResponse): QueryExchangeParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryExchangeParamsResponseAminoMsg): QueryExchangeParamsResponse { + return QueryExchangeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeParamsResponseProtoMsg): QueryExchangeParamsResponse { + return QueryExchangeParamsResponse.decode(message.value); + }, + toProto(message: QueryExchangeParamsResponse): Uint8Array { + return QueryExchangeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeParamsResponse): QueryExchangeParamsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeParamsResponse", + value: QueryExchangeParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeParamsResponse.typeUrl, QueryExchangeParamsResponse); +function createBaseQuerySubaccountDepositsRequest(): QuerySubaccountDepositsRequest { + return { + subaccountId: "", + subaccount: undefined + }; +} +export const QuerySubaccountDepositsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest", + is(o: any): o is QuerySubaccountDepositsRequest { + return o && (o.$typeUrl === QuerySubaccountDepositsRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountDepositsRequestAmino { + return o && (o.$typeUrl === QuerySubaccountDepositsRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.subaccount !== undefined) { + Subaccount.encode(message.subaccount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.subaccount = Subaccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsRequest { + const message = createBaseQuerySubaccountDepositsRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.subaccount = object.subaccount !== undefined && object.subaccount !== null ? Subaccount.fromPartial(object.subaccount) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositsRequestAmino): QuerySubaccountDepositsRequest { + const message = createBaseQuerySubaccountDepositsRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.subaccount !== undefined && object.subaccount !== null) { + message.subaccount = Subaccount.fromAmino(object.subaccount); + } + return message; + }, + toAmino(message: QuerySubaccountDepositsRequest): QuerySubaccountDepositsRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.subaccount = message.subaccount ? Subaccount.toAmino(message.subaccount) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsRequestAminoMsg): QuerySubaccountDepositsRequest { + return QuerySubaccountDepositsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsRequestProtoMsg): QuerySubaccountDepositsRequest { + return QuerySubaccountDepositsRequest.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsRequest): Uint8Array { + return QuerySubaccountDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositsRequest): QuerySubaccountDepositsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsRequest", + value: QuerySubaccountDepositsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositsRequest.typeUrl, QuerySubaccountDepositsRequest); +function createBaseQuerySubaccountDepositsResponse_DepositsEntry(): QuerySubaccountDepositsResponse_DepositsEntry { + return { + key: "", + value: undefined + }; +} +export const QuerySubaccountDepositsResponse_DepositsEntry = { + encode(message: QuerySubaccountDepositsResponse_DepositsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Deposit.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsResponse_DepositsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsResponse_DepositsEntry { + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? Deposit.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositsResponse_DepositsEntryAmino): QuerySubaccountDepositsResponse_DepositsEntry { + const message = createBaseQuerySubaccountDepositsResponse_DepositsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = Deposit.fromAmino(object.value); + } + return message; + }, + toAmino(message: QuerySubaccountDepositsResponse_DepositsEntry): QuerySubaccountDepositsResponse_DepositsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? Deposit.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsResponse_DepositsEntryAminoMsg): QuerySubaccountDepositsResponse_DepositsEntry { + return QuerySubaccountDepositsResponse_DepositsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsResponse_DepositsEntryProtoMsg): QuerySubaccountDepositsResponse_DepositsEntry { + return QuerySubaccountDepositsResponse_DepositsEntry.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsResponse_DepositsEntry): Uint8Array { + return QuerySubaccountDepositsResponse_DepositsEntry.encode(message).finish(); + } +}; +function createBaseQuerySubaccountDepositsResponse(): QuerySubaccountDepositsResponse { + return { + deposits: {} + }; +} +export const QuerySubaccountDepositsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse", + is(o: any): o is QuerySubaccountDepositsResponse { + return o && (o.$typeUrl === QuerySubaccountDepositsResponse.typeUrl || isSet(o.deposits)); + }, + isAmino(o: any): o is QuerySubaccountDepositsResponseAmino { + return o && (o.$typeUrl === QuerySubaccountDepositsResponse.typeUrl || isSet(o.deposits)); + }, + encode(message: QuerySubaccountDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.deposits).forEach(([key, value]) => { + QuerySubaccountDepositsResponse_DepositsEntry.encode({ + key: (key as any), + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = QuerySubaccountDepositsResponse_DepositsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.deposits[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositsResponse { + const message = createBaseQuerySubaccountDepositsResponse(); + message.deposits = Object.entries(object.deposits ?? {}).reduce<{ + [key: string]: Deposit; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Deposit.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: QuerySubaccountDepositsResponseAmino): QuerySubaccountDepositsResponse { + const message = createBaseQuerySubaccountDepositsResponse(); + message.deposits = Object.entries(object.deposits ?? {}).reduce<{ + [key: string]: Deposit; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Deposit.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: QuerySubaccountDepositsResponse): QuerySubaccountDepositsResponseAmino { + const obj: any = {}; + obj.deposits = {}; + if (message.deposits) { + Object.entries(message.deposits).forEach(([k, v]) => { + obj.deposits[k] = Deposit.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositsResponseAminoMsg): QuerySubaccountDepositsResponse { + return QuerySubaccountDepositsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositsResponseProtoMsg): QuerySubaccountDepositsResponse { + return QuerySubaccountDepositsResponse.decode(message.value); + }, + toProto(message: QuerySubaccountDepositsResponse): Uint8Array { + return QuerySubaccountDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositsResponse): QuerySubaccountDepositsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositsResponse", + value: QuerySubaccountDepositsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositsResponse.typeUrl, QuerySubaccountDepositsResponse); +function createBaseQueryExchangeBalancesRequest(): QueryExchangeBalancesRequest { + return {}; +} +export const QueryExchangeBalancesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest", + is(o: any): o is QueryExchangeBalancesRequest { + return o && o.$typeUrl === QueryExchangeBalancesRequest.typeUrl; + }, + isAmino(o: any): o is QueryExchangeBalancesRequestAmino { + return o && o.$typeUrl === QueryExchangeBalancesRequest.typeUrl; + }, + encode(_: QueryExchangeBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeBalancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryExchangeBalancesRequest { + const message = createBaseQueryExchangeBalancesRequest(); + return message; + }, + fromAmino(_: QueryExchangeBalancesRequestAmino): QueryExchangeBalancesRequest { + const message = createBaseQueryExchangeBalancesRequest(); + return message; + }, + toAmino(_: QueryExchangeBalancesRequest): QueryExchangeBalancesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryExchangeBalancesRequestAminoMsg): QueryExchangeBalancesRequest { + return QueryExchangeBalancesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeBalancesRequestProtoMsg): QueryExchangeBalancesRequest { + return QueryExchangeBalancesRequest.decode(message.value); + }, + toProto(message: QueryExchangeBalancesRequest): Uint8Array { + return QueryExchangeBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeBalancesRequest): QueryExchangeBalancesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesRequest", + value: QueryExchangeBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeBalancesRequest.typeUrl, QueryExchangeBalancesRequest); +function createBaseQueryExchangeBalancesResponse(): QueryExchangeBalancesResponse { + return { + balances: [] + }; +} +export const QueryExchangeBalancesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse", + is(o: any): o is QueryExchangeBalancesResponse { + return o && (o.$typeUrl === QueryExchangeBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Balance.is(o.balances[0]))); + }, + isAmino(o: any): o is QueryExchangeBalancesResponseAmino { + return o && (o.$typeUrl === QueryExchangeBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Balance.isAmino(o.balances[0]))); + }, + encode(message: QueryExchangeBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExchangeBalancesResponse { + const message = createBaseQueryExchangeBalancesResponse(); + message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryExchangeBalancesResponseAmino): QueryExchangeBalancesResponse { + const message = createBaseQueryExchangeBalancesResponse(); + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryExchangeBalancesResponse): QueryExchangeBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + return obj; + }, + fromAminoMsg(object: QueryExchangeBalancesResponseAminoMsg): QueryExchangeBalancesResponse { + return QueryExchangeBalancesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeBalancesResponseProtoMsg): QueryExchangeBalancesResponse { + return QueryExchangeBalancesResponse.decode(message.value); + }, + toProto(message: QueryExchangeBalancesResponse): Uint8Array { + return QueryExchangeBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeBalancesResponse): QueryExchangeBalancesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExchangeBalancesResponse", + value: QueryExchangeBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExchangeBalancesResponse.typeUrl, QueryExchangeBalancesResponse); +function createBaseQueryAggregateVolumeRequest(): QueryAggregateVolumeRequest { + return { + account: "" + }; +} +export const QueryAggregateVolumeRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest", + is(o: any): o is QueryAggregateVolumeRequest { + return o && (o.$typeUrl === QueryAggregateVolumeRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryAggregateVolumeRequestAmino { + return o && (o.$typeUrl === QueryAggregateVolumeRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryAggregateVolumeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumeRequest { + const message = createBaseQueryAggregateVolumeRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryAggregateVolumeRequestAmino): QueryAggregateVolumeRequest { + const message = createBaseQueryAggregateVolumeRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryAggregateVolumeRequest): QueryAggregateVolumeRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumeRequestAminoMsg): QueryAggregateVolumeRequest { + return QueryAggregateVolumeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumeRequestProtoMsg): QueryAggregateVolumeRequest { + return QueryAggregateVolumeRequest.decode(message.value); + }, + toProto(message: QueryAggregateVolumeRequest): Uint8Array { + return QueryAggregateVolumeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumeRequest): QueryAggregateVolumeRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeRequest", + value: QueryAggregateVolumeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumeRequest.typeUrl, QueryAggregateVolumeRequest); +function createBaseQueryAggregateVolumeResponse(): QueryAggregateVolumeResponse { + return { + aggregateVolumes: [] + }; +} +export const QueryAggregateVolumeResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse", + is(o: any): o is QueryAggregateVolumeResponse { + return o && (o.$typeUrl === QueryAggregateVolumeResponse.typeUrl || Array.isArray(o.aggregateVolumes) && (!o.aggregateVolumes.length || MarketVolume.is(o.aggregateVolumes[0]))); + }, + isAmino(o: any): o is QueryAggregateVolumeResponseAmino { + return o && (o.$typeUrl === QueryAggregateVolumeResponse.typeUrl || Array.isArray(o.aggregate_volumes) && (!o.aggregate_volumes.length || MarketVolume.isAmino(o.aggregate_volumes[0]))); + }, + encode(message: QueryAggregateVolumeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregateVolumes) { + MarketVolume.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumeResponse { + const message = createBaseQueryAggregateVolumeResponse(); + message.aggregateVolumes = object.aggregateVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumeResponseAmino): QueryAggregateVolumeResponse { + const message = createBaseQueryAggregateVolumeResponse(); + message.aggregateVolumes = object.aggregate_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateVolumeResponse): QueryAggregateVolumeResponseAmino { + const obj: any = {}; + if (message.aggregateVolumes) { + obj.aggregate_volumes = message.aggregateVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.aggregate_volumes = message.aggregateVolumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumeResponseAminoMsg): QueryAggregateVolumeResponse { + return QueryAggregateVolumeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumeResponseProtoMsg): QueryAggregateVolumeResponse { + return QueryAggregateVolumeResponse.decode(message.value); + }, + toProto(message: QueryAggregateVolumeResponse): Uint8Array { + return QueryAggregateVolumeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumeResponse): QueryAggregateVolumeResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumeResponse", + value: QueryAggregateVolumeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumeResponse.typeUrl, QueryAggregateVolumeResponse); +function createBaseQueryAggregateVolumesRequest(): QueryAggregateVolumesRequest { + return { + accounts: [], + marketIds: [] + }; +} +export const QueryAggregateVolumesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest", + is(o: any): o is QueryAggregateVolumesRequest { + return o && (o.$typeUrl === QueryAggregateVolumesRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QueryAggregateVolumesRequestAmino { + return o && (o.$typeUrl === QueryAggregateVolumesRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QueryAggregateVolumesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumesRequest { + const message = createBaseQueryAggregateVolumesRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumesRequestAmino): QueryAggregateVolumesRequest { + const message = createBaseQueryAggregateVolumesRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAggregateVolumesRequest): QueryAggregateVolumesRequestAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumesRequestAminoMsg): QueryAggregateVolumesRequest { + return QueryAggregateVolumesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumesRequestProtoMsg): QueryAggregateVolumesRequest { + return QueryAggregateVolumesRequest.decode(message.value); + }, + toProto(message: QueryAggregateVolumesRequest): Uint8Array { + return QueryAggregateVolumesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumesRequest): QueryAggregateVolumesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesRequest", + value: QueryAggregateVolumesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumesRequest.typeUrl, QueryAggregateVolumesRequest); +function createBaseQueryAggregateVolumesResponse(): QueryAggregateVolumesResponse { + return { + aggregateAccountVolumes: [], + aggregateMarketVolumes: [] + }; +} +export const QueryAggregateVolumesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse", + is(o: any): o is QueryAggregateVolumesResponse { + return o && (o.$typeUrl === QueryAggregateVolumesResponse.typeUrl || Array.isArray(o.aggregateAccountVolumes) && (!o.aggregateAccountVolumes.length || AggregateAccountVolumeRecord.is(o.aggregateAccountVolumes[0])) && Array.isArray(o.aggregateMarketVolumes) && (!o.aggregateMarketVolumes.length || MarketVolume.is(o.aggregateMarketVolumes[0]))); + }, + isAmino(o: any): o is QueryAggregateVolumesResponseAmino { + return o && (o.$typeUrl === QueryAggregateVolumesResponse.typeUrl || Array.isArray(o.aggregate_account_volumes) && (!o.aggregate_account_volumes.length || AggregateAccountVolumeRecord.isAmino(o.aggregate_account_volumes[0])) && Array.isArray(o.aggregate_market_volumes) && (!o.aggregate_market_volumes.length || MarketVolume.isAmino(o.aggregate_market_volumes[0]))); + }, + encode(message: QueryAggregateVolumesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregateAccountVolumes) { + AggregateAccountVolumeRecord.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.aggregateMarketVolumes) { + MarketVolume.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateVolumesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVolumesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateAccountVolumes.push(AggregateAccountVolumeRecord.decode(reader, reader.uint32())); + break; + case 2: + message.aggregateMarketVolumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateVolumesResponse { + const message = createBaseQueryAggregateVolumesResponse(); + message.aggregateAccountVolumes = object.aggregateAccountVolumes?.map(e => AggregateAccountVolumeRecord.fromPartial(e)) || []; + message.aggregateMarketVolumes = object.aggregateMarketVolumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateVolumesResponseAmino): QueryAggregateVolumesResponse { + const message = createBaseQueryAggregateVolumesResponse(); + message.aggregateAccountVolumes = object.aggregate_account_volumes?.map(e => AggregateAccountVolumeRecord.fromAmino(e)) || []; + message.aggregateMarketVolumes = object.aggregate_market_volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateVolumesResponse): QueryAggregateVolumesResponseAmino { + const obj: any = {}; + if (message.aggregateAccountVolumes) { + obj.aggregate_account_volumes = message.aggregateAccountVolumes.map(e => e ? AggregateAccountVolumeRecord.toAmino(e) : undefined); + } else { + obj.aggregate_account_volumes = message.aggregateAccountVolumes; + } + if (message.aggregateMarketVolumes) { + obj.aggregate_market_volumes = message.aggregateMarketVolumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.aggregate_market_volumes = message.aggregateMarketVolumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVolumesResponseAminoMsg): QueryAggregateVolumesResponse { + return QueryAggregateVolumesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVolumesResponseProtoMsg): QueryAggregateVolumesResponse { + return QueryAggregateVolumesResponse.decode(message.value); + }, + toProto(message: QueryAggregateVolumesResponse): Uint8Array { + return QueryAggregateVolumesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVolumesResponse): QueryAggregateVolumesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateVolumesResponse", + value: QueryAggregateVolumesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateVolumesResponse.typeUrl, QueryAggregateVolumesResponse); +function createBaseQueryAggregateMarketVolumeRequest(): QueryAggregateMarketVolumeRequest { + return { + marketId: "" + }; +} +export const QueryAggregateMarketVolumeRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest", + is(o: any): o is QueryAggregateMarketVolumeRequest { + return o && (o.$typeUrl === QueryAggregateMarketVolumeRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryAggregateMarketVolumeRequestAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumeRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryAggregateMarketVolumeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumeRequest { + const message = createBaseQueryAggregateMarketVolumeRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumeRequestAmino): QueryAggregateMarketVolumeRequest { + const message = createBaseQueryAggregateMarketVolumeRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryAggregateMarketVolumeRequest): QueryAggregateMarketVolumeRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumeRequestAminoMsg): QueryAggregateMarketVolumeRequest { + return QueryAggregateMarketVolumeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumeRequestProtoMsg): QueryAggregateMarketVolumeRequest { + return QueryAggregateMarketVolumeRequest.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumeRequest): Uint8Array { + return QueryAggregateMarketVolumeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumeRequest): QueryAggregateMarketVolumeRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeRequest", + value: QueryAggregateMarketVolumeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumeRequest.typeUrl, QueryAggregateMarketVolumeRequest); +function createBaseQueryAggregateMarketVolumeResponse(): QueryAggregateMarketVolumeResponse { + return { + volume: VolumeRecord.fromPartial({}) + }; +} +export const QueryAggregateMarketVolumeResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse", + is(o: any): o is QueryAggregateMarketVolumeResponse { + return o && (o.$typeUrl === QueryAggregateMarketVolumeResponse.typeUrl || VolumeRecord.is(o.volume)); + }, + isAmino(o: any): o is QueryAggregateMarketVolumeResponseAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumeResponse.typeUrl || VolumeRecord.isAmino(o.volume)); + }, + encode(message: QueryAggregateMarketVolumeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volume !== undefined) { + VolumeRecord.encode(message.volume, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volume = VolumeRecord.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumeResponse { + const message = createBaseQueryAggregateMarketVolumeResponse(); + message.volume = object.volume !== undefined && object.volume !== null ? VolumeRecord.fromPartial(object.volume) : undefined; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumeResponseAmino): QueryAggregateMarketVolumeResponse { + const message = createBaseQueryAggregateMarketVolumeResponse(); + if (object.volume !== undefined && object.volume !== null) { + message.volume = VolumeRecord.fromAmino(object.volume); + } + return message; + }, + toAmino(message: QueryAggregateMarketVolumeResponse): QueryAggregateMarketVolumeResponseAmino { + const obj: any = {}; + obj.volume = message.volume ? VolumeRecord.toAmino(message.volume) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumeResponseAminoMsg): QueryAggregateMarketVolumeResponse { + return QueryAggregateMarketVolumeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumeResponseProtoMsg): QueryAggregateMarketVolumeResponse { + return QueryAggregateMarketVolumeResponse.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumeResponse): Uint8Array { + return QueryAggregateMarketVolumeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumeResponse): QueryAggregateMarketVolumeResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumeResponse", + value: QueryAggregateMarketVolumeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumeResponse.typeUrl, QueryAggregateMarketVolumeResponse); +function createBaseQueryDenomDecimalRequest(): QueryDenomDecimalRequest { + return { + denom: "" + }; +} +export const QueryDenomDecimalRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest", + is(o: any): o is QueryDenomDecimalRequest { + return o && (o.$typeUrl === QueryDenomDecimalRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomDecimalRequestAmino { + return o && (o.$typeUrl === QueryDenomDecimalRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomDecimalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalRequest(); + 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: DeepPartial): QueryDenomDecimalRequest { + const message = createBaseQueryDenomDecimalRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomDecimalRequestAmino): QueryDenomDecimalRequest { + const message = createBaseQueryDenomDecimalRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomDecimalRequest): QueryDenomDecimalRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalRequestAminoMsg): QueryDenomDecimalRequest { + return QueryDenomDecimalRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalRequestProtoMsg): QueryDenomDecimalRequest { + return QueryDenomDecimalRequest.decode(message.value); + }, + toProto(message: QueryDenomDecimalRequest): Uint8Array { + return QueryDenomDecimalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalRequest): QueryDenomDecimalRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalRequest", + value: QueryDenomDecimalRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalRequest.typeUrl, QueryDenomDecimalRequest); +function createBaseQueryDenomDecimalResponse(): QueryDenomDecimalResponse { + return { + decimal: BigInt(0) + }; +} +export const QueryDenomDecimalResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse", + is(o: any): o is QueryDenomDecimalResponse { + return o && (o.$typeUrl === QueryDenomDecimalResponse.typeUrl || typeof o.decimal === "bigint"); + }, + isAmino(o: any): o is QueryDenomDecimalResponseAmino { + return o && (o.$typeUrl === QueryDenomDecimalResponse.typeUrl || typeof o.decimal === "bigint"); + }, + encode(message: QueryDenomDecimalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.decimal !== BigInt(0)) { + writer.uint32(8).uint64(message.decimal); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.decimal = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomDecimalResponse { + const message = createBaseQueryDenomDecimalResponse(); + message.decimal = object.decimal !== undefined && object.decimal !== null ? BigInt(object.decimal.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryDenomDecimalResponseAmino): QueryDenomDecimalResponse { + const message = createBaseQueryDenomDecimalResponse(); + if (object.decimal !== undefined && object.decimal !== null) { + message.decimal = BigInt(object.decimal); + } + return message; + }, + toAmino(message: QueryDenomDecimalResponse): QueryDenomDecimalResponseAmino { + const obj: any = {}; + obj.decimal = message.decimal !== BigInt(0) ? message.decimal?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalResponseAminoMsg): QueryDenomDecimalResponse { + return QueryDenomDecimalResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalResponseProtoMsg): QueryDenomDecimalResponse { + return QueryDenomDecimalResponse.decode(message.value); + }, + toProto(message: QueryDenomDecimalResponse): Uint8Array { + return QueryDenomDecimalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalResponse): QueryDenomDecimalResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalResponse", + value: QueryDenomDecimalResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalResponse.typeUrl, QueryDenomDecimalResponse); +function createBaseQueryDenomDecimalsRequest(): QueryDenomDecimalsRequest { + return { + denoms: [] + }; +} +export const QueryDenomDecimalsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest", + is(o: any): o is QueryDenomDecimalsRequest { + return o && (o.$typeUrl === QueryDenomDecimalsRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QueryDenomDecimalsRequestAmino { + return o && (o.$typeUrl === QueryDenomDecimalsRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + encode(message: QueryDenomDecimalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalsRequest(); + 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: DeepPartial): QueryDenomDecimalsRequest { + const message = createBaseQueryDenomDecimalsRequest(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDenomDecimalsRequestAmino): QueryDenomDecimalsRequest { + const message = createBaseQueryDenomDecimalsRequest(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDenomDecimalsRequest): QueryDenomDecimalsRequestAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = message.denoms; + } + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalsRequestAminoMsg): QueryDenomDecimalsRequest { + return QueryDenomDecimalsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalsRequestProtoMsg): QueryDenomDecimalsRequest { + return QueryDenomDecimalsRequest.decode(message.value); + }, + toProto(message: QueryDenomDecimalsRequest): Uint8Array { + return QueryDenomDecimalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalsRequest): QueryDenomDecimalsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsRequest", + value: QueryDenomDecimalsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalsRequest.typeUrl, QueryDenomDecimalsRequest); +function createBaseQueryDenomDecimalsResponse(): QueryDenomDecimalsResponse { + return { + denomDecimals: [] + }; +} +export const QueryDenomDecimalsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse", + is(o: any): o is QueryDenomDecimalsResponse { + return o && (o.$typeUrl === QueryDenomDecimalsResponse.typeUrl || Array.isArray(o.denomDecimals) && (!o.denomDecimals.length || DenomDecimals.is(o.denomDecimals[0]))); + }, + isAmino(o: any): o is QueryDenomDecimalsResponseAmino { + return o && (o.$typeUrl === QueryDenomDecimalsResponse.typeUrl || Array.isArray(o.denom_decimals) && (!o.denom_decimals.length || DenomDecimals.isAmino(o.denom_decimals[0]))); + }, + encode(message: QueryDenomDecimalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomDecimals) { + DenomDecimals.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomDecimalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomDecimalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomDecimals.push(DenomDecimals.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomDecimalsResponse { + const message = createBaseQueryDenomDecimalsResponse(); + message.denomDecimals = object.denomDecimals?.map(e => DenomDecimals.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDenomDecimalsResponseAmino): QueryDenomDecimalsResponse { + const message = createBaseQueryDenomDecimalsResponse(); + message.denomDecimals = object.denom_decimals?.map(e => DenomDecimals.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDenomDecimalsResponse): QueryDenomDecimalsResponseAmino { + const obj: any = {}; + if (message.denomDecimals) { + obj.denom_decimals = message.denomDecimals.map(e => e ? DenomDecimals.toAmino(e) : undefined); + } else { + obj.denom_decimals = message.denomDecimals; + } + return obj; + }, + fromAminoMsg(object: QueryDenomDecimalsResponseAminoMsg): QueryDenomDecimalsResponse { + return QueryDenomDecimalsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomDecimalsResponseProtoMsg): QueryDenomDecimalsResponse { + return QueryDenomDecimalsResponse.decode(message.value); + }, + toProto(message: QueryDenomDecimalsResponse): Uint8Array { + return QueryDenomDecimalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomDecimalsResponse): QueryDenomDecimalsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDenomDecimalsResponse", + value: QueryDenomDecimalsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomDecimalsResponse.typeUrl, QueryDenomDecimalsResponse); +function createBaseQueryAggregateMarketVolumesRequest(): QueryAggregateMarketVolumesRequest { + return { + marketIds: [] + }; +} +export const QueryAggregateMarketVolumesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest", + is(o: any): o is QueryAggregateMarketVolumesRequest { + return o && (o.$typeUrl === QueryAggregateMarketVolumesRequest.typeUrl || Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QueryAggregateMarketVolumesRequestAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumesRequest.typeUrl || Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QueryAggregateMarketVolumesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumesRequest { + const message = createBaseQueryAggregateMarketVolumesRequest(); + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumesRequestAmino): QueryAggregateMarketVolumesRequest { + const message = createBaseQueryAggregateMarketVolumesRequest(); + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAggregateMarketVolumesRequest): QueryAggregateMarketVolumesRequestAmino { + const obj: any = {}; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumesRequestAminoMsg): QueryAggregateMarketVolumesRequest { + return QueryAggregateMarketVolumesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumesRequestProtoMsg): QueryAggregateMarketVolumesRequest { + return QueryAggregateMarketVolumesRequest.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumesRequest): Uint8Array { + return QueryAggregateMarketVolumesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumesRequest): QueryAggregateMarketVolumesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesRequest", + value: QueryAggregateMarketVolumesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumesRequest.typeUrl, QueryAggregateMarketVolumesRequest); +function createBaseQueryAggregateMarketVolumesResponse(): QueryAggregateMarketVolumesResponse { + return { + volumes: [] + }; +} +export const QueryAggregateMarketVolumesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse", + is(o: any): o is QueryAggregateMarketVolumesResponse { + return o && (o.$typeUrl === QueryAggregateMarketVolumesResponse.typeUrl || Array.isArray(o.volumes) && (!o.volumes.length || MarketVolume.is(o.volumes[0]))); + }, + isAmino(o: any): o is QueryAggregateMarketVolumesResponseAmino { + return o && (o.$typeUrl === QueryAggregateMarketVolumesResponse.typeUrl || Array.isArray(o.volumes) && (!o.volumes.length || MarketVolume.isAmino(o.volumes[0]))); + }, + encode(message: QueryAggregateMarketVolumesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.volumes) { + MarketVolume.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAggregateMarketVolumesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateMarketVolumesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volumes.push(MarketVolume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAggregateMarketVolumesResponse { + const message = createBaseQueryAggregateMarketVolumesResponse(); + message.volumes = object.volumes?.map(e => MarketVolume.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateMarketVolumesResponseAmino): QueryAggregateMarketVolumesResponse { + const message = createBaseQueryAggregateMarketVolumesResponse(); + message.volumes = object.volumes?.map(e => MarketVolume.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateMarketVolumesResponse): QueryAggregateMarketVolumesResponseAmino { + const obj: any = {}; + if (message.volumes) { + obj.volumes = message.volumes.map(e => e ? MarketVolume.toAmino(e) : undefined); + } else { + obj.volumes = message.volumes; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateMarketVolumesResponseAminoMsg): QueryAggregateMarketVolumesResponse { + return QueryAggregateMarketVolumesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateMarketVolumesResponseProtoMsg): QueryAggregateMarketVolumesResponse { + return QueryAggregateMarketVolumesResponse.decode(message.value); + }, + toProto(message: QueryAggregateMarketVolumesResponse): Uint8Array { + return QueryAggregateMarketVolumesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateMarketVolumesResponse): QueryAggregateMarketVolumesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAggregateMarketVolumesResponse", + value: QueryAggregateMarketVolumesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAggregateMarketVolumesResponse.typeUrl, QueryAggregateMarketVolumesResponse); +function createBaseQuerySubaccountDepositRequest(): QuerySubaccountDepositRequest { + return { + subaccountId: "", + denom: "" + }; +} +export const QuerySubaccountDepositRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest", + is(o: any): o is QuerySubaccountDepositRequest { + return o && (o.$typeUrl === QuerySubaccountDepositRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySubaccountDepositRequestAmino { + return o && (o.$typeUrl === QuerySubaccountDepositRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.denom === "string"); + }, + encode(message: QuerySubaccountDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositRequest { + const message = createBaseQuerySubaccountDepositRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountDepositRequestAmino): QuerySubaccountDepositRequest { + const message = createBaseQuerySubaccountDepositRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySubaccountDepositRequest): QuerySubaccountDepositRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositRequestAminoMsg): QuerySubaccountDepositRequest { + return QuerySubaccountDepositRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositRequestProtoMsg): QuerySubaccountDepositRequest { + return QuerySubaccountDepositRequest.decode(message.value); + }, + toProto(message: QuerySubaccountDepositRequest): Uint8Array { + return QuerySubaccountDepositRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositRequest): QuerySubaccountDepositRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositRequest", + value: QuerySubaccountDepositRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositRequest.typeUrl, QuerySubaccountDepositRequest); +function createBaseQuerySubaccountDepositResponse(): QuerySubaccountDepositResponse { + return { + deposits: undefined + }; +} +export const QuerySubaccountDepositResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse", + is(o: any): o is QuerySubaccountDepositResponse { + return o && o.$typeUrl === QuerySubaccountDepositResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountDepositResponseAmino { + return o && o.$typeUrl === QuerySubaccountDepositResponse.typeUrl; + }, + encode(message: QuerySubaccountDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deposits !== undefined) { + Deposit.encode(message.deposits, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountDepositResponse { + const message = createBaseQuerySubaccountDepositResponse(); + message.deposits = object.deposits !== undefined && object.deposits !== null ? Deposit.fromPartial(object.deposits) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountDepositResponseAmino): QuerySubaccountDepositResponse { + const message = createBaseQuerySubaccountDepositResponse(); + if (object.deposits !== undefined && object.deposits !== null) { + message.deposits = Deposit.fromAmino(object.deposits); + } + return message; + }, + toAmino(message: QuerySubaccountDepositResponse): QuerySubaccountDepositResponseAmino { + const obj: any = {}; + obj.deposits = message.deposits ? Deposit.toAmino(message.deposits) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountDepositResponseAminoMsg): QuerySubaccountDepositResponse { + return QuerySubaccountDepositResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountDepositResponseProtoMsg): QuerySubaccountDepositResponse { + return QuerySubaccountDepositResponse.decode(message.value); + }, + toProto(message: QuerySubaccountDepositResponse): Uint8Array { + return QuerySubaccountDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountDepositResponse): QuerySubaccountDepositResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountDepositResponse", + value: QuerySubaccountDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountDepositResponse.typeUrl, QuerySubaccountDepositResponse); +function createBaseQuerySpotMarketsRequest(): QuerySpotMarketsRequest { + return { + status: "", + marketIds: [] + }; +} +export const QuerySpotMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest", + is(o: any): o is QuerySpotMarketsRequest { + return o && (o.$typeUrl === QuerySpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is QuerySpotMarketsRequestAmino { + return o && (o.$typeUrl === QuerySpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: QuerySpotMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketsRequest { + const message = createBaseQuerySpotMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QuerySpotMarketsRequestAmino): QuerySpotMarketsRequest { + const message = createBaseQuerySpotMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QuerySpotMarketsRequest): QuerySpotMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: QuerySpotMarketsRequestAminoMsg): QuerySpotMarketsRequest { + return QuerySpotMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketsRequestProtoMsg): QuerySpotMarketsRequest { + return QuerySpotMarketsRequest.decode(message.value); + }, + toProto(message: QuerySpotMarketsRequest): Uint8Array { + return QuerySpotMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketsRequest): QuerySpotMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsRequest", + value: QuerySpotMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketsRequest.typeUrl, QuerySpotMarketsRequest); +function createBaseQuerySpotMarketsResponse(): QuerySpotMarketsResponse { + return { + markets: [] + }; +} +export const QuerySpotMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse", + is(o: any): o is QuerySpotMarketsResponse { + return o && (o.$typeUrl === QuerySpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || SpotMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QuerySpotMarketsResponseAmino { + return o && (o.$typeUrl === QuerySpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || SpotMarket.isAmino(o.markets[0]))); + }, + encode(message: QuerySpotMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + SpotMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(SpotMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketsResponse { + const message = createBaseQuerySpotMarketsResponse(); + message.markets = object.markets?.map(e => SpotMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotMarketsResponseAmino): QuerySpotMarketsResponse { + const message = createBaseQuerySpotMarketsResponse(); + message.markets = object.markets?.map(e => SpotMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotMarketsResponse): QuerySpotMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? SpotMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QuerySpotMarketsResponseAminoMsg): QuerySpotMarketsResponse { + return QuerySpotMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketsResponseProtoMsg): QuerySpotMarketsResponse { + return QuerySpotMarketsResponse.decode(message.value); + }, + toProto(message: QuerySpotMarketsResponse): Uint8Array { + return QuerySpotMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketsResponse): QuerySpotMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketsResponse", + value: QuerySpotMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketsResponse.typeUrl, QuerySpotMarketsResponse); +function createBaseQuerySpotMarketRequest(): QuerySpotMarketRequest { + return { + marketId: "" + }; +} +export const QuerySpotMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest", + is(o: any): o is QuerySpotMarketRequest { + return o && (o.$typeUrl === QuerySpotMarketRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySpotMarketRequestAmino { + return o && (o.$typeUrl === QuerySpotMarketRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QuerySpotMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketRequest { + const message = createBaseQuerySpotMarketRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySpotMarketRequestAmino): QuerySpotMarketRequest { + const message = createBaseQuerySpotMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySpotMarketRequest): QuerySpotMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySpotMarketRequestAminoMsg): QuerySpotMarketRequest { + return QuerySpotMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketRequestProtoMsg): QuerySpotMarketRequest { + return QuerySpotMarketRequest.decode(message.value); + }, + toProto(message: QuerySpotMarketRequest): Uint8Array { + return QuerySpotMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketRequest): QuerySpotMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketRequest", + value: QuerySpotMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketRequest.typeUrl, QuerySpotMarketRequest); +function createBaseQuerySpotMarketResponse(): QuerySpotMarketResponse { + return { + market: undefined + }; +} +export const QuerySpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse", + is(o: any): o is QuerySpotMarketResponse { + return o && o.$typeUrl === QuerySpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpotMarketResponseAmino { + return o && o.$typeUrl === QuerySpotMarketResponse.typeUrl; + }, + encode(message: QuerySpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMarketResponse { + const message = createBaseQuerySpotMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QuerySpotMarketResponseAmino): QuerySpotMarketResponse { + const message = createBaseQuerySpotMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QuerySpotMarketResponse): QuerySpotMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpotMarketResponseAminoMsg): QuerySpotMarketResponse { + return QuerySpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMarketResponseProtoMsg): QuerySpotMarketResponse { + return QuerySpotMarketResponse.decode(message.value); + }, + toProto(message: QuerySpotMarketResponse): Uint8Array { + return QuerySpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMarketResponse): QuerySpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMarketResponse", + value: QuerySpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMarketResponse.typeUrl, QuerySpotMarketResponse); +function createBaseQuerySpotOrderbookRequest(): QuerySpotOrderbookRequest { + return { + marketId: "", + limit: BigInt(0), + orderSide: 0, + limitCumulativeNotional: undefined, + limitCumulativeQuantity: undefined + }; +} +export const QuerySpotOrderbookRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest", + is(o: any): o is QuerySpotOrderbookRequest { + return o && (o.$typeUrl === QuerySpotOrderbookRequest.typeUrl || typeof o.marketId === "string" && typeof o.limit === "bigint" && isSet(o.orderSide)); + }, + isAmino(o: any): o is QuerySpotOrderbookRequestAmino { + return o && (o.$typeUrl === QuerySpotOrderbookRequest.typeUrl || typeof o.market_id === "string" && typeof o.limit === "bigint" && isSet(o.order_side)); + }, + encode(message: QuerySpotOrderbookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(16).uint64(message.limit); + } + if (message.orderSide !== 0) { + writer.uint32(24).int32(message.orderSide); + } + if (message.limitCumulativeNotional !== undefined) { + writer.uint32(34).string(message.limitCumulativeNotional); + } + if (message.limitCumulativeQuantity !== undefined) { + writer.uint32(42).string(message.limitCumulativeQuantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrderbookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrderbookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limit = reader.uint64(); + break; + case 3: + message.orderSide = (reader.int32() as any); + break; + case 4: + message.limitCumulativeNotional = reader.string(); + break; + case 5: + message.limitCumulativeQuantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrderbookRequest { + const message = createBaseQuerySpotOrderbookRequest(); + message.marketId = object.marketId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.orderSide = object.orderSide ?? 0; + message.limitCumulativeNotional = object.limitCumulativeNotional ?? undefined; + message.limitCumulativeQuantity = object.limitCumulativeQuantity ?? undefined; + return message; + }, + fromAmino(object: QuerySpotOrderbookRequestAmino): QuerySpotOrderbookRequest { + const message = createBaseQuerySpotOrderbookRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.order_side !== undefined && object.order_side !== null) { + message.orderSide = object.order_side; + } + if (object.limit_cumulative_notional !== undefined && object.limit_cumulative_notional !== null) { + message.limitCumulativeNotional = object.limit_cumulative_notional; + } + if (object.limit_cumulative_quantity !== undefined && object.limit_cumulative_quantity !== null) { + message.limitCumulativeQuantity = object.limit_cumulative_quantity; + } + return message; + }, + toAmino(message: QuerySpotOrderbookRequest): QuerySpotOrderbookRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.order_side = message.orderSide === 0 ? undefined : message.orderSide; + obj.limit_cumulative_notional = message.limitCumulativeNotional === null ? undefined : message.limitCumulativeNotional; + obj.limit_cumulative_quantity = message.limitCumulativeQuantity === null ? undefined : message.limitCumulativeQuantity; + return obj; + }, + fromAminoMsg(object: QuerySpotOrderbookRequestAminoMsg): QuerySpotOrderbookRequest { + return QuerySpotOrderbookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrderbookRequestProtoMsg): QuerySpotOrderbookRequest { + return QuerySpotOrderbookRequest.decode(message.value); + }, + toProto(message: QuerySpotOrderbookRequest): Uint8Array { + return QuerySpotOrderbookRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrderbookRequest): QuerySpotOrderbookRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookRequest", + value: QuerySpotOrderbookRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrderbookRequest.typeUrl, QuerySpotOrderbookRequest); +function createBaseQuerySpotOrderbookResponse(): QuerySpotOrderbookResponse { + return { + buysPriceLevel: [], + sellsPriceLevel: [] + }; +} +export const QuerySpotOrderbookResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse", + is(o: any): o is QuerySpotOrderbookResponse { + return o && (o.$typeUrl === QuerySpotOrderbookResponse.typeUrl || Array.isArray(o.buysPriceLevel) && (!o.buysPriceLevel.length || Level.is(o.buysPriceLevel[0])) && Array.isArray(o.sellsPriceLevel) && (!o.sellsPriceLevel.length || Level.is(o.sellsPriceLevel[0]))); + }, + isAmino(o: any): o is QuerySpotOrderbookResponseAmino { + return o && (o.$typeUrl === QuerySpotOrderbookResponse.typeUrl || Array.isArray(o.buys_price_level) && (!o.buys_price_level.length || Level.isAmino(o.buys_price_level[0])) && Array.isArray(o.sells_price_level) && (!o.sells_price_level.length || Level.isAmino(o.sells_price_level[0]))); + }, + encode(message: QuerySpotOrderbookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buysPriceLevel) { + Level.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellsPriceLevel) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrderbookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrderbookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buysPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + case 2: + message.sellsPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrderbookResponse { + const message = createBaseQuerySpotOrderbookResponse(); + message.buysPriceLevel = object.buysPriceLevel?.map(e => Level.fromPartial(e)) || []; + message.sellsPriceLevel = object.sellsPriceLevel?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotOrderbookResponseAmino): QuerySpotOrderbookResponse { + const message = createBaseQuerySpotOrderbookResponse(); + message.buysPriceLevel = object.buys_price_level?.map(e => Level.fromAmino(e)) || []; + message.sellsPriceLevel = object.sells_price_level?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotOrderbookResponse): QuerySpotOrderbookResponseAmino { + const obj: any = {}; + if (message.buysPriceLevel) { + obj.buys_price_level = message.buysPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buys_price_level = message.buysPriceLevel; + } + if (message.sellsPriceLevel) { + obj.sells_price_level = message.sellsPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sells_price_level = message.sellsPriceLevel; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrderbookResponseAminoMsg): QuerySpotOrderbookResponse { + return QuerySpotOrderbookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrderbookResponseProtoMsg): QuerySpotOrderbookResponse { + return QuerySpotOrderbookResponse.decode(message.value); + }, + toProto(message: QuerySpotOrderbookResponse): Uint8Array { + return QuerySpotOrderbookResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrderbookResponse): QuerySpotOrderbookResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrderbookResponse", + value: QuerySpotOrderbookResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrderbookResponse.typeUrl, QuerySpotOrderbookResponse); +function createBaseFullSpotMarket(): FullSpotMarket { + return { + market: undefined, + midPriceAndTob: undefined + }; +} +export const FullSpotMarket = { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket", + is(o: any): o is FullSpotMarket { + return o && o.$typeUrl === FullSpotMarket.typeUrl; + }, + isAmino(o: any): o is FullSpotMarketAmino { + return o && o.$typeUrl === FullSpotMarket.typeUrl; + }, + encode(message: FullSpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + SpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.midPriceAndTob !== undefined) { + MidPriceAndTOB.encode(message.midPriceAndTob, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullSpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = SpotMarket.decode(reader, reader.uint32()); + break; + case 2: + message.midPriceAndTob = MidPriceAndTOB.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullSpotMarket { + const message = createBaseFullSpotMarket(); + message.market = object.market !== undefined && object.market !== null ? SpotMarket.fromPartial(object.market) : undefined; + message.midPriceAndTob = object.midPriceAndTob !== undefined && object.midPriceAndTob !== null ? MidPriceAndTOB.fromPartial(object.midPriceAndTob) : undefined; + return message; + }, + fromAmino(object: FullSpotMarketAmino): FullSpotMarket { + const message = createBaseFullSpotMarket(); + if (object.market !== undefined && object.market !== null) { + message.market = SpotMarket.fromAmino(object.market); + } + if (object.mid_price_and_tob !== undefined && object.mid_price_and_tob !== null) { + message.midPriceAndTob = MidPriceAndTOB.fromAmino(object.mid_price_and_tob); + } + return message; + }, + toAmino(message: FullSpotMarket): FullSpotMarketAmino { + const obj: any = {}; + obj.market = message.market ? SpotMarket.toAmino(message.market) : undefined; + obj.mid_price_and_tob = message.midPriceAndTob ? MidPriceAndTOB.toAmino(message.midPriceAndTob) : undefined; + return obj; + }, + fromAminoMsg(object: FullSpotMarketAminoMsg): FullSpotMarket { + return FullSpotMarket.fromAmino(object.value); + }, + fromProtoMsg(message: FullSpotMarketProtoMsg): FullSpotMarket { + return FullSpotMarket.decode(message.value); + }, + toProto(message: FullSpotMarket): Uint8Array { + return FullSpotMarket.encode(message).finish(); + }, + toProtoMsg(message: FullSpotMarket): FullSpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullSpotMarket", + value: FullSpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullSpotMarket.typeUrl, FullSpotMarket); +function createBaseQueryFullSpotMarketsRequest(): QueryFullSpotMarketsRequest { + return { + status: "", + marketIds: [], + withMidPriceAndTob: false + }; +} +export const QueryFullSpotMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest", + is(o: any): o is QueryFullSpotMarketsRequest { + return o && (o.$typeUrl === QueryFullSpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string") && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryFullSpotMarketsRequestAmino { + return o && (o.$typeUrl === QueryFullSpotMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string") && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryFullSpotMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(24).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + case 3: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketsRequest { + const message = createBaseQueryFullSpotMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryFullSpotMarketsRequestAmino): QueryFullSpotMarketsRequest { + const message = createBaseQueryFullSpotMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryFullSpotMarketsRequest): QueryFullSpotMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketsRequestAminoMsg): QueryFullSpotMarketsRequest { + return QueryFullSpotMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketsRequestProtoMsg): QueryFullSpotMarketsRequest { + return QueryFullSpotMarketsRequest.decode(message.value); + }, + toProto(message: QueryFullSpotMarketsRequest): Uint8Array { + return QueryFullSpotMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketsRequest): QueryFullSpotMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsRequest", + value: QueryFullSpotMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketsRequest.typeUrl, QueryFullSpotMarketsRequest); +function createBaseQueryFullSpotMarketsResponse(): QueryFullSpotMarketsResponse { + return { + markets: [] + }; +} +export const QueryFullSpotMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse", + is(o: any): o is QueryFullSpotMarketsResponse { + return o && (o.$typeUrl === QueryFullSpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullSpotMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryFullSpotMarketsResponseAmino { + return o && (o.$typeUrl === QueryFullSpotMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullSpotMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryFullSpotMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + FullSpotMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(FullSpotMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketsResponse { + const message = createBaseQueryFullSpotMarketsResponse(); + message.markets = object.markets?.map(e => FullSpotMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFullSpotMarketsResponseAmino): QueryFullSpotMarketsResponse { + const message = createBaseQueryFullSpotMarketsResponse(); + message.markets = object.markets?.map(e => FullSpotMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFullSpotMarketsResponse): QueryFullSpotMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? FullSpotMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketsResponseAminoMsg): QueryFullSpotMarketsResponse { + return QueryFullSpotMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketsResponseProtoMsg): QueryFullSpotMarketsResponse { + return QueryFullSpotMarketsResponse.decode(message.value); + }, + toProto(message: QueryFullSpotMarketsResponse): Uint8Array { + return QueryFullSpotMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketsResponse): QueryFullSpotMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketsResponse", + value: QueryFullSpotMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketsResponse.typeUrl, QueryFullSpotMarketsResponse); +function createBaseQueryFullSpotMarketRequest(): QueryFullSpotMarketRequest { + return { + marketId: "", + withMidPriceAndTob: false + }; +} +export const QueryFullSpotMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest", + is(o: any): o is QueryFullSpotMarketRequest { + return o && (o.$typeUrl === QueryFullSpotMarketRequest.typeUrl || typeof o.marketId === "string" && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryFullSpotMarketRequestAmino { + return o && (o.$typeUrl === QueryFullSpotMarketRequest.typeUrl || typeof o.market_id === "string" && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryFullSpotMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(16).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketRequest { + const message = createBaseQueryFullSpotMarketRequest(); + message.marketId = object.marketId ?? ""; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryFullSpotMarketRequestAmino): QueryFullSpotMarketRequest { + const message = createBaseQueryFullSpotMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryFullSpotMarketRequest): QueryFullSpotMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketRequestAminoMsg): QueryFullSpotMarketRequest { + return QueryFullSpotMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketRequestProtoMsg): QueryFullSpotMarketRequest { + return QueryFullSpotMarketRequest.decode(message.value); + }, + toProto(message: QueryFullSpotMarketRequest): Uint8Array { + return QueryFullSpotMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketRequest): QueryFullSpotMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketRequest", + value: QueryFullSpotMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketRequest.typeUrl, QueryFullSpotMarketRequest); +function createBaseQueryFullSpotMarketResponse(): QueryFullSpotMarketResponse { + return { + market: undefined + }; +} +export const QueryFullSpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse", + is(o: any): o is QueryFullSpotMarketResponse { + return o && o.$typeUrl === QueryFullSpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is QueryFullSpotMarketResponseAmino { + return o && o.$typeUrl === QueryFullSpotMarketResponse.typeUrl; + }, + encode(message: QueryFullSpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + FullSpotMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFullSpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFullSpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = FullSpotMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFullSpotMarketResponse { + const message = createBaseQueryFullSpotMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? FullSpotMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QueryFullSpotMarketResponseAmino): QueryFullSpotMarketResponse { + const message = createBaseQueryFullSpotMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = FullSpotMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QueryFullSpotMarketResponse): QueryFullSpotMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? FullSpotMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFullSpotMarketResponseAminoMsg): QueryFullSpotMarketResponse { + return QueryFullSpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFullSpotMarketResponseProtoMsg): QueryFullSpotMarketResponse { + return QueryFullSpotMarketResponse.decode(message.value); + }, + toProto(message: QueryFullSpotMarketResponse): Uint8Array { + return QueryFullSpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFullSpotMarketResponse): QueryFullSpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFullSpotMarketResponse", + value: QueryFullSpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFullSpotMarketResponse.typeUrl, QueryFullSpotMarketResponse); +function createBaseQuerySpotOrdersByHashesRequest(): QuerySpotOrdersByHashesRequest { + return { + marketId: "", + subaccountId: "", + orderHashes: [] + }; +} +export const QuerySpotOrdersByHashesRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest", + is(o: any): o is QuerySpotOrdersByHashesRequest { + return o && (o.$typeUrl === QuerySpotOrdersByHashesRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string")); + }, + isAmino(o: any): o is QuerySpotOrdersByHashesRequestAmino { + return o && (o.$typeUrl === QuerySpotOrdersByHashesRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string")); + }, + encode(message: QuerySpotOrdersByHashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.orderHashes) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrdersByHashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrdersByHashesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHashes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrdersByHashesRequest { + const message = createBaseQuerySpotOrdersByHashesRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHashes = object.orderHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: QuerySpotOrdersByHashesRequestAmino): QuerySpotOrdersByHashesRequest { + const message = createBaseQuerySpotOrdersByHashesRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.orderHashes = object.order_hashes?.map(e => e) || []; + return message; + }, + toAmino(message: QuerySpotOrdersByHashesRequest): QuerySpotOrdersByHashesRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrdersByHashesRequestAminoMsg): QuerySpotOrdersByHashesRequest { + return QuerySpotOrdersByHashesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrdersByHashesRequestProtoMsg): QuerySpotOrdersByHashesRequest { + return QuerySpotOrdersByHashesRequest.decode(message.value); + }, + toProto(message: QuerySpotOrdersByHashesRequest): Uint8Array { + return QuerySpotOrdersByHashesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrdersByHashesRequest): QuerySpotOrdersByHashesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesRequest", + value: QuerySpotOrdersByHashesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrdersByHashesRequest.typeUrl, QuerySpotOrdersByHashesRequest); +function createBaseQuerySpotOrdersByHashesResponse(): QuerySpotOrdersByHashesResponse { + return { + orders: [] + }; +} +export const QuerySpotOrdersByHashesResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse", + is(o: any): o is QuerySpotOrdersByHashesResponse { + return o && (o.$typeUrl === QuerySpotOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QuerySpotOrdersByHashesResponseAmino { + return o && (o.$typeUrl === QuerySpotOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QuerySpotOrdersByHashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotOrdersByHashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotOrdersByHashesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotOrdersByHashesResponse { + const message = createBaseQuerySpotOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySpotOrdersByHashesResponseAmino): QuerySpotOrdersByHashesResponse { + const message = createBaseQuerySpotOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySpotOrdersByHashesResponse): QuerySpotOrdersByHashesResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QuerySpotOrdersByHashesResponseAminoMsg): QuerySpotOrdersByHashesResponse { + return QuerySpotOrdersByHashesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotOrdersByHashesResponseProtoMsg): QuerySpotOrdersByHashesResponse { + return QuerySpotOrdersByHashesResponse.decode(message.value); + }, + toProto(message: QuerySpotOrdersByHashesResponse): Uint8Array { + return QuerySpotOrdersByHashesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotOrdersByHashesResponse): QuerySpotOrdersByHashesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotOrdersByHashesResponse", + value: QuerySpotOrdersByHashesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotOrdersByHashesResponse.typeUrl, QuerySpotOrdersByHashesResponse); +function createBaseQueryTraderSpotOrdersRequest(): QueryTraderSpotOrdersRequest { + return { + marketId: "", + subaccountId: "" + }; +} +export const QueryTraderSpotOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest", + is(o: any): o is QueryTraderSpotOrdersRequest { + return o && (o.$typeUrl === QueryTraderSpotOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryTraderSpotOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryTraderSpotOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersRequest { + const message = createBaseQueryTraderSpotOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersRequestAmino): QueryTraderSpotOrdersRequest { + const message = createBaseQueryTraderSpotOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryTraderSpotOrdersRequest): QueryTraderSpotOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersRequestAminoMsg): QueryTraderSpotOrdersRequest { + return QueryTraderSpotOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersRequestProtoMsg): QueryTraderSpotOrdersRequest { + return QueryTraderSpotOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersRequest): Uint8Array { + return QueryTraderSpotOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersRequest): QueryTraderSpotOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersRequest", + value: QueryTraderSpotOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersRequest.typeUrl, QueryTraderSpotOrdersRequest); +function createBaseQueryAccountAddressSpotOrdersRequest(): QueryAccountAddressSpotOrdersRequest { + return { + marketId: "", + accountAddress: "" + }; +} +export const QueryAccountAddressSpotOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest", + is(o: any): o is QueryAccountAddressSpotOrdersRequest { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressSpotOrdersRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.account_address === "string"); + }, + encode(message: QueryAccountAddressSpotOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.accountAddress !== "") { + writer.uint32(18).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressSpotOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressSpotOrdersRequest { + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressSpotOrdersRequestAmino): QueryAccountAddressSpotOrdersRequest { + const message = createBaseQueryAccountAddressSpotOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressSpotOrdersRequest): QueryAccountAddressSpotOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressSpotOrdersRequestAminoMsg): QueryAccountAddressSpotOrdersRequest { + return QueryAccountAddressSpotOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressSpotOrdersRequestProtoMsg): QueryAccountAddressSpotOrdersRequest { + return QueryAccountAddressSpotOrdersRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressSpotOrdersRequest): Uint8Array { + return QueryAccountAddressSpotOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressSpotOrdersRequest): QueryAccountAddressSpotOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersRequest", + value: QueryAccountAddressSpotOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressSpotOrdersRequest.typeUrl, QueryAccountAddressSpotOrdersRequest); +function createBaseTrimmedSpotLimitOrder(): TrimmedSpotLimitOrder { + return { + price: "", + quantity: "", + fillable: "", + isBuy: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedSpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder", + is(o: any): o is TrimmedSpotLimitOrder { + return o && (o.$typeUrl === TrimmedSpotLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedSpotLimitOrderAmino { + return o && (o.$typeUrl === TrimmedSpotLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedSpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.fillable !== "") { + writer.uint32(26).string(message.fillable); + } + if (message.isBuy === true) { + writer.uint32(32).bool(message.isBuy); + } + if (message.orderHash !== "") { + writer.uint32(42).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedSpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.fillable = reader.string(); + break; + case 4: + message.isBuy = reader.bool(); + break; + case 5: + message.orderHash = reader.string(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedSpotLimitOrder { + const message = createBaseTrimmedSpotLimitOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.fillable = object.fillable ?? ""; + message.isBuy = object.isBuy ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedSpotLimitOrderAmino): TrimmedSpotLimitOrder { + const message = createBaseTrimmedSpotLimitOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedSpotLimitOrder): TrimmedSpotLimitOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.isBuy = message.isBuy === false ? undefined : message.isBuy; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedSpotLimitOrderAminoMsg): TrimmedSpotLimitOrder { + return TrimmedSpotLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedSpotLimitOrderProtoMsg): TrimmedSpotLimitOrder { + return TrimmedSpotLimitOrder.decode(message.value); + }, + toProto(message: TrimmedSpotLimitOrder): Uint8Array { + return TrimmedSpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedSpotLimitOrder): TrimmedSpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedSpotLimitOrder", + value: TrimmedSpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedSpotLimitOrder.typeUrl, TrimmedSpotLimitOrder); +function createBaseQueryTraderSpotOrdersResponse(): QueryTraderSpotOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse", + is(o: any): o is QueryTraderSpotOrdersResponse { + return o && (o.$typeUrl === QueryTraderSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderSpotOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersResponse { + const message = createBaseQueryTraderSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersResponseAmino): QueryTraderSpotOrdersResponse { + const message = createBaseQueryTraderSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderSpotOrdersResponse): QueryTraderSpotOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersResponseAminoMsg): QueryTraderSpotOrdersResponse { + return QueryTraderSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersResponseProtoMsg): QueryTraderSpotOrdersResponse { + return QueryTraderSpotOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersResponse): Uint8Array { + return QueryTraderSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersResponse): QueryTraderSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersResponse", + value: QueryTraderSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersResponse.typeUrl, QueryTraderSpotOrdersResponse); +function createBaseQueryAccountAddressSpotOrdersResponse(): QueryAccountAddressSpotOrdersResponse { + return { + orders: [] + }; +} +export const QueryAccountAddressSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse", + is(o: any): o is QueryAccountAddressSpotOrdersResponse { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryAccountAddressSpotOrdersResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressSpotOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedSpotLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryAccountAddressSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedSpotLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedSpotLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressSpotOrdersResponse { + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAccountAddressSpotOrdersResponseAmino): QueryAccountAddressSpotOrdersResponse { + const message = createBaseQueryAccountAddressSpotOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedSpotLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAccountAddressSpotOrdersResponse): QueryAccountAddressSpotOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedSpotLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryAccountAddressSpotOrdersResponseAminoMsg): QueryAccountAddressSpotOrdersResponse { + return QueryAccountAddressSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressSpotOrdersResponseProtoMsg): QueryAccountAddressSpotOrdersResponse { + return QueryAccountAddressSpotOrdersResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressSpotOrdersResponse): Uint8Array { + return QueryAccountAddressSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressSpotOrdersResponse): QueryAccountAddressSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressSpotOrdersResponse", + value: QueryAccountAddressSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressSpotOrdersResponse.typeUrl, QueryAccountAddressSpotOrdersResponse); +function createBaseQuerySpotMidPriceAndTOBRequest(): QuerySpotMidPriceAndTOBRequest { + return { + marketId: "" + }; +} +export const QuerySpotMidPriceAndTOBRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest", + is(o: any): o is QuerySpotMidPriceAndTOBRequest { + return o && (o.$typeUrl === QuerySpotMidPriceAndTOBRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySpotMidPriceAndTOBRequestAmino { + return o && (o.$typeUrl === QuerySpotMidPriceAndTOBRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QuerySpotMidPriceAndTOBRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMidPriceAndTOBRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMidPriceAndTOBRequest { + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySpotMidPriceAndTOBRequestAmino): QuerySpotMidPriceAndTOBRequest { + const message = createBaseQuerySpotMidPriceAndTOBRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySpotMidPriceAndTOBRequest): QuerySpotMidPriceAndTOBRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySpotMidPriceAndTOBRequestAminoMsg): QuerySpotMidPriceAndTOBRequest { + return QuerySpotMidPriceAndTOBRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMidPriceAndTOBRequestProtoMsg): QuerySpotMidPriceAndTOBRequest { + return QuerySpotMidPriceAndTOBRequest.decode(message.value); + }, + toProto(message: QuerySpotMidPriceAndTOBRequest): Uint8Array { + return QuerySpotMidPriceAndTOBRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMidPriceAndTOBRequest): QuerySpotMidPriceAndTOBRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBRequest", + value: QuerySpotMidPriceAndTOBRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMidPriceAndTOBRequest.typeUrl, QuerySpotMidPriceAndTOBRequest); +function createBaseQuerySpotMidPriceAndTOBResponse(): QuerySpotMidPriceAndTOBResponse { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const QuerySpotMidPriceAndTOBResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse", + is(o: any): o is QuerySpotMidPriceAndTOBResponse { + return o && o.$typeUrl === QuerySpotMidPriceAndTOBResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpotMidPriceAndTOBResponseAmino { + return o && o.$typeUrl === QuerySpotMidPriceAndTOBResponse.typeUrl; + }, + encode(message: QuerySpotMidPriceAndTOBResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpotMidPriceAndTOBResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySpotMidPriceAndTOBResponse { + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: QuerySpotMidPriceAndTOBResponseAmino): QuerySpotMidPriceAndTOBResponse { + const message = createBaseQuerySpotMidPriceAndTOBResponse(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: QuerySpotMidPriceAndTOBResponse): QuerySpotMidPriceAndTOBResponseAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: QuerySpotMidPriceAndTOBResponseAminoMsg): QuerySpotMidPriceAndTOBResponse { + return QuerySpotMidPriceAndTOBResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySpotMidPriceAndTOBResponseProtoMsg): QuerySpotMidPriceAndTOBResponse { + return QuerySpotMidPriceAndTOBResponse.decode(message.value); + }, + toProto(message: QuerySpotMidPriceAndTOBResponse): Uint8Array { + return QuerySpotMidPriceAndTOBResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpotMidPriceAndTOBResponse): QuerySpotMidPriceAndTOBResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySpotMidPriceAndTOBResponse", + value: QuerySpotMidPriceAndTOBResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpotMidPriceAndTOBResponse.typeUrl, QuerySpotMidPriceAndTOBResponse); +function createBaseQueryDerivativeMidPriceAndTOBRequest(): QueryDerivativeMidPriceAndTOBRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMidPriceAndTOBRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest", + is(o: any): o is QueryDerivativeMidPriceAndTOBRequest { + return o && (o.$typeUrl === QueryDerivativeMidPriceAndTOBRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMidPriceAndTOBRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMidPriceAndTOBRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMidPriceAndTOBRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMidPriceAndTOBRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMidPriceAndTOBRequest { + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMidPriceAndTOBRequestAmino): QueryDerivativeMidPriceAndTOBRequest { + const message = createBaseQueryDerivativeMidPriceAndTOBRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMidPriceAndTOBRequest): QueryDerivativeMidPriceAndTOBRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMidPriceAndTOBRequestAminoMsg): QueryDerivativeMidPriceAndTOBRequest { + return QueryDerivativeMidPriceAndTOBRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMidPriceAndTOBRequestProtoMsg): QueryDerivativeMidPriceAndTOBRequest { + return QueryDerivativeMidPriceAndTOBRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMidPriceAndTOBRequest): Uint8Array { + return QueryDerivativeMidPriceAndTOBRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMidPriceAndTOBRequest): QueryDerivativeMidPriceAndTOBRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBRequest", + value: QueryDerivativeMidPriceAndTOBRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMidPriceAndTOBRequest.typeUrl, QueryDerivativeMidPriceAndTOBRequest); +function createBaseQueryDerivativeMidPriceAndTOBResponse(): QueryDerivativeMidPriceAndTOBResponse { + return { + midPrice: undefined, + bestBuyPrice: undefined, + bestSellPrice: undefined + }; +} +export const QueryDerivativeMidPriceAndTOBResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse", + is(o: any): o is QueryDerivativeMidPriceAndTOBResponse { + return o && o.$typeUrl === QueryDerivativeMidPriceAndTOBResponse.typeUrl; + }, + isAmino(o: any): o is QueryDerivativeMidPriceAndTOBResponseAmino { + return o && o.$typeUrl === QueryDerivativeMidPriceAndTOBResponse.typeUrl; + }, + encode(message: QueryDerivativeMidPriceAndTOBResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.midPrice !== undefined) { + writer.uint32(10).string(message.midPrice); + } + if (message.bestBuyPrice !== undefined) { + writer.uint32(18).string(message.bestBuyPrice); + } + if (message.bestSellPrice !== undefined) { + writer.uint32(26).string(message.bestSellPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMidPriceAndTOBResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.midPrice = reader.string(); + break; + case 2: + message.bestBuyPrice = reader.string(); + break; + case 3: + message.bestSellPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMidPriceAndTOBResponse { + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + message.midPrice = object.midPrice ?? undefined; + message.bestBuyPrice = object.bestBuyPrice ?? undefined; + message.bestSellPrice = object.bestSellPrice ?? undefined; + return message; + }, + fromAmino(object: QueryDerivativeMidPriceAndTOBResponseAmino): QueryDerivativeMidPriceAndTOBResponse { + const message = createBaseQueryDerivativeMidPriceAndTOBResponse(); + if (object.mid_price !== undefined && object.mid_price !== null) { + message.midPrice = object.mid_price; + } + if (object.best_buy_price !== undefined && object.best_buy_price !== null) { + message.bestBuyPrice = object.best_buy_price; + } + if (object.best_sell_price !== undefined && object.best_sell_price !== null) { + message.bestSellPrice = object.best_sell_price; + } + return message; + }, + toAmino(message: QueryDerivativeMidPriceAndTOBResponse): QueryDerivativeMidPriceAndTOBResponseAmino { + const obj: any = {}; + obj.mid_price = message.midPrice === null ? undefined : message.midPrice; + obj.best_buy_price = message.bestBuyPrice === null ? undefined : message.bestBuyPrice; + obj.best_sell_price = message.bestSellPrice === null ? undefined : message.bestSellPrice; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMidPriceAndTOBResponseAminoMsg): QueryDerivativeMidPriceAndTOBResponse { + return QueryDerivativeMidPriceAndTOBResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMidPriceAndTOBResponseProtoMsg): QueryDerivativeMidPriceAndTOBResponse { + return QueryDerivativeMidPriceAndTOBResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMidPriceAndTOBResponse): Uint8Array { + return QueryDerivativeMidPriceAndTOBResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMidPriceAndTOBResponse): QueryDerivativeMidPriceAndTOBResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMidPriceAndTOBResponse", + value: QueryDerivativeMidPriceAndTOBResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMidPriceAndTOBResponse.typeUrl, QueryDerivativeMidPriceAndTOBResponse); +function createBaseQueryDerivativeOrderbookRequest(): QueryDerivativeOrderbookRequest { + return { + marketId: "", + limit: BigInt(0), + limitCumulativeNotional: undefined + }; +} +export const QueryDerivativeOrderbookRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest", + is(o: any): o is QueryDerivativeOrderbookRequest { + return o && (o.$typeUrl === QueryDerivativeOrderbookRequest.typeUrl || typeof o.marketId === "string" && typeof o.limit === "bigint"); + }, + isAmino(o: any): o is QueryDerivativeOrderbookRequestAmino { + return o && (o.$typeUrl === QueryDerivativeOrderbookRequest.typeUrl || typeof o.market_id === "string" && typeof o.limit === "bigint"); + }, + encode(message: QueryDerivativeOrderbookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(16).uint64(message.limit); + } + if (message.limitCumulativeNotional !== undefined) { + writer.uint32(26).string(message.limitCumulativeNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrderbookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrderbookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.limit = reader.uint64(); + break; + case 3: + message.limitCumulativeNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrderbookRequest { + const message = createBaseQueryDerivativeOrderbookRequest(); + message.marketId = object.marketId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.limitCumulativeNotional = object.limitCumulativeNotional ?? undefined; + return message; + }, + fromAmino(object: QueryDerivativeOrderbookRequestAmino): QueryDerivativeOrderbookRequest { + const message = createBaseQueryDerivativeOrderbookRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.limit_cumulative_notional !== undefined && object.limit_cumulative_notional !== null) { + message.limitCumulativeNotional = object.limit_cumulative_notional; + } + return message; + }, + toAmino(message: QueryDerivativeOrderbookRequest): QueryDerivativeOrderbookRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.limit = message.limit !== BigInt(0) ? message.limit?.toString() : undefined; + obj.limit_cumulative_notional = message.limitCumulativeNotional === null ? undefined : message.limitCumulativeNotional; + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrderbookRequestAminoMsg): QueryDerivativeOrderbookRequest { + return QueryDerivativeOrderbookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrderbookRequestProtoMsg): QueryDerivativeOrderbookRequest { + return QueryDerivativeOrderbookRequest.decode(message.value); + }, + toProto(message: QueryDerivativeOrderbookRequest): Uint8Array { + return QueryDerivativeOrderbookRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrderbookRequest): QueryDerivativeOrderbookRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookRequest", + value: QueryDerivativeOrderbookRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrderbookRequest.typeUrl, QueryDerivativeOrderbookRequest); +function createBaseQueryDerivativeOrderbookResponse(): QueryDerivativeOrderbookResponse { + return { + buysPriceLevel: [], + sellsPriceLevel: [] + }; +} +export const QueryDerivativeOrderbookResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse", + is(o: any): o is QueryDerivativeOrderbookResponse { + return o && (o.$typeUrl === QueryDerivativeOrderbookResponse.typeUrl || Array.isArray(o.buysPriceLevel) && (!o.buysPriceLevel.length || Level.is(o.buysPriceLevel[0])) && Array.isArray(o.sellsPriceLevel) && (!o.sellsPriceLevel.length || Level.is(o.sellsPriceLevel[0]))); + }, + isAmino(o: any): o is QueryDerivativeOrderbookResponseAmino { + return o && (o.$typeUrl === QueryDerivativeOrderbookResponse.typeUrl || Array.isArray(o.buys_price_level) && (!o.buys_price_level.length || Level.isAmino(o.buys_price_level[0])) && Array.isArray(o.sells_price_level) && (!o.sells_price_level.length || Level.isAmino(o.sells_price_level[0]))); + }, + encode(message: QueryDerivativeOrderbookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.buysPriceLevel) { + Level.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.sellsPriceLevel) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrderbookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrderbookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buysPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + case 2: + message.sellsPriceLevel.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrderbookResponse { + const message = createBaseQueryDerivativeOrderbookResponse(); + message.buysPriceLevel = object.buysPriceLevel?.map(e => Level.fromPartial(e)) || []; + message.sellsPriceLevel = object.sellsPriceLevel?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrderbookResponseAmino): QueryDerivativeOrderbookResponse { + const message = createBaseQueryDerivativeOrderbookResponse(); + message.buysPriceLevel = object.buys_price_level?.map(e => Level.fromAmino(e)) || []; + message.sellsPriceLevel = object.sells_price_level?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeOrderbookResponse): QueryDerivativeOrderbookResponseAmino { + const obj: any = {}; + if (message.buysPriceLevel) { + obj.buys_price_level = message.buysPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buys_price_level = message.buysPriceLevel; + } + if (message.sellsPriceLevel) { + obj.sells_price_level = message.sellsPriceLevel.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sells_price_level = message.sellsPriceLevel; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrderbookResponseAminoMsg): QueryDerivativeOrderbookResponse { + return QueryDerivativeOrderbookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrderbookResponseProtoMsg): QueryDerivativeOrderbookResponse { + return QueryDerivativeOrderbookResponse.decode(message.value); + }, + toProto(message: QueryDerivativeOrderbookResponse): Uint8Array { + return QueryDerivativeOrderbookResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrderbookResponse): QueryDerivativeOrderbookResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrderbookResponse", + value: QueryDerivativeOrderbookResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrderbookResponse.typeUrl, QueryDerivativeOrderbookResponse); +function createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return { + marketId: "", + subaccountId: "", + baseAmount: "", + quoteAmount: "", + strategy: 0, + referencePrice: undefined + }; +} +export const QueryTraderSpotOrdersToCancelUpToAmountRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest", + is(o: any): o is QueryTraderSpotOrdersToCancelUpToAmountRequest { + return o && (o.$typeUrl === QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.baseAmount === "string" && typeof o.quoteAmount === "string" && isSet(o.strategy)); + }, + isAmino(o: any): o is QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + return o && (o.$typeUrl === QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.base_amount === "string" && typeof o.quote_amount === "string" && isSet(o.strategy)); + }, + encode(message: QueryTraderSpotOrdersToCancelUpToAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.baseAmount !== "") { + writer.uint32(26).string(message.baseAmount); + } + if (message.quoteAmount !== "") { + writer.uint32(34).string(message.quoteAmount); + } + if (message.strategy !== 0) { + writer.uint32(40).int32(message.strategy); + } + if (message.referencePrice !== undefined) { + writer.uint32(50).string(message.referencePrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.baseAmount = reader.string(); + break; + case 4: + message.quoteAmount = reader.string(); + break; + case 5: + message.strategy = (reader.int32() as any); + break; + case 6: + message.referencePrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.baseAmount = object.baseAmount ?? ""; + message.quoteAmount = object.quoteAmount ?? ""; + message.strategy = object.strategy ?? 0; + message.referencePrice = object.referencePrice ?? undefined; + return message; + }, + fromAmino(object: QueryTraderSpotOrdersToCancelUpToAmountRequestAmino): QueryTraderSpotOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderSpotOrdersToCancelUpToAmountRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.base_amount !== undefined && object.base_amount !== null) { + message.baseAmount = object.base_amount; + } + if (object.quote_amount !== undefined && object.quote_amount !== null) { + message.quoteAmount = object.quote_amount; + } + if (object.strategy !== undefined && object.strategy !== null) { + message.strategy = object.strategy; + } + if (object.reference_price !== undefined && object.reference_price !== null) { + message.referencePrice = object.reference_price; + } + return message; + }, + toAmino(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): QueryTraderSpotOrdersToCancelUpToAmountRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.base_amount = message.baseAmount === "" ? undefined : message.baseAmount; + obj.quote_amount = message.quoteAmount === "" ? undefined : message.quoteAmount; + obj.strategy = message.strategy === 0 ? undefined : message.strategy; + obj.reference_price = message.referencePrice === null ? undefined : message.referencePrice; + return obj; + }, + fromAminoMsg(object: QueryTraderSpotOrdersToCancelUpToAmountRequestAminoMsg): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg): QueryTraderSpotOrdersToCancelUpToAmountRequest { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.decode(message.value); + }, + toProto(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): Uint8Array { + return QueryTraderSpotOrdersToCancelUpToAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderSpotOrdersToCancelUpToAmountRequest): QueryTraderSpotOrdersToCancelUpToAmountRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderSpotOrdersToCancelUpToAmountRequest", + value: QueryTraderSpotOrdersToCancelUpToAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderSpotOrdersToCancelUpToAmountRequest.typeUrl, QueryTraderSpotOrdersToCancelUpToAmountRequest); +function createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return { + marketId: "", + subaccountId: "", + quoteAmount: "", + strategy: 0, + referencePrice: undefined + }; +} +export const QueryTraderDerivativeOrdersToCancelUpToAmountRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest", + is(o: any): o is QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.quoteAmount === "string" && isSet(o.strategy)); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.quote_amount === "string" && isSet(o.strategy)); + }, + encode(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.quoteAmount !== "") { + writer.uint32(26).string(message.quoteAmount); + } + if (message.strategy !== 0) { + writer.uint32(32).int32(message.strategy); + } + if (message.referencePrice !== undefined) { + writer.uint32(42).string(message.referencePrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.quoteAmount = reader.string(); + break; + case 4: + message.strategy = (reader.int32() as any); + break; + case 5: + message.referencePrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.quoteAmount = object.quoteAmount ?? ""; + message.strategy = object.strategy ?? 0; + message.referencePrice = object.referencePrice ?? undefined; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + const message = createBaseQueryTraderDerivativeOrdersToCancelUpToAmountRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.quote_amount !== undefined && object.quote_amount !== null) { + message.quoteAmount = object.quote_amount; + } + if (object.strategy !== undefined && object.strategy !== null) { + message.strategy = object.strategy; + } + if (object.reference_price !== undefined && object.reference_price !== null) { + message.referencePrice = object.reference_price; + } + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): QueryTraderDerivativeOrdersToCancelUpToAmountRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.quote_amount = message.quoteAmount === "" ? undefined : message.quoteAmount; + obj.strategy = message.strategy === 0 ? undefined : message.strategy; + obj.reference_price = message.referencePrice === null ? undefined : message.referencePrice; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersToCancelUpToAmountRequestAminoMsg): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg): QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): Uint8Array { + return QueryTraderDerivativeOrdersToCancelUpToAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersToCancelUpToAmountRequest): QueryTraderDerivativeOrdersToCancelUpToAmountRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersToCancelUpToAmountRequest", + value: QueryTraderDerivativeOrdersToCancelUpToAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersToCancelUpToAmountRequest.typeUrl, QueryTraderDerivativeOrdersToCancelUpToAmountRequest); +function createBaseQueryTraderDerivativeOrdersRequest(): QueryTraderDerivativeOrdersRequest { + return { + marketId: "", + subaccountId: "" + }; +} +export const QueryTraderDerivativeOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest", + is(o: any): o is QueryTraderDerivativeOrdersRequest { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryTraderDerivativeOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersRequest { + const message = createBaseQueryTraderDerivativeOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersRequestAmino): QueryTraderDerivativeOrdersRequest { + const message = createBaseQueryTraderDerivativeOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersRequest): QueryTraderDerivativeOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersRequestAminoMsg): QueryTraderDerivativeOrdersRequest { + return QueryTraderDerivativeOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersRequestProtoMsg): QueryTraderDerivativeOrdersRequest { + return QueryTraderDerivativeOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersRequest): Uint8Array { + return QueryTraderDerivativeOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersRequest): QueryTraderDerivativeOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersRequest", + value: QueryTraderDerivativeOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersRequest.typeUrl, QueryTraderDerivativeOrdersRequest); +function createBaseQueryAccountAddressDerivativeOrdersRequest(): QueryAccountAddressDerivativeOrdersRequest { + return { + marketId: "", + accountAddress: "" + }; +} +export const QueryAccountAddressDerivativeOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest", + is(o: any): o is QueryAccountAddressDerivativeOrdersRequest { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersRequest.typeUrl || typeof o.marketId === "string" && typeof o.accountAddress === "string"); + }, + isAmino(o: any): o is QueryAccountAddressDerivativeOrdersRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersRequest.typeUrl || typeof o.market_id === "string" && typeof o.account_address === "string"); + }, + encode(message: QueryAccountAddressDerivativeOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.accountAddress !== "") { + writer.uint32(18).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressDerivativeOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressDerivativeOrdersRequest { + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + message.marketId = object.marketId ?? ""; + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressDerivativeOrdersRequestAmino): QueryAccountAddressDerivativeOrdersRequest { + const message = createBaseQueryAccountAddressDerivativeOrdersRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressDerivativeOrdersRequest): QueryAccountAddressDerivativeOrdersRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressDerivativeOrdersRequestAminoMsg): QueryAccountAddressDerivativeOrdersRequest { + return QueryAccountAddressDerivativeOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressDerivativeOrdersRequestProtoMsg): QueryAccountAddressDerivativeOrdersRequest { + return QueryAccountAddressDerivativeOrdersRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressDerivativeOrdersRequest): Uint8Array { + return QueryAccountAddressDerivativeOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressDerivativeOrdersRequest): QueryAccountAddressDerivativeOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersRequest", + value: QueryAccountAddressDerivativeOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressDerivativeOrdersRequest.typeUrl, QueryAccountAddressDerivativeOrdersRequest); +function createBaseTrimmedDerivativeLimitOrder(): TrimmedDerivativeLimitOrder { + return { + price: "", + quantity: "", + margin: "", + fillable: "", + isBuy: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedDerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder", + is(o: any): o is TrimmedDerivativeLimitOrder { + return o && (o.$typeUrl === TrimmedDerivativeLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedDerivativeLimitOrderAmino { + return o && (o.$typeUrl === TrimmedDerivativeLimitOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.fillable === "string" && typeof o.isBuy === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedDerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.fillable !== "") { + writer.uint32(34).string(message.fillable); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + if (message.orderHash !== "") { + writer.uint32(50).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(58).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedDerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.fillable = reader.string(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.orderHash = reader.string(); + break; + case 7: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedDerivativeLimitOrder { + const message = createBaseTrimmedDerivativeLimitOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.margin = object.margin ?? ""; + message.fillable = object.fillable ?? ""; + message.isBuy = object.isBuy ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedDerivativeLimitOrderAmino): TrimmedDerivativeLimitOrder { + const message = createBaseTrimmedDerivativeLimitOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.fillable !== undefined && object.fillable !== null) { + message.fillable = object.fillable; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedDerivativeLimitOrder): TrimmedDerivativeLimitOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.fillable = message.fillable === "" ? undefined : message.fillable; + obj.isBuy = message.isBuy ?? false; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedDerivativeLimitOrderAminoMsg): TrimmedDerivativeLimitOrder { + return TrimmedDerivativeLimitOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedDerivativeLimitOrderProtoMsg): TrimmedDerivativeLimitOrder { + return TrimmedDerivativeLimitOrder.decode(message.value); + }, + toProto(message: TrimmedDerivativeLimitOrder): Uint8Array { + return TrimmedDerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedDerivativeLimitOrder): TrimmedDerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeLimitOrder", + value: TrimmedDerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedDerivativeLimitOrder.typeUrl, TrimmedDerivativeLimitOrder); +function createBaseQueryTraderDerivativeOrdersResponse(): QueryTraderDerivativeOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse", + is(o: any): o is QueryTraderDerivativeOrdersResponse { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeOrdersResponse { + const message = createBaseQueryTraderDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderDerivativeOrdersResponseAmino): QueryTraderDerivativeOrdersResponse { + const message = createBaseQueryTraderDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderDerivativeOrdersResponse): QueryTraderDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeOrdersResponseAminoMsg): QueryTraderDerivativeOrdersResponse { + return QueryTraderDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeOrdersResponseProtoMsg): QueryTraderDerivativeOrdersResponse { + return QueryTraderDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderDerivativeOrdersResponse): Uint8Array { + return QueryTraderDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeOrdersResponse): QueryTraderDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeOrdersResponse", + value: QueryTraderDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeOrdersResponse.typeUrl, QueryTraderDerivativeOrdersResponse); +function createBaseQueryAccountAddressDerivativeOrdersResponse(): QueryAccountAddressDerivativeOrdersResponse { + return { + orders: [] + }; +} +export const QueryAccountAddressDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse", + is(o: any): o is QueryAccountAddressDerivativeOrdersResponse { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryAccountAddressDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressDerivativeOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryAccountAddressDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAccountAddressDerivativeOrdersResponse { + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAccountAddressDerivativeOrdersResponseAmino): QueryAccountAddressDerivativeOrdersResponse { + const message = createBaseQueryAccountAddressDerivativeOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAccountAddressDerivativeOrdersResponse): QueryAccountAddressDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryAccountAddressDerivativeOrdersResponseAminoMsg): QueryAccountAddressDerivativeOrdersResponse { + return QueryAccountAddressDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountAddressDerivativeOrdersResponseProtoMsg): QueryAccountAddressDerivativeOrdersResponse { + return QueryAccountAddressDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressDerivativeOrdersResponse): Uint8Array { + return QueryAccountAddressDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressDerivativeOrdersResponse): QueryAccountAddressDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryAccountAddressDerivativeOrdersResponse", + value: QueryAccountAddressDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressDerivativeOrdersResponse.typeUrl, QueryAccountAddressDerivativeOrdersResponse); +function createBaseQueryDerivativeOrdersByHashesRequest(): QueryDerivativeOrdersByHashesRequest { + return { + marketId: "", + subaccountId: "", + orderHashes: [] + }; +} +export const QueryDerivativeOrdersByHashesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest", + is(o: any): o is QueryDerivativeOrdersByHashesRequest { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesRequest.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string")); + }, + isAmino(o: any): o is QueryDerivativeOrdersByHashesRequestAmino { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesRequest.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string")); + }, + encode(message: QueryDerivativeOrdersByHashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.orderHashes) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrdersByHashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHashes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrdersByHashesRequest { + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHashes = object.orderHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrdersByHashesRequestAmino): QueryDerivativeOrdersByHashesRequest { + const message = createBaseQueryDerivativeOrdersByHashesRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.orderHashes = object.order_hashes?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDerivativeOrdersByHashesRequest): QueryDerivativeOrdersByHashesRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrdersByHashesRequestAminoMsg): QueryDerivativeOrdersByHashesRequest { + return QueryDerivativeOrdersByHashesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrdersByHashesRequestProtoMsg): QueryDerivativeOrdersByHashesRequest { + return QueryDerivativeOrdersByHashesRequest.decode(message.value); + }, + toProto(message: QueryDerivativeOrdersByHashesRequest): Uint8Array { + return QueryDerivativeOrdersByHashesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrdersByHashesRequest): QueryDerivativeOrdersByHashesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesRequest", + value: QueryDerivativeOrdersByHashesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrdersByHashesRequest.typeUrl, QueryDerivativeOrdersByHashesRequest); +function createBaseQueryDerivativeOrdersByHashesResponse(): QueryDerivativeOrdersByHashesResponse { + return { + orders: [] + }; +} +export const QueryDerivativeOrdersByHashesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse", + is(o: any): o is QueryDerivativeOrdersByHashesResponse { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryDerivativeOrdersByHashesResponseAmino { + return o && (o.$typeUrl === QueryDerivativeOrdersByHashesResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeLimitOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryDerivativeOrdersByHashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeLimitOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeOrdersByHashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeLimitOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeOrdersByHashesResponse { + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeOrdersByHashesResponseAmino): QueryDerivativeOrdersByHashesResponse { + const message = createBaseQueryDerivativeOrdersByHashesResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeLimitOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeOrdersByHashesResponse): QueryDerivativeOrdersByHashesResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeLimitOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeOrdersByHashesResponseAminoMsg): QueryDerivativeOrdersByHashesResponse { + return QueryDerivativeOrdersByHashesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeOrdersByHashesResponseProtoMsg): QueryDerivativeOrdersByHashesResponse { + return QueryDerivativeOrdersByHashesResponse.decode(message.value); + }, + toProto(message: QueryDerivativeOrdersByHashesResponse): Uint8Array { + return QueryDerivativeOrdersByHashesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeOrdersByHashesResponse): QueryDerivativeOrdersByHashesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeOrdersByHashesResponse", + value: QueryDerivativeOrdersByHashesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeOrdersByHashesResponse.typeUrl, QueryDerivativeOrdersByHashesResponse); +function createBaseQueryDerivativeMarketsRequest(): QueryDerivativeMarketsRequest { + return { + status: "", + marketIds: [], + withMidPriceAndTob: false + }; +} +export const QueryDerivativeMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest", + is(o: any): o is QueryDerivativeMarketsRequest { + return o && (o.$typeUrl === QueryDerivativeMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string") && typeof o.withMidPriceAndTob === "boolean"); + }, + isAmino(o: any): o is QueryDerivativeMarketsRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketsRequest.typeUrl || typeof o.status === "string" && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string") && typeof o.with_mid_price_and_tob === "boolean"); + }, + encode(message: QueryDerivativeMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + if (message.withMidPriceAndTob === true) { + writer.uint32(24).bool(message.withMidPriceAndTob); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.marketIds.push(reader.string()); + break; + case 3: + message.withMidPriceAndTob = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketsRequest { + const message = createBaseQueryDerivativeMarketsRequest(); + message.status = object.status ?? ""; + message.marketIds = object.marketIds?.map(e => e) || []; + message.withMidPriceAndTob = object.withMidPriceAndTob ?? false; + return message; + }, + fromAmino(object: QueryDerivativeMarketsRequestAmino): QueryDerivativeMarketsRequest { + const message = createBaseQueryDerivativeMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + message.marketIds = object.market_ids?.map(e => e) || []; + if (object.with_mid_price_and_tob !== undefined && object.with_mid_price_and_tob !== null) { + message.withMidPriceAndTob = object.with_mid_price_and_tob; + } + return message; + }, + toAmino(message: QueryDerivativeMarketsRequest): QueryDerivativeMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + obj.with_mid_price_and_tob = message.withMidPriceAndTob === false ? undefined : message.withMidPriceAndTob; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketsRequestAminoMsg): QueryDerivativeMarketsRequest { + return QueryDerivativeMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketsRequestProtoMsg): QueryDerivativeMarketsRequest { + return QueryDerivativeMarketsRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketsRequest): Uint8Array { + return QueryDerivativeMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketsRequest): QueryDerivativeMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsRequest", + value: QueryDerivativeMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketsRequest.typeUrl, QueryDerivativeMarketsRequest); +function createBasePriceLevel(): PriceLevel { + return { + price: "", + quantity: "" + }; +} +export const PriceLevel = { + typeUrl: "/injective.exchange.v1beta1.PriceLevel", + is(o: any): o is PriceLevel { + return o && (o.$typeUrl === PriceLevel.typeUrl || typeof o.price === "string" && typeof o.quantity === "string"); + }, + isAmino(o: any): o is PriceLevelAmino { + return o && (o.$typeUrl === PriceLevel.typeUrl || typeof o.price === "string" && typeof o.quantity === "string"); + }, + encode(message: PriceLevel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceLevel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceLevel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceLevel { + const message = createBasePriceLevel(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + return message; + }, + fromAmino(object: PriceLevelAmino): PriceLevel { + const message = createBasePriceLevel(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + return message; + }, + toAmino(message: PriceLevel): PriceLevelAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + return obj; + }, + fromAminoMsg(object: PriceLevelAminoMsg): PriceLevel { + return PriceLevel.fromAmino(object.value); + }, + fromProtoMsg(message: PriceLevelProtoMsg): PriceLevel { + return PriceLevel.decode(message.value); + }, + toProto(message: PriceLevel): Uint8Array { + return PriceLevel.encode(message).finish(); + }, + toProtoMsg(message: PriceLevel): PriceLevelProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PriceLevel", + value: PriceLevel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceLevel.typeUrl, PriceLevel); +function createBasePerpetualMarketState(): PerpetualMarketState { + return { + marketInfo: undefined, + fundingInfo: undefined + }; +} +export const PerpetualMarketState = { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState", + is(o: any): o is PerpetualMarketState { + return o && o.$typeUrl === PerpetualMarketState.typeUrl; + }, + isAmino(o: any): o is PerpetualMarketStateAmino { + return o && o.$typeUrl === PerpetualMarketState.typeUrl; + }, + encode(message: PerpetualMarketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketInfo !== undefined) { + PerpetualMarketInfo.encode(message.marketInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.fundingInfo !== undefined) { + PerpetualMarketFunding.encode(message.fundingInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketInfo = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + case 2: + message.fundingInfo = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PerpetualMarketState { + const message = createBasePerpetualMarketState(); + message.marketInfo = object.marketInfo !== undefined && object.marketInfo !== null ? PerpetualMarketInfo.fromPartial(object.marketInfo) : undefined; + message.fundingInfo = object.fundingInfo !== undefined && object.fundingInfo !== null ? PerpetualMarketFunding.fromPartial(object.fundingInfo) : undefined; + return message; + }, + fromAmino(object: PerpetualMarketStateAmino): PerpetualMarketState { + const message = createBasePerpetualMarketState(); + if (object.market_info !== undefined && object.market_info !== null) { + message.marketInfo = PerpetualMarketInfo.fromAmino(object.market_info); + } + if (object.funding_info !== undefined && object.funding_info !== null) { + message.fundingInfo = PerpetualMarketFunding.fromAmino(object.funding_info); + } + return message; + }, + toAmino(message: PerpetualMarketState): PerpetualMarketStateAmino { + const obj: any = {}; + obj.market_info = message.marketInfo ? PerpetualMarketInfo.toAmino(message.marketInfo) : undefined; + obj.funding_info = message.fundingInfo ? PerpetualMarketFunding.toAmino(message.fundingInfo) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualMarketStateAminoMsg): PerpetualMarketState { + return PerpetualMarketState.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketStateProtoMsg): PerpetualMarketState { + return PerpetualMarketState.decode(message.value); + }, + toProto(message: PerpetualMarketState): Uint8Array { + return PerpetualMarketState.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketState): PerpetualMarketStateProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.PerpetualMarketState", + value: PerpetualMarketState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PerpetualMarketState.typeUrl, PerpetualMarketState); +function createBaseFullDerivativeMarket(): FullDerivativeMarket { + return { + market: undefined, + perpetualInfo: undefined, + futuresInfo: undefined, + markPrice: "", + midPriceAndTob: undefined + }; +} +export const FullDerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket", + is(o: any): o is FullDerivativeMarket { + return o && (o.$typeUrl === FullDerivativeMarket.typeUrl || typeof o.markPrice === "string"); + }, + isAmino(o: any): o is FullDerivativeMarketAmino { + return o && (o.$typeUrl === FullDerivativeMarket.typeUrl || typeof o.mark_price === "string"); + }, + encode(message: FullDerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + DerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualInfo !== undefined) { + PerpetualMarketState.encode(message.perpetualInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.futuresInfo !== undefined) { + ExpiryFuturesMarketInfo.encode(message.futuresInfo, writer.uint32(26).fork()).ldelim(); + } + if (message.markPrice !== "") { + writer.uint32(34).string(message.markPrice); + } + if (message.midPriceAndTob !== undefined) { + MidPriceAndTOB.encode(message.midPriceAndTob, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FullDerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFullDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = DerivativeMarket.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualInfo = PerpetualMarketState.decode(reader, reader.uint32()); + break; + case 3: + message.futuresInfo = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + case 4: + message.markPrice = reader.string(); + break; + case 5: + message.midPriceAndTob = MidPriceAndTOB.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FullDerivativeMarket { + const message = createBaseFullDerivativeMarket(); + message.market = object.market !== undefined && object.market !== null ? DerivativeMarket.fromPartial(object.market) : undefined; + message.perpetualInfo = object.perpetualInfo !== undefined && object.perpetualInfo !== null ? PerpetualMarketState.fromPartial(object.perpetualInfo) : undefined; + message.futuresInfo = object.futuresInfo !== undefined && object.futuresInfo !== null ? ExpiryFuturesMarketInfo.fromPartial(object.futuresInfo) : undefined; + message.markPrice = object.markPrice ?? ""; + message.midPriceAndTob = object.midPriceAndTob !== undefined && object.midPriceAndTob !== null ? MidPriceAndTOB.fromPartial(object.midPriceAndTob) : undefined; + return message; + }, + fromAmino(object: FullDerivativeMarketAmino): FullDerivativeMarket { + const message = createBaseFullDerivativeMarket(); + if (object.market !== undefined && object.market !== null) { + message.market = DerivativeMarket.fromAmino(object.market); + } + if (object.perpetual_info !== undefined && object.perpetual_info !== null) { + message.perpetualInfo = PerpetualMarketState.fromAmino(object.perpetual_info); + } + if (object.futures_info !== undefined && object.futures_info !== null) { + message.futuresInfo = ExpiryFuturesMarketInfo.fromAmino(object.futures_info); + } + if (object.mark_price !== undefined && object.mark_price !== null) { + message.markPrice = object.mark_price; + } + if (object.mid_price_and_tob !== undefined && object.mid_price_and_tob !== null) { + message.midPriceAndTob = MidPriceAndTOB.fromAmino(object.mid_price_and_tob); + } + return message; + }, + toAmino(message: FullDerivativeMarket): FullDerivativeMarketAmino { + const obj: any = {}; + obj.market = message.market ? DerivativeMarket.toAmino(message.market) : undefined; + obj.perpetual_info = message.perpetualInfo ? PerpetualMarketState.toAmino(message.perpetualInfo) : undefined; + obj.futures_info = message.futuresInfo ? ExpiryFuturesMarketInfo.toAmino(message.futuresInfo) : undefined; + obj.mark_price = message.markPrice === "" ? undefined : message.markPrice; + obj.mid_price_and_tob = message.midPriceAndTob ? MidPriceAndTOB.toAmino(message.midPriceAndTob) : undefined; + return obj; + }, + fromAminoMsg(object: FullDerivativeMarketAminoMsg): FullDerivativeMarket { + return FullDerivativeMarket.fromAmino(object.value); + }, + fromProtoMsg(message: FullDerivativeMarketProtoMsg): FullDerivativeMarket { + return FullDerivativeMarket.decode(message.value); + }, + toProto(message: FullDerivativeMarket): Uint8Array { + return FullDerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: FullDerivativeMarket): FullDerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.FullDerivativeMarket", + value: FullDerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FullDerivativeMarket.typeUrl, FullDerivativeMarket); +function createBaseQueryDerivativeMarketsResponse(): QueryDerivativeMarketsResponse { + return { + markets: [] + }; +} +export const QueryDerivativeMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse", + is(o: any): o is QueryDerivativeMarketsResponse { + return o && (o.$typeUrl === QueryDerivativeMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullDerivativeMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryDerivativeMarketsResponseAmino { + return o && (o.$typeUrl === QueryDerivativeMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || FullDerivativeMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryDerivativeMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + FullDerivativeMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(FullDerivativeMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketsResponse { + const message = createBaseQueryDerivativeMarketsResponse(); + message.markets = object.markets?.map(e => FullDerivativeMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDerivativeMarketsResponseAmino): QueryDerivativeMarketsResponse { + const message = createBaseQueryDerivativeMarketsResponse(); + message.markets = object.markets?.map(e => FullDerivativeMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDerivativeMarketsResponse): QueryDerivativeMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? FullDerivativeMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketsResponseAminoMsg): QueryDerivativeMarketsResponse { + return QueryDerivativeMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketsResponseProtoMsg): QueryDerivativeMarketsResponse { + return QueryDerivativeMarketsResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketsResponse): Uint8Array { + return QueryDerivativeMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketsResponse): QueryDerivativeMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketsResponse", + value: QueryDerivativeMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketsResponse.typeUrl, QueryDerivativeMarketsResponse); +function createBaseQueryDerivativeMarketRequest(): QueryDerivativeMarketRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest", + is(o: any): o is QueryDerivativeMarketRequest { + return o && (o.$typeUrl === QueryDerivativeMarketRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketRequest { + const message = createBaseQueryDerivativeMarketRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketRequestAmino): QueryDerivativeMarketRequest { + const message = createBaseQueryDerivativeMarketRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketRequest): QueryDerivativeMarketRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketRequestAminoMsg): QueryDerivativeMarketRequest { + return QueryDerivativeMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketRequestProtoMsg): QueryDerivativeMarketRequest { + return QueryDerivativeMarketRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketRequest): Uint8Array { + return QueryDerivativeMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketRequest): QueryDerivativeMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketRequest", + value: QueryDerivativeMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketRequest.typeUrl, QueryDerivativeMarketRequest); +function createBaseQueryDerivativeMarketResponse(): QueryDerivativeMarketResponse { + return { + market: undefined + }; +} +export const QueryDerivativeMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse", + is(o: any): o is QueryDerivativeMarketResponse { + return o && o.$typeUrl === QueryDerivativeMarketResponse.typeUrl; + }, + isAmino(o: any): o is QueryDerivativeMarketResponseAmino { + return o && o.$typeUrl === QueryDerivativeMarketResponse.typeUrl; + }, + encode(message: QueryDerivativeMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + FullDerivativeMarket.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = FullDerivativeMarket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketResponse { + const message = createBaseQueryDerivativeMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? FullDerivativeMarket.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: QueryDerivativeMarketResponseAmino): QueryDerivativeMarketResponse { + const message = createBaseQueryDerivativeMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = FullDerivativeMarket.fromAmino(object.market); + } + return message; + }, + toAmino(message: QueryDerivativeMarketResponse): QueryDerivativeMarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? FullDerivativeMarket.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketResponseAminoMsg): QueryDerivativeMarketResponse { + return QueryDerivativeMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketResponseProtoMsg): QueryDerivativeMarketResponse { + return QueryDerivativeMarketResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketResponse): Uint8Array { + return QueryDerivativeMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketResponse): QueryDerivativeMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketResponse", + value: QueryDerivativeMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketResponse.typeUrl, QueryDerivativeMarketResponse); +function createBaseQueryDerivativeMarketAddressRequest(): QueryDerivativeMarketAddressRequest { + return { + marketId: "" + }; +} +export const QueryDerivativeMarketAddressRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest", + is(o: any): o is QueryDerivativeMarketAddressRequest { + return o && (o.$typeUrl === QueryDerivativeMarketAddressRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketAddressRequestAmino { + return o && (o.$typeUrl === QueryDerivativeMarketAddressRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryDerivativeMarketAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketAddressRequest { + const message = createBaseQueryDerivativeMarketAddressRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketAddressRequestAmino): QueryDerivativeMarketAddressRequest { + const message = createBaseQueryDerivativeMarketAddressRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketAddressRequest): QueryDerivativeMarketAddressRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketAddressRequestAminoMsg): QueryDerivativeMarketAddressRequest { + return QueryDerivativeMarketAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketAddressRequestProtoMsg): QueryDerivativeMarketAddressRequest { + return QueryDerivativeMarketAddressRequest.decode(message.value); + }, + toProto(message: QueryDerivativeMarketAddressRequest): Uint8Array { + return QueryDerivativeMarketAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketAddressRequest): QueryDerivativeMarketAddressRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressRequest", + value: QueryDerivativeMarketAddressRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketAddressRequest.typeUrl, QueryDerivativeMarketAddressRequest); +function createBaseQueryDerivativeMarketAddressResponse(): QueryDerivativeMarketAddressResponse { + return { + address: "", + subaccountId: "" + }; +} +export const QueryDerivativeMarketAddressResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse", + is(o: any): o is QueryDerivativeMarketAddressResponse { + return o && (o.$typeUrl === QueryDerivativeMarketAddressResponse.typeUrl || typeof o.address === "string" && typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QueryDerivativeMarketAddressResponseAmino { + return o && (o.$typeUrl === QueryDerivativeMarketAddressResponse.typeUrl || typeof o.address === "string" && typeof o.subaccount_id === "string"); + }, + encode(message: QueryDerivativeMarketAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDerivativeMarketAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDerivativeMarketAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDerivativeMarketAddressResponse { + const message = createBaseQueryDerivativeMarketAddressResponse(); + message.address = object.address ?? ""; + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QueryDerivativeMarketAddressResponseAmino): QueryDerivativeMarketAddressResponse { + const message = createBaseQueryDerivativeMarketAddressResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QueryDerivativeMarketAddressResponse): QueryDerivativeMarketAddressResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QueryDerivativeMarketAddressResponseAminoMsg): QueryDerivativeMarketAddressResponse { + return QueryDerivativeMarketAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDerivativeMarketAddressResponseProtoMsg): QueryDerivativeMarketAddressResponse { + return QueryDerivativeMarketAddressResponse.decode(message.value); + }, + toProto(message: QueryDerivativeMarketAddressResponse): Uint8Array { + return QueryDerivativeMarketAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDerivativeMarketAddressResponse): QueryDerivativeMarketAddressResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryDerivativeMarketAddressResponse", + value: QueryDerivativeMarketAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDerivativeMarketAddressResponse.typeUrl, QueryDerivativeMarketAddressResponse); +function createBaseQuerySubaccountTradeNonceRequest(): QuerySubaccountTradeNonceRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountTradeNonceRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest", + is(o: any): o is QuerySubaccountTradeNonceRequest { + return o && (o.$typeUrl === QuerySubaccountTradeNonceRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountTradeNonceRequestAmino { + return o && (o.$typeUrl === QuerySubaccountTradeNonceRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountTradeNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountTradeNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountTradeNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountTradeNonceRequest { + const message = createBaseQuerySubaccountTradeNonceRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountTradeNonceRequestAmino): QuerySubaccountTradeNonceRequest { + const message = createBaseQuerySubaccountTradeNonceRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountTradeNonceRequest): QuerySubaccountTradeNonceRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountTradeNonceRequestAminoMsg): QuerySubaccountTradeNonceRequest { + return QuerySubaccountTradeNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountTradeNonceRequestProtoMsg): QuerySubaccountTradeNonceRequest { + return QuerySubaccountTradeNonceRequest.decode(message.value); + }, + toProto(message: QuerySubaccountTradeNonceRequest): Uint8Array { + return QuerySubaccountTradeNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountTradeNonceRequest): QuerySubaccountTradeNonceRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceRequest", + value: QuerySubaccountTradeNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountTradeNonceRequest.typeUrl, QuerySubaccountTradeNonceRequest); +function createBaseQuerySubaccountPositionsRequest(): QuerySubaccountPositionsRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountPositionsRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest", + is(o: any): o is QuerySubaccountPositionsRequest { + return o && (o.$typeUrl === QuerySubaccountPositionsRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountPositionsRequestAmino { + return o && (o.$typeUrl === QuerySubaccountPositionsRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionsRequest { + const message = createBaseQuerySubaccountPositionsRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountPositionsRequestAmino): QuerySubaccountPositionsRequest { + const message = createBaseQuerySubaccountPositionsRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountPositionsRequest): QuerySubaccountPositionsRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionsRequestAminoMsg): QuerySubaccountPositionsRequest { + return QuerySubaccountPositionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionsRequestProtoMsg): QuerySubaccountPositionsRequest { + return QuerySubaccountPositionsRequest.decode(message.value); + }, + toProto(message: QuerySubaccountPositionsRequest): Uint8Array { + return QuerySubaccountPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionsRequest): QuerySubaccountPositionsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsRequest", + value: QuerySubaccountPositionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionsRequest.typeUrl, QuerySubaccountPositionsRequest); +function createBaseQuerySubaccountPositionInMarketRequest(): QuerySubaccountPositionInMarketRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountPositionInMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest", + is(o: any): o is QuerySubaccountPositionInMarketRequest { + return o && (o.$typeUrl === QuerySubaccountPositionInMarketRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountPositionInMarketRequestAmino { + return o && (o.$typeUrl === QuerySubaccountPositionInMarketRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountPositionInMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionInMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionInMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionInMarketRequest { + const message = createBaseQuerySubaccountPositionInMarketRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountPositionInMarketRequestAmino): QuerySubaccountPositionInMarketRequest { + const message = createBaseQuerySubaccountPositionInMarketRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountPositionInMarketRequest): QuerySubaccountPositionInMarketRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionInMarketRequestAminoMsg): QuerySubaccountPositionInMarketRequest { + return QuerySubaccountPositionInMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionInMarketRequestProtoMsg): QuerySubaccountPositionInMarketRequest { + return QuerySubaccountPositionInMarketRequest.decode(message.value); + }, + toProto(message: QuerySubaccountPositionInMarketRequest): Uint8Array { + return QuerySubaccountPositionInMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionInMarketRequest): QuerySubaccountPositionInMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketRequest", + value: QuerySubaccountPositionInMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionInMarketRequest.typeUrl, QuerySubaccountPositionInMarketRequest); +function createBaseQuerySubaccountEffectivePositionInMarketRequest(): QuerySubaccountEffectivePositionInMarketRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QuerySubaccountEffectivePositionInMarketRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest", + is(o: any): o is QuerySubaccountEffectivePositionInMarketRequest { + return o && (o.$typeUrl === QuerySubaccountEffectivePositionInMarketRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QuerySubaccountEffectivePositionInMarketRequestAmino { + return o && (o.$typeUrl === QuerySubaccountEffectivePositionInMarketRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QuerySubaccountEffectivePositionInMarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountEffectivePositionInMarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountEffectivePositionInMarketRequest { + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountEffectivePositionInMarketRequestAmino): QuerySubaccountEffectivePositionInMarketRequest { + const message = createBaseQuerySubaccountEffectivePositionInMarketRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QuerySubaccountEffectivePositionInMarketRequest): QuerySubaccountEffectivePositionInMarketRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountEffectivePositionInMarketRequestAminoMsg): QuerySubaccountEffectivePositionInMarketRequest { + return QuerySubaccountEffectivePositionInMarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountEffectivePositionInMarketRequestProtoMsg): QuerySubaccountEffectivePositionInMarketRequest { + return QuerySubaccountEffectivePositionInMarketRequest.decode(message.value); + }, + toProto(message: QuerySubaccountEffectivePositionInMarketRequest): Uint8Array { + return QuerySubaccountEffectivePositionInMarketRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountEffectivePositionInMarketRequest): QuerySubaccountEffectivePositionInMarketRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketRequest", + value: QuerySubaccountEffectivePositionInMarketRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountEffectivePositionInMarketRequest.typeUrl, QuerySubaccountEffectivePositionInMarketRequest); +function createBaseQuerySubaccountOrderMetadataRequest(): QuerySubaccountOrderMetadataRequest { + return { + subaccountId: "" + }; +} +export const QuerySubaccountOrderMetadataRequest = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest", + is(o: any): o is QuerySubaccountOrderMetadataRequest { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataRequest.typeUrl || typeof o.subaccountId === "string"); + }, + isAmino(o: any): o is QuerySubaccountOrderMetadataRequestAmino { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataRequest.typeUrl || typeof o.subaccount_id === "string"); + }, + encode(message: QuerySubaccountOrderMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrderMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrderMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrderMetadataRequest { + const message = createBaseQuerySubaccountOrderMetadataRequest(); + message.subaccountId = object.subaccountId ?? ""; + return message; + }, + fromAmino(object: QuerySubaccountOrderMetadataRequestAmino): QuerySubaccountOrderMetadataRequest { + const message = createBaseQuerySubaccountOrderMetadataRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + return message; + }, + toAmino(message: QuerySubaccountOrderMetadataRequest): QuerySubaccountOrderMetadataRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrderMetadataRequestAminoMsg): QuerySubaccountOrderMetadataRequest { + return QuerySubaccountOrderMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrderMetadataRequestProtoMsg): QuerySubaccountOrderMetadataRequest { + return QuerySubaccountOrderMetadataRequest.decode(message.value); + }, + toProto(message: QuerySubaccountOrderMetadataRequest): Uint8Array { + return QuerySubaccountOrderMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrderMetadataRequest): QuerySubaccountOrderMetadataRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataRequest", + value: QuerySubaccountOrderMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrderMetadataRequest.typeUrl, QuerySubaccountOrderMetadataRequest); +function createBaseQuerySubaccountPositionsResponse(): QuerySubaccountPositionsResponse { + return { + state: [] + }; +} +export const QuerySubaccountPositionsResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse", + is(o: any): o is QuerySubaccountPositionsResponse { + return o && (o.$typeUrl === QuerySubaccountPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.is(o.state[0]))); + }, + isAmino(o: any): o is QuerySubaccountPositionsResponseAmino { + return o && (o.$typeUrl === QuerySubaccountPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.isAmino(o.state[0]))); + }, + encode(message: QuerySubaccountPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.state) { + DerivativePosition.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state.push(DerivativePosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionsResponse { + const message = createBaseQuerySubaccountPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountPositionsResponseAmino): QuerySubaccountPositionsResponse { + const message = createBaseQuerySubaccountPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountPositionsResponse): QuerySubaccountPositionsResponseAmino { + const obj: any = {}; + if (message.state) { + obj.state = message.state.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.state = message.state; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionsResponseAminoMsg): QuerySubaccountPositionsResponse { + return QuerySubaccountPositionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionsResponseProtoMsg): QuerySubaccountPositionsResponse { + return QuerySubaccountPositionsResponse.decode(message.value); + }, + toProto(message: QuerySubaccountPositionsResponse): Uint8Array { + return QuerySubaccountPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionsResponse): QuerySubaccountPositionsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionsResponse", + value: QuerySubaccountPositionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionsResponse.typeUrl, QuerySubaccountPositionsResponse); +function createBaseQuerySubaccountPositionInMarketResponse(): QuerySubaccountPositionInMarketResponse { + return { + state: undefined + }; +} +export const QuerySubaccountPositionInMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse", + is(o: any): o is QuerySubaccountPositionInMarketResponse { + return o && o.$typeUrl === QuerySubaccountPositionInMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountPositionInMarketResponseAmino { + return o && o.$typeUrl === QuerySubaccountPositionInMarketResponse.typeUrl; + }, + encode(message: QuerySubaccountPositionInMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + Position.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountPositionInMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountPositionInMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountPositionInMarketResponse { + const message = createBaseQuerySubaccountPositionInMarketResponse(); + message.state = object.state !== undefined && object.state !== null ? Position.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountPositionInMarketResponseAmino): QuerySubaccountPositionInMarketResponse { + const message = createBaseQuerySubaccountPositionInMarketResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = Position.fromAmino(object.state); + } + return message; + }, + toAmino(message: QuerySubaccountPositionInMarketResponse): QuerySubaccountPositionInMarketResponseAmino { + const obj: any = {}; + obj.state = message.state ? Position.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountPositionInMarketResponseAminoMsg): QuerySubaccountPositionInMarketResponse { + return QuerySubaccountPositionInMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountPositionInMarketResponseProtoMsg): QuerySubaccountPositionInMarketResponse { + return QuerySubaccountPositionInMarketResponse.decode(message.value); + }, + toProto(message: QuerySubaccountPositionInMarketResponse): Uint8Array { + return QuerySubaccountPositionInMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountPositionInMarketResponse): QuerySubaccountPositionInMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountPositionInMarketResponse", + value: QuerySubaccountPositionInMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountPositionInMarketResponse.typeUrl, QuerySubaccountPositionInMarketResponse); +function createBaseEffectivePosition(): EffectivePosition { + return { + isLong: false, + quantity: "", + entryPrice: "", + effectiveMargin: "" + }; +} +export const EffectivePosition = { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition", + is(o: any): o is EffectivePosition { + return o && (o.$typeUrl === EffectivePosition.typeUrl || typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.effectiveMargin === "string"); + }, + isAmino(o: any): o is EffectivePositionAmino { + return o && (o.$typeUrl === EffectivePosition.typeUrl || typeof o.is_long === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.effective_margin === "string"); + }, + encode(message: EffectivePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isLong === true) { + writer.uint32(8).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(26).string(message.entryPrice); + } + if (message.effectiveMargin !== "") { + writer.uint32(34).string(message.effectiveMargin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EffectivePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEffectivePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isLong = reader.bool(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.entryPrice = reader.string(); + break; + case 4: + message.effectiveMargin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EffectivePosition { + const message = createBaseEffectivePosition(); + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.effectiveMargin = object.effectiveMargin ?? ""; + return message; + }, + fromAmino(object: EffectivePositionAmino): EffectivePosition { + const message = createBaseEffectivePosition(); + if (object.is_long !== undefined && object.is_long !== null) { + message.isLong = object.is_long; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.effective_margin !== undefined && object.effective_margin !== null) { + message.effectiveMargin = object.effective_margin; + } + return message; + }, + toAmino(message: EffectivePosition): EffectivePositionAmino { + const obj: any = {}; + obj.is_long = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.effective_margin = message.effectiveMargin === "" ? undefined : message.effectiveMargin; + return obj; + }, + fromAminoMsg(object: EffectivePositionAminoMsg): EffectivePosition { + return EffectivePosition.fromAmino(object.value); + }, + fromProtoMsg(message: EffectivePositionProtoMsg): EffectivePosition { + return EffectivePosition.decode(message.value); + }, + toProto(message: EffectivePosition): Uint8Array { + return EffectivePosition.encode(message).finish(); + }, + toProtoMsg(message: EffectivePosition): EffectivePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.EffectivePosition", + value: EffectivePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EffectivePosition.typeUrl, EffectivePosition); +function createBaseQuerySubaccountEffectivePositionInMarketResponse(): QuerySubaccountEffectivePositionInMarketResponse { + return { + state: undefined + }; +} +export const QuerySubaccountEffectivePositionInMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse", + is(o: any): o is QuerySubaccountEffectivePositionInMarketResponse { + return o && o.$typeUrl === QuerySubaccountEffectivePositionInMarketResponse.typeUrl; + }, + isAmino(o: any): o is QuerySubaccountEffectivePositionInMarketResponseAmino { + return o && o.$typeUrl === QuerySubaccountEffectivePositionInMarketResponse.typeUrl; + }, + encode(message: QuerySubaccountEffectivePositionInMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + EffectivePosition.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountEffectivePositionInMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = EffectivePosition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountEffectivePositionInMarketResponse { + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + message.state = object.state !== undefined && object.state !== null ? EffectivePosition.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountEffectivePositionInMarketResponseAmino): QuerySubaccountEffectivePositionInMarketResponse { + const message = createBaseQuerySubaccountEffectivePositionInMarketResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = EffectivePosition.fromAmino(object.state); + } + return message; + }, + toAmino(message: QuerySubaccountEffectivePositionInMarketResponse): QuerySubaccountEffectivePositionInMarketResponseAmino { + const obj: any = {}; + obj.state = message.state ? EffectivePosition.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountEffectivePositionInMarketResponseAminoMsg): QuerySubaccountEffectivePositionInMarketResponse { + return QuerySubaccountEffectivePositionInMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountEffectivePositionInMarketResponseProtoMsg): QuerySubaccountEffectivePositionInMarketResponse { + return QuerySubaccountEffectivePositionInMarketResponse.decode(message.value); + }, + toProto(message: QuerySubaccountEffectivePositionInMarketResponse): Uint8Array { + return QuerySubaccountEffectivePositionInMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountEffectivePositionInMarketResponse): QuerySubaccountEffectivePositionInMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountEffectivePositionInMarketResponse", + value: QuerySubaccountEffectivePositionInMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountEffectivePositionInMarketResponse.typeUrl, QuerySubaccountEffectivePositionInMarketResponse); +function createBaseQueryPerpetualMarketInfoRequest(): QueryPerpetualMarketInfoRequest { + return { + marketId: "" + }; +} +export const QueryPerpetualMarketInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest", + is(o: any): o is QueryPerpetualMarketInfoRequest { + return o && (o.$typeUrl === QueryPerpetualMarketInfoRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryPerpetualMarketInfoRequestAmino { + return o && (o.$typeUrl === QueryPerpetualMarketInfoRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryPerpetualMarketInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketInfoRequest { + const message = createBaseQueryPerpetualMarketInfoRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryPerpetualMarketInfoRequestAmino): QueryPerpetualMarketInfoRequest { + const message = createBaseQueryPerpetualMarketInfoRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryPerpetualMarketInfoRequest): QueryPerpetualMarketInfoRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketInfoRequestAminoMsg): QueryPerpetualMarketInfoRequest { + return QueryPerpetualMarketInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketInfoRequestProtoMsg): QueryPerpetualMarketInfoRequest { + return QueryPerpetualMarketInfoRequest.decode(message.value); + }, + toProto(message: QueryPerpetualMarketInfoRequest): Uint8Array { + return QueryPerpetualMarketInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketInfoRequest): QueryPerpetualMarketInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoRequest", + value: QueryPerpetualMarketInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketInfoRequest.typeUrl, QueryPerpetualMarketInfoRequest); +function createBaseQueryPerpetualMarketInfoResponse(): QueryPerpetualMarketInfoResponse { + return { + info: PerpetualMarketInfo.fromPartial({}) + }; +} +export const QueryPerpetualMarketInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse", + is(o: any): o is QueryPerpetualMarketInfoResponse { + return o && (o.$typeUrl === QueryPerpetualMarketInfoResponse.typeUrl || PerpetualMarketInfo.is(o.info)); + }, + isAmino(o: any): o is QueryPerpetualMarketInfoResponseAmino { + return o && (o.$typeUrl === QueryPerpetualMarketInfoResponse.typeUrl || PerpetualMarketInfo.isAmino(o.info)); + }, + encode(message: QueryPerpetualMarketInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + PerpetualMarketInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = PerpetualMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketInfoResponse { + const message = createBaseQueryPerpetualMarketInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? PerpetualMarketInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualMarketInfoResponseAmino): QueryPerpetualMarketInfoResponse { + const message = createBaseQueryPerpetualMarketInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = PerpetualMarketInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryPerpetualMarketInfoResponse): QueryPerpetualMarketInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? PerpetualMarketInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketInfoResponseAminoMsg): QueryPerpetualMarketInfoResponse { + return QueryPerpetualMarketInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketInfoResponseProtoMsg): QueryPerpetualMarketInfoResponse { + return QueryPerpetualMarketInfoResponse.decode(message.value); + }, + toProto(message: QueryPerpetualMarketInfoResponse): Uint8Array { + return QueryPerpetualMarketInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketInfoResponse): QueryPerpetualMarketInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketInfoResponse", + value: QueryPerpetualMarketInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketInfoResponse.typeUrl, QueryPerpetualMarketInfoResponse); +function createBaseQueryExpiryFuturesMarketInfoRequest(): QueryExpiryFuturesMarketInfoRequest { + return { + marketId: "" + }; +} +export const QueryExpiryFuturesMarketInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest", + is(o: any): o is QueryExpiryFuturesMarketInfoRequest { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryExpiryFuturesMarketInfoRequestAmino { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryExpiryFuturesMarketInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExpiryFuturesMarketInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExpiryFuturesMarketInfoRequest { + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryExpiryFuturesMarketInfoRequestAmino): QueryExpiryFuturesMarketInfoRequest { + const message = createBaseQueryExpiryFuturesMarketInfoRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryExpiryFuturesMarketInfoRequest): QueryExpiryFuturesMarketInfoRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryExpiryFuturesMarketInfoRequestAminoMsg): QueryExpiryFuturesMarketInfoRequest { + return QueryExpiryFuturesMarketInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExpiryFuturesMarketInfoRequestProtoMsg): QueryExpiryFuturesMarketInfoRequest { + return QueryExpiryFuturesMarketInfoRequest.decode(message.value); + }, + toProto(message: QueryExpiryFuturesMarketInfoRequest): Uint8Array { + return QueryExpiryFuturesMarketInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExpiryFuturesMarketInfoRequest): QueryExpiryFuturesMarketInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoRequest", + value: QueryExpiryFuturesMarketInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExpiryFuturesMarketInfoRequest.typeUrl, QueryExpiryFuturesMarketInfoRequest); +function createBaseQueryExpiryFuturesMarketInfoResponse(): QueryExpiryFuturesMarketInfoResponse { + return { + info: ExpiryFuturesMarketInfo.fromPartial({}) + }; +} +export const QueryExpiryFuturesMarketInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse", + is(o: any): o is QueryExpiryFuturesMarketInfoResponse { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoResponse.typeUrl || ExpiryFuturesMarketInfo.is(o.info)); + }, + isAmino(o: any): o is QueryExpiryFuturesMarketInfoResponseAmino { + return o && (o.$typeUrl === QueryExpiryFuturesMarketInfoResponse.typeUrl || ExpiryFuturesMarketInfo.isAmino(o.info)); + }, + encode(message: QueryExpiryFuturesMarketInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + ExpiryFuturesMarketInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryExpiryFuturesMarketInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = ExpiryFuturesMarketInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryExpiryFuturesMarketInfoResponse { + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? ExpiryFuturesMarketInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryExpiryFuturesMarketInfoResponseAmino): QueryExpiryFuturesMarketInfoResponse { + const message = createBaseQueryExpiryFuturesMarketInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = ExpiryFuturesMarketInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryExpiryFuturesMarketInfoResponse): QueryExpiryFuturesMarketInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? ExpiryFuturesMarketInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryExpiryFuturesMarketInfoResponseAminoMsg): QueryExpiryFuturesMarketInfoResponse { + return QueryExpiryFuturesMarketInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExpiryFuturesMarketInfoResponseProtoMsg): QueryExpiryFuturesMarketInfoResponse { + return QueryExpiryFuturesMarketInfoResponse.decode(message.value); + }, + toProto(message: QueryExpiryFuturesMarketInfoResponse): Uint8Array { + return QueryExpiryFuturesMarketInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExpiryFuturesMarketInfoResponse): QueryExpiryFuturesMarketInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryExpiryFuturesMarketInfoResponse", + value: QueryExpiryFuturesMarketInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryExpiryFuturesMarketInfoResponse.typeUrl, QueryExpiryFuturesMarketInfoResponse); +function createBaseQueryPerpetualMarketFundingRequest(): QueryPerpetualMarketFundingRequest { + return { + marketId: "" + }; +} +export const QueryPerpetualMarketFundingRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest", + is(o: any): o is QueryPerpetualMarketFundingRequest { + return o && (o.$typeUrl === QueryPerpetualMarketFundingRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryPerpetualMarketFundingRequestAmino { + return o && (o.$typeUrl === QueryPerpetualMarketFundingRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryPerpetualMarketFundingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketFundingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketFundingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketFundingRequest { + const message = createBaseQueryPerpetualMarketFundingRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryPerpetualMarketFundingRequestAmino): QueryPerpetualMarketFundingRequest { + const message = createBaseQueryPerpetualMarketFundingRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryPerpetualMarketFundingRequest): QueryPerpetualMarketFundingRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketFundingRequestAminoMsg): QueryPerpetualMarketFundingRequest { + return QueryPerpetualMarketFundingRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketFundingRequestProtoMsg): QueryPerpetualMarketFundingRequest { + return QueryPerpetualMarketFundingRequest.decode(message.value); + }, + toProto(message: QueryPerpetualMarketFundingRequest): Uint8Array { + return QueryPerpetualMarketFundingRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketFundingRequest): QueryPerpetualMarketFundingRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingRequest", + value: QueryPerpetualMarketFundingRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketFundingRequest.typeUrl, QueryPerpetualMarketFundingRequest); +function createBaseQueryPerpetualMarketFundingResponse(): QueryPerpetualMarketFundingResponse { + return { + state: PerpetualMarketFunding.fromPartial({}) + }; +} +export const QueryPerpetualMarketFundingResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse", + is(o: any): o is QueryPerpetualMarketFundingResponse { + return o && (o.$typeUrl === QueryPerpetualMarketFundingResponse.typeUrl || PerpetualMarketFunding.is(o.state)); + }, + isAmino(o: any): o is QueryPerpetualMarketFundingResponseAmino { + return o && (o.$typeUrl === QueryPerpetualMarketFundingResponse.typeUrl || PerpetualMarketFunding.isAmino(o.state)); + }, + encode(message: QueryPerpetualMarketFundingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + PerpetualMarketFunding.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualMarketFundingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualMarketFundingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = PerpetualMarketFunding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPerpetualMarketFundingResponse { + const message = createBaseQueryPerpetualMarketFundingResponse(); + message.state = object.state !== undefined && object.state !== null ? PerpetualMarketFunding.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualMarketFundingResponseAmino): QueryPerpetualMarketFundingResponse { + const message = createBaseQueryPerpetualMarketFundingResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = PerpetualMarketFunding.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryPerpetualMarketFundingResponse): QueryPerpetualMarketFundingResponseAmino { + const obj: any = {}; + obj.state = message.state ? PerpetualMarketFunding.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualMarketFundingResponseAminoMsg): QueryPerpetualMarketFundingResponse { + return QueryPerpetualMarketFundingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualMarketFundingResponseProtoMsg): QueryPerpetualMarketFundingResponse { + return QueryPerpetualMarketFundingResponse.decode(message.value); + }, + toProto(message: QueryPerpetualMarketFundingResponse): Uint8Array { + return QueryPerpetualMarketFundingResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualMarketFundingResponse): QueryPerpetualMarketFundingResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPerpetualMarketFundingResponse", + value: QueryPerpetualMarketFundingResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPerpetualMarketFundingResponse.typeUrl, QueryPerpetualMarketFundingResponse); +function createBaseQuerySubaccountOrderMetadataResponse(): QuerySubaccountOrderMetadataResponse { + return { + metadata: [] + }; +} +export const QuerySubaccountOrderMetadataResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse", + is(o: any): o is QuerySubaccountOrderMetadataResponse { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataResponse.typeUrl || Array.isArray(o.metadata) && (!o.metadata.length || SubaccountOrderbookMetadataWithMarket.is(o.metadata[0]))); + }, + isAmino(o: any): o is QuerySubaccountOrderMetadataResponseAmino { + return o && (o.$typeUrl === QuerySubaccountOrderMetadataResponse.typeUrl || Array.isArray(o.metadata) && (!o.metadata.length || SubaccountOrderbookMetadataWithMarket.isAmino(o.metadata[0]))); + }, + encode(message: QuerySubaccountOrderMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.metadata) { + SubaccountOrderbookMetadataWithMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountOrderMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountOrderMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata.push(SubaccountOrderbookMetadataWithMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountOrderMetadataResponse { + const message = createBaseQuerySubaccountOrderMetadataResponse(); + message.metadata = object.metadata?.map(e => SubaccountOrderbookMetadataWithMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubaccountOrderMetadataResponseAmino): QuerySubaccountOrderMetadataResponse { + const message = createBaseQuerySubaccountOrderMetadataResponse(); + message.metadata = object.metadata?.map(e => SubaccountOrderbookMetadataWithMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubaccountOrderMetadataResponse): QuerySubaccountOrderMetadataResponseAmino { + const obj: any = {}; + if (message.metadata) { + obj.metadata = message.metadata.map(e => e ? SubaccountOrderbookMetadataWithMarket.toAmino(e) : undefined); + } else { + obj.metadata = message.metadata; + } + return obj; + }, + fromAminoMsg(object: QuerySubaccountOrderMetadataResponseAminoMsg): QuerySubaccountOrderMetadataResponse { + return QuerySubaccountOrderMetadataResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountOrderMetadataResponseProtoMsg): QuerySubaccountOrderMetadataResponse { + return QuerySubaccountOrderMetadataResponse.decode(message.value); + }, + toProto(message: QuerySubaccountOrderMetadataResponse): Uint8Array { + return QuerySubaccountOrderMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountOrderMetadataResponse): QuerySubaccountOrderMetadataResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountOrderMetadataResponse", + value: QuerySubaccountOrderMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountOrderMetadataResponse.typeUrl, QuerySubaccountOrderMetadataResponse); +function createBaseQuerySubaccountTradeNonceResponse(): QuerySubaccountTradeNonceResponse { + return { + nonce: 0 + }; +} +export const QuerySubaccountTradeNonceResponse = { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse", + is(o: any): o is QuerySubaccountTradeNonceResponse { + return o && (o.$typeUrl === QuerySubaccountTradeNonceResponse.typeUrl || typeof o.nonce === "number"); + }, + isAmino(o: any): o is QuerySubaccountTradeNonceResponseAmino { + return o && (o.$typeUrl === QuerySubaccountTradeNonceResponse.typeUrl || typeof o.nonce === "number"); + }, + encode(message: QuerySubaccountTradeNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== 0) { + writer.uint32(8).uint32(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountTradeNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountTradeNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QuerySubaccountTradeNonceResponse { + const message = createBaseQuerySubaccountTradeNonceResponse(); + message.nonce = object.nonce ?? 0; + return message; + }, + fromAmino(object: QuerySubaccountTradeNonceResponseAmino): QuerySubaccountTradeNonceResponse { + const message = createBaseQuerySubaccountTradeNonceResponse(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = object.nonce; + } + return message; + }, + toAmino(message: QuerySubaccountTradeNonceResponse): QuerySubaccountTradeNonceResponseAmino { + const obj: any = {}; + obj.nonce = message.nonce === 0 ? undefined : message.nonce; + return obj; + }, + fromAminoMsg(object: QuerySubaccountTradeNonceResponseAminoMsg): QuerySubaccountTradeNonceResponse { + return QuerySubaccountTradeNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountTradeNonceResponseProtoMsg): QuerySubaccountTradeNonceResponse { + return QuerySubaccountTradeNonceResponse.decode(message.value); + }, + toProto(message: QuerySubaccountTradeNonceResponse): Uint8Array { + return QuerySubaccountTradeNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountTradeNonceResponse): QuerySubaccountTradeNonceResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QuerySubaccountTradeNonceResponse", + value: QuerySubaccountTradeNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubaccountTradeNonceResponse.typeUrl, QuerySubaccountTradeNonceResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryPositionsRequest(): QueryPositionsRequest { + return {}; +} +export const QueryPositionsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest", + is(o: any): o is QueryPositionsRequest { + return o && o.$typeUrl === QueryPositionsRequest.typeUrl; + }, + isAmino(o: any): o is QueryPositionsRequestAmino { + return o && o.$typeUrl === QueryPositionsRequest.typeUrl; + }, + encode(_: QueryPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPositionsRequest { + const message = createBaseQueryPositionsRequest(); + return message; + }, + fromAmino(_: QueryPositionsRequestAmino): QueryPositionsRequest { + const message = createBaseQueryPositionsRequest(); + return message; + }, + toAmino(_: QueryPositionsRequest): QueryPositionsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPositionsRequestAminoMsg): QueryPositionsRequest { + return QueryPositionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPositionsRequestProtoMsg): QueryPositionsRequest { + return QueryPositionsRequest.decode(message.value); + }, + toProto(message: QueryPositionsRequest): Uint8Array { + return QueryPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionsRequest): QueryPositionsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsRequest", + value: QueryPositionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPositionsRequest.typeUrl, QueryPositionsRequest); +function createBaseQueryPositionsResponse(): QueryPositionsResponse { + return { + state: [] + }; +} +export const QueryPositionsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse", + is(o: any): o is QueryPositionsResponse { + return o && (o.$typeUrl === QueryPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.is(o.state[0]))); + }, + isAmino(o: any): o is QueryPositionsResponseAmino { + return o && (o.$typeUrl === QueryPositionsResponse.typeUrl || Array.isArray(o.state) && (!o.state.length || DerivativePosition.isAmino(o.state[0]))); + }, + encode(message: QueryPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.state) { + DerivativePosition.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state.push(DerivativePosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPositionsResponse { + const message = createBaseQueryPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPositionsResponseAmino): QueryPositionsResponse { + const message = createBaseQueryPositionsResponse(); + message.state = object.state?.map(e => DerivativePosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPositionsResponse): QueryPositionsResponseAmino { + const obj: any = {}; + if (message.state) { + obj.state = message.state.map(e => e ? DerivativePosition.toAmino(e) : undefined); + } else { + obj.state = message.state; + } + return obj; + }, + fromAminoMsg(object: QueryPositionsResponseAminoMsg): QueryPositionsResponse { + return QueryPositionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPositionsResponseProtoMsg): QueryPositionsResponse { + return QueryPositionsResponse.decode(message.value); + }, + toProto(message: QueryPositionsResponse): Uint8Array { + return QueryPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionsResponse): QueryPositionsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryPositionsResponse", + value: QueryPositionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPositionsResponse.typeUrl, QueryPositionsResponse); +function createBaseQueryTradeRewardPointsRequest(): QueryTradeRewardPointsRequest { + return { + accounts: [], + pendingPoolTimestamp: BigInt(0) + }; +} +export const QueryTradeRewardPointsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest", + is(o: any): o is QueryTradeRewardPointsRequest { + return o && (o.$typeUrl === QueryTradeRewardPointsRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && typeof o.pendingPoolTimestamp === "bigint"); + }, + isAmino(o: any): o is QueryTradeRewardPointsRequestAmino { + return o && (o.$typeUrl === QueryTradeRewardPointsRequest.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string") && typeof o.pending_pool_timestamp === "bigint"); + }, + encode(message: QueryTradeRewardPointsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + if (message.pendingPoolTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.pendingPoolTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardPointsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardPointsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + case 2: + message.pendingPoolTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardPointsRequest { + const message = createBaseQueryTradeRewardPointsRequest(); + message.accounts = object.accounts?.map(e => e) || []; + message.pendingPoolTimestamp = object.pendingPoolTimestamp !== undefined && object.pendingPoolTimestamp !== null ? BigInt(object.pendingPoolTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTradeRewardPointsRequestAmino): QueryTradeRewardPointsRequest { + const message = createBaseQueryTradeRewardPointsRequest(); + message.accounts = object.accounts?.map(e => e) || []; + if (object.pending_pool_timestamp !== undefined && object.pending_pool_timestamp !== null) { + message.pendingPoolTimestamp = BigInt(object.pending_pool_timestamp); + } + return message; + }, + toAmino(message: QueryTradeRewardPointsRequest): QueryTradeRewardPointsRequestAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + obj.pending_pool_timestamp = message.pendingPoolTimestamp !== BigInt(0) ? message.pendingPoolTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTradeRewardPointsRequestAminoMsg): QueryTradeRewardPointsRequest { + return QueryTradeRewardPointsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardPointsRequestProtoMsg): QueryTradeRewardPointsRequest { + return QueryTradeRewardPointsRequest.decode(message.value); + }, + toProto(message: QueryTradeRewardPointsRequest): Uint8Array { + return QueryTradeRewardPointsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardPointsRequest): QueryTradeRewardPointsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsRequest", + value: QueryTradeRewardPointsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardPointsRequest.typeUrl, QueryTradeRewardPointsRequest); +function createBaseQueryTradeRewardPointsResponse(): QueryTradeRewardPointsResponse { + return { + accountTradeRewardPoints: [] + }; +} +export const QueryTradeRewardPointsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse", + is(o: any): o is QueryTradeRewardPointsResponse { + return o && (o.$typeUrl === QueryTradeRewardPointsResponse.typeUrl || Array.isArray(o.accountTradeRewardPoints) && (!o.accountTradeRewardPoints.length || typeof o.accountTradeRewardPoints[0] === "string")); + }, + isAmino(o: any): o is QueryTradeRewardPointsResponseAmino { + return o && (o.$typeUrl === QueryTradeRewardPointsResponse.typeUrl || Array.isArray(o.account_trade_reward_points) && (!o.account_trade_reward_points.length || typeof o.account_trade_reward_points[0] === "string")); + }, + encode(message: QueryTradeRewardPointsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountTradeRewardPoints) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardPointsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardPointsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountTradeRewardPoints.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardPointsResponse { + const message = createBaseQueryTradeRewardPointsResponse(); + message.accountTradeRewardPoints = object.accountTradeRewardPoints?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryTradeRewardPointsResponseAmino): QueryTradeRewardPointsResponse { + const message = createBaseQueryTradeRewardPointsResponse(); + message.accountTradeRewardPoints = object.account_trade_reward_points?.map(e => e) || []; + return message; + }, + toAmino(message: QueryTradeRewardPointsResponse): QueryTradeRewardPointsResponseAmino { + const obj: any = {}; + if (message.accountTradeRewardPoints) { + obj.account_trade_reward_points = message.accountTradeRewardPoints.map(e => e); + } else { + obj.account_trade_reward_points = message.accountTradeRewardPoints; + } + return obj; + }, + fromAminoMsg(object: QueryTradeRewardPointsResponseAminoMsg): QueryTradeRewardPointsResponse { + return QueryTradeRewardPointsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardPointsResponseProtoMsg): QueryTradeRewardPointsResponse { + return QueryTradeRewardPointsResponse.decode(message.value); + }, + toProto(message: QueryTradeRewardPointsResponse): Uint8Array { + return QueryTradeRewardPointsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardPointsResponse): QueryTradeRewardPointsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardPointsResponse", + value: QueryTradeRewardPointsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardPointsResponse.typeUrl, QueryTradeRewardPointsResponse); +function createBaseQueryTradeRewardCampaignRequest(): QueryTradeRewardCampaignRequest { + return {}; +} +export const QueryTradeRewardCampaignRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest", + is(o: any): o is QueryTradeRewardCampaignRequest { + return o && o.$typeUrl === QueryTradeRewardCampaignRequest.typeUrl; + }, + isAmino(o: any): o is QueryTradeRewardCampaignRequestAmino { + return o && o.$typeUrl === QueryTradeRewardCampaignRequest.typeUrl; + }, + encode(_: QueryTradeRewardCampaignRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardCampaignRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardCampaignRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryTradeRewardCampaignRequest { + const message = createBaseQueryTradeRewardCampaignRequest(); + return message; + }, + fromAmino(_: QueryTradeRewardCampaignRequestAmino): QueryTradeRewardCampaignRequest { + const message = createBaseQueryTradeRewardCampaignRequest(); + return message; + }, + toAmino(_: QueryTradeRewardCampaignRequest): QueryTradeRewardCampaignRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryTradeRewardCampaignRequestAminoMsg): QueryTradeRewardCampaignRequest { + return QueryTradeRewardCampaignRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardCampaignRequestProtoMsg): QueryTradeRewardCampaignRequest { + return QueryTradeRewardCampaignRequest.decode(message.value); + }, + toProto(message: QueryTradeRewardCampaignRequest): Uint8Array { + return QueryTradeRewardCampaignRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardCampaignRequest): QueryTradeRewardCampaignRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignRequest", + value: QueryTradeRewardCampaignRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardCampaignRequest.typeUrl, QueryTradeRewardCampaignRequest); +function createBaseQueryTradeRewardCampaignResponse(): QueryTradeRewardCampaignResponse { + return { + tradingRewardCampaignInfo: undefined, + tradingRewardPoolCampaignSchedule: [], + totalTradeRewardPoints: "", + pendingTradingRewardPoolCampaignSchedule: [], + pendingTotalTradeRewardPoints: [] + }; +} +export const QueryTradeRewardCampaignResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse", + is(o: any): o is QueryTradeRewardCampaignResponse { + return o && (o.$typeUrl === QueryTradeRewardCampaignResponse.typeUrl || Array.isArray(o.tradingRewardPoolCampaignSchedule) && (!o.tradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.tradingRewardPoolCampaignSchedule[0])) && typeof o.totalTradeRewardPoints === "string" && Array.isArray(o.pendingTradingRewardPoolCampaignSchedule) && (!o.pendingTradingRewardPoolCampaignSchedule.length || CampaignRewardPool.is(o.pendingTradingRewardPoolCampaignSchedule[0])) && Array.isArray(o.pendingTotalTradeRewardPoints) && (!o.pendingTotalTradeRewardPoints.length || typeof o.pendingTotalTradeRewardPoints[0] === "string")); + }, + isAmino(o: any): o is QueryTradeRewardCampaignResponseAmino { + return o && (o.$typeUrl === QueryTradeRewardCampaignResponse.typeUrl || Array.isArray(o.trading_reward_pool_campaign_schedule) && (!o.trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.trading_reward_pool_campaign_schedule[0])) && typeof o.total_trade_reward_points === "string" && Array.isArray(o.pending_trading_reward_pool_campaign_schedule) && (!o.pending_trading_reward_pool_campaign_schedule.length || CampaignRewardPool.isAmino(o.pending_trading_reward_pool_campaign_schedule[0])) && Array.isArray(o.pending_total_trade_reward_points) && (!o.pending_total_trade_reward_points.length || typeof o.pending_total_trade_reward_points[0] === "string")); + }, + encode(message: QueryTradeRewardCampaignResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tradingRewardCampaignInfo !== undefined) { + TradingRewardCampaignInfo.encode(message.tradingRewardCampaignInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.tradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.totalTradeRewardPoints !== "") { + writer.uint32(26).string(message.totalTradeRewardPoints); + } + for (const v of message.pendingTradingRewardPoolCampaignSchedule) { + CampaignRewardPool.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.pendingTotalTradeRewardPoints) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTradeRewardCampaignResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTradeRewardCampaignResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.decode(reader, reader.uint32()); + break; + case 2: + message.tradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 3: + message.totalTradeRewardPoints = reader.string(); + break; + case 4: + message.pendingTradingRewardPoolCampaignSchedule.push(CampaignRewardPool.decode(reader, reader.uint32())); + break; + case 5: + message.pendingTotalTradeRewardPoints.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTradeRewardCampaignResponse { + const message = createBaseQueryTradeRewardCampaignResponse(); + message.tradingRewardCampaignInfo = object.tradingRewardCampaignInfo !== undefined && object.tradingRewardCampaignInfo !== null ? TradingRewardCampaignInfo.fromPartial(object.tradingRewardCampaignInfo) : undefined; + message.tradingRewardPoolCampaignSchedule = object.tradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.totalTradeRewardPoints = object.totalTradeRewardPoints ?? ""; + message.pendingTradingRewardPoolCampaignSchedule = object.pendingTradingRewardPoolCampaignSchedule?.map(e => CampaignRewardPool.fromPartial(e)) || []; + message.pendingTotalTradeRewardPoints = object.pendingTotalTradeRewardPoints?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryTradeRewardCampaignResponseAmino): QueryTradeRewardCampaignResponse { + const message = createBaseQueryTradeRewardCampaignResponse(); + if (object.trading_reward_campaign_info !== undefined && object.trading_reward_campaign_info !== null) { + message.tradingRewardCampaignInfo = TradingRewardCampaignInfo.fromAmino(object.trading_reward_campaign_info); + } + message.tradingRewardPoolCampaignSchedule = object.trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + if (object.total_trade_reward_points !== undefined && object.total_trade_reward_points !== null) { + message.totalTradeRewardPoints = object.total_trade_reward_points; + } + message.pendingTradingRewardPoolCampaignSchedule = object.pending_trading_reward_pool_campaign_schedule?.map(e => CampaignRewardPool.fromAmino(e)) || []; + message.pendingTotalTradeRewardPoints = object.pending_total_trade_reward_points?.map(e => e) || []; + return message; + }, + toAmino(message: QueryTradeRewardCampaignResponse): QueryTradeRewardCampaignResponseAmino { + const obj: any = {}; + obj.trading_reward_campaign_info = message.tradingRewardCampaignInfo ? TradingRewardCampaignInfo.toAmino(message.tradingRewardCampaignInfo) : undefined; + if (message.tradingRewardPoolCampaignSchedule) { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.trading_reward_pool_campaign_schedule = message.tradingRewardPoolCampaignSchedule; + } + obj.total_trade_reward_points = message.totalTradeRewardPoints === "" ? undefined : message.totalTradeRewardPoints; + if (message.pendingTradingRewardPoolCampaignSchedule) { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule.map(e => e ? CampaignRewardPool.toAmino(e) : undefined); + } else { + obj.pending_trading_reward_pool_campaign_schedule = message.pendingTradingRewardPoolCampaignSchedule; + } + if (message.pendingTotalTradeRewardPoints) { + obj.pending_total_trade_reward_points = message.pendingTotalTradeRewardPoints.map(e => e); + } else { + obj.pending_total_trade_reward_points = message.pendingTotalTradeRewardPoints; + } + return obj; + }, + fromAminoMsg(object: QueryTradeRewardCampaignResponseAminoMsg): QueryTradeRewardCampaignResponse { + return QueryTradeRewardCampaignResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTradeRewardCampaignResponseProtoMsg): QueryTradeRewardCampaignResponse { + return QueryTradeRewardCampaignResponse.decode(message.value); + }, + toProto(message: QueryTradeRewardCampaignResponse): Uint8Array { + return QueryTradeRewardCampaignResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTradeRewardCampaignResponse): QueryTradeRewardCampaignResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTradeRewardCampaignResponse", + value: QueryTradeRewardCampaignResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTradeRewardCampaignResponse.typeUrl, QueryTradeRewardCampaignResponse); +function createBaseQueryIsOptedOutOfRewardsRequest(): QueryIsOptedOutOfRewardsRequest { + return { + account: "" + }; +} +export const QueryIsOptedOutOfRewardsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest", + is(o: any): o is QueryIsOptedOutOfRewardsRequest { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryIsOptedOutOfRewardsRequestAmino { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryIsOptedOutOfRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsOptedOutOfRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryIsOptedOutOfRewardsRequest { + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryIsOptedOutOfRewardsRequestAmino): QueryIsOptedOutOfRewardsRequest { + const message = createBaseQueryIsOptedOutOfRewardsRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryIsOptedOutOfRewardsRequest): QueryIsOptedOutOfRewardsRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryIsOptedOutOfRewardsRequestAminoMsg): QueryIsOptedOutOfRewardsRequest { + return QueryIsOptedOutOfRewardsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsOptedOutOfRewardsRequestProtoMsg): QueryIsOptedOutOfRewardsRequest { + return QueryIsOptedOutOfRewardsRequest.decode(message.value); + }, + toProto(message: QueryIsOptedOutOfRewardsRequest): Uint8Array { + return QueryIsOptedOutOfRewardsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIsOptedOutOfRewardsRequest): QueryIsOptedOutOfRewardsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsRequest", + value: QueryIsOptedOutOfRewardsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryIsOptedOutOfRewardsRequest.typeUrl, QueryIsOptedOutOfRewardsRequest); +function createBaseQueryIsOptedOutOfRewardsResponse(): QueryIsOptedOutOfRewardsResponse { + return { + isOptedOut: false + }; +} +export const QueryIsOptedOutOfRewardsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse", + is(o: any): o is QueryIsOptedOutOfRewardsResponse { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsResponse.typeUrl || typeof o.isOptedOut === "boolean"); + }, + isAmino(o: any): o is QueryIsOptedOutOfRewardsResponseAmino { + return o && (o.$typeUrl === QueryIsOptedOutOfRewardsResponse.typeUrl || typeof o.is_opted_out === "boolean"); + }, + encode(message: QueryIsOptedOutOfRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isOptedOut === true) { + writer.uint32(8).bool(message.isOptedOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsOptedOutOfRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isOptedOut = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryIsOptedOutOfRewardsResponse { + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + message.isOptedOut = object.isOptedOut ?? false; + return message; + }, + fromAmino(object: QueryIsOptedOutOfRewardsResponseAmino): QueryIsOptedOutOfRewardsResponse { + const message = createBaseQueryIsOptedOutOfRewardsResponse(); + if (object.is_opted_out !== undefined && object.is_opted_out !== null) { + message.isOptedOut = object.is_opted_out; + } + return message; + }, + toAmino(message: QueryIsOptedOutOfRewardsResponse): QueryIsOptedOutOfRewardsResponseAmino { + const obj: any = {}; + obj.is_opted_out = message.isOptedOut === false ? undefined : message.isOptedOut; + return obj; + }, + fromAminoMsg(object: QueryIsOptedOutOfRewardsResponseAminoMsg): QueryIsOptedOutOfRewardsResponse { + return QueryIsOptedOutOfRewardsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsOptedOutOfRewardsResponseProtoMsg): QueryIsOptedOutOfRewardsResponse { + return QueryIsOptedOutOfRewardsResponse.decode(message.value); + }, + toProto(message: QueryIsOptedOutOfRewardsResponse): Uint8Array { + return QueryIsOptedOutOfRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryIsOptedOutOfRewardsResponse): QueryIsOptedOutOfRewardsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryIsOptedOutOfRewardsResponse", + value: QueryIsOptedOutOfRewardsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryIsOptedOutOfRewardsResponse.typeUrl, QueryIsOptedOutOfRewardsResponse); +function createBaseQueryOptedOutOfRewardsAccountsRequest(): QueryOptedOutOfRewardsAccountsRequest { + return {}; +} +export const QueryOptedOutOfRewardsAccountsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest", + is(o: any): o is QueryOptedOutOfRewardsAccountsRequest { + return o && o.$typeUrl === QueryOptedOutOfRewardsAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryOptedOutOfRewardsAccountsRequestAmino { + return o && o.$typeUrl === QueryOptedOutOfRewardsAccountsRequest.typeUrl; + }, + encode(_: QueryOptedOutOfRewardsAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOptedOutOfRewardsAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOptedOutOfRewardsAccountsRequest { + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + return message; + }, + fromAmino(_: QueryOptedOutOfRewardsAccountsRequestAmino): QueryOptedOutOfRewardsAccountsRequest { + const message = createBaseQueryOptedOutOfRewardsAccountsRequest(); + return message; + }, + toAmino(_: QueryOptedOutOfRewardsAccountsRequest): QueryOptedOutOfRewardsAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOptedOutOfRewardsAccountsRequestAminoMsg): QueryOptedOutOfRewardsAccountsRequest { + return QueryOptedOutOfRewardsAccountsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOptedOutOfRewardsAccountsRequestProtoMsg): QueryOptedOutOfRewardsAccountsRequest { + return QueryOptedOutOfRewardsAccountsRequest.decode(message.value); + }, + toProto(message: QueryOptedOutOfRewardsAccountsRequest): Uint8Array { + return QueryOptedOutOfRewardsAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOptedOutOfRewardsAccountsRequest): QueryOptedOutOfRewardsAccountsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsRequest", + value: QueryOptedOutOfRewardsAccountsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOptedOutOfRewardsAccountsRequest.typeUrl, QueryOptedOutOfRewardsAccountsRequest); +function createBaseQueryOptedOutOfRewardsAccountsResponse(): QueryOptedOutOfRewardsAccountsResponse { + return { + accounts: [] + }; +} +export const QueryOptedOutOfRewardsAccountsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse", + is(o: any): o is QueryOptedOutOfRewardsAccountsResponse { + return o && (o.$typeUrl === QueryOptedOutOfRewardsAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + isAmino(o: any): o is QueryOptedOutOfRewardsAccountsResponseAmino { + return o && (o.$typeUrl === QueryOptedOutOfRewardsAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + encode(message: QueryOptedOutOfRewardsAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOptedOutOfRewardsAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOptedOutOfRewardsAccountsResponse { + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryOptedOutOfRewardsAccountsResponseAmino): QueryOptedOutOfRewardsAccountsResponse { + const message = createBaseQueryOptedOutOfRewardsAccountsResponse(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + toAmino(message: QueryOptedOutOfRewardsAccountsResponse): QueryOptedOutOfRewardsAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: QueryOptedOutOfRewardsAccountsResponseAminoMsg): QueryOptedOutOfRewardsAccountsResponse { + return QueryOptedOutOfRewardsAccountsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOptedOutOfRewardsAccountsResponseProtoMsg): QueryOptedOutOfRewardsAccountsResponse { + return QueryOptedOutOfRewardsAccountsResponse.decode(message.value); + }, + toProto(message: QueryOptedOutOfRewardsAccountsResponse): Uint8Array { + return QueryOptedOutOfRewardsAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOptedOutOfRewardsAccountsResponse): QueryOptedOutOfRewardsAccountsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryOptedOutOfRewardsAccountsResponse", + value: QueryOptedOutOfRewardsAccountsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOptedOutOfRewardsAccountsResponse.typeUrl, QueryOptedOutOfRewardsAccountsResponse); +function createBaseQueryFeeDiscountAccountInfoRequest(): QueryFeeDiscountAccountInfoRequest { + return { + account: "" + }; +} +export const QueryFeeDiscountAccountInfoRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest", + is(o: any): o is QueryFeeDiscountAccountInfoRequest { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoRequest.typeUrl || typeof o.account === "string"); + }, + isAmino(o: any): o is QueryFeeDiscountAccountInfoRequestAmino { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoRequest.typeUrl || typeof o.account === "string"); + }, + encode(message: QueryFeeDiscountAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountAccountInfoRequest { + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: QueryFeeDiscountAccountInfoRequestAmino): QueryFeeDiscountAccountInfoRequest { + const message = createBaseQueryFeeDiscountAccountInfoRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: QueryFeeDiscountAccountInfoRequest): QueryFeeDiscountAccountInfoRequestAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountAccountInfoRequestAminoMsg): QueryFeeDiscountAccountInfoRequest { + return QueryFeeDiscountAccountInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountAccountInfoRequestProtoMsg): QueryFeeDiscountAccountInfoRequest { + return QueryFeeDiscountAccountInfoRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountAccountInfoRequest): Uint8Array { + return QueryFeeDiscountAccountInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountAccountInfoRequest): QueryFeeDiscountAccountInfoRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoRequest", + value: QueryFeeDiscountAccountInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountAccountInfoRequest.typeUrl, QueryFeeDiscountAccountInfoRequest); +function createBaseQueryFeeDiscountAccountInfoResponse(): QueryFeeDiscountAccountInfoResponse { + return { + tierLevel: BigInt(0), + accountInfo: undefined, + accountTtl: undefined + }; +} +export const QueryFeeDiscountAccountInfoResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse", + is(o: any): o is QueryFeeDiscountAccountInfoResponse { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoResponse.typeUrl || typeof o.tierLevel === "bigint"); + }, + isAmino(o: any): o is QueryFeeDiscountAccountInfoResponseAmino { + return o && (o.$typeUrl === QueryFeeDiscountAccountInfoResponse.typeUrl || typeof o.tier_level === "bigint"); + }, + encode(message: QueryFeeDiscountAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tierLevel !== BigInt(0)) { + writer.uint32(8).uint64(message.tierLevel); + } + if (message.accountInfo !== undefined) { + FeeDiscountTierInfo.encode(message.accountInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.accountTtl !== undefined) { + FeeDiscountTierTTL.encode(message.accountTtl, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tierLevel = reader.uint64(); + break; + case 2: + message.accountInfo = FeeDiscountTierInfo.decode(reader, reader.uint32()); + break; + case 3: + message.accountTtl = FeeDiscountTierTTL.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountAccountInfoResponse { + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + message.tierLevel = object.tierLevel !== undefined && object.tierLevel !== null ? BigInt(object.tierLevel.toString()) : BigInt(0); + message.accountInfo = object.accountInfo !== undefined && object.accountInfo !== null ? FeeDiscountTierInfo.fromPartial(object.accountInfo) : undefined; + message.accountTtl = object.accountTtl !== undefined && object.accountTtl !== null ? FeeDiscountTierTTL.fromPartial(object.accountTtl) : undefined; + return message; + }, + fromAmino(object: QueryFeeDiscountAccountInfoResponseAmino): QueryFeeDiscountAccountInfoResponse { + const message = createBaseQueryFeeDiscountAccountInfoResponse(); + if (object.tier_level !== undefined && object.tier_level !== null) { + message.tierLevel = BigInt(object.tier_level); + } + if (object.account_info !== undefined && object.account_info !== null) { + message.accountInfo = FeeDiscountTierInfo.fromAmino(object.account_info); + } + if (object.account_ttl !== undefined && object.account_ttl !== null) { + message.accountTtl = FeeDiscountTierTTL.fromAmino(object.account_ttl); + } + return message; + }, + toAmino(message: QueryFeeDiscountAccountInfoResponse): QueryFeeDiscountAccountInfoResponseAmino { + const obj: any = {}; + obj.tier_level = message.tierLevel !== BigInt(0) ? message.tierLevel?.toString() : undefined; + obj.account_info = message.accountInfo ? FeeDiscountTierInfo.toAmino(message.accountInfo) : undefined; + obj.account_ttl = message.accountTtl ? FeeDiscountTierTTL.toAmino(message.accountTtl) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountAccountInfoResponseAminoMsg): QueryFeeDiscountAccountInfoResponse { + return QueryFeeDiscountAccountInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountAccountInfoResponseProtoMsg): QueryFeeDiscountAccountInfoResponse { + return QueryFeeDiscountAccountInfoResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountAccountInfoResponse): Uint8Array { + return QueryFeeDiscountAccountInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountAccountInfoResponse): QueryFeeDiscountAccountInfoResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountAccountInfoResponse", + value: QueryFeeDiscountAccountInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountAccountInfoResponse.typeUrl, QueryFeeDiscountAccountInfoResponse); +function createBaseQueryFeeDiscountScheduleRequest(): QueryFeeDiscountScheduleRequest { + return {}; +} +export const QueryFeeDiscountScheduleRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest", + is(o: any): o is QueryFeeDiscountScheduleRequest { + return o && o.$typeUrl === QueryFeeDiscountScheduleRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountScheduleRequestAmino { + return o && o.$typeUrl === QueryFeeDiscountScheduleRequest.typeUrl; + }, + encode(_: QueryFeeDiscountScheduleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountScheduleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountScheduleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryFeeDiscountScheduleRequest { + const message = createBaseQueryFeeDiscountScheduleRequest(); + return message; + }, + fromAmino(_: QueryFeeDiscountScheduleRequestAmino): QueryFeeDiscountScheduleRequest { + const message = createBaseQueryFeeDiscountScheduleRequest(); + return message; + }, + toAmino(_: QueryFeeDiscountScheduleRequest): QueryFeeDiscountScheduleRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountScheduleRequestAminoMsg): QueryFeeDiscountScheduleRequest { + return QueryFeeDiscountScheduleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountScheduleRequestProtoMsg): QueryFeeDiscountScheduleRequest { + return QueryFeeDiscountScheduleRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountScheduleRequest): Uint8Array { + return QueryFeeDiscountScheduleRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountScheduleRequest): QueryFeeDiscountScheduleRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleRequest", + value: QueryFeeDiscountScheduleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountScheduleRequest.typeUrl, QueryFeeDiscountScheduleRequest); +function createBaseQueryFeeDiscountScheduleResponse(): QueryFeeDiscountScheduleResponse { + return { + feeDiscountSchedule: undefined + }; +} +export const QueryFeeDiscountScheduleResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse", + is(o: any): o is QueryFeeDiscountScheduleResponse { + return o && o.$typeUrl === QueryFeeDiscountScheduleResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountScheduleResponseAmino { + return o && o.$typeUrl === QueryFeeDiscountScheduleResponse.typeUrl; + }, + encode(message: QueryFeeDiscountScheduleResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feeDiscountSchedule !== undefined) { + FeeDiscountSchedule.encode(message.feeDiscountSchedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountScheduleResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountScheduleResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feeDiscountSchedule = FeeDiscountSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountScheduleResponse { + const message = createBaseQueryFeeDiscountScheduleResponse(); + message.feeDiscountSchedule = object.feeDiscountSchedule !== undefined && object.feeDiscountSchedule !== null ? FeeDiscountSchedule.fromPartial(object.feeDiscountSchedule) : undefined; + return message; + }, + fromAmino(object: QueryFeeDiscountScheduleResponseAmino): QueryFeeDiscountScheduleResponse { + const message = createBaseQueryFeeDiscountScheduleResponse(); + if (object.fee_discount_schedule !== undefined && object.fee_discount_schedule !== null) { + message.feeDiscountSchedule = FeeDiscountSchedule.fromAmino(object.fee_discount_schedule); + } + return message; + }, + toAmino(message: QueryFeeDiscountScheduleResponse): QueryFeeDiscountScheduleResponseAmino { + const obj: any = {}; + obj.fee_discount_schedule = message.feeDiscountSchedule ? FeeDiscountSchedule.toAmino(message.feeDiscountSchedule) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountScheduleResponseAminoMsg): QueryFeeDiscountScheduleResponse { + return QueryFeeDiscountScheduleResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountScheduleResponseProtoMsg): QueryFeeDiscountScheduleResponse { + return QueryFeeDiscountScheduleResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountScheduleResponse): Uint8Array { + return QueryFeeDiscountScheduleResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountScheduleResponse): QueryFeeDiscountScheduleResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountScheduleResponse", + value: QueryFeeDiscountScheduleResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountScheduleResponse.typeUrl, QueryFeeDiscountScheduleResponse); +function createBaseQueryBalanceMismatchesRequest(): QueryBalanceMismatchesRequest { + return { + dustFactor: BigInt(0) + }; +} +export const QueryBalanceMismatchesRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest", + is(o: any): o is QueryBalanceMismatchesRequest { + return o && (o.$typeUrl === QueryBalanceMismatchesRequest.typeUrl || typeof o.dustFactor === "bigint"); + }, + isAmino(o: any): o is QueryBalanceMismatchesRequestAmino { + return o && (o.$typeUrl === QueryBalanceMismatchesRequest.typeUrl || typeof o.dust_factor === "bigint"); + }, + encode(message: QueryBalanceMismatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.dustFactor !== BigInt(0)) { + writer.uint32(8).int64(message.dustFactor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceMismatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceMismatchesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dustFactor = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceMismatchesRequest { + const message = createBaseQueryBalanceMismatchesRequest(); + message.dustFactor = object.dustFactor !== undefined && object.dustFactor !== null ? BigInt(object.dustFactor.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryBalanceMismatchesRequestAmino): QueryBalanceMismatchesRequest { + const message = createBaseQueryBalanceMismatchesRequest(); + if (object.dust_factor !== undefined && object.dust_factor !== null) { + message.dustFactor = BigInt(object.dust_factor); + } + return message; + }, + toAmino(message: QueryBalanceMismatchesRequest): QueryBalanceMismatchesRequestAmino { + const obj: any = {}; + obj.dust_factor = message.dustFactor !== BigInt(0) ? message.dustFactor?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryBalanceMismatchesRequestAminoMsg): QueryBalanceMismatchesRequest { + return QueryBalanceMismatchesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceMismatchesRequestProtoMsg): QueryBalanceMismatchesRequest { + return QueryBalanceMismatchesRequest.decode(message.value); + }, + toProto(message: QueryBalanceMismatchesRequest): Uint8Array { + return QueryBalanceMismatchesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceMismatchesRequest): QueryBalanceMismatchesRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesRequest", + value: QueryBalanceMismatchesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceMismatchesRequest.typeUrl, QueryBalanceMismatchesRequest); +function createBaseBalanceMismatch(): BalanceMismatch { + return { + subaccountId: "", + denom: "", + available: "", + total: "", + balanceHold: "", + expectedTotal: "", + difference: "" + }; +} +export const BalanceMismatch = { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch", + is(o: any): o is BalanceMismatch { + return o && (o.$typeUrl === BalanceMismatch.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balanceHold === "string" && typeof o.expectedTotal === "string" && typeof o.difference === "string"); + }, + isAmino(o: any): o is BalanceMismatchAmino { + return o && (o.$typeUrl === BalanceMismatch.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balance_hold === "string" && typeof o.expected_total === "string" && typeof o.difference === "string"); + }, + encode(message: BalanceMismatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.available !== "") { + writer.uint32(26).string(message.available); + } + if (message.total !== "") { + writer.uint32(34).string(message.total); + } + if (message.balanceHold !== "") { + writer.uint32(42).string(message.balanceHold); + } + if (message.expectedTotal !== "") { + writer.uint32(50).string(message.expectedTotal); + } + if (message.difference !== "") { + writer.uint32(58).string(message.difference); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalanceMismatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalanceMismatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.available = reader.string(); + break; + case 4: + message.total = reader.string(); + break; + case 5: + message.balanceHold = reader.string(); + break; + case 6: + message.expectedTotal = reader.string(); + break; + case 7: + message.difference = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BalanceMismatch { + const message = createBaseBalanceMismatch(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.available = object.available ?? ""; + message.total = object.total ?? ""; + message.balanceHold = object.balanceHold ?? ""; + message.expectedTotal = object.expectedTotal ?? ""; + message.difference = object.difference ?? ""; + return message; + }, + fromAmino(object: BalanceMismatchAmino): BalanceMismatch { + const message = createBaseBalanceMismatch(); + if (object.subaccountId !== undefined && object.subaccountId !== null) { + message.subaccountId = object.subaccountId; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.available !== undefined && object.available !== null) { + message.available = object.available; + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + if (object.expected_total !== undefined && object.expected_total !== null) { + message.expectedTotal = object.expected_total; + } + if (object.difference !== undefined && object.difference !== null) { + message.difference = object.difference; + } + return message; + }, + toAmino(message: BalanceMismatch): BalanceMismatchAmino { + const obj: any = {}; + obj.subaccountId = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.available = message.available === "" ? undefined : message.available; + obj.total = message.total === "" ? undefined : message.total; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + obj.expected_total = message.expectedTotal === "" ? undefined : message.expectedTotal; + obj.difference = message.difference === "" ? undefined : message.difference; + return obj; + }, + fromAminoMsg(object: BalanceMismatchAminoMsg): BalanceMismatch { + return BalanceMismatch.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceMismatchProtoMsg): BalanceMismatch { + return BalanceMismatch.decode(message.value); + }, + toProto(message: BalanceMismatch): Uint8Array { + return BalanceMismatch.encode(message).finish(); + }, + toProtoMsg(message: BalanceMismatch): BalanceMismatchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BalanceMismatch", + value: BalanceMismatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BalanceMismatch.typeUrl, BalanceMismatch); +function createBaseQueryBalanceMismatchesResponse(): QueryBalanceMismatchesResponse { + return { + balanceMismatches: [] + }; +} +export const QueryBalanceMismatchesResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse", + is(o: any): o is QueryBalanceMismatchesResponse { + return o && (o.$typeUrl === QueryBalanceMismatchesResponse.typeUrl || Array.isArray(o.balanceMismatches) && (!o.balanceMismatches.length || BalanceMismatch.is(o.balanceMismatches[0]))); + }, + isAmino(o: any): o is QueryBalanceMismatchesResponseAmino { + return o && (o.$typeUrl === QueryBalanceMismatchesResponse.typeUrl || Array.isArray(o.balance_mismatches) && (!o.balance_mismatches.length || BalanceMismatch.isAmino(o.balance_mismatches[0]))); + }, + encode(message: QueryBalanceMismatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balanceMismatches) { + BalanceMismatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceMismatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceMismatchesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceMismatches.push(BalanceMismatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceMismatchesResponse { + const message = createBaseQueryBalanceMismatchesResponse(); + message.balanceMismatches = object.balanceMismatches?.map(e => BalanceMismatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBalanceMismatchesResponseAmino): QueryBalanceMismatchesResponse { + const message = createBaseQueryBalanceMismatchesResponse(); + message.balanceMismatches = object.balance_mismatches?.map(e => BalanceMismatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBalanceMismatchesResponse): QueryBalanceMismatchesResponseAmino { + const obj: any = {}; + if (message.balanceMismatches) { + obj.balance_mismatches = message.balanceMismatches.map(e => e ? BalanceMismatch.toAmino(e) : undefined); + } else { + obj.balance_mismatches = message.balanceMismatches; + } + return obj; + }, + fromAminoMsg(object: QueryBalanceMismatchesResponseAminoMsg): QueryBalanceMismatchesResponse { + return QueryBalanceMismatchesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceMismatchesResponseProtoMsg): QueryBalanceMismatchesResponse { + return QueryBalanceMismatchesResponse.decode(message.value); + }, + toProto(message: QueryBalanceMismatchesResponse): Uint8Array { + return QueryBalanceMismatchesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceMismatchesResponse): QueryBalanceMismatchesResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceMismatchesResponse", + value: QueryBalanceMismatchesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceMismatchesResponse.typeUrl, QueryBalanceMismatchesResponse); +function createBaseQueryBalanceWithBalanceHoldsRequest(): QueryBalanceWithBalanceHoldsRequest { + return {}; +} +export const QueryBalanceWithBalanceHoldsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest", + is(o: any): o is QueryBalanceWithBalanceHoldsRequest { + return o && o.$typeUrl === QueryBalanceWithBalanceHoldsRequest.typeUrl; + }, + isAmino(o: any): o is QueryBalanceWithBalanceHoldsRequestAmino { + return o && o.$typeUrl === QueryBalanceWithBalanceHoldsRequest.typeUrl; + }, + encode(_: QueryBalanceWithBalanceHoldsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceWithBalanceHoldsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBalanceWithBalanceHoldsRequest { + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + return message; + }, + fromAmino(_: QueryBalanceWithBalanceHoldsRequestAmino): QueryBalanceWithBalanceHoldsRequest { + const message = createBaseQueryBalanceWithBalanceHoldsRequest(); + return message; + }, + toAmino(_: QueryBalanceWithBalanceHoldsRequest): QueryBalanceWithBalanceHoldsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBalanceWithBalanceHoldsRequestAminoMsg): QueryBalanceWithBalanceHoldsRequest { + return QueryBalanceWithBalanceHoldsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceWithBalanceHoldsRequestProtoMsg): QueryBalanceWithBalanceHoldsRequest { + return QueryBalanceWithBalanceHoldsRequest.decode(message.value); + }, + toProto(message: QueryBalanceWithBalanceHoldsRequest): Uint8Array { + return QueryBalanceWithBalanceHoldsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceWithBalanceHoldsRequest): QueryBalanceWithBalanceHoldsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsRequest", + value: QueryBalanceWithBalanceHoldsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceWithBalanceHoldsRequest.typeUrl, QueryBalanceWithBalanceHoldsRequest); +function createBaseBalanceWithMarginHold(): BalanceWithMarginHold { + return { + subaccountId: "", + denom: "", + available: "", + total: "", + balanceHold: "" + }; +} +export const BalanceWithMarginHold = { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold", + is(o: any): o is BalanceWithMarginHold { + return o && (o.$typeUrl === BalanceWithMarginHold.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balanceHold === "string"); + }, + isAmino(o: any): o is BalanceWithMarginHoldAmino { + return o && (o.$typeUrl === BalanceWithMarginHold.typeUrl || typeof o.subaccountId === "string" && typeof o.denom === "string" && typeof o.available === "string" && typeof o.total === "string" && typeof o.balance_hold === "string"); + }, + encode(message: BalanceWithMarginHold, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.available !== "") { + writer.uint32(26).string(message.available); + } + if (message.total !== "") { + writer.uint32(34).string(message.total); + } + if (message.balanceHold !== "") { + writer.uint32(42).string(message.balanceHold); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalanceWithMarginHold { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalanceWithMarginHold(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.available = reader.string(); + break; + case 4: + message.total = reader.string(); + break; + case 5: + message.balanceHold = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BalanceWithMarginHold { + const message = createBaseBalanceWithMarginHold(); + message.subaccountId = object.subaccountId ?? ""; + message.denom = object.denom ?? ""; + message.available = object.available ?? ""; + message.total = object.total ?? ""; + message.balanceHold = object.balanceHold ?? ""; + return message; + }, + fromAmino(object: BalanceWithMarginHoldAmino): BalanceWithMarginHold { + const message = createBaseBalanceWithMarginHold(); + if (object.subaccountId !== undefined && object.subaccountId !== null) { + message.subaccountId = object.subaccountId; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.available !== undefined && object.available !== null) { + message.available = object.available; + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.balance_hold !== undefined && object.balance_hold !== null) { + message.balanceHold = object.balance_hold; + } + return message; + }, + toAmino(message: BalanceWithMarginHold): BalanceWithMarginHoldAmino { + const obj: any = {}; + obj.subaccountId = message.subaccountId === "" ? undefined : message.subaccountId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.available = message.available === "" ? undefined : message.available; + obj.total = message.total === "" ? undefined : message.total; + obj.balance_hold = message.balanceHold === "" ? undefined : message.balanceHold; + return obj; + }, + fromAminoMsg(object: BalanceWithMarginHoldAminoMsg): BalanceWithMarginHold { + return BalanceWithMarginHold.fromAmino(object.value); + }, + fromProtoMsg(message: BalanceWithMarginHoldProtoMsg): BalanceWithMarginHold { + return BalanceWithMarginHold.decode(message.value); + }, + toProto(message: BalanceWithMarginHold): Uint8Array { + return BalanceWithMarginHold.encode(message).finish(); + }, + toProtoMsg(message: BalanceWithMarginHold): BalanceWithMarginHoldProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.BalanceWithMarginHold", + value: BalanceWithMarginHold.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BalanceWithMarginHold.typeUrl, BalanceWithMarginHold); +function createBaseQueryBalanceWithBalanceHoldsResponse(): QueryBalanceWithBalanceHoldsResponse { + return { + balanceWithBalanceHolds: [] + }; +} +export const QueryBalanceWithBalanceHoldsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse", + is(o: any): o is QueryBalanceWithBalanceHoldsResponse { + return o && (o.$typeUrl === QueryBalanceWithBalanceHoldsResponse.typeUrl || Array.isArray(o.balanceWithBalanceHolds) && (!o.balanceWithBalanceHolds.length || BalanceWithMarginHold.is(o.balanceWithBalanceHolds[0]))); + }, + isAmino(o: any): o is QueryBalanceWithBalanceHoldsResponseAmino { + return o && (o.$typeUrl === QueryBalanceWithBalanceHoldsResponse.typeUrl || Array.isArray(o.balance_with_balance_holds) && (!o.balance_with_balance_holds.length || BalanceWithMarginHold.isAmino(o.balance_with_balance_holds[0]))); + }, + encode(message: QueryBalanceWithBalanceHoldsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balanceWithBalanceHolds) { + BalanceWithMarginHold.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceWithBalanceHoldsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceWithBalanceHolds.push(BalanceWithMarginHold.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBalanceWithBalanceHoldsResponse { + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + message.balanceWithBalanceHolds = object.balanceWithBalanceHolds?.map(e => BalanceWithMarginHold.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBalanceWithBalanceHoldsResponseAmino): QueryBalanceWithBalanceHoldsResponse { + const message = createBaseQueryBalanceWithBalanceHoldsResponse(); + message.balanceWithBalanceHolds = object.balance_with_balance_holds?.map(e => BalanceWithMarginHold.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBalanceWithBalanceHoldsResponse): QueryBalanceWithBalanceHoldsResponseAmino { + const obj: any = {}; + if (message.balanceWithBalanceHolds) { + obj.balance_with_balance_holds = message.balanceWithBalanceHolds.map(e => e ? BalanceWithMarginHold.toAmino(e) : undefined); + } else { + obj.balance_with_balance_holds = message.balanceWithBalanceHolds; + } + return obj; + }, + fromAminoMsg(object: QueryBalanceWithBalanceHoldsResponseAminoMsg): QueryBalanceWithBalanceHoldsResponse { + return QueryBalanceWithBalanceHoldsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBalanceWithBalanceHoldsResponseProtoMsg): QueryBalanceWithBalanceHoldsResponse { + return QueryBalanceWithBalanceHoldsResponse.decode(message.value); + }, + toProto(message: QueryBalanceWithBalanceHoldsResponse): Uint8Array { + return QueryBalanceWithBalanceHoldsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceWithBalanceHoldsResponse): QueryBalanceWithBalanceHoldsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBalanceWithBalanceHoldsResponse", + value: QueryBalanceWithBalanceHoldsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBalanceWithBalanceHoldsResponse.typeUrl, QueryBalanceWithBalanceHoldsResponse); +function createBaseQueryFeeDiscountTierStatisticsRequest(): QueryFeeDiscountTierStatisticsRequest { + return {}; +} +export const QueryFeeDiscountTierStatisticsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest", + is(o: any): o is QueryFeeDiscountTierStatisticsRequest { + return o && o.$typeUrl === QueryFeeDiscountTierStatisticsRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeDiscountTierStatisticsRequestAmino { + return o && o.$typeUrl === QueryFeeDiscountTierStatisticsRequest.typeUrl; + }, + encode(_: QueryFeeDiscountTierStatisticsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountTierStatisticsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryFeeDiscountTierStatisticsRequest { + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + return message; + }, + fromAmino(_: QueryFeeDiscountTierStatisticsRequestAmino): QueryFeeDiscountTierStatisticsRequest { + const message = createBaseQueryFeeDiscountTierStatisticsRequest(); + return message; + }, + toAmino(_: QueryFeeDiscountTierStatisticsRequest): QueryFeeDiscountTierStatisticsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountTierStatisticsRequestAminoMsg): QueryFeeDiscountTierStatisticsRequest { + return QueryFeeDiscountTierStatisticsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountTierStatisticsRequestProtoMsg): QueryFeeDiscountTierStatisticsRequest { + return QueryFeeDiscountTierStatisticsRequest.decode(message.value); + }, + toProto(message: QueryFeeDiscountTierStatisticsRequest): Uint8Array { + return QueryFeeDiscountTierStatisticsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountTierStatisticsRequest): QueryFeeDiscountTierStatisticsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsRequest", + value: QueryFeeDiscountTierStatisticsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountTierStatisticsRequest.typeUrl, QueryFeeDiscountTierStatisticsRequest); +function createBaseTierStatistic(): TierStatistic { + return { + tier: BigInt(0), + count: BigInt(0) + }; +} +export const TierStatistic = { + typeUrl: "/injective.exchange.v1beta1.TierStatistic", + is(o: any): o is TierStatistic { + return o && (o.$typeUrl === TierStatistic.typeUrl || typeof o.tier === "bigint" && typeof o.count === "bigint"); + }, + isAmino(o: any): o is TierStatisticAmino { + return o && (o.$typeUrl === TierStatistic.typeUrl || typeof o.tier === "bigint" && typeof o.count === "bigint"); + }, + encode(message: TierStatistic, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tier !== BigInt(0)) { + writer.uint32(8).uint64(message.tier); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TierStatistic { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTierStatistic(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tier = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TierStatistic { + const message = createBaseTierStatistic(); + message.tier = object.tier !== undefined && object.tier !== null ? BigInt(object.tier.toString()) : BigInt(0); + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TierStatisticAmino): TierStatistic { + const message = createBaseTierStatistic(); + if (object.tier !== undefined && object.tier !== null) { + message.tier = BigInt(object.tier); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + return message; + }, + toAmino(message: TierStatistic): TierStatisticAmino { + const obj: any = {}; + obj.tier = message.tier !== BigInt(0) ? message.tier?.toString() : undefined; + obj.count = message.count !== BigInt(0) ? message.count?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TierStatisticAminoMsg): TierStatistic { + return TierStatistic.fromAmino(object.value); + }, + fromProtoMsg(message: TierStatisticProtoMsg): TierStatistic { + return TierStatistic.decode(message.value); + }, + toProto(message: TierStatistic): Uint8Array { + return TierStatistic.encode(message).finish(); + }, + toProtoMsg(message: TierStatistic): TierStatisticProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TierStatistic", + value: TierStatistic.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TierStatistic.typeUrl, TierStatistic); +function createBaseQueryFeeDiscountTierStatisticsResponse(): QueryFeeDiscountTierStatisticsResponse { + return { + statistics: [] + }; +} +export const QueryFeeDiscountTierStatisticsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse", + is(o: any): o is QueryFeeDiscountTierStatisticsResponse { + return o && (o.$typeUrl === QueryFeeDiscountTierStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || TierStatistic.is(o.statistics[0]))); + }, + isAmino(o: any): o is QueryFeeDiscountTierStatisticsResponseAmino { + return o && (o.$typeUrl === QueryFeeDiscountTierStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || TierStatistic.isAmino(o.statistics[0]))); + }, + encode(message: QueryFeeDiscountTierStatisticsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.statistics) { + TierStatistic.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeDiscountTierStatisticsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statistics.push(TierStatistic.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeeDiscountTierStatisticsResponse { + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + message.statistics = object.statistics?.map(e => TierStatistic.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFeeDiscountTierStatisticsResponseAmino): QueryFeeDiscountTierStatisticsResponse { + const message = createBaseQueryFeeDiscountTierStatisticsResponse(); + message.statistics = object.statistics?.map(e => TierStatistic.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFeeDiscountTierStatisticsResponse): QueryFeeDiscountTierStatisticsResponseAmino { + const obj: any = {}; + if (message.statistics) { + obj.statistics = message.statistics.map(e => e ? TierStatistic.toAmino(e) : undefined); + } else { + obj.statistics = message.statistics; + } + return obj; + }, + fromAminoMsg(object: QueryFeeDiscountTierStatisticsResponseAminoMsg): QueryFeeDiscountTierStatisticsResponse { + return QueryFeeDiscountTierStatisticsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeeDiscountTierStatisticsResponseProtoMsg): QueryFeeDiscountTierStatisticsResponse { + return QueryFeeDiscountTierStatisticsResponse.decode(message.value); + }, + toProto(message: QueryFeeDiscountTierStatisticsResponse): Uint8Array { + return QueryFeeDiscountTierStatisticsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeeDiscountTierStatisticsResponse): QueryFeeDiscountTierStatisticsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryFeeDiscountTierStatisticsResponse", + value: QueryFeeDiscountTierStatisticsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeeDiscountTierStatisticsResponse.typeUrl, QueryFeeDiscountTierStatisticsResponse); +function createBaseMitoVaultInfosRequest(): MitoVaultInfosRequest { + return {}; +} +export const MitoVaultInfosRequest = { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest", + is(o: any): o is MitoVaultInfosRequest { + return o && o.$typeUrl === MitoVaultInfosRequest.typeUrl; + }, + isAmino(o: any): o is MitoVaultInfosRequestAmino { + return o && o.$typeUrl === MitoVaultInfosRequest.typeUrl; + }, + encode(_: MitoVaultInfosRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MitoVaultInfosRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMitoVaultInfosRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MitoVaultInfosRequest { + const message = createBaseMitoVaultInfosRequest(); + return message; + }, + fromAmino(_: MitoVaultInfosRequestAmino): MitoVaultInfosRequest { + const message = createBaseMitoVaultInfosRequest(); + return message; + }, + toAmino(_: MitoVaultInfosRequest): MitoVaultInfosRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MitoVaultInfosRequestAminoMsg): MitoVaultInfosRequest { + return MitoVaultInfosRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MitoVaultInfosRequestProtoMsg): MitoVaultInfosRequest { + return MitoVaultInfosRequest.decode(message.value); + }, + toProto(message: MitoVaultInfosRequest): Uint8Array { + return MitoVaultInfosRequest.encode(message).finish(); + }, + toProtoMsg(message: MitoVaultInfosRequest): MitoVaultInfosRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosRequest", + value: MitoVaultInfosRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MitoVaultInfosRequest.typeUrl, MitoVaultInfosRequest); +function createBaseMitoVaultInfosResponse(): MitoVaultInfosResponse { + return { + masterAddresses: [], + derivativeAddresses: [], + spotAddresses: [], + cw20Addresses: [] + }; +} +export const MitoVaultInfosResponse = { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse", + is(o: any): o is MitoVaultInfosResponse { + return o && (o.$typeUrl === MitoVaultInfosResponse.typeUrl || Array.isArray(o.masterAddresses) && (!o.masterAddresses.length || typeof o.masterAddresses[0] === "string") && Array.isArray(o.derivativeAddresses) && (!o.derivativeAddresses.length || typeof o.derivativeAddresses[0] === "string") && Array.isArray(o.spotAddresses) && (!o.spotAddresses.length || typeof o.spotAddresses[0] === "string") && Array.isArray(o.cw20Addresses) && (!o.cw20Addresses.length || typeof o.cw20Addresses[0] === "string")); + }, + isAmino(o: any): o is MitoVaultInfosResponseAmino { + return o && (o.$typeUrl === MitoVaultInfosResponse.typeUrl || Array.isArray(o.master_addresses) && (!o.master_addresses.length || typeof o.master_addresses[0] === "string") && Array.isArray(o.derivative_addresses) && (!o.derivative_addresses.length || typeof o.derivative_addresses[0] === "string") && Array.isArray(o.spot_addresses) && (!o.spot_addresses.length || typeof o.spot_addresses[0] === "string") && Array.isArray(o.cw20_addresses) && (!o.cw20_addresses.length || typeof o.cw20_addresses[0] === "string")); + }, + encode(message: MitoVaultInfosResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.masterAddresses) { + writer.uint32(10).string(v!); + } + for (const v of message.derivativeAddresses) { + writer.uint32(18).string(v!); + } + for (const v of message.spotAddresses) { + writer.uint32(26).string(v!); + } + for (const v of message.cw20Addresses) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MitoVaultInfosResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMitoVaultInfosResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.masterAddresses.push(reader.string()); + break; + case 2: + message.derivativeAddresses.push(reader.string()); + break; + case 3: + message.spotAddresses.push(reader.string()); + break; + case 4: + message.cw20Addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MitoVaultInfosResponse { + const message = createBaseMitoVaultInfosResponse(); + message.masterAddresses = object.masterAddresses?.map(e => e) || []; + message.derivativeAddresses = object.derivativeAddresses?.map(e => e) || []; + message.spotAddresses = object.spotAddresses?.map(e => e) || []; + message.cw20Addresses = object.cw20Addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MitoVaultInfosResponseAmino): MitoVaultInfosResponse { + const message = createBaseMitoVaultInfosResponse(); + message.masterAddresses = object.master_addresses?.map(e => e) || []; + message.derivativeAddresses = object.derivative_addresses?.map(e => e) || []; + message.spotAddresses = object.spot_addresses?.map(e => e) || []; + message.cw20Addresses = object.cw20_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MitoVaultInfosResponse): MitoVaultInfosResponseAmino { + const obj: any = {}; + if (message.masterAddresses) { + obj.master_addresses = message.masterAddresses.map(e => e); + } else { + obj.master_addresses = message.masterAddresses; + } + if (message.derivativeAddresses) { + obj.derivative_addresses = message.derivativeAddresses.map(e => e); + } else { + obj.derivative_addresses = message.derivativeAddresses; + } + if (message.spotAddresses) { + obj.spot_addresses = message.spotAddresses.map(e => e); + } else { + obj.spot_addresses = message.spotAddresses; + } + if (message.cw20Addresses) { + obj.cw20_addresses = message.cw20Addresses.map(e => e); + } else { + obj.cw20_addresses = message.cw20Addresses; + } + return obj; + }, + fromAminoMsg(object: MitoVaultInfosResponseAminoMsg): MitoVaultInfosResponse { + return MitoVaultInfosResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MitoVaultInfosResponseProtoMsg): MitoVaultInfosResponse { + return MitoVaultInfosResponse.decode(message.value); + }, + toProto(message: MitoVaultInfosResponse): Uint8Array { + return MitoVaultInfosResponse.encode(message).finish(); + }, + toProtoMsg(message: MitoVaultInfosResponse): MitoVaultInfosResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MitoVaultInfosResponse", + value: MitoVaultInfosResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MitoVaultInfosResponse.typeUrl, MitoVaultInfosResponse); +function createBaseQueryMarketIDFromVaultRequest(): QueryMarketIDFromVaultRequest { + return { + vaultAddress: "" + }; +} +export const QueryMarketIDFromVaultRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest", + is(o: any): o is QueryMarketIDFromVaultRequest { + return o && (o.$typeUrl === QueryMarketIDFromVaultRequest.typeUrl || typeof o.vaultAddress === "string"); + }, + isAmino(o: any): o is QueryMarketIDFromVaultRequestAmino { + return o && (o.$typeUrl === QueryMarketIDFromVaultRequest.typeUrl || typeof o.vault_address === "string"); + }, + encode(message: QueryMarketIDFromVaultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vaultAddress !== "") { + writer.uint32(10).string(message.vaultAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketIDFromVaultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketIDFromVaultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaultAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketIDFromVaultRequest { + const message = createBaseQueryMarketIDFromVaultRequest(); + message.vaultAddress = object.vaultAddress ?? ""; + return message; + }, + fromAmino(object: QueryMarketIDFromVaultRequestAmino): QueryMarketIDFromVaultRequest { + const message = createBaseQueryMarketIDFromVaultRequest(); + if (object.vault_address !== undefined && object.vault_address !== null) { + message.vaultAddress = object.vault_address; + } + return message; + }, + toAmino(message: QueryMarketIDFromVaultRequest): QueryMarketIDFromVaultRequestAmino { + const obj: any = {}; + obj.vault_address = message.vaultAddress === "" ? undefined : message.vaultAddress; + return obj; + }, + fromAminoMsg(object: QueryMarketIDFromVaultRequestAminoMsg): QueryMarketIDFromVaultRequest { + return QueryMarketIDFromVaultRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketIDFromVaultRequestProtoMsg): QueryMarketIDFromVaultRequest { + return QueryMarketIDFromVaultRequest.decode(message.value); + }, + toProto(message: QueryMarketIDFromVaultRequest): Uint8Array { + return QueryMarketIDFromVaultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketIDFromVaultRequest): QueryMarketIDFromVaultRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultRequest", + value: QueryMarketIDFromVaultRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketIDFromVaultRequest.typeUrl, QueryMarketIDFromVaultRequest); +function createBaseQueryMarketIDFromVaultResponse(): QueryMarketIDFromVaultResponse { + return { + marketId: "" + }; +} +export const QueryMarketIDFromVaultResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse", + is(o: any): o is QueryMarketIDFromVaultResponse { + return o && (o.$typeUrl === QueryMarketIDFromVaultResponse.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketIDFromVaultResponseAmino { + return o && (o.$typeUrl === QueryMarketIDFromVaultResponse.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketIDFromVaultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketIDFromVaultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketIDFromVaultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketIDFromVaultResponse { + const message = createBaseQueryMarketIDFromVaultResponse(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryMarketIDFromVaultResponseAmino): QueryMarketIDFromVaultResponse { + const message = createBaseQueryMarketIDFromVaultResponse(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryMarketIDFromVaultResponse): QueryMarketIDFromVaultResponseAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryMarketIDFromVaultResponseAminoMsg): QueryMarketIDFromVaultResponse { + return QueryMarketIDFromVaultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketIDFromVaultResponseProtoMsg): QueryMarketIDFromVaultResponse { + return QueryMarketIDFromVaultResponse.decode(message.value); + }, + toProto(message: QueryMarketIDFromVaultResponse): Uint8Array { + return QueryMarketIDFromVaultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketIDFromVaultResponse): QueryMarketIDFromVaultResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketIDFromVaultResponse", + value: QueryMarketIDFromVaultResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketIDFromVaultResponse.typeUrl, QueryMarketIDFromVaultResponse); +function createBaseQueryHistoricalTradeRecordsRequest(): QueryHistoricalTradeRecordsRequest { + return { + marketId: "" + }; +} +export const QueryHistoricalTradeRecordsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest", + is(o: any): o is QueryHistoricalTradeRecordsRequest { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryHistoricalTradeRecordsRequestAmino { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryHistoricalTradeRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalTradeRecordsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalTradeRecordsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalTradeRecordsRequest { + const message = createBaseQueryHistoricalTradeRecordsRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryHistoricalTradeRecordsRequestAmino): QueryHistoricalTradeRecordsRequest { + const message = createBaseQueryHistoricalTradeRecordsRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryHistoricalTradeRecordsRequest): QueryHistoricalTradeRecordsRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryHistoricalTradeRecordsRequestAminoMsg): QueryHistoricalTradeRecordsRequest { + return QueryHistoricalTradeRecordsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalTradeRecordsRequestProtoMsg): QueryHistoricalTradeRecordsRequest { + return QueryHistoricalTradeRecordsRequest.decode(message.value); + }, + toProto(message: QueryHistoricalTradeRecordsRequest): Uint8Array { + return QueryHistoricalTradeRecordsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalTradeRecordsRequest): QueryHistoricalTradeRecordsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsRequest", + value: QueryHistoricalTradeRecordsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalTradeRecordsRequest.typeUrl, QueryHistoricalTradeRecordsRequest); +function createBaseQueryHistoricalTradeRecordsResponse(): QueryHistoricalTradeRecordsResponse { + return { + tradeRecords: [] + }; +} +export const QueryHistoricalTradeRecordsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse", + is(o: any): o is QueryHistoricalTradeRecordsResponse { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsResponse.typeUrl || Array.isArray(o.tradeRecords) && (!o.tradeRecords.length || TradeRecords.is(o.tradeRecords[0]))); + }, + isAmino(o: any): o is QueryHistoricalTradeRecordsResponseAmino { + return o && (o.$typeUrl === QueryHistoricalTradeRecordsResponse.typeUrl || Array.isArray(o.trade_records) && (!o.trade_records.length || TradeRecords.isAmino(o.trade_records[0]))); + }, + encode(message: QueryHistoricalTradeRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.tradeRecords) { + TradeRecords.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalTradeRecordsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalTradeRecordsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradeRecords.push(TradeRecords.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalTradeRecordsResponse { + const message = createBaseQueryHistoricalTradeRecordsResponse(); + message.tradeRecords = object.tradeRecords?.map(e => TradeRecords.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryHistoricalTradeRecordsResponseAmino): QueryHistoricalTradeRecordsResponse { + const message = createBaseQueryHistoricalTradeRecordsResponse(); + message.tradeRecords = object.trade_records?.map(e => TradeRecords.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryHistoricalTradeRecordsResponse): QueryHistoricalTradeRecordsResponseAmino { + const obj: any = {}; + if (message.tradeRecords) { + obj.trade_records = message.tradeRecords.map(e => e ? TradeRecords.toAmino(e) : undefined); + } else { + obj.trade_records = message.tradeRecords; + } + return obj; + }, + fromAminoMsg(object: QueryHistoricalTradeRecordsResponseAminoMsg): QueryHistoricalTradeRecordsResponse { + return QueryHistoricalTradeRecordsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalTradeRecordsResponseProtoMsg): QueryHistoricalTradeRecordsResponse { + return QueryHistoricalTradeRecordsResponse.decode(message.value); + }, + toProto(message: QueryHistoricalTradeRecordsResponse): Uint8Array { + return QueryHistoricalTradeRecordsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalTradeRecordsResponse): QueryHistoricalTradeRecordsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryHistoricalTradeRecordsResponse", + value: QueryHistoricalTradeRecordsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalTradeRecordsResponse.typeUrl, QueryHistoricalTradeRecordsResponse); +function createBaseTradeHistoryOptions(): TradeHistoryOptions { + return { + tradeGroupingSec: BigInt(0), + maxAge: BigInt(0), + includeRawHistory: false, + includeMetadata: false + }; +} +export const TradeHistoryOptions = { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions", + is(o: any): o is TradeHistoryOptions { + return o && (o.$typeUrl === TradeHistoryOptions.typeUrl || typeof o.tradeGroupingSec === "bigint" && typeof o.maxAge === "bigint" && typeof o.includeRawHistory === "boolean" && typeof o.includeMetadata === "boolean"); + }, + isAmino(o: any): o is TradeHistoryOptionsAmino { + return o && (o.$typeUrl === TradeHistoryOptions.typeUrl || typeof o.trade_grouping_sec === "bigint" && typeof o.max_age === "bigint" && typeof o.include_raw_history === "boolean" && typeof o.include_metadata === "boolean"); + }, + encode(message: TradeHistoryOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tradeGroupingSec !== BigInt(0)) { + writer.uint32(8).uint64(message.tradeGroupingSec); + } + if (message.maxAge !== BigInt(0)) { + writer.uint32(16).uint64(message.maxAge); + } + if (message.includeRawHistory === true) { + writer.uint32(32).bool(message.includeRawHistory); + } + if (message.includeMetadata === true) { + writer.uint32(40).bool(message.includeMetadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeHistoryOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeHistoryOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradeGroupingSec = reader.uint64(); + break; + case 2: + message.maxAge = reader.uint64(); + break; + case 4: + message.includeRawHistory = reader.bool(); + break; + case 5: + message.includeMetadata = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradeHistoryOptions { + const message = createBaseTradeHistoryOptions(); + message.tradeGroupingSec = object.tradeGroupingSec !== undefined && object.tradeGroupingSec !== null ? BigInt(object.tradeGroupingSec.toString()) : BigInt(0); + message.maxAge = object.maxAge !== undefined && object.maxAge !== null ? BigInt(object.maxAge.toString()) : BigInt(0); + message.includeRawHistory = object.includeRawHistory ?? false; + message.includeMetadata = object.includeMetadata ?? false; + return message; + }, + fromAmino(object: TradeHistoryOptionsAmino): TradeHistoryOptions { + const message = createBaseTradeHistoryOptions(); + if (object.trade_grouping_sec !== undefined && object.trade_grouping_sec !== null) { + message.tradeGroupingSec = BigInt(object.trade_grouping_sec); + } + if (object.max_age !== undefined && object.max_age !== null) { + message.maxAge = BigInt(object.max_age); + } + if (object.include_raw_history !== undefined && object.include_raw_history !== null) { + message.includeRawHistory = object.include_raw_history; + } + if (object.include_metadata !== undefined && object.include_metadata !== null) { + message.includeMetadata = object.include_metadata; + } + return message; + }, + toAmino(message: TradeHistoryOptions): TradeHistoryOptionsAmino { + const obj: any = {}; + obj.trade_grouping_sec = message.tradeGroupingSec !== BigInt(0) ? message.tradeGroupingSec?.toString() : undefined; + obj.max_age = message.maxAge !== BigInt(0) ? message.maxAge?.toString() : undefined; + obj.include_raw_history = message.includeRawHistory === false ? undefined : message.includeRawHistory; + obj.include_metadata = message.includeMetadata === false ? undefined : message.includeMetadata; + return obj; + }, + fromAminoMsg(object: TradeHistoryOptionsAminoMsg): TradeHistoryOptions { + return TradeHistoryOptions.fromAmino(object.value); + }, + fromProtoMsg(message: TradeHistoryOptionsProtoMsg): TradeHistoryOptions { + return TradeHistoryOptions.decode(message.value); + }, + toProto(message: TradeHistoryOptions): Uint8Array { + return TradeHistoryOptions.encode(message).finish(); + }, + toProtoMsg(message: TradeHistoryOptions): TradeHistoryOptionsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TradeHistoryOptions", + value: TradeHistoryOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradeHistoryOptions.typeUrl, TradeHistoryOptions); +function createBaseQueryMarketVolatilityRequest(): QueryMarketVolatilityRequest { + return { + marketId: "", + tradeHistoryOptions: undefined + }; +} +export const QueryMarketVolatilityRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest", + is(o: any): o is QueryMarketVolatilityRequest { + return o && (o.$typeUrl === QueryMarketVolatilityRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketVolatilityRequestAmino { + return o && (o.$typeUrl === QueryMarketVolatilityRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketVolatilityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.tradeHistoryOptions !== undefined) { + TradeHistoryOptions.encode(message.tradeHistoryOptions, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketVolatilityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketVolatilityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.tradeHistoryOptions = TradeHistoryOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketVolatilityRequest { + const message = createBaseQueryMarketVolatilityRequest(); + message.marketId = object.marketId ?? ""; + message.tradeHistoryOptions = object.tradeHistoryOptions !== undefined && object.tradeHistoryOptions !== null ? TradeHistoryOptions.fromPartial(object.tradeHistoryOptions) : undefined; + return message; + }, + fromAmino(object: QueryMarketVolatilityRequestAmino): QueryMarketVolatilityRequest { + const message = createBaseQueryMarketVolatilityRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.trade_history_options !== undefined && object.trade_history_options !== null) { + message.tradeHistoryOptions = TradeHistoryOptions.fromAmino(object.trade_history_options); + } + return message; + }, + toAmino(message: QueryMarketVolatilityRequest): QueryMarketVolatilityRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.trade_history_options = message.tradeHistoryOptions ? TradeHistoryOptions.toAmino(message.tradeHistoryOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketVolatilityRequestAminoMsg): QueryMarketVolatilityRequest { + return QueryMarketVolatilityRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketVolatilityRequestProtoMsg): QueryMarketVolatilityRequest { + return QueryMarketVolatilityRequest.decode(message.value); + }, + toProto(message: QueryMarketVolatilityRequest): Uint8Array { + return QueryMarketVolatilityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketVolatilityRequest): QueryMarketVolatilityRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityRequest", + value: QueryMarketVolatilityRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketVolatilityRequest.typeUrl, QueryMarketVolatilityRequest); +function createBaseQueryMarketVolatilityResponse(): QueryMarketVolatilityResponse { + return { + volatility: "", + historyMetadata: undefined, + rawHistory: [] + }; +} +export const QueryMarketVolatilityResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse", + is(o: any): o is QueryMarketVolatilityResponse { + return o && (o.$typeUrl === QueryMarketVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.rawHistory) && (!o.rawHistory.length || TradeRecord.is(o.rawHistory[0]))); + }, + isAmino(o: any): o is QueryMarketVolatilityResponseAmino { + return o && (o.$typeUrl === QueryMarketVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.raw_history) && (!o.raw_history.length || TradeRecord.isAmino(o.raw_history[0]))); + }, + encode(message: QueryMarketVolatilityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volatility !== "") { + writer.uint32(10).string(message.volatility); + } + if (message.historyMetadata !== undefined) { + MetadataStatistics.encode(message.historyMetadata, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.rawHistory) { + TradeRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketVolatilityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketVolatilityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volatility = reader.string(); + break; + case 2: + message.historyMetadata = MetadataStatistics.decode(reader, reader.uint32()); + break; + case 3: + message.rawHistory.push(TradeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketVolatilityResponse { + const message = createBaseQueryMarketVolatilityResponse(); + message.volatility = object.volatility ?? ""; + message.historyMetadata = object.historyMetadata !== undefined && object.historyMetadata !== null ? MetadataStatistics.fromPartial(object.historyMetadata) : undefined; + message.rawHistory = object.rawHistory?.map(e => TradeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryMarketVolatilityResponseAmino): QueryMarketVolatilityResponse { + const message = createBaseQueryMarketVolatilityResponse(); + if (object.volatility !== undefined && object.volatility !== null) { + message.volatility = object.volatility; + } + if (object.history_metadata !== undefined && object.history_metadata !== null) { + message.historyMetadata = MetadataStatistics.fromAmino(object.history_metadata); + } + message.rawHistory = object.raw_history?.map(e => TradeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryMarketVolatilityResponse): QueryMarketVolatilityResponseAmino { + const obj: any = {}; + obj.volatility = message.volatility === "" ? undefined : message.volatility; + obj.history_metadata = message.historyMetadata ? MetadataStatistics.toAmino(message.historyMetadata) : undefined; + if (message.rawHistory) { + obj.raw_history = message.rawHistory.map(e => e ? TradeRecord.toAmino(e) : undefined); + } else { + obj.raw_history = message.rawHistory; + } + return obj; + }, + fromAminoMsg(object: QueryMarketVolatilityResponseAminoMsg): QueryMarketVolatilityResponse { + return QueryMarketVolatilityResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketVolatilityResponseProtoMsg): QueryMarketVolatilityResponse { + return QueryMarketVolatilityResponse.decode(message.value); + }, + toProto(message: QueryMarketVolatilityResponse): Uint8Array { + return QueryMarketVolatilityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketVolatilityResponse): QueryMarketVolatilityResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketVolatilityResponse", + value: QueryMarketVolatilityResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketVolatilityResponse.typeUrl, QueryMarketVolatilityResponse); +function createBaseQueryBinaryMarketsRequest(): QueryBinaryMarketsRequest { + return { + status: "" + }; +} +export const QueryBinaryMarketsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest", + is(o: any): o is QueryBinaryMarketsRequest { + return o && (o.$typeUrl === QueryBinaryMarketsRequest.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryBinaryMarketsRequestAmino { + return o && (o.$typeUrl === QueryBinaryMarketsRequest.typeUrl || typeof o.status === "string"); + }, + encode(message: QueryBinaryMarketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBinaryMarketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBinaryMarketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBinaryMarketsRequest { + const message = createBaseQueryBinaryMarketsRequest(); + message.status = object.status ?? ""; + return message; + }, + fromAmino(object: QueryBinaryMarketsRequestAmino): QueryBinaryMarketsRequest { + const message = createBaseQueryBinaryMarketsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: QueryBinaryMarketsRequest): QueryBinaryMarketsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: QueryBinaryMarketsRequestAminoMsg): QueryBinaryMarketsRequest { + return QueryBinaryMarketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBinaryMarketsRequestProtoMsg): QueryBinaryMarketsRequest { + return QueryBinaryMarketsRequest.decode(message.value); + }, + toProto(message: QueryBinaryMarketsRequest): Uint8Array { + return QueryBinaryMarketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBinaryMarketsRequest): QueryBinaryMarketsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsRequest", + value: QueryBinaryMarketsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBinaryMarketsRequest.typeUrl, QueryBinaryMarketsRequest); +function createBaseQueryBinaryMarketsResponse(): QueryBinaryMarketsResponse { + return { + markets: [] + }; +} +export const QueryBinaryMarketsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse", + is(o: any): o is QueryBinaryMarketsResponse { + return o && (o.$typeUrl === QueryBinaryMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || BinaryOptionsMarket.is(o.markets[0]))); + }, + isAmino(o: any): o is QueryBinaryMarketsResponseAmino { + return o && (o.$typeUrl === QueryBinaryMarketsResponse.typeUrl || Array.isArray(o.markets) && (!o.markets.length || BinaryOptionsMarket.isAmino(o.markets[0]))); + }, + encode(message: QueryBinaryMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.markets) { + BinaryOptionsMarket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBinaryMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBinaryMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.markets.push(BinaryOptionsMarket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBinaryMarketsResponse { + const message = createBaseQueryBinaryMarketsResponse(); + message.markets = object.markets?.map(e => BinaryOptionsMarket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBinaryMarketsResponseAmino): QueryBinaryMarketsResponse { + const message = createBaseQueryBinaryMarketsResponse(); + message.markets = object.markets?.map(e => BinaryOptionsMarket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBinaryMarketsResponse): QueryBinaryMarketsResponseAmino { + const obj: any = {}; + if (message.markets) { + obj.markets = message.markets.map(e => e ? BinaryOptionsMarket.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: QueryBinaryMarketsResponseAminoMsg): QueryBinaryMarketsResponse { + return QueryBinaryMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBinaryMarketsResponseProtoMsg): QueryBinaryMarketsResponse { + return QueryBinaryMarketsResponse.decode(message.value); + }, + toProto(message: QueryBinaryMarketsResponse): Uint8Array { + return QueryBinaryMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBinaryMarketsResponse): QueryBinaryMarketsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryBinaryMarketsResponse", + value: QueryBinaryMarketsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBinaryMarketsResponse.typeUrl, QueryBinaryMarketsResponse); +function createBaseQueryTraderDerivativeConditionalOrdersRequest(): QueryTraderDerivativeConditionalOrdersRequest { + return { + subaccountId: "", + marketId: "" + }; +} +export const QueryTraderDerivativeConditionalOrdersRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest", + is(o: any): o is QueryTraderDerivativeConditionalOrdersRequest { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersRequest.typeUrl || typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryTraderDerivativeConditionalOrdersRequestAmino { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersRequest.typeUrl || typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: QueryTraderDerivativeConditionalOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeConditionalOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeConditionalOrdersRequest { + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryTraderDerivativeConditionalOrdersRequestAmino): QueryTraderDerivativeConditionalOrdersRequest { + const message = createBaseQueryTraderDerivativeConditionalOrdersRequest(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryTraderDerivativeConditionalOrdersRequest): QueryTraderDerivativeConditionalOrdersRequestAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeConditionalOrdersRequestAminoMsg): QueryTraderDerivativeConditionalOrdersRequest { + return QueryTraderDerivativeConditionalOrdersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeConditionalOrdersRequestProtoMsg): QueryTraderDerivativeConditionalOrdersRequest { + return QueryTraderDerivativeConditionalOrdersRequest.decode(message.value); + }, + toProto(message: QueryTraderDerivativeConditionalOrdersRequest): Uint8Array { + return QueryTraderDerivativeConditionalOrdersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeConditionalOrdersRequest): QueryTraderDerivativeConditionalOrdersRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersRequest", + value: QueryTraderDerivativeConditionalOrdersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeConditionalOrdersRequest.typeUrl, QueryTraderDerivativeConditionalOrdersRequest); +function createBaseTrimmedDerivativeConditionalOrder(): TrimmedDerivativeConditionalOrder { + return { + price: "", + quantity: "", + margin: "", + triggerPrice: "", + isBuy: false, + isLimit: false, + orderHash: "", + cid: "" + }; +} +export const TrimmedDerivativeConditionalOrder = { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder", + is(o: any): o is TrimmedDerivativeConditionalOrder { + return o && (o.$typeUrl === TrimmedDerivativeConditionalOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.triggerPrice === "string" && typeof o.isBuy === "boolean" && typeof o.isLimit === "boolean" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is TrimmedDerivativeConditionalOrderAmino { + return o && (o.$typeUrl === TrimmedDerivativeConditionalOrder.typeUrl || typeof o.price === "string" && typeof o.quantity === "string" && typeof o.margin === "string" && typeof o.triggerPrice === "string" && typeof o.isBuy === "boolean" && typeof o.isLimit === "boolean" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: TrimmedDerivativeConditionalOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.quantity !== "") { + writer.uint32(18).string(message.quantity); + } + if (message.margin !== "") { + writer.uint32(26).string(message.margin); + } + if (message.triggerPrice !== "") { + writer.uint32(34).string(message.triggerPrice); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + if (message.isLimit === true) { + writer.uint32(48).bool(message.isLimit); + } + if (message.orderHash !== "") { + writer.uint32(58).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(66).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrimmedDerivativeConditionalOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrimmedDerivativeConditionalOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.quantity = reader.string(); + break; + case 3: + message.margin = reader.string(); + break; + case 4: + message.triggerPrice = reader.string(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.isLimit = reader.bool(); + break; + case 7: + message.orderHash = reader.string(); + break; + case 8: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TrimmedDerivativeConditionalOrder { + const message = createBaseTrimmedDerivativeConditionalOrder(); + message.price = object.price ?? ""; + message.quantity = object.quantity ?? ""; + message.margin = object.margin ?? ""; + message.triggerPrice = object.triggerPrice ?? ""; + message.isBuy = object.isBuy ?? false; + message.isLimit = object.isLimit ?? false; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: TrimmedDerivativeConditionalOrderAmino): TrimmedDerivativeConditionalOrder { + const message = createBaseTrimmedDerivativeConditionalOrder(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.triggerPrice !== undefined && object.triggerPrice !== null) { + message.triggerPrice = object.triggerPrice; + } + if (object.isBuy !== undefined && object.isBuy !== null) { + message.isBuy = object.isBuy; + } + if (object.isLimit !== undefined && object.isLimit !== null) { + message.isLimit = object.isLimit; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: TrimmedDerivativeConditionalOrder): TrimmedDerivativeConditionalOrderAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.triggerPrice = message.triggerPrice === "" ? undefined : message.triggerPrice; + obj.isBuy = message.isBuy ?? false; + obj.isLimit = message.isLimit ?? false; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: TrimmedDerivativeConditionalOrderAminoMsg): TrimmedDerivativeConditionalOrder { + return TrimmedDerivativeConditionalOrder.fromAmino(object.value); + }, + fromProtoMsg(message: TrimmedDerivativeConditionalOrderProtoMsg): TrimmedDerivativeConditionalOrder { + return TrimmedDerivativeConditionalOrder.decode(message.value); + }, + toProto(message: TrimmedDerivativeConditionalOrder): Uint8Array { + return TrimmedDerivativeConditionalOrder.encode(message).finish(); + }, + toProtoMsg(message: TrimmedDerivativeConditionalOrder): TrimmedDerivativeConditionalOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.TrimmedDerivativeConditionalOrder", + value: TrimmedDerivativeConditionalOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrimmedDerivativeConditionalOrder.typeUrl, TrimmedDerivativeConditionalOrder); +function createBaseQueryTraderDerivativeConditionalOrdersResponse(): QueryTraderDerivativeConditionalOrdersResponse { + return { + orders: [] + }; +} +export const QueryTraderDerivativeConditionalOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse", + is(o: any): o is QueryTraderDerivativeConditionalOrdersResponse { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeConditionalOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is QueryTraderDerivativeConditionalOrdersResponseAmino { + return o && (o.$typeUrl === QueryTraderDerivativeConditionalOrdersResponse.typeUrl || Array.isArray(o.orders) && (!o.orders.length || TrimmedDerivativeConditionalOrder.isAmino(o.orders[0]))); + }, + encode(message: QueryTraderDerivativeConditionalOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orders) { + TrimmedDerivativeConditionalOrder.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTraderDerivativeConditionalOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orders.push(TrimmedDerivativeConditionalOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryTraderDerivativeConditionalOrdersResponse { + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeConditionalOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTraderDerivativeConditionalOrdersResponseAmino): QueryTraderDerivativeConditionalOrdersResponse { + const message = createBaseQueryTraderDerivativeConditionalOrdersResponse(); + message.orders = object.orders?.map(e => TrimmedDerivativeConditionalOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTraderDerivativeConditionalOrdersResponse): QueryTraderDerivativeConditionalOrdersResponseAmino { + const obj: any = {}; + if (message.orders) { + obj.orders = message.orders.map(e => e ? TrimmedDerivativeConditionalOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: QueryTraderDerivativeConditionalOrdersResponseAminoMsg): QueryTraderDerivativeConditionalOrdersResponse { + return QueryTraderDerivativeConditionalOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTraderDerivativeConditionalOrdersResponseProtoMsg): QueryTraderDerivativeConditionalOrdersResponse { + return QueryTraderDerivativeConditionalOrdersResponse.decode(message.value); + }, + toProto(message: QueryTraderDerivativeConditionalOrdersResponse): Uint8Array { + return QueryTraderDerivativeConditionalOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTraderDerivativeConditionalOrdersResponse): QueryTraderDerivativeConditionalOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryTraderDerivativeConditionalOrdersResponse", + value: QueryTraderDerivativeConditionalOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTraderDerivativeConditionalOrdersResponse.typeUrl, QueryTraderDerivativeConditionalOrdersResponse); +function createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(): QueryMarketAtomicExecutionFeeMultiplierRequest { + return { + marketId: "" + }; +} +export const QueryMarketAtomicExecutionFeeMultiplierRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest", + is(o: any): o is QueryMarketAtomicExecutionFeeMultiplierRequest { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryMarketAtomicExecutionFeeMultiplierRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketAtomicExecutionFeeMultiplierRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketAtomicExecutionFeeMultiplierRequest { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryMarketAtomicExecutionFeeMultiplierRequestAmino): QueryMarketAtomicExecutionFeeMultiplierRequest { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryMarketAtomicExecutionFeeMultiplierRequest): QueryMarketAtomicExecutionFeeMultiplierRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryMarketAtomicExecutionFeeMultiplierRequestAminoMsg): QueryMarketAtomicExecutionFeeMultiplierRequest { + return QueryMarketAtomicExecutionFeeMultiplierRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg): QueryMarketAtomicExecutionFeeMultiplierRequest { + return QueryMarketAtomicExecutionFeeMultiplierRequest.decode(message.value); + }, + toProto(message: QueryMarketAtomicExecutionFeeMultiplierRequest): Uint8Array { + return QueryMarketAtomicExecutionFeeMultiplierRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierRequest): QueryMarketAtomicExecutionFeeMultiplierRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierRequest", + value: QueryMarketAtomicExecutionFeeMultiplierRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketAtomicExecutionFeeMultiplierRequest.typeUrl, QueryMarketAtomicExecutionFeeMultiplierRequest); +function createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(): QueryMarketAtomicExecutionFeeMultiplierResponse { + return { + multiplier: "" + }; +} +export const QueryMarketAtomicExecutionFeeMultiplierResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse", + is(o: any): o is QueryMarketAtomicExecutionFeeMultiplierResponse { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl || typeof o.multiplier === "string"); + }, + isAmino(o: any): o is QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + return o && (o.$typeUrl === QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl || typeof o.multiplier === "string"); + }, + encode(message: QueryMarketAtomicExecutionFeeMultiplierResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.multiplier !== "") { + writer.uint32(10).string(message.multiplier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketAtomicExecutionFeeMultiplierResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.multiplier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryMarketAtomicExecutionFeeMultiplierResponse { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + message.multiplier = object.multiplier ?? ""; + return message; + }, + fromAmino(object: QueryMarketAtomicExecutionFeeMultiplierResponseAmino): QueryMarketAtomicExecutionFeeMultiplierResponse { + const message = createBaseQueryMarketAtomicExecutionFeeMultiplierResponse(); + if (object.multiplier !== undefined && object.multiplier !== null) { + message.multiplier = object.multiplier; + } + return message; + }, + toAmino(message: QueryMarketAtomicExecutionFeeMultiplierResponse): QueryMarketAtomicExecutionFeeMultiplierResponseAmino { + const obj: any = {}; + obj.multiplier = message.multiplier === "" ? undefined : message.multiplier; + return obj; + }, + fromAminoMsg(object: QueryMarketAtomicExecutionFeeMultiplierResponseAminoMsg): QueryMarketAtomicExecutionFeeMultiplierResponse { + return QueryMarketAtomicExecutionFeeMultiplierResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg): QueryMarketAtomicExecutionFeeMultiplierResponse { + return QueryMarketAtomicExecutionFeeMultiplierResponse.decode(message.value); + }, + toProto(message: QueryMarketAtomicExecutionFeeMultiplierResponse): Uint8Array { + return QueryMarketAtomicExecutionFeeMultiplierResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketAtomicExecutionFeeMultiplierResponse): QueryMarketAtomicExecutionFeeMultiplierResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryMarketAtomicExecutionFeeMultiplierResponse", + value: QueryMarketAtomicExecutionFeeMultiplierResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryMarketAtomicExecutionFeeMultiplierResponse.typeUrl, QueryMarketAtomicExecutionFeeMultiplierResponse); +function createBaseQueryActiveStakeGrantRequest(): QueryActiveStakeGrantRequest { + return { + grantee: "" + }; +} +export const QueryActiveStakeGrantRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest", + is(o: any): o is QueryActiveStakeGrantRequest { + return o && (o.$typeUrl === QueryActiveStakeGrantRequest.typeUrl || typeof o.grantee === "string"); + }, + isAmino(o: any): o is QueryActiveStakeGrantRequestAmino { + return o && (o.$typeUrl === QueryActiveStakeGrantRequest.typeUrl || typeof o.grantee === "string"); + }, + encode(message: QueryActiveStakeGrantRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryActiveStakeGrantRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActiveStakeGrantRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryActiveStakeGrantRequest { + const message = createBaseQueryActiveStakeGrantRequest(); + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryActiveStakeGrantRequestAmino): QueryActiveStakeGrantRequest { + const message = createBaseQueryActiveStakeGrantRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryActiveStakeGrantRequest): QueryActiveStakeGrantRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryActiveStakeGrantRequestAminoMsg): QueryActiveStakeGrantRequest { + return QueryActiveStakeGrantRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActiveStakeGrantRequestProtoMsg): QueryActiveStakeGrantRequest { + return QueryActiveStakeGrantRequest.decode(message.value); + }, + toProto(message: QueryActiveStakeGrantRequest): Uint8Array { + return QueryActiveStakeGrantRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryActiveStakeGrantRequest): QueryActiveStakeGrantRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantRequest", + value: QueryActiveStakeGrantRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryActiveStakeGrantRequest.typeUrl, QueryActiveStakeGrantRequest); +function createBaseQueryActiveStakeGrantResponse(): QueryActiveStakeGrantResponse { + return { + grant: undefined, + effectiveGrant: undefined + }; +} +export const QueryActiveStakeGrantResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse", + is(o: any): o is QueryActiveStakeGrantResponse { + return o && o.$typeUrl === QueryActiveStakeGrantResponse.typeUrl; + }, + isAmino(o: any): o is QueryActiveStakeGrantResponseAmino { + return o && o.$typeUrl === QueryActiveStakeGrantResponse.typeUrl; + }, + encode(message: QueryActiveStakeGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grant !== undefined) { + ActiveGrant.encode(message.grant, writer.uint32(10).fork()).ldelim(); + } + if (message.effectiveGrant !== undefined) { + EffectiveGrant.encode(message.effectiveGrant, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryActiveStakeGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActiveStakeGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grant = ActiveGrant.decode(reader, reader.uint32()); + break; + case 2: + message.effectiveGrant = EffectiveGrant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryActiveStakeGrantResponse { + const message = createBaseQueryActiveStakeGrantResponse(); + message.grant = object.grant !== undefined && object.grant !== null ? ActiveGrant.fromPartial(object.grant) : undefined; + message.effectiveGrant = object.effectiveGrant !== undefined && object.effectiveGrant !== null ? EffectiveGrant.fromPartial(object.effectiveGrant) : undefined; + return message; + }, + fromAmino(object: QueryActiveStakeGrantResponseAmino): QueryActiveStakeGrantResponse { + const message = createBaseQueryActiveStakeGrantResponse(); + if (object.grant !== undefined && object.grant !== null) { + message.grant = ActiveGrant.fromAmino(object.grant); + } + if (object.effective_grant !== undefined && object.effective_grant !== null) { + message.effectiveGrant = EffectiveGrant.fromAmino(object.effective_grant); + } + return message; + }, + toAmino(message: QueryActiveStakeGrantResponse): QueryActiveStakeGrantResponseAmino { + const obj: any = {}; + obj.grant = message.grant ? ActiveGrant.toAmino(message.grant) : undefined; + obj.effective_grant = message.effectiveGrant ? EffectiveGrant.toAmino(message.effectiveGrant) : undefined; + return obj; + }, + fromAminoMsg(object: QueryActiveStakeGrantResponseAminoMsg): QueryActiveStakeGrantResponse { + return QueryActiveStakeGrantResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActiveStakeGrantResponseProtoMsg): QueryActiveStakeGrantResponse { + return QueryActiveStakeGrantResponse.decode(message.value); + }, + toProto(message: QueryActiveStakeGrantResponse): Uint8Array { + return QueryActiveStakeGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryActiveStakeGrantResponse): QueryActiveStakeGrantResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryActiveStakeGrantResponse", + value: QueryActiveStakeGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryActiveStakeGrantResponse.typeUrl, QueryActiveStakeGrantResponse); +function createBaseQueryGrantAuthorizationRequest(): QueryGrantAuthorizationRequest { + return { + granter: "", + grantee: "" + }; +} +export const QueryGrantAuthorizationRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest", + is(o: any): o is QueryGrantAuthorizationRequest { + return o && (o.$typeUrl === QueryGrantAuthorizationRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationRequestAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + encode(message: QueryGrantAuthorizationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationRequest(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationRequest { + const message = createBaseQueryGrantAuthorizationRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationRequestAmino): QueryGrantAuthorizationRequest { + const message = createBaseQueryGrantAuthorizationRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationRequest): QueryGrantAuthorizationRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationRequestAminoMsg): QueryGrantAuthorizationRequest { + return QueryGrantAuthorizationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationRequestProtoMsg): QueryGrantAuthorizationRequest { + return QueryGrantAuthorizationRequest.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationRequest): Uint8Array { + return QueryGrantAuthorizationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationRequest): QueryGrantAuthorizationRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationRequest", + value: QueryGrantAuthorizationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationRequest.typeUrl, QueryGrantAuthorizationRequest); +function createBaseQueryGrantAuthorizationResponse(): QueryGrantAuthorizationResponse { + return { + amount: "" + }; +} +export const QueryGrantAuthorizationResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse", + is(o: any): o is QueryGrantAuthorizationResponse { + return o && (o.$typeUrl === QueryGrantAuthorizationResponse.typeUrl || typeof o.amount === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationResponseAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationResponse.typeUrl || typeof o.amount === "string"); + }, + encode(message: QueryGrantAuthorizationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== "") { + writer.uint32(10).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationResponse { + const message = createBaseQueryGrantAuthorizationResponse(); + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationResponseAmino): QueryGrantAuthorizationResponse { + const message = createBaseQueryGrantAuthorizationResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationResponse): QueryGrantAuthorizationResponseAmino { + const obj: any = {}; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationResponseAminoMsg): QueryGrantAuthorizationResponse { + return QueryGrantAuthorizationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationResponseProtoMsg): QueryGrantAuthorizationResponse { + return QueryGrantAuthorizationResponse.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationResponse): Uint8Array { + return QueryGrantAuthorizationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationResponse): QueryGrantAuthorizationResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationResponse", + value: QueryGrantAuthorizationResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationResponse.typeUrl, QueryGrantAuthorizationResponse); +function createBaseQueryGrantAuthorizationsRequest(): QueryGrantAuthorizationsRequest { + return { + granter: "" + }; +} +export const QueryGrantAuthorizationsRequest = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest", + is(o: any): o is QueryGrantAuthorizationsRequest { + return o && (o.$typeUrl === QueryGrantAuthorizationsRequest.typeUrl || typeof o.granter === "string"); + }, + isAmino(o: any): o is QueryGrantAuthorizationsRequestAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationsRequest.typeUrl || typeof o.granter === "string"); + }, + encode(message: QueryGrantAuthorizationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationsRequest { + const message = createBaseQueryGrantAuthorizationsRequest(); + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: QueryGrantAuthorizationsRequestAmino): QueryGrantAuthorizationsRequest { + const message = createBaseQueryGrantAuthorizationsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: QueryGrantAuthorizationsRequest): QueryGrantAuthorizationsRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationsRequestAminoMsg): QueryGrantAuthorizationsRequest { + return QueryGrantAuthorizationsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationsRequestProtoMsg): QueryGrantAuthorizationsRequest { + return QueryGrantAuthorizationsRequest.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationsRequest): Uint8Array { + return QueryGrantAuthorizationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationsRequest): QueryGrantAuthorizationsRequestProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsRequest", + value: QueryGrantAuthorizationsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationsRequest.typeUrl, QueryGrantAuthorizationsRequest); +function createBaseQueryGrantAuthorizationsResponse(): QueryGrantAuthorizationsResponse { + return { + totalGrantAmount: "", + grants: [] + }; +} +export const QueryGrantAuthorizationsResponse = { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse", + is(o: any): o is QueryGrantAuthorizationsResponse { + return o && (o.$typeUrl === QueryGrantAuthorizationsResponse.typeUrl || typeof o.totalGrantAmount === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is QueryGrantAuthorizationsResponseAmino { + return o && (o.$typeUrl === QueryGrantAuthorizationsResponse.typeUrl || typeof o.total_grant_amount === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: QueryGrantAuthorizationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalGrantAmount !== "") { + writer.uint32(10).string(message.totalGrantAmount); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantAuthorizationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantAuthorizationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalGrantAmount = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryGrantAuthorizationsResponse { + const message = createBaseQueryGrantAuthorizationsResponse(); + message.totalGrantAmount = object.totalGrantAmount ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryGrantAuthorizationsResponseAmino): QueryGrantAuthorizationsResponse { + const message = createBaseQueryGrantAuthorizationsResponse(); + if (object.total_grant_amount !== undefined && object.total_grant_amount !== null) { + message.totalGrantAmount = object.total_grant_amount; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryGrantAuthorizationsResponse): QueryGrantAuthorizationsResponseAmino { + const obj: any = {}; + obj.total_grant_amount = message.totalGrantAmount === "" ? undefined : message.totalGrantAmount; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: QueryGrantAuthorizationsResponseAminoMsg): QueryGrantAuthorizationsResponse { + return QueryGrantAuthorizationsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGrantAuthorizationsResponseProtoMsg): QueryGrantAuthorizationsResponse { + return QueryGrantAuthorizationsResponse.decode(message.value); + }, + toProto(message: QueryGrantAuthorizationsResponse): Uint8Array { + return QueryGrantAuthorizationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantAuthorizationsResponse): QueryGrantAuthorizationsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.QueryGrantAuthorizationsResponse", + value: QueryGrantAuthorizationsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGrantAuthorizationsResponse.typeUrl, QueryGrantAuthorizationsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/exchange/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..aefb5bab --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/tx.rpc.func.ts @@ -0,0 +1,213 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgDeposit, MsgWithdraw, MsgInstantSpotMarketLaunch, MsgInstantPerpetualMarketLaunch, MsgInstantExpiryFuturesMarketLaunch, MsgCreateSpotLimitOrder, MsgBatchCreateSpotLimitOrders, MsgCreateSpotMarketOrder, MsgCancelSpotOrder, MsgBatchCancelSpotOrders, MsgBatchUpdateOrders, MsgPrivilegedExecuteContract, MsgCreateDerivativeLimitOrder, MsgBatchCreateDerivativeLimitOrders, MsgCreateDerivativeMarketOrder, MsgCancelDerivativeOrder, MsgBatchCancelDerivativeOrders, MsgInstantBinaryOptionsMarketLaunch, MsgCreateBinaryOptionsLimitOrder, MsgCreateBinaryOptionsMarketOrder, MsgCancelBinaryOptionsOrder, MsgBatchCancelBinaryOptionsOrders, MsgSubaccountTransfer, MsgExternalTransfer, MsgLiquidatePosition, MsgEmergencySettleMarket, MsgIncreasePositionMargin, MsgDecreasePositionMargin, MsgRewardsOptOut, MsgAdminUpdateBinaryOptionsMarket, MsgUpdateParams, MsgUpdateSpotMarket, MsgUpdateDerivativeMarket, MsgAuthorizeStakeGrants, MsgActivateStakeGrant } from "./tx"; +export const createDeposit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeposit.typeUrl, + encoders: toEncoders(MsgDeposit), + converters: toConverters(MsgDeposit) +}); +export const createWithdraw = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdraw.typeUrl, + encoders: toEncoders(MsgWithdraw), + converters: toConverters(MsgWithdraw) +}); +export const createInstantSpotMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantSpotMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantSpotMarketLaunch), + converters: toConverters(MsgInstantSpotMarketLaunch) +}); +export const createInstantPerpetualMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantPerpetualMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantPerpetualMarketLaunch), + converters: toConverters(MsgInstantPerpetualMarketLaunch) +}); +export const createInstantExpiryFuturesMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantExpiryFuturesMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantExpiryFuturesMarketLaunch), + converters: toConverters(MsgInstantExpiryFuturesMarketLaunch) +}); +export const createCreateSpotLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotLimitOrder), + converters: toConverters(MsgCreateSpotLimitOrder) +}); +export const createBatchCreateSpotLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateSpotLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateSpotLimitOrders), + converters: toConverters(MsgBatchCreateSpotLimitOrders) +}); +export const createCreateSpotMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateSpotMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateSpotMarketOrder), + converters: toConverters(MsgCreateSpotMarketOrder) +}); +export const createCancelSpotOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSpotOrder.typeUrl, + encoders: toEncoders(MsgCancelSpotOrder), + converters: toConverters(MsgCancelSpotOrder) +}); +export const createBatchCancelSpotOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelSpotOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelSpotOrders), + converters: toConverters(MsgBatchCancelSpotOrders) +}); +export const createBatchUpdateOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchUpdateOrders.typeUrl, + encoders: toEncoders(MsgBatchUpdateOrders), + converters: toConverters(MsgBatchUpdateOrders) +}); +export const createPrivilegedExecuteContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgPrivilegedExecuteContract.typeUrl, + encoders: toEncoders(MsgPrivilegedExecuteContract), + converters: toConverters(MsgPrivilegedExecuteContract) +}); +export const createCreateDerivativeLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeLimitOrder), + converters: toConverters(MsgCreateDerivativeLimitOrder) +}); +export const createBatchCreateDerivativeLimitOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCreateDerivativeLimitOrders.typeUrl, + encoders: toEncoders(MsgBatchCreateDerivativeLimitOrders), + converters: toConverters(MsgBatchCreateDerivativeLimitOrders) +}); +export const createCreateDerivativeMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDerivativeMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateDerivativeMarketOrder), + converters: toConverters(MsgCreateDerivativeMarketOrder) +}); +export const createCancelDerivativeOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelDerivativeOrder.typeUrl, + encoders: toEncoders(MsgCancelDerivativeOrder), + converters: toConverters(MsgCancelDerivativeOrder) +}); +export const createBatchCancelDerivativeOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelDerivativeOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelDerivativeOrders), + converters: toConverters(MsgBatchCancelDerivativeOrders) +}); +export const createInstantBinaryOptionsMarketLaunch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgInstantBinaryOptionsMarketLaunch.typeUrl, + encoders: toEncoders(MsgInstantBinaryOptionsMarketLaunch), + converters: toConverters(MsgInstantBinaryOptionsMarketLaunch) +}); +export const createCreateBinaryOptionsLimitOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsLimitOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsLimitOrder), + converters: toConverters(MsgCreateBinaryOptionsLimitOrder) +}); +export const createCreateBinaryOptionsMarketOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateBinaryOptionsMarketOrder.typeUrl, + encoders: toEncoders(MsgCreateBinaryOptionsMarketOrder), + converters: toConverters(MsgCreateBinaryOptionsMarketOrder) +}); +export const createCancelBinaryOptionsOrder = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelBinaryOptionsOrder.typeUrl, + encoders: toEncoders(MsgCancelBinaryOptionsOrder), + converters: toConverters(MsgCancelBinaryOptionsOrder) +}); +export const createBatchCancelBinaryOptionsOrders = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBatchCancelBinaryOptionsOrders.typeUrl, + encoders: toEncoders(MsgBatchCancelBinaryOptionsOrders), + converters: toConverters(MsgBatchCancelBinaryOptionsOrders) +}); +export const createSubaccountTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubaccountTransfer.typeUrl, + encoders: toEncoders(MsgSubaccountTransfer), + converters: toConverters(MsgSubaccountTransfer) +}); +export const createExternalTransfer = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExternalTransfer.typeUrl, + encoders: toEncoders(MsgExternalTransfer), + converters: toConverters(MsgExternalTransfer) +}); +export const createLiquidatePosition = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgLiquidatePosition.typeUrl, + encoders: toEncoders(MsgLiquidatePosition), + converters: toConverters(MsgLiquidatePosition) +}); +export const createEmergencySettleMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgEmergencySettleMarket.typeUrl, + encoders: toEncoders(MsgEmergencySettleMarket), + converters: toConverters(MsgEmergencySettleMarket) +}); +export const createIncreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgIncreasePositionMargin.typeUrl, + encoders: toEncoders(MsgIncreasePositionMargin), + converters: toConverters(MsgIncreasePositionMargin) +}); +export const createDecreasePositionMargin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDecreasePositionMargin.typeUrl, + encoders: toEncoders(MsgDecreasePositionMargin), + converters: toConverters(MsgDecreasePositionMargin) +}); +export const createRewardsOptOut = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRewardsOptOut.typeUrl, + encoders: toEncoders(MsgRewardsOptOut), + converters: toConverters(MsgRewardsOptOut) +}); +export const createAdminUpdateBinaryOptionsMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAdminUpdateBinaryOptionsMarket.typeUrl, + encoders: toEncoders(MsgAdminUpdateBinaryOptionsMarket), + converters: toConverters(MsgAdminUpdateBinaryOptionsMarket) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createUpdateSpotMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateSpotMarket.typeUrl, + encoders: toEncoders(MsgUpdateSpotMarket), + converters: toConverters(MsgUpdateSpotMarket) +}); +export const createUpdateDerivativeMarket = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateDerivativeMarket.typeUrl, + encoders: toEncoders(MsgUpdateDerivativeMarket), + converters: toConverters(MsgUpdateDerivativeMarket) +}); +export const createAuthorizeStakeGrants = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAuthorizeStakeGrants.typeUrl, + encoders: toEncoders(MsgAuthorizeStakeGrants), + converters: toConverters(MsgAuthorizeStakeGrants) +}); +export const createActivateStakeGrant = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateStakeGrant.typeUrl, + encoders: toEncoders(MsgActivateStakeGrant), + converters: toConverters(MsgActivateStakeGrant) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/exchange/v1beta1/tx.ts b/libs/injectivejs/src/injective/exchange/v1beta1/tx.ts new file mode 100644 index 00000000..5508578a --- /dev/null +++ b/libs/injectivejs/src/injective/exchange/v1beta1/tx.ts @@ -0,0 +1,9492 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { SpotOrder, SpotOrderAmino, DerivativeOrder, DerivativeOrderAmino, MarketStatus, GrantAuthorization, GrantAuthorizationAmino, PositionDelta, PositionDeltaAmino } from "./exchange"; +import { Params, ParamsAmino } from "../../../cosmos/distribution/v1beta1/distribution"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgUpdateSpotMarket { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + marketId: string; + /** (optional) updated ticker value */ + newTicker: string; + /** (optional) updated min price tick size value */ + newMinPriceTickSize: string; + /** (optional) updated min quantity tick size value */ + newMinQuantityTickSize: string; + /** (optional) updated min notional */ + newMinNotional: string; +} +export interface MsgUpdateSpotMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket"; + value: Uint8Array; +} +export interface MsgUpdateSpotMarketAmino { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + market_id: string; + /** (optional) updated ticker value */ + new_ticker: string; + /** (optional) updated min price tick size value */ + new_min_price_tick_size: string; + /** (optional) updated min quantity tick size value */ + new_min_quantity_tick_size: string; + /** (optional) updated min notional */ + new_min_notional: string; +} +export interface MsgUpdateSpotMarketAminoMsg { + type: "exchange/MsgUpdateSpotMarket"; + value: MsgUpdateSpotMarketAmino; +} +export interface MsgUpdateSpotMarketResponse {} +export interface MsgUpdateSpotMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse"; + value: Uint8Array; +} +export interface MsgUpdateSpotMarketResponseAmino {} +export interface MsgUpdateSpotMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse"; + value: MsgUpdateSpotMarketResponseAmino; +} +export interface MsgUpdateDerivativeMarket { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + marketId: string; + /** (optional) updated value for ticker */ + newTicker: string; + /** (optional) updated value for min_price_tick_size */ + newMinPriceTickSize: string; + /** (optional) updated value min_quantity_tick_size */ + newMinQuantityTickSize: string; + /** (optional) updated min notional */ + newMinNotional: string; + /** (optional) updated value for initial_margin_ratio */ + newInitialMarginRatio: string; + /** (optional) updated value for maintenance_margin_ratio */ + newMaintenanceMarginRatio: string; +} +export interface MsgUpdateDerivativeMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket"; + value: Uint8Array; +} +export interface MsgUpdateDerivativeMarketAmino { + /** current admin address of the associated market */ + admin: string; + /** id of the market to be updated */ + market_id: string; + /** (optional) updated value for ticker */ + new_ticker: string; + /** (optional) updated value for min_price_tick_size */ + new_min_price_tick_size: string; + /** (optional) updated value min_quantity_tick_size */ + new_min_quantity_tick_size: string; + /** (optional) updated min notional */ + new_min_notional: string; + /** (optional) updated value for initial_margin_ratio */ + new_initial_margin_ratio: string; + /** (optional) updated value for maintenance_margin_ratio */ + new_maintenance_margin_ratio: string; +} +export interface MsgUpdateDerivativeMarketAminoMsg { + type: "exchange/MsgUpdateDerivativeMarket"; + value: MsgUpdateDerivativeMarketAmino; +} +export interface MsgUpdateDerivativeMarketResponse {} +export interface MsgUpdateDerivativeMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse"; + value: Uint8Array; +} +export interface MsgUpdateDerivativeMarketResponseAmino {} +export interface MsgUpdateDerivativeMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse"; + value: MsgUpdateDerivativeMarketResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the exchange parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the exchange parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "exchange/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgDeposit defines a SDK message for transferring coins from the sender's + * bank balance into the subaccount's exchange deposits + */ +export interface MsgDeposit { + sender: string; + /** + * (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin + * will be deposited to the sender's default subaccount address. + */ + subaccountId: string; + amount: Coin; +} +export interface MsgDepositProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDeposit"; + value: Uint8Array; +} +/** + * MsgDeposit defines a SDK message for transferring coins from the sender's + * bank balance into the subaccount's exchange deposits + */ +export interface MsgDepositAmino { + sender: string; + /** + * (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin + * will be deposited to the sender's default subaccount address. + */ + subaccount_id: string; + amount: CoinAmino; +} +export interface MsgDepositAminoMsg { + type: "exchange/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** + * MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's + * deposits to the user's bank balance + */ +export interface MsgWithdraw { + sender: string; + /** bytes32 subaccount ID to withdraw funds from */ + subaccountId: string; + amount: Coin; +} +export interface MsgWithdrawProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw"; + value: Uint8Array; +} +/** + * MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's + * deposits to the user's bank balance + */ +export interface MsgWithdrawAmino { + sender: string; + /** bytes32 subaccount ID to withdraw funds from */ + subaccount_id: string; + amount: CoinAmino; +} +export interface MsgWithdrawAminoMsg { + type: "exchange/MsgWithdraw"; + value: MsgWithdrawAmino; +} +/** MsgWithdraw defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponse {} +export interface MsgWithdrawResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse"; + value: Uint8Array; +} +/** MsgWithdraw defines the Msg/Withdraw response type. */ +export interface MsgWithdrawResponseAmino {} +export interface MsgWithdrawResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgWithdrawResponse"; + value: MsgWithdrawResponseAmino; +} +/** + * MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit + * order. + */ +export interface MsgCreateSpotLimitOrder { + sender: string; + order: SpotOrder; +} +export interface MsgCreateSpotLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder"; + value: Uint8Array; +} +/** + * MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit + * order. + */ +export interface MsgCreateSpotLimitOrderAmino { + sender: string; + order: SpotOrderAmino; +} +export interface MsgCreateSpotLimitOrderAminoMsg { + type: "exchange/MsgCreateSpotLimitOrder"; + value: MsgCreateSpotLimitOrderAmino; +} +/** + * MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response + * type. + */ +export interface MsgCreateSpotLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateSpotLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response + * type. + */ +export interface MsgCreateSpotLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateSpotLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse"; + value: MsgCreateSpotLimitOrderResponseAmino; +} +/** + * MsgBatchCreateSpotLimitOrders defines a SDK message for creating a new batch + * of spot limit orders. + */ +export interface MsgBatchCreateSpotLimitOrders { + sender: string; + orders: SpotOrder[]; +} +export interface MsgBatchCreateSpotLimitOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders"; + value: Uint8Array; +} +/** + * MsgBatchCreateSpotLimitOrders defines a SDK message for creating a new batch + * of spot limit orders. + */ +export interface MsgBatchCreateSpotLimitOrdersAmino { + sender: string; + orders: SpotOrderAmino[]; +} +export interface MsgBatchCreateSpotLimitOrdersAminoMsg { + type: "exchange/MsgBatchCreateSpotLimitOrders"; + value: MsgBatchCreateSpotLimitOrdersAmino; +} +/** + * MsgBatchCreateSpotLimitOrdersResponse defines the + * Msg/BatchCreateSpotLimitOrders response type. + */ +export interface MsgBatchCreateSpotLimitOrdersResponse { + orderHashes: string[]; + createdOrdersCids: string[]; + failedOrdersCids: string[]; +} +export interface MsgBatchCreateSpotLimitOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCreateSpotLimitOrdersResponse defines the + * Msg/BatchCreateSpotLimitOrders response type. + */ +export interface MsgBatchCreateSpotLimitOrdersResponseAmino { + order_hashes: string[]; + created_orders_cids: string[]; + failed_orders_cids: string[]; +} +export interface MsgBatchCreateSpotLimitOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse"; + value: MsgBatchCreateSpotLimitOrdersResponseAmino; +} +/** + * MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot + * market by paying listing fee without governance + */ +export interface MsgInstantSpotMarketLaunch { + sender: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + baseDenom: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantSpotMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot + * market by paying listing fee without governance + */ +export interface MsgInstantSpotMarketLaunchAmino { + sender: string; + /** Ticker for the spot market. */ + ticker: string; + /** type of coin to use as the base currency */ + base_denom: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** min_price_tick_size defines the minimum tick size of the order's price */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantSpotMarketLaunchAminoMsg { + type: "exchange/MsgInstantSpotMarketLaunch"; + value: MsgInstantSpotMarketLaunchAmino; +} +/** + * MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch + * response type. + */ +export interface MsgInstantSpotMarketLaunchResponse {} +export interface MsgInstantSpotMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch + * response type. + */ +export interface MsgInstantSpotMarketLaunchResponseAmino {} +export interface MsgInstantSpotMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse"; + value: MsgInstantSpotMarketLaunchResponseAmino; +} +/** + * MsgInstantPerpetualMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantPerpetualMarketLaunch { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Oracle type */ + oracleType: OracleType; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + takerFeeRate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the perpetual + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * perpetual market + */ + maintenanceMarginRatio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantPerpetualMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantPerpetualMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantPerpetualMarketLaunchAmino { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the base currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Oracle type */ + oracle_type: OracleType; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + taker_fee_rate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the perpetual + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * perpetual market + */ + maintenance_margin_ratio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantPerpetualMarketLaunchAminoMsg { + type: "exchange/MsgInstantPerpetualMarketLaunch"; + value: MsgInstantPerpetualMarketLaunchAmino; +} +/** + * MsgInstantPerpetualMarketLaunchResponse defines the + * Msg/InstantPerpetualMarketLaunchResponse response type. + */ +export interface MsgInstantPerpetualMarketLaunchResponse {} +export interface MsgInstantPerpetualMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantPerpetualMarketLaunchResponse defines the + * Msg/InstantPerpetualMarketLaunchResponse response type. + */ +export interface MsgInstantPerpetualMarketLaunchResponseAmino {} +export interface MsgInstantPerpetualMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse"; + value: MsgInstantPerpetualMarketLaunchResponseAmino; +} +/** + * MsgInstantBinaryOptionsMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantBinaryOptionsMarketLaunch { + sender: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracleSymbol: string; + /** Oracle Provider */ + oracleProvider: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + takerFeeRate: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quoteDenom: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantBinaryOptionsMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantBinaryOptionsMarketLaunch defines a SDK message for creating a new + * perpetual futures market by paying listing fee without governance + */ +export interface MsgInstantBinaryOptionsMarketLaunchAmino { + sender: string; + /** Ticker for the derivative contract. */ + ticker: string; + /** Oracle symbol */ + oracle_symbol: string; + /** Oracle Provider */ + oracle_provider: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** + * maker_fee_rate defines the trade fee rate for makers on the perpetual + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the perpetual + * market + */ + taker_fee_rate: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** admin of the market */ + admin: string; + /** Address of the quote currency denomination for the binary options contract */ + quote_denom: string; + /** + * min_price_tick_size defines the minimum tick size that the price and margin + * required for orders in the market + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the quantity + * required for orders in the market + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantBinaryOptionsMarketLaunchAminoMsg { + type: "exchange/MsgInstantBinaryOptionsMarketLaunch"; + value: MsgInstantBinaryOptionsMarketLaunchAmino; +} +/** + * MsgInstantBinaryOptionsMarketLaunchResponse defines the + * Msg/InstantBinaryOptionsMarketLaunchResponse response type. + */ +export interface MsgInstantBinaryOptionsMarketLaunchResponse {} +export interface MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantBinaryOptionsMarketLaunchResponse defines the + * Msg/InstantBinaryOptionsMarketLaunchResponse response type. + */ +export interface MsgInstantBinaryOptionsMarketLaunchResponseAmino {} +export interface MsgInstantBinaryOptionsMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse"; + value: MsgInstantBinaryOptionsMarketLaunchResponseAmino; +} +/** + * MsgInstantExpiryFuturesMarketLaunch defines a SDK message for creating a new + * expiry futures market by paying listing fee without governance + */ +export interface MsgInstantExpiryFuturesMarketLaunch { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quoteDenom: string; + /** Oracle base currency */ + oracleBase: string; + /** Oracle quote currency */ + oracleQuote: string; + /** Oracle type */ + oracleType: OracleType; + /** Scale factor for oracle prices. */ + oracleScaleFactor: number; + /** Expiration time of the market */ + expiry: bigint; + /** + * maker_fee_rate defines the trade fee rate for makers on the expiry futures + * market + */ + makerFeeRate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the expiry futures + * market + */ + takerFeeRate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initialMarginRatio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenanceMarginRatio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + minPriceTickSize: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + minQuantityTickSize: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + minNotional: string; +} +export interface MsgInstantExpiryFuturesMarketLaunchProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch"; + value: Uint8Array; +} +/** + * MsgInstantExpiryFuturesMarketLaunch defines a SDK message for creating a new + * expiry futures market by paying listing fee without governance + */ +export interface MsgInstantExpiryFuturesMarketLaunchAmino { + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** type of coin to use as the quote currency */ + quote_denom: string; + /** Oracle base currency */ + oracle_base: string; + /** Oracle quote currency */ + oracle_quote: string; + /** Oracle type */ + oracle_type: OracleType; + /** Scale factor for oracle prices. */ + oracle_scale_factor: number; + /** Expiration time of the market */ + expiry: string; + /** + * maker_fee_rate defines the trade fee rate for makers on the expiry futures + * market + */ + maker_fee_rate: string; + /** + * taker_fee_rate defines the trade fee rate for takers on the expiry futures + * market + */ + taker_fee_rate: string; + /** + * initial_margin_ratio defines the initial margin ratio for the derivative + * market + */ + initial_margin_ratio: string; + /** + * maintenance_margin_ratio defines the maintenance margin ratio for the + * derivative market + */ + maintenance_margin_ratio: string; + /** + * min_price_tick_size defines the minimum tick size of the order's price and + * margin + */ + min_price_tick_size: string; + /** + * min_quantity_tick_size defines the minimum tick size of the order's + * quantity + */ + min_quantity_tick_size: string; + /** + * min_notional defines the minimum notional (in quote asset) required for + * orders in the market + */ + min_notional: string; +} +export interface MsgInstantExpiryFuturesMarketLaunchAminoMsg { + type: "exchange/MsgInstantExpiryFuturesMarketLaunch"; + value: MsgInstantExpiryFuturesMarketLaunchAmino; +} +/** + * MsgInstantExpiryFuturesMarketLaunchResponse defines the + * Msg/InstantExpiryFuturesMarketLaunch response type. + */ +export interface MsgInstantExpiryFuturesMarketLaunchResponse {} +export interface MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse"; + value: Uint8Array; +} +/** + * MsgInstantExpiryFuturesMarketLaunchResponse defines the + * Msg/InstantExpiryFuturesMarketLaunch response type. + */ +export interface MsgInstantExpiryFuturesMarketLaunchResponseAmino {} +export interface MsgInstantExpiryFuturesMarketLaunchResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse"; + value: MsgInstantExpiryFuturesMarketLaunchResponseAmino; +} +/** + * MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market + * order. + */ +export interface MsgCreateSpotMarketOrder { + sender: string; + order: SpotOrder; +} +export interface MsgCreateSpotMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder"; + value: Uint8Array; +} +/** + * MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market + * order. + */ +export interface MsgCreateSpotMarketOrderAmino { + sender: string; + order: SpotOrderAmino; +} +export interface MsgCreateSpotMarketOrderAminoMsg { + type: "exchange/MsgCreateSpotMarketOrder"; + value: MsgCreateSpotMarketOrderAmino; +} +/** + * MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder + * response type. + */ +export interface MsgCreateSpotMarketOrderResponse { + orderHash: string; + results?: SpotMarketOrderResults; + cid: string; +} +export interface MsgCreateSpotMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder + * response type. + */ +export interface MsgCreateSpotMarketOrderResponseAmino { + order_hash: string; + results?: SpotMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateSpotMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse"; + value: MsgCreateSpotMarketOrderResponseAmino; +} +export interface SpotMarketOrderResults { + quantity: string; + price: string; + fee: string; +} +export interface SpotMarketOrderResultsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults"; + value: Uint8Array; +} +export interface SpotMarketOrderResultsAmino { + quantity: string; + price: string; + fee: string; +} +export interface SpotMarketOrderResultsAminoMsg { + type: "/injective.exchange.v1beta1.SpotMarketOrderResults"; + value: SpotMarketOrderResultsAmino; +} +/** A Cosmos-SDK MsgCreateDerivativeLimitOrder */ +export interface MsgCreateDerivativeLimitOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateDerivativeLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateDerivativeLimitOrder */ +export interface MsgCreateDerivativeLimitOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateDerivativeLimitOrderAminoMsg { + type: "exchange/MsgCreateDerivativeLimitOrder"; + value: MsgCreateDerivativeLimitOrderAmino; +} +/** + * MsgCreateDerivativeLimitOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateDerivativeLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateDerivativeLimitOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateDerivativeLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse"; + value: MsgCreateDerivativeLimitOrderResponseAmino; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsLimitOrder */ +export interface MsgCreateBinaryOptionsLimitOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateBinaryOptionsLimitOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsLimitOrder */ +export interface MsgCreateBinaryOptionsLimitOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateBinaryOptionsLimitOrderAminoMsg { + type: "exchange/MsgCreateBinaryOptionsLimitOrder"; + value: MsgCreateBinaryOptionsLimitOrderAmino; +} +/** + * MsgCreateBinaryOptionsLimitOrderResponse defines the + * Msg/CreateBinaryOptionsLimitOrder response type. + */ +export interface MsgCreateBinaryOptionsLimitOrderResponse { + orderHash: string; + cid: string; +} +export interface MsgCreateBinaryOptionsLimitOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateBinaryOptionsLimitOrderResponse defines the + * Msg/CreateBinaryOptionsLimitOrder response type. + */ +export interface MsgCreateBinaryOptionsLimitOrderResponseAmino { + order_hash: string; + cid: string; +} +export interface MsgCreateBinaryOptionsLimitOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse"; + value: MsgCreateBinaryOptionsLimitOrderResponseAmino; +} +/** A Cosmos-SDK MsgBatchCreateDerivativeLimitOrders */ +export interface MsgBatchCreateDerivativeLimitOrders { + sender: string; + orders: DerivativeOrder[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgBatchCreateDerivativeLimitOrders */ +export interface MsgBatchCreateDerivativeLimitOrdersAmino { + sender: string; + orders: DerivativeOrderAmino[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersAminoMsg { + type: "exchange/MsgBatchCreateDerivativeLimitOrders"; + value: MsgBatchCreateDerivativeLimitOrdersAmino; +} +/** + * MsgBatchCreateDerivativeLimitOrdersResponse defines the + * Msg/BatchCreateDerivativeLimitOrders response type. + */ +export interface MsgBatchCreateDerivativeLimitOrdersResponse { + orderHashes: string[]; + createdOrdersCids: string[]; + failedOrdersCids: string[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCreateDerivativeLimitOrdersResponse defines the + * Msg/BatchCreateDerivativeLimitOrders response type. + */ +export interface MsgBatchCreateDerivativeLimitOrdersResponseAmino { + order_hashes: string[]; + created_orders_cids: string[]; + failed_orders_cids: string[]; +} +export interface MsgBatchCreateDerivativeLimitOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse"; + value: MsgBatchCreateDerivativeLimitOrdersResponseAmino; +} +/** MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + cid: string; +} +export interface MsgCancelSpotOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder"; + value: Uint8Array; +} +/** MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + cid: string; +} +export interface MsgCancelSpotOrderAminoMsg { + type: "exchange/MsgCancelSpotOrder"; + value: MsgCancelSpotOrderAmino; +} +/** MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderResponse {} +export interface MsgCancelSpotOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse"; + value: Uint8Array; +} +/** MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. */ +export interface MsgCancelSpotOrderResponseAmino {} +export interface MsgCancelSpotOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse"; + value: MsgCancelSpotOrderResponseAmino; +} +/** MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type. */ +export interface MsgBatchCancelSpotOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelSpotOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders"; + value: Uint8Array; +} +/** MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type. */ +export interface MsgBatchCancelSpotOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelSpotOrdersAminoMsg { + type: "exchange/MsgBatchCancelSpotOrders"; + value: MsgBatchCancelSpotOrdersAmino; +} +/** + * MsgBatchCancelSpotOrdersResponse defines the Msg/BatchCancelSpotOrders + * response type. + */ +export interface MsgBatchCancelSpotOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelSpotOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCancelSpotOrdersResponse defines the Msg/BatchCancelSpotOrders + * response type. + */ +export interface MsgBatchCancelSpotOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelSpotOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse"; + value: MsgBatchCancelSpotOrdersResponseAmino; +} +/** + * MsgBatchCancelBinaryOptionsOrders defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders"; + value: Uint8Array; +} +/** + * MsgBatchCancelBinaryOptionsOrders defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersAminoMsg { + type: "exchange/MsgBatchCancelBinaryOptionsOrders"; + value: MsgBatchCancelBinaryOptionsOrdersAmino; +} +/** + * BatchCancelBinaryOptionsOrdersResponse defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse"; + value: Uint8Array; +} +/** + * BatchCancelBinaryOptionsOrdersResponse defines the + * Msg/BatchCancelBinaryOptionsOrders response type. + */ +export interface MsgBatchCancelBinaryOptionsOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelBinaryOptionsOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse"; + value: MsgBatchCancelBinaryOptionsOrdersResponseAmino; +} +/** MsgBatchUpdateOrders defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrders { + sender: string; + /** + * subaccount_id only used for the spot_market_ids_to_cancel_all and + * derivative_market_ids_to_cancel_all. + */ + subaccountId: string; + spotMarketIdsToCancelAll: string[]; + derivativeMarketIdsToCancelAll: string[]; + spotOrdersToCancel?: OrderData[]; + derivativeOrdersToCancel?: OrderData[]; + spotOrdersToCreate?: SpotOrder[]; + derivativeOrdersToCreate?: DerivativeOrder[]; + binaryOptionsOrdersToCancel?: OrderData[]; + binaryOptionsMarketIdsToCancelAll: string[]; + binaryOptionsOrdersToCreate?: DerivativeOrder[]; +} +export interface MsgBatchUpdateOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders"; + value: Uint8Array; +} +/** MsgBatchUpdateOrders defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersAmino { + sender: string; + /** + * subaccount_id only used for the spot_market_ids_to_cancel_all and + * derivative_market_ids_to_cancel_all. + */ + subaccount_id: string; + spot_market_ids_to_cancel_all: string[]; + derivative_market_ids_to_cancel_all: string[]; + spot_orders_to_cancel?: OrderDataAmino[]; + derivative_orders_to_cancel?: OrderDataAmino[]; + spot_orders_to_create?: SpotOrderAmino[]; + derivative_orders_to_create?: DerivativeOrderAmino[]; + binary_options_orders_to_cancel?: OrderDataAmino[]; + binary_options_market_ids_to_cancel_all: string[]; + binary_options_orders_to_create?: DerivativeOrderAmino[]; +} +export interface MsgBatchUpdateOrdersAminoMsg { + type: "exchange/MsgBatchUpdateOrders"; + value: MsgBatchUpdateOrdersAmino; +} +/** MsgBatchUpdateOrdersResponse defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersResponse { + spotCancelSuccess: boolean[]; + derivativeCancelSuccess: boolean[]; + spotOrderHashes: string[]; + derivativeOrderHashes: string[]; + binaryOptionsCancelSuccess: boolean[]; + binaryOptionsOrderHashes: string[]; + createdSpotOrdersCids: string[]; + failedSpotOrdersCids: string[]; + createdDerivativeOrdersCids: string[]; + failedDerivativeOrdersCids: string[]; + createdBinaryOptionsOrdersCids: string[]; + failedBinaryOptionsOrdersCids: string[]; +} +export interface MsgBatchUpdateOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse"; + value: Uint8Array; +} +/** MsgBatchUpdateOrdersResponse defines the Msg/BatchUpdateOrders response type. */ +export interface MsgBatchUpdateOrdersResponseAmino { + spot_cancel_success: boolean[]; + derivative_cancel_success: boolean[]; + spot_order_hashes: string[]; + derivative_order_hashes: string[]; + binary_options_cancel_success: boolean[]; + binary_options_order_hashes: string[]; + created_spot_orders_cids: string[]; + failed_spot_orders_cids: string[]; + created_derivative_orders_cids: string[]; + failed_derivative_orders_cids: string[]; + created_binary_options_orders_cids: string[]; + failed_binary_options_orders_cids: string[]; +} +export interface MsgBatchUpdateOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse"; + value: MsgBatchUpdateOrdersResponseAmino; +} +/** A Cosmos-SDK MsgCreateDerivativeMarketOrder */ +export interface MsgCreateDerivativeMarketOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateDerivativeMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateDerivativeMarketOrder */ +export interface MsgCreateDerivativeMarketOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateDerivativeMarketOrderAminoMsg { + type: "exchange/MsgCreateDerivativeMarketOrder"; + value: MsgCreateDerivativeMarketOrderAmino; +} +/** + * MsgCreateDerivativeMarketOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeMarketOrderResponse { + orderHash: string; + results?: DerivativeMarketOrderResults; + cid: string; +} +export interface MsgCreateDerivativeMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateDerivativeMarketOrderResponse defines the + * Msg/CreateDerivativeMarketOrder response type. + */ +export interface MsgCreateDerivativeMarketOrderResponseAmino { + order_hash: string; + results?: DerivativeMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateDerivativeMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse"; + value: MsgCreateDerivativeMarketOrderResponseAmino; +} +export interface DerivativeMarketOrderResults { + quantity: string; + price: string; + fee: string; + positionDelta: PositionDelta; + payout: string; +} +export interface DerivativeMarketOrderResultsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults"; + value: Uint8Array; +} +export interface DerivativeMarketOrderResultsAmino { + quantity: string; + price: string; + fee: string; + position_delta: PositionDeltaAmino; + payout: string; +} +export interface DerivativeMarketOrderResultsAminoMsg { + type: "/injective.exchange.v1beta1.DerivativeMarketOrderResults"; + value: DerivativeMarketOrderResultsAmino; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsMarketOrder */ +export interface MsgCreateBinaryOptionsMarketOrder { + sender: string; + order: DerivativeOrder; +} +export interface MsgCreateBinaryOptionsMarketOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgCreateBinaryOptionsMarketOrder */ +export interface MsgCreateBinaryOptionsMarketOrderAmino { + sender: string; + order: DerivativeOrderAmino; +} +export interface MsgCreateBinaryOptionsMarketOrderAminoMsg { + type: "exchange/MsgCreateBinaryOptionsMarketOrder"; + value: MsgCreateBinaryOptionsMarketOrderAmino; +} +/** + * MsgCreateBinaryOptionsMarketOrderResponse defines the + * Msg/CreateBinaryOptionsMarketOrder response type. + */ +export interface MsgCreateBinaryOptionsMarketOrderResponse { + orderHash: string; + results?: DerivativeMarketOrderResults; + cid: string; +} +export interface MsgCreateBinaryOptionsMarketOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse"; + value: Uint8Array; +} +/** + * MsgCreateBinaryOptionsMarketOrderResponse defines the + * Msg/CreateBinaryOptionsMarketOrder response type. + */ +export interface MsgCreateBinaryOptionsMarketOrderResponseAmino { + order_hash: string; + results?: DerivativeMarketOrderResultsAmino; + cid: string; +} +export interface MsgCreateBinaryOptionsMarketOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse"; + value: MsgCreateBinaryOptionsMarketOrderResponseAmino; +} +/** MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. */ +export interface MsgCancelDerivativeOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface MsgCancelDerivativeOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder"; + value: Uint8Array; +} +/** MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. */ +export interface MsgCancelDerivativeOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface MsgCancelDerivativeOrderAminoMsg { + type: "exchange/MsgCancelDerivativeOrder"; + value: MsgCancelDerivativeOrderAmino; +} +/** + * MsgCancelDerivativeOrderResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgCancelDerivativeOrderResponse {} +export interface MsgCancelDerivativeOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse"; + value: Uint8Array; +} +/** + * MsgCancelDerivativeOrderResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgCancelDerivativeOrderResponseAmino {} +export interface MsgCancelDerivativeOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse"; + value: MsgCancelDerivativeOrderResponseAmino; +} +/** + * MsgCancelBinaryOptionsOrder defines the Msg/CancelBinaryOptionsOrder response + * type. + */ +export interface MsgCancelBinaryOptionsOrder { + sender: string; + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface MsgCancelBinaryOptionsOrderProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder"; + value: Uint8Array; +} +/** + * MsgCancelBinaryOptionsOrder defines the Msg/CancelBinaryOptionsOrder response + * type. + */ +export interface MsgCancelBinaryOptionsOrderAmino { + sender: string; + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface MsgCancelBinaryOptionsOrderAminoMsg { + type: "exchange/MsgCancelBinaryOptionsOrder"; + value: MsgCancelBinaryOptionsOrderAmino; +} +/** + * MsgCancelBinaryOptionsOrderResponse defines the + * Msg/CancelBinaryOptionsOrderResponse response type. + */ +export interface MsgCancelBinaryOptionsOrderResponse {} +export interface MsgCancelBinaryOptionsOrderResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse"; + value: Uint8Array; +} +/** + * MsgCancelBinaryOptionsOrderResponse defines the + * Msg/CancelBinaryOptionsOrderResponse response type. + */ +export interface MsgCancelBinaryOptionsOrderResponseAmino {} +export interface MsgCancelBinaryOptionsOrderResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse"; + value: MsgCancelBinaryOptionsOrderResponseAmino; +} +export interface OrderData { + marketId: string; + subaccountId: string; + orderHash: string; + /** bitwise combination of OrderMask enum values */ + orderMask: number; + cid: string; +} +export interface OrderDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.OrderData"; + value: Uint8Array; +} +export interface OrderDataAmino { + market_id: string; + subaccount_id: string; + order_hash: string; + /** bitwise combination of OrderMask enum values */ + order_mask: number; + cid: string; +} +export interface OrderDataAminoMsg { + type: "/injective.exchange.v1beta1.OrderData"; + value: OrderDataAmino; +} +/** + * MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders + * response type. + */ +export interface MsgBatchCancelDerivativeOrders { + sender: string; + data: OrderData[]; +} +export interface MsgBatchCancelDerivativeOrdersProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders"; + value: Uint8Array; +} +/** + * MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders + * response type. + */ +export interface MsgBatchCancelDerivativeOrdersAmino { + sender: string; + data: OrderDataAmino[]; +} +export interface MsgBatchCancelDerivativeOrdersAminoMsg { + type: "exchange/MsgBatchCancelDerivativeOrders"; + value: MsgBatchCancelDerivativeOrdersAmino; +} +/** + * MsgBatchCancelDerivativeOrdersResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgBatchCancelDerivativeOrdersResponse { + success: boolean[]; +} +export interface MsgBatchCancelDerivativeOrdersResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse"; + value: Uint8Array; +} +/** + * MsgBatchCancelDerivativeOrdersResponse defines the + * Msg/CancelDerivativeOrderResponse response type. + */ +export interface MsgBatchCancelDerivativeOrdersResponseAmino { + success: boolean[]; +} +export interface MsgBatchCancelDerivativeOrdersResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse"; + value: MsgBatchCancelDerivativeOrdersResponseAmino; +} +/** A Cosmos-SDK MsgSubaccountTransfer */ +export interface MsgSubaccountTransfer { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + amount: Coin; +} +export interface MsgSubaccountTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgSubaccountTransfer */ +export interface MsgSubaccountTransferAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + amount: CoinAmino; +} +export interface MsgSubaccountTransferAminoMsg { + type: "exchange/MsgSubaccountTransfer"; + value: MsgSubaccountTransferAmino; +} +/** + * MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response + * type. + */ +export interface MsgSubaccountTransferResponse {} +export interface MsgSubaccountTransferResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse"; + value: Uint8Array; +} +/** + * MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response + * type. + */ +export interface MsgSubaccountTransferResponseAmino {} +export interface MsgSubaccountTransferResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse"; + value: MsgSubaccountTransferResponseAmino; +} +/** A Cosmos-SDK MsgExternalTransfer */ +export interface MsgExternalTransfer { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + amount: Coin; +} +export interface MsgExternalTransferProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgExternalTransfer */ +export interface MsgExternalTransferAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + amount: CoinAmino; +} +export interface MsgExternalTransferAminoMsg { + type: "exchange/MsgExternalTransfer"; + value: MsgExternalTransferAmino; +} +/** MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. */ +export interface MsgExternalTransferResponse {} +export interface MsgExternalTransferResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse"; + value: Uint8Array; +} +/** MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. */ +export interface MsgExternalTransferResponseAmino {} +export interface MsgExternalTransferResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgExternalTransferResponse"; + value: MsgExternalTransferResponseAmino; +} +/** A Cosmos-SDK MsgLiquidatePosition */ +export interface MsgLiquidatePosition { + sender: string; + subaccountId: string; + marketId: string; + /** optional order to provide for liquidation */ + order?: DerivativeOrder; +} +export interface MsgLiquidatePositionProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgLiquidatePosition */ +export interface MsgLiquidatePositionAmino { + sender: string; + subaccount_id: string; + market_id: string; + /** optional order to provide for liquidation */ + order?: DerivativeOrderAmino; +} +export interface MsgLiquidatePositionAminoMsg { + type: "exchange/MsgLiquidatePosition"; + value: MsgLiquidatePositionAmino; +} +/** MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. */ +export interface MsgLiquidatePositionResponse {} +export interface MsgLiquidatePositionResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse"; + value: Uint8Array; +} +/** MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. */ +export interface MsgLiquidatePositionResponseAmino {} +export interface MsgLiquidatePositionResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse"; + value: MsgLiquidatePositionResponseAmino; +} +/** A Cosmos-SDK MsgEmergencySettleMarket */ +export interface MsgEmergencySettleMarket { + sender: string; + subaccountId: string; + marketId: string; +} +export interface MsgEmergencySettleMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgEmergencySettleMarket */ +export interface MsgEmergencySettleMarketAmino { + sender: string; + subaccount_id: string; + market_id: string; +} +export interface MsgEmergencySettleMarketAminoMsg { + type: "exchange/MsgEmergencySettleMarket"; + value: MsgEmergencySettleMarketAmino; +} +/** + * MsgEmergencySettleMarketResponse defines the Msg/EmergencySettleMarket + * response type. + */ +export interface MsgEmergencySettleMarketResponse {} +export interface MsgEmergencySettleMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse"; + value: Uint8Array; +} +/** + * MsgEmergencySettleMarketResponse defines the Msg/EmergencySettleMarket + * response type. + */ +export interface MsgEmergencySettleMarketResponseAmino {} +export interface MsgEmergencySettleMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse"; + value: MsgEmergencySettleMarketResponseAmino; +} +/** A Cosmos-SDK MsgIncreasePositionMargin */ +export interface MsgIncreasePositionMargin { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + marketId: string; + /** amount defines the amount of margin to add to the position */ + amount: string; +} +export interface MsgIncreasePositionMarginProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgIncreasePositionMargin */ +export interface MsgIncreasePositionMarginAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + market_id: string; + /** amount defines the amount of margin to add to the position */ + amount: string; +} +export interface MsgIncreasePositionMarginAminoMsg { + type: "exchange/MsgIncreasePositionMargin"; + value: MsgIncreasePositionMarginAmino; +} +/** + * MsgIncreasePositionMarginResponse defines the Msg/IncreasePositionMargin + * response type. + */ +export interface MsgIncreasePositionMarginResponse {} +export interface MsgIncreasePositionMarginResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse"; + value: Uint8Array; +} +/** + * MsgIncreasePositionMarginResponse defines the Msg/IncreasePositionMargin + * response type. + */ +export interface MsgIncreasePositionMarginResponseAmino {} +export interface MsgIncreasePositionMarginResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse"; + value: MsgIncreasePositionMarginResponseAmino; +} +/** A Cosmos-SDK MsgDecreasePositionMargin */ +export interface MsgDecreasePositionMargin { + sender: string; + sourceSubaccountId: string; + destinationSubaccountId: string; + marketId: string; + /** amount defines the amount of margin to withdraw from the position */ + amount: string; +} +export interface MsgDecreasePositionMarginProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgDecreasePositionMargin */ +export interface MsgDecreasePositionMarginAmino { + sender: string; + source_subaccount_id: string; + destination_subaccount_id: string; + market_id: string; + /** amount defines the amount of margin to withdraw from the position */ + amount: string; +} +export interface MsgDecreasePositionMarginAminoMsg { + type: "exchange/MsgDecreasePositionMargin"; + value: MsgDecreasePositionMarginAmino; +} +/** + * MsgDecreasePositionMarginResponse defines the Msg/MsgDecreasePositionMargin + * response type. + */ +export interface MsgDecreasePositionMarginResponse {} +export interface MsgDecreasePositionMarginResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse"; + value: Uint8Array; +} +/** + * MsgDecreasePositionMarginResponse defines the Msg/MsgDecreasePositionMargin + * response type. + */ +export interface MsgDecreasePositionMarginResponseAmino {} +export interface MsgDecreasePositionMarginResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse"; + value: MsgDecreasePositionMarginResponseAmino; +} +/** MsgPrivilegedExecuteContract defines the Msg/Exec message type */ +export interface MsgPrivilegedExecuteContract { + sender: string; + /** + * funds defines the user's bank coins used to fund the execution (e.g. + * 100inj). + */ + funds: string; + /** contract_address defines the contract address to execute */ + contractAddress: string; + /** data defines the call data used when executing the contract */ + data: string; +} +export interface MsgPrivilegedExecuteContractProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract"; + value: Uint8Array; +} +/** MsgPrivilegedExecuteContract defines the Msg/Exec message type */ +export interface MsgPrivilegedExecuteContractAmino { + sender: string; + /** + * funds defines the user's bank coins used to fund the execution (e.g. + * 100inj). + */ + funds: string; + /** contract_address defines the contract address to execute */ + contract_address: string; + /** data defines the call data used when executing the contract */ + data: string; +} +export interface MsgPrivilegedExecuteContractAminoMsg { + type: "exchange/MsgPrivilegedExecuteContract"; + value: MsgPrivilegedExecuteContractAmino; +} +/** MsgPrivilegedExecuteContractResponse defines the Msg/Exec response type. */ +export interface MsgPrivilegedExecuteContractResponse { + fundsDiff: Coin[]; +} +export interface MsgPrivilegedExecuteContractResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse"; + value: Uint8Array; +} +/** MsgPrivilegedExecuteContractResponse defines the Msg/Exec response type. */ +export interface MsgPrivilegedExecuteContractResponseAmino { + funds_diff: CoinAmino[]; +} +export interface MsgPrivilegedExecuteContractResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse"; + value: MsgPrivilegedExecuteContractResponseAmino; +} +/** A Cosmos-SDK MsgRewardsOptOut */ +export interface MsgRewardsOptOut { + sender: string; +} +export interface MsgRewardsOptOutProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgRewardsOptOut */ +export interface MsgRewardsOptOutAmino { + sender: string; +} +export interface MsgRewardsOptOutAminoMsg { + type: "exchange/MsgRewardsOptOut"; + value: MsgRewardsOptOutAmino; +} +/** MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. */ +export interface MsgRewardsOptOutResponse {} +export interface MsgRewardsOptOutResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse"; + value: Uint8Array; +} +/** MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. */ +export interface MsgRewardsOptOutResponseAmino {} +export interface MsgRewardsOptOutResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse"; + value: MsgRewardsOptOutResponseAmino; +} +/** A Cosmos-SDK MsgReclaimLockedFunds */ +export interface MsgReclaimLockedFunds { + sender: string; + lockedAccountPubKey: Uint8Array; + signature: Uint8Array; +} +export interface MsgReclaimLockedFundsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds"; + value: Uint8Array; +} +/** A Cosmos-SDK MsgReclaimLockedFunds */ +export interface MsgReclaimLockedFundsAmino { + sender: string; + lockedAccountPubKey: string; + signature: string; +} +export interface MsgReclaimLockedFundsAminoMsg { + type: "exchange/MsgReclaimLockedFunds"; + value: MsgReclaimLockedFundsAmino; +} +/** + * MsgReclaimLockedFundsResponse defines the Msg/ReclaimLockedFunds response + * type. + */ +export interface MsgReclaimLockedFundsResponse {} +export interface MsgReclaimLockedFundsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse"; + value: Uint8Array; +} +/** + * MsgReclaimLockedFundsResponse defines the Msg/ReclaimLockedFunds response + * type. + */ +export interface MsgReclaimLockedFundsResponseAmino {} +export interface MsgReclaimLockedFundsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse"; + value: MsgReclaimLockedFundsResponseAmino; +} +/** MsgSignData defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignData { + /** Signer is the sdk.AccAddress of the message signer */ + signer: Uint8Array; + /** + * Data represents the raw bytes of the content that is signed (text, json, + * etc) + */ + data: Uint8Array; +} +export interface MsgSignDataProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSignData"; + value: Uint8Array; +} +/** MsgSignData defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDataAmino { + /** Signer is the sdk.AccAddress of the message signer */ + Signer: string; + /** + * Data represents the raw bytes of the content that is signed (text, json, + * etc) + */ + Data: string; +} +export interface MsgSignDataAminoMsg { + type: "/injective.exchange.v1beta1.MsgSignData"; + value: MsgSignDataAmino; +} +/** MsgSignDoc defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDoc { + signType: string; + value: MsgSignData; +} +export interface MsgSignDocProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc"; + value: Uint8Array; +} +/** MsgSignDoc defines an arbitrary, general-purpose, off-chain message */ +export interface MsgSignDocAmino { + sign_type: string; + value: MsgSignDataAmino; +} +export interface MsgSignDocAminoMsg { + type: "/injective.exchange.v1beta1.MsgSignDoc"; + value: MsgSignDocAmino; +} +/** + * MsgAdminUpdateBinaryOptionsMarket is used by the market Admin to operate the + * market + */ +export interface MsgAdminUpdateBinaryOptionsMarket { + sender: string; + marketId: string; + /** new price at which market will be settled */ + settlementPrice?: string; + /** expiration timestamp */ + expirationTimestamp: bigint; + /** expiration timestamp */ + settlementTimestamp: bigint; + /** Status of the market */ + status: MarketStatus; +} +export interface MsgAdminUpdateBinaryOptionsMarketProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket"; + value: Uint8Array; +} +/** + * MsgAdminUpdateBinaryOptionsMarket is used by the market Admin to operate the + * market + */ +export interface MsgAdminUpdateBinaryOptionsMarketAmino { + sender: string; + market_id: string; + /** new price at which market will be settled */ + settlement_price?: string; + /** expiration timestamp */ + expiration_timestamp: string; + /** expiration timestamp */ + settlement_timestamp: string; + /** Status of the market */ + status: MarketStatus; +} +export interface MsgAdminUpdateBinaryOptionsMarketAminoMsg { + type: "exchange/MsgAdminUpdateBinaryOptionsMarket"; + value: MsgAdminUpdateBinaryOptionsMarketAmino; +} +/** + * MsgAdminUpdateBinaryOptionsMarketResponse is the response for + * AdminUpdateBinaryOptionsMarket rpc method + */ +export interface MsgAdminUpdateBinaryOptionsMarketResponse {} +export interface MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse"; + value: Uint8Array; +} +/** + * MsgAdminUpdateBinaryOptionsMarketResponse is the response for + * AdminUpdateBinaryOptionsMarket rpc method + */ +export interface MsgAdminUpdateBinaryOptionsMarketResponseAmino {} +export interface MsgAdminUpdateBinaryOptionsMarketResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse"; + value: MsgAdminUpdateBinaryOptionsMarketResponseAmino; +} +/** MsgAuthorizeStakeGrants grants stakes to grantees. */ +export interface MsgAuthorizeStakeGrants { + sender: string; + grants: GrantAuthorization[]; +} +export interface MsgAuthorizeStakeGrantsProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants"; + value: Uint8Array; +} +/** MsgAuthorizeStakeGrants grants stakes to grantees. */ +export interface MsgAuthorizeStakeGrantsAmino { + sender: string; + grants: GrantAuthorizationAmino[]; +} +export interface MsgAuthorizeStakeGrantsAminoMsg { + type: "exchange/MsgAuthorizeStakeGrants"; + value: MsgAuthorizeStakeGrantsAmino; +} +export interface MsgAuthorizeStakeGrantsResponse {} +export interface MsgAuthorizeStakeGrantsResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse"; + value: Uint8Array; +} +export interface MsgAuthorizeStakeGrantsResponseAmino {} +export interface MsgAuthorizeStakeGrantsResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse"; + value: MsgAuthorizeStakeGrantsResponseAmino; +} +/** MsgActivateStakeGrant allows a grantee to activate a stake grant. */ +export interface MsgActivateStakeGrant { + sender: string; + granter: string; +} +export interface MsgActivateStakeGrantProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant"; + value: Uint8Array; +} +/** MsgActivateStakeGrant allows a grantee to activate a stake grant. */ +export interface MsgActivateStakeGrantAmino { + sender: string; + granter: string; +} +export interface MsgActivateStakeGrantAminoMsg { + type: "exchange/MsgActivateStakeGrant"; + value: MsgActivateStakeGrantAmino; +} +export interface MsgActivateStakeGrantResponse {} +export interface MsgActivateStakeGrantResponseProtoMsg { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse"; + value: Uint8Array; +} +export interface MsgActivateStakeGrantResponseAmino {} +export interface MsgActivateStakeGrantResponseAminoMsg { + type: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse"; + value: MsgActivateStakeGrantResponseAmino; +} +function createBaseMsgUpdateSpotMarket(): MsgUpdateSpotMarket { + return { + admin: "", + marketId: "", + newTicker: "", + newMinPriceTickSize: "", + newMinQuantityTickSize: "", + newMinNotional: "" + }; +} +export const MsgUpdateSpotMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket", + aminoType: "exchange/MsgUpdateSpotMarket", + is(o: any): o is MsgUpdateSpotMarket { + return o && (o.$typeUrl === MsgUpdateSpotMarket.typeUrl || typeof o.admin === "string" && typeof o.marketId === "string" && typeof o.newTicker === "string" && typeof o.newMinPriceTickSize === "string" && typeof o.newMinQuantityTickSize === "string" && typeof o.newMinNotional === "string"); + }, + isAmino(o: any): o is MsgUpdateSpotMarketAmino { + return o && (o.$typeUrl === MsgUpdateSpotMarket.typeUrl || typeof o.admin === "string" && typeof o.market_id === "string" && typeof o.new_ticker === "string" && typeof o.new_min_price_tick_size === "string" && typeof o.new_min_quantity_tick_size === "string" && typeof o.new_min_notional === "string"); + }, + encode(message: MsgUpdateSpotMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.newTicker !== "") { + writer.uint32(26).string(message.newTicker); + } + if (message.newMinPriceTickSize !== "") { + writer.uint32(34).string(message.newMinPriceTickSize); + } + if (message.newMinQuantityTickSize !== "") { + writer.uint32(42).string(message.newMinQuantityTickSize); + } + if (message.newMinNotional !== "") { + writer.uint32(50).string(message.newMinNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSpotMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSpotMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.newTicker = reader.string(); + break; + case 4: + message.newMinPriceTickSize = reader.string(); + break; + case 5: + message.newMinQuantityTickSize = reader.string(); + break; + case 6: + message.newMinNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateSpotMarket { + const message = createBaseMsgUpdateSpotMarket(); + message.admin = object.admin ?? ""; + message.marketId = object.marketId ?? ""; + message.newTicker = object.newTicker ?? ""; + message.newMinPriceTickSize = object.newMinPriceTickSize ?? ""; + message.newMinQuantityTickSize = object.newMinQuantityTickSize ?? ""; + message.newMinNotional = object.newMinNotional ?? ""; + return message; + }, + fromAmino(object: MsgUpdateSpotMarketAmino): MsgUpdateSpotMarket { + const message = createBaseMsgUpdateSpotMarket(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.new_ticker !== undefined && object.new_ticker !== null) { + message.newTicker = object.new_ticker; + } + if (object.new_min_price_tick_size !== undefined && object.new_min_price_tick_size !== null) { + message.newMinPriceTickSize = object.new_min_price_tick_size; + } + if (object.new_min_quantity_tick_size !== undefined && object.new_min_quantity_tick_size !== null) { + message.newMinQuantityTickSize = object.new_min_quantity_tick_size; + } + if (object.new_min_notional !== undefined && object.new_min_notional !== null) { + message.newMinNotional = object.new_min_notional; + } + return message; + }, + toAmino(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.new_ticker = message.newTicker === "" ? undefined : message.newTicker; + obj.new_min_price_tick_size = message.newMinPriceTickSize === "" ? undefined : message.newMinPriceTickSize; + obj.new_min_quantity_tick_size = message.newMinQuantityTickSize === "" ? undefined : message.newMinQuantityTickSize; + obj.new_min_notional = message.newMinNotional === "" ? undefined : message.newMinNotional; + return obj; + }, + fromAminoMsg(object: MsgUpdateSpotMarketAminoMsg): MsgUpdateSpotMarket { + return MsgUpdateSpotMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketAminoMsg { + return { + type: "exchange/MsgUpdateSpotMarket", + value: MsgUpdateSpotMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateSpotMarketProtoMsg): MsgUpdateSpotMarket { + return MsgUpdateSpotMarket.decode(message.value); + }, + toProto(message: MsgUpdateSpotMarket): Uint8Array { + return MsgUpdateSpotMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSpotMarket): MsgUpdateSpotMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarket", + value: MsgUpdateSpotMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateSpotMarket.typeUrl, MsgUpdateSpotMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateSpotMarket.aminoType, MsgUpdateSpotMarket.typeUrl); +function createBaseMsgUpdateSpotMarketResponse(): MsgUpdateSpotMarketResponse { + return {}; +} +export const MsgUpdateSpotMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse", + is(o: any): o is MsgUpdateSpotMarketResponse { + return o && o.$typeUrl === MsgUpdateSpotMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateSpotMarketResponseAmino { + return o && o.$typeUrl === MsgUpdateSpotMarketResponse.typeUrl; + }, + encode(_: MsgUpdateSpotMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSpotMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSpotMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateSpotMarketResponse { + const message = createBaseMsgUpdateSpotMarketResponse(); + return message; + }, + fromAmino(_: MsgUpdateSpotMarketResponseAmino): MsgUpdateSpotMarketResponse { + const message = createBaseMsgUpdateSpotMarketResponse(); + return message; + }, + toAmino(_: MsgUpdateSpotMarketResponse): MsgUpdateSpotMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateSpotMarketResponseAminoMsg): MsgUpdateSpotMarketResponse { + return MsgUpdateSpotMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateSpotMarketResponseProtoMsg): MsgUpdateSpotMarketResponse { + return MsgUpdateSpotMarketResponse.decode(message.value); + }, + toProto(message: MsgUpdateSpotMarketResponse): Uint8Array { + return MsgUpdateSpotMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSpotMarketResponse): MsgUpdateSpotMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateSpotMarketResponse", + value: MsgUpdateSpotMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateSpotMarketResponse.typeUrl, MsgUpdateSpotMarketResponse); +function createBaseMsgUpdateDerivativeMarket(): MsgUpdateDerivativeMarket { + return { + admin: "", + marketId: "", + newTicker: "", + newMinPriceTickSize: "", + newMinQuantityTickSize: "", + newMinNotional: "", + newInitialMarginRatio: "", + newMaintenanceMarginRatio: "" + }; +} +export const MsgUpdateDerivativeMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket", + aminoType: "exchange/MsgUpdateDerivativeMarket", + is(o: any): o is MsgUpdateDerivativeMarket { + return o && (o.$typeUrl === MsgUpdateDerivativeMarket.typeUrl || typeof o.admin === "string" && typeof o.marketId === "string" && typeof o.newTicker === "string" && typeof o.newMinPriceTickSize === "string" && typeof o.newMinQuantityTickSize === "string" && typeof o.newMinNotional === "string" && typeof o.newInitialMarginRatio === "string" && typeof o.newMaintenanceMarginRatio === "string"); + }, + isAmino(o: any): o is MsgUpdateDerivativeMarketAmino { + return o && (o.$typeUrl === MsgUpdateDerivativeMarket.typeUrl || typeof o.admin === "string" && typeof o.market_id === "string" && typeof o.new_ticker === "string" && typeof o.new_min_price_tick_size === "string" && typeof o.new_min_quantity_tick_size === "string" && typeof o.new_min_notional === "string" && typeof o.new_initial_margin_ratio === "string" && typeof o.new_maintenance_margin_ratio === "string"); + }, + encode(message: MsgUpdateDerivativeMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.newTicker !== "") { + writer.uint32(26).string(message.newTicker); + } + if (message.newMinPriceTickSize !== "") { + writer.uint32(34).string(message.newMinPriceTickSize); + } + if (message.newMinQuantityTickSize !== "") { + writer.uint32(42).string(message.newMinQuantityTickSize); + } + if (message.newMinNotional !== "") { + writer.uint32(50).string(message.newMinNotional); + } + if (message.newInitialMarginRatio !== "") { + writer.uint32(58).string(message.newInitialMarginRatio); + } + if (message.newMaintenanceMarginRatio !== "") { + writer.uint32(66).string(message.newMaintenanceMarginRatio); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDerivativeMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDerivativeMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.newTicker = reader.string(); + break; + case 4: + message.newMinPriceTickSize = reader.string(); + break; + case 5: + message.newMinQuantityTickSize = reader.string(); + break; + case 6: + message.newMinNotional = reader.string(); + break; + case 7: + message.newInitialMarginRatio = reader.string(); + break; + case 8: + message.newMaintenanceMarginRatio = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateDerivativeMarket { + const message = createBaseMsgUpdateDerivativeMarket(); + message.admin = object.admin ?? ""; + message.marketId = object.marketId ?? ""; + message.newTicker = object.newTicker ?? ""; + message.newMinPriceTickSize = object.newMinPriceTickSize ?? ""; + message.newMinQuantityTickSize = object.newMinQuantityTickSize ?? ""; + message.newMinNotional = object.newMinNotional ?? ""; + message.newInitialMarginRatio = object.newInitialMarginRatio ?? ""; + message.newMaintenanceMarginRatio = object.newMaintenanceMarginRatio ?? ""; + return message; + }, + fromAmino(object: MsgUpdateDerivativeMarketAmino): MsgUpdateDerivativeMarket { + const message = createBaseMsgUpdateDerivativeMarket(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.new_ticker !== undefined && object.new_ticker !== null) { + message.newTicker = object.new_ticker; + } + if (object.new_min_price_tick_size !== undefined && object.new_min_price_tick_size !== null) { + message.newMinPriceTickSize = object.new_min_price_tick_size; + } + if (object.new_min_quantity_tick_size !== undefined && object.new_min_quantity_tick_size !== null) { + message.newMinQuantityTickSize = object.new_min_quantity_tick_size; + } + if (object.new_min_notional !== undefined && object.new_min_notional !== null) { + message.newMinNotional = object.new_min_notional; + } + if (object.new_initial_margin_ratio !== undefined && object.new_initial_margin_ratio !== null) { + message.newInitialMarginRatio = object.new_initial_margin_ratio; + } + if (object.new_maintenance_margin_ratio !== undefined && object.new_maintenance_margin_ratio !== null) { + message.newMaintenanceMarginRatio = object.new_maintenance_margin_ratio; + } + return message; + }, + toAmino(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.new_ticker = message.newTicker === "" ? undefined : message.newTicker; + obj.new_min_price_tick_size = message.newMinPriceTickSize === "" ? undefined : message.newMinPriceTickSize; + obj.new_min_quantity_tick_size = message.newMinQuantityTickSize === "" ? undefined : message.newMinQuantityTickSize; + obj.new_min_notional = message.newMinNotional === "" ? undefined : message.newMinNotional; + obj.new_initial_margin_ratio = message.newInitialMarginRatio === "" ? undefined : message.newInitialMarginRatio; + obj.new_maintenance_margin_ratio = message.newMaintenanceMarginRatio === "" ? undefined : message.newMaintenanceMarginRatio; + return obj; + }, + fromAminoMsg(object: MsgUpdateDerivativeMarketAminoMsg): MsgUpdateDerivativeMarket { + return MsgUpdateDerivativeMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketAminoMsg { + return { + type: "exchange/MsgUpdateDerivativeMarket", + value: MsgUpdateDerivativeMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateDerivativeMarketProtoMsg): MsgUpdateDerivativeMarket { + return MsgUpdateDerivativeMarket.decode(message.value); + }, + toProto(message: MsgUpdateDerivativeMarket): Uint8Array { + return MsgUpdateDerivativeMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDerivativeMarket): MsgUpdateDerivativeMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarket", + value: MsgUpdateDerivativeMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateDerivativeMarket.typeUrl, MsgUpdateDerivativeMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateDerivativeMarket.aminoType, MsgUpdateDerivativeMarket.typeUrl); +function createBaseMsgUpdateDerivativeMarketResponse(): MsgUpdateDerivativeMarketResponse { + return {}; +} +export const MsgUpdateDerivativeMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse", + is(o: any): o is MsgUpdateDerivativeMarketResponse { + return o && o.$typeUrl === MsgUpdateDerivativeMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateDerivativeMarketResponseAmino { + return o && o.$typeUrl === MsgUpdateDerivativeMarketResponse.typeUrl; + }, + encode(_: MsgUpdateDerivativeMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDerivativeMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDerivativeMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateDerivativeMarketResponse { + const message = createBaseMsgUpdateDerivativeMarketResponse(); + return message; + }, + fromAmino(_: MsgUpdateDerivativeMarketResponseAmino): MsgUpdateDerivativeMarketResponse { + const message = createBaseMsgUpdateDerivativeMarketResponse(); + return message; + }, + toAmino(_: MsgUpdateDerivativeMarketResponse): MsgUpdateDerivativeMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateDerivativeMarketResponseAminoMsg): MsgUpdateDerivativeMarketResponse { + return MsgUpdateDerivativeMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDerivativeMarketResponseProtoMsg): MsgUpdateDerivativeMarketResponse { + return MsgUpdateDerivativeMarketResponse.decode(message.value); + }, + toProto(message: MsgUpdateDerivativeMarketResponse): Uint8Array { + return MsgUpdateDerivativeMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDerivativeMarketResponse): MsgUpdateDerivativeMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateDerivativeMarketResponse", + value: MsgUpdateDerivativeMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateDerivativeMarketResponse.typeUrl, MsgUpdateDerivativeMarketResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParams", + aminoType: "exchange/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "exchange/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: "/injective.exchange.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgDeposit(): MsgDeposit { + return { + sender: "", + subaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgDeposit = { + typeUrl: "/injective.exchange.v1beta1.MsgDeposit", + aminoType: "exchange/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, 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.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeposit { + const message = createBaseMsgDeposit(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgDeposit): MsgDepositAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: "exchange/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: "/injective.exchange.v1beta1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value); + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +function createBaseMsgWithdraw(): MsgWithdraw { + return { + sender: "", + subaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgWithdraw = { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw", + aminoType: "exchange/MsgWithdraw", + is(o: any): o is MsgWithdraw { + return o && (o.$typeUrl === MsgWithdraw.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgWithdrawAmino { + return o && (o.$typeUrl === MsgWithdraw.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdraw { + const message = createBaseMsgWithdraw(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgWithdrawAmino): MsgWithdraw { + const message = createBaseMsgWithdraw(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgWithdraw): MsgWithdrawAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgWithdrawAminoMsg): MsgWithdraw { + return MsgWithdraw.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdraw): MsgWithdrawAminoMsg { + return { + type: "exchange/MsgWithdraw", + value: MsgWithdraw.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProtoMsg): MsgWithdraw { + return MsgWithdraw.decode(message.value); + }, + toProto(message: MsgWithdraw): Uint8Array { + return MsgWithdraw.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdraw): MsgWithdrawProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgWithdraw", + value: MsgWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdraw.typeUrl, MsgWithdraw); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdraw.aminoType, MsgWithdraw.typeUrl); +function createBaseMsgWithdrawResponse(): MsgWithdrawResponse { + return {}; +} +export const MsgWithdrawResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse", + is(o: any): o is MsgWithdrawResponse { + return o && o.$typeUrl === MsgWithdrawResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawResponseAmino { + return o && o.$typeUrl === MsgWithdrawResponse.typeUrl; + }, + encode(_: MsgWithdrawResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawResponse { + const message = createBaseMsgWithdrawResponse(); + return message; + }, + fromAmino(_: MsgWithdrawResponseAmino): MsgWithdrawResponse { + const message = createBaseMsgWithdrawResponse(); + return message; + }, + toAmino(_: MsgWithdrawResponse): MsgWithdrawResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawResponseAminoMsg): MsgWithdrawResponse { + return MsgWithdrawResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawResponseProtoMsg): MsgWithdrawResponse { + return MsgWithdrawResponse.decode(message.value); + }, + toProto(message: MsgWithdrawResponse): Uint8Array { + return MsgWithdrawResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawResponse): MsgWithdrawResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgWithdrawResponse", + value: MsgWithdrawResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawResponse.typeUrl, MsgWithdrawResponse); +function createBaseMsgCreateSpotLimitOrder(): MsgCreateSpotLimitOrder { + return { + sender: "", + order: SpotOrder.fromPartial({}) + }; +} +export const MsgCreateSpotLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder", + aminoType: "exchange/MsgCreateSpotLimitOrder", + is(o: any): o is MsgCreateSpotLimitOrder { + return o && (o.$typeUrl === MsgCreateSpotLimitOrder.typeUrl || typeof o.sender === "string" && SpotOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateSpotLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateSpotLimitOrder.typeUrl || typeof o.sender === "string" && SpotOrder.isAmino(o.order)); + }, + encode(message: MsgCreateSpotLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotLimitOrder { + const message = createBaseMsgCreateSpotLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateSpotLimitOrderAmino): MsgCreateSpotLimitOrder { + const message = createBaseMsgCreateSpotLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotLimitOrderAminoMsg): MsgCreateSpotLimitOrder { + return MsgCreateSpotLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateSpotLimitOrder", + value: MsgCreateSpotLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateSpotLimitOrderProtoMsg): MsgCreateSpotLimitOrder { + return MsgCreateSpotLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateSpotLimitOrder): Uint8Array { + return MsgCreateSpotLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotLimitOrder): MsgCreateSpotLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder", + value: MsgCreateSpotLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotLimitOrder.typeUrl, MsgCreateSpotLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateSpotLimitOrder.aminoType, MsgCreateSpotLimitOrder.typeUrl); +function createBaseMsgCreateSpotLimitOrderResponse(): MsgCreateSpotLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateSpotLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse", + is(o: any): o is MsgCreateSpotLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateSpotLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateSpotLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateSpotLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateSpotLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotLimitOrderResponse { + const message = createBaseMsgCreateSpotLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateSpotLimitOrderResponseAmino): MsgCreateSpotLimitOrderResponse { + const message = createBaseMsgCreateSpotLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateSpotLimitOrderResponse): MsgCreateSpotLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotLimitOrderResponseAminoMsg): MsgCreateSpotLimitOrderResponse { + return MsgCreateSpotLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateSpotLimitOrderResponseProtoMsg): MsgCreateSpotLimitOrderResponse { + return MsgCreateSpotLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateSpotLimitOrderResponse): Uint8Array { + return MsgCreateSpotLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotLimitOrderResponse): MsgCreateSpotLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrderResponse", + value: MsgCreateSpotLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotLimitOrderResponse.typeUrl, MsgCreateSpotLimitOrderResponse); +function createBaseMsgBatchCreateSpotLimitOrders(): MsgBatchCreateSpotLimitOrders { + return { + sender: "", + orders: [] + }; +} +export const MsgBatchCreateSpotLimitOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders", + aminoType: "exchange/MsgBatchCreateSpotLimitOrders", + is(o: any): o is MsgBatchCreateSpotLimitOrders { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || SpotOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is MsgBatchCreateSpotLimitOrdersAmino { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || SpotOrder.isAmino(o.orders[0]))); + }, + encode(message: MsgBatchCreateSpotLimitOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.orders) { + SpotOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateSpotLimitOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateSpotLimitOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orders.push(SpotOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateSpotLimitOrders { + const message = createBaseMsgBatchCreateSpotLimitOrders(); + message.sender = object.sender ?? ""; + message.orders = object.orders?.map(e => SpotOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCreateSpotLimitOrdersAmino): MsgBatchCreateSpotLimitOrders { + const message = createBaseMsgBatchCreateSpotLimitOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.orders = object.orders?.map(e => SpotOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.orders) { + obj.orders = message.orders.map(e => e ? SpotOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateSpotLimitOrdersAminoMsg): MsgBatchCreateSpotLimitOrders { + return MsgBatchCreateSpotLimitOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersAminoMsg { + return { + type: "exchange/MsgBatchCreateSpotLimitOrders", + value: MsgBatchCreateSpotLimitOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCreateSpotLimitOrdersProtoMsg): MsgBatchCreateSpotLimitOrders { + return MsgBatchCreateSpotLimitOrders.decode(message.value); + }, + toProto(message: MsgBatchCreateSpotLimitOrders): Uint8Array { + return MsgBatchCreateSpotLimitOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateSpotLimitOrders): MsgBatchCreateSpotLimitOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders", + value: MsgBatchCreateSpotLimitOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateSpotLimitOrders.typeUrl, MsgBatchCreateSpotLimitOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCreateSpotLimitOrders.aminoType, MsgBatchCreateSpotLimitOrders.typeUrl); +function createBaseMsgBatchCreateSpotLimitOrdersResponse(): MsgBatchCreateSpotLimitOrdersResponse { + return { + orderHashes: [], + createdOrdersCids: [], + failedOrdersCids: [] + }; +} +export const MsgBatchCreateSpotLimitOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse", + is(o: any): o is MsgBatchCreateSpotLimitOrdersResponse { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrdersResponse.typeUrl || Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string") && Array.isArray(o.createdOrdersCids) && (!o.createdOrdersCids.length || typeof o.createdOrdersCids[0] === "string") && Array.isArray(o.failedOrdersCids) && (!o.failedOrdersCids.length || typeof o.failedOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchCreateSpotLimitOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCreateSpotLimitOrdersResponse.typeUrl || Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string") && Array.isArray(o.created_orders_cids) && (!o.created_orders_cids.length || typeof o.created_orders_cids[0] === "string") && Array.isArray(o.failed_orders_cids) && (!o.failed_orders_cids.length || typeof o.failed_orders_cids[0] === "string")); + }, + encode(message: MsgBatchCreateSpotLimitOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderHashes) { + writer.uint32(10).string(v!); + } + for (const v of message.createdOrdersCids) { + writer.uint32(18).string(v!); + } + for (const v of message.failedOrdersCids) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateSpotLimitOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHashes.push(reader.string()); + break; + case 2: + message.createdOrdersCids.push(reader.string()); + break; + case 3: + message.failedOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateSpotLimitOrdersResponse { + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + message.orderHashes = object.orderHashes?.map(e => e) || []; + message.createdOrdersCids = object.createdOrdersCids?.map(e => e) || []; + message.failedOrdersCids = object.failedOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCreateSpotLimitOrdersResponseAmino): MsgBatchCreateSpotLimitOrdersResponse { + const message = createBaseMsgBatchCreateSpotLimitOrdersResponse(); + message.orderHashes = object.order_hashes?.map(e => e) || []; + message.createdOrdersCids = object.created_orders_cids?.map(e => e) || []; + message.failedOrdersCids = object.failed_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCreateSpotLimitOrdersResponse): MsgBatchCreateSpotLimitOrdersResponseAmino { + const obj: any = {}; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + if (message.createdOrdersCids) { + obj.created_orders_cids = message.createdOrdersCids.map(e => e); + } else { + obj.created_orders_cids = message.createdOrdersCids; + } + if (message.failedOrdersCids) { + obj.failed_orders_cids = message.failedOrdersCids.map(e => e); + } else { + obj.failed_orders_cids = message.failedOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateSpotLimitOrdersResponseAminoMsg): MsgBatchCreateSpotLimitOrdersResponse { + return MsgBatchCreateSpotLimitOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCreateSpotLimitOrdersResponseProtoMsg): MsgBatchCreateSpotLimitOrdersResponse { + return MsgBatchCreateSpotLimitOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCreateSpotLimitOrdersResponse): Uint8Array { + return MsgBatchCreateSpotLimitOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateSpotLimitOrdersResponse): MsgBatchCreateSpotLimitOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrdersResponse", + value: MsgBatchCreateSpotLimitOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateSpotLimitOrdersResponse.typeUrl, MsgBatchCreateSpotLimitOrdersResponse); +function createBaseMsgInstantSpotMarketLaunch(): MsgInstantSpotMarketLaunch { + return { + sender: "", + ticker: "", + baseDenom: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantSpotMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch", + aminoType: "exchange/MsgInstantSpotMarketLaunch", + is(o: any): o is MsgInstantSpotMarketLaunch { + return o && (o.$typeUrl === MsgInstantSpotMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.baseDenom === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantSpotMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantSpotMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.base_denom === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantSpotMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.baseDenom !== "") { + writer.uint32(26).string(message.baseDenom); + } + if (message.quoteDenom !== "") { + writer.uint32(34).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(42).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(50).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(58).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantSpotMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantSpotMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.baseDenom = reader.string(); + break; + case 4: + message.quoteDenom = reader.string(); + break; + case 5: + message.minPriceTickSize = reader.string(); + break; + case 6: + message.minQuantityTickSize = reader.string(); + break; + case 7: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantSpotMarketLaunch { + const message = createBaseMsgInstantSpotMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantSpotMarketLaunchAmino): MsgInstantSpotMarketLaunch { + const message = createBaseMsgInstantSpotMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantSpotMarketLaunchAminoMsg): MsgInstantSpotMarketLaunch { + return MsgInstantSpotMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantSpotMarketLaunch", + value: MsgInstantSpotMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantSpotMarketLaunchProtoMsg): MsgInstantSpotMarketLaunch { + return MsgInstantSpotMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantSpotMarketLaunch): Uint8Array { + return MsgInstantSpotMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantSpotMarketLaunch): MsgInstantSpotMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch", + value: MsgInstantSpotMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantSpotMarketLaunch.typeUrl, MsgInstantSpotMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantSpotMarketLaunch.aminoType, MsgInstantSpotMarketLaunch.typeUrl); +function createBaseMsgInstantSpotMarketLaunchResponse(): MsgInstantSpotMarketLaunchResponse { + return {}; +} +export const MsgInstantSpotMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse", + is(o: any): o is MsgInstantSpotMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantSpotMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantSpotMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantSpotMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantSpotMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantSpotMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantSpotMarketLaunchResponse { + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantSpotMarketLaunchResponseAmino): MsgInstantSpotMarketLaunchResponse { + const message = createBaseMsgInstantSpotMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantSpotMarketLaunchResponse): MsgInstantSpotMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantSpotMarketLaunchResponseAminoMsg): MsgInstantSpotMarketLaunchResponse { + return MsgInstantSpotMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantSpotMarketLaunchResponseProtoMsg): MsgInstantSpotMarketLaunchResponse { + return MsgInstantSpotMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantSpotMarketLaunchResponse): Uint8Array { + return MsgInstantSpotMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantSpotMarketLaunchResponse): MsgInstantSpotMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunchResponse", + value: MsgInstantSpotMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantSpotMarketLaunchResponse.typeUrl, MsgInstantSpotMarketLaunchResponse); +function createBaseMsgInstantPerpetualMarketLaunch(): MsgInstantPerpetualMarketLaunch { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleScaleFactor: 0, + oracleType: 0, + makerFeeRate: "", + takerFeeRate: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantPerpetualMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch", + aminoType: "exchange/MsgInstantPerpetualMarketLaunch", + is(o: any): o is MsgInstantPerpetualMarketLaunch { + return o && (o.$typeUrl === MsgInstantPerpetualMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && typeof o.oracleScaleFactor === "number" && isSet(o.oracleType) && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantPerpetualMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantPerpetualMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && typeof o.oracle_scale_factor === "number" && isSet(o.oracle_type) && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantPerpetualMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(48).uint32(message.oracleScaleFactor); + } + if (message.oracleType !== 0) { + writer.uint32(56).int32(message.oracleType); + } + if (message.makerFeeRate !== "") { + writer.uint32(66).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(74).string(message.takerFeeRate); + } + if (message.initialMarginRatio !== "") { + writer.uint32(82).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(90).string(message.maintenanceMarginRatio); + } + if (message.minPriceTickSize !== "") { + writer.uint32(98).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(106).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(114).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantPerpetualMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantPerpetualMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleScaleFactor = reader.uint32(); + break; + case 7: + message.oracleType = (reader.int32() as any); + break; + case 8: + message.makerFeeRate = reader.string(); + break; + case 9: + message.takerFeeRate = reader.string(); + break; + case 10: + message.initialMarginRatio = reader.string(); + break; + case 11: + message.maintenanceMarginRatio = reader.string(); + break; + case 12: + message.minPriceTickSize = reader.string(); + break; + case 13: + message.minQuantityTickSize = reader.string(); + break; + case 14: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantPerpetualMarketLaunch { + const message = createBaseMsgInstantPerpetualMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.oracleType = object.oracleType ?? 0; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantPerpetualMarketLaunchAmino): MsgInstantPerpetualMarketLaunch { + const message = createBaseMsgInstantPerpetualMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantPerpetualMarketLaunchAminoMsg): MsgInstantPerpetualMarketLaunch { + return MsgInstantPerpetualMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantPerpetualMarketLaunch", + value: MsgInstantPerpetualMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantPerpetualMarketLaunchProtoMsg): MsgInstantPerpetualMarketLaunch { + return MsgInstantPerpetualMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantPerpetualMarketLaunch): Uint8Array { + return MsgInstantPerpetualMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantPerpetualMarketLaunch): MsgInstantPerpetualMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch", + value: MsgInstantPerpetualMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantPerpetualMarketLaunch.typeUrl, MsgInstantPerpetualMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantPerpetualMarketLaunch.aminoType, MsgInstantPerpetualMarketLaunch.typeUrl); +function createBaseMsgInstantPerpetualMarketLaunchResponse(): MsgInstantPerpetualMarketLaunchResponse { + return {}; +} +export const MsgInstantPerpetualMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse", + is(o: any): o is MsgInstantPerpetualMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantPerpetualMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantPerpetualMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantPerpetualMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantPerpetualMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantPerpetualMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantPerpetualMarketLaunchResponse { + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantPerpetualMarketLaunchResponseAmino): MsgInstantPerpetualMarketLaunchResponse { + const message = createBaseMsgInstantPerpetualMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantPerpetualMarketLaunchResponse): MsgInstantPerpetualMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantPerpetualMarketLaunchResponseAminoMsg): MsgInstantPerpetualMarketLaunchResponse { + return MsgInstantPerpetualMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantPerpetualMarketLaunchResponseProtoMsg): MsgInstantPerpetualMarketLaunchResponse { + return MsgInstantPerpetualMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantPerpetualMarketLaunchResponse): Uint8Array { + return MsgInstantPerpetualMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantPerpetualMarketLaunchResponse): MsgInstantPerpetualMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunchResponse", + value: MsgInstantPerpetualMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantPerpetualMarketLaunchResponse.typeUrl, MsgInstantPerpetualMarketLaunchResponse); +function createBaseMsgInstantBinaryOptionsMarketLaunch(): MsgInstantBinaryOptionsMarketLaunch { + return { + sender: "", + ticker: "", + oracleSymbol: "", + oracleProvider: "", + oracleType: 0, + oracleScaleFactor: 0, + makerFeeRate: "", + takerFeeRate: "", + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + admin: "", + quoteDenom: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantBinaryOptionsMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch", + aminoType: "exchange/MsgInstantBinaryOptionsMarketLaunch", + is(o: any): o is MsgInstantBinaryOptionsMarketLaunch { + return o && (o.$typeUrl === MsgInstantBinaryOptionsMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.oracleSymbol === "string" && typeof o.oracleProvider === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && typeof o.admin === "string" && typeof o.quoteDenom === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantBinaryOptionsMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantBinaryOptionsMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.oracle_symbol === "string" && typeof o.oracle_provider === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && typeof o.admin === "string" && typeof o.quote_denom === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantBinaryOptionsMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.oracleSymbol !== "") { + writer.uint32(26).string(message.oracleSymbol); + } + if (message.oracleProvider !== "") { + writer.uint32(34).string(message.oracleProvider); + } + if (message.oracleType !== 0) { + writer.uint32(40).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(48).uint32(message.oracleScaleFactor); + } + if (message.makerFeeRate !== "") { + writer.uint32(58).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(66).string(message.takerFeeRate); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(72).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(80).int64(message.settlementTimestamp); + } + if (message.admin !== "") { + writer.uint32(90).string(message.admin); + } + if (message.quoteDenom !== "") { + writer.uint32(98).string(message.quoteDenom); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantBinaryOptionsMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.oracleSymbol = reader.string(); + break; + case 4: + message.oracleProvider = reader.string(); + break; + case 5: + message.oracleType = (reader.int32() as any); + break; + case 6: + message.oracleScaleFactor = reader.uint32(); + break; + case 7: + message.makerFeeRate = reader.string(); + break; + case 8: + message.takerFeeRate = reader.string(); + break; + case 9: + message.expirationTimestamp = reader.int64(); + break; + case 10: + message.settlementTimestamp = reader.int64(); + break; + case 11: + message.admin = reader.string(); + break; + case 12: + message.quoteDenom = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantBinaryOptionsMarketLaunch { + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.oracleSymbol = object.oracleSymbol ?? ""; + message.oracleProvider = object.oracleProvider ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantBinaryOptionsMarketLaunchAmino): MsgInstantBinaryOptionsMarketLaunch { + const message = createBaseMsgInstantBinaryOptionsMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.oracle_symbol !== undefined && object.oracle_symbol !== null) { + message.oracleSymbol = object.oracle_symbol; + } + if (object.oracle_provider !== undefined && object.oracle_provider !== null) { + message.oracleProvider = object.oracle_provider; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.oracle_symbol = message.oracleSymbol === "" ? undefined : message.oracleSymbol; + obj.oracle_provider = message.oracleProvider === "" ? undefined : message.oracleProvider; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantBinaryOptionsMarketLaunchAminoMsg): MsgInstantBinaryOptionsMarketLaunch { + return MsgInstantBinaryOptionsMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantBinaryOptionsMarketLaunch", + value: MsgInstantBinaryOptionsMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchProtoMsg): MsgInstantBinaryOptionsMarketLaunch { + return MsgInstantBinaryOptionsMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantBinaryOptionsMarketLaunch): Uint8Array { + return MsgInstantBinaryOptionsMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantBinaryOptionsMarketLaunch): MsgInstantBinaryOptionsMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch", + value: MsgInstantBinaryOptionsMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantBinaryOptionsMarketLaunch.typeUrl, MsgInstantBinaryOptionsMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantBinaryOptionsMarketLaunch.aminoType, MsgInstantBinaryOptionsMarketLaunch.typeUrl); +function createBaseMsgInstantBinaryOptionsMarketLaunchResponse(): MsgInstantBinaryOptionsMarketLaunchResponse { + return {}; +} +export const MsgInstantBinaryOptionsMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse", + is(o: any): o is MsgInstantBinaryOptionsMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantBinaryOptionsMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantBinaryOptionsMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantBinaryOptionsMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantBinaryOptionsMarketLaunchResponse { + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantBinaryOptionsMarketLaunchResponseAmino): MsgInstantBinaryOptionsMarketLaunchResponse { + const message = createBaseMsgInstantBinaryOptionsMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantBinaryOptionsMarketLaunchResponse): MsgInstantBinaryOptionsMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantBinaryOptionsMarketLaunchResponseAminoMsg): MsgInstantBinaryOptionsMarketLaunchResponse { + return MsgInstantBinaryOptionsMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg): MsgInstantBinaryOptionsMarketLaunchResponse { + return MsgInstantBinaryOptionsMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantBinaryOptionsMarketLaunchResponse): Uint8Array { + return MsgInstantBinaryOptionsMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantBinaryOptionsMarketLaunchResponse): MsgInstantBinaryOptionsMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunchResponse", + value: MsgInstantBinaryOptionsMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantBinaryOptionsMarketLaunchResponse.typeUrl, MsgInstantBinaryOptionsMarketLaunchResponse); +function createBaseMsgInstantExpiryFuturesMarketLaunch(): MsgInstantExpiryFuturesMarketLaunch { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + oracleScaleFactor: 0, + expiry: BigInt(0), + makerFeeRate: "", + takerFeeRate: "", + initialMarginRatio: "", + maintenanceMarginRatio: "", + minPriceTickSize: "", + minQuantityTickSize: "", + minNotional: "" + }; +} +export const MsgInstantExpiryFuturesMarketLaunch = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch", + aminoType: "exchange/MsgInstantExpiryFuturesMarketLaunch", + is(o: any): o is MsgInstantExpiryFuturesMarketLaunch { + return o && (o.$typeUrl === MsgInstantExpiryFuturesMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.oracleScaleFactor === "number" && typeof o.expiry === "bigint" && typeof o.makerFeeRate === "string" && typeof o.takerFeeRate === "string" && typeof o.initialMarginRatio === "string" && typeof o.maintenanceMarginRatio === "string" && typeof o.minPriceTickSize === "string" && typeof o.minQuantityTickSize === "string" && typeof o.minNotional === "string"); + }, + isAmino(o: any): o is MsgInstantExpiryFuturesMarketLaunchAmino { + return o && (o.$typeUrl === MsgInstantExpiryFuturesMarketLaunch.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.oracle_scale_factor === "number" && typeof o.expiry === "bigint" && typeof o.maker_fee_rate === "string" && typeof o.taker_fee_rate === "string" && typeof o.initial_margin_ratio === "string" && typeof o.maintenance_margin_ratio === "string" && typeof o.min_price_tick_size === "string" && typeof o.min_quantity_tick_size === "string" && typeof o.min_notional === "string"); + }, + encode(message: MsgInstantExpiryFuturesMarketLaunch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.oracleScaleFactor !== 0) { + writer.uint32(56).uint32(message.oracleScaleFactor); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(64).int64(message.expiry); + } + if (message.makerFeeRate !== "") { + writer.uint32(74).string(message.makerFeeRate); + } + if (message.takerFeeRate !== "") { + writer.uint32(82).string(message.takerFeeRate); + } + if (message.initialMarginRatio !== "") { + writer.uint32(90).string(message.initialMarginRatio); + } + if (message.maintenanceMarginRatio !== "") { + writer.uint32(98).string(message.maintenanceMarginRatio); + } + if (message.minPriceTickSize !== "") { + writer.uint32(106).string(message.minPriceTickSize); + } + if (message.minQuantityTickSize !== "") { + writer.uint32(114).string(message.minQuantityTickSize); + } + if (message.minNotional !== "") { + writer.uint32(122).string(message.minNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantExpiryFuturesMarketLaunch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.oracleScaleFactor = reader.uint32(); + break; + case 8: + message.expiry = reader.int64(); + break; + case 9: + message.makerFeeRate = reader.string(); + break; + case 10: + message.takerFeeRate = reader.string(); + break; + case 11: + message.initialMarginRatio = reader.string(); + break; + case 12: + message.maintenanceMarginRatio = reader.string(); + break; + case 13: + message.minPriceTickSize = reader.string(); + break; + case 14: + message.minQuantityTickSize = reader.string(); + break; + case 15: + message.minNotional = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgInstantExpiryFuturesMarketLaunch { + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.oracleScaleFactor = object.oracleScaleFactor ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.makerFeeRate = object.makerFeeRate ?? ""; + message.takerFeeRate = object.takerFeeRate ?? ""; + message.initialMarginRatio = object.initialMarginRatio ?? ""; + message.maintenanceMarginRatio = object.maintenanceMarginRatio ?? ""; + message.minPriceTickSize = object.minPriceTickSize ?? ""; + message.minQuantityTickSize = object.minQuantityTickSize ?? ""; + message.minNotional = object.minNotional ?? ""; + return message; + }, + fromAmino(object: MsgInstantExpiryFuturesMarketLaunchAmino): MsgInstantExpiryFuturesMarketLaunch { + const message = createBaseMsgInstantExpiryFuturesMarketLaunch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.oracle_scale_factor !== undefined && object.oracle_scale_factor !== null) { + message.oracleScaleFactor = object.oracle_scale_factor; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.maker_fee_rate !== undefined && object.maker_fee_rate !== null) { + message.makerFeeRate = object.maker_fee_rate; + } + if (object.taker_fee_rate !== undefined && object.taker_fee_rate !== null) { + message.takerFeeRate = object.taker_fee_rate; + } + if (object.initial_margin_ratio !== undefined && object.initial_margin_ratio !== null) { + message.initialMarginRatio = object.initial_margin_ratio; + } + if (object.maintenance_margin_ratio !== undefined && object.maintenance_margin_ratio !== null) { + message.maintenanceMarginRatio = object.maintenance_margin_ratio; + } + if (object.min_price_tick_size !== undefined && object.min_price_tick_size !== null) { + message.minPriceTickSize = object.min_price_tick_size; + } + if (object.min_quantity_tick_size !== undefined && object.min_quantity_tick_size !== null) { + message.minQuantityTickSize = object.min_quantity_tick_size; + } + if (object.min_notional !== undefined && object.min_notional !== null) { + message.minNotional = object.min_notional; + } + return message; + }, + toAmino(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.oracle_scale_factor = message.oracleScaleFactor === 0 ? undefined : message.oracleScaleFactor; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.maker_fee_rate = message.makerFeeRate === "" ? undefined : message.makerFeeRate; + obj.taker_fee_rate = message.takerFeeRate === "" ? undefined : message.takerFeeRate; + obj.initial_margin_ratio = message.initialMarginRatio === "" ? undefined : message.initialMarginRatio; + obj.maintenance_margin_ratio = message.maintenanceMarginRatio === "" ? undefined : message.maintenanceMarginRatio; + obj.min_price_tick_size = message.minPriceTickSize === "" ? undefined : message.minPriceTickSize; + obj.min_quantity_tick_size = message.minQuantityTickSize === "" ? undefined : message.minQuantityTickSize; + obj.min_notional = message.minNotional === "" ? undefined : message.minNotional; + return obj; + }, + fromAminoMsg(object: MsgInstantExpiryFuturesMarketLaunchAminoMsg): MsgInstantExpiryFuturesMarketLaunch { + return MsgInstantExpiryFuturesMarketLaunch.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchAminoMsg { + return { + type: "exchange/MsgInstantExpiryFuturesMarketLaunch", + value: MsgInstantExpiryFuturesMarketLaunch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchProtoMsg): MsgInstantExpiryFuturesMarketLaunch { + return MsgInstantExpiryFuturesMarketLaunch.decode(message.value); + }, + toProto(message: MsgInstantExpiryFuturesMarketLaunch): Uint8Array { + return MsgInstantExpiryFuturesMarketLaunch.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantExpiryFuturesMarketLaunch): MsgInstantExpiryFuturesMarketLaunchProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch", + value: MsgInstantExpiryFuturesMarketLaunch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantExpiryFuturesMarketLaunch.typeUrl, MsgInstantExpiryFuturesMarketLaunch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantExpiryFuturesMarketLaunch.aminoType, MsgInstantExpiryFuturesMarketLaunch.typeUrl); +function createBaseMsgInstantExpiryFuturesMarketLaunchResponse(): MsgInstantExpiryFuturesMarketLaunchResponse { + return {}; +} +export const MsgInstantExpiryFuturesMarketLaunchResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse", + is(o: any): o is MsgInstantExpiryFuturesMarketLaunchResponse { + return o && o.$typeUrl === MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl; + }, + isAmino(o: any): o is MsgInstantExpiryFuturesMarketLaunchResponseAmino { + return o && o.$typeUrl === MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl; + }, + encode(_: MsgInstantExpiryFuturesMarketLaunchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantExpiryFuturesMarketLaunchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgInstantExpiryFuturesMarketLaunchResponse { + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + return message; + }, + fromAmino(_: MsgInstantExpiryFuturesMarketLaunchResponseAmino): MsgInstantExpiryFuturesMarketLaunchResponse { + const message = createBaseMsgInstantExpiryFuturesMarketLaunchResponse(); + return message; + }, + toAmino(_: MsgInstantExpiryFuturesMarketLaunchResponse): MsgInstantExpiryFuturesMarketLaunchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgInstantExpiryFuturesMarketLaunchResponseAminoMsg): MsgInstantExpiryFuturesMarketLaunchResponse { + return MsgInstantExpiryFuturesMarketLaunchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg): MsgInstantExpiryFuturesMarketLaunchResponse { + return MsgInstantExpiryFuturesMarketLaunchResponse.decode(message.value); + }, + toProto(message: MsgInstantExpiryFuturesMarketLaunchResponse): Uint8Array { + return MsgInstantExpiryFuturesMarketLaunchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantExpiryFuturesMarketLaunchResponse): MsgInstantExpiryFuturesMarketLaunchResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunchResponse", + value: MsgInstantExpiryFuturesMarketLaunchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantExpiryFuturesMarketLaunchResponse.typeUrl, MsgInstantExpiryFuturesMarketLaunchResponse); +function createBaseMsgCreateSpotMarketOrder(): MsgCreateSpotMarketOrder { + return { + sender: "", + order: SpotOrder.fromPartial({}) + }; +} +export const MsgCreateSpotMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder", + aminoType: "exchange/MsgCreateSpotMarketOrder", + is(o: any): o is MsgCreateSpotMarketOrder { + return o && (o.$typeUrl === MsgCreateSpotMarketOrder.typeUrl || typeof o.sender === "string" && SpotOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateSpotMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateSpotMarketOrder.typeUrl || typeof o.sender === "string" && SpotOrder.isAmino(o.order)); + }, + encode(message: MsgCreateSpotMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotMarketOrder { + const message = createBaseMsgCreateSpotMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateSpotMarketOrderAmino): MsgCreateSpotMarketOrder { + const message = createBaseMsgCreateSpotMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotMarketOrderAminoMsg): MsgCreateSpotMarketOrder { + return MsgCreateSpotMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateSpotMarketOrder", + value: MsgCreateSpotMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateSpotMarketOrderProtoMsg): MsgCreateSpotMarketOrder { + return MsgCreateSpotMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateSpotMarketOrder): Uint8Array { + return MsgCreateSpotMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotMarketOrder): MsgCreateSpotMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder", + value: MsgCreateSpotMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotMarketOrder.typeUrl, MsgCreateSpotMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateSpotMarketOrder.aminoType, MsgCreateSpotMarketOrder.typeUrl); +function createBaseMsgCreateSpotMarketOrderResponse(): MsgCreateSpotMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateSpotMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse", + is(o: any): o is MsgCreateSpotMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateSpotMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateSpotMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateSpotMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateSpotMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + SpotMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateSpotMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateSpotMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = SpotMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateSpotMarketOrderResponse { + const message = createBaseMsgCreateSpotMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? SpotMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateSpotMarketOrderResponseAmino): MsgCreateSpotMarketOrderResponse { + const message = createBaseMsgCreateSpotMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = SpotMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateSpotMarketOrderResponse): MsgCreateSpotMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? SpotMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateSpotMarketOrderResponseAminoMsg): MsgCreateSpotMarketOrderResponse { + return MsgCreateSpotMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateSpotMarketOrderResponseProtoMsg): MsgCreateSpotMarketOrderResponse { + return MsgCreateSpotMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateSpotMarketOrderResponse): Uint8Array { + return MsgCreateSpotMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateSpotMarketOrderResponse): MsgCreateSpotMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrderResponse", + value: MsgCreateSpotMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateSpotMarketOrderResponse.typeUrl, MsgCreateSpotMarketOrderResponse); +function createBaseSpotMarketOrderResults(): SpotMarketOrderResults { + return { + quantity: "", + price: "", + fee: "" + }; +} +export const SpotMarketOrderResults = { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults", + is(o: any): o is SpotMarketOrderResults { + return o && (o.$typeUrl === SpotMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string"); + }, + isAmino(o: any): o is SpotMarketOrderResultsAmino { + return o && (o.$typeUrl === SpotMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string"); + }, + encode(message: SpotMarketOrderResults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.fee !== "") { + writer.uint32(26).string(message.fee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotMarketOrderResults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotMarketOrderResults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.fee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotMarketOrderResults { + const message = createBaseSpotMarketOrderResults(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.fee = object.fee ?? ""; + return message; + }, + fromAmino(object: SpotMarketOrderResultsAmino): SpotMarketOrderResults { + const message = createBaseSpotMarketOrderResults(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + return message; + }, + toAmino(message: SpotMarketOrderResults): SpotMarketOrderResultsAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.fee = message.fee === "" ? undefined : message.fee; + return obj; + }, + fromAminoMsg(object: SpotMarketOrderResultsAminoMsg): SpotMarketOrderResults { + return SpotMarketOrderResults.fromAmino(object.value); + }, + fromProtoMsg(message: SpotMarketOrderResultsProtoMsg): SpotMarketOrderResults { + return SpotMarketOrderResults.decode(message.value); + }, + toProto(message: SpotMarketOrderResults): Uint8Array { + return SpotMarketOrderResults.encode(message).finish(); + }, + toProtoMsg(message: SpotMarketOrderResults): SpotMarketOrderResultsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.SpotMarketOrderResults", + value: SpotMarketOrderResults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotMarketOrderResults.typeUrl, SpotMarketOrderResults); +function createBaseMsgCreateDerivativeLimitOrder(): MsgCreateDerivativeLimitOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateDerivativeLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder", + aminoType: "exchange/MsgCreateDerivativeLimitOrder", + is(o: any): o is MsgCreateDerivativeLimitOrder { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateDerivativeLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateDerivativeLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeLimitOrder { + const message = createBaseMsgCreateDerivativeLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateDerivativeLimitOrderAmino): MsgCreateDerivativeLimitOrder { + const message = createBaseMsgCreateDerivativeLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeLimitOrderAminoMsg): MsgCreateDerivativeLimitOrder { + return MsgCreateDerivativeLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateDerivativeLimitOrder", + value: MsgCreateDerivativeLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDerivativeLimitOrderProtoMsg): MsgCreateDerivativeLimitOrder { + return MsgCreateDerivativeLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateDerivativeLimitOrder): Uint8Array { + return MsgCreateDerivativeLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeLimitOrder): MsgCreateDerivativeLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder", + value: MsgCreateDerivativeLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeLimitOrder.typeUrl, MsgCreateDerivativeLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDerivativeLimitOrder.aminoType, MsgCreateDerivativeLimitOrder.typeUrl); +function createBaseMsgCreateDerivativeLimitOrderResponse(): MsgCreateDerivativeLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateDerivativeLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse", + is(o: any): o is MsgCreateDerivativeLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateDerivativeLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateDerivativeLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateDerivativeLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeLimitOrderResponse { + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateDerivativeLimitOrderResponseAmino): MsgCreateDerivativeLimitOrderResponse { + const message = createBaseMsgCreateDerivativeLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateDerivativeLimitOrderResponse): MsgCreateDerivativeLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeLimitOrderResponseAminoMsg): MsgCreateDerivativeLimitOrderResponse { + return MsgCreateDerivativeLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDerivativeLimitOrderResponseProtoMsg): MsgCreateDerivativeLimitOrderResponse { + return MsgCreateDerivativeLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateDerivativeLimitOrderResponse): Uint8Array { + return MsgCreateDerivativeLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeLimitOrderResponse): MsgCreateDerivativeLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrderResponse", + value: MsgCreateDerivativeLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeLimitOrderResponse.typeUrl, MsgCreateDerivativeLimitOrderResponse); +function createBaseMsgCreateBinaryOptionsLimitOrder(): MsgCreateBinaryOptionsLimitOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateBinaryOptionsLimitOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder", + aminoType: "exchange/MsgCreateBinaryOptionsLimitOrder", + is(o: any): o is MsgCreateBinaryOptionsLimitOrder { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsLimitOrderAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateBinaryOptionsLimitOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsLimitOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsLimitOrder { + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsLimitOrderAmino): MsgCreateBinaryOptionsLimitOrder { + const message = createBaseMsgCreateBinaryOptionsLimitOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsLimitOrderAminoMsg): MsgCreateBinaryOptionsLimitOrder { + return MsgCreateBinaryOptionsLimitOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderAminoMsg { + return { + type: "exchange/MsgCreateBinaryOptionsLimitOrder", + value: MsgCreateBinaryOptionsLimitOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateBinaryOptionsLimitOrderProtoMsg): MsgCreateBinaryOptionsLimitOrder { + return MsgCreateBinaryOptionsLimitOrder.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsLimitOrder): Uint8Array { + return MsgCreateBinaryOptionsLimitOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsLimitOrder): MsgCreateBinaryOptionsLimitOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder", + value: MsgCreateBinaryOptionsLimitOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsLimitOrder.typeUrl, MsgCreateBinaryOptionsLimitOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBinaryOptionsLimitOrder.aminoType, MsgCreateBinaryOptionsLimitOrder.typeUrl); +function createBaseMsgCreateBinaryOptionsLimitOrderResponse(): MsgCreateBinaryOptionsLimitOrderResponse { + return { + orderHash: "", + cid: "" + }; +} +export const MsgCreateBinaryOptionsLimitOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse", + is(o: any): o is MsgCreateBinaryOptionsLimitOrderResponse { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsLimitOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsLimitOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateBinaryOptionsLimitOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(18).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsLimitOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsLimitOrderResponse { + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsLimitOrderResponseAmino): MsgCreateBinaryOptionsLimitOrderResponse { + const message = createBaseMsgCreateBinaryOptionsLimitOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsLimitOrderResponse): MsgCreateBinaryOptionsLimitOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsLimitOrderResponseAminoMsg): MsgCreateBinaryOptionsLimitOrderResponse { + return MsgCreateBinaryOptionsLimitOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateBinaryOptionsLimitOrderResponseProtoMsg): MsgCreateBinaryOptionsLimitOrderResponse { + return MsgCreateBinaryOptionsLimitOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsLimitOrderResponse): Uint8Array { + return MsgCreateBinaryOptionsLimitOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsLimitOrderResponse): MsgCreateBinaryOptionsLimitOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrderResponse", + value: MsgCreateBinaryOptionsLimitOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsLimitOrderResponse.typeUrl, MsgCreateBinaryOptionsLimitOrderResponse); +function createBaseMsgBatchCreateDerivativeLimitOrders(): MsgBatchCreateDerivativeLimitOrders { + return { + sender: "", + orders: [] + }; +} +export const MsgBatchCreateDerivativeLimitOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders", + aminoType: "exchange/MsgBatchCreateDerivativeLimitOrders", + is(o: any): o is MsgBatchCreateDerivativeLimitOrders { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || DerivativeOrder.is(o.orders[0]))); + }, + isAmino(o: any): o is MsgBatchCreateDerivativeLimitOrdersAmino { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.orders) && (!o.orders.length || DerivativeOrder.isAmino(o.orders[0]))); + }, + encode(message: MsgBatchCreateDerivativeLimitOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.orders) { + DerivativeOrder.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateDerivativeLimitOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orders.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateDerivativeLimitOrders { + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + message.sender = object.sender ?? ""; + message.orders = object.orders?.map(e => DerivativeOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCreateDerivativeLimitOrdersAmino): MsgBatchCreateDerivativeLimitOrders { + const message = createBaseMsgBatchCreateDerivativeLimitOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.orders = object.orders?.map(e => DerivativeOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.orders) { + obj.orders = message.orders.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateDerivativeLimitOrdersAminoMsg): MsgBatchCreateDerivativeLimitOrders { + return MsgBatchCreateDerivativeLimitOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersAminoMsg { + return { + type: "exchange/MsgBatchCreateDerivativeLimitOrders", + value: MsgBatchCreateDerivativeLimitOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersProtoMsg): MsgBatchCreateDerivativeLimitOrders { + return MsgBatchCreateDerivativeLimitOrders.decode(message.value); + }, + toProto(message: MsgBatchCreateDerivativeLimitOrders): Uint8Array { + return MsgBatchCreateDerivativeLimitOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateDerivativeLimitOrders): MsgBatchCreateDerivativeLimitOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders", + value: MsgBatchCreateDerivativeLimitOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateDerivativeLimitOrders.typeUrl, MsgBatchCreateDerivativeLimitOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCreateDerivativeLimitOrders.aminoType, MsgBatchCreateDerivativeLimitOrders.typeUrl); +function createBaseMsgBatchCreateDerivativeLimitOrdersResponse(): MsgBatchCreateDerivativeLimitOrdersResponse { + return { + orderHashes: [], + createdOrdersCids: [], + failedOrdersCids: [] + }; +} +export const MsgBatchCreateDerivativeLimitOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse", + is(o: any): o is MsgBatchCreateDerivativeLimitOrdersResponse { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl || Array.isArray(o.orderHashes) && (!o.orderHashes.length || typeof o.orderHashes[0] === "string") && Array.isArray(o.createdOrdersCids) && (!o.createdOrdersCids.length || typeof o.createdOrdersCids[0] === "string") && Array.isArray(o.failedOrdersCids) && (!o.failedOrdersCids.length || typeof o.failedOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchCreateDerivativeLimitOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl || Array.isArray(o.order_hashes) && (!o.order_hashes.length || typeof o.order_hashes[0] === "string") && Array.isArray(o.created_orders_cids) && (!o.created_orders_cids.length || typeof o.created_orders_cids[0] === "string") && Array.isArray(o.failed_orders_cids) && (!o.failed_orders_cids.length || typeof o.failed_orders_cids[0] === "string")); + }, + encode(message: MsgBatchCreateDerivativeLimitOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderHashes) { + writer.uint32(10).string(v!); + } + for (const v of message.createdOrdersCids) { + writer.uint32(18).string(v!); + } + for (const v of message.failedOrdersCids) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCreateDerivativeLimitOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHashes.push(reader.string()); + break; + case 2: + message.createdOrdersCids.push(reader.string()); + break; + case 3: + message.failedOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCreateDerivativeLimitOrdersResponse { + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + message.orderHashes = object.orderHashes?.map(e => e) || []; + message.createdOrdersCids = object.createdOrdersCids?.map(e => e) || []; + message.failedOrdersCids = object.failedOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCreateDerivativeLimitOrdersResponseAmino): MsgBatchCreateDerivativeLimitOrdersResponse { + const message = createBaseMsgBatchCreateDerivativeLimitOrdersResponse(); + message.orderHashes = object.order_hashes?.map(e => e) || []; + message.createdOrdersCids = object.created_orders_cids?.map(e => e) || []; + message.failedOrdersCids = object.failed_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCreateDerivativeLimitOrdersResponse): MsgBatchCreateDerivativeLimitOrdersResponseAmino { + const obj: any = {}; + if (message.orderHashes) { + obj.order_hashes = message.orderHashes.map(e => e); + } else { + obj.order_hashes = message.orderHashes; + } + if (message.createdOrdersCids) { + obj.created_orders_cids = message.createdOrdersCids.map(e => e); + } else { + obj.created_orders_cids = message.createdOrdersCids; + } + if (message.failedOrdersCids) { + obj.failed_orders_cids = message.failedOrdersCids.map(e => e); + } else { + obj.failed_orders_cids = message.failedOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCreateDerivativeLimitOrdersResponseAminoMsg): MsgBatchCreateDerivativeLimitOrdersResponse { + return MsgBatchCreateDerivativeLimitOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg): MsgBatchCreateDerivativeLimitOrdersResponse { + return MsgBatchCreateDerivativeLimitOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCreateDerivativeLimitOrdersResponse): Uint8Array { + return MsgBatchCreateDerivativeLimitOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCreateDerivativeLimitOrdersResponse): MsgBatchCreateDerivativeLimitOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrdersResponse", + value: MsgBatchCreateDerivativeLimitOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCreateDerivativeLimitOrdersResponse.typeUrl, MsgBatchCreateDerivativeLimitOrdersResponse); +function createBaseMsgCancelSpotOrder(): MsgCancelSpotOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + cid: "" + }; +} +export const MsgCancelSpotOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder", + aminoType: "exchange/MsgCancelSpotOrder", + is(o: any): o is MsgCancelSpotOrder { + return o && (o.$typeUrl === MsgCancelSpotOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelSpotOrderAmino { + return o && (o.$typeUrl === MsgCancelSpotOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCancelSpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelSpotOrder { + const message = createBaseMsgCancelSpotOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelSpotOrderAmino): MsgCancelSpotOrder { + const message = createBaseMsgCancelSpotOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelSpotOrder): MsgCancelSpotOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelSpotOrderAminoMsg): MsgCancelSpotOrder { + return MsgCancelSpotOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelSpotOrder): MsgCancelSpotOrderAminoMsg { + return { + type: "exchange/MsgCancelSpotOrder", + value: MsgCancelSpotOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelSpotOrderProtoMsg): MsgCancelSpotOrder { + return MsgCancelSpotOrder.decode(message.value); + }, + toProto(message: MsgCancelSpotOrder): Uint8Array { + return MsgCancelSpotOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSpotOrder): MsgCancelSpotOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrder", + value: MsgCancelSpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSpotOrder.typeUrl, MsgCancelSpotOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelSpotOrder.aminoType, MsgCancelSpotOrder.typeUrl); +function createBaseMsgCancelSpotOrderResponse(): MsgCancelSpotOrderResponse { + return {}; +} +export const MsgCancelSpotOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse", + is(o: any): o is MsgCancelSpotOrderResponse { + return o && o.$typeUrl === MsgCancelSpotOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelSpotOrderResponseAmino { + return o && o.$typeUrl === MsgCancelSpotOrderResponse.typeUrl; + }, + encode(_: MsgCancelSpotOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSpotOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSpotOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelSpotOrderResponse { + const message = createBaseMsgCancelSpotOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelSpotOrderResponseAmino): MsgCancelSpotOrderResponse { + const message = createBaseMsgCancelSpotOrderResponse(); + return message; + }, + toAmino(_: MsgCancelSpotOrderResponse): MsgCancelSpotOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelSpotOrderResponseAminoMsg): MsgCancelSpotOrderResponse { + return MsgCancelSpotOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelSpotOrderResponseProtoMsg): MsgCancelSpotOrderResponse { + return MsgCancelSpotOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelSpotOrderResponse): Uint8Array { + return MsgCancelSpotOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSpotOrderResponse): MsgCancelSpotOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelSpotOrderResponse", + value: MsgCancelSpotOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSpotOrderResponse.typeUrl, MsgCancelSpotOrderResponse); +function createBaseMsgBatchCancelSpotOrders(): MsgBatchCancelSpotOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelSpotOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders", + aminoType: "exchange/MsgBatchCancelSpotOrders", + is(o: any): o is MsgBatchCancelSpotOrders { + return o && (o.$typeUrl === MsgBatchCancelSpotOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelSpotOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelSpotOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelSpotOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelSpotOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelSpotOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelSpotOrders { + const message = createBaseMsgBatchCancelSpotOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelSpotOrdersAmino): MsgBatchCancelSpotOrders { + const message = createBaseMsgBatchCancelSpotOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelSpotOrdersAminoMsg): MsgBatchCancelSpotOrders { + return MsgBatchCancelSpotOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelSpotOrders", + value: MsgBatchCancelSpotOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelSpotOrdersProtoMsg): MsgBatchCancelSpotOrders { + return MsgBatchCancelSpotOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelSpotOrders): Uint8Array { + return MsgBatchCancelSpotOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelSpotOrders): MsgBatchCancelSpotOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders", + value: MsgBatchCancelSpotOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelSpotOrders.typeUrl, MsgBatchCancelSpotOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelSpotOrders.aminoType, MsgBatchCancelSpotOrders.typeUrl); +function createBaseMsgBatchCancelSpotOrdersResponse(): MsgBatchCancelSpotOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelSpotOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse", + is(o: any): o is MsgBatchCancelSpotOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelSpotOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelSpotOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelSpotOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelSpotOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelSpotOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelSpotOrdersResponse { + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelSpotOrdersResponseAmino): MsgBatchCancelSpotOrdersResponse { + const message = createBaseMsgBatchCancelSpotOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelSpotOrdersResponse): MsgBatchCancelSpotOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelSpotOrdersResponseAminoMsg): MsgBatchCancelSpotOrdersResponse { + return MsgBatchCancelSpotOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelSpotOrdersResponseProtoMsg): MsgBatchCancelSpotOrdersResponse { + return MsgBatchCancelSpotOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelSpotOrdersResponse): Uint8Array { + return MsgBatchCancelSpotOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelSpotOrdersResponse): MsgBatchCancelSpotOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrdersResponse", + value: MsgBatchCancelSpotOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelSpotOrdersResponse.typeUrl, MsgBatchCancelSpotOrdersResponse); +function createBaseMsgBatchCancelBinaryOptionsOrders(): MsgBatchCancelBinaryOptionsOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelBinaryOptionsOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders", + aminoType: "exchange/MsgBatchCancelBinaryOptionsOrders", + is(o: any): o is MsgBatchCancelBinaryOptionsOrders { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelBinaryOptionsOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelBinaryOptionsOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelBinaryOptionsOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelBinaryOptionsOrders { + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelBinaryOptionsOrdersAmino): MsgBatchCancelBinaryOptionsOrders { + const message = createBaseMsgBatchCancelBinaryOptionsOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelBinaryOptionsOrdersAminoMsg): MsgBatchCancelBinaryOptionsOrders { + return MsgBatchCancelBinaryOptionsOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelBinaryOptionsOrders", + value: MsgBatchCancelBinaryOptionsOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersProtoMsg): MsgBatchCancelBinaryOptionsOrders { + return MsgBatchCancelBinaryOptionsOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelBinaryOptionsOrders): Uint8Array { + return MsgBatchCancelBinaryOptionsOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelBinaryOptionsOrders): MsgBatchCancelBinaryOptionsOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders", + value: MsgBatchCancelBinaryOptionsOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelBinaryOptionsOrders.typeUrl, MsgBatchCancelBinaryOptionsOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelBinaryOptionsOrders.aminoType, MsgBatchCancelBinaryOptionsOrders.typeUrl); +function createBaseMsgBatchCancelBinaryOptionsOrdersResponse(): MsgBatchCancelBinaryOptionsOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelBinaryOptionsOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse", + is(o: any): o is MsgBatchCancelBinaryOptionsOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelBinaryOptionsOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelBinaryOptionsOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelBinaryOptionsOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelBinaryOptionsOrdersResponse { + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelBinaryOptionsOrdersResponseAmino): MsgBatchCancelBinaryOptionsOrdersResponse { + const message = createBaseMsgBatchCancelBinaryOptionsOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelBinaryOptionsOrdersResponse): MsgBatchCancelBinaryOptionsOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelBinaryOptionsOrdersResponseAminoMsg): MsgBatchCancelBinaryOptionsOrdersResponse { + return MsgBatchCancelBinaryOptionsOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg): MsgBatchCancelBinaryOptionsOrdersResponse { + return MsgBatchCancelBinaryOptionsOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelBinaryOptionsOrdersResponse): Uint8Array { + return MsgBatchCancelBinaryOptionsOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelBinaryOptionsOrdersResponse): MsgBatchCancelBinaryOptionsOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrdersResponse", + value: MsgBatchCancelBinaryOptionsOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelBinaryOptionsOrdersResponse.typeUrl, MsgBatchCancelBinaryOptionsOrdersResponse); +function createBaseMsgBatchUpdateOrders(): MsgBatchUpdateOrders { + return { + sender: "", + subaccountId: "", + spotMarketIdsToCancelAll: [], + derivativeMarketIdsToCancelAll: [], + spotOrdersToCancel: [], + derivativeOrdersToCancel: [], + spotOrdersToCreate: [], + derivativeOrdersToCreate: [], + binaryOptionsOrdersToCancel: [], + binaryOptionsMarketIdsToCancelAll: [], + binaryOptionsOrdersToCreate: [] + }; +} +export const MsgBatchUpdateOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders", + aminoType: "exchange/MsgBatchUpdateOrders", + is(o: any): o is MsgBatchUpdateOrders { + return o && (o.$typeUrl === MsgBatchUpdateOrders.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && Array.isArray(o.spotMarketIdsToCancelAll) && (!o.spotMarketIdsToCancelAll.length || typeof o.spotMarketIdsToCancelAll[0] === "string") && Array.isArray(o.derivativeMarketIdsToCancelAll) && (!o.derivativeMarketIdsToCancelAll.length || typeof o.derivativeMarketIdsToCancelAll[0] === "string") && Array.isArray(o.binaryOptionsMarketIdsToCancelAll) && (!o.binaryOptionsMarketIdsToCancelAll.length || typeof o.binaryOptionsMarketIdsToCancelAll[0] === "string")); + }, + isAmino(o: any): o is MsgBatchUpdateOrdersAmino { + return o && (o.$typeUrl === MsgBatchUpdateOrders.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && Array.isArray(o.spot_market_ids_to_cancel_all) && (!o.spot_market_ids_to_cancel_all.length || typeof o.spot_market_ids_to_cancel_all[0] === "string") && Array.isArray(o.derivative_market_ids_to_cancel_all) && (!o.derivative_market_ids_to_cancel_all.length || typeof o.derivative_market_ids_to_cancel_all[0] === "string") && Array.isArray(o.binary_options_market_ids_to_cancel_all) && (!o.binary_options_market_ids_to_cancel_all.length || typeof o.binary_options_market_ids_to_cancel_all[0] === "string")); + }, + encode(message: MsgBatchUpdateOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + for (const v of message.spotMarketIdsToCancelAll) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeMarketIdsToCancelAll) { + writer.uint32(34).string(v!); + } + for (const v of message.spotOrdersToCancel) { + OrderData.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.derivativeOrdersToCancel) { + OrderData.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.spotOrdersToCreate) { + SpotOrder.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.derivativeOrdersToCreate) { + DerivativeOrder.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.binaryOptionsOrdersToCancel) { + OrderData.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.binaryOptionsMarketIdsToCancelAll) { + writer.uint32(82).string(v!); + } + for (const v of message.binaryOptionsOrdersToCreate) { + DerivativeOrder.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchUpdateOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchUpdateOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.spotMarketIdsToCancelAll.push(reader.string()); + break; + case 4: + message.derivativeMarketIdsToCancelAll.push(reader.string()); + break; + case 5: + message.spotOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 6: + message.derivativeOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 7: + message.spotOrdersToCreate.push(SpotOrder.decode(reader, reader.uint32())); + break; + case 8: + message.derivativeOrdersToCreate.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + case 9: + message.binaryOptionsOrdersToCancel.push(OrderData.decode(reader, reader.uint32())); + break; + case 10: + message.binaryOptionsMarketIdsToCancelAll.push(reader.string()); + break; + case 11: + message.binaryOptionsOrdersToCreate.push(DerivativeOrder.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchUpdateOrders { + const message = createBaseMsgBatchUpdateOrders(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.spotMarketIdsToCancelAll = object.spotMarketIdsToCancelAll?.map(e => e) || []; + message.derivativeMarketIdsToCancelAll = object.derivativeMarketIdsToCancelAll?.map(e => e) || []; + message.spotOrdersToCancel = object.spotOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.derivativeOrdersToCancel = object.derivativeOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.spotOrdersToCreate = object.spotOrdersToCreate?.map(e => SpotOrder.fromPartial(e)) || []; + message.derivativeOrdersToCreate = object.derivativeOrdersToCreate?.map(e => DerivativeOrder.fromPartial(e)) || []; + message.binaryOptionsOrdersToCancel = object.binaryOptionsOrdersToCancel?.map(e => OrderData.fromPartial(e)) || []; + message.binaryOptionsMarketIdsToCancelAll = object.binaryOptionsMarketIdsToCancelAll?.map(e => e) || []; + message.binaryOptionsOrdersToCreate = object.binaryOptionsOrdersToCreate?.map(e => DerivativeOrder.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchUpdateOrdersAmino): MsgBatchUpdateOrders { + const message = createBaseMsgBatchUpdateOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.spotMarketIdsToCancelAll = object.spot_market_ids_to_cancel_all?.map(e => e) || []; + message.derivativeMarketIdsToCancelAll = object.derivative_market_ids_to_cancel_all?.map(e => e) || []; + message.spotOrdersToCancel = object.spot_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.derivativeOrdersToCancel = object.derivative_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.spotOrdersToCreate = object.spot_orders_to_create?.map(e => SpotOrder.fromAmino(e)) || []; + message.derivativeOrdersToCreate = object.derivative_orders_to_create?.map(e => DerivativeOrder.fromAmino(e)) || []; + message.binaryOptionsOrdersToCancel = object.binary_options_orders_to_cancel?.map(e => OrderData.fromAmino(e)) || []; + message.binaryOptionsMarketIdsToCancelAll = object.binary_options_market_ids_to_cancel_all?.map(e => e) || []; + message.binaryOptionsOrdersToCreate = object.binary_options_orders_to_create?.map(e => DerivativeOrder.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.spotMarketIdsToCancelAll) { + obj.spot_market_ids_to_cancel_all = message.spotMarketIdsToCancelAll.map(e => e); + } else { + obj.spot_market_ids_to_cancel_all = message.spotMarketIdsToCancelAll; + } + if (message.derivativeMarketIdsToCancelAll) { + obj.derivative_market_ids_to_cancel_all = message.derivativeMarketIdsToCancelAll.map(e => e); + } else { + obj.derivative_market_ids_to_cancel_all = message.derivativeMarketIdsToCancelAll; + } + if (message.spotOrdersToCancel) { + obj.spot_orders_to_cancel = message.spotOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.spot_orders_to_cancel = message.spotOrdersToCancel; + } + if (message.derivativeOrdersToCancel) { + obj.derivative_orders_to_cancel = message.derivativeOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.derivative_orders_to_cancel = message.derivativeOrdersToCancel; + } + if (message.spotOrdersToCreate) { + obj.spot_orders_to_create = message.spotOrdersToCreate.map(e => e ? SpotOrder.toAmino(e) : undefined); + } else { + obj.spot_orders_to_create = message.spotOrdersToCreate; + } + if (message.derivativeOrdersToCreate) { + obj.derivative_orders_to_create = message.derivativeOrdersToCreate.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.derivative_orders_to_create = message.derivativeOrdersToCreate; + } + if (message.binaryOptionsOrdersToCancel) { + obj.binary_options_orders_to_cancel = message.binaryOptionsOrdersToCancel.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.binary_options_orders_to_cancel = message.binaryOptionsOrdersToCancel; + } + if (message.binaryOptionsMarketIdsToCancelAll) { + obj.binary_options_market_ids_to_cancel_all = message.binaryOptionsMarketIdsToCancelAll.map(e => e); + } else { + obj.binary_options_market_ids_to_cancel_all = message.binaryOptionsMarketIdsToCancelAll; + } + if (message.binaryOptionsOrdersToCreate) { + obj.binary_options_orders_to_create = message.binaryOptionsOrdersToCreate.map(e => e ? DerivativeOrder.toAmino(e) : undefined); + } else { + obj.binary_options_orders_to_create = message.binaryOptionsOrdersToCreate; + } + return obj; + }, + fromAminoMsg(object: MsgBatchUpdateOrdersAminoMsg): MsgBatchUpdateOrders { + return MsgBatchUpdateOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersAminoMsg { + return { + type: "exchange/MsgBatchUpdateOrders", + value: MsgBatchUpdateOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchUpdateOrdersProtoMsg): MsgBatchUpdateOrders { + return MsgBatchUpdateOrders.decode(message.value); + }, + toProto(message: MsgBatchUpdateOrders): Uint8Array { + return MsgBatchUpdateOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchUpdateOrders): MsgBatchUpdateOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrders", + value: MsgBatchUpdateOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchUpdateOrders.typeUrl, MsgBatchUpdateOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchUpdateOrders.aminoType, MsgBatchUpdateOrders.typeUrl); +function createBaseMsgBatchUpdateOrdersResponse(): MsgBatchUpdateOrdersResponse { + return { + spotCancelSuccess: [], + derivativeCancelSuccess: [], + spotOrderHashes: [], + derivativeOrderHashes: [], + binaryOptionsCancelSuccess: [], + binaryOptionsOrderHashes: [], + createdSpotOrdersCids: [], + failedSpotOrdersCids: [], + createdDerivativeOrdersCids: [], + failedDerivativeOrdersCids: [], + createdBinaryOptionsOrdersCids: [], + failedBinaryOptionsOrdersCids: [] + }; +} +export const MsgBatchUpdateOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse", + is(o: any): o is MsgBatchUpdateOrdersResponse { + return o && (o.$typeUrl === MsgBatchUpdateOrdersResponse.typeUrl || Array.isArray(o.spotCancelSuccess) && (!o.spotCancelSuccess.length || typeof o.spotCancelSuccess[0] === "boolean") && Array.isArray(o.derivativeCancelSuccess) && (!o.derivativeCancelSuccess.length || typeof o.derivativeCancelSuccess[0] === "boolean") && Array.isArray(o.spotOrderHashes) && (!o.spotOrderHashes.length || typeof o.spotOrderHashes[0] === "string") && Array.isArray(o.derivativeOrderHashes) && (!o.derivativeOrderHashes.length || typeof o.derivativeOrderHashes[0] === "string") && Array.isArray(o.binaryOptionsCancelSuccess) && (!o.binaryOptionsCancelSuccess.length || typeof o.binaryOptionsCancelSuccess[0] === "boolean") && Array.isArray(o.binaryOptionsOrderHashes) && (!o.binaryOptionsOrderHashes.length || typeof o.binaryOptionsOrderHashes[0] === "string") && Array.isArray(o.createdSpotOrdersCids) && (!o.createdSpotOrdersCids.length || typeof o.createdSpotOrdersCids[0] === "string") && Array.isArray(o.failedSpotOrdersCids) && (!o.failedSpotOrdersCids.length || typeof o.failedSpotOrdersCids[0] === "string") && Array.isArray(o.createdDerivativeOrdersCids) && (!o.createdDerivativeOrdersCids.length || typeof o.createdDerivativeOrdersCids[0] === "string") && Array.isArray(o.failedDerivativeOrdersCids) && (!o.failedDerivativeOrdersCids.length || typeof o.failedDerivativeOrdersCids[0] === "string") && Array.isArray(o.createdBinaryOptionsOrdersCids) && (!o.createdBinaryOptionsOrdersCids.length || typeof o.createdBinaryOptionsOrdersCids[0] === "string") && Array.isArray(o.failedBinaryOptionsOrdersCids) && (!o.failedBinaryOptionsOrdersCids.length || typeof o.failedBinaryOptionsOrdersCids[0] === "string")); + }, + isAmino(o: any): o is MsgBatchUpdateOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchUpdateOrdersResponse.typeUrl || Array.isArray(o.spot_cancel_success) && (!o.spot_cancel_success.length || typeof o.spot_cancel_success[0] === "boolean") && Array.isArray(o.derivative_cancel_success) && (!o.derivative_cancel_success.length || typeof o.derivative_cancel_success[0] === "boolean") && Array.isArray(o.spot_order_hashes) && (!o.spot_order_hashes.length || typeof o.spot_order_hashes[0] === "string") && Array.isArray(o.derivative_order_hashes) && (!o.derivative_order_hashes.length || typeof o.derivative_order_hashes[0] === "string") && Array.isArray(o.binary_options_cancel_success) && (!o.binary_options_cancel_success.length || typeof o.binary_options_cancel_success[0] === "boolean") && Array.isArray(o.binary_options_order_hashes) && (!o.binary_options_order_hashes.length || typeof o.binary_options_order_hashes[0] === "string") && Array.isArray(o.created_spot_orders_cids) && (!o.created_spot_orders_cids.length || typeof o.created_spot_orders_cids[0] === "string") && Array.isArray(o.failed_spot_orders_cids) && (!o.failed_spot_orders_cids.length || typeof o.failed_spot_orders_cids[0] === "string") && Array.isArray(o.created_derivative_orders_cids) && (!o.created_derivative_orders_cids.length || typeof o.created_derivative_orders_cids[0] === "string") && Array.isArray(o.failed_derivative_orders_cids) && (!o.failed_derivative_orders_cids.length || typeof o.failed_derivative_orders_cids[0] === "string") && Array.isArray(o.created_binary_options_orders_cids) && (!o.created_binary_options_orders_cids.length || typeof o.created_binary_options_orders_cids[0] === "string") && Array.isArray(o.failed_binary_options_orders_cids) && (!o.failed_binary_options_orders_cids.length || typeof o.failed_binary_options_orders_cids[0] === "string")); + }, + encode(message: MsgBatchUpdateOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.spotCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.derivativeCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + for (const v of message.spotOrderHashes) { + writer.uint32(26).string(v!); + } + for (const v of message.derivativeOrderHashes) { + writer.uint32(34).string(v!); + } + writer.uint32(42).fork(); + for (const v of message.binaryOptionsCancelSuccess) { + writer.bool(v); + } + writer.ldelim(); + for (const v of message.binaryOptionsOrderHashes) { + writer.uint32(50).string(v!); + } + for (const v of message.createdSpotOrdersCids) { + writer.uint32(58).string(v!); + } + for (const v of message.failedSpotOrdersCids) { + writer.uint32(66).string(v!); + } + for (const v of message.createdDerivativeOrdersCids) { + writer.uint32(74).string(v!); + } + for (const v of message.failedDerivativeOrdersCids) { + writer.uint32(82).string(v!); + } + for (const v of message.createdBinaryOptionsOrdersCids) { + writer.uint32(90).string(v!); + } + for (const v of message.failedBinaryOptionsOrdersCids) { + writer.uint32(98).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchUpdateOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchUpdateOrdersResponse(); + 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.spotCancelSuccess.push(reader.bool()); + } + } else { + message.spotCancelSuccess.push(reader.bool()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.derivativeCancelSuccess.push(reader.bool()); + } + } else { + message.derivativeCancelSuccess.push(reader.bool()); + } + break; + case 3: + message.spotOrderHashes.push(reader.string()); + break; + case 4: + message.derivativeOrderHashes.push(reader.string()); + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.binaryOptionsCancelSuccess.push(reader.bool()); + } + } else { + message.binaryOptionsCancelSuccess.push(reader.bool()); + } + break; + case 6: + message.binaryOptionsOrderHashes.push(reader.string()); + break; + case 7: + message.createdSpotOrdersCids.push(reader.string()); + break; + case 8: + message.failedSpotOrdersCids.push(reader.string()); + break; + case 9: + message.createdDerivativeOrdersCids.push(reader.string()); + break; + case 10: + message.failedDerivativeOrdersCids.push(reader.string()); + break; + case 11: + message.createdBinaryOptionsOrdersCids.push(reader.string()); + break; + case 12: + message.failedBinaryOptionsOrdersCids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchUpdateOrdersResponse { + const message = createBaseMsgBatchUpdateOrdersResponse(); + message.spotCancelSuccess = object.spotCancelSuccess?.map(e => e) || []; + message.derivativeCancelSuccess = object.derivativeCancelSuccess?.map(e => e) || []; + message.spotOrderHashes = object.spotOrderHashes?.map(e => e) || []; + message.derivativeOrderHashes = object.derivativeOrderHashes?.map(e => e) || []; + message.binaryOptionsCancelSuccess = object.binaryOptionsCancelSuccess?.map(e => e) || []; + message.binaryOptionsOrderHashes = object.binaryOptionsOrderHashes?.map(e => e) || []; + message.createdSpotOrdersCids = object.createdSpotOrdersCids?.map(e => e) || []; + message.failedSpotOrdersCids = object.failedSpotOrdersCids?.map(e => e) || []; + message.createdDerivativeOrdersCids = object.createdDerivativeOrdersCids?.map(e => e) || []; + message.failedDerivativeOrdersCids = object.failedDerivativeOrdersCids?.map(e => e) || []; + message.createdBinaryOptionsOrdersCids = object.createdBinaryOptionsOrdersCids?.map(e => e) || []; + message.failedBinaryOptionsOrdersCids = object.failedBinaryOptionsOrdersCids?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchUpdateOrdersResponseAmino): MsgBatchUpdateOrdersResponse { + const message = createBaseMsgBatchUpdateOrdersResponse(); + message.spotCancelSuccess = object.spot_cancel_success?.map(e => e) || []; + message.derivativeCancelSuccess = object.derivative_cancel_success?.map(e => e) || []; + message.spotOrderHashes = object.spot_order_hashes?.map(e => e) || []; + message.derivativeOrderHashes = object.derivative_order_hashes?.map(e => e) || []; + message.binaryOptionsCancelSuccess = object.binary_options_cancel_success?.map(e => e) || []; + message.binaryOptionsOrderHashes = object.binary_options_order_hashes?.map(e => e) || []; + message.createdSpotOrdersCids = object.created_spot_orders_cids?.map(e => e) || []; + message.failedSpotOrdersCids = object.failed_spot_orders_cids?.map(e => e) || []; + message.createdDerivativeOrdersCids = object.created_derivative_orders_cids?.map(e => e) || []; + message.failedDerivativeOrdersCids = object.failed_derivative_orders_cids?.map(e => e) || []; + message.createdBinaryOptionsOrdersCids = object.created_binary_options_orders_cids?.map(e => e) || []; + message.failedBinaryOptionsOrdersCids = object.failed_binary_options_orders_cids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchUpdateOrdersResponse): MsgBatchUpdateOrdersResponseAmino { + const obj: any = {}; + if (message.spotCancelSuccess) { + obj.spot_cancel_success = message.spotCancelSuccess.map(e => e); + } else { + obj.spot_cancel_success = message.spotCancelSuccess; + } + if (message.derivativeCancelSuccess) { + obj.derivative_cancel_success = message.derivativeCancelSuccess.map(e => e); + } else { + obj.derivative_cancel_success = message.derivativeCancelSuccess; + } + if (message.spotOrderHashes) { + obj.spot_order_hashes = message.spotOrderHashes.map(e => e); + } else { + obj.spot_order_hashes = message.spotOrderHashes; + } + if (message.derivativeOrderHashes) { + obj.derivative_order_hashes = message.derivativeOrderHashes.map(e => e); + } else { + obj.derivative_order_hashes = message.derivativeOrderHashes; + } + if (message.binaryOptionsCancelSuccess) { + obj.binary_options_cancel_success = message.binaryOptionsCancelSuccess.map(e => e); + } else { + obj.binary_options_cancel_success = message.binaryOptionsCancelSuccess; + } + if (message.binaryOptionsOrderHashes) { + obj.binary_options_order_hashes = message.binaryOptionsOrderHashes.map(e => e); + } else { + obj.binary_options_order_hashes = message.binaryOptionsOrderHashes; + } + if (message.createdSpotOrdersCids) { + obj.created_spot_orders_cids = message.createdSpotOrdersCids.map(e => e); + } else { + obj.created_spot_orders_cids = message.createdSpotOrdersCids; + } + if (message.failedSpotOrdersCids) { + obj.failed_spot_orders_cids = message.failedSpotOrdersCids.map(e => e); + } else { + obj.failed_spot_orders_cids = message.failedSpotOrdersCids; + } + if (message.createdDerivativeOrdersCids) { + obj.created_derivative_orders_cids = message.createdDerivativeOrdersCids.map(e => e); + } else { + obj.created_derivative_orders_cids = message.createdDerivativeOrdersCids; + } + if (message.failedDerivativeOrdersCids) { + obj.failed_derivative_orders_cids = message.failedDerivativeOrdersCids.map(e => e); + } else { + obj.failed_derivative_orders_cids = message.failedDerivativeOrdersCids; + } + if (message.createdBinaryOptionsOrdersCids) { + obj.created_binary_options_orders_cids = message.createdBinaryOptionsOrdersCids.map(e => e); + } else { + obj.created_binary_options_orders_cids = message.createdBinaryOptionsOrdersCids; + } + if (message.failedBinaryOptionsOrdersCids) { + obj.failed_binary_options_orders_cids = message.failedBinaryOptionsOrdersCids.map(e => e); + } else { + obj.failed_binary_options_orders_cids = message.failedBinaryOptionsOrdersCids; + } + return obj; + }, + fromAminoMsg(object: MsgBatchUpdateOrdersResponseAminoMsg): MsgBatchUpdateOrdersResponse { + return MsgBatchUpdateOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchUpdateOrdersResponseProtoMsg): MsgBatchUpdateOrdersResponse { + return MsgBatchUpdateOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchUpdateOrdersResponse): Uint8Array { + return MsgBatchUpdateOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchUpdateOrdersResponse): MsgBatchUpdateOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchUpdateOrdersResponse", + value: MsgBatchUpdateOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchUpdateOrdersResponse.typeUrl, MsgBatchUpdateOrdersResponse); +function createBaseMsgCreateDerivativeMarketOrder(): MsgCreateDerivativeMarketOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateDerivativeMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder", + aminoType: "exchange/MsgCreateDerivativeMarketOrder", + is(o: any): o is MsgCreateDerivativeMarketOrder { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateDerivativeMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateDerivativeMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeMarketOrder { + const message = createBaseMsgCreateDerivativeMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateDerivativeMarketOrderAmino): MsgCreateDerivativeMarketOrder { + const message = createBaseMsgCreateDerivativeMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeMarketOrderAminoMsg): MsgCreateDerivativeMarketOrder { + return MsgCreateDerivativeMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateDerivativeMarketOrder", + value: MsgCreateDerivativeMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDerivativeMarketOrderProtoMsg): MsgCreateDerivativeMarketOrder { + return MsgCreateDerivativeMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateDerivativeMarketOrder): Uint8Array { + return MsgCreateDerivativeMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeMarketOrder): MsgCreateDerivativeMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder", + value: MsgCreateDerivativeMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeMarketOrder.typeUrl, MsgCreateDerivativeMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDerivativeMarketOrder.aminoType, MsgCreateDerivativeMarketOrder.typeUrl); +function createBaseMsgCreateDerivativeMarketOrderResponse(): MsgCreateDerivativeMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateDerivativeMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse", + is(o: any): o is MsgCreateDerivativeMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateDerivativeMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateDerivativeMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateDerivativeMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + DerivativeMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDerivativeMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = DerivativeMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDerivativeMarketOrderResponse { + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? DerivativeMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateDerivativeMarketOrderResponseAmino): MsgCreateDerivativeMarketOrderResponse { + const message = createBaseMsgCreateDerivativeMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = DerivativeMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateDerivativeMarketOrderResponse): MsgCreateDerivativeMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? DerivativeMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateDerivativeMarketOrderResponseAminoMsg): MsgCreateDerivativeMarketOrderResponse { + return MsgCreateDerivativeMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDerivativeMarketOrderResponseProtoMsg): MsgCreateDerivativeMarketOrderResponse { + return MsgCreateDerivativeMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateDerivativeMarketOrderResponse): Uint8Array { + return MsgCreateDerivativeMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDerivativeMarketOrderResponse): MsgCreateDerivativeMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrderResponse", + value: MsgCreateDerivativeMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDerivativeMarketOrderResponse.typeUrl, MsgCreateDerivativeMarketOrderResponse); +function createBaseDerivativeMarketOrderResults(): DerivativeMarketOrderResults { + return { + quantity: "", + price: "", + fee: "", + positionDelta: PositionDelta.fromPartial({}), + payout: "" + }; +} +export const DerivativeMarketOrderResults = { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults", + is(o: any): o is DerivativeMarketOrderResults { + return o && (o.$typeUrl === DerivativeMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string" && PositionDelta.is(o.positionDelta) && typeof o.payout === "string"); + }, + isAmino(o: any): o is DerivativeMarketOrderResultsAmino { + return o && (o.$typeUrl === DerivativeMarketOrderResults.typeUrl || typeof o.quantity === "string" && typeof o.price === "string" && typeof o.fee === "string" && PositionDelta.isAmino(o.position_delta) && typeof o.payout === "string"); + }, + encode(message: DerivativeMarketOrderResults, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quantity !== "") { + writer.uint32(10).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.fee !== "") { + writer.uint32(26).string(message.fee); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(34).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(42).string(message.payout); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeMarketOrderResults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeMarketOrderResults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.fee = reader.string(); + break; + case 4: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 5: + message.payout = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeMarketOrderResults { + const message = createBaseDerivativeMarketOrderResults(); + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.fee = object.fee ?? ""; + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + return message; + }, + fromAmino(object: DerivativeMarketOrderResultsAmino): DerivativeMarketOrderResults { + const message = createBaseDerivativeMarketOrderResults(); + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + return message; + }, + toAmino(message: DerivativeMarketOrderResults): DerivativeMarketOrderResultsAmino { + const obj: any = {}; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + return obj; + }, + fromAminoMsg(object: DerivativeMarketOrderResultsAminoMsg): DerivativeMarketOrderResults { + return DerivativeMarketOrderResults.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeMarketOrderResultsProtoMsg): DerivativeMarketOrderResults { + return DerivativeMarketOrderResults.decode(message.value); + }, + toProto(message: DerivativeMarketOrderResults): Uint8Array { + return DerivativeMarketOrderResults.encode(message).finish(); + }, + toProtoMsg(message: DerivativeMarketOrderResults): DerivativeMarketOrderResultsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.DerivativeMarketOrderResults", + value: DerivativeMarketOrderResults.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeMarketOrderResults.typeUrl, DerivativeMarketOrderResults); +function createBaseMsgCreateBinaryOptionsMarketOrder(): MsgCreateBinaryOptionsMarketOrder { + return { + sender: "", + order: DerivativeOrder.fromPartial({}) + }; +} +export const MsgCreateBinaryOptionsMarketOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder", + aminoType: "exchange/MsgCreateBinaryOptionsMarketOrder", + is(o: any): o is MsgCreateBinaryOptionsMarketOrder { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.is(o.order)); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsMarketOrderAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrder.typeUrl || typeof o.sender === "string" && DerivativeOrder.isAmino(o.order)); + }, + encode(message: MsgCreateBinaryOptionsMarketOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsMarketOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsMarketOrder { + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + message.sender = object.sender ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsMarketOrderAmino): MsgCreateBinaryOptionsMarketOrder { + const message = createBaseMsgCreateBinaryOptionsMarketOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsMarketOrderAminoMsg): MsgCreateBinaryOptionsMarketOrder { + return MsgCreateBinaryOptionsMarketOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderAminoMsg { + return { + type: "exchange/MsgCreateBinaryOptionsMarketOrder", + value: MsgCreateBinaryOptionsMarketOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateBinaryOptionsMarketOrderProtoMsg): MsgCreateBinaryOptionsMarketOrder { + return MsgCreateBinaryOptionsMarketOrder.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsMarketOrder): Uint8Array { + return MsgCreateBinaryOptionsMarketOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsMarketOrder): MsgCreateBinaryOptionsMarketOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder", + value: MsgCreateBinaryOptionsMarketOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsMarketOrder.typeUrl, MsgCreateBinaryOptionsMarketOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBinaryOptionsMarketOrder.aminoType, MsgCreateBinaryOptionsMarketOrder.typeUrl); +function createBaseMsgCreateBinaryOptionsMarketOrderResponse(): MsgCreateBinaryOptionsMarketOrderResponse { + return { + orderHash: "", + results: undefined, + cid: "" + }; +} +export const MsgCreateBinaryOptionsMarketOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse", + is(o: any): o is MsgCreateBinaryOptionsMarketOrderResponse { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrderResponse.typeUrl || typeof o.orderHash === "string" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCreateBinaryOptionsMarketOrderResponseAmino { + return o && (o.$typeUrl === MsgCreateBinaryOptionsMarketOrderResponse.typeUrl || typeof o.order_hash === "string" && typeof o.cid === "string"); + }, + encode(message: MsgCreateBinaryOptionsMarketOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderHash !== "") { + writer.uint32(10).string(message.orderHash); + } + if (message.results !== undefined) { + DerivativeMarketOrderResults.encode(message.results, writer.uint32(18).fork()).ldelim(); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBinaryOptionsMarketOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderHash = reader.string(); + break; + case 2: + message.results = DerivativeMarketOrderResults.decode(reader, reader.uint32()); + break; + case 3: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateBinaryOptionsMarketOrderResponse { + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + message.orderHash = object.orderHash ?? ""; + message.results = object.results !== undefined && object.results !== null ? DerivativeMarketOrderResults.fromPartial(object.results) : undefined; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCreateBinaryOptionsMarketOrderResponseAmino): MsgCreateBinaryOptionsMarketOrderResponse { + const message = createBaseMsgCreateBinaryOptionsMarketOrderResponse(); + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.results !== undefined && object.results !== null) { + message.results = DerivativeMarketOrderResults.fromAmino(object.results); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCreateBinaryOptionsMarketOrderResponse): MsgCreateBinaryOptionsMarketOrderResponseAmino { + const obj: any = {}; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.results = message.results ? DerivativeMarketOrderResults.toAmino(message.results) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCreateBinaryOptionsMarketOrderResponseAminoMsg): MsgCreateBinaryOptionsMarketOrderResponse { + return MsgCreateBinaryOptionsMarketOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateBinaryOptionsMarketOrderResponseProtoMsg): MsgCreateBinaryOptionsMarketOrderResponse { + return MsgCreateBinaryOptionsMarketOrderResponse.decode(message.value); + }, + toProto(message: MsgCreateBinaryOptionsMarketOrderResponse): Uint8Array { + return MsgCreateBinaryOptionsMarketOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateBinaryOptionsMarketOrderResponse): MsgCreateBinaryOptionsMarketOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrderResponse", + value: MsgCreateBinaryOptionsMarketOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateBinaryOptionsMarketOrderResponse.typeUrl, MsgCreateBinaryOptionsMarketOrderResponse); +function createBaseMsgCancelDerivativeOrder(): MsgCancelDerivativeOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const MsgCancelDerivativeOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder", + aminoType: "exchange/MsgCancelDerivativeOrder", + is(o: any): o is MsgCancelDerivativeOrder { + return o && (o.$typeUrl === MsgCancelDerivativeOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelDerivativeOrderAmino { + return o && (o.$typeUrl === MsgCancelDerivativeOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: MsgCancelDerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(40).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelDerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.orderMask = reader.int32(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelDerivativeOrder { + const message = createBaseMsgCancelDerivativeOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelDerivativeOrderAmino): MsgCancelDerivativeOrder { + const message = createBaseMsgCancelDerivativeOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelDerivativeOrderAminoMsg): MsgCancelDerivativeOrder { + return MsgCancelDerivativeOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderAminoMsg { + return { + type: "exchange/MsgCancelDerivativeOrder", + value: MsgCancelDerivativeOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelDerivativeOrderProtoMsg): MsgCancelDerivativeOrder { + return MsgCancelDerivativeOrder.decode(message.value); + }, + toProto(message: MsgCancelDerivativeOrder): Uint8Array { + return MsgCancelDerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelDerivativeOrder): MsgCancelDerivativeOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder", + value: MsgCancelDerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelDerivativeOrder.typeUrl, MsgCancelDerivativeOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelDerivativeOrder.aminoType, MsgCancelDerivativeOrder.typeUrl); +function createBaseMsgCancelDerivativeOrderResponse(): MsgCancelDerivativeOrderResponse { + return {}; +} +export const MsgCancelDerivativeOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse", + is(o: any): o is MsgCancelDerivativeOrderResponse { + return o && o.$typeUrl === MsgCancelDerivativeOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelDerivativeOrderResponseAmino { + return o && o.$typeUrl === MsgCancelDerivativeOrderResponse.typeUrl; + }, + encode(_: MsgCancelDerivativeOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelDerivativeOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelDerivativeOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelDerivativeOrderResponse { + const message = createBaseMsgCancelDerivativeOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelDerivativeOrderResponseAmino): MsgCancelDerivativeOrderResponse { + const message = createBaseMsgCancelDerivativeOrderResponse(); + return message; + }, + toAmino(_: MsgCancelDerivativeOrderResponse): MsgCancelDerivativeOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelDerivativeOrderResponseAminoMsg): MsgCancelDerivativeOrderResponse { + return MsgCancelDerivativeOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelDerivativeOrderResponseProtoMsg): MsgCancelDerivativeOrderResponse { + return MsgCancelDerivativeOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelDerivativeOrderResponse): Uint8Array { + return MsgCancelDerivativeOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelDerivativeOrderResponse): MsgCancelDerivativeOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelDerivativeOrderResponse", + value: MsgCancelDerivativeOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelDerivativeOrderResponse.typeUrl, MsgCancelDerivativeOrderResponse); +function createBaseMsgCancelBinaryOptionsOrder(): MsgCancelBinaryOptionsOrder { + return { + sender: "", + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const MsgCancelBinaryOptionsOrder = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder", + aminoType: "exchange/MsgCancelBinaryOptionsOrder", + is(o: any): o is MsgCancelBinaryOptionsOrder { + return o && (o.$typeUrl === MsgCancelBinaryOptionsOrder.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is MsgCancelBinaryOptionsOrderAmino { + return o && (o.$typeUrl === MsgCancelBinaryOptionsOrder.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: MsgCancelBinaryOptionsOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(26).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(34).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(40).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(50).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelBinaryOptionsOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelBinaryOptionsOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.subaccountId = reader.string(); + break; + case 4: + message.orderHash = reader.string(); + break; + case 5: + message.orderMask = reader.int32(); + break; + case 6: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelBinaryOptionsOrder { + const message = createBaseMsgCancelBinaryOptionsOrder(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: MsgCancelBinaryOptionsOrderAmino): MsgCancelBinaryOptionsOrder { + const message = createBaseMsgCancelBinaryOptionsOrder(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: MsgCancelBinaryOptionsOrderAminoMsg): MsgCancelBinaryOptionsOrder { + return MsgCancelBinaryOptionsOrder.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderAminoMsg { + return { + type: "exchange/MsgCancelBinaryOptionsOrder", + value: MsgCancelBinaryOptionsOrder.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelBinaryOptionsOrderProtoMsg): MsgCancelBinaryOptionsOrder { + return MsgCancelBinaryOptionsOrder.decode(message.value); + }, + toProto(message: MsgCancelBinaryOptionsOrder): Uint8Array { + return MsgCancelBinaryOptionsOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelBinaryOptionsOrder): MsgCancelBinaryOptionsOrderProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder", + value: MsgCancelBinaryOptionsOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelBinaryOptionsOrder.typeUrl, MsgCancelBinaryOptionsOrder); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelBinaryOptionsOrder.aminoType, MsgCancelBinaryOptionsOrder.typeUrl); +function createBaseMsgCancelBinaryOptionsOrderResponse(): MsgCancelBinaryOptionsOrderResponse { + return {}; +} +export const MsgCancelBinaryOptionsOrderResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse", + is(o: any): o is MsgCancelBinaryOptionsOrderResponse { + return o && o.$typeUrl === MsgCancelBinaryOptionsOrderResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelBinaryOptionsOrderResponseAmino { + return o && o.$typeUrl === MsgCancelBinaryOptionsOrderResponse.typeUrl; + }, + encode(_: MsgCancelBinaryOptionsOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelBinaryOptionsOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelBinaryOptionsOrderResponse { + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelBinaryOptionsOrderResponseAmino): MsgCancelBinaryOptionsOrderResponse { + const message = createBaseMsgCancelBinaryOptionsOrderResponse(); + return message; + }, + toAmino(_: MsgCancelBinaryOptionsOrderResponse): MsgCancelBinaryOptionsOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelBinaryOptionsOrderResponseAminoMsg): MsgCancelBinaryOptionsOrderResponse { + return MsgCancelBinaryOptionsOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelBinaryOptionsOrderResponseProtoMsg): MsgCancelBinaryOptionsOrderResponse { + return MsgCancelBinaryOptionsOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelBinaryOptionsOrderResponse): Uint8Array { + return MsgCancelBinaryOptionsOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelBinaryOptionsOrderResponse): MsgCancelBinaryOptionsOrderResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrderResponse", + value: MsgCancelBinaryOptionsOrderResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelBinaryOptionsOrderResponse.typeUrl, MsgCancelBinaryOptionsOrderResponse); +function createBaseOrderData(): OrderData { + return { + marketId: "", + subaccountId: "", + orderHash: "", + orderMask: 0, + cid: "" + }; +} +export const OrderData = { + typeUrl: "/injective.exchange.v1beta1.OrderData", + is(o: any): o is OrderData { + return o && (o.$typeUrl === OrderData.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.orderHash === "string" && typeof o.orderMask === "number" && typeof o.cid === "string"); + }, + isAmino(o: any): o is OrderDataAmino { + return o && (o.$typeUrl === OrderData.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.order_hash === "string" && typeof o.order_mask === "number" && typeof o.cid === "string"); + }, + encode(message: OrderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.orderHash !== "") { + writer.uint32(26).string(message.orderHash); + } + if (message.orderMask !== 0) { + writer.uint32(32).int32(message.orderMask); + } + if (message.cid !== "") { + writer.uint32(42).string(message.cid); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.orderHash = reader.string(); + break; + case 4: + message.orderMask = reader.int32(); + break; + case 5: + message.cid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderData { + const message = createBaseOrderData(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.orderHash = object.orderHash ?? ""; + message.orderMask = object.orderMask ?? 0; + message.cid = object.cid ?? ""; + return message; + }, + fromAmino(object: OrderDataAmino): OrderData { + const message = createBaseOrderData(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.order_mask !== undefined && object.order_mask !== null) { + message.orderMask = object.order_mask; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + return message; + }, + toAmino(message: OrderData): OrderDataAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.order_mask = message.orderMask === 0 ? undefined : message.orderMask; + obj.cid = message.cid === "" ? undefined : message.cid; + return obj; + }, + fromAminoMsg(object: OrderDataAminoMsg): OrderData { + return OrderData.fromAmino(object.value); + }, + fromProtoMsg(message: OrderDataProtoMsg): OrderData { + return OrderData.decode(message.value); + }, + toProto(message: OrderData): Uint8Array { + return OrderData.encode(message).finish(); + }, + toProtoMsg(message: OrderData): OrderDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.OrderData", + value: OrderData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderData.typeUrl, OrderData); +function createBaseMsgBatchCancelDerivativeOrders(): MsgBatchCancelDerivativeOrders { + return { + sender: "", + data: [] + }; +} +export const MsgBatchCancelDerivativeOrders = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders", + aminoType: "exchange/MsgBatchCancelDerivativeOrders", + is(o: any): o is MsgBatchCancelDerivativeOrders { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.is(o.data[0]))); + }, + isAmino(o: any): o is MsgBatchCancelDerivativeOrdersAmino { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrders.typeUrl || typeof o.sender === "string" && Array.isArray(o.data) && (!o.data.length || OrderData.isAmino(o.data[0]))); + }, + encode(message: MsgBatchCancelDerivativeOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.data) { + OrderData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelDerivativeOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelDerivativeOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.data.push(OrderData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelDerivativeOrders { + const message = createBaseMsgBatchCancelDerivativeOrders(); + message.sender = object.sender ?? ""; + message.data = object.data?.map(e => OrderData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelDerivativeOrdersAmino): MsgBatchCancelDerivativeOrders { + const message = createBaseMsgBatchCancelDerivativeOrders(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.data = object.data?.map(e => OrderData.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.data) { + obj.data = message.data.map(e => e ? OrderData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelDerivativeOrdersAminoMsg): MsgBatchCancelDerivativeOrders { + return MsgBatchCancelDerivativeOrders.fromAmino(object.value); + }, + toAminoMsg(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersAminoMsg { + return { + type: "exchange/MsgBatchCancelDerivativeOrders", + value: MsgBatchCancelDerivativeOrders.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBatchCancelDerivativeOrdersProtoMsg): MsgBatchCancelDerivativeOrders { + return MsgBatchCancelDerivativeOrders.decode(message.value); + }, + toProto(message: MsgBatchCancelDerivativeOrders): Uint8Array { + return MsgBatchCancelDerivativeOrders.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelDerivativeOrders): MsgBatchCancelDerivativeOrdersProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders", + value: MsgBatchCancelDerivativeOrders.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelDerivativeOrders.typeUrl, MsgBatchCancelDerivativeOrders); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBatchCancelDerivativeOrders.aminoType, MsgBatchCancelDerivativeOrders.typeUrl); +function createBaseMsgBatchCancelDerivativeOrdersResponse(): MsgBatchCancelDerivativeOrdersResponse { + return { + success: [] + }; +} +export const MsgBatchCancelDerivativeOrdersResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse", + is(o: any): o is MsgBatchCancelDerivativeOrdersResponse { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + isAmino(o: any): o is MsgBatchCancelDerivativeOrdersResponseAmino { + return o && (o.$typeUrl === MsgBatchCancelDerivativeOrdersResponse.typeUrl || Array.isArray(o.success) && (!o.success.length || typeof o.success[0] === "boolean")); + }, + encode(message: MsgBatchCancelDerivativeOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.success) { + writer.bool(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelDerivativeOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + 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.success.push(reader.bool()); + } + } else { + message.success.push(reader.bool()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBatchCancelDerivativeOrdersResponse { + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBatchCancelDerivativeOrdersResponseAmino): MsgBatchCancelDerivativeOrdersResponse { + const message = createBaseMsgBatchCancelDerivativeOrdersResponse(); + message.success = object.success?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBatchCancelDerivativeOrdersResponse): MsgBatchCancelDerivativeOrdersResponseAmino { + const obj: any = {}; + if (message.success) { + obj.success = message.success.map(e => e); + } else { + obj.success = message.success; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelDerivativeOrdersResponseAminoMsg): MsgBatchCancelDerivativeOrdersResponse { + return MsgBatchCancelDerivativeOrdersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelDerivativeOrdersResponseProtoMsg): MsgBatchCancelDerivativeOrdersResponse { + return MsgBatchCancelDerivativeOrdersResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelDerivativeOrdersResponse): Uint8Array { + return MsgBatchCancelDerivativeOrdersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelDerivativeOrdersResponse): MsgBatchCancelDerivativeOrdersResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrdersResponse", + value: MsgBatchCancelDerivativeOrdersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBatchCancelDerivativeOrdersResponse.typeUrl, MsgBatchCancelDerivativeOrdersResponse); +function createBaseMsgSubaccountTransfer(): MsgSubaccountTransfer { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgSubaccountTransfer = { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer", + aminoType: "exchange/MsgSubaccountTransfer", + is(o: any): o is MsgSubaccountTransfer { + return o && (o.$typeUrl === MsgSubaccountTransfer.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgSubaccountTransferAmino { + return o && (o.$typeUrl === MsgSubaccountTransfer.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgSubaccountTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubaccountTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubaccountTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubaccountTransfer { + const message = createBaseMsgSubaccountTransfer(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgSubaccountTransferAmino): MsgSubaccountTransfer { + const message = createBaseMsgSubaccountTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgSubaccountTransfer): MsgSubaccountTransferAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubaccountTransferAminoMsg): MsgSubaccountTransfer { + return MsgSubaccountTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubaccountTransfer): MsgSubaccountTransferAminoMsg { + return { + type: "exchange/MsgSubaccountTransfer", + value: MsgSubaccountTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubaccountTransferProtoMsg): MsgSubaccountTransfer { + return MsgSubaccountTransfer.decode(message.value); + }, + toProto(message: MsgSubaccountTransfer): Uint8Array { + return MsgSubaccountTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgSubaccountTransfer): MsgSubaccountTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransfer", + value: MsgSubaccountTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubaccountTransfer.typeUrl, MsgSubaccountTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubaccountTransfer.aminoType, MsgSubaccountTransfer.typeUrl); +function createBaseMsgSubaccountTransferResponse(): MsgSubaccountTransferResponse { + return {}; +} +export const MsgSubaccountTransferResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse", + is(o: any): o is MsgSubaccountTransferResponse { + return o && o.$typeUrl === MsgSubaccountTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubaccountTransferResponseAmino { + return o && o.$typeUrl === MsgSubaccountTransferResponse.typeUrl; + }, + encode(_: MsgSubaccountTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubaccountTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubaccountTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubaccountTransferResponse { + const message = createBaseMsgSubaccountTransferResponse(); + return message; + }, + fromAmino(_: MsgSubaccountTransferResponseAmino): MsgSubaccountTransferResponse { + const message = createBaseMsgSubaccountTransferResponse(); + return message; + }, + toAmino(_: MsgSubaccountTransferResponse): MsgSubaccountTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubaccountTransferResponseAminoMsg): MsgSubaccountTransferResponse { + return MsgSubaccountTransferResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubaccountTransferResponseProtoMsg): MsgSubaccountTransferResponse { + return MsgSubaccountTransferResponse.decode(message.value); + }, + toProto(message: MsgSubaccountTransferResponse): Uint8Array { + return MsgSubaccountTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubaccountTransferResponse): MsgSubaccountTransferResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSubaccountTransferResponse", + value: MsgSubaccountTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubaccountTransferResponse.typeUrl, MsgSubaccountTransferResponse); +function createBaseMsgExternalTransfer(): MsgExternalTransfer { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgExternalTransfer = { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer", + aminoType: "exchange/MsgExternalTransfer", + is(o: any): o is MsgExternalTransfer { + return o && (o.$typeUrl === MsgExternalTransfer.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgExternalTransferAmino { + return o && (o.$typeUrl === MsgExternalTransfer.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgExternalTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExternalTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExternalTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExternalTransfer { + const message = createBaseMsgExternalTransfer(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgExternalTransferAmino): MsgExternalTransfer { + const message = createBaseMsgExternalTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgExternalTransfer): MsgExternalTransferAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExternalTransferAminoMsg): MsgExternalTransfer { + return MsgExternalTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgExternalTransfer): MsgExternalTransferAminoMsg { + return { + type: "exchange/MsgExternalTransfer", + value: MsgExternalTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExternalTransferProtoMsg): MsgExternalTransfer { + return MsgExternalTransfer.decode(message.value); + }, + toProto(message: MsgExternalTransfer): Uint8Array { + return MsgExternalTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgExternalTransfer): MsgExternalTransferProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransfer", + value: MsgExternalTransfer.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExternalTransfer.typeUrl, MsgExternalTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExternalTransfer.aminoType, MsgExternalTransfer.typeUrl); +function createBaseMsgExternalTransferResponse(): MsgExternalTransferResponse { + return {}; +} +export const MsgExternalTransferResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse", + is(o: any): o is MsgExternalTransferResponse { + return o && o.$typeUrl === MsgExternalTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgExternalTransferResponseAmino { + return o && o.$typeUrl === MsgExternalTransferResponse.typeUrl; + }, + encode(_: MsgExternalTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExternalTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExternalTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgExternalTransferResponse { + const message = createBaseMsgExternalTransferResponse(); + return message; + }, + fromAmino(_: MsgExternalTransferResponseAmino): MsgExternalTransferResponse { + const message = createBaseMsgExternalTransferResponse(); + return message; + }, + toAmino(_: MsgExternalTransferResponse): MsgExternalTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExternalTransferResponseAminoMsg): MsgExternalTransferResponse { + return MsgExternalTransferResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExternalTransferResponseProtoMsg): MsgExternalTransferResponse { + return MsgExternalTransferResponse.decode(message.value); + }, + toProto(message: MsgExternalTransferResponse): Uint8Array { + return MsgExternalTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExternalTransferResponse): MsgExternalTransferResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgExternalTransferResponse", + value: MsgExternalTransferResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExternalTransferResponse.typeUrl, MsgExternalTransferResponse); +function createBaseMsgLiquidatePosition(): MsgLiquidatePosition { + return { + sender: "", + subaccountId: "", + marketId: "", + order: undefined + }; +} +export const MsgLiquidatePosition = { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition", + aminoType: "exchange/MsgLiquidatePosition", + is(o: any): o is MsgLiquidatePosition { + return o && (o.$typeUrl === MsgLiquidatePosition.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MsgLiquidatePositionAmino { + return o && (o.$typeUrl === MsgLiquidatePosition.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: MsgLiquidatePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidatePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidatePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.marketId = reader.string(); + break; + case 4: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgLiquidatePosition { + const message = createBaseMsgLiquidatePosition(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgLiquidatePositionAmino): MsgLiquidatePosition { + const message = createBaseMsgLiquidatePosition(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgLiquidatePosition): MsgLiquidatePositionAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidatePositionAminoMsg): MsgLiquidatePosition { + return MsgLiquidatePosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidatePosition): MsgLiquidatePositionAminoMsg { + return { + type: "exchange/MsgLiquidatePosition", + value: MsgLiquidatePosition.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLiquidatePositionProtoMsg): MsgLiquidatePosition { + return MsgLiquidatePosition.decode(message.value); + }, + toProto(message: MsgLiquidatePosition): Uint8Array { + return MsgLiquidatePosition.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidatePosition): MsgLiquidatePositionProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePosition", + value: MsgLiquidatePosition.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgLiquidatePosition.typeUrl, MsgLiquidatePosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLiquidatePosition.aminoType, MsgLiquidatePosition.typeUrl); +function createBaseMsgLiquidatePositionResponse(): MsgLiquidatePositionResponse { + return {}; +} +export const MsgLiquidatePositionResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse", + is(o: any): o is MsgLiquidatePositionResponse { + return o && o.$typeUrl === MsgLiquidatePositionResponse.typeUrl; + }, + isAmino(o: any): o is MsgLiquidatePositionResponseAmino { + return o && o.$typeUrl === MsgLiquidatePositionResponse.typeUrl; + }, + encode(_: MsgLiquidatePositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidatePositionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidatePositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgLiquidatePositionResponse { + const message = createBaseMsgLiquidatePositionResponse(); + return message; + }, + fromAmino(_: MsgLiquidatePositionResponseAmino): MsgLiquidatePositionResponse { + const message = createBaseMsgLiquidatePositionResponse(); + return message; + }, + toAmino(_: MsgLiquidatePositionResponse): MsgLiquidatePositionResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidatePositionResponseAminoMsg): MsgLiquidatePositionResponse { + return MsgLiquidatePositionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidatePositionResponseProtoMsg): MsgLiquidatePositionResponse { + return MsgLiquidatePositionResponse.decode(message.value); + }, + toProto(message: MsgLiquidatePositionResponse): Uint8Array { + return MsgLiquidatePositionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidatePositionResponse): MsgLiquidatePositionResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgLiquidatePositionResponse", + value: MsgLiquidatePositionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgLiquidatePositionResponse.typeUrl, MsgLiquidatePositionResponse); +function createBaseMsgEmergencySettleMarket(): MsgEmergencySettleMarket { + return { + sender: "", + subaccountId: "", + marketId: "" + }; +} +export const MsgEmergencySettleMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket", + aminoType: "exchange/MsgEmergencySettleMarket", + is(o: any): o is MsgEmergencySettleMarket { + return o && (o.$typeUrl === MsgEmergencySettleMarket.typeUrl || typeof o.sender === "string" && typeof o.subaccountId === "string" && typeof o.marketId === "string"); + }, + isAmino(o: any): o is MsgEmergencySettleMarketAmino { + return o && (o.$typeUrl === MsgEmergencySettleMarket.typeUrl || typeof o.sender === "string" && typeof o.subaccount_id === "string" && typeof o.market_id === "string"); + }, + encode(message: MsgEmergencySettleMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.marketId !== "") { + writer.uint32(26).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmergencySettleMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmergencySettleMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgEmergencySettleMarket { + const message = createBaseMsgEmergencySettleMarket(); + message.sender = object.sender ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: MsgEmergencySettleMarketAmino): MsgEmergencySettleMarket { + const message = createBaseMsgEmergencySettleMarket(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: MsgEmergencySettleMarketAminoMsg): MsgEmergencySettleMarket { + return MsgEmergencySettleMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketAminoMsg { + return { + type: "exchange/MsgEmergencySettleMarket", + value: MsgEmergencySettleMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmergencySettleMarketProtoMsg): MsgEmergencySettleMarket { + return MsgEmergencySettleMarket.decode(message.value); + }, + toProto(message: MsgEmergencySettleMarket): Uint8Array { + return MsgEmergencySettleMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgEmergencySettleMarket): MsgEmergencySettleMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarket", + value: MsgEmergencySettleMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmergencySettleMarket.typeUrl, MsgEmergencySettleMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEmergencySettleMarket.aminoType, MsgEmergencySettleMarket.typeUrl); +function createBaseMsgEmergencySettleMarketResponse(): MsgEmergencySettleMarketResponse { + return {}; +} +export const MsgEmergencySettleMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse", + is(o: any): o is MsgEmergencySettleMarketResponse { + return o && o.$typeUrl === MsgEmergencySettleMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgEmergencySettleMarketResponseAmino { + return o && o.$typeUrl === MsgEmergencySettleMarketResponse.typeUrl; + }, + encode(_: MsgEmergencySettleMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmergencySettleMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmergencySettleMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgEmergencySettleMarketResponse { + const message = createBaseMsgEmergencySettleMarketResponse(); + return message; + }, + fromAmino(_: MsgEmergencySettleMarketResponseAmino): MsgEmergencySettleMarketResponse { + const message = createBaseMsgEmergencySettleMarketResponse(); + return message; + }, + toAmino(_: MsgEmergencySettleMarketResponse): MsgEmergencySettleMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgEmergencySettleMarketResponseAminoMsg): MsgEmergencySettleMarketResponse { + return MsgEmergencySettleMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgEmergencySettleMarketResponseProtoMsg): MsgEmergencySettleMarketResponse { + return MsgEmergencySettleMarketResponse.decode(message.value); + }, + toProto(message: MsgEmergencySettleMarketResponse): Uint8Array { + return MsgEmergencySettleMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEmergencySettleMarketResponse): MsgEmergencySettleMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgEmergencySettleMarketResponse", + value: MsgEmergencySettleMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmergencySettleMarketResponse.typeUrl, MsgEmergencySettleMarketResponse); +function createBaseMsgIncreasePositionMargin(): MsgIncreasePositionMargin { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + marketId: "", + amount: "" + }; +} +export const MsgIncreasePositionMargin = { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin", + aminoType: "exchange/MsgIncreasePositionMargin", + is(o: any): o is MsgIncreasePositionMargin { + return o && (o.$typeUrl === MsgIncreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && typeof o.marketId === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is MsgIncreasePositionMarginAmino { + return o && (o.$typeUrl === MsgIncreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && typeof o.market_id === "string" && typeof o.amount === "string"); + }, + encode(message: MsgIncreasePositionMargin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.marketId !== "") { + writer.uint32(34).string(message.marketId); + } + if (message.amount !== "") { + writer.uint32(42).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIncreasePositionMargin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIncreasePositionMargin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.marketId = reader.string(); + break; + case 5: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgIncreasePositionMargin { + const message = createBaseMsgIncreasePositionMargin(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgIncreasePositionMarginAmino): MsgIncreasePositionMargin { + const message = createBaseMsgIncreasePositionMargin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgIncreasePositionMarginAminoMsg): MsgIncreasePositionMargin { + return MsgIncreasePositionMargin.fromAmino(object.value); + }, + toAminoMsg(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginAminoMsg { + return { + type: "exchange/MsgIncreasePositionMargin", + value: MsgIncreasePositionMargin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIncreasePositionMarginProtoMsg): MsgIncreasePositionMargin { + return MsgIncreasePositionMargin.decode(message.value); + }, + toProto(message: MsgIncreasePositionMargin): Uint8Array { + return MsgIncreasePositionMargin.encode(message).finish(); + }, + toProtoMsg(message: MsgIncreasePositionMargin): MsgIncreasePositionMarginProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMargin", + value: MsgIncreasePositionMargin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIncreasePositionMargin.typeUrl, MsgIncreasePositionMargin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIncreasePositionMargin.aminoType, MsgIncreasePositionMargin.typeUrl); +function createBaseMsgIncreasePositionMarginResponse(): MsgIncreasePositionMarginResponse { + return {}; +} +export const MsgIncreasePositionMarginResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse", + is(o: any): o is MsgIncreasePositionMarginResponse { + return o && o.$typeUrl === MsgIncreasePositionMarginResponse.typeUrl; + }, + isAmino(o: any): o is MsgIncreasePositionMarginResponseAmino { + return o && o.$typeUrl === MsgIncreasePositionMarginResponse.typeUrl; + }, + encode(_: MsgIncreasePositionMarginResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIncreasePositionMarginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIncreasePositionMarginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgIncreasePositionMarginResponse { + const message = createBaseMsgIncreasePositionMarginResponse(); + return message; + }, + fromAmino(_: MsgIncreasePositionMarginResponseAmino): MsgIncreasePositionMarginResponse { + const message = createBaseMsgIncreasePositionMarginResponse(); + return message; + }, + toAmino(_: MsgIncreasePositionMarginResponse): MsgIncreasePositionMarginResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIncreasePositionMarginResponseAminoMsg): MsgIncreasePositionMarginResponse { + return MsgIncreasePositionMarginResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgIncreasePositionMarginResponseProtoMsg): MsgIncreasePositionMarginResponse { + return MsgIncreasePositionMarginResponse.decode(message.value); + }, + toProto(message: MsgIncreasePositionMarginResponse): Uint8Array { + return MsgIncreasePositionMarginResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIncreasePositionMarginResponse): MsgIncreasePositionMarginResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgIncreasePositionMarginResponse", + value: MsgIncreasePositionMarginResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIncreasePositionMarginResponse.typeUrl, MsgIncreasePositionMarginResponse); +function createBaseMsgDecreasePositionMargin(): MsgDecreasePositionMargin { + return { + sender: "", + sourceSubaccountId: "", + destinationSubaccountId: "", + marketId: "", + amount: "" + }; +} +export const MsgDecreasePositionMargin = { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin", + aminoType: "exchange/MsgDecreasePositionMargin", + is(o: any): o is MsgDecreasePositionMargin { + return o && (o.$typeUrl === MsgDecreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.sourceSubaccountId === "string" && typeof o.destinationSubaccountId === "string" && typeof o.marketId === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is MsgDecreasePositionMarginAmino { + return o && (o.$typeUrl === MsgDecreasePositionMargin.typeUrl || typeof o.sender === "string" && typeof o.source_subaccount_id === "string" && typeof o.destination_subaccount_id === "string" && typeof o.market_id === "string" && typeof o.amount === "string"); + }, + encode(message: MsgDecreasePositionMargin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sourceSubaccountId !== "") { + writer.uint32(18).string(message.sourceSubaccountId); + } + if (message.destinationSubaccountId !== "") { + writer.uint32(26).string(message.destinationSubaccountId); + } + if (message.marketId !== "") { + writer.uint32(34).string(message.marketId); + } + if (message.amount !== "") { + writer.uint32(42).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDecreasePositionMargin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDecreasePositionMargin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sourceSubaccountId = reader.string(); + break; + case 3: + message.destinationSubaccountId = reader.string(); + break; + case 4: + message.marketId = reader.string(); + break; + case 5: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDecreasePositionMargin { + const message = createBaseMsgDecreasePositionMargin(); + message.sender = object.sender ?? ""; + message.sourceSubaccountId = object.sourceSubaccountId ?? ""; + message.destinationSubaccountId = object.destinationSubaccountId ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgDecreasePositionMarginAmino): MsgDecreasePositionMargin { + const message = createBaseMsgDecreasePositionMargin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.source_subaccount_id !== undefined && object.source_subaccount_id !== null) { + message.sourceSubaccountId = object.source_subaccount_id; + } + if (object.destination_subaccount_id !== undefined && object.destination_subaccount_id !== null) { + message.destinationSubaccountId = object.destination_subaccount_id; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.source_subaccount_id = message.sourceSubaccountId === "" ? undefined : message.sourceSubaccountId; + obj.destination_subaccount_id = message.destinationSubaccountId === "" ? undefined : message.destinationSubaccountId; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgDecreasePositionMarginAminoMsg): MsgDecreasePositionMargin { + return MsgDecreasePositionMargin.fromAmino(object.value); + }, + toAminoMsg(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginAminoMsg { + return { + type: "exchange/MsgDecreasePositionMargin", + value: MsgDecreasePositionMargin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDecreasePositionMarginProtoMsg): MsgDecreasePositionMargin { + return MsgDecreasePositionMargin.decode(message.value); + }, + toProto(message: MsgDecreasePositionMargin): Uint8Array { + return MsgDecreasePositionMargin.encode(message).finish(); + }, + toProtoMsg(message: MsgDecreasePositionMargin): MsgDecreasePositionMarginProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMargin", + value: MsgDecreasePositionMargin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDecreasePositionMargin.typeUrl, MsgDecreasePositionMargin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDecreasePositionMargin.aminoType, MsgDecreasePositionMargin.typeUrl); +function createBaseMsgDecreasePositionMarginResponse(): MsgDecreasePositionMarginResponse { + return {}; +} +export const MsgDecreasePositionMarginResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse", + is(o: any): o is MsgDecreasePositionMarginResponse { + return o && o.$typeUrl === MsgDecreasePositionMarginResponse.typeUrl; + }, + isAmino(o: any): o is MsgDecreasePositionMarginResponseAmino { + return o && o.$typeUrl === MsgDecreasePositionMarginResponse.typeUrl; + }, + encode(_: MsgDecreasePositionMarginResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDecreasePositionMarginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDecreasePositionMarginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDecreasePositionMarginResponse { + const message = createBaseMsgDecreasePositionMarginResponse(); + return message; + }, + fromAmino(_: MsgDecreasePositionMarginResponseAmino): MsgDecreasePositionMarginResponse { + const message = createBaseMsgDecreasePositionMarginResponse(); + return message; + }, + toAmino(_: MsgDecreasePositionMarginResponse): MsgDecreasePositionMarginResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDecreasePositionMarginResponseAminoMsg): MsgDecreasePositionMarginResponse { + return MsgDecreasePositionMarginResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDecreasePositionMarginResponseProtoMsg): MsgDecreasePositionMarginResponse { + return MsgDecreasePositionMarginResponse.decode(message.value); + }, + toProto(message: MsgDecreasePositionMarginResponse): Uint8Array { + return MsgDecreasePositionMarginResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDecreasePositionMarginResponse): MsgDecreasePositionMarginResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgDecreasePositionMarginResponse", + value: MsgDecreasePositionMarginResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDecreasePositionMarginResponse.typeUrl, MsgDecreasePositionMarginResponse); +function createBaseMsgPrivilegedExecuteContract(): MsgPrivilegedExecuteContract { + return { + sender: "", + funds: "", + contractAddress: "", + data: "" + }; +} +export const MsgPrivilegedExecuteContract = { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract", + aminoType: "exchange/MsgPrivilegedExecuteContract", + is(o: any): o is MsgPrivilegedExecuteContract { + return o && (o.$typeUrl === MsgPrivilegedExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.funds === "string" && typeof o.contractAddress === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is MsgPrivilegedExecuteContractAmino { + return o && (o.$typeUrl === MsgPrivilegedExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.funds === "string" && typeof o.contract_address === "string" && typeof o.data === "string"); + }, + encode(message: MsgPrivilegedExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.funds !== "") { + writer.uint32(18).string(message.funds); + } + if (message.contractAddress !== "") { + writer.uint32(26).string(message.contractAddress); + } + if (message.data !== "") { + writer.uint32(34).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPrivilegedExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPrivilegedExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.funds = reader.string(); + break; + case 3: + message.contractAddress = reader.string(); + break; + case 4: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgPrivilegedExecuteContract { + const message = createBaseMsgPrivilegedExecuteContract(); + message.sender = object.sender ?? ""; + message.funds = object.funds ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: MsgPrivilegedExecuteContractAmino): MsgPrivilegedExecuteContract { + const message = createBaseMsgPrivilegedExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.funds !== undefined && object.funds !== null) { + message.funds = object.funds; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.funds = message.funds === "" ? undefined : message.funds; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: MsgPrivilegedExecuteContractAminoMsg): MsgPrivilegedExecuteContract { + return MsgPrivilegedExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractAminoMsg { + return { + type: "exchange/MsgPrivilegedExecuteContract", + value: MsgPrivilegedExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPrivilegedExecuteContractProtoMsg): MsgPrivilegedExecuteContract { + return MsgPrivilegedExecuteContract.decode(message.value); + }, + toProto(message: MsgPrivilegedExecuteContract): Uint8Array { + return MsgPrivilegedExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgPrivilegedExecuteContract): MsgPrivilegedExecuteContractProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContract", + value: MsgPrivilegedExecuteContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPrivilegedExecuteContract.typeUrl, MsgPrivilegedExecuteContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPrivilegedExecuteContract.aminoType, MsgPrivilegedExecuteContract.typeUrl); +function createBaseMsgPrivilegedExecuteContractResponse(): MsgPrivilegedExecuteContractResponse { + return { + fundsDiff: [] + }; +} +export const MsgPrivilegedExecuteContractResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse", + is(o: any): o is MsgPrivilegedExecuteContractResponse { + return o && (o.$typeUrl === MsgPrivilegedExecuteContractResponse.typeUrl || Array.isArray(o.fundsDiff) && (!o.fundsDiff.length || Coin.is(o.fundsDiff[0]))); + }, + isAmino(o: any): o is MsgPrivilegedExecuteContractResponseAmino { + return o && (o.$typeUrl === MsgPrivilegedExecuteContractResponse.typeUrl || Array.isArray(o.funds_diff) && (!o.funds_diff.length || Coin.isAmino(o.funds_diff[0]))); + }, + encode(message: MsgPrivilegedExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.fundsDiff) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPrivilegedExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPrivilegedExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fundsDiff.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgPrivilegedExecuteContractResponse { + const message = createBaseMsgPrivilegedExecuteContractResponse(); + message.fundsDiff = object.fundsDiff?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgPrivilegedExecuteContractResponseAmino): MsgPrivilegedExecuteContractResponse { + const message = createBaseMsgPrivilegedExecuteContractResponse(); + message.fundsDiff = object.funds_diff?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgPrivilegedExecuteContractResponse): MsgPrivilegedExecuteContractResponseAmino { + const obj: any = {}; + if (message.fundsDiff) { + obj.funds_diff = message.fundsDiff.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds_diff = message.fundsDiff; + } + return obj; + }, + fromAminoMsg(object: MsgPrivilegedExecuteContractResponseAminoMsg): MsgPrivilegedExecuteContractResponse { + return MsgPrivilegedExecuteContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPrivilegedExecuteContractResponseProtoMsg): MsgPrivilegedExecuteContractResponse { + return MsgPrivilegedExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgPrivilegedExecuteContractResponse): Uint8Array { + return MsgPrivilegedExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPrivilegedExecuteContractResponse): MsgPrivilegedExecuteContractResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgPrivilegedExecuteContractResponse", + value: MsgPrivilegedExecuteContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPrivilegedExecuteContractResponse.typeUrl, MsgPrivilegedExecuteContractResponse); +function createBaseMsgRewardsOptOut(): MsgRewardsOptOut { + return { + sender: "" + }; +} +export const MsgRewardsOptOut = { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut", + aminoType: "exchange/MsgRewardsOptOut", + is(o: any): o is MsgRewardsOptOut { + return o && (o.$typeUrl === MsgRewardsOptOut.typeUrl || typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgRewardsOptOutAmino { + return o && (o.$typeUrl === MsgRewardsOptOut.typeUrl || typeof o.sender === "string"); + }, + encode(message: MsgRewardsOptOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRewardsOptOut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRewardsOptOut(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRewardsOptOut { + const message = createBaseMsgRewardsOptOut(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgRewardsOptOutAmino): MsgRewardsOptOut { + const message = createBaseMsgRewardsOptOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgRewardsOptOut): MsgRewardsOptOutAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgRewardsOptOutAminoMsg): MsgRewardsOptOut { + return MsgRewardsOptOut.fromAmino(object.value); + }, + toAminoMsg(message: MsgRewardsOptOut): MsgRewardsOptOutAminoMsg { + return { + type: "exchange/MsgRewardsOptOut", + value: MsgRewardsOptOut.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRewardsOptOutProtoMsg): MsgRewardsOptOut { + return MsgRewardsOptOut.decode(message.value); + }, + toProto(message: MsgRewardsOptOut): Uint8Array { + return MsgRewardsOptOut.encode(message).finish(); + }, + toProtoMsg(message: MsgRewardsOptOut): MsgRewardsOptOutProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOut", + value: MsgRewardsOptOut.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRewardsOptOut.typeUrl, MsgRewardsOptOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRewardsOptOut.aminoType, MsgRewardsOptOut.typeUrl); +function createBaseMsgRewardsOptOutResponse(): MsgRewardsOptOutResponse { + return {}; +} +export const MsgRewardsOptOutResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse", + is(o: any): o is MsgRewardsOptOutResponse { + return o && o.$typeUrl === MsgRewardsOptOutResponse.typeUrl; + }, + isAmino(o: any): o is MsgRewardsOptOutResponseAmino { + return o && o.$typeUrl === MsgRewardsOptOutResponse.typeUrl; + }, + encode(_: MsgRewardsOptOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRewardsOptOutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRewardsOptOutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRewardsOptOutResponse { + const message = createBaseMsgRewardsOptOutResponse(); + return message; + }, + fromAmino(_: MsgRewardsOptOutResponseAmino): MsgRewardsOptOutResponse { + const message = createBaseMsgRewardsOptOutResponse(); + return message; + }, + toAmino(_: MsgRewardsOptOutResponse): MsgRewardsOptOutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRewardsOptOutResponseAminoMsg): MsgRewardsOptOutResponse { + return MsgRewardsOptOutResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRewardsOptOutResponseProtoMsg): MsgRewardsOptOutResponse { + return MsgRewardsOptOutResponse.decode(message.value); + }, + toProto(message: MsgRewardsOptOutResponse): Uint8Array { + return MsgRewardsOptOutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRewardsOptOutResponse): MsgRewardsOptOutResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgRewardsOptOutResponse", + value: MsgRewardsOptOutResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRewardsOptOutResponse.typeUrl, MsgRewardsOptOutResponse); +function createBaseMsgReclaimLockedFunds(): MsgReclaimLockedFunds { + return { + sender: "", + lockedAccountPubKey: new Uint8Array(), + signature: new Uint8Array() + }; +} +export const MsgReclaimLockedFunds = { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds", + aminoType: "exchange/MsgReclaimLockedFunds", + is(o: any): o is MsgReclaimLockedFunds { + return o && (o.$typeUrl === MsgReclaimLockedFunds.typeUrl || typeof o.sender === "string" && (o.lockedAccountPubKey instanceof Uint8Array || typeof o.lockedAccountPubKey === "string") && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is MsgReclaimLockedFundsAmino { + return o && (o.$typeUrl === MsgReclaimLockedFunds.typeUrl || typeof o.sender === "string" && (o.lockedAccountPubKey instanceof Uint8Array || typeof o.lockedAccountPubKey === "string") && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: MsgReclaimLockedFunds, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.lockedAccountPubKey.length !== 0) { + writer.uint32(18).bytes(message.lockedAccountPubKey); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgReclaimLockedFunds { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReclaimLockedFunds(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.lockedAccountPubKey = reader.bytes(); + break; + case 3: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgReclaimLockedFunds { + const message = createBaseMsgReclaimLockedFunds(); + message.sender = object.sender ?? ""; + message.lockedAccountPubKey = object.lockedAccountPubKey ?? new Uint8Array(); + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgReclaimLockedFundsAmino): MsgReclaimLockedFunds { + const message = createBaseMsgReclaimLockedFunds(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lockedAccountPubKey !== undefined && object.lockedAccountPubKey !== null) { + message.lockedAccountPubKey = bytesFromBase64(object.lockedAccountPubKey); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.lockedAccountPubKey = message.lockedAccountPubKey ? base64FromBytes(message.lockedAccountPubKey) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: MsgReclaimLockedFundsAminoMsg): MsgReclaimLockedFunds { + return MsgReclaimLockedFunds.fromAmino(object.value); + }, + toAminoMsg(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsAminoMsg { + return { + type: "exchange/MsgReclaimLockedFunds", + value: MsgReclaimLockedFunds.toAmino(message) + }; + }, + fromProtoMsg(message: MsgReclaimLockedFundsProtoMsg): MsgReclaimLockedFunds { + return MsgReclaimLockedFunds.decode(message.value); + }, + toProto(message: MsgReclaimLockedFunds): Uint8Array { + return MsgReclaimLockedFunds.encode(message).finish(); + }, + toProtoMsg(message: MsgReclaimLockedFunds): MsgReclaimLockedFundsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFunds", + value: MsgReclaimLockedFunds.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgReclaimLockedFunds.typeUrl, MsgReclaimLockedFunds); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgReclaimLockedFunds.aminoType, MsgReclaimLockedFunds.typeUrl); +function createBaseMsgReclaimLockedFundsResponse(): MsgReclaimLockedFundsResponse { + return {}; +} +export const MsgReclaimLockedFundsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse", + is(o: any): o is MsgReclaimLockedFundsResponse { + return o && o.$typeUrl === MsgReclaimLockedFundsResponse.typeUrl; + }, + isAmino(o: any): o is MsgReclaimLockedFundsResponseAmino { + return o && o.$typeUrl === MsgReclaimLockedFundsResponse.typeUrl; + }, + encode(_: MsgReclaimLockedFundsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgReclaimLockedFundsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReclaimLockedFundsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgReclaimLockedFundsResponse { + const message = createBaseMsgReclaimLockedFundsResponse(); + return message; + }, + fromAmino(_: MsgReclaimLockedFundsResponseAmino): MsgReclaimLockedFundsResponse { + const message = createBaseMsgReclaimLockedFundsResponse(); + return message; + }, + toAmino(_: MsgReclaimLockedFundsResponse): MsgReclaimLockedFundsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgReclaimLockedFundsResponseAminoMsg): MsgReclaimLockedFundsResponse { + return MsgReclaimLockedFundsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgReclaimLockedFundsResponseProtoMsg): MsgReclaimLockedFundsResponse { + return MsgReclaimLockedFundsResponse.decode(message.value); + }, + toProto(message: MsgReclaimLockedFundsResponse): Uint8Array { + return MsgReclaimLockedFundsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgReclaimLockedFundsResponse): MsgReclaimLockedFundsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgReclaimLockedFundsResponse", + value: MsgReclaimLockedFundsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgReclaimLockedFundsResponse.typeUrl, MsgReclaimLockedFundsResponse); +function createBaseMsgSignData(): MsgSignData { + return { + signer: new Uint8Array(), + data: new Uint8Array() + }; +} +export const MsgSignData = { + typeUrl: "/injective.exchange.v1beta1.MsgSignData", + is(o: any): o is MsgSignData { + return o && (o.$typeUrl === MsgSignData.typeUrl || (o.signer instanceof Uint8Array || typeof o.signer === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgSignDataAmino { + return o && (o.$typeUrl === MsgSignData.typeUrl || (o.Signer instanceof Uint8Array || typeof o.Signer === "string") && (o.Data instanceof Uint8Array || typeof o.Data === "string")); + }, + encode(message: MsgSignData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer.length !== 0) { + writer.uint32(10).bytes(message.signer); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSignData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSignData { + const message = createBaseMsgSignData(); + message.signer = object.signer ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSignDataAmino): MsgSignData { + const message = createBaseMsgSignData(); + if (object.Signer !== undefined && object.Signer !== null) { + message.signer = bytesFromBase64(object.Signer); + } + if (object.Data !== undefined && object.Data !== null) { + message.data = bytesFromBase64(object.Data); + } + return message; + }, + toAmino(message: MsgSignData): MsgSignDataAmino { + const obj: any = {}; + obj.Signer = message.signer ? base64FromBytes(message.signer) : ""; + obj.Data = message.data ? base64FromBytes(message.data) : ""; + return obj; + }, + fromAminoMsg(object: MsgSignDataAminoMsg): MsgSignData { + return MsgSignData.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSignDataProtoMsg): MsgSignData { + return MsgSignData.decode(message.value); + }, + toProto(message: MsgSignData): Uint8Array { + return MsgSignData.encode(message).finish(); + }, + toProtoMsg(message: MsgSignData): MsgSignDataProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSignData", + value: MsgSignData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSignData.typeUrl, MsgSignData); +function createBaseMsgSignDoc(): MsgSignDoc { + return { + signType: "", + value: MsgSignData.fromPartial({}) + }; +} +export const MsgSignDoc = { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc", + is(o: any): o is MsgSignDoc { + return o && (o.$typeUrl === MsgSignDoc.typeUrl || typeof o.signType === "string" && MsgSignData.is(o.value)); + }, + isAmino(o: any): o is MsgSignDocAmino { + return o && (o.$typeUrl === MsgSignDoc.typeUrl || typeof o.sign_type === "string" && MsgSignData.isAmino(o.value)); + }, + encode(message: MsgSignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signType !== "") { + writer.uint32(10).string(message.signType); + } + if (message.value !== undefined) { + MsgSignData.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSignDoc(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signType = reader.string(); + break; + case 2: + message.value = MsgSignData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSignDoc { + const message = createBaseMsgSignDoc(); + message.signType = object.signType ?? ""; + message.value = object.value !== undefined && object.value !== null ? MsgSignData.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MsgSignDocAmino): MsgSignDoc { + const message = createBaseMsgSignDoc(); + if (object.sign_type !== undefined && object.sign_type !== null) { + message.signType = object.sign_type; + } + if (object.value !== undefined && object.value !== null) { + message.value = MsgSignData.fromAmino(object.value); + } + return message; + }, + toAmino(message: MsgSignDoc): MsgSignDocAmino { + const obj: any = {}; + obj.sign_type = message.signType ?? ""; + obj.value = message.value ? MsgSignData.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSignDocAminoMsg): MsgSignDoc { + return MsgSignDoc.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSignDocProtoMsg): MsgSignDoc { + return MsgSignDoc.decode(message.value); + }, + toProto(message: MsgSignDoc): Uint8Array { + return MsgSignDoc.encode(message).finish(); + }, + toProtoMsg(message: MsgSignDoc): MsgSignDocProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgSignDoc", + value: MsgSignDoc.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSignDoc.typeUrl, MsgSignDoc); +function createBaseMsgAdminUpdateBinaryOptionsMarket(): MsgAdminUpdateBinaryOptionsMarket { + return { + sender: "", + marketId: "", + settlementPrice: undefined, + expirationTimestamp: BigInt(0), + settlementTimestamp: BigInt(0), + status: 0 + }; +} +export const MsgAdminUpdateBinaryOptionsMarket = { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket", + aminoType: "exchange/MsgAdminUpdateBinaryOptionsMarket", + is(o: any): o is MsgAdminUpdateBinaryOptionsMarket { + return o && (o.$typeUrl === MsgAdminUpdateBinaryOptionsMarket.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && typeof o.expirationTimestamp === "bigint" && typeof o.settlementTimestamp === "bigint" && isSet(o.status)); + }, + isAmino(o: any): o is MsgAdminUpdateBinaryOptionsMarketAmino { + return o && (o.$typeUrl === MsgAdminUpdateBinaryOptionsMarket.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && typeof o.expiration_timestamp === "bigint" && typeof o.settlement_timestamp === "bigint" && isSet(o.status)); + }, + encode(message: MsgAdminUpdateBinaryOptionsMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.settlementPrice !== undefined) { + writer.uint32(26).string(message.settlementPrice); + } + if (message.expirationTimestamp !== BigInt(0)) { + writer.uint32(32).int64(message.expirationTimestamp); + } + if (message.settlementTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.settlementTimestamp); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAdminUpdateBinaryOptionsMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.settlementPrice = reader.string(); + break; + case 4: + message.expirationTimestamp = reader.int64(); + break; + case 5: + message.settlementTimestamp = reader.int64(); + break; + case 6: + message.status = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAdminUpdateBinaryOptionsMarket { + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.settlementPrice = object.settlementPrice ?? undefined; + message.expirationTimestamp = object.expirationTimestamp !== undefined && object.expirationTimestamp !== null ? BigInt(object.expirationTimestamp.toString()) : BigInt(0); + message.settlementTimestamp = object.settlementTimestamp !== undefined && object.settlementTimestamp !== null ? BigInt(object.settlementTimestamp.toString()) : BigInt(0); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: MsgAdminUpdateBinaryOptionsMarketAmino): MsgAdminUpdateBinaryOptionsMarket { + const message = createBaseMsgAdminUpdateBinaryOptionsMarket(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.settlement_price !== undefined && object.settlement_price !== null) { + message.settlementPrice = object.settlement_price; + } + if (object.expiration_timestamp !== undefined && object.expiration_timestamp !== null) { + message.expirationTimestamp = BigInt(object.expiration_timestamp); + } + if (object.settlement_timestamp !== undefined && object.settlement_timestamp !== null) { + message.settlementTimestamp = BigInt(object.settlement_timestamp); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.settlement_price = message.settlementPrice === null ? undefined : message.settlementPrice; + obj.expiration_timestamp = message.expirationTimestamp !== BigInt(0) ? message.expirationTimestamp?.toString() : undefined; + obj.settlement_timestamp = message.settlementTimestamp !== BigInt(0) ? message.settlementTimestamp?.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: MsgAdminUpdateBinaryOptionsMarketAminoMsg): MsgAdminUpdateBinaryOptionsMarket { + return MsgAdminUpdateBinaryOptionsMarket.fromAmino(object.value); + }, + toAminoMsg(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketAminoMsg { + return { + type: "exchange/MsgAdminUpdateBinaryOptionsMarket", + value: MsgAdminUpdateBinaryOptionsMarket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketProtoMsg): MsgAdminUpdateBinaryOptionsMarket { + return MsgAdminUpdateBinaryOptionsMarket.decode(message.value); + }, + toProto(message: MsgAdminUpdateBinaryOptionsMarket): Uint8Array { + return MsgAdminUpdateBinaryOptionsMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgAdminUpdateBinaryOptionsMarket): MsgAdminUpdateBinaryOptionsMarketProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket", + value: MsgAdminUpdateBinaryOptionsMarket.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAdminUpdateBinaryOptionsMarket.typeUrl, MsgAdminUpdateBinaryOptionsMarket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAdminUpdateBinaryOptionsMarket.aminoType, MsgAdminUpdateBinaryOptionsMarket.typeUrl); +function createBaseMsgAdminUpdateBinaryOptionsMarketResponse(): MsgAdminUpdateBinaryOptionsMarketResponse { + return {}; +} +export const MsgAdminUpdateBinaryOptionsMarketResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse", + is(o: any): o is MsgAdminUpdateBinaryOptionsMarketResponse { + return o && o.$typeUrl === MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl; + }, + isAmino(o: any): o is MsgAdminUpdateBinaryOptionsMarketResponseAmino { + return o && o.$typeUrl === MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl; + }, + encode(_: MsgAdminUpdateBinaryOptionsMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAdminUpdateBinaryOptionsMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAdminUpdateBinaryOptionsMarketResponse { + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + return message; + }, + fromAmino(_: MsgAdminUpdateBinaryOptionsMarketResponseAmino): MsgAdminUpdateBinaryOptionsMarketResponse { + const message = createBaseMsgAdminUpdateBinaryOptionsMarketResponse(); + return message; + }, + toAmino(_: MsgAdminUpdateBinaryOptionsMarketResponse): MsgAdminUpdateBinaryOptionsMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAdminUpdateBinaryOptionsMarketResponseAminoMsg): MsgAdminUpdateBinaryOptionsMarketResponse { + return MsgAdminUpdateBinaryOptionsMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg): MsgAdminUpdateBinaryOptionsMarketResponse { + return MsgAdminUpdateBinaryOptionsMarketResponse.decode(message.value); + }, + toProto(message: MsgAdminUpdateBinaryOptionsMarketResponse): Uint8Array { + return MsgAdminUpdateBinaryOptionsMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAdminUpdateBinaryOptionsMarketResponse): MsgAdminUpdateBinaryOptionsMarketResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarketResponse", + value: MsgAdminUpdateBinaryOptionsMarketResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAdminUpdateBinaryOptionsMarketResponse.typeUrl, MsgAdminUpdateBinaryOptionsMarketResponse); +function createBaseMsgAuthorizeStakeGrants(): MsgAuthorizeStakeGrants { + return { + sender: "", + grants: [] + }; +} +export const MsgAuthorizeStakeGrants = { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants", + aminoType: "exchange/MsgAuthorizeStakeGrants", + is(o: any): o is MsgAuthorizeStakeGrants { + return o && (o.$typeUrl === MsgAuthorizeStakeGrants.typeUrl || typeof o.sender === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isAmino(o: any): o is MsgAuthorizeStakeGrantsAmino { + return o && (o.$typeUrl === MsgAuthorizeStakeGrants.typeUrl || typeof o.sender === "string" && Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, + encode(message: MsgAuthorizeStakeGrants, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeStakeGrants { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeStakeGrants(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAuthorizeStakeGrants { + const message = createBaseMsgAuthorizeStakeGrants(); + message.sender = object.sender ?? ""; + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAuthorizeStakeGrantsAmino): MsgAuthorizeStakeGrants { + const message = createBaseMsgAuthorizeStakeGrants(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: MsgAuthorizeStakeGrantsAminoMsg): MsgAuthorizeStakeGrants { + return MsgAuthorizeStakeGrants.fromAmino(object.value); + }, + toAminoMsg(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsAminoMsg { + return { + type: "exchange/MsgAuthorizeStakeGrants", + value: MsgAuthorizeStakeGrants.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAuthorizeStakeGrantsProtoMsg): MsgAuthorizeStakeGrants { + return MsgAuthorizeStakeGrants.decode(message.value); + }, + toProto(message: MsgAuthorizeStakeGrants): Uint8Array { + return MsgAuthorizeStakeGrants.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeStakeGrants): MsgAuthorizeStakeGrantsProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants", + value: MsgAuthorizeStakeGrants.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAuthorizeStakeGrants.typeUrl, MsgAuthorizeStakeGrants); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAuthorizeStakeGrants.aminoType, MsgAuthorizeStakeGrants.typeUrl); +function createBaseMsgAuthorizeStakeGrantsResponse(): MsgAuthorizeStakeGrantsResponse { + return {}; +} +export const MsgAuthorizeStakeGrantsResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse", + is(o: any): o is MsgAuthorizeStakeGrantsResponse { + return o && o.$typeUrl === MsgAuthorizeStakeGrantsResponse.typeUrl; + }, + isAmino(o: any): o is MsgAuthorizeStakeGrantsResponseAmino { + return o && o.$typeUrl === MsgAuthorizeStakeGrantsResponse.typeUrl; + }, + encode(_: MsgAuthorizeStakeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeStakeGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAuthorizeStakeGrantsResponse { + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + return message; + }, + fromAmino(_: MsgAuthorizeStakeGrantsResponseAmino): MsgAuthorizeStakeGrantsResponse { + const message = createBaseMsgAuthorizeStakeGrantsResponse(); + return message; + }, + toAmino(_: MsgAuthorizeStakeGrantsResponse): MsgAuthorizeStakeGrantsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAuthorizeStakeGrantsResponseAminoMsg): MsgAuthorizeStakeGrantsResponse { + return MsgAuthorizeStakeGrantsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAuthorizeStakeGrantsResponseProtoMsg): MsgAuthorizeStakeGrantsResponse { + return MsgAuthorizeStakeGrantsResponse.decode(message.value); + }, + toProto(message: MsgAuthorizeStakeGrantsResponse): Uint8Array { + return MsgAuthorizeStakeGrantsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeStakeGrantsResponse): MsgAuthorizeStakeGrantsResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrantsResponse", + value: MsgAuthorizeStakeGrantsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAuthorizeStakeGrantsResponse.typeUrl, MsgAuthorizeStakeGrantsResponse); +function createBaseMsgActivateStakeGrant(): MsgActivateStakeGrant { + return { + sender: "", + granter: "" + }; +} +export const MsgActivateStakeGrant = { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant", + aminoType: "exchange/MsgActivateStakeGrant", + is(o: any): o is MsgActivateStakeGrant { + return o && (o.$typeUrl === MsgActivateStakeGrant.typeUrl || typeof o.sender === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is MsgActivateStakeGrantAmino { + return o && (o.$typeUrl === MsgActivateStakeGrant.typeUrl || typeof o.sender === "string" && typeof o.granter === "string"); + }, + encode(message: MsgActivateStakeGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.granter !== "") { + writer.uint32(18).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateStakeGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateStakeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgActivateStakeGrant { + const message = createBaseMsgActivateStakeGrant(); + message.sender = object.sender ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: MsgActivateStakeGrantAmino): MsgActivateStakeGrant { + const message = createBaseMsgActivateStakeGrant(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: MsgActivateStakeGrant): MsgActivateStakeGrantAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: MsgActivateStakeGrantAminoMsg): MsgActivateStakeGrant { + return MsgActivateStakeGrant.fromAmino(object.value); + }, + toAminoMsg(message: MsgActivateStakeGrant): MsgActivateStakeGrantAminoMsg { + return { + type: "exchange/MsgActivateStakeGrant", + value: MsgActivateStakeGrant.toAmino(message) + }; + }, + fromProtoMsg(message: MsgActivateStakeGrantProtoMsg): MsgActivateStakeGrant { + return MsgActivateStakeGrant.decode(message.value); + }, + toProto(message: MsgActivateStakeGrant): Uint8Array { + return MsgActivateStakeGrant.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateStakeGrant): MsgActivateStakeGrantProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrant", + value: MsgActivateStakeGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateStakeGrant.typeUrl, MsgActivateStakeGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgActivateStakeGrant.aminoType, MsgActivateStakeGrant.typeUrl); +function createBaseMsgActivateStakeGrantResponse(): MsgActivateStakeGrantResponse { + return {}; +} +export const MsgActivateStakeGrantResponse = { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse", + is(o: any): o is MsgActivateStakeGrantResponse { + return o && o.$typeUrl === MsgActivateStakeGrantResponse.typeUrl; + }, + isAmino(o: any): o is MsgActivateStakeGrantResponseAmino { + return o && o.$typeUrl === MsgActivateStakeGrantResponse.typeUrl; + }, + encode(_: MsgActivateStakeGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateStakeGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateStakeGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgActivateStakeGrantResponse { + const message = createBaseMsgActivateStakeGrantResponse(); + return message; + }, + fromAmino(_: MsgActivateStakeGrantResponseAmino): MsgActivateStakeGrantResponse { + const message = createBaseMsgActivateStakeGrantResponse(); + return message; + }, + toAmino(_: MsgActivateStakeGrantResponse): MsgActivateStakeGrantResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgActivateStakeGrantResponseAminoMsg): MsgActivateStakeGrantResponse { + return MsgActivateStakeGrantResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgActivateStakeGrantResponseProtoMsg): MsgActivateStakeGrantResponse { + return MsgActivateStakeGrantResponse.decode(message.value); + }, + toProto(message: MsgActivateStakeGrantResponse): Uint8Array { + return MsgActivateStakeGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateStakeGrantResponse): MsgActivateStakeGrantResponseProtoMsg { + return { + typeUrl: "/injective.exchange.v1beta1.MsgActivateStakeGrantResponse", + value: MsgActivateStakeGrantResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateStakeGrantResponse.typeUrl, MsgActivateStakeGrantResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/events.ts b/libs/injectivejs/src/injective/insurance/v1beta1/events.ts new file mode 100644 index 00000000..b4bca225 --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/events.ts @@ -0,0 +1,521 @@ +import { InsuranceFund, InsuranceFundAmino, RedemptionSchedule, RedemptionScheduleAmino } from "./insurance"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventInsuranceFundUpdate { + fund?: InsuranceFund; +} +export interface EventInsuranceFundUpdateProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate"; + value: Uint8Array; +} +export interface EventInsuranceFundUpdateAmino { + fund?: InsuranceFundAmino; +} +export interface EventInsuranceFundUpdateAminoMsg { + type: "/injective.insurance.v1beta1.EventInsuranceFundUpdate"; + value: EventInsuranceFundUpdateAmino; +} +export interface EventRequestRedemption { + schedule?: RedemptionSchedule; +} +export interface EventRequestRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption"; + value: Uint8Array; +} +export interface EventRequestRedemptionAmino { + schedule?: RedemptionScheduleAmino; +} +export interface EventRequestRedemptionAminoMsg { + type: "/injective.insurance.v1beta1.EventRequestRedemption"; + value: EventRequestRedemptionAmino; +} +export interface EventWithdrawRedemption { + /** redemption schedule triggered withdraw */ + schedule?: RedemptionSchedule; + /** redeem coin amount in base_currency */ + redeemCoin: Coin; +} +export interface EventWithdrawRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption"; + value: Uint8Array; +} +export interface EventWithdrawRedemptionAmino { + /** redemption schedule triggered withdraw */ + schedule?: RedemptionScheduleAmino; + /** redeem coin amount in base_currency */ + redeem_coin: CoinAmino; +} +export interface EventWithdrawRedemptionAminoMsg { + type: "/injective.insurance.v1beta1.EventWithdrawRedemption"; + value: EventWithdrawRedemptionAmino; +} +export interface EventUnderwrite { + /** address of the underwriter */ + underwriter: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** deposit coin amount */ + deposit: Coin; + /** share coin amount */ + shares: Coin; +} +export interface EventUnderwriteProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite"; + value: Uint8Array; +} +export interface EventUnderwriteAmino { + /** address of the underwriter */ + underwriter: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** deposit coin amount */ + deposit: CoinAmino; + /** share coin amount */ + shares: CoinAmino; +} +export interface EventUnderwriteAminoMsg { + type: "/injective.insurance.v1beta1.EventUnderwrite"; + value: EventUnderwriteAmino; +} +export interface EventInsuranceWithdraw { + marketId: string; + marketTicker: string; + withdrawal: Coin; +} +export interface EventInsuranceWithdrawProtoMsg { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw"; + value: Uint8Array; +} +export interface EventInsuranceWithdrawAmino { + market_id: string; + market_ticker: string; + withdrawal: CoinAmino; +} +export interface EventInsuranceWithdrawAminoMsg { + type: "/injective.insurance.v1beta1.EventInsuranceWithdraw"; + value: EventInsuranceWithdrawAmino; +} +function createBaseEventInsuranceFundUpdate(): EventInsuranceFundUpdate { + return { + fund: undefined + }; +} +export const EventInsuranceFundUpdate = { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate", + is(o: any): o is EventInsuranceFundUpdate { + return o && o.$typeUrl === EventInsuranceFundUpdate.typeUrl; + }, + isAmino(o: any): o is EventInsuranceFundUpdateAmino { + return o && o.$typeUrl === EventInsuranceFundUpdate.typeUrl; + }, + encode(message: EventInsuranceFundUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fund !== undefined) { + InsuranceFund.encode(message.fund, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInsuranceFundUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInsuranceFundUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fund = InsuranceFund.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInsuranceFundUpdate { + const message = createBaseEventInsuranceFundUpdate(); + message.fund = object.fund !== undefined && object.fund !== null ? InsuranceFund.fromPartial(object.fund) : undefined; + return message; + }, + fromAmino(object: EventInsuranceFundUpdateAmino): EventInsuranceFundUpdate { + const message = createBaseEventInsuranceFundUpdate(); + if (object.fund !== undefined && object.fund !== null) { + message.fund = InsuranceFund.fromAmino(object.fund); + } + return message; + }, + toAmino(message: EventInsuranceFundUpdate): EventInsuranceFundUpdateAmino { + const obj: any = {}; + obj.fund = message.fund ? InsuranceFund.toAmino(message.fund) : undefined; + return obj; + }, + fromAminoMsg(object: EventInsuranceFundUpdateAminoMsg): EventInsuranceFundUpdate { + return EventInsuranceFundUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: EventInsuranceFundUpdateProtoMsg): EventInsuranceFundUpdate { + return EventInsuranceFundUpdate.decode(message.value); + }, + toProto(message: EventInsuranceFundUpdate): Uint8Array { + return EventInsuranceFundUpdate.encode(message).finish(); + }, + toProtoMsg(message: EventInsuranceFundUpdate): EventInsuranceFundUpdateProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceFundUpdate", + value: EventInsuranceFundUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInsuranceFundUpdate.typeUrl, EventInsuranceFundUpdate); +function createBaseEventRequestRedemption(): EventRequestRedemption { + return { + schedule: undefined + }; +} +export const EventRequestRedemption = { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption", + is(o: any): o is EventRequestRedemption { + return o && o.$typeUrl === EventRequestRedemption.typeUrl; + }, + isAmino(o: any): o is EventRequestRedemptionAmino { + return o && o.$typeUrl === EventRequestRedemption.typeUrl; + }, + encode(message: EventRequestRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + RedemptionSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventRequestRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventRequestRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = RedemptionSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventRequestRedemption { + const message = createBaseEventRequestRedemption(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? RedemptionSchedule.fromPartial(object.schedule) : undefined; + return message; + }, + fromAmino(object: EventRequestRedemptionAmino): EventRequestRedemption { + const message = createBaseEventRequestRedemption(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = RedemptionSchedule.fromAmino(object.schedule); + } + return message; + }, + toAmino(message: EventRequestRedemption): EventRequestRedemptionAmino { + const obj: any = {}; + obj.schedule = message.schedule ? RedemptionSchedule.toAmino(message.schedule) : undefined; + return obj; + }, + fromAminoMsg(object: EventRequestRedemptionAminoMsg): EventRequestRedemption { + return EventRequestRedemption.fromAmino(object.value); + }, + fromProtoMsg(message: EventRequestRedemptionProtoMsg): EventRequestRedemption { + return EventRequestRedemption.decode(message.value); + }, + toProto(message: EventRequestRedemption): Uint8Array { + return EventRequestRedemption.encode(message).finish(); + }, + toProtoMsg(message: EventRequestRedemption): EventRequestRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventRequestRedemption", + value: EventRequestRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventRequestRedemption.typeUrl, EventRequestRedemption); +function createBaseEventWithdrawRedemption(): EventWithdrawRedemption { + return { + schedule: undefined, + redeemCoin: Coin.fromPartial({}) + }; +} +export const EventWithdrawRedemption = { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption", + is(o: any): o is EventWithdrawRedemption { + return o && (o.$typeUrl === EventWithdrawRedemption.typeUrl || Coin.is(o.redeemCoin)); + }, + isAmino(o: any): o is EventWithdrawRedemptionAmino { + return o && (o.$typeUrl === EventWithdrawRedemption.typeUrl || Coin.isAmino(o.redeem_coin)); + }, + encode(message: EventWithdrawRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.schedule !== undefined) { + RedemptionSchedule.encode(message.schedule, writer.uint32(10).fork()).ldelim(); + } + if (message.redeemCoin !== undefined) { + Coin.encode(message.redeemCoin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schedule = RedemptionSchedule.decode(reader, reader.uint32()); + break; + case 2: + message.redeemCoin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventWithdrawRedemption { + const message = createBaseEventWithdrawRedemption(); + message.schedule = object.schedule !== undefined && object.schedule !== null ? RedemptionSchedule.fromPartial(object.schedule) : undefined; + message.redeemCoin = object.redeemCoin !== undefined && object.redeemCoin !== null ? Coin.fromPartial(object.redeemCoin) : undefined; + return message; + }, + fromAmino(object: EventWithdrawRedemptionAmino): EventWithdrawRedemption { + const message = createBaseEventWithdrawRedemption(); + if (object.schedule !== undefined && object.schedule !== null) { + message.schedule = RedemptionSchedule.fromAmino(object.schedule); + } + if (object.redeem_coin !== undefined && object.redeem_coin !== null) { + message.redeemCoin = Coin.fromAmino(object.redeem_coin); + } + return message; + }, + toAmino(message: EventWithdrawRedemption): EventWithdrawRedemptionAmino { + const obj: any = {}; + obj.schedule = message.schedule ? RedemptionSchedule.toAmino(message.schedule) : undefined; + obj.redeem_coin = message.redeemCoin ? Coin.toAmino(message.redeemCoin) : undefined; + return obj; + }, + fromAminoMsg(object: EventWithdrawRedemptionAminoMsg): EventWithdrawRedemption { + return EventWithdrawRedemption.fromAmino(object.value); + }, + fromProtoMsg(message: EventWithdrawRedemptionProtoMsg): EventWithdrawRedemption { + return EventWithdrawRedemption.decode(message.value); + }, + toProto(message: EventWithdrawRedemption): Uint8Array { + return EventWithdrawRedemption.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawRedemption): EventWithdrawRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventWithdrawRedemption", + value: EventWithdrawRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventWithdrawRedemption.typeUrl, EventWithdrawRedemption); +function createBaseEventUnderwrite(): EventUnderwrite { + return { + underwriter: "", + marketId: "", + deposit: Coin.fromPartial({}), + shares: Coin.fromPartial({}) + }; +} +export const EventUnderwrite = { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite", + is(o: any): o is EventUnderwrite { + return o && (o.$typeUrl === EventUnderwrite.typeUrl || typeof o.underwriter === "string" && typeof o.marketId === "string" && Coin.is(o.deposit) && Coin.is(o.shares)); + }, + isAmino(o: any): o is EventUnderwriteAmino { + return o && (o.$typeUrl === EventUnderwrite.typeUrl || typeof o.underwriter === "string" && typeof o.marketId === "string" && Coin.isAmino(o.deposit) && Coin.isAmino(o.shares)); + }, + encode(message: EventUnderwrite, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.underwriter !== "") { + writer.uint32(10).string(message.underwriter); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(26).fork()).ldelim(); + } + if (message.shares !== undefined) { + Coin.encode(message.shares, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUnderwrite { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUnderwrite(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.underwriter = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.deposit = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.shares = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventUnderwrite { + const message = createBaseEventUnderwrite(); + message.underwriter = object.underwriter ?? ""; + message.marketId = object.marketId ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Coin.fromPartial(object.deposit) : undefined; + message.shares = object.shares !== undefined && object.shares !== null ? Coin.fromPartial(object.shares) : undefined; + return message; + }, + fromAmino(object: EventUnderwriteAmino): EventUnderwrite { + const message = createBaseEventUnderwrite(); + if (object.underwriter !== undefined && object.underwriter !== null) { + message.underwriter = object.underwriter; + } + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Coin.fromAmino(object.deposit); + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = Coin.fromAmino(object.shares); + } + return message; + }, + toAmino(message: EventUnderwrite): EventUnderwriteAmino { + const obj: any = {}; + obj.underwriter = message.underwriter === "" ? undefined : message.underwriter; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.deposit = message.deposit ? Coin.toAmino(message.deposit) : undefined; + obj.shares = message.shares ? Coin.toAmino(message.shares) : undefined; + return obj; + }, + fromAminoMsg(object: EventUnderwriteAminoMsg): EventUnderwrite { + return EventUnderwrite.fromAmino(object.value); + }, + fromProtoMsg(message: EventUnderwriteProtoMsg): EventUnderwrite { + return EventUnderwrite.decode(message.value); + }, + toProto(message: EventUnderwrite): Uint8Array { + return EventUnderwrite.encode(message).finish(); + }, + toProtoMsg(message: EventUnderwrite): EventUnderwriteProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventUnderwrite", + value: EventUnderwrite.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventUnderwrite.typeUrl, EventUnderwrite); +function createBaseEventInsuranceWithdraw(): EventInsuranceWithdraw { + return { + marketId: "", + marketTicker: "", + withdrawal: Coin.fromPartial({}) + }; +} +export const EventInsuranceWithdraw = { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw", + is(o: any): o is EventInsuranceWithdraw { + return o && (o.$typeUrl === EventInsuranceWithdraw.typeUrl || typeof o.marketId === "string" && typeof o.marketTicker === "string" && Coin.is(o.withdrawal)); + }, + isAmino(o: any): o is EventInsuranceWithdrawAmino { + return o && (o.$typeUrl === EventInsuranceWithdraw.typeUrl || typeof o.market_id === "string" && typeof o.market_ticker === "string" && Coin.isAmino(o.withdrawal)); + }, + encode(message: EventInsuranceWithdraw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.marketTicker !== "") { + writer.uint32(18).string(message.marketTicker); + } + if (message.withdrawal !== undefined) { + Coin.encode(message.withdrawal, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventInsuranceWithdraw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventInsuranceWithdraw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.marketTicker = reader.string(); + break; + case 3: + message.withdrawal = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventInsuranceWithdraw { + const message = createBaseEventInsuranceWithdraw(); + message.marketId = object.marketId ?? ""; + message.marketTicker = object.marketTicker ?? ""; + message.withdrawal = object.withdrawal !== undefined && object.withdrawal !== null ? Coin.fromPartial(object.withdrawal) : undefined; + return message; + }, + fromAmino(object: EventInsuranceWithdrawAmino): EventInsuranceWithdraw { + const message = createBaseEventInsuranceWithdraw(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_ticker !== undefined && object.market_ticker !== null) { + message.marketTicker = object.market_ticker; + } + if (object.withdrawal !== undefined && object.withdrawal !== null) { + message.withdrawal = Coin.fromAmino(object.withdrawal); + } + return message; + }, + toAmino(message: EventInsuranceWithdraw): EventInsuranceWithdrawAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_ticker = message.marketTicker === "" ? undefined : message.marketTicker; + obj.withdrawal = message.withdrawal ? Coin.toAmino(message.withdrawal) : undefined; + return obj; + }, + fromAminoMsg(object: EventInsuranceWithdrawAminoMsg): EventInsuranceWithdraw { + return EventInsuranceWithdraw.fromAmino(object.value); + }, + fromProtoMsg(message: EventInsuranceWithdrawProtoMsg): EventInsuranceWithdraw { + return EventInsuranceWithdraw.decode(message.value); + }, + toProto(message: EventInsuranceWithdraw): Uint8Array { + return EventInsuranceWithdraw.encode(message).finish(); + }, + toProtoMsg(message: EventInsuranceWithdraw): EventInsuranceWithdrawProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.EventInsuranceWithdraw", + value: EventInsuranceWithdraw.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventInsuranceWithdraw.typeUrl, EventInsuranceWithdraw); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/genesis.ts b/libs/injectivejs/src/injective/insurance/v1beta1/genesis.ts new file mode 100644 index 00000000..ee8fb73c --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/genesis.ts @@ -0,0 +1,178 @@ +import { Params, ParamsAmino, InsuranceFund, InsuranceFundAmino, RedemptionSchedule, RedemptionScheduleAmino } from "./insurance"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the insurance module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to insurance. */ + params: Params; + /** + * insurance_funds describes the insurance funds available for derivative + * markets + */ + insuranceFunds: InsuranceFund[]; + /** redemption_schedule describes the redemption requests pending */ + redemptionSchedule: RedemptionSchedule[]; + /** + * next_share_denom_id describes the next share denom id to be used for newly + * creating insurance fund incremented by 1 per insurance fund creation + */ + nextShareDenomId: bigint; + /** + * next_redemption_schedule_id describes next redemption schedule id to be + * used for next schedule incremented by 1 per redemption request + */ + nextRedemptionScheduleId: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.insurance.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the insurance module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to insurance. */ + params: ParamsAmino; + /** + * insurance_funds describes the insurance funds available for derivative + * markets + */ + insurance_funds: InsuranceFundAmino[]; + /** redemption_schedule describes the redemption requests pending */ + redemption_schedule: RedemptionScheduleAmino[]; + /** + * next_share_denom_id describes the next share denom id to be used for newly + * creating insurance fund incremented by 1 per insurance fund creation + */ + next_share_denom_id: string; + /** + * next_redemption_schedule_id describes next redemption schedule id to be + * used for next schedule incremented by 1 per redemption request + */ + next_redemption_schedule_id: string; +} +export interface GenesisStateAminoMsg { + type: "/injective.insurance.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + insuranceFunds: [], + redemptionSchedule: [], + nextShareDenomId: BigInt(0), + nextRedemptionScheduleId: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/injective.insurance.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.insuranceFunds) && (!o.insuranceFunds.length || InsuranceFund.is(o.insuranceFunds[0])) && Array.isArray(o.redemptionSchedule) && (!o.redemptionSchedule.length || RedemptionSchedule.is(o.redemptionSchedule[0])) && typeof o.nextShareDenomId === "bigint" && typeof o.nextRedemptionScheduleId === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.insurance_funds) && (!o.insurance_funds.length || InsuranceFund.isAmino(o.insurance_funds[0])) && Array.isArray(o.redemption_schedule) && (!o.redemption_schedule.length || RedemptionSchedule.isAmino(o.redemption_schedule[0])) && typeof o.next_share_denom_id === "bigint" && typeof o.next_redemption_schedule_id === "bigint"); + }, + 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.insuranceFunds) { + InsuranceFund.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.redemptionSchedule) { + RedemptionSchedule.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.nextShareDenomId !== BigInt(0)) { + writer.uint32(32).uint64(message.nextShareDenomId); + } + if (message.nextRedemptionScheduleId !== BigInt(0)) { + writer.uint32(40).uint64(message.nextRedemptionScheduleId); + } + 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.insuranceFunds.push(InsuranceFund.decode(reader, reader.uint32())); + break; + case 3: + message.redemptionSchedule.push(RedemptionSchedule.decode(reader, reader.uint32())); + break; + case 4: + message.nextShareDenomId = reader.uint64(); + break; + case 5: + message.nextRedemptionScheduleId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.insuranceFunds = object.insuranceFunds?.map(e => InsuranceFund.fromPartial(e)) || []; + message.redemptionSchedule = object.redemptionSchedule?.map(e => RedemptionSchedule.fromPartial(e)) || []; + message.nextShareDenomId = object.nextShareDenomId !== undefined && object.nextShareDenomId !== null ? BigInt(object.nextShareDenomId.toString()) : BigInt(0); + message.nextRedemptionScheduleId = object.nextRedemptionScheduleId !== undefined && object.nextRedemptionScheduleId !== null ? BigInt(object.nextRedemptionScheduleId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.insuranceFunds = object.insurance_funds?.map(e => InsuranceFund.fromAmino(e)) || []; + message.redemptionSchedule = object.redemption_schedule?.map(e => RedemptionSchedule.fromAmino(e)) || []; + if (object.next_share_denom_id !== undefined && object.next_share_denom_id !== null) { + message.nextShareDenomId = BigInt(object.next_share_denom_id); + } + if (object.next_redemption_schedule_id !== undefined && object.next_redemption_schedule_id !== null) { + message.nextRedemptionScheduleId = BigInt(object.next_redemption_schedule_id); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.insuranceFunds) { + obj.insurance_funds = message.insuranceFunds.map(e => e ? InsuranceFund.toAmino(e) : undefined); + } else { + obj.insurance_funds = message.insuranceFunds; + } + if (message.redemptionSchedule) { + obj.redemption_schedule = message.redemptionSchedule.map(e => e ? RedemptionSchedule.toAmino(e) : undefined); + } else { + obj.redemption_schedule = message.redemptionSchedule; + } + obj.next_share_denom_id = message.nextShareDenomId !== BigInt(0) ? message.nextShareDenomId?.toString() : undefined; + obj.next_redemption_schedule_id = message.nextRedemptionScheduleId !== BigInt(0) ? message.nextRedemptionScheduleId?.toString() : undefined; + 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: "/injective.insurance.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/insurance.ts b/libs/injectivejs/src/injective/insurance/v1beta1/insurance.ts new file mode 100644 index 00000000..ac3a0186 --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/insurance.ts @@ -0,0 +1,531 @@ +import { Duration, DurationAmino } from "../../../google/protobuf/duration"; +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** + * default_redemption_notice_period_duration defines the default minimum + * notice period duration that must pass after an underwriter sends a + * redemption request before the underwriter can claim his tokens + */ + defaultRedemptionNoticePeriodDuration: Duration; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.insurance.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * default_redemption_notice_period_duration defines the default minimum + * notice period duration that must pass after an underwriter sends a + * redemption request before the underwriter can claim his tokens + */ + default_redemption_notice_period_duration: DurationAmino; +} +export interface ParamsAminoMsg { + type: "insurance/Params"; + value: ParamsAmino; +} +export interface InsuranceFund { + /** deposit denomination for the given insurance fund */ + depositDenom: string; + /** insurance fund pool token denomination for the given insurance fund */ + insurancePoolTokenDenom: string; + /** + * redemption_notice_period_duration defines the minimum notice period + * duration that must pass after an underwriter sends a redemption request + * before the underwriter can claim his tokens + */ + redemptionNoticePeriodDuration: Duration; + /** balance of fund */ + balance: string; + /** total share tokens minted */ + totalShare: string; + /** marketID of the derivative market */ + marketId: string; + /** ticker of the derivative market */ + marketTicker: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracleBase: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracleQuote: string; + /** Oracle type of the binary options or derivative market */ + oracleType: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: bigint; +} +export interface InsuranceFundProtoMsg { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund"; + value: Uint8Array; +} +export interface InsuranceFundAmino { + /** deposit denomination for the given insurance fund */ + deposit_denom: string; + /** insurance fund pool token denomination for the given insurance fund */ + insurance_pool_token_denom: string; + /** + * redemption_notice_period_duration defines the minimum notice period + * duration that must pass after an underwriter sends a redemption request + * before the underwriter can claim his tokens + */ + redemption_notice_period_duration: DurationAmino; + /** balance of fund */ + balance: string; + /** total share tokens minted */ + total_share: string; + /** marketID of the derivative market */ + market_id: string; + /** ticker of the derivative market */ + market_ticker: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracle_base: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracle_quote: string; + /** Oracle type of the binary options or derivative market */ + oracle_type: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: string; +} +export interface InsuranceFundAminoMsg { + type: "/injective.insurance.v1beta1.InsuranceFund"; + value: InsuranceFundAmino; +} +export interface RedemptionSchedule { + /** id of redemption schedule */ + id: bigint; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** address of the redeemer */ + redeemer: string; + /** the time after which the redemption can be claimed */ + claimableRedemptionTime: Date; + /** the insurance_pool_token amount to redeem */ + redemptionAmount: Coin; +} +export interface RedemptionScheduleProtoMsg { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule"; + value: Uint8Array; +} +export interface RedemptionScheduleAmino { + /** id of redemption schedule */ + id: string; + /** marketId of insurance fund for the redemption */ + marketId: string; + /** address of the redeemer */ + redeemer: string; + /** the time after which the redemption can be claimed */ + claimable_redemption_time: string; + /** the insurance_pool_token amount to redeem */ + redemption_amount: CoinAmino; +} +export interface RedemptionScheduleAminoMsg { + type: "/injective.insurance.v1beta1.RedemptionSchedule"; + value: RedemptionScheduleAmino; +} +function createBaseParams(): Params { + return { + defaultRedemptionNoticePeriodDuration: Duration.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/injective.insurance.v1beta1.Params", + aminoType: "insurance/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.defaultRedemptionNoticePeriodDuration)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.default_redemption_notice_period_duration)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.defaultRedemptionNoticePeriodDuration !== undefined) { + Duration.encode(message.defaultRedemptionNoticePeriodDuration, 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.defaultRedemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.defaultRedemptionNoticePeriodDuration = object.defaultRedemptionNoticePeriodDuration !== undefined && object.defaultRedemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.defaultRedemptionNoticePeriodDuration) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.default_redemption_notice_period_duration !== undefined && object.default_redemption_notice_period_duration !== null) { + message.defaultRedemptionNoticePeriodDuration = Duration.fromAmino(object.default_redemption_notice_period_duration); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.default_redemption_notice_period_duration = message.defaultRedemptionNoticePeriodDuration ? Duration.toAmino(message.defaultRedemptionNoticePeriodDuration) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "insurance/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: "/injective.insurance.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseInsuranceFund(): InsuranceFund { + return { + depositDenom: "", + insurancePoolTokenDenom: "", + redemptionNoticePeriodDuration: Duration.fromPartial({}), + balance: "", + totalShare: "", + marketId: "", + marketTicker: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + expiry: BigInt(0) + }; +} +export const InsuranceFund = { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund", + is(o: any): o is InsuranceFund { + return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.depositDenom === "string" && typeof o.insurancePoolTokenDenom === "string" && Duration.is(o.redemptionNoticePeriodDuration) && typeof o.balance === "string" && typeof o.totalShare === "string" && typeof o.marketId === "string" && typeof o.marketTicker === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.expiry === "bigint"); + }, + isAmino(o: any): o is InsuranceFundAmino { + return o && (o.$typeUrl === InsuranceFund.typeUrl || typeof o.deposit_denom === "string" && typeof o.insurance_pool_token_denom === "string" && Duration.isAmino(o.redemption_notice_period_duration) && typeof o.balance === "string" && typeof o.total_share === "string" && typeof o.market_id === "string" && typeof o.market_ticker === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.expiry === "bigint"); + }, + encode(message: InsuranceFund, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.depositDenom !== "") { + writer.uint32(10).string(message.depositDenom); + } + if (message.insurancePoolTokenDenom !== "") { + writer.uint32(18).string(message.insurancePoolTokenDenom); + } + if (message.redemptionNoticePeriodDuration !== undefined) { + Duration.encode(message.redemptionNoticePeriodDuration, writer.uint32(26).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + if (message.totalShare !== "") { + writer.uint32(42).string(message.totalShare); + } + if (message.marketId !== "") { + writer.uint32(50).string(message.marketId); + } + if (message.marketTicker !== "") { + writer.uint32(58).string(message.marketTicker); + } + if (message.oracleBase !== "") { + writer.uint32(66).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(74).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(80).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(88).int64(message.expiry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InsuranceFund { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInsuranceFund(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositDenom = reader.string(); + break; + case 2: + message.insurancePoolTokenDenom = reader.string(); + break; + case 3: + message.redemptionNoticePeriodDuration = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + case 5: + message.totalShare = reader.string(); + break; + case 6: + message.marketId = reader.string(); + break; + case 7: + message.marketTicker = reader.string(); + break; + case 8: + message.oracleBase = reader.string(); + break; + case 9: + message.oracleQuote = reader.string(); + break; + case 10: + message.oracleType = (reader.int32() as any); + break; + case 11: + message.expiry = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): InsuranceFund { + const message = createBaseInsuranceFund(); + message.depositDenom = object.depositDenom ?? ""; + message.insurancePoolTokenDenom = object.insurancePoolTokenDenom ?? ""; + message.redemptionNoticePeriodDuration = object.redemptionNoticePeriodDuration !== undefined && object.redemptionNoticePeriodDuration !== null ? Duration.fromPartial(object.redemptionNoticePeriodDuration) : undefined; + message.balance = object.balance ?? ""; + message.totalShare = object.totalShare ?? ""; + message.marketId = object.marketId ?? ""; + message.marketTicker = object.marketTicker ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + return message; + }, + fromAmino(object: InsuranceFundAmino): InsuranceFund { + const message = createBaseInsuranceFund(); + if (object.deposit_denom !== undefined && object.deposit_denom !== null) { + message.depositDenom = object.deposit_denom; + } + if (object.insurance_pool_token_denom !== undefined && object.insurance_pool_token_denom !== null) { + message.insurancePoolTokenDenom = object.insurance_pool_token_denom; + } + if (object.redemption_notice_period_duration !== undefined && object.redemption_notice_period_duration !== null) { + message.redemptionNoticePeriodDuration = Duration.fromAmino(object.redemption_notice_period_duration); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.total_share !== undefined && object.total_share !== null) { + message.totalShare = object.total_share; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.market_ticker !== undefined && object.market_ticker !== null) { + message.marketTicker = object.market_ticker; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + return message; + }, + toAmino(message: InsuranceFund): InsuranceFundAmino { + const obj: any = {}; + obj.deposit_denom = message.depositDenom === "" ? undefined : message.depositDenom; + obj.insurance_pool_token_denom = message.insurancePoolTokenDenom === "" ? undefined : message.insurancePoolTokenDenom; + obj.redemption_notice_period_duration = message.redemptionNoticePeriodDuration ? Duration.toAmino(message.redemptionNoticePeriodDuration) : undefined; + obj.balance = message.balance === "" ? undefined : message.balance; + obj.total_share = message.totalShare === "" ? undefined : message.totalShare; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.market_ticker = message.marketTicker === "" ? undefined : message.marketTicker; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: InsuranceFundAminoMsg): InsuranceFund { + return InsuranceFund.fromAmino(object.value); + }, + fromProtoMsg(message: InsuranceFundProtoMsg): InsuranceFund { + return InsuranceFund.decode(message.value); + }, + toProto(message: InsuranceFund): Uint8Array { + return InsuranceFund.encode(message).finish(); + }, + toProtoMsg(message: InsuranceFund): InsuranceFundProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.InsuranceFund", + value: InsuranceFund.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InsuranceFund.typeUrl, InsuranceFund); +function createBaseRedemptionSchedule(): RedemptionSchedule { + return { + id: BigInt(0), + marketId: "", + redeemer: "", + claimableRedemptionTime: new Date(), + redemptionAmount: Coin.fromPartial({}) + }; +} +export const RedemptionSchedule = { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule", + is(o: any): o is RedemptionSchedule { + return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.is(o.claimableRedemptionTime) && Coin.is(o.redemptionAmount)); + }, + isAmino(o: any): o is RedemptionScheduleAmino { + return o && (o.$typeUrl === RedemptionSchedule.typeUrl || typeof o.id === "bigint" && typeof o.marketId === "string" && typeof o.redeemer === "string" && Timestamp.isAmino(o.claimable_redemption_time) && Coin.isAmino(o.redemption_amount)); + }, + encode(message: RedemptionSchedule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.redeemer !== "") { + writer.uint32(26).string(message.redeemer); + } + if (message.claimableRedemptionTime !== undefined) { + Timestamp.encode(toTimestamp(message.claimableRedemptionTime), writer.uint32(34).fork()).ldelim(); + } + if (message.redemptionAmount !== undefined) { + Coin.encode(message.redemptionAmount, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedemptionSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedemptionSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.redeemer = reader.string(); + break; + case 4: + message.claimableRedemptionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.redemptionAmount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RedemptionSchedule { + const message = createBaseRedemptionSchedule(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.marketId = object.marketId ?? ""; + message.redeemer = object.redeemer ?? ""; + message.claimableRedemptionTime = object.claimableRedemptionTime ?? undefined; + message.redemptionAmount = object.redemptionAmount !== undefined && object.redemptionAmount !== null ? Coin.fromPartial(object.redemptionAmount) : undefined; + return message; + }, + fromAmino(object: RedemptionScheduleAmino): RedemptionSchedule { + const message = createBaseRedemptionSchedule(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.redeemer !== undefined && object.redeemer !== null) { + message.redeemer = object.redeemer; + } + if (object.claimable_redemption_time !== undefined && object.claimable_redemption_time !== null) { + message.claimableRedemptionTime = fromTimestamp(Timestamp.fromAmino(object.claimable_redemption_time)); + } + if (object.redemption_amount !== undefined && object.redemption_amount !== null) { + message.redemptionAmount = Coin.fromAmino(object.redemption_amount); + } + return message; + }, + toAmino(message: RedemptionSchedule): RedemptionScheduleAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.redeemer = message.redeemer === "" ? undefined : message.redeemer; + obj.claimable_redemption_time = message.claimableRedemptionTime ? Timestamp.toAmino(toTimestamp(message.claimableRedemptionTime)) : undefined; + obj.redemption_amount = message.redemptionAmount ? Coin.toAmino(message.redemptionAmount) : undefined; + return obj; + }, + fromAminoMsg(object: RedemptionScheduleAminoMsg): RedemptionSchedule { + return RedemptionSchedule.fromAmino(object.value); + }, + fromProtoMsg(message: RedemptionScheduleProtoMsg): RedemptionSchedule { + return RedemptionSchedule.decode(message.value); + }, + toProto(message: RedemptionSchedule): Uint8Array { + return RedemptionSchedule.encode(message).finish(); + }, + toProtoMsg(message: RedemptionSchedule): RedemptionScheduleProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.RedemptionSchedule", + value: RedemptionSchedule.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RedemptionSchedule.typeUrl, RedemptionSchedule); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/insurance/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..b7b9ee1d --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/query.rpc.func.ts @@ -0,0 +1,44 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryInsuranceParamsRequest, QueryInsuranceParamsResponse, QueryInsuranceFundRequest, QueryInsuranceFundResponse, QueryInsuranceFundsRequest, QueryInsuranceFundsResponse, QueryEstimatedRedemptionsRequest, QueryEstimatedRedemptionsResponse, QueryPendingRedemptionsRequest, QueryPendingRedemptionsResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetInsuranceParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceParamsRequest.encode, + decode: QueryInsuranceParamsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceParams", + clientResolver +}); +export const createGetInsuranceFund = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundRequest.encode, + decode: QueryInsuranceFundResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFund", + clientResolver +}); +export const createGetInsuranceFunds = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryInsuranceFundsRequest.encode, + decode: QueryInsuranceFundsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceFunds", + clientResolver +}); +export const createGetEstimatedRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryEstimatedRedemptionsRequest.encode, + decode: QueryEstimatedRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "EstimatedRedemptions", + clientResolver +}); +export const createGetPendingRedemptions = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingRedemptionsRequest.encode, + decode: QueryPendingRedemptionsResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "PendingRedemptions", + clientResolver +}); +export const createGetInsuranceModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.insurance.v1beta1.Query", + method: "InsuranceModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/query.ts b/libs/injectivejs/src/injective/insurance/v1beta1/query.ts new file mode 100644 index 00000000..f8ee7aae --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/query.ts @@ -0,0 +1,1095 @@ +import { Params, ParamsAmino, InsuranceFund, InsuranceFundAmino } from "./insurance"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams + * RPC method. + */ +export interface QueryInsuranceParamsRequest {} +export interface QueryInsuranceParamsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams + * RPC method. + */ +export interface QueryInsuranceParamsRequestAmino {} +export interface QueryInsuranceParamsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest"; + value: QueryInsuranceParamsRequestAmino; +} +/** + * QueryInsuranceParamsRequest is the response type for the + * Query/InsuranceParams RPC method. + */ +export interface QueryInsuranceParamsResponse { + params: Params; +} +export interface QueryInsuranceParamsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceParamsRequest is the response type for the + * Query/InsuranceParams RPC method. + */ +export interface QueryInsuranceParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryInsuranceParamsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse"; + value: QueryInsuranceParamsResponseAmino; +} +/** + * QueryInsuranceFundRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundRequest { + /** Market ID for the market */ + marketId: string; +} +export interface QueryInsuranceFundRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceFundRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundRequestAmino { + /** Market ID for the market */ + market_id: string; +} +export interface QueryInsuranceFundRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundRequest"; + value: QueryInsuranceFundRequestAmino; +} +/** + * QueryInsuranceFundResponse is the response type for the Query/InsuranceFund + * RPC method. + */ +export interface QueryInsuranceFundResponse { + fund?: InsuranceFund; +} +export interface QueryInsuranceFundResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceFundResponse is the response type for the Query/InsuranceFund + * RPC method. + */ +export interface QueryInsuranceFundResponseAmino { + fund?: InsuranceFundAmino; +} +export interface QueryInsuranceFundResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundResponse"; + value: QueryInsuranceFundResponseAmino; +} +/** + * QueryInsuranceFundsRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsRequest {} +export interface QueryInsuranceFundsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest"; + value: Uint8Array; +} +/** + * QueryInsuranceFundsRequest is the request type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsRequestAmino {} +export interface QueryInsuranceFundsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest"; + value: QueryInsuranceFundsRequestAmino; +} +/** + * QueryInsuranceFundsResponse is the response type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsResponse { + funds: InsuranceFund[]; +} +export interface QueryInsuranceFundsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse"; + value: Uint8Array; +} +/** + * QueryInsuranceFundsResponse is the response type for the Query/InsuranceFunds + * RPC method. + */ +export interface QueryInsuranceFundsResponseAmino { + funds: InsuranceFundAmino[]; +} +export interface QueryInsuranceFundsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse"; + value: QueryInsuranceFundsResponseAmino; +} +/** + * QueryEstimatedRedemptionsRequest is the request type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsRequest { + marketId: string; + address: string; +} +export interface QueryEstimatedRedemptionsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest"; + value: Uint8Array; +} +/** + * QueryEstimatedRedemptionsRequest is the request type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsRequestAmino { + marketId: string; + address: string; +} +export interface QueryEstimatedRedemptionsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest"; + value: QueryEstimatedRedemptionsRequestAmino; +} +/** + * QueryEstimatedRedemptionsResponse is the response type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsResponse { + amount: Coin[]; +} +export interface QueryEstimatedRedemptionsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse"; + value: Uint8Array; +} +/** + * QueryEstimatedRedemptionsResponse is the response type for the + * Query/EstimatedRedemptions RPC method. + */ +export interface QueryEstimatedRedemptionsResponseAmino { + amount: CoinAmino[]; +} +export interface QueryEstimatedRedemptionsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse"; + value: QueryEstimatedRedemptionsResponseAmino; +} +/** + * QueryPendingRedemptionsRequest is the request type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsRequest { + marketId: string; + address: string; +} +export interface QueryPendingRedemptionsRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest"; + value: Uint8Array; +} +/** + * QueryPendingRedemptionsRequest is the request type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsRequestAmino { + marketId: string; + address: string; +} +export interface QueryPendingRedemptionsRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest"; + value: QueryPendingRedemptionsRequestAmino; +} +/** + * QueryPendingRedemptionsResponse is the response type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsResponse { + amount: Coin[]; +} +export interface QueryPendingRedemptionsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse"; + value: Uint8Array; +} +/** + * QueryPendingRedemptionsResponse is the response type for the + * Query/PendingRedemptions RPC method. + */ +export interface QueryPendingRedemptionsResponseAmino { + amount: CoinAmino[]; +} +export interface QueryPendingRedemptionsResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse"; + value: QueryPendingRedemptionsResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.insurance.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/InsuranceModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.insurance.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryInsuranceParamsRequest(): QueryInsuranceParamsRequest { + return {}; +} +export const QueryInsuranceParamsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest", + is(o: any): o is QueryInsuranceParamsRequest { + return o && o.$typeUrl === QueryInsuranceParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceParamsRequestAmino { + return o && o.$typeUrl === QueryInsuranceParamsRequest.typeUrl; + }, + encode(_: QueryInsuranceParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryInsuranceParamsRequest { + const message = createBaseQueryInsuranceParamsRequest(); + return message; + }, + fromAmino(_: QueryInsuranceParamsRequestAmino): QueryInsuranceParamsRequest { + const message = createBaseQueryInsuranceParamsRequest(); + return message; + }, + toAmino(_: QueryInsuranceParamsRequest): QueryInsuranceParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryInsuranceParamsRequestAminoMsg): QueryInsuranceParamsRequest { + return QueryInsuranceParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceParamsRequestProtoMsg): QueryInsuranceParamsRequest { + return QueryInsuranceParamsRequest.decode(message.value); + }, + toProto(message: QueryInsuranceParamsRequest): Uint8Array { + return QueryInsuranceParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceParamsRequest): QueryInsuranceParamsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsRequest", + value: QueryInsuranceParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceParamsRequest.typeUrl, QueryInsuranceParamsRequest); +function createBaseQueryInsuranceParamsResponse(): QueryInsuranceParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryInsuranceParamsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse", + is(o: any): o is QueryInsuranceParamsResponse { + return o && (o.$typeUrl === QueryInsuranceParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryInsuranceParamsResponseAmino { + return o && (o.$typeUrl === QueryInsuranceParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryInsuranceParamsResponse, 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): QueryInsuranceParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceParamsResponse(); + 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: DeepPartial): QueryInsuranceParamsResponse { + const message = createBaseQueryInsuranceParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryInsuranceParamsResponseAmino): QueryInsuranceParamsResponse { + const message = createBaseQueryInsuranceParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryInsuranceParamsResponse): QueryInsuranceParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryInsuranceParamsResponseAminoMsg): QueryInsuranceParamsResponse { + return QueryInsuranceParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceParamsResponseProtoMsg): QueryInsuranceParamsResponse { + return QueryInsuranceParamsResponse.decode(message.value); + }, + toProto(message: QueryInsuranceParamsResponse): Uint8Array { + return QueryInsuranceParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceParamsResponse): QueryInsuranceParamsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceParamsResponse", + value: QueryInsuranceParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceParamsResponse.typeUrl, QueryInsuranceParamsResponse); +function createBaseQueryInsuranceFundRequest(): QueryInsuranceFundRequest { + return { + marketId: "" + }; +} +export const QueryInsuranceFundRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest", + is(o: any): o is QueryInsuranceFundRequest { + return o && (o.$typeUrl === QueryInsuranceFundRequest.typeUrl || typeof o.marketId === "string"); + }, + isAmino(o: any): o is QueryInsuranceFundRequestAmino { + return o && (o.$typeUrl === QueryInsuranceFundRequest.typeUrl || typeof o.market_id === "string"); + }, + encode(message: QueryInsuranceFundRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundRequest { + const message = createBaseQueryInsuranceFundRequest(); + message.marketId = object.marketId ?? ""; + return message; + }, + fromAmino(object: QueryInsuranceFundRequestAmino): QueryInsuranceFundRequest { + const message = createBaseQueryInsuranceFundRequest(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryInsuranceFundRequest): QueryInsuranceFundRequestAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundRequestAminoMsg): QueryInsuranceFundRequest { + return QueryInsuranceFundRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundRequestProtoMsg): QueryInsuranceFundRequest { + return QueryInsuranceFundRequest.decode(message.value); + }, + toProto(message: QueryInsuranceFundRequest): Uint8Array { + return QueryInsuranceFundRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundRequest): QueryInsuranceFundRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundRequest", + value: QueryInsuranceFundRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundRequest.typeUrl, QueryInsuranceFundRequest); +function createBaseQueryInsuranceFundResponse(): QueryInsuranceFundResponse { + return { + fund: undefined + }; +} +export const QueryInsuranceFundResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse", + is(o: any): o is QueryInsuranceFundResponse { + return o && o.$typeUrl === QueryInsuranceFundResponse.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceFundResponseAmino { + return o && o.$typeUrl === QueryInsuranceFundResponse.typeUrl; + }, + encode(message: QueryInsuranceFundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fund !== undefined) { + InsuranceFund.encode(message.fund, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fund = InsuranceFund.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundResponse { + const message = createBaseQueryInsuranceFundResponse(); + message.fund = object.fund !== undefined && object.fund !== null ? InsuranceFund.fromPartial(object.fund) : undefined; + return message; + }, + fromAmino(object: QueryInsuranceFundResponseAmino): QueryInsuranceFundResponse { + const message = createBaseQueryInsuranceFundResponse(); + if (object.fund !== undefined && object.fund !== null) { + message.fund = InsuranceFund.fromAmino(object.fund); + } + return message; + }, + toAmino(message: QueryInsuranceFundResponse): QueryInsuranceFundResponseAmino { + const obj: any = {}; + obj.fund = message.fund ? InsuranceFund.toAmino(message.fund) : undefined; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundResponseAminoMsg): QueryInsuranceFundResponse { + return QueryInsuranceFundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundResponseProtoMsg): QueryInsuranceFundResponse { + return QueryInsuranceFundResponse.decode(message.value); + }, + toProto(message: QueryInsuranceFundResponse): Uint8Array { + return QueryInsuranceFundResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundResponse): QueryInsuranceFundResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundResponse", + value: QueryInsuranceFundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundResponse.typeUrl, QueryInsuranceFundResponse); +function createBaseQueryInsuranceFundsRequest(): QueryInsuranceFundsRequest { + return {}; +} +export const QueryInsuranceFundsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest", + is(o: any): o is QueryInsuranceFundsRequest { + return o && o.$typeUrl === QueryInsuranceFundsRequest.typeUrl; + }, + isAmino(o: any): o is QueryInsuranceFundsRequestAmino { + return o && o.$typeUrl === QueryInsuranceFundsRequest.typeUrl; + }, + encode(_: QueryInsuranceFundsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryInsuranceFundsRequest { + const message = createBaseQueryInsuranceFundsRequest(); + return message; + }, + fromAmino(_: QueryInsuranceFundsRequestAmino): QueryInsuranceFundsRequest { + const message = createBaseQueryInsuranceFundsRequest(); + return message; + }, + toAmino(_: QueryInsuranceFundsRequest): QueryInsuranceFundsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundsRequestAminoMsg): QueryInsuranceFundsRequest { + return QueryInsuranceFundsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundsRequestProtoMsg): QueryInsuranceFundsRequest { + return QueryInsuranceFundsRequest.decode(message.value); + }, + toProto(message: QueryInsuranceFundsRequest): Uint8Array { + return QueryInsuranceFundsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundsRequest): QueryInsuranceFundsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsRequest", + value: QueryInsuranceFundsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundsRequest.typeUrl, QueryInsuranceFundsRequest); +function createBaseQueryInsuranceFundsResponse(): QueryInsuranceFundsResponse { + return { + funds: [] + }; +} +export const QueryInsuranceFundsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse", + is(o: any): o is QueryInsuranceFundsResponse { + return o && (o.$typeUrl === QueryInsuranceFundsResponse.typeUrl || Array.isArray(o.funds) && (!o.funds.length || InsuranceFund.is(o.funds[0]))); + }, + isAmino(o: any): o is QueryInsuranceFundsResponseAmino { + return o && (o.$typeUrl === QueryInsuranceFundsResponse.typeUrl || Array.isArray(o.funds) && (!o.funds.length || InsuranceFund.isAmino(o.funds[0]))); + }, + encode(message: QueryInsuranceFundsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.funds) { + InsuranceFund.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInsuranceFundsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInsuranceFundsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.funds.push(InsuranceFund.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryInsuranceFundsResponse { + const message = createBaseQueryInsuranceFundsResponse(); + message.funds = object.funds?.map(e => InsuranceFund.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryInsuranceFundsResponseAmino): QueryInsuranceFundsResponse { + const message = createBaseQueryInsuranceFundsResponse(); + message.funds = object.funds?.map(e => InsuranceFund.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryInsuranceFundsResponse): QueryInsuranceFundsResponseAmino { + const obj: any = {}; + if (message.funds) { + obj.funds = message.funds.map(e => e ? InsuranceFund.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: QueryInsuranceFundsResponseAminoMsg): QueryInsuranceFundsResponse { + return QueryInsuranceFundsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInsuranceFundsResponseProtoMsg): QueryInsuranceFundsResponse { + return QueryInsuranceFundsResponse.decode(message.value); + }, + toProto(message: QueryInsuranceFundsResponse): Uint8Array { + return QueryInsuranceFundsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInsuranceFundsResponse): QueryInsuranceFundsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryInsuranceFundsResponse", + value: QueryInsuranceFundsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryInsuranceFundsResponse.typeUrl, QueryInsuranceFundsResponse); +function createBaseQueryEstimatedRedemptionsRequest(): QueryEstimatedRedemptionsRequest { + return { + marketId: "", + address: "" + }; +} +export const QueryEstimatedRedemptionsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest", + is(o: any): o is QueryEstimatedRedemptionsRequest { + return o && (o.$typeUrl === QueryEstimatedRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryEstimatedRedemptionsRequestAmino { + return o && (o.$typeUrl === QueryEstimatedRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + encode(message: QueryEstimatedRedemptionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEstimatedRedemptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimatedRedemptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryEstimatedRedemptionsRequest { + const message = createBaseQueryEstimatedRedemptionsRequest(); + message.marketId = object.marketId ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryEstimatedRedemptionsRequestAmino): QueryEstimatedRedemptionsRequest { + const message = createBaseQueryEstimatedRedemptionsRequest(); + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryEstimatedRedemptionsRequest): QueryEstimatedRedemptionsRequestAmino { + const obj: any = {}; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryEstimatedRedemptionsRequestAminoMsg): QueryEstimatedRedemptionsRequest { + return QueryEstimatedRedemptionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimatedRedemptionsRequestProtoMsg): QueryEstimatedRedemptionsRequest { + return QueryEstimatedRedemptionsRequest.decode(message.value); + }, + toProto(message: QueryEstimatedRedemptionsRequest): Uint8Array { + return QueryEstimatedRedemptionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimatedRedemptionsRequest): QueryEstimatedRedemptionsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsRequest", + value: QueryEstimatedRedemptionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEstimatedRedemptionsRequest.typeUrl, QueryEstimatedRedemptionsRequest); +function createBaseQueryEstimatedRedemptionsResponse(): QueryEstimatedRedemptionsResponse { + return { + amount: [] + }; +} +export const QueryEstimatedRedemptionsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse", + is(o: any): o is QueryEstimatedRedemptionsResponse { + return o && (o.$typeUrl === QueryEstimatedRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is QueryEstimatedRedemptionsResponseAmino { + return o && (o.$typeUrl === QueryEstimatedRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: QueryEstimatedRedemptionsResponse, 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): QueryEstimatedRedemptionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimatedRedemptionsResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryEstimatedRedemptionsResponse { + const message = createBaseQueryEstimatedRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryEstimatedRedemptionsResponseAmino): QueryEstimatedRedemptionsResponse { + const message = createBaseQueryEstimatedRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryEstimatedRedemptionsResponse): QueryEstimatedRedemptionsResponseAmino { + 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: QueryEstimatedRedemptionsResponseAminoMsg): QueryEstimatedRedemptionsResponse { + return QueryEstimatedRedemptionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimatedRedemptionsResponseProtoMsg): QueryEstimatedRedemptionsResponse { + return QueryEstimatedRedemptionsResponse.decode(message.value); + }, + toProto(message: QueryEstimatedRedemptionsResponse): Uint8Array { + return QueryEstimatedRedemptionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimatedRedemptionsResponse): QueryEstimatedRedemptionsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryEstimatedRedemptionsResponse", + value: QueryEstimatedRedemptionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEstimatedRedemptionsResponse.typeUrl, QueryEstimatedRedemptionsResponse); +function createBaseQueryPendingRedemptionsRequest(): QueryPendingRedemptionsRequest { + return { + marketId: "", + address: "" + }; +} +export const QueryPendingRedemptionsRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest", + is(o: any): o is QueryPendingRedemptionsRequest { + return o && (o.$typeUrl === QueryPendingRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryPendingRedemptionsRequestAmino { + return o && (o.$typeUrl === QueryPendingRedemptionsRequest.typeUrl || typeof o.marketId === "string" && typeof o.address === "string"); + }, + encode(message: QueryPendingRedemptionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingRedemptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingRedemptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingRedemptionsRequest { + const message = createBaseQueryPendingRedemptionsRequest(); + message.marketId = object.marketId ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryPendingRedemptionsRequestAmino): QueryPendingRedemptionsRequest { + const message = createBaseQueryPendingRedemptionsRequest(); + if (object.marketId !== undefined && object.marketId !== null) { + message.marketId = object.marketId; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryPendingRedemptionsRequest): QueryPendingRedemptionsRequestAmino { + const obj: any = {}; + obj.marketId = message.marketId === "" ? undefined : message.marketId; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryPendingRedemptionsRequestAminoMsg): QueryPendingRedemptionsRequest { + return QueryPendingRedemptionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingRedemptionsRequestProtoMsg): QueryPendingRedemptionsRequest { + return QueryPendingRedemptionsRequest.decode(message.value); + }, + toProto(message: QueryPendingRedemptionsRequest): Uint8Array { + return QueryPendingRedemptionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingRedemptionsRequest): QueryPendingRedemptionsRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsRequest", + value: QueryPendingRedemptionsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingRedemptionsRequest.typeUrl, QueryPendingRedemptionsRequest); +function createBaseQueryPendingRedemptionsResponse(): QueryPendingRedemptionsResponse { + return { + amount: [] + }; +} +export const QueryPendingRedemptionsResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse", + is(o: any): o is QueryPendingRedemptionsResponse { + return o && (o.$typeUrl === QueryPendingRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isAmino(o: any): o is QueryPendingRedemptionsResponseAmino { + return o && (o.$typeUrl === QueryPendingRedemptionsResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: QueryPendingRedemptionsResponse, 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): QueryPendingRedemptionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingRedemptionsResponse(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingRedemptionsResponse { + const message = createBaseQueryPendingRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPendingRedemptionsResponseAmino): QueryPendingRedemptionsResponse { + const message = createBaseQueryPendingRedemptionsResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPendingRedemptionsResponse): QueryPendingRedemptionsResponseAmino { + 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: QueryPendingRedemptionsResponseAminoMsg): QueryPendingRedemptionsResponse { + return QueryPendingRedemptionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingRedemptionsResponseProtoMsg): QueryPendingRedemptionsResponse { + return QueryPendingRedemptionsResponse.decode(message.value); + }, + toProto(message: QueryPendingRedemptionsResponse): Uint8Array { + return QueryPendingRedemptionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingRedemptionsResponse): QueryPendingRedemptionsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryPendingRedemptionsResponse", + value: QueryPendingRedemptionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingRedemptionsResponse.typeUrl, QueryPendingRedemptionsResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/insurance/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..34466eaa --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/tx.rpc.func.ts @@ -0,0 +1,27 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateInsuranceFund, MsgUnderwrite, MsgRequestRedemption, MsgUpdateParams } from "./tx"; +export const createCreateInsuranceFund = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateInsuranceFund.typeUrl, + encoders: toEncoders(MsgCreateInsuranceFund), + converters: toConverters(MsgCreateInsuranceFund) +}); +export const createUnderwrite = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUnderwrite.typeUrl, + encoders: toEncoders(MsgUnderwrite), + converters: toConverters(MsgUnderwrite) +}); +export const createRequestRedemption = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestRedemption.typeUrl, + encoders: toEncoders(MsgRequestRedemption), + converters: toConverters(MsgRequestRedemption) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/insurance/v1beta1/tx.ts b/libs/injectivejs/src/injective/insurance/v1beta1/tx.ts new file mode 100644 index 00000000..1965e15c --- /dev/null +++ b/libs/injectivejs/src/injective/insurance/v1beta1/tx.ts @@ -0,0 +1,892 @@ +import { OracleType } from "../../oracle/v1beta1/oracle"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino } from "./insurance"; +import { isSet, DeepPartial } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgCreateInsuranceFund a message to create an insurance fund for a derivative + * market. + */ +export interface MsgCreateInsuranceFund { + /** Creator of the insurance fund. */ + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** Coin denom to use for the market quote denom */ + quoteDenom: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracleBase: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracleQuote: string; + /** Oracle type of the binary options or derivative market */ + oracleType: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: bigint; + /** Initial deposit of the insurance fund */ + initialDeposit: Coin; +} +export interface MsgCreateInsuranceFundProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund"; + value: Uint8Array; +} +/** + * MsgCreateInsuranceFund a message to create an insurance fund for a derivative + * market. + */ +export interface MsgCreateInsuranceFundAmino { + /** Creator of the insurance fund. */ + sender: string; + /** Ticker for the derivative market. */ + ticker: string; + /** Coin denom to use for the market quote denom */ + quote_denom: string; + /** + * Oracle base currency of the derivative market OR the oracle symbol for the + * binary options market. + */ + oracle_base: string; + /** + * Oracle quote currency of the derivative market OR the oracle provider for + * the binary options market. + */ + oracle_quote: string; + /** Oracle type of the binary options or derivative market */ + oracle_type: OracleType; + /** + * Expiration time of the derivative market. Should be -1 for perpetual or -2 + * for binary options markets. + */ + expiry: string; + /** Initial deposit of the insurance fund */ + initial_deposit: CoinAmino; +} +export interface MsgCreateInsuranceFundAminoMsg { + type: "insurance/MsgCreateInsuranceFund"; + value: MsgCreateInsuranceFundAmino; +} +export interface MsgCreateInsuranceFundResponse {} +export interface MsgCreateInsuranceFundResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse"; + value: Uint8Array; +} +export interface MsgCreateInsuranceFundResponseAmino {} +export interface MsgCreateInsuranceFundResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse"; + value: MsgCreateInsuranceFundResponseAmino; +} +/** + * MsgUnderwrite defines a message for depositing coins to underwrite an + * insurance fund + */ +export interface MsgUnderwrite { + /** Address of the underwriter. */ + sender: string; + /** MarketID of the insurance fund. */ + marketId: string; + /** Amount of quote_denom to underwrite the insurance fund. */ + deposit: Coin; +} +export interface MsgUnderwriteProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite"; + value: Uint8Array; +} +/** + * MsgUnderwrite defines a message for depositing coins to underwrite an + * insurance fund + */ +export interface MsgUnderwriteAmino { + /** Address of the underwriter. */ + sender: string; + /** MarketID of the insurance fund. */ + market_id: string; + /** Amount of quote_denom to underwrite the insurance fund. */ + deposit: CoinAmino; +} +export interface MsgUnderwriteAminoMsg { + type: "insurance/MsgUnderwrite"; + value: MsgUnderwriteAmino; +} +export interface MsgUnderwriteResponse {} +export interface MsgUnderwriteResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse"; + value: Uint8Array; +} +export interface MsgUnderwriteResponseAmino {} +export interface MsgUnderwriteResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgUnderwriteResponse"; + value: MsgUnderwriteResponseAmino; +} +/** + * MsgRequestRedemption defines a message for requesting a redemption of the + * sender's insurance fund tokens + */ +export interface MsgRequestRedemption { + /** Address of the underwriter requesting a redemption. */ + sender: string; + /** MarketID of the insurance fund. */ + marketId: string; + /** Insurance fund share token amount to be redeemed. */ + amount: Coin; +} +export interface MsgRequestRedemptionProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption"; + value: Uint8Array; +} +/** + * MsgRequestRedemption defines a message for requesting a redemption of the + * sender's insurance fund tokens + */ +export interface MsgRequestRedemptionAmino { + /** Address of the underwriter requesting a redemption. */ + sender: string; + /** MarketID of the insurance fund. */ + market_id: string; + /** Insurance fund share token amount to be redeemed. */ + amount: CoinAmino; +} +export interface MsgRequestRedemptionAminoMsg { + type: "insurance/MsgRequestRedemption"; + value: MsgRequestRedemptionAmino; +} +export interface MsgRequestRedemptionResponse {} +export interface MsgRequestRedemptionResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse"; + value: Uint8Array; +} +export interface MsgRequestRedemptionResponseAmino {} +export interface MsgRequestRedemptionResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse"; + value: MsgRequestRedemptionResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the insurance parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the insurance parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "insurance/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.insurance.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateInsuranceFund(): MsgCreateInsuranceFund { + return { + sender: "", + ticker: "", + quoteDenom: "", + oracleBase: "", + oracleQuote: "", + oracleType: 0, + expiry: BigInt(0), + initialDeposit: Coin.fromPartial({}) + }; +} +export const MsgCreateInsuranceFund = { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund", + aminoType: "insurance/MsgCreateInsuranceFund", + is(o: any): o is MsgCreateInsuranceFund { + return o && (o.$typeUrl === MsgCreateInsuranceFund.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quoteDenom === "string" && typeof o.oracleBase === "string" && typeof o.oracleQuote === "string" && isSet(o.oracleType) && typeof o.expiry === "bigint" && Coin.is(o.initialDeposit)); + }, + isAmino(o: any): o is MsgCreateInsuranceFundAmino { + return o && (o.$typeUrl === MsgCreateInsuranceFund.typeUrl || typeof o.sender === "string" && typeof o.ticker === "string" && typeof o.quote_denom === "string" && typeof o.oracle_base === "string" && typeof o.oracle_quote === "string" && isSet(o.oracle_type) && typeof o.expiry === "bigint" && Coin.isAmino(o.initial_deposit)); + }, + encode(message: MsgCreateInsuranceFund, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.quoteDenom !== "") { + writer.uint32(26).string(message.quoteDenom); + } + if (message.oracleBase !== "") { + writer.uint32(34).string(message.oracleBase); + } + if (message.oracleQuote !== "") { + writer.uint32(42).string(message.oracleQuote); + } + if (message.oracleType !== 0) { + writer.uint32(48).int32(message.oracleType); + } + if (message.expiry !== BigInt(0)) { + writer.uint32(56).int64(message.expiry); + } + if (message.initialDeposit !== undefined) { + Coin.encode(message.initialDeposit, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateInsuranceFund { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateInsuranceFund(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.quoteDenom = reader.string(); + break; + case 4: + message.oracleBase = reader.string(); + break; + case 5: + message.oracleQuote = reader.string(); + break; + case 6: + message.oracleType = (reader.int32() as any); + break; + case 7: + message.expiry = reader.int64(); + break; + case 8: + message.initialDeposit = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateInsuranceFund { + const message = createBaseMsgCreateInsuranceFund(); + message.sender = object.sender ?? ""; + message.ticker = object.ticker ?? ""; + message.quoteDenom = object.quoteDenom ?? ""; + message.oracleBase = object.oracleBase ?? ""; + message.oracleQuote = object.oracleQuote ?? ""; + message.oracleType = object.oracleType ?? 0; + message.expiry = object.expiry !== undefined && object.expiry !== null ? BigInt(object.expiry.toString()) : BigInt(0); + message.initialDeposit = object.initialDeposit !== undefined && object.initialDeposit !== null ? Coin.fromPartial(object.initialDeposit) : undefined; + return message; + }, + fromAmino(object: MsgCreateInsuranceFundAmino): MsgCreateInsuranceFund { + const message = createBaseMsgCreateInsuranceFund(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.quote_denom !== undefined && object.quote_denom !== null) { + message.quoteDenom = object.quote_denom; + } + if (object.oracle_base !== undefined && object.oracle_base !== null) { + message.oracleBase = object.oracle_base; + } + if (object.oracle_quote !== undefined && object.oracle_quote !== null) { + message.oracleQuote = object.oracle_quote; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.expiry !== undefined && object.expiry !== null) { + message.expiry = BigInt(object.expiry); + } + if (object.initial_deposit !== undefined && object.initial_deposit !== null) { + message.initialDeposit = Coin.fromAmino(object.initial_deposit); + } + return message; + }, + toAmino(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.quote_denom = message.quoteDenom === "" ? undefined : message.quoteDenom; + obj.oracle_base = message.oracleBase === "" ? undefined : message.oracleBase; + obj.oracle_quote = message.oracleQuote === "" ? undefined : message.oracleQuote; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.expiry = message.expiry !== BigInt(0) ? message.expiry?.toString() : undefined; + obj.initial_deposit = message.initialDeposit ? Coin.toAmino(message.initialDeposit) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateInsuranceFundAminoMsg): MsgCreateInsuranceFund { + return MsgCreateInsuranceFund.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundAminoMsg { + return { + type: "insurance/MsgCreateInsuranceFund", + value: MsgCreateInsuranceFund.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateInsuranceFundProtoMsg): MsgCreateInsuranceFund { + return MsgCreateInsuranceFund.decode(message.value); + }, + toProto(message: MsgCreateInsuranceFund): Uint8Array { + return MsgCreateInsuranceFund.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateInsuranceFund): MsgCreateInsuranceFundProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFund", + value: MsgCreateInsuranceFund.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateInsuranceFund.typeUrl, MsgCreateInsuranceFund); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateInsuranceFund.aminoType, MsgCreateInsuranceFund.typeUrl); +function createBaseMsgCreateInsuranceFundResponse(): MsgCreateInsuranceFundResponse { + return {}; +} +export const MsgCreateInsuranceFundResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse", + is(o: any): o is MsgCreateInsuranceFundResponse { + return o && o.$typeUrl === MsgCreateInsuranceFundResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateInsuranceFundResponseAmino { + return o && o.$typeUrl === MsgCreateInsuranceFundResponse.typeUrl; + }, + encode(_: MsgCreateInsuranceFundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateInsuranceFundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateInsuranceFundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateInsuranceFundResponse { + const message = createBaseMsgCreateInsuranceFundResponse(); + return message; + }, + fromAmino(_: MsgCreateInsuranceFundResponseAmino): MsgCreateInsuranceFundResponse { + const message = createBaseMsgCreateInsuranceFundResponse(); + return message; + }, + toAmino(_: MsgCreateInsuranceFundResponse): MsgCreateInsuranceFundResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateInsuranceFundResponseAminoMsg): MsgCreateInsuranceFundResponse { + return MsgCreateInsuranceFundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateInsuranceFundResponseProtoMsg): MsgCreateInsuranceFundResponse { + return MsgCreateInsuranceFundResponse.decode(message.value); + }, + toProto(message: MsgCreateInsuranceFundResponse): Uint8Array { + return MsgCreateInsuranceFundResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateInsuranceFundResponse): MsgCreateInsuranceFundResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgCreateInsuranceFundResponse", + value: MsgCreateInsuranceFundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateInsuranceFundResponse.typeUrl, MsgCreateInsuranceFundResponse); +function createBaseMsgUnderwrite(): MsgUnderwrite { + return { + sender: "", + marketId: "", + deposit: Coin.fromPartial({}) + }; +} +export const MsgUnderwrite = { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite", + aminoType: "insurance/MsgUnderwrite", + is(o: any): o is MsgUnderwrite { + return o && (o.$typeUrl === MsgUnderwrite.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && Coin.is(o.deposit)); + }, + isAmino(o: any): o is MsgUnderwriteAmino { + return o && (o.$typeUrl === MsgUnderwrite.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && Coin.isAmino(o.deposit)); + }, + encode(message: MsgUnderwrite, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.deposit !== undefined) { + Coin.encode(message.deposit, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnderwrite { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnderwrite(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.deposit = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUnderwrite { + const message = createBaseMsgUnderwrite(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Coin.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: MsgUnderwriteAmino): MsgUnderwrite { + const message = createBaseMsgUnderwrite(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Coin.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: MsgUnderwrite): MsgUnderwriteAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.deposit = message.deposit ? Coin.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUnderwriteAminoMsg): MsgUnderwrite { + return MsgUnderwrite.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnderwrite): MsgUnderwriteAminoMsg { + return { + type: "insurance/MsgUnderwrite", + value: MsgUnderwrite.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnderwriteProtoMsg): MsgUnderwrite { + return MsgUnderwrite.decode(message.value); + }, + toProto(message: MsgUnderwrite): Uint8Array { + return MsgUnderwrite.encode(message).finish(); + }, + toProtoMsg(message: MsgUnderwrite): MsgUnderwriteProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwrite", + value: MsgUnderwrite.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnderwrite.typeUrl, MsgUnderwrite); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnderwrite.aminoType, MsgUnderwrite.typeUrl); +function createBaseMsgUnderwriteResponse(): MsgUnderwriteResponse { + return {}; +} +export const MsgUnderwriteResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse", + is(o: any): o is MsgUnderwriteResponse { + return o && o.$typeUrl === MsgUnderwriteResponse.typeUrl; + }, + isAmino(o: any): o is MsgUnderwriteResponseAmino { + return o && o.$typeUrl === MsgUnderwriteResponse.typeUrl; + }, + encode(_: MsgUnderwriteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnderwriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnderwriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUnderwriteResponse { + const message = createBaseMsgUnderwriteResponse(); + return message; + }, + fromAmino(_: MsgUnderwriteResponseAmino): MsgUnderwriteResponse { + const message = createBaseMsgUnderwriteResponse(); + return message; + }, + toAmino(_: MsgUnderwriteResponse): MsgUnderwriteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnderwriteResponseAminoMsg): MsgUnderwriteResponse { + return MsgUnderwriteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnderwriteResponseProtoMsg): MsgUnderwriteResponse { + return MsgUnderwriteResponse.decode(message.value); + }, + toProto(message: MsgUnderwriteResponse): Uint8Array { + return MsgUnderwriteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnderwriteResponse): MsgUnderwriteResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUnderwriteResponse", + value: MsgUnderwriteResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnderwriteResponse.typeUrl, MsgUnderwriteResponse); +function createBaseMsgRequestRedemption(): MsgRequestRedemption { + return { + sender: "", + marketId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgRequestRedemption = { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption", + aminoType: "insurance/MsgRequestRedemption", + is(o: any): o is MsgRequestRedemption { + return o && (o.$typeUrl === MsgRequestRedemption.typeUrl || typeof o.sender === "string" && typeof o.marketId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgRequestRedemptionAmino { + return o && (o.$typeUrl === MsgRequestRedemption.typeUrl || typeof o.sender === "string" && typeof o.market_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgRequestRedemption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.marketId !== "") { + writer.uint32(18).string(message.marketId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestRedemption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestRedemption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.marketId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestRedemption { + const message = createBaseMsgRequestRedemption(); + message.sender = object.sender ?? ""; + message.marketId = object.marketId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgRequestRedemptionAmino): MsgRequestRedemption { + const message = createBaseMsgRequestRedemption(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgRequestRedemption): MsgRequestRedemptionAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRequestRedemptionAminoMsg): MsgRequestRedemption { + return MsgRequestRedemption.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestRedemption): MsgRequestRedemptionAminoMsg { + return { + type: "insurance/MsgRequestRedemption", + value: MsgRequestRedemption.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestRedemptionProtoMsg): MsgRequestRedemption { + return MsgRequestRedemption.decode(message.value); + }, + toProto(message: MsgRequestRedemption): Uint8Array { + return MsgRequestRedemption.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestRedemption): MsgRequestRedemptionProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemption", + value: MsgRequestRedemption.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestRedemption.typeUrl, MsgRequestRedemption); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestRedemption.aminoType, MsgRequestRedemption.typeUrl); +function createBaseMsgRequestRedemptionResponse(): MsgRequestRedemptionResponse { + return {}; +} +export const MsgRequestRedemptionResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse", + is(o: any): o is MsgRequestRedemptionResponse { + return o && o.$typeUrl === MsgRequestRedemptionResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestRedemptionResponseAmino { + return o && o.$typeUrl === MsgRequestRedemptionResponse.typeUrl; + }, + encode(_: MsgRequestRedemptionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestRedemptionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestRedemptionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestRedemptionResponse { + const message = createBaseMsgRequestRedemptionResponse(); + return message; + }, + fromAmino(_: MsgRequestRedemptionResponseAmino): MsgRequestRedemptionResponse { + const message = createBaseMsgRequestRedemptionResponse(); + return message; + }, + toAmino(_: MsgRequestRedemptionResponse): MsgRequestRedemptionResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestRedemptionResponseAminoMsg): MsgRequestRedemptionResponse { + return MsgRequestRedemptionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestRedemptionResponseProtoMsg): MsgRequestRedemptionResponse { + return MsgRequestRedemptionResponse.decode(message.value); + }, + toProto(message: MsgRequestRedemptionResponse): Uint8Array { + return MsgRequestRedemptionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestRedemptionResponse): MsgRequestRedemptionResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgRequestRedemptionResponse", + value: MsgRequestRedemptionResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestRedemptionResponse.typeUrl, MsgRequestRedemptionResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParams", + aminoType: "insurance/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "insurance/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: "/injective.insurance.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.insurance.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/genesis.ts b/libs/injectivejs/src/injective/ocr/v1beta1/genesis.ts new file mode 100644 index 00000000..2fd0d991 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/genesis.ts @@ -0,0 +1,945 @@ +import { Params, ParamsAmino, FeedConfig, FeedConfigAmino, Transmission, TransmissionAmino, EpochAndRound, EpochAndRoundAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the OCR module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to OCR. */ + params: Params; + /** feed_configs stores all of the supported OCR feeds */ + feedConfigs: FeedConfig[]; + /** latest_epoch_and_rounds stores the latest epoch and round for each feedId */ + latestEpochAndRounds: FeedEpochAndRound[]; + /** feed_transmissions stores the last transmission for each feed */ + feedTransmissions: FeedTransmission[]; + /** + * latest_aggregator_round_ids stores the latest aggregator round ID for each + * feedId + */ + latestAggregatorRoundIds: FeedLatestAggregatorRoundIDs[]; + /** reward_pools stores the reward pools */ + rewardPools: RewardPool[]; + /** feed_observation_counts stores the feed observation counts */ + feedObservationCounts: FeedCounts[]; + /** feed_transmission_counts stores the feed transmission counts */ + feedTransmissionCounts: FeedCounts[]; + /** pending_payeeships stores the pending payeeships */ + pendingPayeeships: PendingPayeeship[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.ocr.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the OCR module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to OCR. */ + params: ParamsAmino; + /** feed_configs stores all of the supported OCR feeds */ + feed_configs: FeedConfigAmino[]; + /** latest_epoch_and_rounds stores the latest epoch and round for each feedId */ + latest_epoch_and_rounds: FeedEpochAndRoundAmino[]; + /** feed_transmissions stores the last transmission for each feed */ + feed_transmissions: FeedTransmissionAmino[]; + /** + * latest_aggregator_round_ids stores the latest aggregator round ID for each + * feedId + */ + latest_aggregator_round_ids: FeedLatestAggregatorRoundIDsAmino[]; + /** reward_pools stores the reward pools */ + reward_pools: RewardPoolAmino[]; + /** feed_observation_counts stores the feed observation counts */ + feed_observation_counts: FeedCountsAmino[]; + /** feed_transmission_counts stores the feed transmission counts */ + feed_transmission_counts: FeedCountsAmino[]; + /** pending_payeeships stores the pending payeeships */ + pending_payeeships: PendingPayeeshipAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.ocr.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface FeedTransmission { + feedId: string; + transmission?: Transmission; +} +export interface FeedTransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission"; + value: Uint8Array; +} +export interface FeedTransmissionAmino { + feed_id: string; + transmission?: TransmissionAmino; +} +export interface FeedTransmissionAminoMsg { + type: "/injective.ocr.v1beta1.FeedTransmission"; + value: FeedTransmissionAmino; +} +export interface FeedEpochAndRound { + feedId: string; + epochAndRound?: EpochAndRound; +} +export interface FeedEpochAndRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound"; + value: Uint8Array; +} +export interface FeedEpochAndRoundAmino { + feed_id: string; + epoch_and_round?: EpochAndRoundAmino; +} +export interface FeedEpochAndRoundAminoMsg { + type: "/injective.ocr.v1beta1.FeedEpochAndRound"; + value: FeedEpochAndRoundAmino; +} +export interface FeedLatestAggregatorRoundIDs { + feedId: string; + aggregatorRoundId: bigint; +} +export interface FeedLatestAggregatorRoundIDsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs"; + value: Uint8Array; +} +export interface FeedLatestAggregatorRoundIDsAmino { + feed_id: string; + aggregator_round_id: string; +} +export interface FeedLatestAggregatorRoundIDsAminoMsg { + type: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs"; + value: FeedLatestAggregatorRoundIDsAmino; +} +export interface RewardPool { + feedId: string; + amount: Coin; +} +export interface RewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.RewardPool"; + value: Uint8Array; +} +export interface RewardPoolAmino { + feed_id: string; + amount: CoinAmino; +} +export interface RewardPoolAminoMsg { + type: "/injective.ocr.v1beta1.RewardPool"; + value: RewardPoolAmino; +} +export interface FeedCounts { + feedId: string; + counts: Count[]; +} +export interface FeedCountsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedCounts"; + value: Uint8Array; +} +export interface FeedCountsAmino { + feed_id: string; + counts: CountAmino[]; +} +export interface FeedCountsAminoMsg { + type: "/injective.ocr.v1beta1.FeedCounts"; + value: FeedCountsAmino; +} +export interface Count { + address: string; + count: bigint; +} +export interface CountProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Count"; + value: Uint8Array; +} +export interface CountAmino { + address: string; + count: string; +} +export interface CountAminoMsg { + type: "/injective.ocr.v1beta1.Count"; + value: CountAmino; +} +export interface PendingPayeeship { + feedId: string; + transmitter: string; + proposedPayee: string; +} +export interface PendingPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship"; + value: Uint8Array; +} +export interface PendingPayeeshipAmino { + feed_id: string; + transmitter: string; + proposed_payee: string; +} +export interface PendingPayeeshipAminoMsg { + type: "/injective.ocr.v1beta1.PendingPayeeship"; + value: PendingPayeeshipAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + feedConfigs: [], + latestEpochAndRounds: [], + feedTransmissions: [], + latestAggregatorRoundIds: [], + rewardPools: [], + feedObservationCounts: [], + feedTransmissionCounts: [], + pendingPayeeships: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.ocr.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.feedConfigs) && (!o.feedConfigs.length || FeedConfig.is(o.feedConfigs[0])) && Array.isArray(o.latestEpochAndRounds) && (!o.latestEpochAndRounds.length || FeedEpochAndRound.is(o.latestEpochAndRounds[0])) && Array.isArray(o.feedTransmissions) && (!o.feedTransmissions.length || FeedTransmission.is(o.feedTransmissions[0])) && Array.isArray(o.latestAggregatorRoundIds) && (!o.latestAggregatorRoundIds.length || FeedLatestAggregatorRoundIDs.is(o.latestAggregatorRoundIds[0])) && Array.isArray(o.rewardPools) && (!o.rewardPools.length || RewardPool.is(o.rewardPools[0])) && Array.isArray(o.feedObservationCounts) && (!o.feedObservationCounts.length || FeedCounts.is(o.feedObservationCounts[0])) && Array.isArray(o.feedTransmissionCounts) && (!o.feedTransmissionCounts.length || FeedCounts.is(o.feedTransmissionCounts[0])) && Array.isArray(o.pendingPayeeships) && (!o.pendingPayeeships.length || PendingPayeeship.is(o.pendingPayeeships[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.feed_configs) && (!o.feed_configs.length || FeedConfig.isAmino(o.feed_configs[0])) && Array.isArray(o.latest_epoch_and_rounds) && (!o.latest_epoch_and_rounds.length || FeedEpochAndRound.isAmino(o.latest_epoch_and_rounds[0])) && Array.isArray(o.feed_transmissions) && (!o.feed_transmissions.length || FeedTransmission.isAmino(o.feed_transmissions[0])) && Array.isArray(o.latest_aggregator_round_ids) && (!o.latest_aggregator_round_ids.length || FeedLatestAggregatorRoundIDs.isAmino(o.latest_aggregator_round_ids[0])) && Array.isArray(o.reward_pools) && (!o.reward_pools.length || RewardPool.isAmino(o.reward_pools[0])) && Array.isArray(o.feed_observation_counts) && (!o.feed_observation_counts.length || FeedCounts.isAmino(o.feed_observation_counts[0])) && Array.isArray(o.feed_transmission_counts) && (!o.feed_transmission_counts.length || FeedCounts.isAmino(o.feed_transmission_counts[0])) && Array.isArray(o.pending_payeeships) && (!o.pending_payeeships.length || PendingPayeeship.isAmino(o.pending_payeeships[0]))); + }, + 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.feedConfigs) { + FeedConfig.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.latestEpochAndRounds) { + FeedEpochAndRound.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.feedTransmissions) { + FeedTransmission.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.latestAggregatorRoundIds) { + FeedLatestAggregatorRoundIDs.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.rewardPools) { + RewardPool.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.feedObservationCounts) { + FeedCounts.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.feedTransmissionCounts) { + FeedCounts.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.pendingPayeeships) { + PendingPayeeship.encode(v!, writer.uint32(74).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.feedConfigs.push(FeedConfig.decode(reader, reader.uint32())); + break; + case 3: + message.latestEpochAndRounds.push(FeedEpochAndRound.decode(reader, reader.uint32())); + break; + case 4: + message.feedTransmissions.push(FeedTransmission.decode(reader, reader.uint32())); + break; + case 5: + message.latestAggregatorRoundIds.push(FeedLatestAggregatorRoundIDs.decode(reader, reader.uint32())); + break; + case 6: + message.rewardPools.push(RewardPool.decode(reader, reader.uint32())); + break; + case 7: + message.feedObservationCounts.push(FeedCounts.decode(reader, reader.uint32())); + break; + case 8: + message.feedTransmissionCounts.push(FeedCounts.decode(reader, reader.uint32())); + break; + case 9: + message.pendingPayeeships.push(PendingPayeeship.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.feedConfigs = object.feedConfigs?.map(e => FeedConfig.fromPartial(e)) || []; + message.latestEpochAndRounds = object.latestEpochAndRounds?.map(e => FeedEpochAndRound.fromPartial(e)) || []; + message.feedTransmissions = object.feedTransmissions?.map(e => FeedTransmission.fromPartial(e)) || []; + message.latestAggregatorRoundIds = object.latestAggregatorRoundIds?.map(e => FeedLatestAggregatorRoundIDs.fromPartial(e)) || []; + message.rewardPools = object.rewardPools?.map(e => RewardPool.fromPartial(e)) || []; + message.feedObservationCounts = object.feedObservationCounts?.map(e => FeedCounts.fromPartial(e)) || []; + message.feedTransmissionCounts = object.feedTransmissionCounts?.map(e => FeedCounts.fromPartial(e)) || []; + message.pendingPayeeships = object.pendingPayeeships?.map(e => PendingPayeeship.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.feedConfigs = object.feed_configs?.map(e => FeedConfig.fromAmino(e)) || []; + message.latestEpochAndRounds = object.latest_epoch_and_rounds?.map(e => FeedEpochAndRound.fromAmino(e)) || []; + message.feedTransmissions = object.feed_transmissions?.map(e => FeedTransmission.fromAmino(e)) || []; + message.latestAggregatorRoundIds = object.latest_aggregator_round_ids?.map(e => FeedLatestAggregatorRoundIDs.fromAmino(e)) || []; + message.rewardPools = object.reward_pools?.map(e => RewardPool.fromAmino(e)) || []; + message.feedObservationCounts = object.feed_observation_counts?.map(e => FeedCounts.fromAmino(e)) || []; + message.feedTransmissionCounts = object.feed_transmission_counts?.map(e => FeedCounts.fromAmino(e)) || []; + message.pendingPayeeships = object.pending_payeeships?.map(e => PendingPayeeship.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.feedConfigs) { + obj.feed_configs = message.feedConfigs.map(e => e ? FeedConfig.toAmino(e) : undefined); + } else { + obj.feed_configs = message.feedConfigs; + } + if (message.latestEpochAndRounds) { + obj.latest_epoch_and_rounds = message.latestEpochAndRounds.map(e => e ? FeedEpochAndRound.toAmino(e) : undefined); + } else { + obj.latest_epoch_and_rounds = message.latestEpochAndRounds; + } + if (message.feedTransmissions) { + obj.feed_transmissions = message.feedTransmissions.map(e => e ? FeedTransmission.toAmino(e) : undefined); + } else { + obj.feed_transmissions = message.feedTransmissions; + } + if (message.latestAggregatorRoundIds) { + obj.latest_aggregator_round_ids = message.latestAggregatorRoundIds.map(e => e ? FeedLatestAggregatorRoundIDs.toAmino(e) : undefined); + } else { + obj.latest_aggregator_round_ids = message.latestAggregatorRoundIds; + } + if (message.rewardPools) { + obj.reward_pools = message.rewardPools.map(e => e ? RewardPool.toAmino(e) : undefined); + } else { + obj.reward_pools = message.rewardPools; + } + if (message.feedObservationCounts) { + obj.feed_observation_counts = message.feedObservationCounts.map(e => e ? FeedCounts.toAmino(e) : undefined); + } else { + obj.feed_observation_counts = message.feedObservationCounts; + } + if (message.feedTransmissionCounts) { + obj.feed_transmission_counts = message.feedTransmissionCounts.map(e => e ? FeedCounts.toAmino(e) : undefined); + } else { + obj.feed_transmission_counts = message.feedTransmissionCounts; + } + if (message.pendingPayeeships) { + obj.pending_payeeships = message.pendingPayeeships.map(e => e ? PendingPayeeship.toAmino(e) : undefined); + } else { + obj.pending_payeeships = message.pendingPayeeships; + } + 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: "/injective.ocr.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseFeedTransmission(): FeedTransmission { + return { + feedId: "", + transmission: undefined + }; +} +export const FeedTransmission = { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission", + is(o: any): o is FeedTransmission { + return o && (o.$typeUrl === FeedTransmission.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is FeedTransmissionAmino { + return o && (o.$typeUrl === FeedTransmission.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: FeedTransmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.transmission !== undefined) { + Transmission.encode(message.transmission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedTransmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.transmission = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedTransmission { + const message = createBaseFeedTransmission(); + message.feedId = object.feedId ?? ""; + message.transmission = object.transmission !== undefined && object.transmission !== null ? Transmission.fromPartial(object.transmission) : undefined; + return message; + }, + fromAmino(object: FeedTransmissionAmino): FeedTransmission { + const message = createBaseFeedTransmission(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.transmission !== undefined && object.transmission !== null) { + message.transmission = Transmission.fromAmino(object.transmission); + } + return message; + }, + toAmino(message: FeedTransmission): FeedTransmissionAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.transmission = message.transmission ? Transmission.toAmino(message.transmission) : undefined; + return obj; + }, + fromAminoMsg(object: FeedTransmissionAminoMsg): FeedTransmission { + return FeedTransmission.fromAmino(object.value); + }, + fromProtoMsg(message: FeedTransmissionProtoMsg): FeedTransmission { + return FeedTransmission.decode(message.value); + }, + toProto(message: FeedTransmission): Uint8Array { + return FeedTransmission.encode(message).finish(); + }, + toProtoMsg(message: FeedTransmission): FeedTransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedTransmission", + value: FeedTransmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedTransmission.typeUrl, FeedTransmission); +function createBaseFeedEpochAndRound(): FeedEpochAndRound { + return { + feedId: "", + epochAndRound: undefined + }; +} +export const FeedEpochAndRound = { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound", + is(o: any): o is FeedEpochAndRound { + return o && (o.$typeUrl === FeedEpochAndRound.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is FeedEpochAndRoundAmino { + return o && (o.$typeUrl === FeedEpochAndRound.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: FeedEpochAndRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedEpochAndRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedEpochAndRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedEpochAndRound { + const message = createBaseFeedEpochAndRound(); + message.feedId = object.feedId ?? ""; + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: FeedEpochAndRoundAmino): FeedEpochAndRound { + const message = createBaseFeedEpochAndRound(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: FeedEpochAndRound): FeedEpochAndRoundAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: FeedEpochAndRoundAminoMsg): FeedEpochAndRound { + return FeedEpochAndRound.fromAmino(object.value); + }, + fromProtoMsg(message: FeedEpochAndRoundProtoMsg): FeedEpochAndRound { + return FeedEpochAndRound.decode(message.value); + }, + toProto(message: FeedEpochAndRound): Uint8Array { + return FeedEpochAndRound.encode(message).finish(); + }, + toProtoMsg(message: FeedEpochAndRound): FeedEpochAndRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedEpochAndRound", + value: FeedEpochAndRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedEpochAndRound.typeUrl, FeedEpochAndRound); +function createBaseFeedLatestAggregatorRoundIDs(): FeedLatestAggregatorRoundIDs { + return { + feedId: "", + aggregatorRoundId: BigInt(0) + }; +} +export const FeedLatestAggregatorRoundIDs = { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs", + is(o: any): o is FeedLatestAggregatorRoundIDs { + return o && (o.$typeUrl === FeedLatestAggregatorRoundIDs.typeUrl || typeof o.feedId === "string" && typeof o.aggregatorRoundId === "bigint"); + }, + isAmino(o: any): o is FeedLatestAggregatorRoundIDsAmino { + return o && (o.$typeUrl === FeedLatestAggregatorRoundIDs.typeUrl || typeof o.feed_id === "string" && typeof o.aggregator_round_id === "bigint"); + }, + encode(message: FeedLatestAggregatorRoundIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.aggregatorRoundId !== BigInt(0)) { + writer.uint32(16).uint64(message.aggregatorRoundId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedLatestAggregatorRoundIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedLatestAggregatorRoundIDs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.aggregatorRoundId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedLatestAggregatorRoundIDs { + const message = createBaseFeedLatestAggregatorRoundIDs(); + message.feedId = object.feedId ?? ""; + message.aggregatorRoundId = object.aggregatorRoundId !== undefined && object.aggregatorRoundId !== null ? BigInt(object.aggregatorRoundId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeedLatestAggregatorRoundIDsAmino): FeedLatestAggregatorRoundIDs { + const message = createBaseFeedLatestAggregatorRoundIDs(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.aggregator_round_id !== undefined && object.aggregator_round_id !== null) { + message.aggregatorRoundId = BigInt(object.aggregator_round_id); + } + return message; + }, + toAmino(message: FeedLatestAggregatorRoundIDs): FeedLatestAggregatorRoundIDsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.aggregator_round_id = message.aggregatorRoundId !== BigInt(0) ? message.aggregatorRoundId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeedLatestAggregatorRoundIDsAminoMsg): FeedLatestAggregatorRoundIDs { + return FeedLatestAggregatorRoundIDs.fromAmino(object.value); + }, + fromProtoMsg(message: FeedLatestAggregatorRoundIDsProtoMsg): FeedLatestAggregatorRoundIDs { + return FeedLatestAggregatorRoundIDs.decode(message.value); + }, + toProto(message: FeedLatestAggregatorRoundIDs): Uint8Array { + return FeedLatestAggregatorRoundIDs.encode(message).finish(); + }, + toProtoMsg(message: FeedLatestAggregatorRoundIDs): FeedLatestAggregatorRoundIDsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedLatestAggregatorRoundIDs", + value: FeedLatestAggregatorRoundIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedLatestAggregatorRoundIDs.typeUrl, FeedLatestAggregatorRoundIDs); +function createBaseRewardPool(): RewardPool { + return { + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const RewardPool = { + typeUrl: "/injective.ocr.v1beta1.RewardPool", + is(o: any): o is RewardPool { + return o && (o.$typeUrl === RewardPool.typeUrl || typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is RewardPoolAmino { + return o && (o.$typeUrl === RewardPool.typeUrl || typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: RewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RewardPool { + const message = createBaseRewardPool(); + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: RewardPoolAmino): RewardPool { + const message = createBaseRewardPool(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: RewardPool): RewardPoolAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: RewardPoolAminoMsg): RewardPool { + return RewardPool.fromAmino(object.value); + }, + fromProtoMsg(message: RewardPoolProtoMsg): RewardPool { + return RewardPool.decode(message.value); + }, + toProto(message: RewardPool): Uint8Array { + return RewardPool.encode(message).finish(); + }, + toProtoMsg(message: RewardPool): RewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.RewardPool", + value: RewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RewardPool.typeUrl, RewardPool); +function createBaseFeedCounts(): FeedCounts { + return { + feedId: "", + counts: [] + }; +} +export const FeedCounts = { + typeUrl: "/injective.ocr.v1beta1.FeedCounts", + is(o: any): o is FeedCounts { + return o && (o.$typeUrl === FeedCounts.typeUrl || typeof o.feedId === "string" && Array.isArray(o.counts) && (!o.counts.length || Count.is(o.counts[0]))); + }, + isAmino(o: any): o is FeedCountsAmino { + return o && (o.$typeUrl === FeedCounts.typeUrl || typeof o.feed_id === "string" && Array.isArray(o.counts) && (!o.counts.length || Count.isAmino(o.counts[0]))); + }, + encode(message: FeedCounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + for (const v of message.counts) { + Count.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedCounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedCounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.counts.push(Count.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedCounts { + const message = createBaseFeedCounts(); + message.feedId = object.feedId ?? ""; + message.counts = object.counts?.map(e => Count.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeedCountsAmino): FeedCounts { + const message = createBaseFeedCounts(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.counts = object.counts?.map(e => Count.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeedCounts): FeedCountsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.counts) { + obj.counts = message.counts.map(e => e ? Count.toAmino(e) : undefined); + } else { + obj.counts = message.counts; + } + return obj; + }, + fromAminoMsg(object: FeedCountsAminoMsg): FeedCounts { + return FeedCounts.fromAmino(object.value); + }, + fromProtoMsg(message: FeedCountsProtoMsg): FeedCounts { + return FeedCounts.decode(message.value); + }, + toProto(message: FeedCounts): Uint8Array { + return FeedCounts.encode(message).finish(); + }, + toProtoMsg(message: FeedCounts): FeedCountsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedCounts", + value: FeedCounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedCounts.typeUrl, FeedCounts); +function createBaseCount(): Count { + return { + address: "", + count: BigInt(0) + }; +} +export const Count = { + typeUrl: "/injective.ocr.v1beta1.Count", + is(o: any): o is Count { + return o && (o.$typeUrl === Count.typeUrl || typeof o.address === "string" && typeof o.count === "bigint"); + }, + isAmino(o: any): o is CountAmino { + return o && (o.$typeUrl === Count.typeUrl || typeof o.address === "string" && typeof o.count === "bigint"); + }, + encode(message: Count, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Count { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Count { + const message = createBaseCount(); + message.address = object.address ?? ""; + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CountAmino): Count { + const message = createBaseCount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + return message; + }, + toAmino(message: Count): CountAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.count = message.count !== BigInt(0) ? message.count?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CountAminoMsg): Count { + return Count.fromAmino(object.value); + }, + fromProtoMsg(message: CountProtoMsg): Count { + return Count.decode(message.value); + }, + toProto(message: Count): Uint8Array { + return Count.encode(message).finish(); + }, + toProtoMsg(message: Count): CountProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Count", + value: Count.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Count.typeUrl, Count); +function createBasePendingPayeeship(): PendingPayeeship { + return { + feedId: "", + transmitter: "", + proposedPayee: "" + }; +} +export const PendingPayeeship = { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship", + is(o: any): o is PendingPayeeship { + return o && (o.$typeUrl === PendingPayeeship.typeUrl || typeof o.feedId === "string" && typeof o.transmitter === "string" && typeof o.proposedPayee === "string"); + }, + isAmino(o: any): o is PendingPayeeshipAmino { + return o && (o.$typeUrl === PendingPayeeship.typeUrl || typeof o.feed_id === "string" && typeof o.transmitter === "string" && typeof o.proposed_payee === "string"); + }, + encode(message: PendingPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.proposedPayee !== "") { + writer.uint32(26).string(message.proposedPayee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PendingPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePendingPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.proposedPayee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PendingPayeeship { + const message = createBasePendingPayeeship(); + message.feedId = object.feedId ?? ""; + message.transmitter = object.transmitter ?? ""; + message.proposedPayee = object.proposedPayee ?? ""; + return message; + }, + fromAmino(object: PendingPayeeshipAmino): PendingPayeeship { + const message = createBasePendingPayeeship(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.proposed_payee !== undefined && object.proposed_payee !== null) { + message.proposedPayee = object.proposed_payee; + } + return message; + }, + toAmino(message: PendingPayeeship): PendingPayeeshipAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.proposed_payee = message.proposedPayee === "" ? undefined : message.proposedPayee; + return obj; + }, + fromAminoMsg(object: PendingPayeeshipAminoMsg): PendingPayeeship { + return PendingPayeeship.fromAmino(object.value); + }, + fromProtoMsg(message: PendingPayeeshipProtoMsg): PendingPayeeship { + return PendingPayeeship.decode(message.value); + }, + toProto(message: PendingPayeeship): Uint8Array { + return PendingPayeeship.encode(message).finish(); + }, + toProtoMsg(message: PendingPayeeship): PendingPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.PendingPayeeship", + value: PendingPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PendingPayeeship.typeUrl, PendingPayeeship); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/ocr.ts b/libs/injectivejs/src/injective/ocr/v1beta1/ocr.ts new file mode 100644 index 00000000..6a93f048 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/ocr.ts @@ -0,0 +1,3044 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** The block number interval at which payouts are made */ + payoutBlockInterval: bigint; + /** The admin for the OCR module */ + moduleAdmin: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** The block number interval at which payouts are made */ + payout_block_interval: string; + /** The admin for the OCR module */ + module_admin: string; +} +export interface ParamsAminoMsg { + type: "ocr/Params"; + value: ParamsAmino; +} +export interface FeedConfig { + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; + /** feed-specific params for the Cosmos module. */ + moduleParams?: ModuleParams; +} +export interface FeedConfigProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedConfig"; + value: Uint8Array; +} +export interface FeedConfigAmino { + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; + /** feed-specific params for the Cosmos module. */ + module_params?: ModuleParamsAmino; +} +export interface FeedConfigAminoMsg { + type: "/injective.ocr.v1beta1.FeedConfig"; + value: FeedConfigAmino; +} +export interface FeedConfigInfo { + latestConfigDigest: Uint8Array; + f: number; + n: number; + /** + * config_count ordinal number of this config setting among all config + * settings + */ + configCount: bigint; + latestConfigBlockNumber: bigint; +} +export interface FeedConfigInfoProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo"; + value: Uint8Array; +} +export interface FeedConfigInfoAmino { + latest_config_digest: string; + f: number; + n: number; + /** + * config_count ordinal number of this config setting among all config + * settings + */ + config_count: string; + latest_config_block_number: string; +} +export interface FeedConfigInfoAminoMsg { + type: "/injective.ocr.v1beta1.FeedConfigInfo"; + value: FeedConfigInfoAmino; +} +export interface ModuleParams { + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** lowest answer the median of a report is allowed to be */ + minAnswer: string; + /** highest answer the median of a report is allowed to be */ + maxAnswer: string; + /** Fixed LINK reward for each observer */ + linkPerObservation: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission: string; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** Enables unique reports */ + uniqueReports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; + /** feed administrator */ + feedAdmin: string; + /** feed billing administrator */ + billingAdmin: string; +} +export interface ModuleParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ModuleParams"; + value: Uint8Array; +} +export interface ModuleParamsAmino { + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** lowest answer the median of a report is allowed to be */ + min_answer: string; + /** highest answer the median of a report is allowed to be */ + max_answer: string; + /** Fixed LINK reward for each observer */ + link_per_observation: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission: string; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** Enables unique reports */ + unique_reports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; + /** feed administrator */ + feed_admin: string; + /** feed billing administrator */ + billing_admin: string; +} +export interface ModuleParamsAminoMsg { + type: "/injective.ocr.v1beta1.ModuleParams"; + value: ModuleParamsAmino; +} +export interface ContractConfig { + /** + * config_count ordinal number of this config setting among all config + * settings + */ + configCount: bigint; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; +} +export interface ContractConfigProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ContractConfig"; + value: Uint8Array; +} +export interface ContractConfigAmino { + /** + * config_count ordinal number of this config setting among all config + * settings + */ + config_count: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; +} +export interface ContractConfigAminoMsg { + type: "/injective.ocr.v1beta1.ContractConfig"; + value: ContractConfigAmino; +} +export interface SetConfigProposal { + title: string; + description: string; + config?: FeedConfig; +} +export interface SetConfigProposalProtoMsg { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal"; + value: Uint8Array; +} +export interface SetConfigProposalAmino { + title: string; + description: string; + config?: FeedConfigAmino; +} +export interface SetConfigProposalAminoMsg { + type: "ocr/SetConfigProposal"; + value: SetConfigProposalAmino; +} +export interface FeedProperties { + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchainConfig: Uint8Array; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchainConfigVersion: bigint; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchainConfig: Uint8Array; + /** lowest answer the median of a report is allowed to be */ + minAnswer: string; + /** highest answer the median of a report is allowed to be */ + maxAnswer: string; + /** Fixed LINK reward for each observer */ + linkPerObservation: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission: string; + /** Enables unique reports */ + uniqueReports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; +} +export interface FeedPropertiesProtoMsg { + typeUrl: "/injective.ocr.v1beta1.FeedProperties"; + value: Uint8Array; +} +export interface FeedPropertiesAmino { + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** + * f maximum number of faulty/dishonest oracles the protocol can tolerate + * while still working correctly + */ + f: number; + /** onchain_config serialized data with reporting plugin params on chain. */ + onchain_config: string; + /** + * offchain_config_version version of the serialization format used for + * "offchain_config" parameter + */ + offchain_config_version: string; + /** + * offchain_config serialized data used by oracles to configure their offchain + * operation + */ + offchain_config: string; + /** lowest answer the median of a report is allowed to be */ + min_answer: string; + /** highest answer the median of a report is allowed to be */ + max_answer: string; + /** Fixed LINK reward for each observer */ + link_per_observation: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission: string; + /** Enables unique reports */ + unique_reports: boolean; + /** + * short human-readable description of observable this feed's answers pertain + * to + */ + description: string; +} +export interface FeedPropertiesAminoMsg { + type: "/injective.ocr.v1beta1.FeedProperties"; + value: FeedPropertiesAmino; +} +export interface SetBatchConfigProposal { + title: string; + description: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** feed properties */ + feedProperties: FeedProperties[]; +} +export interface SetBatchConfigProposalProtoMsg { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal"; + value: Uint8Array; +} +export interface SetBatchConfigProposalAmino { + title: string; + description: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** feed properties */ + feed_properties: FeedPropertiesAmino[]; +} +export interface SetBatchConfigProposalAminoMsg { + type: "ocr/SetBatchConfigProposal"; + value: SetBatchConfigProposalAmino; +} +export interface OracleObservationsCounts { + counts: number[]; +} +export interface OracleObservationsCountsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts"; + value: Uint8Array; +} +export interface OracleObservationsCountsAmino { + counts: number[]; +} +export interface OracleObservationsCountsAminoMsg { + type: "/injective.ocr.v1beta1.OracleObservationsCounts"; + value: OracleObservationsCountsAmino; +} +/** LINK-INJ-denominated reimbursements for gas used by transmitters. */ +export interface GasReimbursements { + reimbursements: Coin[]; +} +export interface GasReimbursementsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements"; + value: Uint8Array; +} +/** LINK-INJ-denominated reimbursements for gas used by transmitters. */ +export interface GasReimbursementsAmino { + reimbursements: CoinAmino[]; +} +export interface GasReimbursementsAminoMsg { + type: "/injective.ocr.v1beta1.GasReimbursements"; + value: GasReimbursementsAmino; +} +export interface Payee { + transmitterAddr: string; + paymentAddr: string; +} +export interface PayeeProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Payee"; + value: Uint8Array; +} +export interface PayeeAmino { + transmitter_addr: string; + payment_addr: string; +} +export interface PayeeAminoMsg { + type: "/injective.ocr.v1beta1.Payee"; + value: PayeeAmino; +} +/** + * Transmission records the median answer from the transmit transaction at + * time timestamp + */ +export interface Transmission { + answer: string; + /** when were observations made offchain */ + observationsTimestamp: bigint; + /** when was report received onchain */ + transmissionTimestamp: bigint; +} +export interface TransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Transmission"; + value: Uint8Array; +} +/** + * Transmission records the median answer from the transmit transaction at + * time timestamp + */ +export interface TransmissionAmino { + answer: string; + /** when were observations made offchain */ + observations_timestamp: string; + /** when was report received onchain */ + transmission_timestamp: string; +} +export interface TransmissionAminoMsg { + type: "/injective.ocr.v1beta1.Transmission"; + value: TransmissionAmino; +} +export interface EpochAndRound { + epoch: bigint; + round: bigint; +} +export interface EpochAndRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound"; + value: Uint8Array; +} +export interface EpochAndRoundAmino { + epoch: string; + round: string; +} +export interface EpochAndRoundAminoMsg { + type: "/injective.ocr.v1beta1.EpochAndRound"; + value: EpochAndRoundAmino; +} +export interface Report { + observationsTimestamp: bigint; + /** ith element is the index of the ith observer */ + observers: Uint8Array; + observations: string[]; +} +export interface ReportProtoMsg { + typeUrl: "/injective.ocr.v1beta1.Report"; + value: Uint8Array; +} +export interface ReportAmino { + observations_timestamp: string; + /** ith element is the index of the ith observer */ + observers: string; + observations: string[]; +} +export interface ReportAminoMsg { + type: "/injective.ocr.v1beta1.Report"; + value: ReportAmino; +} +export interface ReportToSign { + configDigest: Uint8Array; + epoch: bigint; + round: bigint; + extraHash: Uint8Array; + /** Opaque report */ + report: Uint8Array; +} +export interface ReportToSignProtoMsg { + typeUrl: "/injective.ocr.v1beta1.ReportToSign"; + value: Uint8Array; +} +export interface ReportToSignAmino { + config_digest: string; + epoch: string; + round: string; + extra_hash: string; + /** Opaque report */ + report: string; +} +export interface ReportToSignAminoMsg { + type: "/injective.ocr.v1beta1.ReportToSign"; + value: ReportToSignAmino; +} +export interface EventOraclePaid { + transmitterAddr: string; + payeeAddr: string; + amount: Coin; +} +export interface EventOraclePaidProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid"; + value: Uint8Array; +} +export interface EventOraclePaidAmino { + transmitter_addr: string; + payee_addr: string; + amount: CoinAmino; +} +export interface EventOraclePaidAminoMsg { + type: "/injective.ocr.v1beta1.EventOraclePaid"; + value: EventOraclePaidAmino; +} +export interface EventAnswerUpdated { + current: string; + roundId: string; + updatedAt: Date; +} +export interface EventAnswerUpdatedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated"; + value: Uint8Array; +} +export interface EventAnswerUpdatedAmino { + current: string; + round_id: string; + updated_at: string; +} +export interface EventAnswerUpdatedAminoMsg { + type: "/injective.ocr.v1beta1.EventAnswerUpdated"; + value: EventAnswerUpdatedAmino; +} +export interface EventNewRound { + roundId: string; + /** address of starter */ + startedBy: string; + startedAt: Date; +} +export interface EventNewRoundProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventNewRound"; + value: Uint8Array; +} +export interface EventNewRoundAmino { + round_id: string; + /** address of starter */ + started_by: string; + started_at: string; +} +export interface EventNewRoundAminoMsg { + type: "/injective.ocr.v1beta1.EventNewRound"; + value: EventNewRoundAmino; +} +export interface EventTransmitted { + configDigest: Uint8Array; + epoch: bigint; +} +export interface EventTransmittedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted"; + value: Uint8Array; +} +export interface EventTransmittedAmino { + config_digest: string; + epoch: string; +} +export interface EventTransmittedAminoMsg { + type: "/injective.ocr.v1beta1.EventTransmitted"; + value: EventTransmittedAmino; +} +export interface EventNewTransmission { + feedId: string; + aggregatorRoundId: number; + answer: string; + transmitter: string; + observationsTimestamp: bigint; + observations: string[]; + observers: Uint8Array; + configDigest: Uint8Array; + epochAndRound?: EpochAndRound; +} +export interface EventNewTransmissionProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission"; + value: Uint8Array; +} +export interface EventNewTransmissionAmino { + feed_id: string; + aggregator_round_id: number; + answer: string; + transmitter: string; + observations_timestamp: string; + observations: string[]; + observers: string; + config_digest: string; + epoch_and_round?: EpochAndRoundAmino; +} +export interface EventNewTransmissionAminoMsg { + type: "/injective.ocr.v1beta1.EventNewTransmission"; + value: EventNewTransmissionAmino; +} +export interface EventConfigSet { + /** hash of the config */ + configDigest: Uint8Array; + /** + * previous_config_block_number block in which the previous config was set, to + * simplify historic analysis + */ + previousConfigBlockNumber: bigint; + config?: FeedConfig; + configInfo?: FeedConfigInfo; +} +export interface EventConfigSetProtoMsg { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet"; + value: Uint8Array; +} +export interface EventConfigSetAmino { + /** hash of the config */ + config_digest: string; + /** + * previous_config_block_number block in which the previous config was set, to + * simplify historic analysis + */ + previous_config_block_number: string; + config?: FeedConfigAmino; + config_info?: FeedConfigInfoAmino; +} +export interface EventConfigSetAminoMsg { + type: "/injective.ocr.v1beta1.EventConfigSet"; + value: EventConfigSetAmino; +} +function createBaseParams(): Params { + return { + linkDenom: "", + payoutBlockInterval: BigInt(0), + moduleAdmin: "" + }; +} +export const Params = { + typeUrl: "/injective.ocr.v1beta1.Params", + aminoType: "ocr/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.linkDenom === "string" && typeof o.payoutBlockInterval === "bigint" && typeof o.moduleAdmin === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.link_denom === "string" && typeof o.payout_block_interval === "bigint" && typeof o.module_admin === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.linkDenom !== "") { + writer.uint32(10).string(message.linkDenom); + } + if (message.payoutBlockInterval !== BigInt(0)) { + writer.uint32(16).uint64(message.payoutBlockInterval); + } + if (message.moduleAdmin !== "") { + writer.uint32(26).string(message.moduleAdmin); + } + 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.linkDenom = reader.string(); + break; + case 2: + message.payoutBlockInterval = reader.uint64(); + break; + case 3: + message.moduleAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.linkDenom = object.linkDenom ?? ""; + message.payoutBlockInterval = object.payoutBlockInterval !== undefined && object.payoutBlockInterval !== null ? BigInt(object.payoutBlockInterval.toString()) : BigInt(0); + message.moduleAdmin = object.moduleAdmin ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.payout_block_interval !== undefined && object.payout_block_interval !== null) { + message.payoutBlockInterval = BigInt(object.payout_block_interval); + } + if (object.module_admin !== undefined && object.module_admin !== null) { + message.moduleAdmin = object.module_admin; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.payout_block_interval = message.payoutBlockInterval !== BigInt(0) ? message.payoutBlockInterval?.toString() : undefined; + obj.module_admin = message.moduleAdmin === "" ? undefined : message.moduleAdmin; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "ocr/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: "/injective.ocr.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseFeedConfig(): FeedConfig { + return { + signers: [], + transmitters: [], + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array(), + moduleParams: undefined + }; +} +export const FeedConfig = { + typeUrl: "/injective.ocr.v1beta1.FeedConfig", + is(o: any): o is FeedConfig { + return o && (o.$typeUrl === FeedConfig.typeUrl || Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string")); + }, + isAmino(o: any): o is FeedConfigAmino { + return o && (o.$typeUrl === FeedConfig.typeUrl || Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string")); + }, + encode(message: FeedConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signers) { + writer.uint32(10).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(18).string(v!); + } + if (message.f !== 0) { + writer.uint32(24).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(34).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(40).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(50).bytes(message.offchainConfig); + } + if (message.moduleParams !== undefined) { + ModuleParams.encode(message.moduleParams, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signers.push(reader.string()); + break; + case 2: + message.transmitters.push(reader.string()); + break; + case 3: + message.f = reader.uint32(); + break; + case 4: + message.onchainConfig = reader.bytes(); + break; + case 5: + message.offchainConfigVersion = reader.uint64(); + break; + case 6: + message.offchainConfig = reader.bytes(); + break; + case 7: + message.moduleParams = ModuleParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedConfig { + const message = createBaseFeedConfig(); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + message.moduleParams = object.moduleParams !== undefined && object.moduleParams !== null ? ModuleParams.fromPartial(object.moduleParams) : undefined; + return message; + }, + fromAmino(object: FeedConfigAmino): FeedConfig { + const message = createBaseFeedConfig(); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + if (object.module_params !== undefined && object.module_params !== null) { + message.moduleParams = ModuleParams.fromAmino(object.module_params); + } + return message; + }, + toAmino(message: FeedConfig): FeedConfigAmino { + const obj: any = {}; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + obj.module_params = message.moduleParams ? ModuleParams.toAmino(message.moduleParams) : undefined; + return obj; + }, + fromAminoMsg(object: FeedConfigAminoMsg): FeedConfig { + return FeedConfig.fromAmino(object.value); + }, + fromProtoMsg(message: FeedConfigProtoMsg): FeedConfig { + return FeedConfig.decode(message.value); + }, + toProto(message: FeedConfig): Uint8Array { + return FeedConfig.encode(message).finish(); + }, + toProtoMsg(message: FeedConfig): FeedConfigProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedConfig", + value: FeedConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedConfig.typeUrl, FeedConfig); +function createBaseFeedConfigInfo(): FeedConfigInfo { + return { + latestConfigDigest: new Uint8Array(), + f: 0, + n: 0, + configCount: BigInt(0), + latestConfigBlockNumber: BigInt(0) + }; +} +export const FeedConfigInfo = { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo", + is(o: any): o is FeedConfigInfo { + return o && (o.$typeUrl === FeedConfigInfo.typeUrl || (o.latestConfigDigest instanceof Uint8Array || typeof o.latestConfigDigest === "string") && typeof o.f === "number" && typeof o.n === "number" && typeof o.configCount === "bigint" && typeof o.latestConfigBlockNumber === "bigint"); + }, + isAmino(o: any): o is FeedConfigInfoAmino { + return o && (o.$typeUrl === FeedConfigInfo.typeUrl || (o.latest_config_digest instanceof Uint8Array || typeof o.latest_config_digest === "string") && typeof o.f === "number" && typeof o.n === "number" && typeof o.config_count === "bigint" && typeof o.latest_config_block_number === "bigint"); + }, + encode(message: FeedConfigInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.latestConfigDigest.length !== 0) { + writer.uint32(10).bytes(message.latestConfigDigest); + } + if (message.f !== 0) { + writer.uint32(16).uint32(message.f); + } + if (message.n !== 0) { + writer.uint32(24).uint32(message.n); + } + if (message.configCount !== BigInt(0)) { + writer.uint32(32).uint64(message.configCount); + } + if (message.latestConfigBlockNumber !== BigInt(0)) { + writer.uint32(40).int64(message.latestConfigBlockNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedConfigInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedConfigInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestConfigDigest = reader.bytes(); + break; + case 2: + message.f = reader.uint32(); + break; + case 3: + message.n = reader.uint32(); + break; + case 4: + message.configCount = reader.uint64(); + break; + case 5: + message.latestConfigBlockNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedConfigInfo { + const message = createBaseFeedConfigInfo(); + message.latestConfigDigest = object.latestConfigDigest ?? new Uint8Array(); + message.f = object.f ?? 0; + message.n = object.n ?? 0; + message.configCount = object.configCount !== undefined && object.configCount !== null ? BigInt(object.configCount.toString()) : BigInt(0); + message.latestConfigBlockNumber = object.latestConfigBlockNumber !== undefined && object.latestConfigBlockNumber !== null ? BigInt(object.latestConfigBlockNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FeedConfigInfoAmino): FeedConfigInfo { + const message = createBaseFeedConfigInfo(); + if (object.latest_config_digest !== undefined && object.latest_config_digest !== null) { + message.latestConfigDigest = bytesFromBase64(object.latest_config_digest); + } + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.n !== undefined && object.n !== null) { + message.n = object.n; + } + if (object.config_count !== undefined && object.config_count !== null) { + message.configCount = BigInt(object.config_count); + } + if (object.latest_config_block_number !== undefined && object.latest_config_block_number !== null) { + message.latestConfigBlockNumber = BigInt(object.latest_config_block_number); + } + return message; + }, + toAmino(message: FeedConfigInfo): FeedConfigInfoAmino { + const obj: any = {}; + obj.latest_config_digest = message.latestConfigDigest ? base64FromBytes(message.latestConfigDigest) : undefined; + obj.f = message.f === 0 ? undefined : message.f; + obj.n = message.n === 0 ? undefined : message.n; + obj.config_count = message.configCount !== BigInt(0) ? message.configCount?.toString() : undefined; + obj.latest_config_block_number = message.latestConfigBlockNumber !== BigInt(0) ? message.latestConfigBlockNumber?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FeedConfigInfoAminoMsg): FeedConfigInfo { + return FeedConfigInfo.fromAmino(object.value); + }, + fromProtoMsg(message: FeedConfigInfoProtoMsg): FeedConfigInfo { + return FeedConfigInfo.decode(message.value); + }, + toProto(message: FeedConfigInfo): Uint8Array { + return FeedConfigInfo.encode(message).finish(); + }, + toProtoMsg(message: FeedConfigInfo): FeedConfigInfoProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedConfigInfo", + value: FeedConfigInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedConfigInfo.typeUrl, FeedConfigInfo); +function createBaseModuleParams(): ModuleParams { + return { + feedId: "", + minAnswer: "", + maxAnswer: "", + linkPerObservation: "", + linkPerTransmission: "", + linkDenom: "", + uniqueReports: false, + description: "", + feedAdmin: "", + billingAdmin: "" + }; +} +export const ModuleParams = { + typeUrl: "/injective.ocr.v1beta1.ModuleParams", + is(o: any): o is ModuleParams { + return o && (o.$typeUrl === ModuleParams.typeUrl || typeof o.feedId === "string" && typeof o.minAnswer === "string" && typeof o.maxAnswer === "string" && typeof o.linkPerObservation === "string" && typeof o.linkPerTransmission === "string" && typeof o.linkDenom === "string" && typeof o.uniqueReports === "boolean" && typeof o.description === "string" && typeof o.feedAdmin === "string" && typeof o.billingAdmin === "string"); + }, + isAmino(o: any): o is ModuleParamsAmino { + return o && (o.$typeUrl === ModuleParams.typeUrl || typeof o.feed_id === "string" && typeof o.min_answer === "string" && typeof o.max_answer === "string" && typeof o.link_per_observation === "string" && typeof o.link_per_transmission === "string" && typeof o.link_denom === "string" && typeof o.unique_reports === "boolean" && typeof o.description === "string" && typeof o.feed_admin === "string" && typeof o.billing_admin === "string"); + }, + encode(message: ModuleParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.minAnswer !== "") { + writer.uint32(18).string(message.minAnswer); + } + if (message.maxAnswer !== "") { + writer.uint32(26).string(message.maxAnswer); + } + if (message.linkPerObservation !== "") { + writer.uint32(34).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== "") { + writer.uint32(42).string(message.linkPerTransmission); + } + if (message.linkDenom !== "") { + writer.uint32(50).string(message.linkDenom); + } + if (message.uniqueReports === true) { + writer.uint32(56).bool(message.uniqueReports); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.feedAdmin !== "") { + writer.uint32(74).string(message.feedAdmin); + } + if (message.billingAdmin !== "") { + writer.uint32(82).string(message.billingAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.minAnswer = reader.string(); + break; + case 3: + message.maxAnswer = reader.string(); + break; + case 4: + message.linkPerObservation = reader.string(); + break; + case 5: + message.linkPerTransmission = reader.string(); + break; + case 6: + message.linkDenom = reader.string(); + break; + case 7: + message.uniqueReports = reader.bool(); + break; + case 8: + message.description = reader.string(); + break; + case 9: + message.feedAdmin = reader.string(); + break; + case 10: + message.billingAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ModuleParams { + const message = createBaseModuleParams(); + message.feedId = object.feedId ?? ""; + message.minAnswer = object.minAnswer ?? ""; + message.maxAnswer = object.maxAnswer ?? ""; + message.linkPerObservation = object.linkPerObservation ?? ""; + message.linkPerTransmission = object.linkPerTransmission ?? ""; + message.linkDenom = object.linkDenom ?? ""; + message.uniqueReports = object.uniqueReports ?? false; + message.description = object.description ?? ""; + message.feedAdmin = object.feedAdmin ?? ""; + message.billingAdmin = object.billingAdmin ?? ""; + return message; + }, + fromAmino(object: ModuleParamsAmino): ModuleParams { + const message = createBaseModuleParams(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.min_answer !== undefined && object.min_answer !== null) { + message.minAnswer = object.min_answer; + } + if (object.max_answer !== undefined && object.max_answer !== null) { + message.maxAnswer = object.max_answer; + } + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.unique_reports !== undefined && object.unique_reports !== null) { + message.uniqueReports = object.unique_reports; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.feed_admin !== undefined && object.feed_admin !== null) { + message.feedAdmin = object.feed_admin; + } + if (object.billing_admin !== undefined && object.billing_admin !== null) { + message.billingAdmin = object.billing_admin; + } + return message; + }, + toAmino(message: ModuleParams): ModuleParamsAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.min_answer = message.minAnswer === "" ? undefined : message.minAnswer; + obj.max_answer = message.maxAnswer === "" ? undefined : message.maxAnswer; + obj.link_per_observation = message.linkPerObservation === "" ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === "" ? undefined : message.linkPerTransmission; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.unique_reports = message.uniqueReports === false ? undefined : message.uniqueReports; + obj.description = message.description === "" ? undefined : message.description; + obj.feed_admin = message.feedAdmin === "" ? undefined : message.feedAdmin; + obj.billing_admin = message.billingAdmin === "" ? undefined : message.billingAdmin; + return obj; + }, + fromAminoMsg(object: ModuleParamsAminoMsg): ModuleParams { + return ModuleParams.fromAmino(object.value); + }, + fromProtoMsg(message: ModuleParamsProtoMsg): ModuleParams { + return ModuleParams.decode(message.value); + }, + toProto(message: ModuleParams): Uint8Array { + return ModuleParams.encode(message).finish(); + }, + toProtoMsg(message: ModuleParams): ModuleParamsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ModuleParams", + value: ModuleParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleParams.typeUrl, ModuleParams); +function createBaseContractConfig(): ContractConfig { + return { + configCount: BigInt(0), + signers: [], + transmitters: [], + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array() + }; +} +export const ContractConfig = { + typeUrl: "/injective.ocr.v1beta1.ContractConfig", + is(o: any): o is ContractConfig { + return o && (o.$typeUrl === ContractConfig.typeUrl || typeof o.configCount === "bigint" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string")); + }, + isAmino(o: any): o is ContractConfigAmino { + return o && (o.$typeUrl === ContractConfig.typeUrl || typeof o.config_count === "bigint" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string")); + }, + encode(message: ContractConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configCount !== BigInt(0)) { + writer.uint32(8).uint64(message.configCount); + } + for (const v of message.signers) { + writer.uint32(18).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(26).string(v!); + } + if (message.f !== 0) { + writer.uint32(32).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(42).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(48).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(58).bytes(message.offchainConfig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configCount = reader.uint64(); + break; + case 2: + message.signers.push(reader.string()); + break; + case 3: + message.transmitters.push(reader.string()); + break; + case 4: + message.f = reader.uint32(); + break; + case 5: + message.onchainConfig = reader.bytes(); + break; + case 6: + message.offchainConfigVersion = reader.uint64(); + break; + case 7: + message.offchainConfig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractConfig { + const message = createBaseContractConfig(); + message.configCount = object.configCount !== undefined && object.configCount !== null ? BigInt(object.configCount.toString()) : BigInt(0); + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractConfigAmino): ContractConfig { + const message = createBaseContractConfig(); + if (object.config_count !== undefined && object.config_count !== null) { + message.configCount = BigInt(object.config_count); + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + return message; + }, + toAmino(message: ContractConfig): ContractConfigAmino { + const obj: any = {}; + obj.config_count = message.configCount !== BigInt(0) ? message.configCount?.toString() : undefined; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + return obj; + }, + fromAminoMsg(object: ContractConfigAminoMsg): ContractConfig { + return ContractConfig.fromAmino(object.value); + }, + fromProtoMsg(message: ContractConfigProtoMsg): ContractConfig { + return ContractConfig.decode(message.value); + }, + toProto(message: ContractConfig): Uint8Array { + return ContractConfig.encode(message).finish(); + }, + toProtoMsg(message: ContractConfig): ContractConfigProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ContractConfig", + value: ContractConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractConfig.typeUrl, ContractConfig); +function createBaseSetConfigProposal(): SetConfigProposal { + return { + title: "", + description: "", + config: undefined + }; +} +export const SetConfigProposal = { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal", + aminoType: "ocr/SetConfigProposal", + is(o: any): o is SetConfigProposal { + return o && (o.$typeUrl === SetConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is SetConfigProposalAmino { + return o && (o.$typeUrl === SetConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + encode(message: SetConfigProposal, 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.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetConfigProposal(); + 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.config = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetConfigProposal { + const message = createBaseSetConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: SetConfigProposalAmino): SetConfigProposal { + const message = createBaseSetConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + return message; + }, + toAmino(message: SetConfigProposal): SetConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: SetConfigProposalAminoMsg): SetConfigProposal { + return SetConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetConfigProposal): SetConfigProposalAminoMsg { + return { + type: "ocr/SetConfigProposal", + value: SetConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetConfigProposalProtoMsg): SetConfigProposal { + return SetConfigProposal.decode(message.value); + }, + toProto(message: SetConfigProposal): Uint8Array { + return SetConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: SetConfigProposal): SetConfigProposalProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.SetConfigProposal", + value: SetConfigProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetConfigProposal.typeUrl, SetConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetConfigProposal.aminoType, SetConfigProposal.typeUrl); +function createBaseFeedProperties(): FeedProperties { + return { + feedId: "", + f: 0, + onchainConfig: new Uint8Array(), + offchainConfigVersion: BigInt(0), + offchainConfig: new Uint8Array(), + minAnswer: "", + maxAnswer: "", + linkPerObservation: "", + linkPerTransmission: "", + uniqueReports: false, + description: "" + }; +} +export const FeedProperties = { + typeUrl: "/injective.ocr.v1beta1.FeedProperties", + is(o: any): o is FeedProperties { + return o && (o.$typeUrl === FeedProperties.typeUrl || typeof o.feedId === "string" && typeof o.f === "number" && (o.onchainConfig instanceof Uint8Array || typeof o.onchainConfig === "string") && typeof o.offchainConfigVersion === "bigint" && (o.offchainConfig instanceof Uint8Array || typeof o.offchainConfig === "string") && typeof o.minAnswer === "string" && typeof o.maxAnswer === "string" && typeof o.linkPerObservation === "string" && typeof o.linkPerTransmission === "string" && typeof o.uniqueReports === "boolean" && typeof o.description === "string"); + }, + isAmino(o: any): o is FeedPropertiesAmino { + return o && (o.$typeUrl === FeedProperties.typeUrl || typeof o.feed_id === "string" && typeof o.f === "number" && (o.onchain_config instanceof Uint8Array || typeof o.onchain_config === "string") && typeof o.offchain_config_version === "bigint" && (o.offchain_config instanceof Uint8Array || typeof o.offchain_config === "string") && typeof o.min_answer === "string" && typeof o.max_answer === "string" && typeof o.link_per_observation === "string" && typeof o.link_per_transmission === "string" && typeof o.unique_reports === "boolean" && typeof o.description === "string"); + }, + encode(message: FeedProperties, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.f !== 0) { + writer.uint32(16).uint32(message.f); + } + if (message.onchainConfig.length !== 0) { + writer.uint32(26).bytes(message.onchainConfig); + } + if (message.offchainConfigVersion !== BigInt(0)) { + writer.uint32(32).uint64(message.offchainConfigVersion); + } + if (message.offchainConfig.length !== 0) { + writer.uint32(42).bytes(message.offchainConfig); + } + if (message.minAnswer !== "") { + writer.uint32(50).string(message.minAnswer); + } + if (message.maxAnswer !== "") { + writer.uint32(58).string(message.maxAnswer); + } + if (message.linkPerObservation !== "") { + writer.uint32(66).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== "") { + writer.uint32(74).string(message.linkPerTransmission); + } + if (message.uniqueReports === true) { + writer.uint32(80).bool(message.uniqueReports); + } + if (message.description !== "") { + writer.uint32(90).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeedProperties { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeedProperties(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.f = reader.uint32(); + break; + case 3: + message.onchainConfig = reader.bytes(); + break; + case 4: + message.offchainConfigVersion = reader.uint64(); + break; + case 5: + message.offchainConfig = reader.bytes(); + break; + case 6: + message.minAnswer = reader.string(); + break; + case 7: + message.maxAnswer = reader.string(); + break; + case 8: + message.linkPerObservation = reader.string(); + break; + case 9: + message.linkPerTransmission = reader.string(); + break; + case 10: + message.uniqueReports = reader.bool(); + break; + case 11: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): FeedProperties { + const message = createBaseFeedProperties(); + message.feedId = object.feedId ?? ""; + message.f = object.f ?? 0; + message.onchainConfig = object.onchainConfig ?? new Uint8Array(); + message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? BigInt(object.offchainConfigVersion.toString()) : BigInt(0); + message.offchainConfig = object.offchainConfig ?? new Uint8Array(); + message.minAnswer = object.minAnswer ?? ""; + message.maxAnswer = object.maxAnswer ?? ""; + message.linkPerObservation = object.linkPerObservation ?? ""; + message.linkPerTransmission = object.linkPerTransmission ?? ""; + message.uniqueReports = object.uniqueReports ?? false; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: FeedPropertiesAmino): FeedProperties { + const message = createBaseFeedProperties(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.f !== undefined && object.f !== null) { + message.f = object.f; + } + if (object.onchain_config !== undefined && object.onchain_config !== null) { + message.onchainConfig = bytesFromBase64(object.onchain_config); + } + if (object.offchain_config_version !== undefined && object.offchain_config_version !== null) { + message.offchainConfigVersion = BigInt(object.offchain_config_version); + } + if (object.offchain_config !== undefined && object.offchain_config !== null) { + message.offchainConfig = bytesFromBase64(object.offchain_config); + } + if (object.min_answer !== undefined && object.min_answer !== null) { + message.minAnswer = object.min_answer; + } + if (object.max_answer !== undefined && object.max_answer !== null) { + message.maxAnswer = object.max_answer; + } + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.unique_reports !== undefined && object.unique_reports !== null) { + message.uniqueReports = object.unique_reports; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: FeedProperties): FeedPropertiesAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.f = message.f === 0 ? undefined : message.f; + obj.onchain_config = message.onchainConfig ? base64FromBytes(message.onchainConfig) : undefined; + obj.offchain_config_version = message.offchainConfigVersion !== BigInt(0) ? message.offchainConfigVersion?.toString() : undefined; + obj.offchain_config = message.offchainConfig ? base64FromBytes(message.offchainConfig) : undefined; + obj.min_answer = message.minAnswer === "" ? undefined : message.minAnswer; + obj.max_answer = message.maxAnswer === "" ? undefined : message.maxAnswer; + obj.link_per_observation = message.linkPerObservation === "" ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === "" ? undefined : message.linkPerTransmission; + obj.unique_reports = message.uniqueReports === false ? undefined : message.uniqueReports; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: FeedPropertiesAminoMsg): FeedProperties { + return FeedProperties.fromAmino(object.value); + }, + fromProtoMsg(message: FeedPropertiesProtoMsg): FeedProperties { + return FeedProperties.decode(message.value); + }, + toProto(message: FeedProperties): Uint8Array { + return FeedProperties.encode(message).finish(); + }, + toProtoMsg(message: FeedProperties): FeedPropertiesProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.FeedProperties", + value: FeedProperties.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FeedProperties.typeUrl, FeedProperties); +function createBaseSetBatchConfigProposal(): SetBatchConfigProposal { + return { + title: "", + description: "", + signers: [], + transmitters: [], + linkDenom: "", + feedProperties: [] + }; +} +export const SetBatchConfigProposal = { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal", + aminoType: "ocr/SetBatchConfigProposal", + is(o: any): o is SetBatchConfigProposal { + return o && (o.$typeUrl === SetBatchConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.linkDenom === "string" && Array.isArray(o.feedProperties) && (!o.feedProperties.length || FeedProperties.is(o.feedProperties[0]))); + }, + isAmino(o: any): o is SetBatchConfigProposalAmino { + return o && (o.$typeUrl === SetBatchConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.link_denom === "string" && Array.isArray(o.feed_properties) && (!o.feed_properties.length || FeedProperties.isAmino(o.feed_properties[0]))); + }, + encode(message: SetBatchConfigProposal, 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.signers) { + writer.uint32(26).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(34).string(v!); + } + if (message.linkDenom !== "") { + writer.uint32(42).string(message.linkDenom); + } + for (const v of message.feedProperties) { + FeedProperties.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBatchConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBatchConfigProposal(); + 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.signers.push(reader.string()); + break; + case 4: + message.transmitters.push(reader.string()); + break; + case 5: + message.linkDenom = reader.string(); + break; + case 6: + message.feedProperties.push(FeedProperties.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBatchConfigProposal { + const message = createBaseSetBatchConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.linkDenom = object.linkDenom ?? ""; + message.feedProperties = object.feedProperties?.map(e => FeedProperties.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SetBatchConfigProposalAmino): SetBatchConfigProposal { + const message = createBaseSetBatchConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + message.feedProperties = object.feed_properties?.map(e => FeedProperties.fromAmino(e)) || []; + return message; + }, + toAmino(message: SetBatchConfigProposal): SetBatchConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + if (message.feedProperties) { + obj.feed_properties = message.feedProperties.map(e => e ? FeedProperties.toAmino(e) : undefined); + } else { + obj.feed_properties = message.feedProperties; + } + return obj; + }, + fromAminoMsg(object: SetBatchConfigProposalAminoMsg): SetBatchConfigProposal { + return SetBatchConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetBatchConfigProposal): SetBatchConfigProposalAminoMsg { + return { + type: "ocr/SetBatchConfigProposal", + value: SetBatchConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetBatchConfigProposalProtoMsg): SetBatchConfigProposal { + return SetBatchConfigProposal.decode(message.value); + }, + toProto(message: SetBatchConfigProposal): Uint8Array { + return SetBatchConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: SetBatchConfigProposal): SetBatchConfigProposalProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.SetBatchConfigProposal", + value: SetBatchConfigProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBatchConfigProposal.typeUrl, SetBatchConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetBatchConfigProposal.aminoType, SetBatchConfigProposal.typeUrl); +function createBaseOracleObservationsCounts(): OracleObservationsCounts { + return { + counts: [] + }; +} +export const OracleObservationsCounts = { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts", + is(o: any): o is OracleObservationsCounts { + return o && (o.$typeUrl === OracleObservationsCounts.typeUrl || Array.isArray(o.counts) && (!o.counts.length || typeof o.counts[0] === "number")); + }, + isAmino(o: any): o is OracleObservationsCountsAmino { + return o && (o.$typeUrl === OracleObservationsCounts.typeUrl || Array.isArray(o.counts) && (!o.counts.length || typeof o.counts[0] === "number")); + }, + encode(message: OracleObservationsCounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.counts) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleObservationsCounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleObservationsCounts(); + 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.counts.push(reader.uint32()); + } + } else { + message.counts.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleObservationsCounts { + const message = createBaseOracleObservationsCounts(); + message.counts = object.counts?.map(e => e) || []; + return message; + }, + fromAmino(object: OracleObservationsCountsAmino): OracleObservationsCounts { + const message = createBaseOracleObservationsCounts(); + message.counts = object.counts?.map(e => e) || []; + return message; + }, + toAmino(message: OracleObservationsCounts): OracleObservationsCountsAmino { + const obj: any = {}; + if (message.counts) { + obj.counts = message.counts.map(e => e); + } else { + obj.counts = message.counts; + } + return obj; + }, + fromAminoMsg(object: OracleObservationsCountsAminoMsg): OracleObservationsCounts { + return OracleObservationsCounts.fromAmino(object.value); + }, + fromProtoMsg(message: OracleObservationsCountsProtoMsg): OracleObservationsCounts { + return OracleObservationsCounts.decode(message.value); + }, + toProto(message: OracleObservationsCounts): Uint8Array { + return OracleObservationsCounts.encode(message).finish(); + }, + toProtoMsg(message: OracleObservationsCounts): OracleObservationsCountsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.OracleObservationsCounts", + value: OracleObservationsCounts.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleObservationsCounts.typeUrl, OracleObservationsCounts); +function createBaseGasReimbursements(): GasReimbursements { + return { + reimbursements: [] + }; +} +export const GasReimbursements = { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements", + is(o: any): o is GasReimbursements { + return o && (o.$typeUrl === GasReimbursements.typeUrl || Array.isArray(o.reimbursements) && (!o.reimbursements.length || Coin.is(o.reimbursements[0]))); + }, + isAmino(o: any): o is GasReimbursementsAmino { + return o && (o.$typeUrl === GasReimbursements.typeUrl || Array.isArray(o.reimbursements) && (!o.reimbursements.length || Coin.isAmino(o.reimbursements[0]))); + }, + encode(message: GasReimbursements, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.reimbursements) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GasReimbursements { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasReimbursements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reimbursements.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GasReimbursements { + const message = createBaseGasReimbursements(); + message.reimbursements = object.reimbursements?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GasReimbursementsAmino): GasReimbursements { + const message = createBaseGasReimbursements(); + message.reimbursements = object.reimbursements?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: GasReimbursements): GasReimbursementsAmino { + const obj: any = {}; + if (message.reimbursements) { + obj.reimbursements = message.reimbursements.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.reimbursements = message.reimbursements; + } + return obj; + }, + fromAminoMsg(object: GasReimbursementsAminoMsg): GasReimbursements { + return GasReimbursements.fromAmino(object.value); + }, + fromProtoMsg(message: GasReimbursementsProtoMsg): GasReimbursements { + return GasReimbursements.decode(message.value); + }, + toProto(message: GasReimbursements): Uint8Array { + return GasReimbursements.encode(message).finish(); + }, + toProtoMsg(message: GasReimbursements): GasReimbursementsProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.GasReimbursements", + value: GasReimbursements.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GasReimbursements.typeUrl, GasReimbursements); +function createBasePayee(): Payee { + return { + transmitterAddr: "", + paymentAddr: "" + }; +} +export const Payee = { + typeUrl: "/injective.ocr.v1beta1.Payee", + is(o: any): o is Payee { + return o && (o.$typeUrl === Payee.typeUrl || typeof o.transmitterAddr === "string" && typeof o.paymentAddr === "string"); + }, + isAmino(o: any): o is PayeeAmino { + return o && (o.$typeUrl === Payee.typeUrl || typeof o.transmitter_addr === "string" && typeof o.payment_addr === "string"); + }, + encode(message: Payee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitterAddr !== "") { + writer.uint32(10).string(message.transmitterAddr); + } + if (message.paymentAddr !== "") { + writer.uint32(18).string(message.paymentAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Payee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePayee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitterAddr = reader.string(); + break; + case 2: + message.paymentAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Payee { + const message = createBasePayee(); + message.transmitterAddr = object.transmitterAddr ?? ""; + message.paymentAddr = object.paymentAddr ?? ""; + return message; + }, + fromAmino(object: PayeeAmino): Payee { + const message = createBasePayee(); + if (object.transmitter_addr !== undefined && object.transmitter_addr !== null) { + message.transmitterAddr = object.transmitter_addr; + } + if (object.payment_addr !== undefined && object.payment_addr !== null) { + message.paymentAddr = object.payment_addr; + } + return message; + }, + toAmino(message: Payee): PayeeAmino { + const obj: any = {}; + obj.transmitter_addr = message.transmitterAddr === "" ? undefined : message.transmitterAddr; + obj.payment_addr = message.paymentAddr === "" ? undefined : message.paymentAddr; + return obj; + }, + fromAminoMsg(object: PayeeAminoMsg): Payee { + return Payee.fromAmino(object.value); + }, + fromProtoMsg(message: PayeeProtoMsg): Payee { + return Payee.decode(message.value); + }, + toProto(message: Payee): Uint8Array { + return Payee.encode(message).finish(); + }, + toProtoMsg(message: Payee): PayeeProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Payee", + value: Payee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Payee.typeUrl, Payee); +function createBaseTransmission(): Transmission { + return { + answer: "", + observationsTimestamp: BigInt(0), + transmissionTimestamp: BigInt(0) + }; +} +export const Transmission = { + typeUrl: "/injective.ocr.v1beta1.Transmission", + is(o: any): o is Transmission { + return o && (o.$typeUrl === Transmission.typeUrl || typeof o.answer === "string" && typeof o.observationsTimestamp === "bigint" && typeof o.transmissionTimestamp === "bigint"); + }, + isAmino(o: any): o is TransmissionAmino { + return o && (o.$typeUrl === Transmission.typeUrl || typeof o.answer === "string" && typeof o.observations_timestamp === "bigint" && typeof o.transmission_timestamp === "bigint"); + }, + encode(message: Transmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.answer !== "") { + writer.uint32(10).string(message.answer); + } + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(16).int64(message.observationsTimestamp); + } + if (message.transmissionTimestamp !== BigInt(0)) { + writer.uint32(24).int64(message.transmissionTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Transmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answer = reader.string(); + break; + case 2: + message.observationsTimestamp = reader.int64(); + break; + case 3: + message.transmissionTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Transmission { + const message = createBaseTransmission(); + message.answer = object.answer ?? ""; + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.transmissionTimestamp = object.transmissionTimestamp !== undefined && object.transmissionTimestamp !== null ? BigInt(object.transmissionTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TransmissionAmino): Transmission { + const message = createBaseTransmission(); + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + if (object.transmission_timestamp !== undefined && object.transmission_timestamp !== null) { + message.transmissionTimestamp = BigInt(object.transmission_timestamp); + } + return message; + }, + toAmino(message: Transmission): TransmissionAmino { + const obj: any = {}; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + obj.transmission_timestamp = message.transmissionTimestamp !== BigInt(0) ? message.transmissionTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TransmissionAminoMsg): Transmission { + return Transmission.fromAmino(object.value); + }, + fromProtoMsg(message: TransmissionProtoMsg): Transmission { + return Transmission.decode(message.value); + }, + toProto(message: Transmission): Uint8Array { + return Transmission.encode(message).finish(); + }, + toProtoMsg(message: Transmission): TransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Transmission", + value: Transmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Transmission.typeUrl, Transmission); +function createBaseEpochAndRound(): EpochAndRound { + return { + epoch: BigInt(0), + round: BigInt(0) + }; +} +export const EpochAndRound = { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound", + is(o: any): o is EpochAndRound { + return o && (o.$typeUrl === EpochAndRound.typeUrl || typeof o.epoch === "bigint" && typeof o.round === "bigint"); + }, + isAmino(o: any): o is EpochAndRoundAmino { + return o && (o.$typeUrl === EpochAndRound.typeUrl || typeof o.epoch === "bigint" && typeof o.round === "bigint"); + }, + encode(message: EpochAndRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epoch !== BigInt(0)) { + writer.uint32(8).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(16).uint64(message.round); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EpochAndRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEpochAndRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint64(); + break; + case 2: + message.round = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EpochAndRound { + const message = createBaseEpochAndRound(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EpochAndRoundAmino): EpochAndRound { + const message = createBaseEpochAndRound(); + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + return message; + }, + toAmino(message: EpochAndRound): EpochAndRoundAmino { + const obj: any = {}; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EpochAndRoundAminoMsg): EpochAndRound { + return EpochAndRound.fromAmino(object.value); + }, + fromProtoMsg(message: EpochAndRoundProtoMsg): EpochAndRound { + return EpochAndRound.decode(message.value); + }, + toProto(message: EpochAndRound): Uint8Array { + return EpochAndRound.encode(message).finish(); + }, + toProtoMsg(message: EpochAndRound): EpochAndRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EpochAndRound", + value: EpochAndRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EpochAndRound.typeUrl, EpochAndRound); +function createBaseReport(): Report { + return { + observationsTimestamp: BigInt(0), + observers: new Uint8Array(), + observations: [] + }; +} +export const Report = { + typeUrl: "/injective.ocr.v1beta1.Report", + is(o: any): o is Report { + return o && (o.$typeUrl === Report.typeUrl || typeof o.observationsTimestamp === "bigint" && (o.observers instanceof Uint8Array || typeof o.observers === "string") && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string")); + }, + isAmino(o: any): o is ReportAmino { + return o && (o.$typeUrl === Report.typeUrl || typeof o.observations_timestamp === "bigint" && (o.observers instanceof Uint8Array || typeof o.observers === "string") && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string")); + }, + encode(message: Report, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(8).int64(message.observationsTimestamp); + } + if (message.observers.length !== 0) { + writer.uint32(18).bytes(message.observers); + } + for (const v of message.observations) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Report { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.observationsTimestamp = reader.int64(); + break; + case 2: + message.observers = reader.bytes(); + break; + case 3: + message.observations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Report { + const message = createBaseReport(); + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.observers = object.observers ?? new Uint8Array(); + message.observations = object.observations?.map(e => e) || []; + return message; + }, + fromAmino(object: ReportAmino): Report { + const message = createBaseReport(); + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + if (object.observers !== undefined && object.observers !== null) { + message.observers = bytesFromBase64(object.observers); + } + message.observations = object.observations?.map(e => e) || []; + return message; + }, + toAmino(message: Report): ReportAmino { + const obj: any = {}; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + obj.observers = message.observers ? base64FromBytes(message.observers) : undefined; + if (message.observations) { + obj.observations = message.observations.map(e => e); + } else { + obj.observations = message.observations; + } + return obj; + }, + fromAminoMsg(object: ReportAminoMsg): Report { + return Report.fromAmino(object.value); + }, + fromProtoMsg(message: ReportProtoMsg): Report { + return Report.decode(message.value); + }, + toProto(message: Report): Uint8Array { + return Report.encode(message).finish(); + }, + toProtoMsg(message: Report): ReportProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.Report", + value: Report.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Report.typeUrl, Report); +function createBaseReportToSign(): ReportToSign { + return { + configDigest: new Uint8Array(), + epoch: BigInt(0), + round: BigInt(0), + extraHash: new Uint8Array(), + report: new Uint8Array() + }; +} +export const ReportToSign = { + typeUrl: "/injective.ocr.v1beta1.ReportToSign", + is(o: any): o is ReportToSign { + return o && (o.$typeUrl === ReportToSign.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extraHash instanceof Uint8Array || typeof o.extraHash === "string") && (o.report instanceof Uint8Array || typeof o.report === "string")); + }, + isAmino(o: any): o is ReportToSignAmino { + return o && (o.$typeUrl === ReportToSign.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extra_hash instanceof Uint8Array || typeof o.extra_hash === "string") && (o.report instanceof Uint8Array || typeof o.report === "string")); + }, + encode(message: ReportToSign, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(16).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(24).uint64(message.round); + } + if (message.extraHash.length !== 0) { + writer.uint32(34).bytes(message.extraHash); + } + if (message.report.length !== 0) { + writer.uint32(42).bytes(message.report); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ReportToSign { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReportToSign(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epoch = reader.uint64(); + break; + case 3: + message.round = reader.uint64(); + break; + case 4: + message.extraHash = reader.bytes(); + break; + case 5: + message.report = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ReportToSign { + const message = createBaseReportToSign(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.extraHash = object.extraHash ?? new Uint8Array(); + message.report = object.report ?? new Uint8Array(); + return message; + }, + fromAmino(object: ReportToSignAmino): ReportToSign { + const message = createBaseReportToSign(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.extra_hash !== undefined && object.extra_hash !== null) { + message.extraHash = bytesFromBase64(object.extra_hash); + } + if (object.report !== undefined && object.report !== null) { + message.report = bytesFromBase64(object.report); + } + return message; + }, + toAmino(message: ReportToSign): ReportToSignAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.extra_hash = message.extraHash ? base64FromBytes(message.extraHash) : undefined; + obj.report = message.report ? base64FromBytes(message.report) : undefined; + return obj; + }, + fromAminoMsg(object: ReportToSignAminoMsg): ReportToSign { + return ReportToSign.fromAmino(object.value); + }, + fromProtoMsg(message: ReportToSignProtoMsg): ReportToSign { + return ReportToSign.decode(message.value); + }, + toProto(message: ReportToSign): Uint8Array { + return ReportToSign.encode(message).finish(); + }, + toProtoMsg(message: ReportToSign): ReportToSignProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.ReportToSign", + value: ReportToSign.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ReportToSign.typeUrl, ReportToSign); +function createBaseEventOraclePaid(): EventOraclePaid { + return { + transmitterAddr: "", + payeeAddr: "", + amount: Coin.fromPartial({}) + }; +} +export const EventOraclePaid = { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid", + is(o: any): o is EventOraclePaid { + return o && (o.$typeUrl === EventOraclePaid.typeUrl || typeof o.transmitterAddr === "string" && typeof o.payeeAddr === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventOraclePaidAmino { + return o && (o.$typeUrl === EventOraclePaid.typeUrl || typeof o.transmitter_addr === "string" && typeof o.payee_addr === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventOraclePaid, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitterAddr !== "") { + writer.uint32(10).string(message.transmitterAddr); + } + if (message.payeeAddr !== "") { + writer.uint32(18).string(message.payeeAddr); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOraclePaid { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOraclePaid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitterAddr = reader.string(); + break; + case 2: + message.payeeAddr = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOraclePaid { + const message = createBaseEventOraclePaid(); + message.transmitterAddr = object.transmitterAddr ?? ""; + message.payeeAddr = object.payeeAddr ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventOraclePaidAmino): EventOraclePaid { + const message = createBaseEventOraclePaid(); + if (object.transmitter_addr !== undefined && object.transmitter_addr !== null) { + message.transmitterAddr = object.transmitter_addr; + } + if (object.payee_addr !== undefined && object.payee_addr !== null) { + message.payeeAddr = object.payee_addr; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventOraclePaid): EventOraclePaidAmino { + const obj: any = {}; + obj.transmitter_addr = message.transmitterAddr === "" ? undefined : message.transmitterAddr; + obj.payee_addr = message.payeeAddr === "" ? undefined : message.payeeAddr; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventOraclePaidAminoMsg): EventOraclePaid { + return EventOraclePaid.fromAmino(object.value); + }, + fromProtoMsg(message: EventOraclePaidProtoMsg): EventOraclePaid { + return EventOraclePaid.decode(message.value); + }, + toProto(message: EventOraclePaid): Uint8Array { + return EventOraclePaid.encode(message).finish(); + }, + toProtoMsg(message: EventOraclePaid): EventOraclePaidProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventOraclePaid", + value: EventOraclePaid.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOraclePaid.typeUrl, EventOraclePaid); +function createBaseEventAnswerUpdated(): EventAnswerUpdated { + return { + current: "", + roundId: "", + updatedAt: new Date() + }; +} +export const EventAnswerUpdated = { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated", + is(o: any): o is EventAnswerUpdated { + return o && (o.$typeUrl === EventAnswerUpdated.typeUrl || typeof o.current === "string" && typeof o.roundId === "string" && Timestamp.is(o.updatedAt)); + }, + isAmino(o: any): o is EventAnswerUpdatedAmino { + return o && (o.$typeUrl === EventAnswerUpdated.typeUrl || typeof o.current === "string" && typeof o.round_id === "string" && Timestamp.isAmino(o.updated_at)); + }, + encode(message: EventAnswerUpdated, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.current !== "") { + writer.uint32(10).string(message.current); + } + if (message.roundId !== "") { + writer.uint32(18).string(message.roundId); + } + if (message.updatedAt !== undefined) { + Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAnswerUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAnswerUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.current = reader.string(); + break; + case 2: + message.roundId = reader.string(); + break; + case 3: + message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAnswerUpdated { + const message = createBaseEventAnswerUpdated(); + message.current = object.current ?? ""; + message.roundId = object.roundId ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + return message; + }, + fromAmino(object: EventAnswerUpdatedAmino): EventAnswerUpdated { + const message = createBaseEventAnswerUpdated(); + if (object.current !== undefined && object.current !== null) { + message.current = object.current; + } + if (object.round_id !== undefined && object.round_id !== null) { + message.roundId = object.round_id; + } + if (object.updated_at !== undefined && object.updated_at !== null) { + message.updatedAt = fromTimestamp(Timestamp.fromAmino(object.updated_at)); + } + return message; + }, + toAmino(message: EventAnswerUpdated): EventAnswerUpdatedAmino { + const obj: any = {}; + obj.current = message.current === "" ? undefined : message.current; + obj.round_id = message.roundId === "" ? undefined : message.roundId; + obj.updated_at = message.updatedAt ? Timestamp.toAmino(toTimestamp(message.updatedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: EventAnswerUpdatedAminoMsg): EventAnswerUpdated { + return EventAnswerUpdated.fromAmino(object.value); + }, + fromProtoMsg(message: EventAnswerUpdatedProtoMsg): EventAnswerUpdated { + return EventAnswerUpdated.decode(message.value); + }, + toProto(message: EventAnswerUpdated): Uint8Array { + return EventAnswerUpdated.encode(message).finish(); + }, + toProtoMsg(message: EventAnswerUpdated): EventAnswerUpdatedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventAnswerUpdated", + value: EventAnswerUpdated.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAnswerUpdated.typeUrl, EventAnswerUpdated); +function createBaseEventNewRound(): EventNewRound { + return { + roundId: "", + startedBy: "", + startedAt: new Date() + }; +} +export const EventNewRound = { + typeUrl: "/injective.ocr.v1beta1.EventNewRound", + is(o: any): o is EventNewRound { + return o && (o.$typeUrl === EventNewRound.typeUrl || typeof o.roundId === "string" && typeof o.startedBy === "string" && Timestamp.is(o.startedAt)); + }, + isAmino(o: any): o is EventNewRoundAmino { + return o && (o.$typeUrl === EventNewRound.typeUrl || typeof o.round_id === "string" && typeof o.started_by === "string" && Timestamp.isAmino(o.started_at)); + }, + encode(message: EventNewRound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.roundId !== "") { + writer.uint32(10).string(message.roundId); + } + if (message.startedBy !== "") { + writer.uint32(18).string(message.startedBy); + } + if (message.startedAt !== undefined) { + Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewRound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewRound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.string(); + break; + case 2: + message.startedBy = reader.string(); + break; + case 3: + message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewRound { + const message = createBaseEventNewRound(); + message.roundId = object.roundId ?? ""; + message.startedBy = object.startedBy ?? ""; + message.startedAt = object.startedAt ?? undefined; + return message; + }, + fromAmino(object: EventNewRoundAmino): EventNewRound { + const message = createBaseEventNewRound(); + if (object.round_id !== undefined && object.round_id !== null) { + message.roundId = object.round_id; + } + if (object.started_by !== undefined && object.started_by !== null) { + message.startedBy = object.started_by; + } + if (object.started_at !== undefined && object.started_at !== null) { + message.startedAt = fromTimestamp(Timestamp.fromAmino(object.started_at)); + } + return message; + }, + toAmino(message: EventNewRound): EventNewRoundAmino { + const obj: any = {}; + obj.round_id = message.roundId === "" ? undefined : message.roundId; + obj.started_by = message.startedBy === "" ? undefined : message.startedBy; + obj.started_at = message.startedAt ? Timestamp.toAmino(toTimestamp(message.startedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: EventNewRoundAminoMsg): EventNewRound { + return EventNewRound.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewRoundProtoMsg): EventNewRound { + return EventNewRound.decode(message.value); + }, + toProto(message: EventNewRound): Uint8Array { + return EventNewRound.encode(message).finish(); + }, + toProtoMsg(message: EventNewRound): EventNewRoundProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventNewRound", + value: EventNewRound.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewRound.typeUrl, EventNewRound); +function createBaseEventTransmitted(): EventTransmitted { + return { + configDigest: new Uint8Array(), + epoch: BigInt(0) + }; +} +export const EventTransmitted = { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted", + is(o: any): o is EventTransmitted { + return o && (o.$typeUrl === EventTransmitted.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.epoch === "bigint"); + }, + isAmino(o: any): o is EventTransmittedAmino { + return o && (o.$typeUrl === EventTransmitted.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.epoch === "bigint"); + }, + encode(message: EventTransmitted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(16).uint64(message.epoch); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventTransmitted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventTransmitted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epoch = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventTransmitted { + const message = createBaseEventTransmitted(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventTransmittedAmino): EventTransmitted { + const message = createBaseEventTransmitted(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + return message; + }, + toAmino(message: EventTransmitted): EventTransmittedAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventTransmittedAminoMsg): EventTransmitted { + return EventTransmitted.fromAmino(object.value); + }, + fromProtoMsg(message: EventTransmittedProtoMsg): EventTransmitted { + return EventTransmitted.decode(message.value); + }, + toProto(message: EventTransmitted): Uint8Array { + return EventTransmitted.encode(message).finish(); + }, + toProtoMsg(message: EventTransmitted): EventTransmittedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventTransmitted", + value: EventTransmitted.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventTransmitted.typeUrl, EventTransmitted); +function createBaseEventNewTransmission(): EventNewTransmission { + return { + feedId: "", + aggregatorRoundId: 0, + answer: "", + transmitter: "", + observationsTimestamp: BigInt(0), + observations: [], + observers: new Uint8Array(), + configDigest: new Uint8Array(), + epochAndRound: undefined + }; +} +export const EventNewTransmission = { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission", + is(o: any): o is EventNewTransmission { + return o && (o.$typeUrl === EventNewTransmission.typeUrl || typeof o.feedId === "string" && typeof o.aggregatorRoundId === "number" && typeof o.answer === "string" && typeof o.transmitter === "string" && typeof o.observationsTimestamp === "bigint" && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string") && (o.observers instanceof Uint8Array || typeof o.observers === "string") && (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string")); + }, + isAmino(o: any): o is EventNewTransmissionAmino { + return o && (o.$typeUrl === EventNewTransmission.typeUrl || typeof o.feed_id === "string" && typeof o.aggregator_round_id === "number" && typeof o.answer === "string" && typeof o.transmitter === "string" && typeof o.observations_timestamp === "bigint" && Array.isArray(o.observations) && (!o.observations.length || typeof o.observations[0] === "string") && (o.observers instanceof Uint8Array || typeof o.observers === "string") && (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string")); + }, + encode(message: EventNewTransmission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.aggregatorRoundId !== 0) { + writer.uint32(16).uint32(message.aggregatorRoundId); + } + if (message.answer !== "") { + writer.uint32(26).string(message.answer); + } + if (message.transmitter !== "") { + writer.uint32(34).string(message.transmitter); + } + if (message.observationsTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.observationsTimestamp); + } + for (const v of message.observations) { + writer.uint32(50).string(v!); + } + if (message.observers.length !== 0) { + writer.uint32(58).bytes(message.observers); + } + if (message.configDigest.length !== 0) { + writer.uint32(66).bytes(message.configDigest); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventNewTransmission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventNewTransmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.aggregatorRoundId = reader.uint32(); + break; + case 3: + message.answer = reader.string(); + break; + case 4: + message.transmitter = reader.string(); + break; + case 5: + message.observationsTimestamp = reader.int64(); + break; + case 6: + message.observations.push(reader.string()); + break; + case 7: + message.observers = reader.bytes(); + break; + case 8: + message.configDigest = reader.bytes(); + break; + case 9: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventNewTransmission { + const message = createBaseEventNewTransmission(); + message.feedId = object.feedId ?? ""; + message.aggregatorRoundId = object.aggregatorRoundId ?? 0; + message.answer = object.answer ?? ""; + message.transmitter = object.transmitter ?? ""; + message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? BigInt(object.observationsTimestamp.toString()) : BigInt(0); + message.observations = object.observations?.map(e => e) || []; + message.observers = object.observers ?? new Uint8Array(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: EventNewTransmissionAmino): EventNewTransmission { + const message = createBaseEventNewTransmission(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.aggregator_round_id !== undefined && object.aggregator_round_id !== null) { + message.aggregatorRoundId = object.aggregator_round_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.observations_timestamp !== undefined && object.observations_timestamp !== null) { + message.observationsTimestamp = BigInt(object.observations_timestamp); + } + message.observations = object.observations?.map(e => e) || []; + if (object.observers !== undefined && object.observers !== null) { + message.observers = bytesFromBase64(object.observers); + } + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: EventNewTransmission): EventNewTransmissionAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.aggregator_round_id = message.aggregatorRoundId === 0 ? undefined : message.aggregatorRoundId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.observations_timestamp = message.observationsTimestamp !== BigInt(0) ? message.observationsTimestamp?.toString() : undefined; + if (message.observations) { + obj.observations = message.observations.map(e => e); + } else { + obj.observations = message.observations; + } + obj.observers = message.observers ? base64FromBytes(message.observers) : undefined; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: EventNewTransmissionAminoMsg): EventNewTransmission { + return EventNewTransmission.fromAmino(object.value); + }, + fromProtoMsg(message: EventNewTransmissionProtoMsg): EventNewTransmission { + return EventNewTransmission.decode(message.value); + }, + toProto(message: EventNewTransmission): Uint8Array { + return EventNewTransmission.encode(message).finish(); + }, + toProtoMsg(message: EventNewTransmission): EventNewTransmissionProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventNewTransmission", + value: EventNewTransmission.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventNewTransmission.typeUrl, EventNewTransmission); +function createBaseEventConfigSet(): EventConfigSet { + return { + configDigest: new Uint8Array(), + previousConfigBlockNumber: BigInt(0), + config: undefined, + configInfo: undefined + }; +} +export const EventConfigSet = { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet", + is(o: any): o is EventConfigSet { + return o && (o.$typeUrl === EventConfigSet.typeUrl || (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.previousConfigBlockNumber === "bigint"); + }, + isAmino(o: any): o is EventConfigSetAmino { + return o && (o.$typeUrl === EventConfigSet.typeUrl || (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.previous_config_block_number === "bigint"); + }, + encode(message: EventConfigSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.previousConfigBlockNumber !== BigInt(0)) { + writer.uint32(16).int64(message.previousConfigBlockNumber); + } + if (message.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(26).fork()).ldelim(); + } + if (message.configInfo !== undefined) { + FeedConfigInfo.encode(message.configInfo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConfigSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConfigSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.previousConfigBlockNumber = reader.int64(); + break; + case 3: + message.config = FeedConfig.decode(reader, reader.uint32()); + break; + case 4: + message.configInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConfigSet { + const message = createBaseEventConfigSet(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.previousConfigBlockNumber = object.previousConfigBlockNumber !== undefined && object.previousConfigBlockNumber !== null ? BigInt(object.previousConfigBlockNumber.toString()) : BigInt(0); + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + message.configInfo = object.configInfo !== undefined && object.configInfo !== null ? FeedConfigInfo.fromPartial(object.configInfo) : undefined; + return message; + }, + fromAmino(object: EventConfigSetAmino): EventConfigSet { + const message = createBaseEventConfigSet(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.previous_config_block_number !== undefined && object.previous_config_block_number !== null) { + message.previousConfigBlockNumber = BigInt(object.previous_config_block_number); + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + if (object.config_info !== undefined && object.config_info !== null) { + message.configInfo = FeedConfigInfo.fromAmino(object.config_info); + } + return message; + }, + toAmino(message: EventConfigSet): EventConfigSetAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.previous_config_block_number = message.previousConfigBlockNumber !== BigInt(0) ? message.previousConfigBlockNumber?.toString() : undefined; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + obj.config_info = message.configInfo ? FeedConfigInfo.toAmino(message.configInfo) : undefined; + return obj; + }, + fromAminoMsg(object: EventConfigSetAminoMsg): EventConfigSet { + return EventConfigSet.fromAmino(object.value); + }, + fromProtoMsg(message: EventConfigSetProtoMsg): EventConfigSet { + return EventConfigSet.decode(message.value); + }, + toProto(message: EventConfigSet): Uint8Array { + return EventConfigSet.encode(message).finish(); + }, + toProtoMsg(message: EventConfigSet): EventConfigSetProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.EventConfigSet", + value: EventConfigSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConfigSet.typeUrl, EventConfigSet); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/ocr/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..028e63a7 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/query.rpc.func.ts @@ -0,0 +1,51 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryFeedConfigRequest, QueryFeedConfigResponse, QueryFeedConfigInfoRequest, QueryFeedConfigInfoResponse, QueryLatestRoundRequest, QueryLatestRoundResponse, QueryLatestTransmissionDetailsRequest, QueryLatestTransmissionDetailsResponse, QueryOwedAmountRequest, QueryOwedAmountResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetFeedConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigRequest.encode, + decode: QueryFeedConfigResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfig", + clientResolver +}); +export const createGetFeedConfigInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryFeedConfigInfoRequest.encode, + decode: QueryFeedConfigInfoResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "FeedConfigInfo", + clientResolver +}); +export const createGetLatestRound = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestRoundRequest.encode, + decode: QueryLatestRoundResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestRound", + clientResolver +}); +export const createGetLatestTransmissionDetails = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLatestTransmissionDetailsRequest.encode, + decode: QueryLatestTransmissionDetailsResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "LatestTransmissionDetails", + clientResolver +}); +export const createGetOwedAmount = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOwedAmountRequest.encode, + decode: QueryOwedAmountResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OwedAmount", + clientResolver +}); +export const createGetOcrModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.ocr.v1beta1.Query", + method: "OcrModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/query.ts b/libs/injectivejs/src/injective/ocr/v1beta1/query.ts new file mode 100644 index 00000000..d4dbcdb8 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/query.ts @@ -0,0 +1,1218 @@ +import { Params, ParamsAmino, FeedConfigInfo, FeedConfigInfoAmino, FeedConfig, FeedConfigAmino, EpochAndRound, EpochAndRoundAmino, Transmission, TransmissionAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +export interface QueryFeedConfigRequest { + feedId: string; +} +export interface QueryFeedConfigRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest"; + value: Uint8Array; +} +export interface QueryFeedConfigRequestAmino { + feed_id: string; +} +export interface QueryFeedConfigRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigRequest"; + value: QueryFeedConfigRequestAmino; +} +export interface QueryFeedConfigResponse { + feedConfigInfo?: FeedConfigInfo; + feedConfig?: FeedConfig; +} +export interface QueryFeedConfigResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse"; + value: Uint8Array; +} +export interface QueryFeedConfigResponseAmino { + feed_config_info?: FeedConfigInfoAmino; + feed_config?: FeedConfigAmino; +} +export interface QueryFeedConfigResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigResponse"; + value: QueryFeedConfigResponseAmino; +} +export interface QueryFeedConfigInfoRequest { + feedId: string; +} +export interface QueryFeedConfigInfoRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest"; + value: Uint8Array; +} +export interface QueryFeedConfigInfoRequestAmino { + feed_id: string; +} +export interface QueryFeedConfigInfoRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest"; + value: QueryFeedConfigInfoRequestAmino; +} +export interface QueryFeedConfigInfoResponse { + feedConfigInfo?: FeedConfigInfo; + epochAndRound?: EpochAndRound; +} +export interface QueryFeedConfigInfoResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse"; + value: Uint8Array; +} +export interface QueryFeedConfigInfoResponseAmino { + feed_config_info?: FeedConfigInfoAmino; + epoch_and_round?: EpochAndRoundAmino; +} +export interface QueryFeedConfigInfoResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse"; + value: QueryFeedConfigInfoResponseAmino; +} +export interface QueryLatestRoundRequest { + feedId: string; +} +export interface QueryLatestRoundRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest"; + value: Uint8Array; +} +export interface QueryLatestRoundRequestAmino { + feed_id: string; +} +export interface QueryLatestRoundRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestRoundRequest"; + value: QueryLatestRoundRequestAmino; +} +export interface QueryLatestRoundResponse { + latestRoundId: bigint; + data?: Transmission; +} +export interface QueryLatestRoundResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse"; + value: Uint8Array; +} +export interface QueryLatestRoundResponseAmino { + latest_round_id: string; + data?: TransmissionAmino; +} +export interface QueryLatestRoundResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestRoundResponse"; + value: QueryLatestRoundResponseAmino; +} +export interface QueryLatestTransmissionDetailsRequest { + feedId: string; +} +export interface QueryLatestTransmissionDetailsRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest"; + value: Uint8Array; +} +export interface QueryLatestTransmissionDetailsRequestAmino { + feed_id: string; +} +export interface QueryLatestTransmissionDetailsRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest"; + value: QueryLatestTransmissionDetailsRequestAmino; +} +export interface QueryLatestTransmissionDetailsResponse { + configDigest: Uint8Array; + epochAndRound?: EpochAndRound; + data?: Transmission; +} +export interface QueryLatestTransmissionDetailsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse"; + value: Uint8Array; +} +export interface QueryLatestTransmissionDetailsResponseAmino { + config_digest: string; + epoch_and_round?: EpochAndRoundAmino; + data?: TransmissionAmino; +} +export interface QueryLatestTransmissionDetailsResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse"; + value: QueryLatestTransmissionDetailsResponseAmino; +} +export interface QueryOwedAmountRequest { + transmitter: string; +} +export interface QueryOwedAmountRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest"; + value: Uint8Array; +} +export interface QueryOwedAmountRequestAmino { + transmitter: string; +} +export interface QueryOwedAmountRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryOwedAmountRequest"; + value: QueryOwedAmountRequestAmino; +} +export interface QueryOwedAmountResponse { + amount: Coin; +} +export interface QueryOwedAmountResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse"; + value: Uint8Array; +} +export interface QueryOwedAmountResponseAmino { + amount: CoinAmino; +} +export interface QueryOwedAmountResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryOwedAmountResponse"; + value: QueryOwedAmountResponseAmino; +} +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.ocr.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.ocr.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryFeedConfigRequest(): QueryFeedConfigRequest { + return { + feedId: "" + }; +} +export const QueryFeedConfigRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest", + is(o: any): o is QueryFeedConfigRequest { + return o && (o.$typeUrl === QueryFeedConfigRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryFeedConfigRequestAmino { + return o && (o.$typeUrl === QueryFeedConfigRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryFeedConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigRequest { + const message = createBaseQueryFeedConfigRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryFeedConfigRequestAmino): QueryFeedConfigRequest { + const message = createBaseQueryFeedConfigRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryFeedConfigRequest): QueryFeedConfigRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigRequestAminoMsg): QueryFeedConfigRequest { + return QueryFeedConfigRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigRequestProtoMsg): QueryFeedConfigRequest { + return QueryFeedConfigRequest.decode(message.value); + }, + toProto(message: QueryFeedConfigRequest): Uint8Array { + return QueryFeedConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigRequest): QueryFeedConfigRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigRequest", + value: QueryFeedConfigRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigRequest.typeUrl, QueryFeedConfigRequest); +function createBaseQueryFeedConfigResponse(): QueryFeedConfigResponse { + return { + feedConfigInfo: undefined, + feedConfig: undefined + }; +} +export const QueryFeedConfigResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse", + is(o: any): o is QueryFeedConfigResponse { + return o && o.$typeUrl === QueryFeedConfigResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeedConfigResponseAmino { + return o && o.$typeUrl === QueryFeedConfigResponse.typeUrl; + }, + encode(message: QueryFeedConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedConfigInfo !== undefined) { + FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.feedConfig !== undefined) { + FeedConfig.encode(message.feedConfig, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedConfigInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + case 2: + message.feedConfig = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigResponse { + const message = createBaseQueryFeedConfigResponse(); + message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined; + message.feedConfig = object.feedConfig !== undefined && object.feedConfig !== null ? FeedConfig.fromPartial(object.feedConfig) : undefined; + return message; + }, + fromAmino(object: QueryFeedConfigResponseAmino): QueryFeedConfigResponse { + const message = createBaseQueryFeedConfigResponse(); + if (object.feed_config_info !== undefined && object.feed_config_info !== null) { + message.feedConfigInfo = FeedConfigInfo.fromAmino(object.feed_config_info); + } + if (object.feed_config !== undefined && object.feed_config !== null) { + message.feedConfig = FeedConfig.fromAmino(object.feed_config); + } + return message; + }, + toAmino(message: QueryFeedConfigResponse): QueryFeedConfigResponseAmino { + const obj: any = {}; + obj.feed_config_info = message.feedConfigInfo ? FeedConfigInfo.toAmino(message.feedConfigInfo) : undefined; + obj.feed_config = message.feedConfig ? FeedConfig.toAmino(message.feedConfig) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigResponseAminoMsg): QueryFeedConfigResponse { + return QueryFeedConfigResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigResponseProtoMsg): QueryFeedConfigResponse { + return QueryFeedConfigResponse.decode(message.value); + }, + toProto(message: QueryFeedConfigResponse): Uint8Array { + return QueryFeedConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigResponse): QueryFeedConfigResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigResponse", + value: QueryFeedConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigResponse.typeUrl, QueryFeedConfigResponse); +function createBaseQueryFeedConfigInfoRequest(): QueryFeedConfigInfoRequest { + return { + feedId: "" + }; +} +export const QueryFeedConfigInfoRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest", + is(o: any): o is QueryFeedConfigInfoRequest { + return o && (o.$typeUrl === QueryFeedConfigInfoRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryFeedConfigInfoRequestAmino { + return o && (o.$typeUrl === QueryFeedConfigInfoRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryFeedConfigInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigInfoRequest { + const message = createBaseQueryFeedConfigInfoRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryFeedConfigInfoRequestAmino): QueryFeedConfigInfoRequest { + const message = createBaseQueryFeedConfigInfoRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryFeedConfigInfoRequest): QueryFeedConfigInfoRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigInfoRequestAminoMsg): QueryFeedConfigInfoRequest { + return QueryFeedConfigInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigInfoRequestProtoMsg): QueryFeedConfigInfoRequest { + return QueryFeedConfigInfoRequest.decode(message.value); + }, + toProto(message: QueryFeedConfigInfoRequest): Uint8Array { + return QueryFeedConfigInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigInfoRequest): QueryFeedConfigInfoRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoRequest", + value: QueryFeedConfigInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigInfoRequest.typeUrl, QueryFeedConfigInfoRequest); +function createBaseQueryFeedConfigInfoResponse(): QueryFeedConfigInfoResponse { + return { + feedConfigInfo: undefined, + epochAndRound: undefined + }; +} +export const QueryFeedConfigInfoResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse", + is(o: any): o is QueryFeedConfigInfoResponse { + return o && o.$typeUrl === QueryFeedConfigInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryFeedConfigInfoResponseAmino { + return o && o.$typeUrl === QueryFeedConfigInfoResponse.typeUrl; + }, + encode(message: QueryFeedConfigInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedConfigInfo !== undefined) { + FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeedConfigInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeedConfigInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedConfigInfo = FeedConfigInfo.decode(reader, reader.uint32()); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryFeedConfigInfoResponse { + const message = createBaseQueryFeedConfigInfoResponse(); + message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined; + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + return message; + }, + fromAmino(object: QueryFeedConfigInfoResponseAmino): QueryFeedConfigInfoResponse { + const message = createBaseQueryFeedConfigInfoResponse(); + if (object.feed_config_info !== undefined && object.feed_config_info !== null) { + message.feedConfigInfo = FeedConfigInfo.fromAmino(object.feed_config_info); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + return message; + }, + toAmino(message: QueryFeedConfigInfoResponse): QueryFeedConfigInfoResponseAmino { + const obj: any = {}; + obj.feed_config_info = message.feedConfigInfo ? FeedConfigInfo.toAmino(message.feedConfigInfo) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + return obj; + }, + fromAminoMsg(object: QueryFeedConfigInfoResponseAminoMsg): QueryFeedConfigInfoResponse { + return QueryFeedConfigInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeedConfigInfoResponseProtoMsg): QueryFeedConfigInfoResponse { + return QueryFeedConfigInfoResponse.decode(message.value); + }, + toProto(message: QueryFeedConfigInfoResponse): Uint8Array { + return QueryFeedConfigInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeedConfigInfoResponse): QueryFeedConfigInfoResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryFeedConfigInfoResponse", + value: QueryFeedConfigInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryFeedConfigInfoResponse.typeUrl, QueryFeedConfigInfoResponse); +function createBaseQueryLatestRoundRequest(): QueryLatestRoundRequest { + return { + feedId: "" + }; +} +export const QueryLatestRoundRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest", + is(o: any): o is QueryLatestRoundRequest { + return o && (o.$typeUrl === QueryLatestRoundRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryLatestRoundRequestAmino { + return o && (o.$typeUrl === QueryLatestRoundRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryLatestRoundRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestRoundRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestRoundRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestRoundRequest { + const message = createBaseQueryLatestRoundRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryLatestRoundRequestAmino): QueryLatestRoundRequest { + const message = createBaseQueryLatestRoundRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryLatestRoundRequest): QueryLatestRoundRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryLatestRoundRequestAminoMsg): QueryLatestRoundRequest { + return QueryLatestRoundRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestRoundRequestProtoMsg): QueryLatestRoundRequest { + return QueryLatestRoundRequest.decode(message.value); + }, + toProto(message: QueryLatestRoundRequest): Uint8Array { + return QueryLatestRoundRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestRoundRequest): QueryLatestRoundRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundRequest", + value: QueryLatestRoundRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestRoundRequest.typeUrl, QueryLatestRoundRequest); +function createBaseQueryLatestRoundResponse(): QueryLatestRoundResponse { + return { + latestRoundId: BigInt(0), + data: undefined + }; +} +export const QueryLatestRoundResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse", + is(o: any): o is QueryLatestRoundResponse { + return o && (o.$typeUrl === QueryLatestRoundResponse.typeUrl || typeof o.latestRoundId === "bigint"); + }, + isAmino(o: any): o is QueryLatestRoundResponseAmino { + return o && (o.$typeUrl === QueryLatestRoundResponse.typeUrl || typeof o.latest_round_id === "bigint"); + }, + encode(message: QueryLatestRoundResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.latestRoundId !== BigInt(0)) { + writer.uint32(8).uint64(message.latestRoundId); + } + if (message.data !== undefined) { + Transmission.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestRoundResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestRoundResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestRoundId = reader.uint64(); + break; + case 2: + message.data = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestRoundResponse { + const message = createBaseQueryLatestRoundResponse(); + message.latestRoundId = object.latestRoundId !== undefined && object.latestRoundId !== null ? BigInt(object.latestRoundId.toString()) : BigInt(0); + message.data = object.data !== undefined && object.data !== null ? Transmission.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: QueryLatestRoundResponseAmino): QueryLatestRoundResponse { + const message = createBaseQueryLatestRoundResponse(); + if (object.latest_round_id !== undefined && object.latest_round_id !== null) { + message.latestRoundId = BigInt(object.latest_round_id); + } + if (object.data !== undefined && object.data !== null) { + message.data = Transmission.fromAmino(object.data); + } + return message; + }, + toAmino(message: QueryLatestRoundResponse): QueryLatestRoundResponseAmino { + const obj: any = {}; + obj.latest_round_id = message.latestRoundId !== BigInt(0) ? message.latestRoundId?.toString() : undefined; + obj.data = message.data ? Transmission.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLatestRoundResponseAminoMsg): QueryLatestRoundResponse { + return QueryLatestRoundResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestRoundResponseProtoMsg): QueryLatestRoundResponse { + return QueryLatestRoundResponse.decode(message.value); + }, + toProto(message: QueryLatestRoundResponse): Uint8Array { + return QueryLatestRoundResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestRoundResponse): QueryLatestRoundResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestRoundResponse", + value: QueryLatestRoundResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestRoundResponse.typeUrl, QueryLatestRoundResponse); +function createBaseQueryLatestTransmissionDetailsRequest(): QueryLatestTransmissionDetailsRequest { + return { + feedId: "" + }; +} +export const QueryLatestTransmissionDetailsRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest", + is(o: any): o is QueryLatestTransmissionDetailsRequest { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsRequest.typeUrl || typeof o.feedId === "string"); + }, + isAmino(o: any): o is QueryLatestTransmissionDetailsRequestAmino { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsRequest.typeUrl || typeof o.feed_id === "string"); + }, + encode(message: QueryLatestTransmissionDetailsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestTransmissionDetailsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestTransmissionDetailsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestTransmissionDetailsRequest { + const message = createBaseQueryLatestTransmissionDetailsRequest(); + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: QueryLatestTransmissionDetailsRequestAmino): QueryLatestTransmissionDetailsRequest { + const message = createBaseQueryLatestTransmissionDetailsRequest(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: QueryLatestTransmissionDetailsRequest): QueryLatestTransmissionDetailsRequestAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: QueryLatestTransmissionDetailsRequestAminoMsg): QueryLatestTransmissionDetailsRequest { + return QueryLatestTransmissionDetailsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestTransmissionDetailsRequestProtoMsg): QueryLatestTransmissionDetailsRequest { + return QueryLatestTransmissionDetailsRequest.decode(message.value); + }, + toProto(message: QueryLatestTransmissionDetailsRequest): Uint8Array { + return QueryLatestTransmissionDetailsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestTransmissionDetailsRequest): QueryLatestTransmissionDetailsRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsRequest", + value: QueryLatestTransmissionDetailsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestTransmissionDetailsRequest.typeUrl, QueryLatestTransmissionDetailsRequest); +function createBaseQueryLatestTransmissionDetailsResponse(): QueryLatestTransmissionDetailsResponse { + return { + configDigest: new Uint8Array(), + epochAndRound: undefined, + data: undefined + }; +} +export const QueryLatestTransmissionDetailsResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse", + is(o: any): o is QueryLatestTransmissionDetailsResponse { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsResponse.typeUrl || o.configDigest instanceof Uint8Array || typeof o.configDigest === "string"); + }, + isAmino(o: any): o is QueryLatestTransmissionDetailsResponseAmino { + return o && (o.$typeUrl === QueryLatestTransmissionDetailsResponse.typeUrl || o.config_digest instanceof Uint8Array || typeof o.config_digest === "string"); + }, + encode(message: QueryLatestTransmissionDetailsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.configDigest.length !== 0) { + writer.uint32(10).bytes(message.configDigest); + } + if (message.epochAndRound !== undefined) { + EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim(); + } + if (message.data !== undefined) { + Transmission.encode(message.data, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLatestTransmissionDetailsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestTransmissionDetailsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configDigest = reader.bytes(); + break; + case 2: + message.epochAndRound = EpochAndRound.decode(reader, reader.uint32()); + break; + case 3: + message.data = Transmission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLatestTransmissionDetailsResponse { + const message = createBaseQueryLatestTransmissionDetailsResponse(); + message.configDigest = object.configDigest ?? new Uint8Array(); + message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined; + message.data = object.data !== undefined && object.data !== null ? Transmission.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: QueryLatestTransmissionDetailsResponseAmino): QueryLatestTransmissionDetailsResponse { + const message = createBaseQueryLatestTransmissionDetailsResponse(); + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.epoch_and_round !== undefined && object.epoch_and_round !== null) { + message.epochAndRound = EpochAndRound.fromAmino(object.epoch_and_round); + } + if (object.data !== undefined && object.data !== null) { + message.data = Transmission.fromAmino(object.data); + } + return message; + }, + toAmino(message: QueryLatestTransmissionDetailsResponse): QueryLatestTransmissionDetailsResponseAmino { + const obj: any = {}; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.epoch_and_round = message.epochAndRound ? EpochAndRound.toAmino(message.epochAndRound) : undefined; + obj.data = message.data ? Transmission.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLatestTransmissionDetailsResponseAminoMsg): QueryLatestTransmissionDetailsResponse { + return QueryLatestTransmissionDetailsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLatestTransmissionDetailsResponseProtoMsg): QueryLatestTransmissionDetailsResponse { + return QueryLatestTransmissionDetailsResponse.decode(message.value); + }, + toProto(message: QueryLatestTransmissionDetailsResponse): Uint8Array { + return QueryLatestTransmissionDetailsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLatestTransmissionDetailsResponse): QueryLatestTransmissionDetailsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryLatestTransmissionDetailsResponse", + value: QueryLatestTransmissionDetailsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLatestTransmissionDetailsResponse.typeUrl, QueryLatestTransmissionDetailsResponse); +function createBaseQueryOwedAmountRequest(): QueryOwedAmountRequest { + return { + transmitter: "" + }; +} +export const QueryOwedAmountRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest", + is(o: any): o is QueryOwedAmountRequest { + return o && (o.$typeUrl === QueryOwedAmountRequest.typeUrl || typeof o.transmitter === "string"); + }, + isAmino(o: any): o is QueryOwedAmountRequestAmino { + return o && (o.$typeUrl === QueryOwedAmountRequest.typeUrl || typeof o.transmitter === "string"); + }, + encode(message: QueryOwedAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitter !== "") { + writer.uint32(10).string(message.transmitter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwedAmountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwedAmountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOwedAmountRequest { + const message = createBaseQueryOwedAmountRequest(); + message.transmitter = object.transmitter ?? ""; + return message; + }, + fromAmino(object: QueryOwedAmountRequestAmino): QueryOwedAmountRequest { + const message = createBaseQueryOwedAmountRequest(); + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + return message; + }, + toAmino(message: QueryOwedAmountRequest): QueryOwedAmountRequestAmino { + const obj: any = {}; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + return obj; + }, + fromAminoMsg(object: QueryOwedAmountRequestAminoMsg): QueryOwedAmountRequest { + return QueryOwedAmountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwedAmountRequestProtoMsg): QueryOwedAmountRequest { + return QueryOwedAmountRequest.decode(message.value); + }, + toProto(message: QueryOwedAmountRequest): Uint8Array { + return QueryOwedAmountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOwedAmountRequest): QueryOwedAmountRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountRequest", + value: QueryOwedAmountRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOwedAmountRequest.typeUrl, QueryOwedAmountRequest); +function createBaseQueryOwedAmountResponse(): QueryOwedAmountResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryOwedAmountResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse", + is(o: any): o is QueryOwedAmountResponse { + return o && (o.$typeUrl === QueryOwedAmountResponse.typeUrl || Coin.is(o.amount)); + }, + isAmino(o: any): o is QueryOwedAmountResponseAmino { + return o && (o.$typeUrl === QueryOwedAmountResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QueryOwedAmountResponse, 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): QueryOwedAmountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwedAmountResponse(); + 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: DeepPartial): QueryOwedAmountResponse { + const message = createBaseQueryOwedAmountResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryOwedAmountResponseAmino): QueryOwedAmountResponse { + const message = createBaseQueryOwedAmountResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryOwedAmountResponse): QueryOwedAmountResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOwedAmountResponseAminoMsg): QueryOwedAmountResponse { + return QueryOwedAmountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwedAmountResponseProtoMsg): QueryOwedAmountResponse { + return QueryOwedAmountResponse.decode(message.value); + }, + toProto(message: QueryOwedAmountResponse): Uint8Array { + return QueryOwedAmountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOwedAmountResponse): QueryOwedAmountResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryOwedAmountResponse", + value: QueryOwedAmountResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOwedAmountResponse.typeUrl, QueryOwedAmountResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/ocr/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..32fa6520 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/tx.rpc.func.ts @@ -0,0 +1,57 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateFeed, MsgUpdateFeed, MsgTransmit, MsgFundFeedRewardPool, MsgWithdrawFeedRewardPool, MsgSetPayees, MsgTransferPayeeship, MsgAcceptPayeeship, MsgUpdateParams } from "./tx"; +export const createCreateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateFeed.typeUrl, + encoders: toEncoders(MsgCreateFeed), + converters: toConverters(MsgCreateFeed) +}); +export const createUpdateFeed = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateFeed.typeUrl, + encoders: toEncoders(MsgUpdateFeed), + converters: toConverters(MsgUpdateFeed) +}); +export const createTransmit = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransmit.typeUrl, + encoders: toEncoders(MsgTransmit), + converters: toConverters(MsgTransmit) +}); +export const createFundFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgFundFeedRewardPool.typeUrl, + encoders: toEncoders(MsgFundFeedRewardPool), + converters: toConverters(MsgFundFeedRewardPool) +}); +export const createWithdrawFeedRewardPool = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawFeedRewardPool.typeUrl, + encoders: toEncoders(MsgWithdrawFeedRewardPool), + converters: toConverters(MsgWithdrawFeedRewardPool) +}); +export const createSetPayees = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetPayees.typeUrl, + encoders: toEncoders(MsgSetPayees), + converters: toConverters(MsgSetPayees) +}); +export const createTransferPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgTransferPayeeship.typeUrl, + encoders: toEncoders(MsgTransferPayeeship), + converters: toConverters(MsgTransferPayeeship) +}); +export const createAcceptPayeeship = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgAcceptPayeeship.typeUrl, + encoders: toEncoders(MsgAcceptPayeeship), + converters: toConverters(MsgAcceptPayeeship) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/ocr/v1beta1/tx.ts b/libs/injectivejs/src/injective/ocr/v1beta1/tx.ts new file mode 100644 index 00000000..d26b2a17 --- /dev/null +++ b/libs/injectivejs/src/injective/ocr/v1beta1/tx.ts @@ -0,0 +1,1900 @@ +import { FeedConfig, FeedConfigAmino, Report, ReportAmino, Params, ParamsAmino } from "./ocr"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgCreateFeed { + sender: string; + config?: FeedConfig; +} +export interface MsgCreateFeedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed"; + value: Uint8Array; +} +export interface MsgCreateFeedAmino { + sender: string; + config?: FeedConfigAmino; +} +export interface MsgCreateFeedAminoMsg { + type: "ocr/MsgCreateFeed"; + value: MsgCreateFeedAmino; +} +export interface MsgCreateFeedResponse {} +export interface MsgCreateFeedResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse"; + value: Uint8Array; +} +export interface MsgCreateFeedResponseAmino {} +export interface MsgCreateFeedResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgCreateFeedResponse"; + value: MsgCreateFeedResponseAmino; +} +export interface MsgUpdateFeed { + sender: string; + /** feed_id is an unique ID for the target of this config */ + feedId: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Fixed LINK reward for each observer */ + linkPerObservation?: string; + /** Fixed LINK reward for transmitter */ + linkPerTransmission?: string; + /** Native denom for LINK coin in the bank keeper */ + linkDenom: string; + /** feed administrator */ + feedAdmin: string; + /** feed billing administrator */ + billingAdmin: string; +} +export interface MsgUpdateFeedProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed"; + value: Uint8Array; +} +export interface MsgUpdateFeedAmino { + sender: string; + /** feed_id is an unique ID for the target of this config */ + feed_id: string; + /** signers ith element is address ith oracle uses to sign a report */ + signers: string[]; + /** + * transmitters ith element is address ith oracle uses to transmit a report + * via the transmit method + */ + transmitters: string[]; + /** Fixed LINK reward for each observer */ + link_per_observation?: string; + /** Fixed LINK reward for transmitter */ + link_per_transmission?: string; + /** Native denom for LINK coin in the bank keeper */ + link_denom: string; + /** feed administrator */ + feed_admin: string; + /** feed billing administrator */ + billing_admin: string; +} +export interface MsgUpdateFeedAminoMsg { + type: "ocr/MsgUpdateFeed"; + value: MsgUpdateFeedAmino; +} +export interface MsgUpdateFeedResponse {} +export interface MsgUpdateFeedResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse"; + value: Uint8Array; +} +export interface MsgUpdateFeedResponseAmino {} +export interface MsgUpdateFeedResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgUpdateFeedResponse"; + value: MsgUpdateFeedResponseAmino; +} +export interface MsgTransmit { + /** Address of the transmitter */ + transmitter: string; + configDigest: Uint8Array; + feedId: string; + epoch: bigint; + round: bigint; + extraHash: Uint8Array; + report?: Report; + signatures: Uint8Array[]; +} +export interface MsgTransmitProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit"; + value: Uint8Array; +} +export interface MsgTransmitAmino { + /** Address of the transmitter */ + transmitter: string; + config_digest: string; + feed_id: string; + epoch: string; + round: string; + extra_hash: string; + report?: ReportAmino; + signatures: string[]; +} +export interface MsgTransmitAminoMsg { + type: "ocr/MsgTransmit"; + value: MsgTransmitAmino; +} +export interface MsgTransmitResponse {} +export interface MsgTransmitResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse"; + value: Uint8Array; +} +export interface MsgTransmitResponseAmino {} +export interface MsgTransmitResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgTransmitResponse"; + value: MsgTransmitResponseAmino; +} +export interface MsgFundFeedRewardPool { + sender: string; + feedId: string; + amount: Coin; +} +export interface MsgFundFeedRewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool"; + value: Uint8Array; +} +export interface MsgFundFeedRewardPoolAmino { + sender: string; + feed_id: string; + amount: CoinAmino; +} +export interface MsgFundFeedRewardPoolAminoMsg { + type: "ocr/MsgFundFeedRewardPool"; + value: MsgFundFeedRewardPoolAmino; +} +export interface MsgFundFeedRewardPoolResponse {} +export interface MsgFundFeedRewardPoolResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse"; + value: Uint8Array; +} +export interface MsgFundFeedRewardPoolResponseAmino {} +export interface MsgFundFeedRewardPoolResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse"; + value: MsgFundFeedRewardPoolResponseAmino; +} +export interface MsgWithdrawFeedRewardPool { + sender: string; + feedId: string; + amount: Coin; +} +export interface MsgWithdrawFeedRewardPoolProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool"; + value: Uint8Array; +} +export interface MsgWithdrawFeedRewardPoolAmino { + sender: string; + feed_id: string; + amount: CoinAmino; +} +export interface MsgWithdrawFeedRewardPoolAminoMsg { + type: "ocr/MsgWithdrawFeedRewardPool"; + value: MsgWithdrawFeedRewardPoolAmino; +} +export interface MsgWithdrawFeedRewardPoolResponse {} +export interface MsgWithdrawFeedRewardPoolResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse"; + value: Uint8Array; +} +export interface MsgWithdrawFeedRewardPoolResponseAmino {} +export interface MsgWithdrawFeedRewardPoolResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse"; + value: MsgWithdrawFeedRewardPoolResponseAmino; +} +export interface MsgSetPayees { + sender: string; + feedId: string; + /** addresses oracles use to transmit the reports */ + transmitters: string[]; + /** addresses of payees corresponding to list of transmitters */ + payees: string[]; +} +export interface MsgSetPayeesProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees"; + value: Uint8Array; +} +export interface MsgSetPayeesAmino { + sender: string; + feed_id: string; + /** addresses oracles use to transmit the reports */ + transmitters: string[]; + /** addresses of payees corresponding to list of transmitters */ + payees: string[]; +} +export interface MsgSetPayeesAminoMsg { + type: "ocr/MsgSetPayees"; + value: MsgSetPayeesAmino; +} +export interface MsgSetPayeesResponse {} +export interface MsgSetPayeesResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse"; + value: Uint8Array; +} +export interface MsgSetPayeesResponseAmino {} +export interface MsgSetPayeesResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgSetPayeesResponse"; + value: MsgSetPayeesResponseAmino; +} +export interface MsgTransferPayeeship { + /** transmitter address of oracle whose payee is changing */ + sender: string; + transmitter: string; + feedId: string; + /** new payee address */ + proposed: string; +} +export interface MsgTransferPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship"; + value: Uint8Array; +} +export interface MsgTransferPayeeshipAmino { + /** transmitter address of oracle whose payee is changing */ + sender: string; + transmitter: string; + feed_id: string; + /** new payee address */ + proposed: string; +} +export interface MsgTransferPayeeshipAminoMsg { + type: "ocr/MsgTransferPayeeship"; + value: MsgTransferPayeeshipAmino; +} +export interface MsgTransferPayeeshipResponse {} +export interface MsgTransferPayeeshipResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse"; + value: Uint8Array; +} +export interface MsgTransferPayeeshipResponseAmino {} +export interface MsgTransferPayeeshipResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse"; + value: MsgTransferPayeeshipResponseAmino; +} +export interface MsgAcceptPayeeship { + /** new payee address */ + payee: string; + /** transmitter address of oracle whose payee is changing */ + transmitter: string; + feedId: string; +} +export interface MsgAcceptPayeeshipProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship"; + value: Uint8Array; +} +export interface MsgAcceptPayeeshipAmino { + /** new payee address */ + payee: string; + /** transmitter address of oracle whose payee is changing */ + transmitter: string; + feed_id: string; +} +export interface MsgAcceptPayeeshipAminoMsg { + type: "ocr/MsgAcceptPayeeship"; + value: MsgAcceptPayeeshipAmino; +} +export interface MsgAcceptPayeeshipResponse {} +export interface MsgAcceptPayeeshipResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse"; + value: Uint8Array; +} +export interface MsgAcceptPayeeshipResponseAmino {} +export interface MsgAcceptPayeeshipResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse"; + value: MsgAcceptPayeeshipResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the ocr parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "ocr/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.ocr.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateFeed(): MsgCreateFeed { + return { + sender: "", + config: undefined + }; +} +export const MsgCreateFeed = { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed", + aminoType: "ocr/MsgCreateFeed", + is(o: any): o is MsgCreateFeed { + return o && (o.$typeUrl === MsgCreateFeed.typeUrl || typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCreateFeedAmino { + return o && (o.$typeUrl === MsgCreateFeed.typeUrl || typeof o.sender === "string"); + }, + encode(message: MsgCreateFeed, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.config !== undefined) { + FeedConfig.encode(message.config, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateFeed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateFeed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.config = FeedConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateFeed { + const message = createBaseMsgCreateFeed(); + message.sender = object.sender ?? ""; + message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: MsgCreateFeedAmino): MsgCreateFeed { + const message = createBaseMsgCreateFeed(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.config !== undefined && object.config !== null) { + message.config = FeedConfig.fromAmino(object.config); + } + return message; + }, + toAmino(message: MsgCreateFeed): MsgCreateFeedAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.config = message.config ? FeedConfig.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateFeedAminoMsg): MsgCreateFeed { + return MsgCreateFeed.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateFeed): MsgCreateFeedAminoMsg { + return { + type: "ocr/MsgCreateFeed", + value: MsgCreateFeed.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateFeedProtoMsg): MsgCreateFeed { + return MsgCreateFeed.decode(message.value); + }, + toProto(message: MsgCreateFeed): Uint8Array { + return MsgCreateFeed.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateFeed): MsgCreateFeedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeed", + value: MsgCreateFeed.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateFeed.typeUrl, MsgCreateFeed); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateFeed.aminoType, MsgCreateFeed.typeUrl); +function createBaseMsgCreateFeedResponse(): MsgCreateFeedResponse { + return {}; +} +export const MsgCreateFeedResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse", + is(o: any): o is MsgCreateFeedResponse { + return o && o.$typeUrl === MsgCreateFeedResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateFeedResponseAmino { + return o && o.$typeUrl === MsgCreateFeedResponse.typeUrl; + }, + encode(_: MsgCreateFeedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateFeedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateFeedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateFeedResponse { + const message = createBaseMsgCreateFeedResponse(); + return message; + }, + fromAmino(_: MsgCreateFeedResponseAmino): MsgCreateFeedResponse { + const message = createBaseMsgCreateFeedResponse(); + return message; + }, + toAmino(_: MsgCreateFeedResponse): MsgCreateFeedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateFeedResponseAminoMsg): MsgCreateFeedResponse { + return MsgCreateFeedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateFeedResponseProtoMsg): MsgCreateFeedResponse { + return MsgCreateFeedResponse.decode(message.value); + }, + toProto(message: MsgCreateFeedResponse): Uint8Array { + return MsgCreateFeedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateFeedResponse): MsgCreateFeedResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgCreateFeedResponse", + value: MsgCreateFeedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateFeedResponse.typeUrl, MsgCreateFeedResponse); +function createBaseMsgUpdateFeed(): MsgUpdateFeed { + return { + sender: "", + feedId: "", + signers: [], + transmitters: [], + linkPerObservation: undefined, + linkPerTransmission: undefined, + linkDenom: "", + feedAdmin: "", + billingAdmin: "" + }; +} +export const MsgUpdateFeed = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed", + aminoType: "ocr/MsgUpdateFeed", + is(o: any): o is MsgUpdateFeed { + return o && (o.$typeUrl === MsgUpdateFeed.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.linkDenom === "string" && typeof o.feedAdmin === "string" && typeof o.billingAdmin === "string"); + }, + isAmino(o: any): o is MsgUpdateFeedAmino { + return o && (o.$typeUrl === MsgUpdateFeed.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Array.isArray(o.signers) && (!o.signers.length || typeof o.signers[0] === "string") && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && typeof o.link_denom === "string" && typeof o.feed_admin === "string" && typeof o.billing_admin === "string"); + }, + encode(message: MsgUpdateFeed, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + for (const v of message.signers) { + writer.uint32(26).string(v!); + } + for (const v of message.transmitters) { + writer.uint32(34).string(v!); + } + if (message.linkPerObservation !== undefined) { + writer.uint32(42).string(message.linkPerObservation); + } + if (message.linkPerTransmission !== undefined) { + writer.uint32(50).string(message.linkPerTransmission); + } + if (message.linkDenom !== "") { + writer.uint32(58).string(message.linkDenom); + } + if (message.feedAdmin !== "") { + writer.uint32(66).string(message.feedAdmin); + } + if (message.billingAdmin !== "") { + writer.uint32(74).string(message.billingAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateFeed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateFeed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.signers.push(reader.string()); + break; + case 4: + message.transmitters.push(reader.string()); + break; + case 5: + message.linkPerObservation = reader.string(); + break; + case 6: + message.linkPerTransmission = reader.string(); + break; + case 7: + message.linkDenom = reader.string(); + break; + case 8: + message.feedAdmin = reader.string(); + break; + case 9: + message.billingAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateFeed { + const message = createBaseMsgUpdateFeed(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + message.linkPerObservation = object.linkPerObservation ?? undefined; + message.linkPerTransmission = object.linkPerTransmission ?? undefined; + message.linkDenom = object.linkDenom ?? ""; + message.feedAdmin = object.feedAdmin ?? ""; + message.billingAdmin = object.billingAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateFeedAmino): MsgUpdateFeed { + const message = createBaseMsgUpdateFeed(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.signers = object.signers?.map(e => e) || []; + message.transmitters = object.transmitters?.map(e => e) || []; + if (object.link_per_observation !== undefined && object.link_per_observation !== null) { + message.linkPerObservation = object.link_per_observation; + } + if (object.link_per_transmission !== undefined && object.link_per_transmission !== null) { + message.linkPerTransmission = object.link_per_transmission; + } + if (object.link_denom !== undefined && object.link_denom !== null) { + message.linkDenom = object.link_denom; + } + if (object.feed_admin !== undefined && object.feed_admin !== null) { + message.feedAdmin = object.feed_admin; + } + if (object.billing_admin !== undefined && object.billing_admin !== null) { + message.billingAdmin = object.billing_admin; + } + return message; + }, + toAmino(message: MsgUpdateFeed): MsgUpdateFeedAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.signers) { + obj.signers = message.signers.map(e => e); + } else { + obj.signers = message.signers; + } + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + obj.link_per_observation = message.linkPerObservation === null ? undefined : message.linkPerObservation; + obj.link_per_transmission = message.linkPerTransmission === null ? undefined : message.linkPerTransmission; + obj.link_denom = message.linkDenom === "" ? undefined : message.linkDenom; + obj.feed_admin = message.feedAdmin === "" ? undefined : message.feedAdmin; + obj.billing_admin = message.billingAdmin === "" ? undefined : message.billingAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateFeedAminoMsg): MsgUpdateFeed { + return MsgUpdateFeed.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateFeed): MsgUpdateFeedAminoMsg { + return { + type: "ocr/MsgUpdateFeed", + value: MsgUpdateFeed.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateFeedProtoMsg): MsgUpdateFeed { + return MsgUpdateFeed.decode(message.value); + }, + toProto(message: MsgUpdateFeed): Uint8Array { + return MsgUpdateFeed.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateFeed): MsgUpdateFeedProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeed", + value: MsgUpdateFeed.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateFeed.typeUrl, MsgUpdateFeed); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateFeed.aminoType, MsgUpdateFeed.typeUrl); +function createBaseMsgUpdateFeedResponse(): MsgUpdateFeedResponse { + return {}; +} +export const MsgUpdateFeedResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse", + is(o: any): o is MsgUpdateFeedResponse { + return o && o.$typeUrl === MsgUpdateFeedResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateFeedResponseAmino { + return o && o.$typeUrl === MsgUpdateFeedResponse.typeUrl; + }, + encode(_: MsgUpdateFeedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateFeedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateFeedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateFeedResponse { + const message = createBaseMsgUpdateFeedResponse(); + return message; + }, + fromAmino(_: MsgUpdateFeedResponseAmino): MsgUpdateFeedResponse { + const message = createBaseMsgUpdateFeedResponse(); + return message; + }, + toAmino(_: MsgUpdateFeedResponse): MsgUpdateFeedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateFeedResponseAminoMsg): MsgUpdateFeedResponse { + return MsgUpdateFeedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateFeedResponseProtoMsg): MsgUpdateFeedResponse { + return MsgUpdateFeedResponse.decode(message.value); + }, + toProto(message: MsgUpdateFeedResponse): Uint8Array { + return MsgUpdateFeedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateFeedResponse): MsgUpdateFeedResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateFeedResponse", + value: MsgUpdateFeedResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateFeedResponse.typeUrl, MsgUpdateFeedResponse); +function createBaseMsgTransmit(): MsgTransmit { + return { + transmitter: "", + configDigest: new Uint8Array(), + feedId: "", + epoch: BigInt(0), + round: BigInt(0), + extraHash: new Uint8Array(), + report: undefined, + signatures: [] + }; +} +export const MsgTransmit = { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit", + aminoType: "ocr/MsgTransmit", + is(o: any): o is MsgTransmit { + return o && (o.$typeUrl === MsgTransmit.typeUrl || typeof o.transmitter === "string" && (o.configDigest instanceof Uint8Array || typeof o.configDigest === "string") && typeof o.feedId === "string" && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extraHash instanceof Uint8Array || typeof o.extraHash === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MsgTransmitAmino { + return o && (o.$typeUrl === MsgTransmit.typeUrl || typeof o.transmitter === "string" && (o.config_digest instanceof Uint8Array || typeof o.config_digest === "string") && typeof o.feed_id === "string" && typeof o.epoch === "bigint" && typeof o.round === "bigint" && (o.extra_hash instanceof Uint8Array || typeof o.extra_hash === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MsgTransmit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transmitter !== "") { + writer.uint32(10).string(message.transmitter); + } + if (message.configDigest.length !== 0) { + writer.uint32(18).bytes(message.configDigest); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(32).uint64(message.epoch); + } + if (message.round !== BigInt(0)) { + writer.uint32(40).uint64(message.round); + } + if (message.extraHash.length !== 0) { + writer.uint32(50).bytes(message.extraHash); + } + if (message.report !== undefined) { + Report.encode(message.report, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(66).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransmit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransmit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transmitter = reader.string(); + break; + case 2: + message.configDigest = reader.bytes(); + break; + case 3: + message.feedId = reader.string(); + break; + case 4: + message.epoch = reader.uint64(); + break; + case 5: + message.round = reader.uint64(); + break; + case 6: + message.extraHash = reader.bytes(); + break; + case 7: + message.report = Report.decode(reader, reader.uint32()); + break; + case 8: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransmit { + const message = createBaseMsgTransmit(); + message.transmitter = object.transmitter ?? ""; + message.configDigest = object.configDigest ?? new Uint8Array(); + message.feedId = object.feedId ?? ""; + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.round = object.round !== undefined && object.round !== null ? BigInt(object.round.toString()) : BigInt(0); + message.extraHash = object.extraHash ?? new Uint8Array(); + message.report = object.report !== undefined && object.report !== null ? Report.fromPartial(object.report) : undefined; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgTransmitAmino): MsgTransmit { + const message = createBaseMsgTransmit(); + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.config_digest !== undefined && object.config_digest !== null) { + message.configDigest = bytesFromBase64(object.config_digest); + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.round !== undefined && object.round !== null) { + message.round = BigInt(object.round); + } + if (object.extra_hash !== undefined && object.extra_hash !== null) { + message.extraHash = bytesFromBase64(object.extra_hash); + } + if (object.report !== undefined && object.report !== null) { + message.report = Report.fromAmino(object.report); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgTransmit): MsgTransmitAmino { + const obj: any = {}; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.config_digest = message.configDigest ? base64FromBytes(message.configDigest) : undefined; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.epoch = message.epoch !== BigInt(0) ? message.epoch?.toString() : undefined; + obj.round = message.round !== BigInt(0) ? message.round?.toString() : undefined; + obj.extra_hash = message.extraHash ? base64FromBytes(message.extraHash) : undefined; + obj.report = message.report ? Report.toAmino(message.report) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MsgTransmitAminoMsg): MsgTransmit { + return MsgTransmit.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransmit): MsgTransmitAminoMsg { + return { + type: "ocr/MsgTransmit", + value: MsgTransmit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransmitProtoMsg): MsgTransmit { + return MsgTransmit.decode(message.value); + }, + toProto(message: MsgTransmit): Uint8Array { + return MsgTransmit.encode(message).finish(); + }, + toProtoMsg(message: MsgTransmit): MsgTransmitProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransmit", + value: MsgTransmit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransmit.typeUrl, MsgTransmit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransmit.aminoType, MsgTransmit.typeUrl); +function createBaseMsgTransmitResponse(): MsgTransmitResponse { + return {}; +} +export const MsgTransmitResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse", + is(o: any): o is MsgTransmitResponse { + return o && o.$typeUrl === MsgTransmitResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransmitResponseAmino { + return o && o.$typeUrl === MsgTransmitResponse.typeUrl; + }, + encode(_: MsgTransmitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransmitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransmitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgTransmitResponse { + const message = createBaseMsgTransmitResponse(); + return message; + }, + fromAmino(_: MsgTransmitResponseAmino): MsgTransmitResponse { + const message = createBaseMsgTransmitResponse(); + return message; + }, + toAmino(_: MsgTransmitResponse): MsgTransmitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransmitResponseAminoMsg): MsgTransmitResponse { + return MsgTransmitResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransmitResponseProtoMsg): MsgTransmitResponse { + return MsgTransmitResponse.decode(message.value); + }, + toProto(message: MsgTransmitResponse): Uint8Array { + return MsgTransmitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransmitResponse): MsgTransmitResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransmitResponse", + value: MsgTransmitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransmitResponse.typeUrl, MsgTransmitResponse); +function createBaseMsgFundFeedRewardPool(): MsgFundFeedRewardPool { + return { + sender: "", + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgFundFeedRewardPool = { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool", + aminoType: "ocr/MsgFundFeedRewardPool", + is(o: any): o is MsgFundFeedRewardPool { + return o && (o.$typeUrl === MsgFundFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgFundFeedRewardPoolAmino { + return o && (o.$typeUrl === MsgFundFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgFundFeedRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundFeedRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundFeedRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgFundFeedRewardPool { + const message = createBaseMsgFundFeedRewardPool(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgFundFeedRewardPoolAmino): MsgFundFeedRewardPool { + const message = createBaseMsgFundFeedRewardPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgFundFeedRewardPoolAminoMsg): MsgFundFeedRewardPool { + return MsgFundFeedRewardPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolAminoMsg { + return { + type: "ocr/MsgFundFeedRewardPool", + value: MsgFundFeedRewardPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundFeedRewardPoolProtoMsg): MsgFundFeedRewardPool { + return MsgFundFeedRewardPool.decode(message.value); + }, + toProto(message: MsgFundFeedRewardPool): Uint8Array { + return MsgFundFeedRewardPool.encode(message).finish(); + }, + toProtoMsg(message: MsgFundFeedRewardPool): MsgFundFeedRewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPool", + value: MsgFundFeedRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundFeedRewardPool.typeUrl, MsgFundFeedRewardPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundFeedRewardPool.aminoType, MsgFundFeedRewardPool.typeUrl); +function createBaseMsgFundFeedRewardPoolResponse(): MsgFundFeedRewardPoolResponse { + return {}; +} +export const MsgFundFeedRewardPoolResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse", + is(o: any): o is MsgFundFeedRewardPoolResponse { + return o && o.$typeUrl === MsgFundFeedRewardPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgFundFeedRewardPoolResponseAmino { + return o && o.$typeUrl === MsgFundFeedRewardPoolResponse.typeUrl; + }, + encode(_: MsgFundFeedRewardPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundFeedRewardPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundFeedRewardPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgFundFeedRewardPoolResponse { + const message = createBaseMsgFundFeedRewardPoolResponse(); + return message; + }, + fromAmino(_: MsgFundFeedRewardPoolResponseAmino): MsgFundFeedRewardPoolResponse { + const message = createBaseMsgFundFeedRewardPoolResponse(); + return message; + }, + toAmino(_: MsgFundFeedRewardPoolResponse): MsgFundFeedRewardPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgFundFeedRewardPoolResponseAminoMsg): MsgFundFeedRewardPoolResponse { + return MsgFundFeedRewardPoolResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgFundFeedRewardPoolResponseProtoMsg): MsgFundFeedRewardPoolResponse { + return MsgFundFeedRewardPoolResponse.decode(message.value); + }, + toProto(message: MsgFundFeedRewardPoolResponse): Uint8Array { + return MsgFundFeedRewardPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgFundFeedRewardPoolResponse): MsgFundFeedRewardPoolResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgFundFeedRewardPoolResponse", + value: MsgFundFeedRewardPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgFundFeedRewardPoolResponse.typeUrl, MsgFundFeedRewardPoolResponse); +function createBaseMsgWithdrawFeedRewardPool(): MsgWithdrawFeedRewardPool { + return { + sender: "", + feedId: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgWithdrawFeedRewardPool = { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool", + aminoType: "ocr/MsgWithdrawFeedRewardPool", + is(o: any): o is MsgWithdrawFeedRewardPool { + return o && (o.$typeUrl === MsgWithdrawFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgWithdrawFeedRewardPoolAmino { + return o && (o.$typeUrl === MsgWithdrawFeedRewardPool.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Coin.isAmino(o.amount)); + }, + encode(message: MsgWithdrawFeedRewardPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFeedRewardPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFeedRewardPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawFeedRewardPool { + const message = createBaseMsgWithdrawFeedRewardPool(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgWithdrawFeedRewardPoolAmino): MsgWithdrawFeedRewardPool { + const message = createBaseMsgWithdrawFeedRewardPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFeedRewardPoolAminoMsg): MsgWithdrawFeedRewardPool { + return MsgWithdrawFeedRewardPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolAminoMsg { + return { + type: "ocr/MsgWithdrawFeedRewardPool", + value: MsgWithdrawFeedRewardPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawFeedRewardPoolProtoMsg): MsgWithdrawFeedRewardPool { + return MsgWithdrawFeedRewardPool.decode(message.value); + }, + toProto(message: MsgWithdrawFeedRewardPool): Uint8Array { + return MsgWithdrawFeedRewardPool.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFeedRewardPool): MsgWithdrawFeedRewardPoolProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPool", + value: MsgWithdrawFeedRewardPool.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawFeedRewardPool.typeUrl, MsgWithdrawFeedRewardPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawFeedRewardPool.aminoType, MsgWithdrawFeedRewardPool.typeUrl); +function createBaseMsgWithdrawFeedRewardPoolResponse(): MsgWithdrawFeedRewardPoolResponse { + return {}; +} +export const MsgWithdrawFeedRewardPoolResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse", + is(o: any): o is MsgWithdrawFeedRewardPoolResponse { + return o && o.$typeUrl === MsgWithdrawFeedRewardPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawFeedRewardPoolResponseAmino { + return o && o.$typeUrl === MsgWithdrawFeedRewardPoolResponse.typeUrl; + }, + encode(_: MsgWithdrawFeedRewardPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFeedRewardPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawFeedRewardPoolResponse { + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + return message; + }, + fromAmino(_: MsgWithdrawFeedRewardPoolResponseAmino): MsgWithdrawFeedRewardPoolResponse { + const message = createBaseMsgWithdrawFeedRewardPoolResponse(); + return message; + }, + toAmino(_: MsgWithdrawFeedRewardPoolResponse): MsgWithdrawFeedRewardPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFeedRewardPoolResponseAminoMsg): MsgWithdrawFeedRewardPoolResponse { + return MsgWithdrawFeedRewardPoolResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawFeedRewardPoolResponseProtoMsg): MsgWithdrawFeedRewardPoolResponse { + return MsgWithdrawFeedRewardPoolResponse.decode(message.value); + }, + toProto(message: MsgWithdrawFeedRewardPoolResponse): Uint8Array { + return MsgWithdrawFeedRewardPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFeedRewardPoolResponse): MsgWithdrawFeedRewardPoolResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgWithdrawFeedRewardPoolResponse", + value: MsgWithdrawFeedRewardPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawFeedRewardPoolResponse.typeUrl, MsgWithdrawFeedRewardPoolResponse); +function createBaseMsgSetPayees(): MsgSetPayees { + return { + sender: "", + feedId: "", + transmitters: [], + payees: [] + }; +} +export const MsgSetPayees = { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees", + aminoType: "ocr/MsgSetPayees", + is(o: any): o is MsgSetPayees { + return o && (o.$typeUrl === MsgSetPayees.typeUrl || typeof o.sender === "string" && typeof o.feedId === "string" && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && Array.isArray(o.payees) && (!o.payees.length || typeof o.payees[0] === "string")); + }, + isAmino(o: any): o is MsgSetPayeesAmino { + return o && (o.$typeUrl === MsgSetPayees.typeUrl || typeof o.sender === "string" && typeof o.feed_id === "string" && Array.isArray(o.transmitters) && (!o.transmitters.length || typeof o.transmitters[0] === "string") && Array.isArray(o.payees) && (!o.payees.length || typeof o.payees[0] === "string")); + }, + encode(message: MsgSetPayees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.feedId !== "") { + writer.uint32(18).string(message.feedId); + } + for (const v of message.transmitters) { + writer.uint32(26).string(v!); + } + for (const v of message.payees) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPayees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetPayees(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.transmitters.push(reader.string()); + break; + case 4: + message.payees.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetPayees { + const message = createBaseMsgSetPayees(); + message.sender = object.sender ?? ""; + message.feedId = object.feedId ?? ""; + message.transmitters = object.transmitters?.map(e => e) || []; + message.payees = object.payees?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgSetPayeesAmino): MsgSetPayees { + const message = createBaseMsgSetPayees(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + message.transmitters = object.transmitters?.map(e => e) || []; + message.payees = object.payees?.map(e => e) || []; + return message; + }, + toAmino(message: MsgSetPayees): MsgSetPayeesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + if (message.transmitters) { + obj.transmitters = message.transmitters.map(e => e); + } else { + obj.transmitters = message.transmitters; + } + if (message.payees) { + obj.payees = message.payees.map(e => e); + } else { + obj.payees = message.payees; + } + return obj; + }, + fromAminoMsg(object: MsgSetPayeesAminoMsg): MsgSetPayees { + return MsgSetPayees.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetPayees): MsgSetPayeesAminoMsg { + return { + type: "ocr/MsgSetPayees", + value: MsgSetPayees.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetPayeesProtoMsg): MsgSetPayees { + return MsgSetPayees.decode(message.value); + }, + toProto(message: MsgSetPayees): Uint8Array { + return MsgSetPayees.encode(message).finish(); + }, + toProtoMsg(message: MsgSetPayees): MsgSetPayeesProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayees", + value: MsgSetPayees.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetPayees.typeUrl, MsgSetPayees); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetPayees.aminoType, MsgSetPayees.typeUrl); +function createBaseMsgSetPayeesResponse(): MsgSetPayeesResponse { + return {}; +} +export const MsgSetPayeesResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse", + is(o: any): o is MsgSetPayeesResponse { + return o && o.$typeUrl === MsgSetPayeesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetPayeesResponseAmino { + return o && o.$typeUrl === MsgSetPayeesResponse.typeUrl; + }, + encode(_: MsgSetPayeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPayeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetPayeesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetPayeesResponse { + const message = createBaseMsgSetPayeesResponse(); + return message; + }, + fromAmino(_: MsgSetPayeesResponseAmino): MsgSetPayeesResponse { + const message = createBaseMsgSetPayeesResponse(); + return message; + }, + toAmino(_: MsgSetPayeesResponse): MsgSetPayeesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetPayeesResponseAminoMsg): MsgSetPayeesResponse { + return MsgSetPayeesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetPayeesResponseProtoMsg): MsgSetPayeesResponse { + return MsgSetPayeesResponse.decode(message.value); + }, + toProto(message: MsgSetPayeesResponse): Uint8Array { + return MsgSetPayeesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetPayeesResponse): MsgSetPayeesResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgSetPayeesResponse", + value: MsgSetPayeesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetPayeesResponse.typeUrl, MsgSetPayeesResponse); +function createBaseMsgTransferPayeeship(): MsgTransferPayeeship { + return { + sender: "", + transmitter: "", + feedId: "", + proposed: "" + }; +} +export const MsgTransferPayeeship = { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship", + aminoType: "ocr/MsgTransferPayeeship", + is(o: any): o is MsgTransferPayeeship { + return o && (o.$typeUrl === MsgTransferPayeeship.typeUrl || typeof o.sender === "string" && typeof o.transmitter === "string" && typeof o.feedId === "string" && typeof o.proposed === "string"); + }, + isAmino(o: any): o is MsgTransferPayeeshipAmino { + return o && (o.$typeUrl === MsgTransferPayeeship.typeUrl || typeof o.sender === "string" && typeof o.transmitter === "string" && typeof o.feed_id === "string" && typeof o.proposed === "string"); + }, + encode(message: MsgTransferPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + if (message.proposed !== "") { + writer.uint32(34).string(message.proposed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.feedId = reader.string(); + break; + case 4: + message.proposed = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgTransferPayeeship { + const message = createBaseMsgTransferPayeeship(); + message.sender = object.sender ?? ""; + message.transmitter = object.transmitter ?? ""; + message.feedId = object.feedId ?? ""; + message.proposed = object.proposed ?? ""; + return message; + }, + fromAmino(object: MsgTransferPayeeshipAmino): MsgTransferPayeeship { + const message = createBaseMsgTransferPayeeship(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.proposed !== undefined && object.proposed !== null) { + message.proposed = object.proposed; + } + return message; + }, + toAmino(message: MsgTransferPayeeship): MsgTransferPayeeshipAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.proposed = message.proposed === "" ? undefined : message.proposed; + return obj; + }, + fromAminoMsg(object: MsgTransferPayeeshipAminoMsg): MsgTransferPayeeship { + return MsgTransferPayeeship.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPayeeship): MsgTransferPayeeshipAminoMsg { + return { + type: "ocr/MsgTransferPayeeship", + value: MsgTransferPayeeship.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPayeeshipProtoMsg): MsgTransferPayeeship { + return MsgTransferPayeeship.decode(message.value); + }, + toProto(message: MsgTransferPayeeship): Uint8Array { + return MsgTransferPayeeship.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPayeeship): MsgTransferPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeship", + value: MsgTransferPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPayeeship.typeUrl, MsgTransferPayeeship); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferPayeeship.aminoType, MsgTransferPayeeship.typeUrl); +function createBaseMsgTransferPayeeshipResponse(): MsgTransferPayeeshipResponse { + return {}; +} +export const MsgTransferPayeeshipResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse", + is(o: any): o is MsgTransferPayeeshipResponse { + return o && o.$typeUrl === MsgTransferPayeeshipResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransferPayeeshipResponseAmino { + return o && o.$typeUrl === MsgTransferPayeeshipResponse.typeUrl; + }, + encode(_: MsgTransferPayeeshipResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPayeeshipResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPayeeshipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgTransferPayeeshipResponse { + const message = createBaseMsgTransferPayeeshipResponse(); + return message; + }, + fromAmino(_: MsgTransferPayeeshipResponseAmino): MsgTransferPayeeshipResponse { + const message = createBaseMsgTransferPayeeshipResponse(); + return message; + }, + toAmino(_: MsgTransferPayeeshipResponse): MsgTransferPayeeshipResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferPayeeshipResponseAminoMsg): MsgTransferPayeeshipResponse { + return MsgTransferPayeeshipResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransferPayeeshipResponseProtoMsg): MsgTransferPayeeshipResponse { + return MsgTransferPayeeshipResponse.decode(message.value); + }, + toProto(message: MsgTransferPayeeshipResponse): Uint8Array { + return MsgTransferPayeeshipResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPayeeshipResponse): MsgTransferPayeeshipResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgTransferPayeeshipResponse", + value: MsgTransferPayeeshipResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPayeeshipResponse.typeUrl, MsgTransferPayeeshipResponse); +function createBaseMsgAcceptPayeeship(): MsgAcceptPayeeship { + return { + payee: "", + transmitter: "", + feedId: "" + }; +} +export const MsgAcceptPayeeship = { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship", + aminoType: "ocr/MsgAcceptPayeeship", + is(o: any): o is MsgAcceptPayeeship { + return o && (o.$typeUrl === MsgAcceptPayeeship.typeUrl || typeof o.payee === "string" && typeof o.transmitter === "string" && typeof o.feedId === "string"); + }, + isAmino(o: any): o is MsgAcceptPayeeshipAmino { + return o && (o.$typeUrl === MsgAcceptPayeeship.typeUrl || typeof o.payee === "string" && typeof o.transmitter === "string" && typeof o.feed_id === "string"); + }, + encode(message: MsgAcceptPayeeship, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.payee !== "") { + writer.uint32(10).string(message.payee); + } + if (message.transmitter !== "") { + writer.uint32(18).string(message.transmitter); + } + if (message.feedId !== "") { + writer.uint32(26).string(message.feedId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcceptPayeeship { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptPayeeship(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payee = reader.string(); + break; + case 2: + message.transmitter = reader.string(); + break; + case 3: + message.feedId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgAcceptPayeeship { + const message = createBaseMsgAcceptPayeeship(); + message.payee = object.payee ?? ""; + message.transmitter = object.transmitter ?? ""; + message.feedId = object.feedId ?? ""; + return message; + }, + fromAmino(object: MsgAcceptPayeeshipAmino): MsgAcceptPayeeship { + const message = createBaseMsgAcceptPayeeship(); + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + if (object.transmitter !== undefined && object.transmitter !== null) { + message.transmitter = object.transmitter; + } + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + return message; + }, + toAmino(message: MsgAcceptPayeeship): MsgAcceptPayeeshipAmino { + const obj: any = {}; + obj.payee = message.payee === "" ? undefined : message.payee; + obj.transmitter = message.transmitter === "" ? undefined : message.transmitter; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + return obj; + }, + fromAminoMsg(object: MsgAcceptPayeeshipAminoMsg): MsgAcceptPayeeship { + return MsgAcceptPayeeship.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcceptPayeeship): MsgAcceptPayeeshipAminoMsg { + return { + type: "ocr/MsgAcceptPayeeship", + value: MsgAcceptPayeeship.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcceptPayeeshipProtoMsg): MsgAcceptPayeeship { + return MsgAcceptPayeeship.decode(message.value); + }, + toProto(message: MsgAcceptPayeeship): Uint8Array { + return MsgAcceptPayeeship.encode(message).finish(); + }, + toProtoMsg(message: MsgAcceptPayeeship): MsgAcceptPayeeshipProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeship", + value: MsgAcceptPayeeship.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcceptPayeeship.typeUrl, MsgAcceptPayeeship); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcceptPayeeship.aminoType, MsgAcceptPayeeship.typeUrl); +function createBaseMsgAcceptPayeeshipResponse(): MsgAcceptPayeeshipResponse { + return {}; +} +export const MsgAcceptPayeeshipResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse", + is(o: any): o is MsgAcceptPayeeshipResponse { + return o && o.$typeUrl === MsgAcceptPayeeshipResponse.typeUrl; + }, + isAmino(o: any): o is MsgAcceptPayeeshipResponseAmino { + return o && o.$typeUrl === MsgAcceptPayeeshipResponse.typeUrl; + }, + encode(_: MsgAcceptPayeeshipResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcceptPayeeshipResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcceptPayeeshipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgAcceptPayeeshipResponse { + const message = createBaseMsgAcceptPayeeshipResponse(); + return message; + }, + fromAmino(_: MsgAcceptPayeeshipResponseAmino): MsgAcceptPayeeshipResponse { + const message = createBaseMsgAcceptPayeeshipResponse(); + return message; + }, + toAmino(_: MsgAcceptPayeeshipResponse): MsgAcceptPayeeshipResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAcceptPayeeshipResponseAminoMsg): MsgAcceptPayeeshipResponse { + return MsgAcceptPayeeshipResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAcceptPayeeshipResponseProtoMsg): MsgAcceptPayeeshipResponse { + return MsgAcceptPayeeshipResponse.decode(message.value); + }, + toProto(message: MsgAcceptPayeeshipResponse): Uint8Array { + return MsgAcceptPayeeshipResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcceptPayeeshipResponse): MsgAcceptPayeeshipResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgAcceptPayeeshipResponse", + value: MsgAcceptPayeeshipResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgAcceptPayeeshipResponse.typeUrl, MsgAcceptPayeeshipResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParams", + aminoType: "ocr/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "ocr/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: "/injective.ocr.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.ocr.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/events.ts b/libs/injectivejs/src/injective/oracle/v1beta1/events.ts new file mode 100644 index 00000000..e78a07bd --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/events.ts @@ -0,0 +1,1234 @@ +import { StorkPriceState, StorkPriceStateAmino, PythPriceState, PythPriceStateAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface SetChainlinkPriceEvent { + feedId: string; + answer: string; + timestamp: bigint; +} +export interface SetChainlinkPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent"; + value: Uint8Array; +} +export interface SetChainlinkPriceEventAmino { + feed_id: string; + answer: string; + timestamp: string; +} +export interface SetChainlinkPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetChainlinkPriceEvent"; + value: SetChainlinkPriceEventAmino; +} +/** Event type upon set ref */ +export interface SetBandPriceEvent { + relayer: string; + symbol: string; + price: string; + resolveTime: bigint; + requestId: bigint; +} +export interface SetBandPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent"; + value: Uint8Array; +} +/** Event type upon set ref */ +export interface SetBandPriceEventAmino { + relayer: string; + symbol: string; + price: string; + resolve_time: string; + request_id: string; +} +export interface SetBandPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetBandPriceEvent"; + value: SetBandPriceEventAmino; +} +export interface SetBandIBCPriceEvent { + relayer: string; + symbols: string[]; + prices: string[]; + resolveTime: bigint; + requestId: bigint; + clientId: bigint; +} +export interface SetBandIBCPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent"; + value: Uint8Array; +} +export interface SetBandIBCPriceEventAmino { + relayer: string; + symbols: string[]; + prices: string[]; + resolve_time: string; + request_id: string; + client_id: string; +} +export interface SetBandIBCPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetBandIBCPriceEvent"; + value: SetBandIBCPriceEventAmino; +} +export interface EventBandIBCAckSuccess { + ackResult: string; + clientId: bigint; +} +export interface EventBandIBCAckSuccessProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess"; + value: Uint8Array; +} +export interface EventBandIBCAckSuccessAmino { + ack_result: string; + client_id: string; +} +export interface EventBandIBCAckSuccessAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCAckSuccess"; + value: EventBandIBCAckSuccessAmino; +} +export interface EventBandIBCAckError { + ackError: string; + clientId: bigint; +} +export interface EventBandIBCAckErrorProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError"; + value: Uint8Array; +} +export interface EventBandIBCAckErrorAmino { + ack_error: string; + client_id: string; +} +export interface EventBandIBCAckErrorAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCAckError"; + value: EventBandIBCAckErrorAmino; +} +export interface EventBandIBCResponseTimeout { + clientId: bigint; +} +export interface EventBandIBCResponseTimeoutProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout"; + value: Uint8Array; +} +export interface EventBandIBCResponseTimeoutAmino { + client_id: string; +} +export interface EventBandIBCResponseTimeoutAminoMsg { + type: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout"; + value: EventBandIBCResponseTimeoutAmino; +} +export interface SetPriceFeedPriceEvent { + relayer: string; + base: string; + quote: string; + /** price defines the price of the oracle base and quote */ + price: string; +} +export interface SetPriceFeedPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent"; + value: Uint8Array; +} +export interface SetPriceFeedPriceEventAmino { + relayer: string; + base: string; + quote: string; + /** price defines the price of the oracle base and quote */ + price: string; +} +export interface SetPriceFeedPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent"; + value: SetPriceFeedPriceEventAmino; +} +export interface SetProviderPriceEvent { + provider: string; + relayer: string; + symbol: string; + price: string; +} +export interface SetProviderPriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent"; + value: Uint8Array; +} +export interface SetProviderPriceEventAmino { + provider: string; + relayer: string; + symbol: string; + price: string; +} +export interface SetProviderPriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetProviderPriceEvent"; + value: SetProviderPriceEventAmino; +} +export interface SetCoinbasePriceEvent { + symbol: string; + price: string; + timestamp: bigint; +} +export interface SetCoinbasePriceEventProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent"; + value: Uint8Array; +} +export interface SetCoinbasePriceEventAmino { + symbol: string; + price: string; + timestamp: string; +} +export interface SetCoinbasePriceEventAminoMsg { + type: "/injective.oracle.v1beta1.SetCoinbasePriceEvent"; + value: SetCoinbasePriceEventAmino; +} +export interface EventSetStorkPrices { + prices: StorkPriceState[]; +} +export interface EventSetStorkPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices"; + value: Uint8Array; +} +export interface EventSetStorkPricesAmino { + prices: StorkPriceStateAmino[]; +} +export interface EventSetStorkPricesAminoMsg { + type: "/injective.oracle.v1beta1.EventSetStorkPrices"; + value: EventSetStorkPricesAmino; +} +export interface EventSetPythPrices { + prices: PythPriceState[]; +} +export interface EventSetPythPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices"; + value: Uint8Array; +} +export interface EventSetPythPricesAmino { + prices: PythPriceStateAmino[]; +} +export interface EventSetPythPricesAminoMsg { + type: "/injective.oracle.v1beta1.EventSetPythPrices"; + value: EventSetPythPricesAmino; +} +function createBaseSetChainlinkPriceEvent(): SetChainlinkPriceEvent { + return { + feedId: "", + answer: "", + timestamp: BigInt(0) + }; +} +export const SetChainlinkPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent", + is(o: any): o is SetChainlinkPriceEvent { + return o && (o.$typeUrl === SetChainlinkPriceEvent.typeUrl || typeof o.feedId === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SetChainlinkPriceEventAmino { + return o && (o.$typeUrl === SetChainlinkPriceEvent.typeUrl || typeof o.feed_id === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SetChainlinkPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.answer !== "") { + writer.uint32(18).string(message.answer); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetChainlinkPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetChainlinkPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.answer = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetChainlinkPriceEvent { + const message = createBaseSetChainlinkPriceEvent(); + message.feedId = object.feedId ?? ""; + message.answer = object.answer ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetChainlinkPriceEventAmino): SetChainlinkPriceEvent { + const message = createBaseSetChainlinkPriceEvent(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SetChainlinkPriceEvent): SetChainlinkPriceEventAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetChainlinkPriceEventAminoMsg): SetChainlinkPriceEvent { + return SetChainlinkPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetChainlinkPriceEventProtoMsg): SetChainlinkPriceEvent { + return SetChainlinkPriceEvent.decode(message.value); + }, + toProto(message: SetChainlinkPriceEvent): Uint8Array { + return SetChainlinkPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetChainlinkPriceEvent): SetChainlinkPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetChainlinkPriceEvent", + value: SetChainlinkPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetChainlinkPriceEvent.typeUrl, SetChainlinkPriceEvent); +function createBaseSetBandPriceEvent(): SetBandPriceEvent { + return { + relayer: "", + symbol: "", + price: "", + resolveTime: BigInt(0), + requestId: BigInt(0) + }; +} +export const SetBandPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent", + is(o: any): o is SetBandPriceEvent { + return o && (o.$typeUrl === SetBandPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string" && typeof o.resolveTime === "bigint" && typeof o.requestId === "bigint"); + }, + isAmino(o: any): o is SetBandPriceEventAmino { + return o && (o.$typeUrl === SetBandPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string" && typeof o.resolve_time === "bigint" && typeof o.request_id === "bigint"); + }, + encode(message: SetBandPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(32).uint64(message.resolveTime); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(40).uint64(message.requestId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBandPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBandPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.resolveTime = reader.uint64(); + break; + case 5: + message.requestId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBandPriceEvent { + const message = createBaseSetBandPriceEvent(); + message.relayer = object.relayer ?? ""; + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetBandPriceEventAmino): SetBandPriceEvent { + const message = createBaseSetBandPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + return message; + }, + toAmino(message: SetBandPriceEvent): SetBandPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetBandPriceEventAminoMsg): SetBandPriceEvent { + return SetBandPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetBandPriceEventProtoMsg): SetBandPriceEvent { + return SetBandPriceEvent.decode(message.value); + }, + toProto(message: SetBandPriceEvent): Uint8Array { + return SetBandPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetBandPriceEvent): SetBandPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetBandPriceEvent", + value: SetBandPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBandPriceEvent.typeUrl, SetBandPriceEvent); +function createBaseSetBandIBCPriceEvent(): SetBandIBCPriceEvent { + return { + relayer: "", + symbols: [], + prices: [], + resolveTime: BigInt(0), + requestId: BigInt(0), + clientId: BigInt(0) + }; +} +export const SetBandIBCPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent", + is(o: any): o is SetBandIBCPriceEvent { + return o && (o.$typeUrl === SetBandIBCPriceEvent.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string") && typeof o.resolveTime === "bigint" && typeof o.requestId === "bigint" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is SetBandIBCPriceEventAmino { + return o && (o.$typeUrl === SetBandIBCPriceEvent.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string") && typeof o.resolve_time === "bigint" && typeof o.request_id === "bigint" && typeof o.client_id === "bigint"); + }, + encode(message: SetBandIBCPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + for (const v of message.symbols) { + writer.uint32(18).string(v!); + } + for (const v of message.prices) { + writer.uint32(26).string(v!); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(32).uint64(message.resolveTime); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(40).uint64(message.requestId); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(48).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetBandIBCPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetBandIBCPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbols.push(reader.string()); + break; + case 3: + message.prices.push(reader.string()); + break; + case 4: + message.resolveTime = reader.uint64(); + break; + case 5: + message.requestId = reader.uint64(); + break; + case 6: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetBandIBCPriceEvent { + const message = createBaseSetBandIBCPriceEvent(); + message.relayer = object.relayer ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetBandIBCPriceEventAmino): SetBandIBCPriceEvent { + const message = createBaseSetBandIBCPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: SetBandIBCPriceEvent): SetBandIBCPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.prices) { + obj.prices = message.prices.map(e => e); + } else { + obj.prices = message.prices; + } + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetBandIBCPriceEventAminoMsg): SetBandIBCPriceEvent { + return SetBandIBCPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetBandIBCPriceEventProtoMsg): SetBandIBCPriceEvent { + return SetBandIBCPriceEvent.decode(message.value); + }, + toProto(message: SetBandIBCPriceEvent): Uint8Array { + return SetBandIBCPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetBandIBCPriceEvent): SetBandIBCPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetBandIBCPriceEvent", + value: SetBandIBCPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetBandIBCPriceEvent.typeUrl, SetBandIBCPriceEvent); +function createBaseEventBandIBCAckSuccess(): EventBandIBCAckSuccess { + return { + ackResult: "", + clientId: BigInt(0) + }; +} +export const EventBandIBCAckSuccess = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess", + is(o: any): o is EventBandIBCAckSuccess { + return o && (o.$typeUrl === EventBandIBCAckSuccess.typeUrl || typeof o.ackResult === "string" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCAckSuccessAmino { + return o && (o.$typeUrl === EventBandIBCAckSuccess.typeUrl || typeof o.ack_result === "string" && typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCAckSuccess, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ackResult !== "") { + writer.uint32(10).string(message.ackResult); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(16).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCAckSuccess { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCAckSuccess(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ackResult = reader.string(); + break; + case 2: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCAckSuccess { + const message = createBaseEventBandIBCAckSuccess(); + message.ackResult = object.ackResult ?? ""; + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCAckSuccessAmino): EventBandIBCAckSuccess { + const message = createBaseEventBandIBCAckSuccess(); + if (object.ack_result !== undefined && object.ack_result !== null) { + message.ackResult = object.ack_result; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCAckSuccess): EventBandIBCAckSuccessAmino { + const obj: any = {}; + obj.ack_result = message.ackResult === "" ? undefined : message.ackResult; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCAckSuccessAminoMsg): EventBandIBCAckSuccess { + return EventBandIBCAckSuccess.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCAckSuccessProtoMsg): EventBandIBCAckSuccess { + return EventBandIBCAckSuccess.decode(message.value); + }, + toProto(message: EventBandIBCAckSuccess): Uint8Array { + return EventBandIBCAckSuccess.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCAckSuccess): EventBandIBCAckSuccessProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckSuccess", + value: EventBandIBCAckSuccess.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCAckSuccess.typeUrl, EventBandIBCAckSuccess); +function createBaseEventBandIBCAckError(): EventBandIBCAckError { + return { + ackError: "", + clientId: BigInt(0) + }; +} +export const EventBandIBCAckError = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError", + is(o: any): o is EventBandIBCAckError { + return o && (o.$typeUrl === EventBandIBCAckError.typeUrl || typeof o.ackError === "string" && typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCAckErrorAmino { + return o && (o.$typeUrl === EventBandIBCAckError.typeUrl || typeof o.ack_error === "string" && typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCAckError, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ackError !== "") { + writer.uint32(10).string(message.ackError); + } + if (message.clientId !== BigInt(0)) { + writer.uint32(16).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCAckError { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCAckError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ackError = reader.string(); + break; + case 2: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCAckError { + const message = createBaseEventBandIBCAckError(); + message.ackError = object.ackError ?? ""; + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCAckErrorAmino): EventBandIBCAckError { + const message = createBaseEventBandIBCAckError(); + if (object.ack_error !== undefined && object.ack_error !== null) { + message.ackError = object.ack_error; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCAckError): EventBandIBCAckErrorAmino { + const obj: any = {}; + obj.ack_error = message.ackError === "" ? undefined : message.ackError; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCAckErrorAminoMsg): EventBandIBCAckError { + return EventBandIBCAckError.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCAckErrorProtoMsg): EventBandIBCAckError { + return EventBandIBCAckError.decode(message.value); + }, + toProto(message: EventBandIBCAckError): Uint8Array { + return EventBandIBCAckError.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCAckError): EventBandIBCAckErrorProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCAckError", + value: EventBandIBCAckError.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCAckError.typeUrl, EventBandIBCAckError); +function createBaseEventBandIBCResponseTimeout(): EventBandIBCResponseTimeout { + return { + clientId: BigInt(0) + }; +} +export const EventBandIBCResponseTimeout = { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout", + is(o: any): o is EventBandIBCResponseTimeout { + return o && (o.$typeUrl === EventBandIBCResponseTimeout.typeUrl || typeof o.clientId === "bigint"); + }, + isAmino(o: any): o is EventBandIBCResponseTimeoutAmino { + return o && (o.$typeUrl === EventBandIBCResponseTimeout.typeUrl || typeof o.client_id === "bigint"); + }, + encode(message: EventBandIBCResponseTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== BigInt(0)) { + writer.uint32(8).int64(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBandIBCResponseTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBandIBCResponseTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBandIBCResponseTimeout { + const message = createBaseEventBandIBCResponseTimeout(); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBandIBCResponseTimeoutAmino): EventBandIBCResponseTimeout { + const message = createBaseEventBandIBCResponseTimeout(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + return message; + }, + toAmino(message: EventBandIBCResponseTimeout): EventBandIBCResponseTimeoutAmino { + const obj: any = {}; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBandIBCResponseTimeoutAminoMsg): EventBandIBCResponseTimeout { + return EventBandIBCResponseTimeout.fromAmino(object.value); + }, + fromProtoMsg(message: EventBandIBCResponseTimeoutProtoMsg): EventBandIBCResponseTimeout { + return EventBandIBCResponseTimeout.decode(message.value); + }, + toProto(message: EventBandIBCResponseTimeout): Uint8Array { + return EventBandIBCResponseTimeout.encode(message).finish(); + }, + toProtoMsg(message: EventBandIBCResponseTimeout): EventBandIBCResponseTimeoutProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventBandIBCResponseTimeout", + value: EventBandIBCResponseTimeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBandIBCResponseTimeout.typeUrl, EventBandIBCResponseTimeout); +function createBaseSetPriceFeedPriceEvent(): SetPriceFeedPriceEvent { + return { + relayer: "", + base: "", + quote: "", + price: "" + }; +} +export const SetPriceFeedPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent", + is(o: any): o is SetPriceFeedPriceEvent { + return o && (o.$typeUrl === SetPriceFeedPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.base === "string" && typeof o.quote === "string" && typeof o.price === "string"); + }, + isAmino(o: any): o is SetPriceFeedPriceEventAmino { + return o && (o.$typeUrl === SetPriceFeedPriceEvent.typeUrl || typeof o.relayer === "string" && typeof o.base === "string" && typeof o.quote === "string" && typeof o.price === "string"); + }, + encode(message: SetPriceFeedPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + if (message.base !== "") { + writer.uint32(18).string(message.base); + } + if (message.quote !== "") { + writer.uint32(26).string(message.quote); + } + if (message.price !== "") { + writer.uint32(34).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetPriceFeedPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetPriceFeedPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.base = reader.string(); + break; + case 3: + message.quote = reader.string(); + break; + case 4: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetPriceFeedPriceEvent { + const message = createBaseSetPriceFeedPriceEvent(); + message.relayer = object.relayer ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: SetPriceFeedPriceEventAmino): SetPriceFeedPriceEvent { + const message = createBaseSetPriceFeedPriceEvent(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: SetPriceFeedPriceEvent): SetPriceFeedPriceEventAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: SetPriceFeedPriceEventAminoMsg): SetPriceFeedPriceEvent { + return SetPriceFeedPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetPriceFeedPriceEventProtoMsg): SetPriceFeedPriceEvent { + return SetPriceFeedPriceEvent.decode(message.value); + }, + toProto(message: SetPriceFeedPriceEvent): Uint8Array { + return SetPriceFeedPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetPriceFeedPriceEvent): SetPriceFeedPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetPriceFeedPriceEvent", + value: SetPriceFeedPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetPriceFeedPriceEvent.typeUrl, SetPriceFeedPriceEvent); +function createBaseSetProviderPriceEvent(): SetProviderPriceEvent { + return { + provider: "", + relayer: "", + symbol: "", + price: "" + }; +} +export const SetProviderPriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent", + is(o: any): o is SetProviderPriceEvent { + return o && (o.$typeUrl === SetProviderPriceEvent.typeUrl || typeof o.provider === "string" && typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string"); + }, + isAmino(o: any): o is SetProviderPriceEventAmino { + return o && (o.$typeUrl === SetProviderPriceEvent.typeUrl || typeof o.provider === "string" && typeof o.relayer === "string" && typeof o.symbol === "string" && typeof o.price === "string"); + }, + encode(message: SetProviderPriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + if (message.relayer !== "") { + writer.uint32(18).string(message.relayer); + } + if (message.symbol !== "") { + writer.uint32(26).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(34).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetProviderPriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetProviderPriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.relayer = reader.string(); + break; + case 3: + message.symbol = reader.string(); + break; + case 4: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetProviderPriceEvent { + const message = createBaseSetProviderPriceEvent(); + message.provider = object.provider ?? ""; + message.relayer = object.relayer ?? ""; + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: SetProviderPriceEventAmino): SetProviderPriceEvent { + const message = createBaseSetProviderPriceEvent(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: SetProviderPriceEvent): SetProviderPriceEventAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: SetProviderPriceEventAminoMsg): SetProviderPriceEvent { + return SetProviderPriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetProviderPriceEventProtoMsg): SetProviderPriceEvent { + return SetProviderPriceEvent.decode(message.value); + }, + toProto(message: SetProviderPriceEvent): Uint8Array { + return SetProviderPriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetProviderPriceEvent): SetProviderPriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetProviderPriceEvent", + value: SetProviderPriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetProviderPriceEvent.typeUrl, SetProviderPriceEvent); +function createBaseSetCoinbasePriceEvent(): SetCoinbasePriceEvent { + return { + symbol: "", + price: "", + timestamp: BigInt(0) + }; +} +export const SetCoinbasePriceEvent = { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent", + is(o: any): o is SetCoinbasePriceEvent { + return o && (o.$typeUrl === SetCoinbasePriceEvent.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SetCoinbasePriceEventAmino { + return o && (o.$typeUrl === SetCoinbasePriceEvent.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SetCoinbasePriceEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetCoinbasePriceEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetCoinbasePriceEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SetCoinbasePriceEvent { + const message = createBaseSetCoinbasePriceEvent(); + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SetCoinbasePriceEventAmino): SetCoinbasePriceEvent { + const message = createBaseSetCoinbasePriceEvent(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SetCoinbasePriceEvent): SetCoinbasePriceEventAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SetCoinbasePriceEventAminoMsg): SetCoinbasePriceEvent { + return SetCoinbasePriceEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetCoinbasePriceEventProtoMsg): SetCoinbasePriceEvent { + return SetCoinbasePriceEvent.decode(message.value); + }, + toProto(message: SetCoinbasePriceEvent): Uint8Array { + return SetCoinbasePriceEvent.encode(message).finish(); + }, + toProtoMsg(message: SetCoinbasePriceEvent): SetCoinbasePriceEventProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SetCoinbasePriceEvent", + value: SetCoinbasePriceEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetCoinbasePriceEvent.typeUrl, SetCoinbasePriceEvent); +function createBaseEventSetStorkPrices(): EventSetStorkPrices { + return { + prices: [] + }; +} +export const EventSetStorkPrices = { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices", + is(o: any): o is EventSetStorkPrices { + return o && (o.$typeUrl === EventSetStorkPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || StorkPriceState.is(o.prices[0]))); + }, + isAmino(o: any): o is EventSetStorkPricesAmino { + return o && (o.$typeUrl === EventSetStorkPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || StorkPriceState.isAmino(o.prices[0]))); + }, + encode(message: EventSetStorkPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + StorkPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetStorkPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetStorkPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(StorkPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetStorkPrices { + const message = createBaseEventSetStorkPrices(); + message.prices = object.prices?.map(e => StorkPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventSetStorkPricesAmino): EventSetStorkPrices { + const message = createBaseEventSetStorkPrices(); + message.prices = object.prices?.map(e => StorkPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventSetStorkPrices): EventSetStorkPricesAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: EventSetStorkPricesAminoMsg): EventSetStorkPrices { + return EventSetStorkPrices.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetStorkPricesProtoMsg): EventSetStorkPrices { + return EventSetStorkPrices.decode(message.value); + }, + toProto(message: EventSetStorkPrices): Uint8Array { + return EventSetStorkPrices.encode(message).finish(); + }, + toProtoMsg(message: EventSetStorkPrices): EventSetStorkPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventSetStorkPrices", + value: EventSetStorkPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetStorkPrices.typeUrl, EventSetStorkPrices); +function createBaseEventSetPythPrices(): EventSetPythPrices { + return { + prices: [] + }; +} +export const EventSetPythPrices = { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices", + is(o: any): o is EventSetPythPrices { + return o && (o.$typeUrl === EventSetPythPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || PythPriceState.is(o.prices[0]))); + }, + isAmino(o: any): o is EventSetPythPricesAmino { + return o && (o.$typeUrl === EventSetPythPrices.typeUrl || Array.isArray(o.prices) && (!o.prices.length || PythPriceState.isAmino(o.prices[0]))); + }, + encode(message: EventSetPythPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + PythPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetPythPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetPythPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(PythPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetPythPrices { + const message = createBaseEventSetPythPrices(); + message.prices = object.prices?.map(e => PythPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventSetPythPricesAmino): EventSetPythPrices { + const message = createBaseEventSetPythPrices(); + message.prices = object.prices?.map(e => PythPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: EventSetPythPrices): EventSetPythPricesAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: EventSetPythPricesAminoMsg): EventSetPythPrices { + return EventSetPythPrices.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetPythPricesProtoMsg): EventSetPythPrices { + return EventSetPythPrices.decode(message.value); + }, + toProto(message: EventSetPythPrices): Uint8Array { + return EventSetPythPrices.encode(message).finish(); + }, + toProtoMsg(message: EventSetPythPrices): EventSetPythPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EventSetPythPrices", + value: EventSetPythPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetPythPrices.typeUrl, EventSetPythPrices); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/genesis.ts b/libs/injectivejs/src/injective/oracle/v1beta1/genesis.ts new file mode 100644 index 00000000..de88f8a9 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/genesis.ts @@ -0,0 +1,440 @@ +import { Params, ParamsAmino, BandPriceState, BandPriceStateAmino, PriceFeedState, PriceFeedStateAmino, CoinbasePriceState, CoinbasePriceStateAmino, BandOracleRequest, BandOracleRequestAmino, BandIBCParams, BandIBCParamsAmino, ChainlinkPriceState, ChainlinkPriceStateAmino, PriceRecords, PriceRecordsAmino, ProviderState, ProviderStateAmino, PythPriceState, PythPriceStateAmino, StorkPriceState, StorkPriceStateAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to oracle. */ + params: Params; + bandRelayers: string[]; + bandPriceStates: BandPriceState[]; + priceFeedPriceStates: PriceFeedState[]; + coinbasePriceStates: CoinbasePriceState[]; + bandIbcPriceStates: BandPriceState[]; + bandIbcOracleRequests: BandOracleRequest[]; + bandIbcParams: BandIBCParams; + bandIbcLatestClientId: bigint; + calldataRecords: CalldataRecord[]; + bandIbcLatestRequestId: bigint; + chainlinkPriceStates: ChainlinkPriceState[]; + historicalPriceRecords: PriceRecords[]; + providerStates: ProviderState[]; + pythPriceStates: PythPriceState[]; + storkPriceStates: StorkPriceState[]; + storkPublishers: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to oracle. */ + params: ParamsAmino; + band_relayers: string[]; + band_price_states: BandPriceStateAmino[]; + price_feed_price_states: PriceFeedStateAmino[]; + coinbase_price_states: CoinbasePriceStateAmino[]; + band_ibc_price_states: BandPriceStateAmino[]; + band_ibc_oracle_requests: BandOracleRequestAmino[]; + band_ibc_params: BandIBCParamsAmino; + band_ibc_latest_client_id: string; + calldata_records: CalldataRecordAmino[]; + band_ibc_latest_request_id: string; + chainlink_price_states: ChainlinkPriceStateAmino[]; + historical_price_records: PriceRecordsAmino[]; + provider_states: ProviderStateAmino[]; + pyth_price_states: PythPriceStateAmino[]; + stork_price_states: StorkPriceStateAmino[]; + stork_publishers: string[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.oracle.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface CalldataRecord { + clientId: bigint; + calldata: Uint8Array; +} +export interface CalldataRecordProtoMsg { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord"; + value: Uint8Array; +} +export interface CalldataRecordAmino { + client_id: string; + calldata: string; +} +export interface CalldataRecordAminoMsg { + type: "/injective.oracle.v1beta1.CalldataRecord"; + value: CalldataRecordAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + bandRelayers: [], + bandPriceStates: [], + priceFeedPriceStates: [], + coinbasePriceStates: [], + bandIbcPriceStates: [], + bandIbcOracleRequests: [], + bandIbcParams: BandIBCParams.fromPartial({}), + bandIbcLatestClientId: BigInt(0), + calldataRecords: [], + bandIbcLatestRequestId: BigInt(0), + chainlinkPriceStates: [], + historicalPriceRecords: [], + providerStates: [], + pythPriceStates: [], + storkPriceStates: [], + storkPublishers: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.oracle.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.bandRelayers) && (!o.bandRelayers.length || typeof o.bandRelayers[0] === "string") && Array.isArray(o.bandPriceStates) && (!o.bandPriceStates.length || BandPriceState.is(o.bandPriceStates[0])) && Array.isArray(o.priceFeedPriceStates) && (!o.priceFeedPriceStates.length || PriceFeedState.is(o.priceFeedPriceStates[0])) && Array.isArray(o.coinbasePriceStates) && (!o.coinbasePriceStates.length || CoinbasePriceState.is(o.coinbasePriceStates[0])) && Array.isArray(o.bandIbcPriceStates) && (!o.bandIbcPriceStates.length || BandPriceState.is(o.bandIbcPriceStates[0])) && Array.isArray(o.bandIbcOracleRequests) && (!o.bandIbcOracleRequests.length || BandOracleRequest.is(o.bandIbcOracleRequests[0])) && BandIBCParams.is(o.bandIbcParams) && typeof o.bandIbcLatestClientId === "bigint" && Array.isArray(o.calldataRecords) && (!o.calldataRecords.length || CalldataRecord.is(o.calldataRecords[0])) && typeof o.bandIbcLatestRequestId === "bigint" && Array.isArray(o.chainlinkPriceStates) && (!o.chainlinkPriceStates.length || ChainlinkPriceState.is(o.chainlinkPriceStates[0])) && Array.isArray(o.historicalPriceRecords) && (!o.historicalPriceRecords.length || PriceRecords.is(o.historicalPriceRecords[0])) && Array.isArray(o.providerStates) && (!o.providerStates.length || ProviderState.is(o.providerStates[0])) && Array.isArray(o.pythPriceStates) && (!o.pythPriceStates.length || PythPriceState.is(o.pythPriceStates[0])) && Array.isArray(o.storkPriceStates) && (!o.storkPriceStates.length || StorkPriceState.is(o.storkPriceStates[0])) && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.band_relayers) && (!o.band_relayers.length || typeof o.band_relayers[0] === "string") && Array.isArray(o.band_price_states) && (!o.band_price_states.length || BandPriceState.isAmino(o.band_price_states[0])) && Array.isArray(o.price_feed_price_states) && (!o.price_feed_price_states.length || PriceFeedState.isAmino(o.price_feed_price_states[0])) && Array.isArray(o.coinbase_price_states) && (!o.coinbase_price_states.length || CoinbasePriceState.isAmino(o.coinbase_price_states[0])) && Array.isArray(o.band_ibc_price_states) && (!o.band_ibc_price_states.length || BandPriceState.isAmino(o.band_ibc_price_states[0])) && Array.isArray(o.band_ibc_oracle_requests) && (!o.band_ibc_oracle_requests.length || BandOracleRequest.isAmino(o.band_ibc_oracle_requests[0])) && BandIBCParams.isAmino(o.band_ibc_params) && typeof o.band_ibc_latest_client_id === "bigint" && Array.isArray(o.calldata_records) && (!o.calldata_records.length || CalldataRecord.isAmino(o.calldata_records[0])) && typeof o.band_ibc_latest_request_id === "bigint" && Array.isArray(o.chainlink_price_states) && (!o.chainlink_price_states.length || ChainlinkPriceState.isAmino(o.chainlink_price_states[0])) && Array.isArray(o.historical_price_records) && (!o.historical_price_records.length || PriceRecords.isAmino(o.historical_price_records[0])) && Array.isArray(o.provider_states) && (!o.provider_states.length || ProviderState.isAmino(o.provider_states[0])) && Array.isArray(o.pyth_price_states) && (!o.pyth_price_states.length || PythPriceState.isAmino(o.pyth_price_states[0])) && Array.isArray(o.stork_price_states) && (!o.stork_price_states.length || StorkPriceState.isAmino(o.stork_price_states[0])) && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + 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.bandRelayers) { + writer.uint32(18).string(v!); + } + for (const v of message.bandPriceStates) { + BandPriceState.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.priceFeedPriceStates) { + PriceFeedState.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.coinbasePriceStates) { + CoinbasePriceState.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.bandIbcPriceStates) { + BandPriceState.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.bandIbcOracleRequests) { + BandOracleRequest.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.bandIbcParams !== undefined) { + BandIBCParams.encode(message.bandIbcParams, writer.uint32(66).fork()).ldelim(); + } + if (message.bandIbcLatestClientId !== BigInt(0)) { + writer.uint32(72).uint64(message.bandIbcLatestClientId); + } + for (const v of message.calldataRecords) { + CalldataRecord.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.bandIbcLatestRequestId !== BigInt(0)) { + writer.uint32(88).uint64(message.bandIbcLatestRequestId); + } + for (const v of message.chainlinkPriceStates) { + ChainlinkPriceState.encode(v!, writer.uint32(98).fork()).ldelim(); + } + for (const v of message.historicalPriceRecords) { + PriceRecords.encode(v!, writer.uint32(106).fork()).ldelim(); + } + for (const v of message.providerStates) { + ProviderState.encode(v!, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.pythPriceStates) { + PythPriceState.encode(v!, writer.uint32(122).fork()).ldelim(); + } + for (const v of message.storkPriceStates) { + StorkPriceState.encode(v!, writer.uint32(130).fork()).ldelim(); + } + for (const v of message.storkPublishers) { + writer.uint32(138).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.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.bandRelayers.push(reader.string()); + break; + case 3: + message.bandPriceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + case 4: + message.priceFeedPriceStates.push(PriceFeedState.decode(reader, reader.uint32())); + break; + case 5: + message.coinbasePriceStates.push(CoinbasePriceState.decode(reader, reader.uint32())); + break; + case 6: + message.bandIbcPriceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + case 7: + message.bandIbcOracleRequests.push(BandOracleRequest.decode(reader, reader.uint32())); + break; + case 8: + message.bandIbcParams = BandIBCParams.decode(reader, reader.uint32()); + break; + case 9: + message.bandIbcLatestClientId = reader.uint64(); + break; + case 10: + message.calldataRecords.push(CalldataRecord.decode(reader, reader.uint32())); + break; + case 11: + message.bandIbcLatestRequestId = reader.uint64(); + break; + case 12: + message.chainlinkPriceStates.push(ChainlinkPriceState.decode(reader, reader.uint32())); + break; + case 13: + message.historicalPriceRecords.push(PriceRecords.decode(reader, reader.uint32())); + break; + case 14: + message.providerStates.push(ProviderState.decode(reader, reader.uint32())); + break; + case 15: + message.pythPriceStates.push(PythPriceState.decode(reader, reader.uint32())); + break; + case 16: + message.storkPriceStates.push(StorkPriceState.decode(reader, reader.uint32())); + break; + case 17: + message.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.bandRelayers = object.bandRelayers?.map(e => e) || []; + message.bandPriceStates = object.bandPriceStates?.map(e => BandPriceState.fromPartial(e)) || []; + message.priceFeedPriceStates = object.priceFeedPriceStates?.map(e => PriceFeedState.fromPartial(e)) || []; + message.coinbasePriceStates = object.coinbasePriceStates?.map(e => CoinbasePriceState.fromPartial(e)) || []; + message.bandIbcPriceStates = object.bandIbcPriceStates?.map(e => BandPriceState.fromPartial(e)) || []; + message.bandIbcOracleRequests = object.bandIbcOracleRequests?.map(e => BandOracleRequest.fromPartial(e)) || []; + message.bandIbcParams = object.bandIbcParams !== undefined && object.bandIbcParams !== null ? BandIBCParams.fromPartial(object.bandIbcParams) : undefined; + message.bandIbcLatestClientId = object.bandIbcLatestClientId !== undefined && object.bandIbcLatestClientId !== null ? BigInt(object.bandIbcLatestClientId.toString()) : BigInt(0); + message.calldataRecords = object.calldataRecords?.map(e => CalldataRecord.fromPartial(e)) || []; + message.bandIbcLatestRequestId = object.bandIbcLatestRequestId !== undefined && object.bandIbcLatestRequestId !== null ? BigInt(object.bandIbcLatestRequestId.toString()) : BigInt(0); + message.chainlinkPriceStates = object.chainlinkPriceStates?.map(e => ChainlinkPriceState.fromPartial(e)) || []; + message.historicalPriceRecords = object.historicalPriceRecords?.map(e => PriceRecords.fromPartial(e)) || []; + message.providerStates = object.providerStates?.map(e => ProviderState.fromPartial(e)) || []; + message.pythPriceStates = object.pythPriceStates?.map(e => PythPriceState.fromPartial(e)) || []; + message.storkPriceStates = object.storkPriceStates?.map(e => StorkPriceState.fromPartial(e)) || []; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.bandRelayers = object.band_relayers?.map(e => e) || []; + message.bandPriceStates = object.band_price_states?.map(e => BandPriceState.fromAmino(e)) || []; + message.priceFeedPriceStates = object.price_feed_price_states?.map(e => PriceFeedState.fromAmino(e)) || []; + message.coinbasePriceStates = object.coinbase_price_states?.map(e => CoinbasePriceState.fromAmino(e)) || []; + message.bandIbcPriceStates = object.band_ibc_price_states?.map(e => BandPriceState.fromAmino(e)) || []; + message.bandIbcOracleRequests = object.band_ibc_oracle_requests?.map(e => BandOracleRequest.fromAmino(e)) || []; + if (object.band_ibc_params !== undefined && object.band_ibc_params !== null) { + message.bandIbcParams = BandIBCParams.fromAmino(object.band_ibc_params); + } + if (object.band_ibc_latest_client_id !== undefined && object.band_ibc_latest_client_id !== null) { + message.bandIbcLatestClientId = BigInt(object.band_ibc_latest_client_id); + } + message.calldataRecords = object.calldata_records?.map(e => CalldataRecord.fromAmino(e)) || []; + if (object.band_ibc_latest_request_id !== undefined && object.band_ibc_latest_request_id !== null) { + message.bandIbcLatestRequestId = BigInt(object.band_ibc_latest_request_id); + } + message.chainlinkPriceStates = object.chainlink_price_states?.map(e => ChainlinkPriceState.fromAmino(e)) || []; + message.historicalPriceRecords = object.historical_price_records?.map(e => PriceRecords.fromAmino(e)) || []; + message.providerStates = object.provider_states?.map(e => ProviderState.fromAmino(e)) || []; + message.pythPriceStates = object.pyth_price_states?.map(e => PythPriceState.fromAmino(e)) || []; + message.storkPriceStates = object.stork_price_states?.map(e => StorkPriceState.fromAmino(e)) || []; + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.bandRelayers) { + obj.band_relayers = message.bandRelayers.map(e => e); + } else { + obj.band_relayers = message.bandRelayers; + } + if (message.bandPriceStates) { + obj.band_price_states = message.bandPriceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.band_price_states = message.bandPriceStates; + } + if (message.priceFeedPriceStates) { + obj.price_feed_price_states = message.priceFeedPriceStates.map(e => e ? PriceFeedState.toAmino(e) : undefined); + } else { + obj.price_feed_price_states = message.priceFeedPriceStates; + } + if (message.coinbasePriceStates) { + obj.coinbase_price_states = message.coinbasePriceStates.map(e => e ? CoinbasePriceState.toAmino(e) : undefined); + } else { + obj.coinbase_price_states = message.coinbasePriceStates; + } + if (message.bandIbcPriceStates) { + obj.band_ibc_price_states = message.bandIbcPriceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.band_ibc_price_states = message.bandIbcPriceStates; + } + if (message.bandIbcOracleRequests) { + obj.band_ibc_oracle_requests = message.bandIbcOracleRequests.map(e => e ? BandOracleRequest.toAmino(e) : undefined); + } else { + obj.band_ibc_oracle_requests = message.bandIbcOracleRequests; + } + obj.band_ibc_params = message.bandIbcParams ? BandIBCParams.toAmino(message.bandIbcParams) : undefined; + obj.band_ibc_latest_client_id = message.bandIbcLatestClientId !== BigInt(0) ? message.bandIbcLatestClientId?.toString() : undefined; + if (message.calldataRecords) { + obj.calldata_records = message.calldataRecords.map(e => e ? CalldataRecord.toAmino(e) : undefined); + } else { + obj.calldata_records = message.calldataRecords; + } + obj.band_ibc_latest_request_id = message.bandIbcLatestRequestId !== BigInt(0) ? message.bandIbcLatestRequestId?.toString() : undefined; + if (message.chainlinkPriceStates) { + obj.chainlink_price_states = message.chainlinkPriceStates.map(e => e ? ChainlinkPriceState.toAmino(e) : undefined); + } else { + obj.chainlink_price_states = message.chainlinkPriceStates; + } + if (message.historicalPriceRecords) { + obj.historical_price_records = message.historicalPriceRecords.map(e => e ? PriceRecords.toAmino(e) : undefined); + } else { + obj.historical_price_records = message.historicalPriceRecords; + } + if (message.providerStates) { + obj.provider_states = message.providerStates.map(e => e ? ProviderState.toAmino(e) : undefined); + } else { + obj.provider_states = message.providerStates; + } + if (message.pythPriceStates) { + obj.pyth_price_states = message.pythPriceStates.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.pyth_price_states = message.pythPriceStates; + } + if (message.storkPriceStates) { + obj.stork_price_states = message.storkPriceStates.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.stork_price_states = message.storkPriceStates; + } + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + 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: "/injective.oracle.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseCalldataRecord(): CalldataRecord { + return { + clientId: BigInt(0), + calldata: new Uint8Array() + }; +} +export const CalldataRecord = { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord", + is(o: any): o is CalldataRecord { + return o && (o.$typeUrl === CalldataRecord.typeUrl || typeof o.clientId === "bigint" && (o.calldata instanceof Uint8Array || typeof o.calldata === "string")); + }, + isAmino(o: any): o is CalldataRecordAmino { + return o && (o.$typeUrl === CalldataRecord.typeUrl || typeof o.client_id === "bigint" && (o.calldata instanceof Uint8Array || typeof o.calldata === "string")); + }, + encode(message: CalldataRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== BigInt(0)) { + writer.uint32(8).uint64(message.clientId); + } + if (message.calldata.length !== 0) { + writer.uint32(18).bytes(message.calldata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CalldataRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalldataRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.uint64(); + break; + case 2: + message.calldata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CalldataRecord { + const message = createBaseCalldataRecord(); + message.clientId = object.clientId !== undefined && object.clientId !== null ? BigInt(object.clientId.toString()) : BigInt(0); + message.calldata = object.calldata ?? new Uint8Array(); + return message; + }, + fromAmino(object: CalldataRecordAmino): CalldataRecord { + const message = createBaseCalldataRecord(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = BigInt(object.client_id); + } + if (object.calldata !== undefined && object.calldata !== null) { + message.calldata = bytesFromBase64(object.calldata); + } + return message; + }, + toAmino(message: CalldataRecord): CalldataRecordAmino { + const obj: any = {}; + obj.client_id = message.clientId !== BigInt(0) ? message.clientId?.toString() : undefined; + obj.calldata = message.calldata ? base64FromBytes(message.calldata) : undefined; + return obj; + }, + fromAminoMsg(object: CalldataRecordAminoMsg): CalldataRecord { + return CalldataRecord.fromAmino(object.value); + }, + fromProtoMsg(message: CalldataRecordProtoMsg): CalldataRecord { + return CalldataRecord.decode(message.value); + }, + toProto(message: CalldataRecord): Uint8Array { + return CalldataRecord.encode(message).finish(); + }, + toProtoMsg(message: CalldataRecord): CalldataRecordProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.CalldataRecord", + value: CalldataRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CalldataRecord.typeUrl, CalldataRecord); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/oracle.ts b/libs/injectivejs/src/injective/oracle/v1beta1/oracle.ts new file mode 100644 index 00000000..36616d68 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/oracle.ts @@ -0,0 +1,3206 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OracleType { + Unspecified = 0, + Band = 1, + PriceFeed = 2, + Coinbase = 3, + Chainlink = 4, + Razor = 5, + Dia = 6, + API3 = 7, + Uma = 8, + Pyth = 9, + BandIBC = 10, + Provider = 11, + Stork = 12, + UNRECOGNIZED = -1, +} +export const OracleTypeAmino = OracleType; +export function oracleTypeFromJSON(object: any): OracleType { + switch (object) { + case 0: + case "Unspecified": + return OracleType.Unspecified; + case 1: + case "Band": + return OracleType.Band; + case 2: + case "PriceFeed": + return OracleType.PriceFeed; + case 3: + case "Coinbase": + return OracleType.Coinbase; + case 4: + case "Chainlink": + return OracleType.Chainlink; + case 5: + case "Razor": + return OracleType.Razor; + case 6: + case "Dia": + return OracleType.Dia; + case 7: + case "API3": + return OracleType.API3; + case 8: + case "Uma": + return OracleType.Uma; + case 9: + case "Pyth": + return OracleType.Pyth; + case 10: + case "BandIBC": + return OracleType.BandIBC; + case 11: + case "Provider": + return OracleType.Provider; + case 12: + case "Stork": + return OracleType.Stork; + case -1: + case "UNRECOGNIZED": + default: + return OracleType.UNRECOGNIZED; + } +} +export function oracleTypeToJSON(object: OracleType): string { + switch (object) { + case OracleType.Unspecified: + return "Unspecified"; + case OracleType.Band: + return "Band"; + case OracleType.PriceFeed: + return "PriceFeed"; + case OracleType.Coinbase: + return "Coinbase"; + case OracleType.Chainlink: + return "Chainlink"; + case OracleType.Razor: + return "Razor"; + case OracleType.Dia: + return "Dia"; + case OracleType.API3: + return "API3"; + case OracleType.Uma: + return "Uma"; + case OracleType.Pyth: + return "Pyth"; + case OracleType.BandIBC: + return "BandIBC"; + case OracleType.Provider: + return "Provider"; + case OracleType.Stork: + return "Stork"; + case OracleType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Params { + pythContract: string; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + pyth_contract: string; +} +export interface ParamsAminoMsg { + type: "oracle/Params"; + value: ParamsAmino; +} +export interface OracleInfo { + symbol: string; + oracleType: OracleType; +} +export interface OracleInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.OracleInfo"; + value: Uint8Array; +} +export interface OracleInfoAmino { + symbol: string; + oracle_type: OracleType; +} +export interface OracleInfoAminoMsg { + type: "/injective.oracle.v1beta1.OracleInfo"; + value: OracleInfoAmino; +} +export interface ChainlinkPriceState { + feedId: string; + answer: string; + timestamp: bigint; + priceState: PriceState; +} +export interface ChainlinkPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState"; + value: Uint8Array; +} +export interface ChainlinkPriceStateAmino { + feed_id: string; + answer: string; + timestamp: string; + price_state: PriceStateAmino; +} +export interface ChainlinkPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.ChainlinkPriceState"; + value: ChainlinkPriceStateAmino; +} +export interface BandPriceState { + symbol: string; + rate: string; + resolveTime: bigint; + requestID: bigint; + priceState: PriceState; +} +export interface BandPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandPriceState"; + value: Uint8Array; +} +export interface BandPriceStateAmino { + symbol: string; + rate: string; + resolve_time: string; + request_ID: string; + price_state: PriceStateAmino; +} +export interface BandPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.BandPriceState"; + value: BandPriceStateAmino; +} +export interface PriceFeedState { + base: string; + quote: string; + priceState?: PriceState; + relayers: string[]; +} +export interface PriceFeedStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState"; + value: Uint8Array; +} +export interface PriceFeedStateAmino { + base: string; + quote: string; + price_state?: PriceStateAmino; + relayers: string[]; +} +export interface PriceFeedStateAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedState"; + value: PriceFeedStateAmino; +} +export interface ProviderInfo { + provider: string; + relayers: string[]; +} +export interface ProviderInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo"; + value: Uint8Array; +} +export interface ProviderInfoAmino { + provider: string; + relayers: string[]; +} +export interface ProviderInfoAminoMsg { + type: "/injective.oracle.v1beta1.ProviderInfo"; + value: ProviderInfoAmino; +} +export interface ProviderState { + providerInfo?: ProviderInfo; + providerPriceStates: ProviderPriceState[]; +} +export interface ProviderStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderState"; + value: Uint8Array; +} +export interface ProviderStateAmino { + provider_info?: ProviderInfoAmino; + provider_price_states: ProviderPriceStateAmino[]; +} +export interface ProviderStateAminoMsg { + type: "/injective.oracle.v1beta1.ProviderState"; + value: ProviderStateAmino; +} +export interface ProviderPriceState { + symbol: string; + state?: PriceState; +} +export interface ProviderPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState"; + value: Uint8Array; +} +export interface ProviderPriceStateAmino { + symbol: string; + state?: PriceStateAmino; +} +export interface ProviderPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.ProviderPriceState"; + value: ProviderPriceStateAmino; +} +export interface PriceFeedInfo { + base: string; + quote: string; +} +export interface PriceFeedInfoProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo"; + value: Uint8Array; +} +export interface PriceFeedInfoAmino { + base: string; + quote: string; +} +export interface PriceFeedInfoAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedInfo"; + value: PriceFeedInfoAmino; +} +export interface PriceFeedPrice { + price: string; +} +export interface PriceFeedPriceProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice"; + value: Uint8Array; +} +export interface PriceFeedPriceAmino { + price: string; +} +export interface PriceFeedPriceAminoMsg { + type: "/injective.oracle.v1beta1.PriceFeedPrice"; + value: PriceFeedPriceAmino; +} +export interface CoinbasePriceState { + /** kind should always be "prices" */ + kind: string; + /** timestamp of the when the price was signed by coinbase */ + timestamp: bigint; + /** the symbol of the price, e.g. BTC */ + key: string; + /** the value of the price scaled by 1e6 */ + value: bigint; + /** the price state */ + priceState: PriceState; +} +export interface CoinbasePriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState"; + value: Uint8Array; +} +export interface CoinbasePriceStateAmino { + /** kind should always be "prices" */ + kind: string; + /** timestamp of the when the price was signed by coinbase */ + timestamp: string; + /** the symbol of the price, e.g. BTC */ + key: string; + /** the value of the price scaled by 1e6 */ + value: string; + /** the price state */ + price_state: PriceStateAmino; +} +export interface CoinbasePriceStateAminoMsg { + type: "/injective.oracle.v1beta1.CoinbasePriceState"; + value: CoinbasePriceStateAmino; +} +export interface StorkPriceState { + /** timestamp of the when the price was signed by stork */ + timestamp: bigint; + /** the symbol of the price, e.g. BTC */ + symbol: string; + /** the value of the price scaled by 1e18 */ + value: string; + /** the price state */ + priceState: PriceState; +} +export interface StorkPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState"; + value: Uint8Array; +} +export interface StorkPriceStateAmino { + /** timestamp of the when the price was signed by stork */ + timestamp: string; + /** the symbol of the price, e.g. BTC */ + symbol: string; + /** the value of the price scaled by 1e18 */ + value: string; + /** the price state */ + price_state: PriceStateAmino; +} +export interface StorkPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.StorkPriceState"; + value: StorkPriceStateAmino; +} +export interface PriceState { + price: string; + cumulativePrice: string; + timestamp: bigint; +} +export interface PriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceState"; + value: Uint8Array; +} +export interface PriceStateAmino { + price: string; + cumulative_price: string; + timestamp: string; +} +export interface PriceStateAminoMsg { + type: "/injective.oracle.v1beta1.PriceState"; + value: PriceStateAmino; +} +export interface PythPriceState { + priceId: string; + emaPrice: string; + emaConf: string; + conf: string; + publishTime: bigint; + priceState: PriceState; +} +export interface PythPriceStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PythPriceState"; + value: Uint8Array; +} +export interface PythPriceStateAmino { + price_id: string; + ema_price: string; + ema_conf: string; + conf: string; + publish_time: string; + price_state: PriceStateAmino; +} +export interface PythPriceStateAminoMsg { + type: "/injective.oracle.v1beta1.PythPriceState"; + value: PythPriceStateAmino; +} +export interface BandOracleRequest { + /** Unique Identifier for band ibc oracle request */ + requestId: bigint; + /** + * OracleScriptID is the unique identifier of the oracle script to be + * executed. + */ + oracleScriptId: bigint; + /** Symbols is the list of symbols to prepare in the calldata */ + symbols: string[]; + /** + * AskCount is the number of validators that are requested to respond to this + * oracle request. Higher value means more security, at a higher gas cost. + */ + askCount: bigint; + /** + * MinCount is the minimum number of validators necessary for the request to + * proceed to the execution phase. Higher value means more security, at the + * cost of liveness. + */ + minCount: bigint; + /** + * FeeLimit is the maximum tokens that will be paid to all data source + * providers. + */ + feeLimit: Coin[]; + /** PrepareGas is amount of gas to pay to prepare raw requests */ + prepareGas: bigint; + /** ExecuteGas is amount of gas to reserve for executing */ + executeGas: bigint; + /** + * MinSourceCount is the minimum number of data sources that must be used by + * each validator + */ + minSourceCount: bigint; +} +export interface BandOracleRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest"; + value: Uint8Array; +} +export interface BandOracleRequestAmino { + /** Unique Identifier for band ibc oracle request */ + request_id: string; + /** + * OracleScriptID is the unique identifier of the oracle script to be + * executed. + */ + oracle_script_id: string; + /** Symbols is the list of symbols to prepare in the calldata */ + symbols: string[]; + /** + * AskCount is the number of validators that are requested to respond to this + * oracle request. Higher value means more security, at a higher gas cost. + */ + ask_count: string; + /** + * MinCount is the minimum number of validators necessary for the request to + * proceed to the execution phase. Higher value means more security, at the + * cost of liveness. + */ + min_count: string; + /** + * FeeLimit is the maximum tokens that will be paid to all data source + * providers. + */ + fee_limit: CoinAmino[]; + /** PrepareGas is amount of gas to pay to prepare raw requests */ + prepare_gas: string; + /** ExecuteGas is amount of gas to reserve for executing */ + execute_gas: string; + /** + * MinSourceCount is the minimum number of data sources that must be used by + * each validator + */ + min_source_count: string; +} +export interface BandOracleRequestAminoMsg { + type: "/injective.oracle.v1beta1.BandOracleRequest"; + value: BandOracleRequestAmino; +} +export interface BandIBCParams { + /** true if Band IBC should be enabled */ + bandIbcEnabled: boolean; + /** block request interval to send Band IBC prices */ + ibcRequestInterval: bigint; + /** band IBC source channel */ + ibcSourceChannel: string; + /** band IBC version */ + ibcVersion: string; + /** band IBC portID */ + ibcPortId: string; + /** legacy oracle scheme ids */ + legacyOracleIds: bigint[]; +} +export interface BandIBCParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams"; + value: Uint8Array; +} +export interface BandIBCParamsAmino { + /** true if Band IBC should be enabled */ + band_ibc_enabled: boolean; + /** block request interval to send Band IBC prices */ + ibc_request_interval: string; + /** band IBC source channel */ + ibc_source_channel: string; + /** band IBC version */ + ibc_version: string; + /** band IBC portID */ + ibc_port_id: string; + /** legacy oracle scheme ids */ + legacy_oracle_ids: string[]; +} +export interface BandIBCParamsAminoMsg { + type: "/injective.oracle.v1beta1.BandIBCParams"; + value: BandIBCParamsAmino; +} +export interface SymbolPriceTimestamp { + oracle: OracleType; + symbolId: string; + timestamp: bigint; +} +export interface SymbolPriceTimestampProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp"; + value: Uint8Array; +} +export interface SymbolPriceTimestampAmino { + oracle: OracleType; + symbol_id: string; + timestamp: string; +} +export interface SymbolPriceTimestampAminoMsg { + type: "/injective.oracle.v1beta1.SymbolPriceTimestamp"; + value: SymbolPriceTimestampAmino; +} +export interface LastPriceTimestamps { + lastPriceTimestamps: SymbolPriceTimestamp[]; +} +export interface LastPriceTimestampsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps"; + value: Uint8Array; +} +export interface LastPriceTimestampsAmino { + last_price_timestamps: SymbolPriceTimestampAmino[]; +} +export interface LastPriceTimestampsAminoMsg { + type: "/injective.oracle.v1beta1.LastPriceTimestamps"; + value: LastPriceTimestampsAmino; +} +export interface PriceRecords { + oracle: OracleType; + symbolId: string; + latestPriceRecords: PriceRecord[]; +} +export interface PriceRecordsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceRecords"; + value: Uint8Array; +} +export interface PriceRecordsAmino { + oracle: OracleType; + symbol_id: string; + latest_price_records: PriceRecordAmino[]; +} +export interface PriceRecordsAminoMsg { + type: "/injective.oracle.v1beta1.PriceRecords"; + value: PriceRecordsAmino; +} +export interface PriceRecord { + timestamp: bigint; + price: string; +} +export interface PriceRecordProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceRecord"; + value: Uint8Array; +} +export interface PriceRecordAmino { + timestamp: string; + price: string; +} +export interface PriceRecordAminoMsg { + type: "/injective.oracle.v1beta1.PriceRecord"; + value: PriceRecordAmino; +} +/** + * MetadataStatistics refers to the metadata summary statistics of the + * historical sample considered + */ +export interface MetadataStatistics { + /** + * GroupCount refers to the number of groups used. Equals RecordsSampleSize if + * no grouping is used + */ + groupCount: number; + /** RecordsSampleSize refers to the total number of records used. */ + recordsSampleSize: number; + /** + * Mean refers to the arithmetic mean + * For trades, the mean is the VWAP computed over the grouped trade records ∑ + * (price * quantity) / ∑ quantity For oracle prices, the mean is computed + * over the price records ∑ (price) / prices_count + */ + mean: string; + /** + * TWAP refers to the time-weighted average price which equals ∑ (price_i * + * ∆t_i) / ∑ ∆t_i where ∆t_i = t_i - t_{i-1} + */ + twap: string; + /** FirstTimestamp is the timestamp of the oldest record considered */ + firstTimestamp: bigint; + /** LastTimestamp is the timestamp of the youngest record considered */ + lastTimestamp: bigint; + /** MinPrice refers to the smallest individual raw price considered */ + minPrice: string; + /** MaxPrice refers to the largest individual raw price considered */ + maxPrice: string; + /** MedianPrice refers to the median individual raw price considered */ + medianPrice: string; +} +export interface MetadataStatisticsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics"; + value: Uint8Array; +} +/** + * MetadataStatistics refers to the metadata summary statistics of the + * historical sample considered + */ +export interface MetadataStatisticsAmino { + /** + * GroupCount refers to the number of groups used. Equals RecordsSampleSize if + * no grouping is used + */ + group_count: number; + /** RecordsSampleSize refers to the total number of records used. */ + records_sample_size: number; + /** + * Mean refers to the arithmetic mean + * For trades, the mean is the VWAP computed over the grouped trade records ∑ + * (price * quantity) / ∑ quantity For oracle prices, the mean is computed + * over the price records ∑ (price) / prices_count + */ + mean: string; + /** + * TWAP refers to the time-weighted average price which equals ∑ (price_i * + * ∆t_i) / ∑ ∆t_i where ∆t_i = t_i - t_{i-1} + */ + twap: string; + /** FirstTimestamp is the timestamp of the oldest record considered */ + first_timestamp: string; + /** LastTimestamp is the timestamp of the youngest record considered */ + last_timestamp: string; + /** MinPrice refers to the smallest individual raw price considered */ + min_price: string; + /** MaxPrice refers to the largest individual raw price considered */ + max_price: string; + /** MedianPrice refers to the median individual raw price considered */ + median_price: string; +} +export interface MetadataStatisticsAminoMsg { + type: "/injective.oracle.v1beta1.MetadataStatistics"; + value: MetadataStatisticsAmino; +} +export interface PriceAttestation { + priceId: string; + /** MaxPrice refers to the largest individual raw price considered */ + price: bigint; + conf: bigint; + expo: number; + emaPrice: bigint; + emaConf: bigint; + emaExpo: number; + publishTime: bigint; +} +export interface PriceAttestationProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation"; + value: Uint8Array; +} +export interface PriceAttestationAmino { + price_id: string; + /** MaxPrice refers to the largest individual raw price considered */ + price: string; + conf: string; + expo: number; + ema_price: string; + ema_conf: string; + ema_expo: number; + publish_time: string; +} +export interface PriceAttestationAminoMsg { + type: "/injective.oracle.v1beta1.PriceAttestation"; + value: PriceAttestationAmino; +} +export interface AssetPair { + assetId: string; + signedPrices: SignedPriceOfAssetPair[]; +} +export interface AssetPairProtoMsg { + typeUrl: "/injective.oracle.v1beta1.AssetPair"; + value: Uint8Array; +} +export interface AssetPairAmino { + asset_id: string; + signed_prices: SignedPriceOfAssetPairAmino[]; +} +export interface AssetPairAminoMsg { + type: "/injective.oracle.v1beta1.AssetPair"; + value: AssetPairAmino; +} +export interface SignedPriceOfAssetPair { + publisherKey: string; + timestamp: bigint; + price: string; + signature: Uint8Array; +} +export interface SignedPriceOfAssetPairProtoMsg { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair"; + value: Uint8Array; +} +export interface SignedPriceOfAssetPairAmino { + publisher_key: string; + timestamp: string; + price: string; + signature: string; +} +export interface SignedPriceOfAssetPairAminoMsg { + type: "/injective.oracle.v1beta1.SignedPriceOfAssetPair"; + value: SignedPriceOfAssetPairAmino; +} +function createBaseParams(): Params { + return { + pythContract: "" + }; +} +export const Params = { + typeUrl: "/injective.oracle.v1beta1.Params", + aminoType: "oracle/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.pythContract === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.pyth_contract === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pythContract !== "") { + writer.uint32(10).string(message.pythContract); + } + 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.pythContract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.pythContract = object.pythContract ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.pyth_contract !== undefined && object.pyth_contract !== null) { + message.pythContract = object.pyth_contract; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.pyth_contract = message.pythContract === "" ? undefined : message.pythContract; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "oracle/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: "/injective.oracle.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseOracleInfo(): OracleInfo { + return { + symbol: "", + oracleType: 0 + }; +} +export const OracleInfo = { + typeUrl: "/injective.oracle.v1beta1.OracleInfo", + is(o: any): o is OracleInfo { + return o && (o.$typeUrl === OracleInfo.typeUrl || typeof o.symbol === "string" && isSet(o.oracleType)); + }, + isAmino(o: any): o is OracleInfoAmino { + return o && (o.$typeUrl === OracleInfo.typeUrl || typeof o.symbol === "string" && isSet(o.oracle_type)); + }, + encode(message: OracleInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.oracleType !== 0) { + writer.uint32(16).int32(message.oracleType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.oracleType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleInfo { + const message = createBaseOracleInfo(); + message.symbol = object.symbol ?? ""; + message.oracleType = object.oracleType ?? 0; + return message; + }, + fromAmino(object: OracleInfoAmino): OracleInfo { + const message = createBaseOracleInfo(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + return message; + }, + toAmino(message: OracleInfo): OracleInfoAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + return obj; + }, + fromAminoMsg(object: OracleInfoAminoMsg): OracleInfo { + return OracleInfo.fromAmino(object.value); + }, + fromProtoMsg(message: OracleInfoProtoMsg): OracleInfo { + return OracleInfo.decode(message.value); + }, + toProto(message: OracleInfo): Uint8Array { + return OracleInfo.encode(message).finish(); + }, + toProtoMsg(message: OracleInfo): OracleInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.OracleInfo", + value: OracleInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleInfo.typeUrl, OracleInfo); +function createBaseChainlinkPriceState(): ChainlinkPriceState { + return { + feedId: "", + answer: "", + timestamp: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const ChainlinkPriceState = { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState", + is(o: any): o is ChainlinkPriceState { + return o && (o.$typeUrl === ChainlinkPriceState.typeUrl || typeof o.feedId === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is ChainlinkPriceStateAmino { + return o && (o.$typeUrl === ChainlinkPriceState.typeUrl || typeof o.feed_id === "string" && typeof o.answer === "string" && typeof o.timestamp === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: ChainlinkPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feedId !== "") { + writer.uint32(10).string(message.feedId); + } + if (message.answer !== "") { + writer.uint32(18).string(message.answer); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ChainlinkPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChainlinkPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feedId = reader.string(); + break; + case 2: + message.answer = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + case 4: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ChainlinkPriceState { + const message = createBaseChainlinkPriceState(); + message.feedId = object.feedId ?? ""; + message.answer = object.answer ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: ChainlinkPriceStateAmino): ChainlinkPriceState { + const message = createBaseChainlinkPriceState(); + if (object.feed_id !== undefined && object.feed_id !== null) { + message.feedId = object.feed_id; + } + if (object.answer !== undefined && object.answer !== null) { + message.answer = object.answer; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: ChainlinkPriceState): ChainlinkPriceStateAmino { + const obj: any = {}; + obj.feed_id = message.feedId === "" ? undefined : message.feedId; + obj.answer = message.answer === "" ? undefined : message.answer; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: ChainlinkPriceStateAminoMsg): ChainlinkPriceState { + return ChainlinkPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: ChainlinkPriceStateProtoMsg): ChainlinkPriceState { + return ChainlinkPriceState.decode(message.value); + }, + toProto(message: ChainlinkPriceState): Uint8Array { + return ChainlinkPriceState.encode(message).finish(); + }, + toProtoMsg(message: ChainlinkPriceState): ChainlinkPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ChainlinkPriceState", + value: ChainlinkPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ChainlinkPriceState.typeUrl, ChainlinkPriceState); +function createBaseBandPriceState(): BandPriceState { + return { + symbol: "", + rate: "", + resolveTime: BigInt(0), + requestID: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const BandPriceState = { + typeUrl: "/injective.oracle.v1beta1.BandPriceState", + is(o: any): o is BandPriceState { + return o && (o.$typeUrl === BandPriceState.typeUrl || typeof o.symbol === "string" && typeof o.rate === "string" && typeof o.resolveTime === "bigint" && typeof o.requestID === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is BandPriceStateAmino { + return o && (o.$typeUrl === BandPriceState.typeUrl || typeof o.symbol === "string" && typeof o.rate === "string" && typeof o.resolve_time === "bigint" && typeof o.request_ID === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: BandPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.rate !== "") { + writer.uint32(18).string(message.rate); + } + if (message.resolveTime !== BigInt(0)) { + writer.uint32(24).uint64(message.resolveTime); + } + if (message.requestID !== BigInt(0)) { + writer.uint32(32).uint64(message.requestID); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.rate = reader.string(); + break; + case 3: + message.resolveTime = reader.uint64(); + break; + case 4: + message.requestID = reader.uint64(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandPriceState { + const message = createBaseBandPriceState(); + message.symbol = object.symbol ?? ""; + message.rate = object.rate ?? ""; + message.resolveTime = object.resolveTime !== undefined && object.resolveTime !== null ? BigInt(object.resolveTime.toString()) : BigInt(0); + message.requestID = object.requestID !== undefined && object.requestID !== null ? BigInt(object.requestID.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: BandPriceStateAmino): BandPriceState { + const message = createBaseBandPriceState(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.resolve_time !== undefined && object.resolve_time !== null) { + message.resolveTime = BigInt(object.resolve_time); + } + if (object.request_ID !== undefined && object.request_ID !== null) { + message.requestID = BigInt(object.request_ID); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: BandPriceState): BandPriceStateAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.rate = message.rate === "" ? undefined : message.rate; + obj.resolve_time = message.resolveTime !== BigInt(0) ? message.resolveTime?.toString() : undefined; + obj.request_ID = message.requestID !== BigInt(0) ? message.requestID?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: BandPriceStateAminoMsg): BandPriceState { + return BandPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: BandPriceStateProtoMsg): BandPriceState { + return BandPriceState.decode(message.value); + }, + toProto(message: BandPriceState): Uint8Array { + return BandPriceState.encode(message).finish(); + }, + toProtoMsg(message: BandPriceState): BandPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandPriceState", + value: BandPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandPriceState.typeUrl, BandPriceState); +function createBasePriceFeedState(): PriceFeedState { + return { + base: "", + quote: "", + priceState: undefined, + relayers: [] + }; +} +export const PriceFeedState = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState", + is(o: any): o is PriceFeedState { + return o && (o.$typeUrl === PriceFeedState.typeUrl || typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is PriceFeedStateAmino { + return o && (o.$typeUrl === PriceFeedState.typeUrl || typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: PriceFeedState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== "") { + writer.uint32(10).string(message.base); + } + if (message.quote !== "") { + writer.uint32(18).string(message.quote); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.relayers) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = reader.string(); + break; + case 2: + message.quote = reader.string(); + break; + case 3: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + case 4: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedState { + const message = createBasePriceFeedState(); + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: PriceFeedStateAmino): PriceFeedState { + const message = createBasePriceFeedState(); + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: PriceFeedState): PriceFeedStateAmino { + const obj: any = {}; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: PriceFeedStateAminoMsg): PriceFeedState { + return PriceFeedState.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedStateProtoMsg): PriceFeedState { + return PriceFeedState.decode(message.value); + }, + toProto(message: PriceFeedState): Uint8Array { + return PriceFeedState.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedState): PriceFeedStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedState", + value: PriceFeedState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedState.typeUrl, PriceFeedState); +function createBaseProviderInfo(): ProviderInfo { + return { + provider: "", + relayers: [] + }; +} +export const ProviderInfo = { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo", + is(o: any): o is ProviderInfo { + return o && (o.$typeUrl === ProviderInfo.typeUrl || typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is ProviderInfoAmino { + return o && (o.$typeUrl === ProviderInfo.typeUrl || typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: ProviderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderInfo { + const message = createBaseProviderInfo(); + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: ProviderInfoAmino): ProviderInfo { + const message = createBaseProviderInfo(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: ProviderInfo): ProviderInfoAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: ProviderInfoAminoMsg): ProviderInfo { + return ProviderInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderInfoProtoMsg): ProviderInfo { + return ProviderInfo.decode(message.value); + }, + toProto(message: ProviderInfo): Uint8Array { + return ProviderInfo.encode(message).finish(); + }, + toProtoMsg(message: ProviderInfo): ProviderInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderInfo", + value: ProviderInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderInfo.typeUrl, ProviderInfo); +function createBaseProviderState(): ProviderState { + return { + providerInfo: undefined, + providerPriceStates: [] + }; +} +export const ProviderState = { + typeUrl: "/injective.oracle.v1beta1.ProviderState", + is(o: any): o is ProviderState { + return o && (o.$typeUrl === ProviderState.typeUrl || Array.isArray(o.providerPriceStates) && (!o.providerPriceStates.length || ProviderPriceState.is(o.providerPriceStates[0]))); + }, + isAmino(o: any): o is ProviderStateAmino { + return o && (o.$typeUrl === ProviderState.typeUrl || Array.isArray(o.provider_price_states) && (!o.provider_price_states.length || ProviderPriceState.isAmino(o.provider_price_states[0]))); + }, + encode(message: ProviderState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.providerInfo !== undefined) { + ProviderInfo.encode(message.providerInfo, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.providerPriceStates) { + ProviderPriceState.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providerInfo = ProviderInfo.decode(reader, reader.uint32()); + break; + case 2: + message.providerPriceStates.push(ProviderPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderState { + const message = createBaseProviderState(); + message.providerInfo = object.providerInfo !== undefined && object.providerInfo !== null ? ProviderInfo.fromPartial(object.providerInfo) : undefined; + message.providerPriceStates = object.providerPriceStates?.map(e => ProviderPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProviderStateAmino): ProviderState { + const message = createBaseProviderState(); + if (object.provider_info !== undefined && object.provider_info !== null) { + message.providerInfo = ProviderInfo.fromAmino(object.provider_info); + } + message.providerPriceStates = object.provider_price_states?.map(e => ProviderPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: ProviderState): ProviderStateAmino { + const obj: any = {}; + obj.provider_info = message.providerInfo ? ProviderInfo.toAmino(message.providerInfo) : undefined; + if (message.providerPriceStates) { + obj.provider_price_states = message.providerPriceStates.map(e => e ? ProviderPriceState.toAmino(e) : undefined); + } else { + obj.provider_price_states = message.providerPriceStates; + } + return obj; + }, + fromAminoMsg(object: ProviderStateAminoMsg): ProviderState { + return ProviderState.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderStateProtoMsg): ProviderState { + return ProviderState.decode(message.value); + }, + toProto(message: ProviderState): Uint8Array { + return ProviderState.encode(message).finish(); + }, + toProtoMsg(message: ProviderState): ProviderStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderState", + value: ProviderState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderState.typeUrl, ProviderState); +function createBaseProviderPriceState(): ProviderPriceState { + return { + symbol: "", + state: undefined + }; +} +export const ProviderPriceState = { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState", + is(o: any): o is ProviderPriceState { + return o && (o.$typeUrl === ProviderPriceState.typeUrl || typeof o.symbol === "string"); + }, + isAmino(o: any): o is ProviderPriceStateAmino { + return o && (o.$typeUrl === ProviderPriceState.typeUrl || typeof o.symbol === "string"); + }, + encode(message: ProviderPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.state !== undefined) { + PriceState.encode(message.state, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.state = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ProviderPriceState { + const message = createBaseProviderPriceState(); + message.symbol = object.symbol ?? ""; + message.state = object.state !== undefined && object.state !== null ? PriceState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: ProviderPriceStateAmino): ProviderPriceState { + const message = createBaseProviderPriceState(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.state !== undefined && object.state !== null) { + message.state = PriceState.fromAmino(object.state); + } + return message; + }, + toAmino(message: ProviderPriceState): ProviderPriceStateAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.state = message.state ? PriceState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: ProviderPriceStateAminoMsg): ProviderPriceState { + return ProviderPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderPriceStateProtoMsg): ProviderPriceState { + return ProviderPriceState.decode(message.value); + }, + toProto(message: ProviderPriceState): Uint8Array { + return ProviderPriceState.encode(message).finish(); + }, + toProtoMsg(message: ProviderPriceState): ProviderPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ProviderPriceState", + value: ProviderPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProviderPriceState.typeUrl, ProviderPriceState); +function createBasePriceFeedInfo(): PriceFeedInfo { + return { + base: "", + quote: "" + }; +} +export const PriceFeedInfo = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo", + is(o: any): o is PriceFeedInfo { + return o && (o.$typeUrl === PriceFeedInfo.typeUrl || typeof o.base === "string" && typeof o.quote === "string"); + }, + isAmino(o: any): o is PriceFeedInfoAmino { + return o && (o.$typeUrl === PriceFeedInfo.typeUrl || typeof o.base === "string" && typeof o.quote === "string"); + }, + encode(message: PriceFeedInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== "") { + writer.uint32(10).string(message.base); + } + if (message.quote !== "") { + writer.uint32(18).string(message.quote); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = reader.string(); + break; + case 2: + message.quote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedInfo { + const message = createBasePriceFeedInfo(); + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + return message; + }, + fromAmino(object: PriceFeedInfoAmino): PriceFeedInfo { + const message = createBasePriceFeedInfo(); + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + return message; + }, + toAmino(message: PriceFeedInfo): PriceFeedInfoAmino { + const obj: any = {}; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + return obj; + }, + fromAminoMsg(object: PriceFeedInfoAminoMsg): PriceFeedInfo { + return PriceFeedInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedInfoProtoMsg): PriceFeedInfo { + return PriceFeedInfo.decode(message.value); + }, + toProto(message: PriceFeedInfo): Uint8Array { + return PriceFeedInfo.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedInfo): PriceFeedInfoProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedInfo", + value: PriceFeedInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedInfo.typeUrl, PriceFeedInfo); +function createBasePriceFeedPrice(): PriceFeedPrice { + return { + price: "" + }; +} +export const PriceFeedPrice = { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice", + is(o: any): o is PriceFeedPrice { + return o && (o.$typeUrl === PriceFeedPrice.typeUrl || typeof o.price === "string"); + }, + isAmino(o: any): o is PriceFeedPriceAmino { + return o && (o.$typeUrl === PriceFeedPrice.typeUrl || typeof o.price === "string"); + }, + encode(message: PriceFeedPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceFeedPrice { + const message = createBasePriceFeedPrice(); + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: PriceFeedPriceAmino): PriceFeedPrice { + const message = createBasePriceFeedPrice(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: PriceFeedPrice): PriceFeedPriceAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: PriceFeedPriceAminoMsg): PriceFeedPrice { + return PriceFeedPrice.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedPriceProtoMsg): PriceFeedPrice { + return PriceFeedPrice.decode(message.value); + }, + toProto(message: PriceFeedPrice): Uint8Array { + return PriceFeedPrice.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedPrice): PriceFeedPriceProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceFeedPrice", + value: PriceFeedPrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceFeedPrice.typeUrl, PriceFeedPrice); +function createBaseCoinbasePriceState(): CoinbasePriceState { + return { + kind: "", + timestamp: BigInt(0), + key: "", + value: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const CoinbasePriceState = { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState", + is(o: any): o is CoinbasePriceState { + return o && (o.$typeUrl === CoinbasePriceState.typeUrl || typeof o.kind === "string" && typeof o.timestamp === "bigint" && typeof o.key === "string" && typeof o.value === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is CoinbasePriceStateAmino { + return o && (o.$typeUrl === CoinbasePriceState.typeUrl || typeof o.kind === "string" && typeof o.timestamp === "bigint" && typeof o.key === "string" && typeof o.value === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: CoinbasePriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.key !== "") { + writer.uint32(26).string(message.key); + } + if (message.value !== BigInt(0)) { + writer.uint32(32).uint64(message.value); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CoinbasePriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoinbasePriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.key = reader.string(); + break; + case 4: + message.value = reader.uint64(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CoinbasePriceState { + const message = createBaseCoinbasePriceState(); + message.kind = object.kind ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: CoinbasePriceStateAmino): CoinbasePriceState { + const message = createBaseCoinbasePriceState(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: CoinbasePriceState): CoinbasePriceStateAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value !== BigInt(0) ? message.value?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: CoinbasePriceStateAminoMsg): CoinbasePriceState { + return CoinbasePriceState.fromAmino(object.value); + }, + fromProtoMsg(message: CoinbasePriceStateProtoMsg): CoinbasePriceState { + return CoinbasePriceState.decode(message.value); + }, + toProto(message: CoinbasePriceState): Uint8Array { + return CoinbasePriceState.encode(message).finish(); + }, + toProtoMsg(message: CoinbasePriceState): CoinbasePriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.CoinbasePriceState", + value: CoinbasePriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CoinbasePriceState.typeUrl, CoinbasePriceState); +function createBaseStorkPriceState(): StorkPriceState { + return { + timestamp: BigInt(0), + symbol: "", + value: "", + priceState: PriceState.fromPartial({}) + }; +} +export const StorkPriceState = { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState", + is(o: any): o is StorkPriceState { + return o && (o.$typeUrl === StorkPriceState.typeUrl || typeof o.timestamp === "bigint" && typeof o.symbol === "string" && typeof o.value === "string" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is StorkPriceStateAmino { + return o && (o.$typeUrl === StorkPriceState.typeUrl || typeof o.timestamp === "bigint" && typeof o.symbol === "string" && typeof o.value === "string" && PriceState.isAmino(o.price_state)); + }, + encode(message: StorkPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).uint64(message.timestamp); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StorkPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStorkPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + case 5: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StorkPriceState { + const message = createBaseStorkPriceState(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.symbol = object.symbol ?? ""; + message.value = object.value ?? ""; + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: StorkPriceStateAmino): StorkPriceState { + const message = createBaseStorkPriceState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: StorkPriceState): StorkPriceStateAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.value = message.value === "" ? undefined : message.value; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: StorkPriceStateAminoMsg): StorkPriceState { + return StorkPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: StorkPriceStateProtoMsg): StorkPriceState { + return StorkPriceState.decode(message.value); + }, + toProto(message: StorkPriceState): Uint8Array { + return StorkPriceState.encode(message).finish(); + }, + toProtoMsg(message: StorkPriceState): StorkPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.StorkPriceState", + value: StorkPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StorkPriceState.typeUrl, StorkPriceState); +function createBasePriceState(): PriceState { + return { + price: "", + cumulativePrice: "", + timestamp: BigInt(0) + }; +} +export const PriceState = { + typeUrl: "/injective.oracle.v1beta1.PriceState", + is(o: any): o is PriceState { + return o && (o.$typeUrl === PriceState.typeUrl || typeof o.price === "string" && typeof o.cumulativePrice === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is PriceStateAmino { + return o && (o.$typeUrl === PriceState.typeUrl || typeof o.price === "string" && typeof o.cumulative_price === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: PriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.cumulativePrice !== "") { + writer.uint32(18).string(message.cumulativePrice); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).int64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.cumulativePrice = reader.string(); + break; + case 3: + message.timestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceState { + const message = createBasePriceState(); + message.price = object.price ?? ""; + message.cumulativePrice = object.cumulativePrice ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PriceStateAmino): PriceState { + const message = createBasePriceState(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.cumulative_price !== undefined && object.cumulative_price !== null) { + message.cumulativePrice = object.cumulative_price; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: PriceState): PriceStateAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.cumulative_price = message.cumulativePrice === "" ? undefined : message.cumulativePrice; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PriceStateAminoMsg): PriceState { + return PriceState.fromAmino(object.value); + }, + fromProtoMsg(message: PriceStateProtoMsg): PriceState { + return PriceState.decode(message.value); + }, + toProto(message: PriceState): Uint8Array { + return PriceState.encode(message).finish(); + }, + toProtoMsg(message: PriceState): PriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceState", + value: PriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceState.typeUrl, PriceState); +function createBasePythPriceState(): PythPriceState { + return { + priceId: "", + emaPrice: "", + emaConf: "", + conf: "", + publishTime: BigInt(0), + priceState: PriceState.fromPartial({}) + }; +} +export const PythPriceState = { + typeUrl: "/injective.oracle.v1beta1.PythPriceState", + is(o: any): o is PythPriceState { + return o && (o.$typeUrl === PythPriceState.typeUrl || typeof o.priceId === "string" && typeof o.emaPrice === "string" && typeof o.emaConf === "string" && typeof o.conf === "string" && typeof o.publishTime === "bigint" && PriceState.is(o.priceState)); + }, + isAmino(o: any): o is PythPriceStateAmino { + return o && (o.$typeUrl === PythPriceState.typeUrl || typeof o.price_id === "string" && typeof o.ema_price === "string" && typeof o.ema_conf === "string" && typeof o.conf === "string" && typeof o.publish_time === "bigint" && PriceState.isAmino(o.price_state)); + }, + encode(message: PythPriceState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + if (message.emaPrice !== "") { + writer.uint32(18).string(message.emaPrice); + } + if (message.emaConf !== "") { + writer.uint32(26).string(message.emaConf); + } + if (message.conf !== "") { + writer.uint32(34).string(message.conf); + } + if (message.publishTime !== BigInt(0)) { + writer.uint32(40).uint64(message.publishTime); + } + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PythPriceState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePythPriceState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + case 2: + message.emaPrice = reader.string(); + break; + case 3: + message.emaConf = reader.string(); + break; + case 4: + message.conf = reader.string(); + break; + case 5: + message.publishTime = reader.uint64(); + break; + case 6: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PythPriceState { + const message = createBasePythPriceState(); + message.priceId = object.priceId ?? ""; + message.emaPrice = object.emaPrice ?? ""; + message.emaConf = object.emaConf ?? ""; + message.conf = object.conf ?? ""; + message.publishTime = object.publishTime !== undefined && object.publishTime !== null ? BigInt(object.publishTime.toString()) : BigInt(0); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: PythPriceStateAmino): PythPriceState { + const message = createBasePythPriceState(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + if (object.ema_price !== undefined && object.ema_price !== null) { + message.emaPrice = object.ema_price; + } + if (object.ema_conf !== undefined && object.ema_conf !== null) { + message.emaConf = object.ema_conf; + } + if (object.conf !== undefined && object.conf !== null) { + message.conf = object.conf; + } + if (object.publish_time !== undefined && object.publish_time !== null) { + message.publishTime = BigInt(object.publish_time); + } + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: PythPriceState): PythPriceStateAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + obj.ema_price = message.emaPrice === "" ? undefined : message.emaPrice; + obj.ema_conf = message.emaConf === "" ? undefined : message.emaConf; + obj.conf = message.conf === "" ? undefined : message.conf; + obj.publish_time = message.publishTime !== BigInt(0) ? message.publishTime?.toString() : undefined; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: PythPriceStateAminoMsg): PythPriceState { + return PythPriceState.fromAmino(object.value); + }, + fromProtoMsg(message: PythPriceStateProtoMsg): PythPriceState { + return PythPriceState.decode(message.value); + }, + toProto(message: PythPriceState): Uint8Array { + return PythPriceState.encode(message).finish(); + }, + toProtoMsg(message: PythPriceState): PythPriceStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PythPriceState", + value: PythPriceState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PythPriceState.typeUrl, PythPriceState); +function createBaseBandOracleRequest(): BandOracleRequest { + return { + requestId: BigInt(0), + oracleScriptId: BigInt(0), + symbols: [], + askCount: BigInt(0), + minCount: BigInt(0), + feeLimit: [], + prepareGas: BigInt(0), + executeGas: BigInt(0), + minSourceCount: BigInt(0) + }; +} +export const BandOracleRequest = { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest", + is(o: any): o is BandOracleRequest { + return o && (o.$typeUrl === BandOracleRequest.typeUrl || typeof o.requestId === "bigint" && typeof o.oracleScriptId === "bigint" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && typeof o.askCount === "bigint" && typeof o.minCount === "bigint" && Array.isArray(o.feeLimit) && (!o.feeLimit.length || Coin.is(o.feeLimit[0])) && typeof o.prepareGas === "bigint" && typeof o.executeGas === "bigint" && typeof o.minSourceCount === "bigint"); + }, + isAmino(o: any): o is BandOracleRequestAmino { + return o && (o.$typeUrl === BandOracleRequest.typeUrl || typeof o.request_id === "bigint" && typeof o.oracle_script_id === "bigint" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && typeof o.ask_count === "bigint" && typeof o.min_count === "bigint" && Array.isArray(o.fee_limit) && (!o.fee_limit.length || Coin.isAmino(o.fee_limit[0])) && typeof o.prepare_gas === "bigint" && typeof o.execute_gas === "bigint" && typeof o.min_source_count === "bigint"); + }, + encode(message: BandOracleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.requestId !== BigInt(0)) { + writer.uint32(8).uint64(message.requestId); + } + if (message.oracleScriptId !== BigInt(0)) { + writer.uint32(16).int64(message.oracleScriptId); + } + for (const v of message.symbols) { + writer.uint32(26).string(v!); + } + if (message.askCount !== BigInt(0)) { + writer.uint32(32).uint64(message.askCount); + } + if (message.minCount !== BigInt(0)) { + writer.uint32(40).uint64(message.minCount); + } + for (const v of message.feeLimit) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.prepareGas !== BigInt(0)) { + writer.uint32(56).uint64(message.prepareGas); + } + if (message.executeGas !== BigInt(0)) { + writer.uint32(64).uint64(message.executeGas); + } + if (message.minSourceCount !== BigInt(0)) { + writer.uint32(72).uint64(message.minSourceCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandOracleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandOracleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.uint64(); + break; + case 2: + message.oracleScriptId = reader.int64(); + break; + case 3: + message.symbols.push(reader.string()); + break; + case 4: + message.askCount = reader.uint64(); + break; + case 5: + message.minCount = reader.uint64(); + break; + case 6: + message.feeLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.prepareGas = reader.uint64(); + break; + case 8: + message.executeGas = reader.uint64(); + break; + case 9: + message.minSourceCount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandOracleRequest { + const message = createBaseBandOracleRequest(); + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + message.oracleScriptId = object.oracleScriptId !== undefined && object.oracleScriptId !== null ? BigInt(object.oracleScriptId.toString()) : BigInt(0); + message.symbols = object.symbols?.map(e => e) || []; + message.askCount = object.askCount !== undefined && object.askCount !== null ? BigInt(object.askCount.toString()) : BigInt(0); + message.minCount = object.minCount !== undefined && object.minCount !== null ? BigInt(object.minCount.toString()) : BigInt(0); + message.feeLimit = object.feeLimit?.map(e => Coin.fromPartial(e)) || []; + message.prepareGas = object.prepareGas !== undefined && object.prepareGas !== null ? BigInt(object.prepareGas.toString()) : BigInt(0); + message.executeGas = object.executeGas !== undefined && object.executeGas !== null ? BigInt(object.executeGas.toString()) : BigInt(0); + message.minSourceCount = object.minSourceCount !== undefined && object.minSourceCount !== null ? BigInt(object.minSourceCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BandOracleRequestAmino): BandOracleRequest { + const message = createBaseBandOracleRequest(); + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + if (object.oracle_script_id !== undefined && object.oracle_script_id !== null) { + message.oracleScriptId = BigInt(object.oracle_script_id); + } + message.symbols = object.symbols?.map(e => e) || []; + if (object.ask_count !== undefined && object.ask_count !== null) { + message.askCount = BigInt(object.ask_count); + } + if (object.min_count !== undefined && object.min_count !== null) { + message.minCount = BigInt(object.min_count); + } + message.feeLimit = object.fee_limit?.map(e => Coin.fromAmino(e)) || []; + if (object.prepare_gas !== undefined && object.prepare_gas !== null) { + message.prepareGas = BigInt(object.prepare_gas); + } + if (object.execute_gas !== undefined && object.execute_gas !== null) { + message.executeGas = BigInt(object.execute_gas); + } + if (object.min_source_count !== undefined && object.min_source_count !== null) { + message.minSourceCount = BigInt(object.min_source_count); + } + return message; + }, + toAmino(message: BandOracleRequest): BandOracleRequestAmino { + const obj: any = {}; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + obj.oracle_script_id = message.oracleScriptId !== BigInt(0) ? message.oracleScriptId?.toString() : undefined; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + obj.ask_count = message.askCount !== BigInt(0) ? message.askCount?.toString() : undefined; + obj.min_count = message.minCount !== BigInt(0) ? message.minCount?.toString() : undefined; + if (message.feeLimit) { + obj.fee_limit = message.feeLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.fee_limit = message.feeLimit; + } + obj.prepare_gas = message.prepareGas !== BigInt(0) ? message.prepareGas?.toString() : undefined; + obj.execute_gas = message.executeGas !== BigInt(0) ? message.executeGas?.toString() : undefined; + obj.min_source_count = message.minSourceCount !== BigInt(0) ? message.minSourceCount?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BandOracleRequestAminoMsg): BandOracleRequest { + return BandOracleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: BandOracleRequestProtoMsg): BandOracleRequest { + return BandOracleRequest.decode(message.value); + }, + toProto(message: BandOracleRequest): Uint8Array { + return BandOracleRequest.encode(message).finish(); + }, + toProtoMsg(message: BandOracleRequest): BandOracleRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandOracleRequest", + value: BandOracleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandOracleRequest.typeUrl, BandOracleRequest); +function createBaseBandIBCParams(): BandIBCParams { + return { + bandIbcEnabled: false, + ibcRequestInterval: BigInt(0), + ibcSourceChannel: "", + ibcVersion: "", + ibcPortId: "", + legacyOracleIds: [] + }; +} +export const BandIBCParams = { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams", + is(o: any): o is BandIBCParams { + return o && (o.$typeUrl === BandIBCParams.typeUrl || typeof o.bandIbcEnabled === "boolean" && typeof o.ibcRequestInterval === "bigint" && typeof o.ibcSourceChannel === "string" && typeof o.ibcVersion === "string" && typeof o.ibcPortId === "string" && Array.isArray(o.legacyOracleIds) && (!o.legacyOracleIds.length || typeof o.legacyOracleIds[0] === "bigint")); + }, + isAmino(o: any): o is BandIBCParamsAmino { + return o && (o.$typeUrl === BandIBCParams.typeUrl || typeof o.band_ibc_enabled === "boolean" && typeof o.ibc_request_interval === "bigint" && typeof o.ibc_source_channel === "string" && typeof o.ibc_version === "string" && typeof o.ibc_port_id === "string" && Array.isArray(o.legacy_oracle_ids) && (!o.legacy_oracle_ids.length || typeof o.legacy_oracle_ids[0] === "bigint")); + }, + encode(message: BandIBCParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bandIbcEnabled === true) { + writer.uint32(8).bool(message.bandIbcEnabled); + } + if (message.ibcRequestInterval !== BigInt(0)) { + writer.uint32(16).int64(message.ibcRequestInterval); + } + if (message.ibcSourceChannel !== "") { + writer.uint32(26).string(message.ibcSourceChannel); + } + if (message.ibcVersion !== "") { + writer.uint32(34).string(message.ibcVersion); + } + if (message.ibcPortId !== "") { + writer.uint32(42).string(message.ibcPortId); + } + writer.uint32(50).fork(); + for (const v of message.legacyOracleIds) { + writer.int64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BandIBCParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBandIBCParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bandIbcEnabled = reader.bool(); + break; + case 2: + message.ibcRequestInterval = reader.int64(); + break; + case 3: + message.ibcSourceChannel = reader.string(); + break; + case 4: + message.ibcVersion = reader.string(); + break; + case 5: + message.ibcPortId = reader.string(); + break; + case 6: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.legacyOracleIds.push(reader.int64()); + } + } else { + message.legacyOracleIds.push(reader.int64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BandIBCParams { + const message = createBaseBandIBCParams(); + message.bandIbcEnabled = object.bandIbcEnabled ?? false; + message.ibcRequestInterval = object.ibcRequestInterval !== undefined && object.ibcRequestInterval !== null ? BigInt(object.ibcRequestInterval.toString()) : BigInt(0); + message.ibcSourceChannel = object.ibcSourceChannel ?? ""; + message.ibcVersion = object.ibcVersion ?? ""; + message.ibcPortId = object.ibcPortId ?? ""; + message.legacyOracleIds = object.legacyOracleIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: BandIBCParamsAmino): BandIBCParams { + const message = createBaseBandIBCParams(); + if (object.band_ibc_enabled !== undefined && object.band_ibc_enabled !== null) { + message.bandIbcEnabled = object.band_ibc_enabled; + } + if (object.ibc_request_interval !== undefined && object.ibc_request_interval !== null) { + message.ibcRequestInterval = BigInt(object.ibc_request_interval); + } + if (object.ibc_source_channel !== undefined && object.ibc_source_channel !== null) { + message.ibcSourceChannel = object.ibc_source_channel; + } + if (object.ibc_version !== undefined && object.ibc_version !== null) { + message.ibcVersion = object.ibc_version; + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + message.legacyOracleIds = object.legacy_oracle_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: BandIBCParams): BandIBCParamsAmino { + const obj: any = {}; + obj.band_ibc_enabled = message.bandIbcEnabled === false ? undefined : message.bandIbcEnabled; + obj.ibc_request_interval = message.ibcRequestInterval !== BigInt(0) ? message.ibcRequestInterval?.toString() : undefined; + obj.ibc_source_channel = message.ibcSourceChannel === "" ? undefined : message.ibcSourceChannel; + obj.ibc_version = message.ibcVersion === "" ? undefined : message.ibcVersion; + obj.ibc_port_id = message.ibcPortId === "" ? undefined : message.ibcPortId; + if (message.legacyOracleIds) { + obj.legacy_oracle_ids = message.legacyOracleIds.map(e => e.toString()); + } else { + obj.legacy_oracle_ids = message.legacyOracleIds; + } + return obj; + }, + fromAminoMsg(object: BandIBCParamsAminoMsg): BandIBCParams { + return BandIBCParams.fromAmino(object.value); + }, + fromProtoMsg(message: BandIBCParamsProtoMsg): BandIBCParams { + return BandIBCParams.decode(message.value); + }, + toProto(message: BandIBCParams): Uint8Array { + return BandIBCParams.encode(message).finish(); + }, + toProtoMsg(message: BandIBCParams): BandIBCParamsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.BandIBCParams", + value: BandIBCParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BandIBCParams.typeUrl, BandIBCParams); +function createBaseSymbolPriceTimestamp(): SymbolPriceTimestamp { + return { + oracle: 0, + symbolId: "", + timestamp: BigInt(0) + }; +} +export const SymbolPriceTimestamp = { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp", + is(o: any): o is SymbolPriceTimestamp { + return o && (o.$typeUrl === SymbolPriceTimestamp.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SymbolPriceTimestampAmino { + return o && (o.$typeUrl === SymbolPriceTimestamp.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string" && typeof o.timestamp === "bigint"); + }, + encode(message: SymbolPriceTimestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).int64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SymbolPriceTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSymbolPriceTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + case 3: + message.timestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SymbolPriceTimestamp { + const message = createBaseSymbolPriceTimestamp(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SymbolPriceTimestampAmino): SymbolPriceTimestamp { + const message = createBaseSymbolPriceTimestamp(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SymbolPriceTimestamp): SymbolPriceTimestampAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SymbolPriceTimestampAminoMsg): SymbolPriceTimestamp { + return SymbolPriceTimestamp.fromAmino(object.value); + }, + fromProtoMsg(message: SymbolPriceTimestampProtoMsg): SymbolPriceTimestamp { + return SymbolPriceTimestamp.decode(message.value); + }, + toProto(message: SymbolPriceTimestamp): Uint8Array { + return SymbolPriceTimestamp.encode(message).finish(); + }, + toProtoMsg(message: SymbolPriceTimestamp): SymbolPriceTimestampProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SymbolPriceTimestamp", + value: SymbolPriceTimestamp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SymbolPriceTimestamp.typeUrl, SymbolPriceTimestamp); +function createBaseLastPriceTimestamps(): LastPriceTimestamps { + return { + lastPriceTimestamps: [] + }; +} +export const LastPriceTimestamps = { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps", + is(o: any): o is LastPriceTimestamps { + return o && (o.$typeUrl === LastPriceTimestamps.typeUrl || Array.isArray(o.lastPriceTimestamps) && (!o.lastPriceTimestamps.length || SymbolPriceTimestamp.is(o.lastPriceTimestamps[0]))); + }, + isAmino(o: any): o is LastPriceTimestampsAmino { + return o && (o.$typeUrl === LastPriceTimestamps.typeUrl || Array.isArray(o.last_price_timestamps) && (!o.last_price_timestamps.length || SymbolPriceTimestamp.isAmino(o.last_price_timestamps[0]))); + }, + encode(message: LastPriceTimestamps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.lastPriceTimestamps) { + SymbolPriceTimestamp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastPriceTimestamps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastPriceTimestamps(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastPriceTimestamps.push(SymbolPriceTimestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastPriceTimestamps { + const message = createBaseLastPriceTimestamps(); + message.lastPriceTimestamps = object.lastPriceTimestamps?.map(e => SymbolPriceTimestamp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LastPriceTimestampsAmino): LastPriceTimestamps { + const message = createBaseLastPriceTimestamps(); + message.lastPriceTimestamps = object.last_price_timestamps?.map(e => SymbolPriceTimestamp.fromAmino(e)) || []; + return message; + }, + toAmino(message: LastPriceTimestamps): LastPriceTimestampsAmino { + const obj: any = {}; + if (message.lastPriceTimestamps) { + obj.last_price_timestamps = message.lastPriceTimestamps.map(e => e ? SymbolPriceTimestamp.toAmino(e) : undefined); + } else { + obj.last_price_timestamps = message.lastPriceTimestamps; + } + return obj; + }, + fromAminoMsg(object: LastPriceTimestampsAminoMsg): LastPriceTimestamps { + return LastPriceTimestamps.fromAmino(object.value); + }, + fromProtoMsg(message: LastPriceTimestampsProtoMsg): LastPriceTimestamps { + return LastPriceTimestamps.decode(message.value); + }, + toProto(message: LastPriceTimestamps): Uint8Array { + return LastPriceTimestamps.encode(message).finish(); + }, + toProtoMsg(message: LastPriceTimestamps): LastPriceTimestampsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.LastPriceTimestamps", + value: LastPriceTimestamps.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastPriceTimestamps.typeUrl, LastPriceTimestamps); +function createBasePriceRecords(): PriceRecords { + return { + oracle: 0, + symbolId: "", + latestPriceRecords: [] + }; +} +export const PriceRecords = { + typeUrl: "/injective.oracle.v1beta1.PriceRecords", + is(o: any): o is PriceRecords { + return o && (o.$typeUrl === PriceRecords.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string" && Array.isArray(o.latestPriceRecords) && (!o.latestPriceRecords.length || PriceRecord.is(o.latestPriceRecords[0]))); + }, + isAmino(o: any): o is PriceRecordsAmino { + return o && (o.$typeUrl === PriceRecords.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string" && Array.isArray(o.latest_price_records) && (!o.latest_price_records.length || PriceRecord.isAmino(o.latest_price_records[0]))); + }, + encode(message: PriceRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + for (const v of message.latestPriceRecords) { + PriceRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceRecords { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceRecords(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + case 3: + message.latestPriceRecords.push(PriceRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceRecords { + const message = createBasePriceRecords(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + message.latestPriceRecords = object.latestPriceRecords?.map(e => PriceRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PriceRecordsAmino): PriceRecords { + const message = createBasePriceRecords(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + message.latestPriceRecords = object.latest_price_records?.map(e => PriceRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: PriceRecords): PriceRecordsAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + if (message.latestPriceRecords) { + obj.latest_price_records = message.latestPriceRecords.map(e => e ? PriceRecord.toAmino(e) : undefined); + } else { + obj.latest_price_records = message.latestPriceRecords; + } + return obj; + }, + fromAminoMsg(object: PriceRecordsAminoMsg): PriceRecords { + return PriceRecords.fromAmino(object.value); + }, + fromProtoMsg(message: PriceRecordsProtoMsg): PriceRecords { + return PriceRecords.decode(message.value); + }, + toProto(message: PriceRecords): Uint8Array { + return PriceRecords.encode(message).finish(); + }, + toProtoMsg(message: PriceRecords): PriceRecordsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceRecords", + value: PriceRecords.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceRecords.typeUrl, PriceRecords); +function createBasePriceRecord(): PriceRecord { + return { + timestamp: BigInt(0), + price: "" + }; +} +export const PriceRecord = { + typeUrl: "/injective.oracle.v1beta1.PriceRecord", + is(o: any): o is PriceRecord { + return o && (o.$typeUrl === PriceRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string"); + }, + isAmino(o: any): o is PriceRecordAmino { + return o && (o.$typeUrl === PriceRecord.typeUrl || typeof o.timestamp === "bigint" && typeof o.price === "string"); + }, + encode(message: PriceRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).int64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.int64(); + break; + case 2: + message.price = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceRecord { + const message = createBasePriceRecord(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + return message; + }, + fromAmino(object: PriceRecordAmino): PriceRecord { + const message = createBasePriceRecord(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + return message; + }, + toAmino(message: PriceRecord): PriceRecordAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + return obj; + }, + fromAminoMsg(object: PriceRecordAminoMsg): PriceRecord { + return PriceRecord.fromAmino(object.value); + }, + fromProtoMsg(message: PriceRecordProtoMsg): PriceRecord { + return PriceRecord.decode(message.value); + }, + toProto(message: PriceRecord): Uint8Array { + return PriceRecord.encode(message).finish(); + }, + toProtoMsg(message: PriceRecord): PriceRecordProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceRecord", + value: PriceRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceRecord.typeUrl, PriceRecord); +function createBaseMetadataStatistics(): MetadataStatistics { + return { + groupCount: 0, + recordsSampleSize: 0, + mean: "", + twap: "", + firstTimestamp: BigInt(0), + lastTimestamp: BigInt(0), + minPrice: "", + maxPrice: "", + medianPrice: "" + }; +} +export const MetadataStatistics = { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics", + is(o: any): o is MetadataStatistics { + return o && (o.$typeUrl === MetadataStatistics.typeUrl || typeof o.groupCount === "number" && typeof o.recordsSampleSize === "number" && typeof o.mean === "string" && typeof o.twap === "string" && typeof o.firstTimestamp === "bigint" && typeof o.lastTimestamp === "bigint" && typeof o.minPrice === "string" && typeof o.maxPrice === "string" && typeof o.medianPrice === "string"); + }, + isAmino(o: any): o is MetadataStatisticsAmino { + return o && (o.$typeUrl === MetadataStatistics.typeUrl || typeof o.group_count === "number" && typeof o.records_sample_size === "number" && typeof o.mean === "string" && typeof o.twap === "string" && typeof o.first_timestamp === "bigint" && typeof o.last_timestamp === "bigint" && typeof o.min_price === "string" && typeof o.max_price === "string" && typeof o.median_price === "string"); + }, + encode(message: MetadataStatistics, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupCount !== 0) { + writer.uint32(8).uint32(message.groupCount); + } + if (message.recordsSampleSize !== 0) { + writer.uint32(16).uint32(message.recordsSampleSize); + } + if (message.mean !== "") { + writer.uint32(26).string(message.mean); + } + if (message.twap !== "") { + writer.uint32(34).string(message.twap); + } + if (message.firstTimestamp !== BigInt(0)) { + writer.uint32(40).int64(message.firstTimestamp); + } + if (message.lastTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.lastTimestamp); + } + if (message.minPrice !== "") { + writer.uint32(58).string(message.minPrice); + } + if (message.maxPrice !== "") { + writer.uint32(66).string(message.maxPrice); + } + if (message.medianPrice !== "") { + writer.uint32(74).string(message.medianPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MetadataStatistics { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadataStatistics(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupCount = reader.uint32(); + break; + case 2: + message.recordsSampleSize = reader.uint32(); + break; + case 3: + message.mean = reader.string(); + break; + case 4: + message.twap = reader.string(); + break; + case 5: + message.firstTimestamp = reader.int64(); + break; + case 6: + message.lastTimestamp = reader.int64(); + break; + case 7: + message.minPrice = reader.string(); + break; + case 8: + message.maxPrice = reader.string(); + break; + case 9: + message.medianPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MetadataStatistics { + const message = createBaseMetadataStatistics(); + message.groupCount = object.groupCount ?? 0; + message.recordsSampleSize = object.recordsSampleSize ?? 0; + message.mean = object.mean ?? ""; + message.twap = object.twap ?? ""; + message.firstTimestamp = object.firstTimestamp !== undefined && object.firstTimestamp !== null ? BigInt(object.firstTimestamp.toString()) : BigInt(0); + message.lastTimestamp = object.lastTimestamp !== undefined && object.lastTimestamp !== null ? BigInt(object.lastTimestamp.toString()) : BigInt(0); + message.minPrice = object.minPrice ?? ""; + message.maxPrice = object.maxPrice ?? ""; + message.medianPrice = object.medianPrice ?? ""; + return message; + }, + fromAmino(object: MetadataStatisticsAmino): MetadataStatistics { + const message = createBaseMetadataStatistics(); + if (object.group_count !== undefined && object.group_count !== null) { + message.groupCount = object.group_count; + } + if (object.records_sample_size !== undefined && object.records_sample_size !== null) { + message.recordsSampleSize = object.records_sample_size; + } + if (object.mean !== undefined && object.mean !== null) { + message.mean = object.mean; + } + if (object.twap !== undefined && object.twap !== null) { + message.twap = object.twap; + } + if (object.first_timestamp !== undefined && object.first_timestamp !== null) { + message.firstTimestamp = BigInt(object.first_timestamp); + } + if (object.last_timestamp !== undefined && object.last_timestamp !== null) { + message.lastTimestamp = BigInt(object.last_timestamp); + } + if (object.min_price !== undefined && object.min_price !== null) { + message.minPrice = object.min_price; + } + if (object.max_price !== undefined && object.max_price !== null) { + message.maxPrice = object.max_price; + } + if (object.median_price !== undefined && object.median_price !== null) { + message.medianPrice = object.median_price; + } + return message; + }, + toAmino(message: MetadataStatistics): MetadataStatisticsAmino { + const obj: any = {}; + obj.group_count = message.groupCount === 0 ? undefined : message.groupCount; + obj.records_sample_size = message.recordsSampleSize === 0 ? undefined : message.recordsSampleSize; + obj.mean = message.mean === "" ? undefined : message.mean; + obj.twap = message.twap === "" ? undefined : message.twap; + obj.first_timestamp = message.firstTimestamp !== BigInt(0) ? message.firstTimestamp?.toString() : undefined; + obj.last_timestamp = message.lastTimestamp !== BigInt(0) ? message.lastTimestamp?.toString() : undefined; + obj.min_price = message.minPrice === "" ? undefined : message.minPrice; + obj.max_price = message.maxPrice === "" ? undefined : message.maxPrice; + obj.median_price = message.medianPrice === "" ? undefined : message.medianPrice; + return obj; + }, + fromAminoMsg(object: MetadataStatisticsAminoMsg): MetadataStatistics { + return MetadataStatistics.fromAmino(object.value); + }, + fromProtoMsg(message: MetadataStatisticsProtoMsg): MetadataStatistics { + return MetadataStatistics.decode(message.value); + }, + toProto(message: MetadataStatistics): Uint8Array { + return MetadataStatistics.encode(message).finish(); + }, + toProtoMsg(message: MetadataStatistics): MetadataStatisticsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MetadataStatistics", + value: MetadataStatistics.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MetadataStatistics.typeUrl, MetadataStatistics); +function createBasePriceAttestation(): PriceAttestation { + return { + priceId: "", + price: BigInt(0), + conf: BigInt(0), + expo: 0, + emaPrice: BigInt(0), + emaConf: BigInt(0), + emaExpo: 0, + publishTime: BigInt(0) + }; +} +export const PriceAttestation = { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation", + is(o: any): o is PriceAttestation { + return o && (o.$typeUrl === PriceAttestation.typeUrl || typeof o.priceId === "string" && typeof o.price === "bigint" && typeof o.conf === "bigint" && typeof o.expo === "number" && typeof o.emaPrice === "bigint" && typeof o.emaConf === "bigint" && typeof o.emaExpo === "number" && typeof o.publishTime === "bigint"); + }, + isAmino(o: any): o is PriceAttestationAmino { + return o && (o.$typeUrl === PriceAttestation.typeUrl || typeof o.price_id === "string" && typeof o.price === "bigint" && typeof o.conf === "bigint" && typeof o.expo === "number" && typeof o.ema_price === "bigint" && typeof o.ema_conf === "bigint" && typeof o.ema_expo === "number" && typeof o.publish_time === "bigint"); + }, + encode(message: PriceAttestation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + if (message.price !== BigInt(0)) { + writer.uint32(16).int64(message.price); + } + if (message.conf !== BigInt(0)) { + writer.uint32(24).uint64(message.conf); + } + if (message.expo !== 0) { + writer.uint32(32).int32(message.expo); + } + if (message.emaPrice !== BigInt(0)) { + writer.uint32(40).int64(message.emaPrice); + } + if (message.emaConf !== BigInt(0)) { + writer.uint32(48).uint64(message.emaConf); + } + if (message.emaExpo !== 0) { + writer.uint32(56).int32(message.emaExpo); + } + if (message.publishTime !== BigInt(0)) { + writer.uint32(64).int64(message.publishTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceAttestation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceAttestation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + case 2: + message.price = reader.int64(); + break; + case 3: + message.conf = reader.uint64(); + break; + case 4: + message.expo = reader.int32(); + break; + case 5: + message.emaPrice = reader.int64(); + break; + case 6: + message.emaConf = reader.uint64(); + break; + case 7: + message.emaExpo = reader.int32(); + break; + case 8: + message.publishTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PriceAttestation { + const message = createBasePriceAttestation(); + message.priceId = object.priceId ?? ""; + message.price = object.price !== undefined && object.price !== null ? BigInt(object.price.toString()) : BigInt(0); + message.conf = object.conf !== undefined && object.conf !== null ? BigInt(object.conf.toString()) : BigInt(0); + message.expo = object.expo ?? 0; + message.emaPrice = object.emaPrice !== undefined && object.emaPrice !== null ? BigInt(object.emaPrice.toString()) : BigInt(0); + message.emaConf = object.emaConf !== undefined && object.emaConf !== null ? BigInt(object.emaConf.toString()) : BigInt(0); + message.emaExpo = object.emaExpo ?? 0; + message.publishTime = object.publishTime !== undefined && object.publishTime !== null ? BigInt(object.publishTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PriceAttestationAmino): PriceAttestation { + const message = createBasePriceAttestation(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + if (object.price !== undefined && object.price !== null) { + message.price = BigInt(object.price); + } + if (object.conf !== undefined && object.conf !== null) { + message.conf = BigInt(object.conf); + } + if (object.expo !== undefined && object.expo !== null) { + message.expo = object.expo; + } + if (object.ema_price !== undefined && object.ema_price !== null) { + message.emaPrice = BigInt(object.ema_price); + } + if (object.ema_conf !== undefined && object.ema_conf !== null) { + message.emaConf = BigInt(object.ema_conf); + } + if (object.ema_expo !== undefined && object.ema_expo !== null) { + message.emaExpo = object.ema_expo; + } + if (object.publish_time !== undefined && object.publish_time !== null) { + message.publishTime = BigInt(object.publish_time); + } + return message; + }, + toAmino(message: PriceAttestation): PriceAttestationAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + obj.price = message.price !== BigInt(0) ? message.price?.toString() : undefined; + obj.conf = message.conf !== BigInt(0) ? message.conf?.toString() : undefined; + obj.expo = message.expo === 0 ? undefined : message.expo; + obj.ema_price = message.emaPrice !== BigInt(0) ? message.emaPrice?.toString() : undefined; + obj.ema_conf = message.emaConf !== BigInt(0) ? message.emaConf?.toString() : undefined; + obj.ema_expo = message.emaExpo === 0 ? undefined : message.emaExpo; + obj.publish_time = message.publishTime !== BigInt(0) ? message.publishTime?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PriceAttestationAminoMsg): PriceAttestation { + return PriceAttestation.fromAmino(object.value); + }, + fromProtoMsg(message: PriceAttestationProtoMsg): PriceAttestation { + return PriceAttestation.decode(message.value); + }, + toProto(message: PriceAttestation): Uint8Array { + return PriceAttestation.encode(message).finish(); + }, + toProtoMsg(message: PriceAttestation): PriceAttestationProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PriceAttestation", + value: PriceAttestation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PriceAttestation.typeUrl, PriceAttestation); +function createBaseAssetPair(): AssetPair { + return { + assetId: "", + signedPrices: [] + }; +} +export const AssetPair = { + typeUrl: "/injective.oracle.v1beta1.AssetPair", + is(o: any): o is AssetPair { + return o && (o.$typeUrl === AssetPair.typeUrl || typeof o.assetId === "string" && Array.isArray(o.signedPrices) && (!o.signedPrices.length || SignedPriceOfAssetPair.is(o.signedPrices[0]))); + }, + isAmino(o: any): o is AssetPairAmino { + return o && (o.$typeUrl === AssetPair.typeUrl || typeof o.asset_id === "string" && Array.isArray(o.signed_prices) && (!o.signed_prices.length || SignedPriceOfAssetPair.isAmino(o.signed_prices[0]))); + }, + encode(message: AssetPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetId !== "") { + writer.uint32(10).string(message.assetId); + } + for (const v of message.signedPrices) { + SignedPriceOfAssetPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AssetPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetId = reader.string(); + break; + case 2: + message.signedPrices.push(SignedPriceOfAssetPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AssetPair { + const message = createBaseAssetPair(); + message.assetId = object.assetId ?? ""; + message.signedPrices = object.signedPrices?.map(e => SignedPriceOfAssetPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AssetPairAmino): AssetPair { + const message = createBaseAssetPair(); + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + message.signedPrices = object.signed_prices?.map(e => SignedPriceOfAssetPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: AssetPair): AssetPairAmino { + const obj: any = {}; + obj.asset_id = message.assetId === "" ? undefined : message.assetId; + if (message.signedPrices) { + obj.signed_prices = message.signedPrices.map(e => e ? SignedPriceOfAssetPair.toAmino(e) : undefined); + } else { + obj.signed_prices = message.signedPrices; + } + return obj; + }, + fromAminoMsg(object: AssetPairAminoMsg): AssetPair { + return AssetPair.fromAmino(object.value); + }, + fromProtoMsg(message: AssetPairProtoMsg): AssetPair { + return AssetPair.decode(message.value); + }, + toProto(message: AssetPair): Uint8Array { + return AssetPair.encode(message).finish(); + }, + toProtoMsg(message: AssetPair): AssetPairProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.AssetPair", + value: AssetPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AssetPair.typeUrl, AssetPair); +function createBaseSignedPriceOfAssetPair(): SignedPriceOfAssetPair { + return { + publisherKey: "", + timestamp: BigInt(0), + price: "", + signature: new Uint8Array() + }; +} +export const SignedPriceOfAssetPair = { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair", + is(o: any): o is SignedPriceOfAssetPair { + return o && (o.$typeUrl === SignedPriceOfAssetPair.typeUrl || typeof o.publisherKey === "string" && typeof o.timestamp === "bigint" && typeof o.price === "string" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is SignedPriceOfAssetPairAmino { + return o && (o.$typeUrl === SignedPriceOfAssetPair.typeUrl || typeof o.publisher_key === "string" && typeof o.timestamp === "bigint" && typeof o.price === "string" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: SignedPriceOfAssetPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publisherKey !== "") { + writer.uint32(10).string(message.publisherKey); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.price !== "") { + writer.uint32(26).string(message.price); + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedPriceOfAssetPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedPriceOfAssetPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisherKey = reader.string(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.price = reader.string(); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignedPriceOfAssetPair { + const message = createBaseSignedPriceOfAssetPair(); + message.publisherKey = object.publisherKey ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.price = object.price ?? ""; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignedPriceOfAssetPairAmino): SignedPriceOfAssetPair { + const message = createBaseSignedPriceOfAssetPair(); + if (object.publisher_key !== undefined && object.publisher_key !== null) { + message.publisherKey = object.publisher_key; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: SignedPriceOfAssetPair): SignedPriceOfAssetPairAmino { + const obj: any = {}; + obj.publisher_key = message.publisherKey === "" ? undefined : message.publisherKey; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp?.toString() : undefined; + obj.price = message.price === "" ? undefined : message.price; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignedPriceOfAssetPairAminoMsg): SignedPriceOfAssetPair { + return SignedPriceOfAssetPair.fromAmino(object.value); + }, + fromProtoMsg(message: SignedPriceOfAssetPairProtoMsg): SignedPriceOfAssetPair { + return SignedPriceOfAssetPair.decode(message.value); + }, + toProto(message: SignedPriceOfAssetPair): Uint8Array { + return SignedPriceOfAssetPair.encode(message).finish(); + }, + toProtoMsg(message: SignedPriceOfAssetPair): SignedPriceOfAssetPairProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.SignedPriceOfAssetPair", + value: SignedPriceOfAssetPair.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignedPriceOfAssetPair.typeUrl, SignedPriceOfAssetPair); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/proposal.ts b/libs/injectivejs/src/injective/oracle/v1beta1/proposal.ts new file mode 100644 index 00000000..453fdef3 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/proposal.ts @@ -0,0 +1,1449 @@ +import { BandOracleRequest, BandOracleRequestAmino, BandIBCParams, BandIBCParamsAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface GrantBandOraclePrivilegeProposal { + title: string; + description: string; + relayers: string[]; +} +export interface GrantBandOraclePrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal"; + value: Uint8Array; +} +export interface GrantBandOraclePrivilegeProposalAmino { + title: string; + description: string; + relayers: string[]; +} +export interface GrantBandOraclePrivilegeProposalAminoMsg { + type: "oracle/GrantBandOraclePrivilegeProposal"; + value: GrantBandOraclePrivilegeProposalAmino; +} +export interface RevokeBandOraclePrivilegeProposal { + title: string; + description: string; + relayers: string[]; +} +export interface RevokeBandOraclePrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeBandOraclePrivilegeProposalAmino { + title: string; + description: string; + relayers: string[]; +} +export interface RevokeBandOraclePrivilegeProposalAminoMsg { + type: "oracle/RevokeBandOraclePrivilegeProposal"; + value: RevokeBandOraclePrivilegeProposalAmino; +} +export interface GrantPriceFeederPrivilegeProposal { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface GrantPriceFeederPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantPriceFeederPrivilegeProposalAmino { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface GrantPriceFeederPrivilegeProposalAminoMsg { + type: "oracle/GrantPriceFeederPrivilegeProposal"; + value: GrantPriceFeederPrivilegeProposalAmino; +} +export interface GrantProviderPrivilegeProposal { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface GrantProviderPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantProviderPrivilegeProposalAmino { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface GrantProviderPrivilegeProposalAminoMsg { + type: "oracle/GrantProviderPrivilegeProposal"; + value: GrantProviderPrivilegeProposalAmino; +} +export interface RevokeProviderPrivilegeProposal { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface RevokeProviderPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeProviderPrivilegeProposalAmino { + title: string; + description: string; + provider: string; + relayers: string[]; +} +export interface RevokeProviderPrivilegeProposalAminoMsg { + type: "oracle/RevokeProviderPrivilegeProposal"; + value: RevokeProviderPrivilegeProposalAmino; +} +export interface RevokePriceFeederPrivilegeProposal { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface RevokePriceFeederPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokePriceFeederPrivilegeProposalAmino { + title: string; + description: string; + base: string; + quote: string; + relayers: string[]; +} +export interface RevokePriceFeederPrivilegeProposalAminoMsg { + type: "oracle/RevokePriceFeederPrivilegeProposal"; + value: RevokePriceFeederPrivilegeProposalAmino; +} +export interface AuthorizeBandOracleRequestProposal { + title: string; + description: string; + request: BandOracleRequest; +} +export interface AuthorizeBandOracleRequestProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal"; + value: Uint8Array; +} +export interface AuthorizeBandOracleRequestProposalAmino { + title: string; + description: string; + request: BandOracleRequestAmino; +} +export interface AuthorizeBandOracleRequestProposalAminoMsg { + type: "oracle/AuthorizeBandOracleRequestProposal"; + value: AuthorizeBandOracleRequestProposalAmino; +} +export interface UpdateBandOracleRequestProposal { + title: string; + description: string; + deleteRequestIds: bigint[]; + updateOracleRequest?: BandOracleRequest; +} +export interface UpdateBandOracleRequestProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal"; + value: Uint8Array; +} +export interface UpdateBandOracleRequestProposalAmino { + title: string; + description: string; + delete_request_ids: string[]; + update_oracle_request?: BandOracleRequestAmino; +} +export interface UpdateBandOracleRequestProposalAminoMsg { + type: "oracle/UpdateBandOracleRequestProposal"; + value: UpdateBandOracleRequestProposalAmino; +} +export interface EnableBandIBCProposal { + title: string; + description: string; + bandIbcParams: BandIBCParams; +} +export interface EnableBandIBCProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal"; + value: Uint8Array; +} +export interface EnableBandIBCProposalAmino { + title: string; + description: string; + band_ibc_params: BandIBCParamsAmino; +} +export interface EnableBandIBCProposalAminoMsg { + type: "oracle/EnableBandIBCProposal"; + value: EnableBandIBCProposalAmino; +} +export interface GrantStorkPublisherPrivilegeProposal { + title: string; + description: string; + storkPublishers: string[]; +} +export interface GrantStorkPublisherPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal"; + value: Uint8Array; +} +export interface GrantStorkPublisherPrivilegeProposalAmino { + title: string; + description: string; + stork_publishers: string[]; +} +export interface GrantStorkPublisherPrivilegeProposalAminoMsg { + type: "oracle/GrantStorkPublisherPrivilegeProposal"; + value: GrantStorkPublisherPrivilegeProposalAmino; +} +export interface RevokeStorkPublisherPrivilegeProposal { + title: string; + description: string; + storkPublishers: string[]; +} +export interface RevokeStorkPublisherPrivilegeProposalProtoMsg { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal"; + value: Uint8Array; +} +export interface RevokeStorkPublisherPrivilegeProposalAmino { + title: string; + description: string; + stork_publishers: string[]; +} +export interface RevokeStorkPublisherPrivilegeProposalAminoMsg { + type: "oracle/RevokeStorkPublisherPrivilegeProposal"; + value: RevokeStorkPublisherPrivilegeProposalAmino; +} +function createBaseGrantBandOraclePrivilegeProposal(): GrantBandOraclePrivilegeProposal { + return { + title: "", + description: "", + relayers: [] + }; +} +export const GrantBandOraclePrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal", + aminoType: "oracle/GrantBandOraclePrivilegeProposal", + is(o: any): o is GrantBandOraclePrivilegeProposal { + return o && (o.$typeUrl === GrantBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantBandOraclePrivilegeProposalAmino { + return o && (o.$typeUrl === GrantBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantBandOraclePrivilegeProposal, 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.relayers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantBandOraclePrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantBandOraclePrivilegeProposal(); + 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.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantBandOraclePrivilegeProposal { + const message = createBaseGrantBandOraclePrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantBandOraclePrivilegeProposalAmino): GrantBandOraclePrivilegeProposal { + const message = createBaseGrantBandOraclePrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantBandOraclePrivilegeProposalAminoMsg): GrantBandOraclePrivilegeProposal { + return GrantBandOraclePrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalAminoMsg { + return { + type: "oracle/GrantBandOraclePrivilegeProposal", + value: GrantBandOraclePrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantBandOraclePrivilegeProposalProtoMsg): GrantBandOraclePrivilegeProposal { + return GrantBandOraclePrivilegeProposal.decode(message.value); + }, + toProto(message: GrantBandOraclePrivilegeProposal): Uint8Array { + return GrantBandOraclePrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantBandOraclePrivilegeProposal): GrantBandOraclePrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantBandOraclePrivilegeProposal", + value: GrantBandOraclePrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantBandOraclePrivilegeProposal.typeUrl, GrantBandOraclePrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantBandOraclePrivilegeProposal.aminoType, GrantBandOraclePrivilegeProposal.typeUrl); +function createBaseRevokeBandOraclePrivilegeProposal(): RevokeBandOraclePrivilegeProposal { + return { + title: "", + description: "", + relayers: [] + }; +} +export const RevokeBandOraclePrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal", + aminoType: "oracle/RevokeBandOraclePrivilegeProposal", + is(o: any): o is RevokeBandOraclePrivilegeProposal { + return o && (o.$typeUrl === RevokeBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokeBandOraclePrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeBandOraclePrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokeBandOraclePrivilegeProposal, 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.relayers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeBandOraclePrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeBandOraclePrivilegeProposal(); + 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.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeBandOraclePrivilegeProposal { + const message = createBaseRevokeBandOraclePrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeBandOraclePrivilegeProposalAmino): RevokeBandOraclePrivilegeProposal { + const message = createBaseRevokeBandOraclePrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokeBandOraclePrivilegeProposalAminoMsg): RevokeBandOraclePrivilegeProposal { + return RevokeBandOraclePrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeBandOraclePrivilegeProposal", + value: RevokeBandOraclePrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeBandOraclePrivilegeProposalProtoMsg): RevokeBandOraclePrivilegeProposal { + return RevokeBandOraclePrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeBandOraclePrivilegeProposal): Uint8Array { + return RevokeBandOraclePrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeBandOraclePrivilegeProposal): RevokeBandOraclePrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeBandOraclePrivilegeProposal", + value: RevokeBandOraclePrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeBandOraclePrivilegeProposal.typeUrl, RevokeBandOraclePrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeBandOraclePrivilegeProposal.aminoType, RevokeBandOraclePrivilegeProposal.typeUrl); +function createBaseGrantPriceFeederPrivilegeProposal(): GrantPriceFeederPrivilegeProposal { + return { + title: "", + description: "", + base: "", + quote: "", + relayers: [] + }; +} +export const GrantPriceFeederPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal", + aminoType: "oracle/GrantPriceFeederPrivilegeProposal", + is(o: any): o is GrantPriceFeederPrivilegeProposal { + return o && (o.$typeUrl === GrantPriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantPriceFeederPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantPriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantPriceFeederPrivilegeProposal, 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.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.quote !== "") { + writer.uint32(34).string(message.quote); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantPriceFeederPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantPriceFeederPrivilegeProposal(); + 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.base = reader.string(); + break; + case 4: + message.quote = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantPriceFeederPrivilegeProposal { + const message = createBaseGrantPriceFeederPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantPriceFeederPrivilegeProposalAmino): GrantPriceFeederPrivilegeProposal { + const message = createBaseGrantPriceFeederPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantPriceFeederPrivilegeProposalAminoMsg): GrantPriceFeederPrivilegeProposal { + return GrantPriceFeederPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantPriceFeederPrivilegeProposal", + value: GrantPriceFeederPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantPriceFeederPrivilegeProposalProtoMsg): GrantPriceFeederPrivilegeProposal { + return GrantPriceFeederPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantPriceFeederPrivilegeProposal): Uint8Array { + return GrantPriceFeederPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantPriceFeederPrivilegeProposal): GrantPriceFeederPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantPriceFeederPrivilegeProposal", + value: GrantPriceFeederPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantPriceFeederPrivilegeProposal.typeUrl, GrantPriceFeederPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantPriceFeederPrivilegeProposal.aminoType, GrantPriceFeederPrivilegeProposal.typeUrl); +function createBaseGrantProviderPrivilegeProposal(): GrantProviderPrivilegeProposal { + return { + title: "", + description: "", + provider: "", + relayers: [] + }; +} +export const GrantProviderPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal", + aminoType: "oracle/GrantProviderPrivilegeProposal", + is(o: any): o is GrantProviderPrivilegeProposal { + return o && (o.$typeUrl === GrantProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is GrantProviderPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: GrantProviderPrivilegeProposal, 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.provider !== "") { + writer.uint32(26).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantProviderPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantProviderPrivilegeProposal(); + 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.provider = reader.string(); + break; + case 4: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantProviderPrivilegeProposal { + const message = createBaseGrantProviderPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantProviderPrivilegeProposalAmino): GrantProviderPrivilegeProposal { + const message = createBaseGrantProviderPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: GrantProviderPrivilegeProposalAminoMsg): GrantProviderPrivilegeProposal { + return GrantProviderPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantProviderPrivilegeProposal", + value: GrantProviderPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProviderPrivilegeProposalProtoMsg): GrantProviderPrivilegeProposal { + return GrantProviderPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantProviderPrivilegeProposal): Uint8Array { + return GrantProviderPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantProviderPrivilegeProposal): GrantProviderPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantProviderPrivilegeProposal", + value: GrantProviderPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantProviderPrivilegeProposal.typeUrl, GrantProviderPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantProviderPrivilegeProposal.aminoType, GrantProviderPrivilegeProposal.typeUrl); +function createBaseRevokeProviderPrivilegeProposal(): RevokeProviderPrivilegeProposal { + return { + title: "", + description: "", + provider: "", + relayers: [] + }; +} +export const RevokeProviderPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal", + aminoType: "oracle/RevokeProviderPrivilegeProposal", + is(o: any): o is RevokeProviderPrivilegeProposal { + return o && (o.$typeUrl === RevokeProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokeProviderPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeProviderPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.provider === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokeProviderPrivilegeProposal, 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.provider !== "") { + writer.uint32(26).string(message.provider); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeProviderPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeProviderPrivilegeProposal(); + 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.provider = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeProviderPrivilegeProposal { + const message = createBaseRevokeProviderPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.provider = object.provider ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeProviderPrivilegeProposalAmino): RevokeProviderPrivilegeProposal { + const message = createBaseRevokeProviderPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokeProviderPrivilegeProposalAminoMsg): RevokeProviderPrivilegeProposal { + return RevokeProviderPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeProviderPrivilegeProposal", + value: RevokeProviderPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeProviderPrivilegeProposalProtoMsg): RevokeProviderPrivilegeProposal { + return RevokeProviderPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeProviderPrivilegeProposal): Uint8Array { + return RevokeProviderPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeProviderPrivilegeProposal): RevokeProviderPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeProviderPrivilegeProposal", + value: RevokeProviderPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeProviderPrivilegeProposal.typeUrl, RevokeProviderPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeProviderPrivilegeProposal.aminoType, RevokeProviderPrivilegeProposal.typeUrl); +function createBaseRevokePriceFeederPrivilegeProposal(): RevokePriceFeederPrivilegeProposal { + return { + title: "", + description: "", + base: "", + quote: "", + relayers: [] + }; +} +export const RevokePriceFeederPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal", + aminoType: "oracle/RevokePriceFeederPrivilegeProposal", + is(o: any): o is RevokePriceFeederPrivilegeProposal { + return o && (o.$typeUrl === RevokePriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is RevokePriceFeederPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokePriceFeederPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.base === "string" && typeof o.quote === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: RevokePriceFeederPrivilegeProposal, 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.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.quote !== "") { + writer.uint32(34).string(message.quote); + } + for (const v of message.relayers) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokePriceFeederPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokePriceFeederPrivilegeProposal(); + 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.base = reader.string(); + break; + case 4: + message.quote = reader.string(); + break; + case 5: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokePriceFeederPrivilegeProposal { + const message = createBaseRevokePriceFeederPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokePriceFeederPrivilegeProposalAmino): RevokePriceFeederPrivilegeProposal { + const message = createBaseRevokePriceFeederPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: RevokePriceFeederPrivilegeProposalAminoMsg): RevokePriceFeederPrivilegeProposal { + return RevokePriceFeederPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokePriceFeederPrivilegeProposal", + value: RevokePriceFeederPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokePriceFeederPrivilegeProposalProtoMsg): RevokePriceFeederPrivilegeProposal { + return RevokePriceFeederPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokePriceFeederPrivilegeProposal): Uint8Array { + return RevokePriceFeederPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokePriceFeederPrivilegeProposal): RevokePriceFeederPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokePriceFeederPrivilegeProposal", + value: RevokePriceFeederPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokePriceFeederPrivilegeProposal.typeUrl, RevokePriceFeederPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokePriceFeederPrivilegeProposal.aminoType, RevokePriceFeederPrivilegeProposal.typeUrl); +function createBaseAuthorizeBandOracleRequestProposal(): AuthorizeBandOracleRequestProposal { + return { + title: "", + description: "", + request: BandOracleRequest.fromPartial({}) + }; +} +export const AuthorizeBandOracleRequestProposal = { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal", + aminoType: "oracle/AuthorizeBandOracleRequestProposal", + is(o: any): o is AuthorizeBandOracleRequestProposal { + return o && (o.$typeUrl === AuthorizeBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandOracleRequest.is(o.request)); + }, + isAmino(o: any): o is AuthorizeBandOracleRequestProposalAmino { + return o && (o.$typeUrl === AuthorizeBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandOracleRequest.isAmino(o.request)); + }, + encode(message: AuthorizeBandOracleRequestProposal, 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.request !== undefined) { + BandOracleRequest.encode(message.request, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuthorizeBandOracleRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthorizeBandOracleRequestProposal(); + 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.request = BandOracleRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AuthorizeBandOracleRequestProposal { + const message = createBaseAuthorizeBandOracleRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.request = object.request !== undefined && object.request !== null ? BandOracleRequest.fromPartial(object.request) : undefined; + return message; + }, + fromAmino(object: AuthorizeBandOracleRequestProposalAmino): AuthorizeBandOracleRequestProposal { + const message = createBaseAuthorizeBandOracleRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.request !== undefined && object.request !== null) { + message.request = BandOracleRequest.fromAmino(object.request); + } + return message; + }, + toAmino(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.request = message.request ? BandOracleRequest.toAmino(message.request) : undefined; + return obj; + }, + fromAminoMsg(object: AuthorizeBandOracleRequestProposalAminoMsg): AuthorizeBandOracleRequestProposal { + return AuthorizeBandOracleRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalAminoMsg { + return { + type: "oracle/AuthorizeBandOracleRequestProposal", + value: AuthorizeBandOracleRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: AuthorizeBandOracleRequestProposalProtoMsg): AuthorizeBandOracleRequestProposal { + return AuthorizeBandOracleRequestProposal.decode(message.value); + }, + toProto(message: AuthorizeBandOracleRequestProposal): Uint8Array { + return AuthorizeBandOracleRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: AuthorizeBandOracleRequestProposal): AuthorizeBandOracleRequestProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.AuthorizeBandOracleRequestProposal", + value: AuthorizeBandOracleRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AuthorizeBandOracleRequestProposal.typeUrl, AuthorizeBandOracleRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthorizeBandOracleRequestProposal.aminoType, AuthorizeBandOracleRequestProposal.typeUrl); +function createBaseUpdateBandOracleRequestProposal(): UpdateBandOracleRequestProposal { + return { + title: "", + description: "", + deleteRequestIds: [], + updateOracleRequest: undefined + }; +} +export const UpdateBandOracleRequestProposal = { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal", + aminoType: "oracle/UpdateBandOracleRequestProposal", + is(o: any): o is UpdateBandOracleRequestProposal { + return o && (o.$typeUrl === UpdateBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.deleteRequestIds) && (!o.deleteRequestIds.length || typeof o.deleteRequestIds[0] === "bigint")); + }, + isAmino(o: any): o is UpdateBandOracleRequestProposalAmino { + return o && (o.$typeUrl === UpdateBandOracleRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.delete_request_ids) && (!o.delete_request_ids.length || typeof o.delete_request_ids[0] === "bigint")); + }, + encode(message: UpdateBandOracleRequestProposal, 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.deleteRequestIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.updateOracleRequest !== undefined) { + BandOracleRequest.encode(message.updateOracleRequest, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateBandOracleRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateBandOracleRequestProposal(); + 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.deleteRequestIds.push(reader.uint64()); + } + } else { + message.deleteRequestIds.push(reader.uint64()); + } + break; + case 4: + message.updateOracleRequest = BandOracleRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): UpdateBandOracleRequestProposal { + const message = createBaseUpdateBandOracleRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.deleteRequestIds = object.deleteRequestIds?.map(e => BigInt(e.toString())) || []; + message.updateOracleRequest = object.updateOracleRequest !== undefined && object.updateOracleRequest !== null ? BandOracleRequest.fromPartial(object.updateOracleRequest) : undefined; + return message; + }, + fromAmino(object: UpdateBandOracleRequestProposalAmino): UpdateBandOracleRequestProposal { + const message = createBaseUpdateBandOracleRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.deleteRequestIds = object.delete_request_ids?.map(e => BigInt(e)) || []; + if (object.update_oracle_request !== undefined && object.update_oracle_request !== null) { + message.updateOracleRequest = BandOracleRequest.fromAmino(object.update_oracle_request); + } + return message; + }, + toAmino(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.deleteRequestIds) { + obj.delete_request_ids = message.deleteRequestIds.map(e => e.toString()); + } else { + obj.delete_request_ids = message.deleteRequestIds; + } + obj.update_oracle_request = message.updateOracleRequest ? BandOracleRequest.toAmino(message.updateOracleRequest) : undefined; + return obj; + }, + fromAminoMsg(object: UpdateBandOracleRequestProposalAminoMsg): UpdateBandOracleRequestProposal { + return UpdateBandOracleRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalAminoMsg { + return { + type: "oracle/UpdateBandOracleRequestProposal", + value: UpdateBandOracleRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateBandOracleRequestProposalProtoMsg): UpdateBandOracleRequestProposal { + return UpdateBandOracleRequestProposal.decode(message.value); + }, + toProto(message: UpdateBandOracleRequestProposal): Uint8Array { + return UpdateBandOracleRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateBandOracleRequestProposal): UpdateBandOracleRequestProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.UpdateBandOracleRequestProposal", + value: UpdateBandOracleRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UpdateBandOracleRequestProposal.typeUrl, UpdateBandOracleRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateBandOracleRequestProposal.aminoType, UpdateBandOracleRequestProposal.typeUrl); +function createBaseEnableBandIBCProposal(): EnableBandIBCProposal { + return { + title: "", + description: "", + bandIbcParams: BandIBCParams.fromPartial({}) + }; +} +export const EnableBandIBCProposal = { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal", + aminoType: "oracle/EnableBandIBCProposal", + is(o: any): o is EnableBandIBCProposal { + return o && (o.$typeUrl === EnableBandIBCProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandIBCParams.is(o.bandIbcParams)); + }, + isAmino(o: any): o is EnableBandIBCProposalAmino { + return o && (o.$typeUrl === EnableBandIBCProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && BandIBCParams.isAmino(o.band_ibc_params)); + }, + encode(message: EnableBandIBCProposal, 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.bandIbcParams !== undefined) { + BandIBCParams.encode(message.bandIbcParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnableBandIBCProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnableBandIBCProposal(); + 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.bandIbcParams = BandIBCParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EnableBandIBCProposal { + const message = createBaseEnableBandIBCProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.bandIbcParams = object.bandIbcParams !== undefined && object.bandIbcParams !== null ? BandIBCParams.fromPartial(object.bandIbcParams) : undefined; + return message; + }, + fromAmino(object: EnableBandIBCProposalAmino): EnableBandIBCProposal { + const message = createBaseEnableBandIBCProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.band_ibc_params !== undefined && object.band_ibc_params !== null) { + message.bandIbcParams = BandIBCParams.fromAmino(object.band_ibc_params); + } + return message; + }, + toAmino(message: EnableBandIBCProposal): EnableBandIBCProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.band_ibc_params = message.bandIbcParams ? BandIBCParams.toAmino(message.bandIbcParams) : undefined; + return obj; + }, + fromAminoMsg(object: EnableBandIBCProposalAminoMsg): EnableBandIBCProposal { + return EnableBandIBCProposal.fromAmino(object.value); + }, + toAminoMsg(message: EnableBandIBCProposal): EnableBandIBCProposalAminoMsg { + return { + type: "oracle/EnableBandIBCProposal", + value: EnableBandIBCProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EnableBandIBCProposalProtoMsg): EnableBandIBCProposal { + return EnableBandIBCProposal.decode(message.value); + }, + toProto(message: EnableBandIBCProposal): Uint8Array { + return EnableBandIBCProposal.encode(message).finish(); + }, + toProtoMsg(message: EnableBandIBCProposal): EnableBandIBCProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.EnableBandIBCProposal", + value: EnableBandIBCProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EnableBandIBCProposal.typeUrl, EnableBandIBCProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(EnableBandIBCProposal.aminoType, EnableBandIBCProposal.typeUrl); +function createBaseGrantStorkPublisherPrivilegeProposal(): GrantStorkPublisherPrivilegeProposal { + return { + title: "", + description: "", + storkPublishers: [] + }; +} +export const GrantStorkPublisherPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal", + aminoType: "oracle/GrantStorkPublisherPrivilegeProposal", + is(o: any): o is GrantStorkPublisherPrivilegeProposal { + return o && (o.$typeUrl === GrantStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is GrantStorkPublisherPrivilegeProposalAmino { + return o && (o.$typeUrl === GrantStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + encode(message: GrantStorkPublisherPrivilegeProposal, 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.storkPublishers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantStorkPublisherPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + 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.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GrantStorkPublisherPrivilegeProposal { + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantStorkPublisherPrivilegeProposalAmino): GrantStorkPublisherPrivilegeProposal { + const message = createBaseGrantStorkPublisherPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + return obj; + }, + fromAminoMsg(object: GrantStorkPublisherPrivilegeProposalAminoMsg): GrantStorkPublisherPrivilegeProposal { + return GrantStorkPublisherPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalAminoMsg { + return { + type: "oracle/GrantStorkPublisherPrivilegeProposal", + value: GrantStorkPublisherPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: GrantStorkPublisherPrivilegeProposalProtoMsg): GrantStorkPublisherPrivilegeProposal { + return GrantStorkPublisherPrivilegeProposal.decode(message.value); + }, + toProto(message: GrantStorkPublisherPrivilegeProposal): Uint8Array { + return GrantStorkPublisherPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: GrantStorkPublisherPrivilegeProposal): GrantStorkPublisherPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.GrantStorkPublisherPrivilegeProposal", + value: GrantStorkPublisherPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GrantStorkPublisherPrivilegeProposal.typeUrl, GrantStorkPublisherPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantStorkPublisherPrivilegeProposal.aminoType, GrantStorkPublisherPrivilegeProposal.typeUrl); +function createBaseRevokeStorkPublisherPrivilegeProposal(): RevokeStorkPublisherPrivilegeProposal { + return { + title: "", + description: "", + storkPublishers: [] + }; +} +export const RevokeStorkPublisherPrivilegeProposal = { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal", + aminoType: "oracle/RevokeStorkPublisherPrivilegeProposal", + is(o: any): o is RevokeStorkPublisherPrivilegeProposal { + return o && (o.$typeUrl === RevokeStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.storkPublishers) && (!o.storkPublishers.length || typeof o.storkPublishers[0] === "string")); + }, + isAmino(o: any): o is RevokeStorkPublisherPrivilegeProposalAmino { + return o && (o.$typeUrl === RevokeStorkPublisherPrivilegeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.stork_publishers) && (!o.stork_publishers.length || typeof o.stork_publishers[0] === "string")); + }, + encode(message: RevokeStorkPublisherPrivilegeProposal, 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.storkPublishers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeStorkPublisherPrivilegeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + 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.storkPublishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeStorkPublisherPrivilegeProposal { + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.storkPublishers = object.storkPublishers?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeStorkPublisherPrivilegeProposalAmino): RevokeStorkPublisherPrivilegeProposal { + const message = createBaseRevokeStorkPublisherPrivilegeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.storkPublishers = object.stork_publishers?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.storkPublishers) { + obj.stork_publishers = message.storkPublishers.map(e => e); + } else { + obj.stork_publishers = message.storkPublishers; + } + return obj; + }, + fromAminoMsg(object: RevokeStorkPublisherPrivilegeProposalAminoMsg): RevokeStorkPublisherPrivilegeProposal { + return RevokeStorkPublisherPrivilegeProposal.fromAmino(object.value); + }, + toAminoMsg(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalAminoMsg { + return { + type: "oracle/RevokeStorkPublisherPrivilegeProposal", + value: RevokeStorkPublisherPrivilegeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: RevokeStorkPublisherPrivilegeProposalProtoMsg): RevokeStorkPublisherPrivilegeProposal { + return RevokeStorkPublisherPrivilegeProposal.decode(message.value); + }, + toProto(message: RevokeStorkPublisherPrivilegeProposal): Uint8Array { + return RevokeStorkPublisherPrivilegeProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeStorkPublisherPrivilegeProposal): RevokeStorkPublisherPrivilegeProposalProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.RevokeStorkPublisherPrivilegeProposal", + value: RevokeStorkPublisherPrivilegeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeStorkPublisherPrivilegeProposal.typeUrl, RevokeStorkPublisherPrivilegeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RevokeStorkPublisherPrivilegeProposal.aminoType, RevokeStorkPublisherPrivilegeProposal.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/oracle/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..16f39b30 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/query.rpc.func.ts @@ -0,0 +1,121 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryBandRelayersRequest, QueryBandRelayersResponse, QueryBandPriceStatesRequest, QueryBandPriceStatesResponse, QueryBandIBCPriceStatesRequest, QueryBandIBCPriceStatesResponse, QueryPriceFeedPriceStatesRequest, QueryPriceFeedPriceStatesResponse, QueryCoinbasePriceStatesRequest, QueryCoinbasePriceStatesResponse, QueryPythPriceStatesRequest, QueryPythPriceStatesResponse, QueryStorkPriceStatesRequest, QueryStorkPriceStatesResponse, QueryStorkPublishersRequest, QueryStorkPublishersResponse, QueryProviderPriceStateRequest, QueryProviderPriceStateResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryHistoricalPriceRecordsRequest, QueryHistoricalPriceRecordsResponse, QueryOracleVolatilityRequest, QueryOracleVolatilityResponse, QueryOracleProvidersInfoRequest, QueryOracleProvidersInfoResponse, QueryOracleProviderPricesRequest, QueryOracleProviderPricesResponse, QueryOraclePriceRequest, QueryOraclePriceResponse, QueryPythPriceRequest, QueryPythPriceResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetBandRelayers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandRelayersRequest.encode, + decode: QueryBandRelayersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandRelayers", + clientResolver +}); +export const createGetBandPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandPriceStatesRequest.encode, + decode: QueryBandPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandPriceStates", + clientResolver +}); +export const createGetBandIBCPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBandIBCPriceStatesRequest.encode, + decode: QueryBandIBCPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "BandIBCPriceStates", + clientResolver +}); +export const createGetPriceFeedPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPriceFeedPriceStatesRequest.encode, + decode: QueryPriceFeedPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PriceFeedPriceStates", + clientResolver +}); +export const createGetCoinbasePriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCoinbasePriceStatesRequest.encode, + decode: QueryCoinbasePriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "CoinbasePriceStates", + clientResolver +}); +export const createGetPythPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceStatesRequest.encode, + decode: QueryPythPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPriceStates", + clientResolver +}); +export const createGetStorkPriceStates = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPriceStatesRequest.encode, + decode: QueryStorkPriceStatesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPriceStates", + clientResolver +}); +export const createGetStorkPublishers = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryStorkPublishersRequest.encode, + decode: QueryStorkPublishersResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "StorkPublishers", + clientResolver +}); +export const createGetProviderPriceState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryProviderPriceStateRequest.encode, + decode: QueryProviderPriceStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "ProviderPriceState", + clientResolver +}); +export const createGetOracleModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleModuleState", + clientResolver +}); +export const createGetHistoricalPriceRecords = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryHistoricalPriceRecordsRequest.encode, + decode: QueryHistoricalPriceRecordsResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "HistoricalPriceRecords", + clientResolver +}); +export const createGetOracleVolatility = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleVolatilityRequest.encode, + decode: QueryOracleVolatilityResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleVolatility", + clientResolver +}); +export const createGetOracleProvidersInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProvidersInfoRequest.encode, + decode: QueryOracleProvidersInfoResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProvidersInfo", + clientResolver +}); +export const createGetOracleProviderPrices = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOracleProviderPricesRequest.encode, + decode: QueryOracleProviderPricesResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OracleProviderPrices", + clientResolver +}); +export const createGetOraclePrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOraclePriceRequest.encode, + decode: QueryOraclePriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "OraclePrice", + clientResolver +}); +export const createGetPythPrice = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPythPriceRequest.encode, + decode: QueryPythPriceResponse.decode, + service: "injective.oracle.v1beta1.Query", + method: "PythPrice", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/query.ts b/libs/injectivejs/src/injective/oracle/v1beta1/query.ts new file mode 100644 index 00000000..e44832a4 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/query.ts @@ -0,0 +1,3446 @@ +import { OracleType, OracleInfo, OracleInfoAmino, PythPriceState, PythPriceStateAmino, Params, ParamsAmino, BandPriceState, BandPriceStateAmino, PriceFeedState, PriceFeedStateAmino, CoinbasePriceState, CoinbasePriceStateAmino, StorkPriceState, StorkPriceStateAmino, PriceState, PriceStateAmino, PriceRecords, PriceRecordsAmino, MetadataStatistics, MetadataStatisticsAmino, PriceRecord, PriceRecordAmino, ProviderInfo, ProviderInfoAmino, ProviderState, ProviderStateAmino } from "./oracle"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryPythPriceRequest { + priceId: string; +} +export interface QueryPythPriceRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest"; + value: Uint8Array; +} +export interface QueryPythPriceRequestAmino { + price_id: string; +} +export interface QueryPythPriceRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceRequest"; + value: QueryPythPriceRequestAmino; +} +export interface QueryPythPriceResponse { + priceState?: PythPriceState; +} +export interface QueryPythPriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse"; + value: Uint8Array; +} +export interface QueryPythPriceResponseAmino { + price_state?: PythPriceStateAmino; +} +export interface QueryPythPriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceResponse"; + value: QueryPythPriceResponseAmino; +} +/** + * QueryOracleParamsRequest is the request type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** + * QueryOracleParamsRequest is the request type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** + * QueryOracleParamsResponse is the response type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** + * QueryOracleParamsResponse is the response type for the Query/OracleParams RPC + * method. + */ +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryBandRelayersRequest is the request type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersRequest {} +export interface QueryBandRelayersRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest"; + value: Uint8Array; +} +/** + * QueryBandRelayersRequest is the request type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersRequestAmino {} +export interface QueryBandRelayersRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandRelayersRequest"; + value: QueryBandRelayersRequestAmino; +} +/** + * QueryBandRelayersResponse is the response type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersResponse { + relayers: string[]; +} +export interface QueryBandRelayersResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse"; + value: Uint8Array; +} +/** + * QueryBandRelayersResponse is the response type for the Query/BandRelayers RPC + * method. + */ +export interface QueryBandRelayersResponseAmino { + relayers: string[]; +} +export interface QueryBandRelayersResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandRelayersResponse"; + value: QueryBandRelayersResponseAmino; +} +/** + * QueryBandPriceStatesRequest is the request type for the Query/BandPriceStates + * RPC method. + */ +export interface QueryBandPriceStatesRequest {} +export interface QueryBandPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryBandPriceStatesRequest is the request type for the Query/BandPriceStates + * RPC method. + */ +export interface QueryBandPriceStatesRequestAmino {} +export interface QueryBandPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest"; + value: QueryBandPriceStatesRequestAmino; +} +/** + * QueryBandPriceStatesResponse is the response type for the + * Query/BandPriceStates RPC method. + */ +export interface QueryBandPriceStatesResponse { + priceStates: BandPriceState[]; +} +export interface QueryBandPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryBandPriceStatesResponse is the response type for the + * Query/BandPriceStates RPC method. + */ +export interface QueryBandPriceStatesResponseAmino { + price_states: BandPriceStateAmino[]; +} +export interface QueryBandPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse"; + value: QueryBandPriceStatesResponseAmino; +} +/** + * QueryBandIBCPriceStatesRequest is the request type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesRequest {} +export interface QueryBandIBCPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryBandIBCPriceStatesRequest is the request type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesRequestAmino {} +export interface QueryBandIBCPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest"; + value: QueryBandIBCPriceStatesRequestAmino; +} +/** + * QueryBandIBCPriceStatesResponse is the response type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesResponse { + priceStates: BandPriceState[]; +} +export interface QueryBandIBCPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryBandIBCPriceStatesResponse is the response type for the + * Query/BandIBCPriceStates RPC method. + */ +export interface QueryBandIBCPriceStatesResponseAmino { + price_states: BandPriceStateAmino[]; +} +export interface QueryBandIBCPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse"; + value: QueryBandIBCPriceStatesResponseAmino; +} +/** + * QueryPriceFeedPriceStatesRequest is the request type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesRequest {} +export interface QueryPriceFeedPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryPriceFeedPriceStatesRequest is the request type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesRequestAmino {} +export interface QueryPriceFeedPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest"; + value: QueryPriceFeedPriceStatesRequestAmino; +} +/** + * QueryPriceFeedPriceStatesResponse is the response type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesResponse { + priceStates: PriceFeedState[]; +} +export interface QueryPriceFeedPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryPriceFeedPriceStatesResponse is the response type for the + * Query/PriceFeedPriceStates RPC method. + */ +export interface QueryPriceFeedPriceStatesResponseAmino { + price_states: PriceFeedStateAmino[]; +} +export interface QueryPriceFeedPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse"; + value: QueryPriceFeedPriceStatesResponseAmino; +} +/** + * QueryCoinbasePriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesRequest {} +export interface QueryCoinbasePriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryCoinbasePriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesRequestAmino {} +export interface QueryCoinbasePriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest"; + value: QueryCoinbasePriceStatesRequestAmino; +} +/** + * QueryCoinbasePriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesResponse { + priceStates: CoinbasePriceState[]; +} +export interface QueryCoinbasePriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryCoinbasePriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryCoinbasePriceStatesResponseAmino { + price_states: CoinbasePriceStateAmino[]; +} +export interface QueryCoinbasePriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse"; + value: QueryCoinbasePriceStatesResponseAmino; +} +/** + * QueryPythPriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesRequest {} +export interface QueryPythPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryPythPriceStatesRequest is the request type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesRequestAmino {} +export interface QueryPythPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest"; + value: QueryPythPriceStatesRequestAmino; +} +/** + * QueryPythPriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesResponse { + priceStates: PythPriceState[]; +} +export interface QueryPythPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryPythPriceStatesResponse is the response type for the + * Query/CoinbasePriceStates RPC method. + */ +export interface QueryPythPriceStatesResponseAmino { + price_states: PythPriceStateAmino[]; +} +export interface QueryPythPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse"; + value: QueryPythPriceStatesResponseAmino; +} +/** + * QueryStorkPriceStatesRequest is the request type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesRequest {} +export interface QueryStorkPriceStatesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest"; + value: Uint8Array; +} +/** + * QueryStorkPriceStatesRequest is the request type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesRequestAmino {} +export interface QueryStorkPriceStatesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest"; + value: QueryStorkPriceStatesRequestAmino; +} +/** + * QueryStorkPriceStatesResponse is the response type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesResponse { + priceStates: StorkPriceState[]; +} +export interface QueryStorkPriceStatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse"; + value: Uint8Array; +} +/** + * QueryStorkPriceStatesResponse is the response type for the + * Query/StorkPriceStates RPC method. + */ +export interface QueryStorkPriceStatesResponseAmino { + price_states: StorkPriceStateAmino[]; +} +export interface QueryStorkPriceStatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse"; + value: QueryStorkPriceStatesResponseAmino; +} +/** + * QueryStorkPublishersRequest is the request type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersRequest {} +export interface QueryStorkPublishersRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest"; + value: Uint8Array; +} +/** + * QueryStorkPublishersRequest is the request type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersRequestAmino {} +export interface QueryStorkPublishersRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPublishersRequest"; + value: QueryStorkPublishersRequestAmino; +} +/** + * QueryStorkPublishersResponse is the response type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersResponse { + publishers: string[]; +} +export interface QueryStorkPublishersResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse"; + value: Uint8Array; +} +/** + * QueryStorkPublishersResponse is the response type for the + * Query/StorkPublishers RPC method. + */ +export interface QueryStorkPublishersResponseAmino { + publishers: string[]; +} +export interface QueryStorkPublishersResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryStorkPublishersResponse"; + value: QueryStorkPublishersResponseAmino; +} +/** + * QueryProviderPriceStateRequest is the request type for the + * Query/ProviderPriceState RPC method. + */ +export interface QueryProviderPriceStateRequest { + provider: string; + symbol: string; +} +export interface QueryProviderPriceStateRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest"; + value: Uint8Array; +} +/** + * QueryProviderPriceStateRequest is the request type for the + * Query/ProviderPriceState RPC method. + */ +export interface QueryProviderPriceStateRequestAmino { + provider: string; + symbol: string; +} +export interface QueryProviderPriceStateRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest"; + value: QueryProviderPriceStateRequestAmino; +} +/** + * QueryProviderPriceStatesResponse is the response type for the + * Query/ProviderPriceStates RPC method. + */ +export interface QueryProviderPriceStateResponse { + priceState?: PriceState; +} +export interface QueryProviderPriceStateResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse"; + value: Uint8Array; +} +/** + * QueryProviderPriceStatesResponse is the response type for the + * Query/ProviderPriceStates RPC method. + */ +export interface QueryProviderPriceStateResponseAmino { + price_state?: PriceStateAmino; +} +export interface QueryProviderPriceStateResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse"; + value: QueryProviderPriceStateResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/OracleModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface QueryHistoricalPriceRecordsRequest { + oracle: OracleType; + symbolId: string; +} +export interface QueryHistoricalPriceRecordsRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest"; + value: Uint8Array; +} +export interface QueryHistoricalPriceRecordsRequestAmino { + oracle: OracleType; + symbol_id: string; +} +export interface QueryHistoricalPriceRecordsRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest"; + value: QueryHistoricalPriceRecordsRequestAmino; +} +export interface QueryHistoricalPriceRecordsResponse { + priceRecords: PriceRecords[]; +} +export interface QueryHistoricalPriceRecordsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse"; + value: Uint8Array; +} +export interface QueryHistoricalPriceRecordsResponseAmino { + price_records: PriceRecordsAmino[]; +} +export interface QueryHistoricalPriceRecordsResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse"; + value: QueryHistoricalPriceRecordsResponseAmino; +} +export interface OracleHistoryOptions { + /** + * MaxAge restricts the oracle price records oldest age in seconds from the + * current block time to consider. A value of 0 means use all the records + * present on the chain. + */ + maxAge: bigint; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + includeRawHistory: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + includeMetadata: boolean; +} +export interface OracleHistoryOptionsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions"; + value: Uint8Array; +} +export interface OracleHistoryOptionsAmino { + /** + * MaxAge restricts the oracle price records oldest age in seconds from the + * current block time to consider. A value of 0 means use all the records + * present on the chain. + */ + max_age: string; + /** + * If IncludeRawHistory is true, the raw underlying data used for the + * computation is included in the response + */ + include_raw_history: boolean; + /** + * If IncludeMetadata is true, metadata on the computation is included in the + * response + */ + include_metadata: boolean; +} +export interface OracleHistoryOptionsAminoMsg { + type: "/injective.oracle.v1beta1.OracleHistoryOptions"; + value: OracleHistoryOptionsAmino; +} +/** + * QueryOracleVolatilityRequest is the request type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityRequest { + baseInfo?: OracleInfo; + quoteInfo?: OracleInfo; + oracleHistoryOptions?: OracleHistoryOptions; +} +export interface QueryOracleVolatilityRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest"; + value: Uint8Array; +} +/** + * QueryOracleVolatilityRequest is the request type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityRequestAmino { + base_info?: OracleInfoAmino; + quote_info?: OracleInfoAmino; + oracle_history_options?: OracleHistoryOptionsAmino; +} +export interface QueryOracleVolatilityRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest"; + value: QueryOracleVolatilityRequestAmino; +} +/** + * QueryOracleVolatilityResponse is the response type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityResponse { + volatility: string; + historyMetadata?: MetadataStatistics; + rawHistory: PriceRecord[]; +} +export interface QueryOracleVolatilityResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse"; + value: Uint8Array; +} +/** + * QueryOracleVolatilityResponse is the response type for Query/OracleVolatility + * RPC method. + */ +export interface QueryOracleVolatilityResponseAmino { + volatility: string; + history_metadata?: MetadataStatisticsAmino; + raw_history: PriceRecordAmino[]; +} +export interface QueryOracleVolatilityResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse"; + value: QueryOracleVolatilityResponseAmino; +} +export interface QueryOracleProvidersInfoRequest {} +export interface QueryOracleProvidersInfoRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest"; + value: Uint8Array; +} +export interface QueryOracleProvidersInfoRequestAmino {} +export interface QueryOracleProvidersInfoRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest"; + value: QueryOracleProvidersInfoRequestAmino; +} +export interface QueryOracleProvidersInfoResponse { + providers: ProviderInfo[]; +} +export interface QueryOracleProvidersInfoResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse"; + value: Uint8Array; +} +export interface QueryOracleProvidersInfoResponseAmino { + providers: ProviderInfoAmino[]; +} +export interface QueryOracleProvidersInfoResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse"; + value: QueryOracleProvidersInfoResponseAmino; +} +export interface QueryOracleProviderPricesRequest { + provider: string; +} +export interface QueryOracleProviderPricesRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest"; + value: Uint8Array; +} +export interface QueryOracleProviderPricesRequestAmino { + provider: string; +} +export interface QueryOracleProviderPricesRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest"; + value: QueryOracleProviderPricesRequestAmino; +} +export interface QueryOracleProviderPricesResponse { + providerState: ProviderState[]; +} +export interface QueryOracleProviderPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse"; + value: Uint8Array; +} +export interface QueryOracleProviderPricesResponseAmino { + providerState: ProviderStateAmino[]; +} +export interface QueryOracleProviderPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse"; + value: QueryOracleProviderPricesResponseAmino; +} +/** + * ScalingOptions defines optional configuration to avoid precision loss. The + * oracle result will be returned as base_price * 10^base_decimals / quote_price + * * 10^quote_decimals + */ +export interface ScalingOptions { + baseDecimals: number; + quoteDecimals: number; +} +export interface ScalingOptionsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions"; + value: Uint8Array; +} +/** + * ScalingOptions defines optional configuration to avoid precision loss. The + * oracle result will be returned as base_price * 10^base_decimals / quote_price + * * 10^quote_decimals + */ +export interface ScalingOptionsAmino { + base_decimals: number; + quote_decimals: number; +} +export interface ScalingOptionsAminoMsg { + type: "/injective.oracle.v1beta1.ScalingOptions"; + value: ScalingOptionsAmino; +} +/** + * QueryOraclePriceRequest is the request type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceRequest { + oracleType: OracleType; + base: string; + quote: string; + scalingOptions?: ScalingOptions; +} +export interface QueryOraclePriceRequestProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest"; + value: Uint8Array; +} +/** + * QueryOraclePriceRequest is the request type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceRequestAmino { + oracle_type: OracleType; + base: string; + quote: string; + scaling_options?: ScalingOptionsAmino; +} +export interface QueryOraclePriceRequestAminoMsg { + type: "/injective.oracle.v1beta1.QueryOraclePriceRequest"; + value: QueryOraclePriceRequestAmino; +} +export interface PricePairState { + pairPrice: string; + basePrice: string; + quotePrice: string; + baseCumulativePrice: string; + quoteCumulativePrice: string; + baseTimestamp: bigint; + quoteTimestamp: bigint; +} +export interface PricePairStateProtoMsg { + typeUrl: "/injective.oracle.v1beta1.PricePairState"; + value: Uint8Array; +} +export interface PricePairStateAmino { + pair_price: string; + base_price: string; + quote_price: string; + base_cumulative_price: string; + quote_cumulative_price: string; + base_timestamp: string; + quote_timestamp: string; +} +export interface PricePairStateAminoMsg { + type: "/injective.oracle.v1beta1.PricePairState"; + value: PricePairStateAmino; +} +/** + * QueryOraclePriceResponse is the response type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceResponse { + pricePairState?: PricePairState; +} +export interface QueryOraclePriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse"; + value: Uint8Array; +} +/** + * QueryOraclePriceResponse is the response type for the Query/OraclePrice RPC + * method. + */ +export interface QueryOraclePriceResponseAmino { + price_pair_state?: PricePairStateAmino; +} +export interface QueryOraclePriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.QueryOraclePriceResponse"; + value: QueryOraclePriceResponseAmino; +} +function createBaseQueryPythPriceRequest(): QueryPythPriceRequest { + return { + priceId: "" + }; +} +export const QueryPythPriceRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest", + is(o: any): o is QueryPythPriceRequest { + return o && (o.$typeUrl === QueryPythPriceRequest.typeUrl || typeof o.priceId === "string"); + }, + isAmino(o: any): o is QueryPythPriceRequestAmino { + return o && (o.$typeUrl === QueryPythPriceRequest.typeUrl || typeof o.price_id === "string"); + }, + encode(message: QueryPythPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceId !== "") { + writer.uint32(10).string(message.priceId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceRequest { + const message = createBaseQueryPythPriceRequest(); + message.priceId = object.priceId ?? ""; + return message; + }, + fromAmino(object: QueryPythPriceRequestAmino): QueryPythPriceRequest { + const message = createBaseQueryPythPriceRequest(); + if (object.price_id !== undefined && object.price_id !== null) { + message.priceId = object.price_id; + } + return message; + }, + toAmino(message: QueryPythPriceRequest): QueryPythPriceRequestAmino { + const obj: any = {}; + obj.price_id = message.priceId === "" ? undefined : message.priceId; + return obj; + }, + fromAminoMsg(object: QueryPythPriceRequestAminoMsg): QueryPythPriceRequest { + return QueryPythPriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceRequestProtoMsg): QueryPythPriceRequest { + return QueryPythPriceRequest.decode(message.value); + }, + toProto(message: QueryPythPriceRequest): Uint8Array { + return QueryPythPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceRequest): QueryPythPriceRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceRequest", + value: QueryPythPriceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceRequest.typeUrl, QueryPythPriceRequest); +function createBaseQueryPythPriceResponse(): QueryPythPriceResponse { + return { + priceState: undefined + }; +} +export const QueryPythPriceResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse", + is(o: any): o is QueryPythPriceResponse { + return o && o.$typeUrl === QueryPythPriceResponse.typeUrl; + }, + isAmino(o: any): o is QueryPythPriceResponseAmino { + return o && o.$typeUrl === QueryPythPriceResponse.typeUrl; + }, + encode(message: QueryPythPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceState !== undefined) { + PythPriceState.encode(message.priceState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceState = PythPriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceResponse { + const message = createBaseQueryPythPriceResponse(); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PythPriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: QueryPythPriceResponseAmino): QueryPythPriceResponse { + const message = createBaseQueryPythPriceResponse(); + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PythPriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: QueryPythPriceResponse): QueryPythPriceResponseAmino { + const obj: any = {}; + obj.price_state = message.priceState ? PythPriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPythPriceResponseAminoMsg): QueryPythPriceResponse { + return QueryPythPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceResponseProtoMsg): QueryPythPriceResponse { + return QueryPythPriceResponse.decode(message.value); + }, + toProto(message: QueryPythPriceResponse): Uint8Array { + return QueryPythPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceResponse): QueryPythPriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceResponse", + value: QueryPythPriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceResponse.typeUrl, QueryPythPriceResponse); +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryBandRelayersRequest(): QueryBandRelayersRequest { + return {}; +} +export const QueryBandRelayersRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest", + is(o: any): o is QueryBandRelayersRequest { + return o && o.$typeUrl === QueryBandRelayersRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandRelayersRequestAmino { + return o && o.$typeUrl === QueryBandRelayersRequest.typeUrl; + }, + encode(_: QueryBandRelayersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandRelayersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandRelayersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandRelayersRequest { + const message = createBaseQueryBandRelayersRequest(); + return message; + }, + fromAmino(_: QueryBandRelayersRequestAmino): QueryBandRelayersRequest { + const message = createBaseQueryBandRelayersRequest(); + return message; + }, + toAmino(_: QueryBandRelayersRequest): QueryBandRelayersRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandRelayersRequestAminoMsg): QueryBandRelayersRequest { + return QueryBandRelayersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandRelayersRequestProtoMsg): QueryBandRelayersRequest { + return QueryBandRelayersRequest.decode(message.value); + }, + toProto(message: QueryBandRelayersRequest): Uint8Array { + return QueryBandRelayersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandRelayersRequest): QueryBandRelayersRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersRequest", + value: QueryBandRelayersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandRelayersRequest.typeUrl, QueryBandRelayersRequest); +function createBaseQueryBandRelayersResponse(): QueryBandRelayersResponse { + return { + relayers: [] + }; +} +export const QueryBandRelayersResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse", + is(o: any): o is QueryBandRelayersResponse { + return o && (o.$typeUrl === QueryBandRelayersResponse.typeUrl || Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is QueryBandRelayersResponseAmino { + return o && (o.$typeUrl === QueryBandRelayersResponse.typeUrl || Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + encode(message: QueryBandRelayersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.relayers) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandRelayersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandRelayersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandRelayersResponse { + const message = createBaseQueryBandRelayersResponse(); + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryBandRelayersResponseAmino): QueryBandRelayersResponse { + const message = createBaseQueryBandRelayersResponse(); + message.relayers = object.relayers?.map(e => e) || []; + return message; + }, + toAmino(message: QueryBandRelayersResponse): QueryBandRelayersResponseAmino { + const obj: any = {}; + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = message.relayers; + } + return obj; + }, + fromAminoMsg(object: QueryBandRelayersResponseAminoMsg): QueryBandRelayersResponse { + return QueryBandRelayersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandRelayersResponseProtoMsg): QueryBandRelayersResponse { + return QueryBandRelayersResponse.decode(message.value); + }, + toProto(message: QueryBandRelayersResponse): Uint8Array { + return QueryBandRelayersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandRelayersResponse): QueryBandRelayersResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandRelayersResponse", + value: QueryBandRelayersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandRelayersResponse.typeUrl, QueryBandRelayersResponse); +function createBaseQueryBandPriceStatesRequest(): QueryBandPriceStatesRequest { + return {}; +} +export const QueryBandPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest", + is(o: any): o is QueryBandPriceStatesRequest { + return o && o.$typeUrl === QueryBandPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandPriceStatesRequestAmino { + return o && o.$typeUrl === QueryBandPriceStatesRequest.typeUrl; + }, + encode(_: QueryBandPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandPriceStatesRequest { + const message = createBaseQueryBandPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryBandPriceStatesRequestAmino): QueryBandPriceStatesRequest { + const message = createBaseQueryBandPriceStatesRequest(); + return message; + }, + toAmino(_: QueryBandPriceStatesRequest): QueryBandPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandPriceStatesRequestAminoMsg): QueryBandPriceStatesRequest { + return QueryBandPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandPriceStatesRequestProtoMsg): QueryBandPriceStatesRequest { + return QueryBandPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryBandPriceStatesRequest): Uint8Array { + return QueryBandPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandPriceStatesRequest): QueryBandPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesRequest", + value: QueryBandPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandPriceStatesRequest.typeUrl, QueryBandPriceStatesRequest); +function createBaseQueryBandPriceStatesResponse(): QueryBandPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryBandPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse", + is(o: any): o is QueryBandPriceStatesResponse { + return o && (o.$typeUrl === QueryBandPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || BandPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryBandPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryBandPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || BandPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryBandPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + BandPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandPriceStatesResponse { + const message = createBaseQueryBandPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => BandPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBandPriceStatesResponseAmino): QueryBandPriceStatesResponse { + const message = createBaseQueryBandPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => BandPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBandPriceStatesResponse): QueryBandPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryBandPriceStatesResponseAminoMsg): QueryBandPriceStatesResponse { + return QueryBandPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandPriceStatesResponseProtoMsg): QueryBandPriceStatesResponse { + return QueryBandPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryBandPriceStatesResponse): Uint8Array { + return QueryBandPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandPriceStatesResponse): QueryBandPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandPriceStatesResponse", + value: QueryBandPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandPriceStatesResponse.typeUrl, QueryBandPriceStatesResponse); +function createBaseQueryBandIBCPriceStatesRequest(): QueryBandIBCPriceStatesRequest { + return {}; +} +export const QueryBandIBCPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest", + is(o: any): o is QueryBandIBCPriceStatesRequest { + return o && o.$typeUrl === QueryBandIBCPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryBandIBCPriceStatesRequestAmino { + return o && o.$typeUrl === QueryBandIBCPriceStatesRequest.typeUrl; + }, + encode(_: QueryBandIBCPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandIBCPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandIBCPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBandIBCPriceStatesRequest { + const message = createBaseQueryBandIBCPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryBandIBCPriceStatesRequestAmino): QueryBandIBCPriceStatesRequest { + const message = createBaseQueryBandIBCPriceStatesRequest(); + return message; + }, + toAmino(_: QueryBandIBCPriceStatesRequest): QueryBandIBCPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBandIBCPriceStatesRequestAminoMsg): QueryBandIBCPriceStatesRequest { + return QueryBandIBCPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandIBCPriceStatesRequestProtoMsg): QueryBandIBCPriceStatesRequest { + return QueryBandIBCPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryBandIBCPriceStatesRequest): Uint8Array { + return QueryBandIBCPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBandIBCPriceStatesRequest): QueryBandIBCPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesRequest", + value: QueryBandIBCPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandIBCPriceStatesRequest.typeUrl, QueryBandIBCPriceStatesRequest); +function createBaseQueryBandIBCPriceStatesResponse(): QueryBandIBCPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryBandIBCPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse", + is(o: any): o is QueryBandIBCPriceStatesResponse { + return o && (o.$typeUrl === QueryBandIBCPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || BandPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryBandIBCPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryBandIBCPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || BandPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryBandIBCPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + BandPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBandIBCPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBandIBCPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(BandPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBandIBCPriceStatesResponse { + const message = createBaseQueryBandIBCPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => BandPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBandIBCPriceStatesResponseAmino): QueryBandIBCPriceStatesResponse { + const message = createBaseQueryBandIBCPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => BandPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBandIBCPriceStatesResponse): QueryBandIBCPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? BandPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryBandIBCPriceStatesResponseAminoMsg): QueryBandIBCPriceStatesResponse { + return QueryBandIBCPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBandIBCPriceStatesResponseProtoMsg): QueryBandIBCPriceStatesResponse { + return QueryBandIBCPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryBandIBCPriceStatesResponse): Uint8Array { + return QueryBandIBCPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBandIBCPriceStatesResponse): QueryBandIBCPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryBandIBCPriceStatesResponse", + value: QueryBandIBCPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBandIBCPriceStatesResponse.typeUrl, QueryBandIBCPriceStatesResponse); +function createBaseQueryPriceFeedPriceStatesRequest(): QueryPriceFeedPriceStatesRequest { + return {}; +} +export const QueryPriceFeedPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest", + is(o: any): o is QueryPriceFeedPriceStatesRequest { + return o && o.$typeUrl === QueryPriceFeedPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPriceFeedPriceStatesRequestAmino { + return o && o.$typeUrl === QueryPriceFeedPriceStatesRequest.typeUrl; + }, + encode(_: QueryPriceFeedPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPriceFeedPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPriceFeedPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPriceFeedPriceStatesRequest { + const message = createBaseQueryPriceFeedPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryPriceFeedPriceStatesRequestAmino): QueryPriceFeedPriceStatesRequest { + const message = createBaseQueryPriceFeedPriceStatesRequest(); + return message; + }, + toAmino(_: QueryPriceFeedPriceStatesRequest): QueryPriceFeedPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPriceFeedPriceStatesRequestAminoMsg): QueryPriceFeedPriceStatesRequest { + return QueryPriceFeedPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPriceFeedPriceStatesRequestProtoMsg): QueryPriceFeedPriceStatesRequest { + return QueryPriceFeedPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryPriceFeedPriceStatesRequest): Uint8Array { + return QueryPriceFeedPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPriceFeedPriceStatesRequest): QueryPriceFeedPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesRequest", + value: QueryPriceFeedPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPriceFeedPriceStatesRequest.typeUrl, QueryPriceFeedPriceStatesRequest); +function createBaseQueryPriceFeedPriceStatesResponse(): QueryPriceFeedPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryPriceFeedPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse", + is(o: any): o is QueryPriceFeedPriceStatesResponse { + return o && (o.$typeUrl === QueryPriceFeedPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || PriceFeedState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryPriceFeedPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryPriceFeedPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || PriceFeedState.isAmino(o.price_states[0]))); + }, + encode(message: QueryPriceFeedPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + PriceFeedState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPriceFeedPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPriceFeedPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(PriceFeedState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPriceFeedPriceStatesResponse { + const message = createBaseQueryPriceFeedPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => PriceFeedState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPriceFeedPriceStatesResponseAmino): QueryPriceFeedPriceStatesResponse { + const message = createBaseQueryPriceFeedPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => PriceFeedState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPriceFeedPriceStatesResponse): QueryPriceFeedPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? PriceFeedState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryPriceFeedPriceStatesResponseAminoMsg): QueryPriceFeedPriceStatesResponse { + return QueryPriceFeedPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPriceFeedPriceStatesResponseProtoMsg): QueryPriceFeedPriceStatesResponse { + return QueryPriceFeedPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryPriceFeedPriceStatesResponse): Uint8Array { + return QueryPriceFeedPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPriceFeedPriceStatesResponse): QueryPriceFeedPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPriceFeedPriceStatesResponse", + value: QueryPriceFeedPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPriceFeedPriceStatesResponse.typeUrl, QueryPriceFeedPriceStatesResponse); +function createBaseQueryCoinbasePriceStatesRequest(): QueryCoinbasePriceStatesRequest { + return {}; +} +export const QueryCoinbasePriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest", + is(o: any): o is QueryCoinbasePriceStatesRequest { + return o && o.$typeUrl === QueryCoinbasePriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryCoinbasePriceStatesRequestAmino { + return o && o.$typeUrl === QueryCoinbasePriceStatesRequest.typeUrl; + }, + encode(_: QueryCoinbasePriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCoinbasePriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCoinbasePriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCoinbasePriceStatesRequest { + const message = createBaseQueryCoinbasePriceStatesRequest(); + return message; + }, + fromAmino(_: QueryCoinbasePriceStatesRequestAmino): QueryCoinbasePriceStatesRequest { + const message = createBaseQueryCoinbasePriceStatesRequest(); + return message; + }, + toAmino(_: QueryCoinbasePriceStatesRequest): QueryCoinbasePriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCoinbasePriceStatesRequestAminoMsg): QueryCoinbasePriceStatesRequest { + return QueryCoinbasePriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCoinbasePriceStatesRequestProtoMsg): QueryCoinbasePriceStatesRequest { + return QueryCoinbasePriceStatesRequest.decode(message.value); + }, + toProto(message: QueryCoinbasePriceStatesRequest): Uint8Array { + return QueryCoinbasePriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCoinbasePriceStatesRequest): QueryCoinbasePriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesRequest", + value: QueryCoinbasePriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCoinbasePriceStatesRequest.typeUrl, QueryCoinbasePriceStatesRequest); +function createBaseQueryCoinbasePriceStatesResponse(): QueryCoinbasePriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryCoinbasePriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse", + is(o: any): o is QueryCoinbasePriceStatesResponse { + return o && (o.$typeUrl === QueryCoinbasePriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || CoinbasePriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryCoinbasePriceStatesResponseAmino { + return o && (o.$typeUrl === QueryCoinbasePriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || CoinbasePriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryCoinbasePriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + CoinbasePriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCoinbasePriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCoinbasePriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(CoinbasePriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCoinbasePriceStatesResponse { + const message = createBaseQueryCoinbasePriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => CoinbasePriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCoinbasePriceStatesResponseAmino): QueryCoinbasePriceStatesResponse { + const message = createBaseQueryCoinbasePriceStatesResponse(); + message.priceStates = object.price_states?.map(e => CoinbasePriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCoinbasePriceStatesResponse): QueryCoinbasePriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? CoinbasePriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryCoinbasePriceStatesResponseAminoMsg): QueryCoinbasePriceStatesResponse { + return QueryCoinbasePriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCoinbasePriceStatesResponseProtoMsg): QueryCoinbasePriceStatesResponse { + return QueryCoinbasePriceStatesResponse.decode(message.value); + }, + toProto(message: QueryCoinbasePriceStatesResponse): Uint8Array { + return QueryCoinbasePriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCoinbasePriceStatesResponse): QueryCoinbasePriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryCoinbasePriceStatesResponse", + value: QueryCoinbasePriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCoinbasePriceStatesResponse.typeUrl, QueryCoinbasePriceStatesResponse); +function createBaseQueryPythPriceStatesRequest(): QueryPythPriceStatesRequest { + return {}; +} +export const QueryPythPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest", + is(o: any): o is QueryPythPriceStatesRequest { + return o && o.$typeUrl === QueryPythPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPythPriceStatesRequestAmino { + return o && o.$typeUrl === QueryPythPriceStatesRequest.typeUrl; + }, + encode(_: QueryPythPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryPythPriceStatesRequest { + const message = createBaseQueryPythPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryPythPriceStatesRequestAmino): QueryPythPriceStatesRequest { + const message = createBaseQueryPythPriceStatesRequest(); + return message; + }, + toAmino(_: QueryPythPriceStatesRequest): QueryPythPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPythPriceStatesRequestAminoMsg): QueryPythPriceStatesRequest { + return QueryPythPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceStatesRequestProtoMsg): QueryPythPriceStatesRequest { + return QueryPythPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryPythPriceStatesRequest): Uint8Array { + return QueryPythPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceStatesRequest): QueryPythPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesRequest", + value: QueryPythPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceStatesRequest.typeUrl, QueryPythPriceStatesRequest); +function createBaseQueryPythPriceStatesResponse(): QueryPythPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryPythPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse", + is(o: any): o is QueryPythPriceStatesResponse { + return o && (o.$typeUrl === QueryPythPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || PythPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryPythPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryPythPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || PythPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryPythPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + PythPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPythPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPythPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(PythPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPythPriceStatesResponse { + const message = createBaseQueryPythPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => PythPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPythPriceStatesResponseAmino): QueryPythPriceStatesResponse { + const message = createBaseQueryPythPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => PythPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPythPriceStatesResponse): QueryPythPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? PythPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryPythPriceStatesResponseAminoMsg): QueryPythPriceStatesResponse { + return QueryPythPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPythPriceStatesResponseProtoMsg): QueryPythPriceStatesResponse { + return QueryPythPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryPythPriceStatesResponse): Uint8Array { + return QueryPythPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPythPriceStatesResponse): QueryPythPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryPythPriceStatesResponse", + value: QueryPythPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPythPriceStatesResponse.typeUrl, QueryPythPriceStatesResponse); +function createBaseQueryStorkPriceStatesRequest(): QueryStorkPriceStatesRequest { + return {}; +} +export const QueryStorkPriceStatesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest", + is(o: any): o is QueryStorkPriceStatesRequest { + return o && o.$typeUrl === QueryStorkPriceStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryStorkPriceStatesRequestAmino { + return o && o.$typeUrl === QueryStorkPriceStatesRequest.typeUrl; + }, + encode(_: QueryStorkPriceStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPriceStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPriceStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryStorkPriceStatesRequest { + const message = createBaseQueryStorkPriceStatesRequest(); + return message; + }, + fromAmino(_: QueryStorkPriceStatesRequestAmino): QueryStorkPriceStatesRequest { + const message = createBaseQueryStorkPriceStatesRequest(); + return message; + }, + toAmino(_: QueryStorkPriceStatesRequest): QueryStorkPriceStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStorkPriceStatesRequestAminoMsg): QueryStorkPriceStatesRequest { + return QueryStorkPriceStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPriceStatesRequestProtoMsg): QueryStorkPriceStatesRequest { + return QueryStorkPriceStatesRequest.decode(message.value); + }, + toProto(message: QueryStorkPriceStatesRequest): Uint8Array { + return QueryStorkPriceStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPriceStatesRequest): QueryStorkPriceStatesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesRequest", + value: QueryStorkPriceStatesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPriceStatesRequest.typeUrl, QueryStorkPriceStatesRequest); +function createBaseQueryStorkPriceStatesResponse(): QueryStorkPriceStatesResponse { + return { + priceStates: [] + }; +} +export const QueryStorkPriceStatesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse", + is(o: any): o is QueryStorkPriceStatesResponse { + return o && (o.$typeUrl === QueryStorkPriceStatesResponse.typeUrl || Array.isArray(o.priceStates) && (!o.priceStates.length || StorkPriceState.is(o.priceStates[0]))); + }, + isAmino(o: any): o is QueryStorkPriceStatesResponseAmino { + return o && (o.$typeUrl === QueryStorkPriceStatesResponse.typeUrl || Array.isArray(o.price_states) && (!o.price_states.length || StorkPriceState.isAmino(o.price_states[0]))); + }, + encode(message: QueryStorkPriceStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceStates) { + StorkPriceState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPriceStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPriceStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceStates.push(StorkPriceState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryStorkPriceStatesResponse { + const message = createBaseQueryStorkPriceStatesResponse(); + message.priceStates = object.priceStates?.map(e => StorkPriceState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryStorkPriceStatesResponseAmino): QueryStorkPriceStatesResponse { + const message = createBaseQueryStorkPriceStatesResponse(); + message.priceStates = object.price_states?.map(e => StorkPriceState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryStorkPriceStatesResponse): QueryStorkPriceStatesResponseAmino { + const obj: any = {}; + if (message.priceStates) { + obj.price_states = message.priceStates.map(e => e ? StorkPriceState.toAmino(e) : undefined); + } else { + obj.price_states = message.priceStates; + } + return obj; + }, + fromAminoMsg(object: QueryStorkPriceStatesResponseAminoMsg): QueryStorkPriceStatesResponse { + return QueryStorkPriceStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPriceStatesResponseProtoMsg): QueryStorkPriceStatesResponse { + return QueryStorkPriceStatesResponse.decode(message.value); + }, + toProto(message: QueryStorkPriceStatesResponse): Uint8Array { + return QueryStorkPriceStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPriceStatesResponse): QueryStorkPriceStatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPriceStatesResponse", + value: QueryStorkPriceStatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPriceStatesResponse.typeUrl, QueryStorkPriceStatesResponse); +function createBaseQueryStorkPublishersRequest(): QueryStorkPublishersRequest { + return {}; +} +export const QueryStorkPublishersRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest", + is(o: any): o is QueryStorkPublishersRequest { + return o && o.$typeUrl === QueryStorkPublishersRequest.typeUrl; + }, + isAmino(o: any): o is QueryStorkPublishersRequestAmino { + return o && o.$typeUrl === QueryStorkPublishersRequest.typeUrl; + }, + encode(_: QueryStorkPublishersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPublishersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPublishersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryStorkPublishersRequest { + const message = createBaseQueryStorkPublishersRequest(); + return message; + }, + fromAmino(_: QueryStorkPublishersRequestAmino): QueryStorkPublishersRequest { + const message = createBaseQueryStorkPublishersRequest(); + return message; + }, + toAmino(_: QueryStorkPublishersRequest): QueryStorkPublishersRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStorkPublishersRequestAminoMsg): QueryStorkPublishersRequest { + return QueryStorkPublishersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPublishersRequestProtoMsg): QueryStorkPublishersRequest { + return QueryStorkPublishersRequest.decode(message.value); + }, + toProto(message: QueryStorkPublishersRequest): Uint8Array { + return QueryStorkPublishersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPublishersRequest): QueryStorkPublishersRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersRequest", + value: QueryStorkPublishersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPublishersRequest.typeUrl, QueryStorkPublishersRequest); +function createBaseQueryStorkPublishersResponse(): QueryStorkPublishersResponse { + return { + publishers: [] + }; +} +export const QueryStorkPublishersResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse", + is(o: any): o is QueryStorkPublishersResponse { + return o && (o.$typeUrl === QueryStorkPublishersResponse.typeUrl || Array.isArray(o.publishers) && (!o.publishers.length || typeof o.publishers[0] === "string")); + }, + isAmino(o: any): o is QueryStorkPublishersResponseAmino { + return o && (o.$typeUrl === QueryStorkPublishersResponse.typeUrl || Array.isArray(o.publishers) && (!o.publishers.length || typeof o.publishers[0] === "string")); + }, + encode(message: QueryStorkPublishersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.publishers) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStorkPublishersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStorkPublishersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publishers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryStorkPublishersResponse { + const message = createBaseQueryStorkPublishersResponse(); + message.publishers = object.publishers?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryStorkPublishersResponseAmino): QueryStorkPublishersResponse { + const message = createBaseQueryStorkPublishersResponse(); + message.publishers = object.publishers?.map(e => e) || []; + return message; + }, + toAmino(message: QueryStorkPublishersResponse): QueryStorkPublishersResponseAmino { + const obj: any = {}; + if (message.publishers) { + obj.publishers = message.publishers.map(e => e); + } else { + obj.publishers = message.publishers; + } + return obj; + }, + fromAminoMsg(object: QueryStorkPublishersResponseAminoMsg): QueryStorkPublishersResponse { + return QueryStorkPublishersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStorkPublishersResponseProtoMsg): QueryStorkPublishersResponse { + return QueryStorkPublishersResponse.decode(message.value); + }, + toProto(message: QueryStorkPublishersResponse): Uint8Array { + return QueryStorkPublishersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStorkPublishersResponse): QueryStorkPublishersResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryStorkPublishersResponse", + value: QueryStorkPublishersResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryStorkPublishersResponse.typeUrl, QueryStorkPublishersResponse); +function createBaseQueryProviderPriceStateRequest(): QueryProviderPriceStateRequest { + return { + provider: "", + symbol: "" + }; +} +export const QueryProviderPriceStateRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest", + is(o: any): o is QueryProviderPriceStateRequest { + return o && (o.$typeUrl === QueryProviderPriceStateRequest.typeUrl || typeof o.provider === "string" && typeof o.symbol === "string"); + }, + isAmino(o: any): o is QueryProviderPriceStateRequestAmino { + return o && (o.$typeUrl === QueryProviderPriceStateRequest.typeUrl || typeof o.provider === "string" && typeof o.symbol === "string"); + }, + encode(message: QueryProviderPriceStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProviderPriceStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderPriceStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryProviderPriceStateRequest { + const message = createBaseQueryProviderPriceStateRequest(); + message.provider = object.provider ?? ""; + message.symbol = object.symbol ?? ""; + return message; + }, + fromAmino(object: QueryProviderPriceStateRequestAmino): QueryProviderPriceStateRequest { + const message = createBaseQueryProviderPriceStateRequest(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + return message; + }, + toAmino(message: QueryProviderPriceStateRequest): QueryProviderPriceStateRequestAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + return obj; + }, + fromAminoMsg(object: QueryProviderPriceStateRequestAminoMsg): QueryProviderPriceStateRequest { + return QueryProviderPriceStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderPriceStateRequestProtoMsg): QueryProviderPriceStateRequest { + return QueryProviderPriceStateRequest.decode(message.value); + }, + toProto(message: QueryProviderPriceStateRequest): Uint8Array { + return QueryProviderPriceStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderPriceStateRequest): QueryProviderPriceStateRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateRequest", + value: QueryProviderPriceStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProviderPriceStateRequest.typeUrl, QueryProviderPriceStateRequest); +function createBaseQueryProviderPriceStateResponse(): QueryProviderPriceStateResponse { + return { + priceState: undefined + }; +} +export const QueryProviderPriceStateResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse", + is(o: any): o is QueryProviderPriceStateResponse { + return o && o.$typeUrl === QueryProviderPriceStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryProviderPriceStateResponseAmino { + return o && o.$typeUrl === QueryProviderPriceStateResponse.typeUrl; + }, + encode(message: QueryProviderPriceStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceState !== undefined) { + PriceState.encode(message.priceState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProviderPriceStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderPriceStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceState = PriceState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryProviderPriceStateResponse { + const message = createBaseQueryProviderPriceStateResponse(); + message.priceState = object.priceState !== undefined && object.priceState !== null ? PriceState.fromPartial(object.priceState) : undefined; + return message; + }, + fromAmino(object: QueryProviderPriceStateResponseAmino): QueryProviderPriceStateResponse { + const message = createBaseQueryProviderPriceStateResponse(); + if (object.price_state !== undefined && object.price_state !== null) { + message.priceState = PriceState.fromAmino(object.price_state); + } + return message; + }, + toAmino(message: QueryProviderPriceStateResponse): QueryProviderPriceStateResponseAmino { + const obj: any = {}; + obj.price_state = message.priceState ? PriceState.toAmino(message.priceState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProviderPriceStateResponseAminoMsg): QueryProviderPriceStateResponse { + return QueryProviderPriceStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderPriceStateResponseProtoMsg): QueryProviderPriceStateResponse { + return QueryProviderPriceStateResponse.decode(message.value); + }, + toProto(message: QueryProviderPriceStateResponse): Uint8Array { + return QueryProviderPriceStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderPriceStateResponse): QueryProviderPriceStateResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryProviderPriceStateResponse", + value: QueryProviderPriceStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryProviderPriceStateResponse.typeUrl, QueryProviderPriceStateResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryHistoricalPriceRecordsRequest(): QueryHistoricalPriceRecordsRequest { + return { + oracle: 0, + symbolId: "" + }; +} +export const QueryHistoricalPriceRecordsRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest", + is(o: any): o is QueryHistoricalPriceRecordsRequest { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsRequest.typeUrl || isSet(o.oracle) && typeof o.symbolId === "string"); + }, + isAmino(o: any): o is QueryHistoricalPriceRecordsRequestAmino { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsRequest.typeUrl || isSet(o.oracle) && typeof o.symbol_id === "string"); + }, + encode(message: QueryHistoricalPriceRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracle !== 0) { + writer.uint32(8).int32(message.oracle); + } + if (message.symbolId !== "") { + writer.uint32(18).string(message.symbolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalPriceRecordsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalPriceRecordsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracle = (reader.int32() as any); + break; + case 2: + message.symbolId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalPriceRecordsRequest { + const message = createBaseQueryHistoricalPriceRecordsRequest(); + message.oracle = object.oracle ?? 0; + message.symbolId = object.symbolId ?? ""; + return message; + }, + fromAmino(object: QueryHistoricalPriceRecordsRequestAmino): QueryHistoricalPriceRecordsRequest { + const message = createBaseQueryHistoricalPriceRecordsRequest(); + if (object.oracle !== undefined && object.oracle !== null) { + message.oracle = object.oracle; + } + if (object.symbol_id !== undefined && object.symbol_id !== null) { + message.symbolId = object.symbol_id; + } + return message; + }, + toAmino(message: QueryHistoricalPriceRecordsRequest): QueryHistoricalPriceRecordsRequestAmino { + const obj: any = {}; + obj.oracle = message.oracle === 0 ? undefined : message.oracle; + obj.symbol_id = message.symbolId === "" ? undefined : message.symbolId; + return obj; + }, + fromAminoMsg(object: QueryHistoricalPriceRecordsRequestAminoMsg): QueryHistoricalPriceRecordsRequest { + return QueryHistoricalPriceRecordsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalPriceRecordsRequestProtoMsg): QueryHistoricalPriceRecordsRequest { + return QueryHistoricalPriceRecordsRequest.decode(message.value); + }, + toProto(message: QueryHistoricalPriceRecordsRequest): Uint8Array { + return QueryHistoricalPriceRecordsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalPriceRecordsRequest): QueryHistoricalPriceRecordsRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsRequest", + value: QueryHistoricalPriceRecordsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalPriceRecordsRequest.typeUrl, QueryHistoricalPriceRecordsRequest); +function createBaseQueryHistoricalPriceRecordsResponse(): QueryHistoricalPriceRecordsResponse { + return { + priceRecords: [] + }; +} +export const QueryHistoricalPriceRecordsResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse", + is(o: any): o is QueryHistoricalPriceRecordsResponse { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsResponse.typeUrl || Array.isArray(o.priceRecords) && (!o.priceRecords.length || PriceRecords.is(o.priceRecords[0]))); + }, + isAmino(o: any): o is QueryHistoricalPriceRecordsResponseAmino { + return o && (o.$typeUrl === QueryHistoricalPriceRecordsResponse.typeUrl || Array.isArray(o.price_records) && (!o.price_records.length || PriceRecords.isAmino(o.price_records[0]))); + }, + encode(message: QueryHistoricalPriceRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceRecords) { + PriceRecords.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalPriceRecordsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalPriceRecordsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceRecords.push(PriceRecords.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryHistoricalPriceRecordsResponse { + const message = createBaseQueryHistoricalPriceRecordsResponse(); + message.priceRecords = object.priceRecords?.map(e => PriceRecords.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryHistoricalPriceRecordsResponseAmino): QueryHistoricalPriceRecordsResponse { + const message = createBaseQueryHistoricalPriceRecordsResponse(); + message.priceRecords = object.price_records?.map(e => PriceRecords.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryHistoricalPriceRecordsResponse): QueryHistoricalPriceRecordsResponseAmino { + const obj: any = {}; + if (message.priceRecords) { + obj.price_records = message.priceRecords.map(e => e ? PriceRecords.toAmino(e) : undefined); + } else { + obj.price_records = message.priceRecords; + } + return obj; + }, + fromAminoMsg(object: QueryHistoricalPriceRecordsResponseAminoMsg): QueryHistoricalPriceRecordsResponse { + return QueryHistoricalPriceRecordsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHistoricalPriceRecordsResponseProtoMsg): QueryHistoricalPriceRecordsResponse { + return QueryHistoricalPriceRecordsResponse.decode(message.value); + }, + toProto(message: QueryHistoricalPriceRecordsResponse): Uint8Array { + return QueryHistoricalPriceRecordsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalPriceRecordsResponse): QueryHistoricalPriceRecordsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryHistoricalPriceRecordsResponse", + value: QueryHistoricalPriceRecordsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryHistoricalPriceRecordsResponse.typeUrl, QueryHistoricalPriceRecordsResponse); +function createBaseOracleHistoryOptions(): OracleHistoryOptions { + return { + maxAge: BigInt(0), + includeRawHistory: false, + includeMetadata: false + }; +} +export const OracleHistoryOptions = { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions", + is(o: any): o is OracleHistoryOptions { + return o && (o.$typeUrl === OracleHistoryOptions.typeUrl || typeof o.maxAge === "bigint" && typeof o.includeRawHistory === "boolean" && typeof o.includeMetadata === "boolean"); + }, + isAmino(o: any): o is OracleHistoryOptionsAmino { + return o && (o.$typeUrl === OracleHistoryOptions.typeUrl || typeof o.max_age === "bigint" && typeof o.include_raw_history === "boolean" && typeof o.include_metadata === "boolean"); + }, + encode(message: OracleHistoryOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAge !== BigInt(0)) { + writer.uint32(8).uint64(message.maxAge); + } + if (message.includeRawHistory === true) { + writer.uint32(16).bool(message.includeRawHistory); + } + if (message.includeMetadata === true) { + writer.uint32(24).bool(message.includeMetadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleHistoryOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleHistoryOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAge = reader.uint64(); + break; + case 2: + message.includeRawHistory = reader.bool(); + break; + case 3: + message.includeMetadata = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OracleHistoryOptions { + const message = createBaseOracleHistoryOptions(); + message.maxAge = object.maxAge !== undefined && object.maxAge !== null ? BigInt(object.maxAge.toString()) : BigInt(0); + message.includeRawHistory = object.includeRawHistory ?? false; + message.includeMetadata = object.includeMetadata ?? false; + return message; + }, + fromAmino(object: OracleHistoryOptionsAmino): OracleHistoryOptions { + const message = createBaseOracleHistoryOptions(); + if (object.max_age !== undefined && object.max_age !== null) { + message.maxAge = BigInt(object.max_age); + } + if (object.include_raw_history !== undefined && object.include_raw_history !== null) { + message.includeRawHistory = object.include_raw_history; + } + if (object.include_metadata !== undefined && object.include_metadata !== null) { + message.includeMetadata = object.include_metadata; + } + return message; + }, + toAmino(message: OracleHistoryOptions): OracleHistoryOptionsAmino { + const obj: any = {}; + obj.max_age = message.maxAge !== BigInt(0) ? message.maxAge?.toString() : undefined; + obj.include_raw_history = message.includeRawHistory === false ? undefined : message.includeRawHistory; + obj.include_metadata = message.includeMetadata === false ? undefined : message.includeMetadata; + return obj; + }, + fromAminoMsg(object: OracleHistoryOptionsAminoMsg): OracleHistoryOptions { + return OracleHistoryOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OracleHistoryOptionsProtoMsg): OracleHistoryOptions { + return OracleHistoryOptions.decode(message.value); + }, + toProto(message: OracleHistoryOptions): Uint8Array { + return OracleHistoryOptions.encode(message).finish(); + }, + toProtoMsg(message: OracleHistoryOptions): OracleHistoryOptionsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.OracleHistoryOptions", + value: OracleHistoryOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OracleHistoryOptions.typeUrl, OracleHistoryOptions); +function createBaseQueryOracleVolatilityRequest(): QueryOracleVolatilityRequest { + return { + baseInfo: undefined, + quoteInfo: undefined, + oracleHistoryOptions: undefined + }; +} +export const QueryOracleVolatilityRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest", + is(o: any): o is QueryOracleVolatilityRequest { + return o && o.$typeUrl === QueryOracleVolatilityRequest.typeUrl; + }, + isAmino(o: any): o is QueryOracleVolatilityRequestAmino { + return o && o.$typeUrl === QueryOracleVolatilityRequest.typeUrl; + }, + encode(message: QueryOracleVolatilityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseInfo !== undefined) { + OracleInfo.encode(message.baseInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.quoteInfo !== undefined) { + OracleInfo.encode(message.quoteInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.oracleHistoryOptions !== undefined) { + OracleHistoryOptions.encode(message.oracleHistoryOptions, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleVolatilityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleVolatilityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseInfo = OracleInfo.decode(reader, reader.uint32()); + break; + case 2: + message.quoteInfo = OracleInfo.decode(reader, reader.uint32()); + break; + case 3: + message.oracleHistoryOptions = OracleHistoryOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleVolatilityRequest { + const message = createBaseQueryOracleVolatilityRequest(); + message.baseInfo = object.baseInfo !== undefined && object.baseInfo !== null ? OracleInfo.fromPartial(object.baseInfo) : undefined; + message.quoteInfo = object.quoteInfo !== undefined && object.quoteInfo !== null ? OracleInfo.fromPartial(object.quoteInfo) : undefined; + message.oracleHistoryOptions = object.oracleHistoryOptions !== undefined && object.oracleHistoryOptions !== null ? OracleHistoryOptions.fromPartial(object.oracleHistoryOptions) : undefined; + return message; + }, + fromAmino(object: QueryOracleVolatilityRequestAmino): QueryOracleVolatilityRequest { + const message = createBaseQueryOracleVolatilityRequest(); + if (object.base_info !== undefined && object.base_info !== null) { + message.baseInfo = OracleInfo.fromAmino(object.base_info); + } + if (object.quote_info !== undefined && object.quote_info !== null) { + message.quoteInfo = OracleInfo.fromAmino(object.quote_info); + } + if (object.oracle_history_options !== undefined && object.oracle_history_options !== null) { + message.oracleHistoryOptions = OracleHistoryOptions.fromAmino(object.oracle_history_options); + } + return message; + }, + toAmino(message: QueryOracleVolatilityRequest): QueryOracleVolatilityRequestAmino { + const obj: any = {}; + obj.base_info = message.baseInfo ? OracleInfo.toAmino(message.baseInfo) : undefined; + obj.quote_info = message.quoteInfo ? OracleInfo.toAmino(message.quoteInfo) : undefined; + obj.oracle_history_options = message.oracleHistoryOptions ? OracleHistoryOptions.toAmino(message.oracleHistoryOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOracleVolatilityRequestAminoMsg): QueryOracleVolatilityRequest { + return QueryOracleVolatilityRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleVolatilityRequestProtoMsg): QueryOracleVolatilityRequest { + return QueryOracleVolatilityRequest.decode(message.value); + }, + toProto(message: QueryOracleVolatilityRequest): Uint8Array { + return QueryOracleVolatilityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleVolatilityRequest): QueryOracleVolatilityRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityRequest", + value: QueryOracleVolatilityRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleVolatilityRequest.typeUrl, QueryOracleVolatilityRequest); +function createBaseQueryOracleVolatilityResponse(): QueryOracleVolatilityResponse { + return { + volatility: "", + historyMetadata: undefined, + rawHistory: [] + }; +} +export const QueryOracleVolatilityResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse", + is(o: any): o is QueryOracleVolatilityResponse { + return o && (o.$typeUrl === QueryOracleVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.rawHistory) && (!o.rawHistory.length || PriceRecord.is(o.rawHistory[0]))); + }, + isAmino(o: any): o is QueryOracleVolatilityResponseAmino { + return o && (o.$typeUrl === QueryOracleVolatilityResponse.typeUrl || typeof o.volatility === "string" && Array.isArray(o.raw_history) && (!o.raw_history.length || PriceRecord.isAmino(o.raw_history[0]))); + }, + encode(message: QueryOracleVolatilityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.volatility !== "") { + writer.uint32(10).string(message.volatility); + } + if (message.historyMetadata !== undefined) { + MetadataStatistics.encode(message.historyMetadata, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.rawHistory) { + PriceRecord.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleVolatilityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleVolatilityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volatility = reader.string(); + break; + case 2: + message.historyMetadata = MetadataStatistics.decode(reader, reader.uint32()); + break; + case 3: + message.rawHistory.push(PriceRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleVolatilityResponse { + const message = createBaseQueryOracleVolatilityResponse(); + message.volatility = object.volatility ?? ""; + message.historyMetadata = object.historyMetadata !== undefined && object.historyMetadata !== null ? MetadataStatistics.fromPartial(object.historyMetadata) : undefined; + message.rawHistory = object.rawHistory?.map(e => PriceRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleVolatilityResponseAmino): QueryOracleVolatilityResponse { + const message = createBaseQueryOracleVolatilityResponse(); + if (object.volatility !== undefined && object.volatility !== null) { + message.volatility = object.volatility; + } + if (object.history_metadata !== undefined && object.history_metadata !== null) { + message.historyMetadata = MetadataStatistics.fromAmino(object.history_metadata); + } + message.rawHistory = object.raw_history?.map(e => PriceRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleVolatilityResponse): QueryOracleVolatilityResponseAmino { + const obj: any = {}; + obj.volatility = message.volatility === "" ? undefined : message.volatility; + obj.history_metadata = message.historyMetadata ? MetadataStatistics.toAmino(message.historyMetadata) : undefined; + if (message.rawHistory) { + obj.raw_history = message.rawHistory.map(e => e ? PriceRecord.toAmino(e) : undefined); + } else { + obj.raw_history = message.rawHistory; + } + return obj; + }, + fromAminoMsg(object: QueryOracleVolatilityResponseAminoMsg): QueryOracleVolatilityResponse { + return QueryOracleVolatilityResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleVolatilityResponseProtoMsg): QueryOracleVolatilityResponse { + return QueryOracleVolatilityResponse.decode(message.value); + }, + toProto(message: QueryOracleVolatilityResponse): Uint8Array { + return QueryOracleVolatilityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleVolatilityResponse): QueryOracleVolatilityResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleVolatilityResponse", + value: QueryOracleVolatilityResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleVolatilityResponse.typeUrl, QueryOracleVolatilityResponse); +function createBaseQueryOracleProvidersInfoRequest(): QueryOracleProvidersInfoRequest { + return {}; +} +export const QueryOracleProvidersInfoRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest", + is(o: any): o is QueryOracleProvidersInfoRequest { + return o && o.$typeUrl === QueryOracleProvidersInfoRequest.typeUrl; + }, + isAmino(o: any): o is QueryOracleProvidersInfoRequestAmino { + return o && o.$typeUrl === QueryOracleProvidersInfoRequest.typeUrl; + }, + encode(_: QueryOracleProvidersInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProvidersInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProvidersInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOracleProvidersInfoRequest { + const message = createBaseQueryOracleProvidersInfoRequest(); + return message; + }, + fromAmino(_: QueryOracleProvidersInfoRequestAmino): QueryOracleProvidersInfoRequest { + const message = createBaseQueryOracleProvidersInfoRequest(); + return message; + }, + toAmino(_: QueryOracleProvidersInfoRequest): QueryOracleProvidersInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOracleProvidersInfoRequestAminoMsg): QueryOracleProvidersInfoRequest { + return QueryOracleProvidersInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProvidersInfoRequestProtoMsg): QueryOracleProvidersInfoRequest { + return QueryOracleProvidersInfoRequest.decode(message.value); + }, + toProto(message: QueryOracleProvidersInfoRequest): Uint8Array { + return QueryOracleProvidersInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProvidersInfoRequest): QueryOracleProvidersInfoRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoRequest", + value: QueryOracleProvidersInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProvidersInfoRequest.typeUrl, QueryOracleProvidersInfoRequest); +function createBaseQueryOracleProvidersInfoResponse(): QueryOracleProvidersInfoResponse { + return { + providers: [] + }; +} +export const QueryOracleProvidersInfoResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse", + is(o: any): o is QueryOracleProvidersInfoResponse { + return o && (o.$typeUrl === QueryOracleProvidersInfoResponse.typeUrl || Array.isArray(o.providers) && (!o.providers.length || ProviderInfo.is(o.providers[0]))); + }, + isAmino(o: any): o is QueryOracleProvidersInfoResponseAmino { + return o && (o.$typeUrl === QueryOracleProvidersInfoResponse.typeUrl || Array.isArray(o.providers) && (!o.providers.length || ProviderInfo.isAmino(o.providers[0]))); + }, + encode(message: QueryOracleProvidersInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.providers) { + ProviderInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProvidersInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProvidersInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providers.push(ProviderInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProvidersInfoResponse { + const message = createBaseQueryOracleProvidersInfoResponse(); + message.providers = object.providers?.map(e => ProviderInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleProvidersInfoResponseAmino): QueryOracleProvidersInfoResponse { + const message = createBaseQueryOracleProvidersInfoResponse(); + message.providers = object.providers?.map(e => ProviderInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleProvidersInfoResponse): QueryOracleProvidersInfoResponseAmino { + const obj: any = {}; + if (message.providers) { + obj.providers = message.providers.map(e => e ? ProviderInfo.toAmino(e) : undefined); + } else { + obj.providers = message.providers; + } + return obj; + }, + fromAminoMsg(object: QueryOracleProvidersInfoResponseAminoMsg): QueryOracleProvidersInfoResponse { + return QueryOracleProvidersInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProvidersInfoResponseProtoMsg): QueryOracleProvidersInfoResponse { + return QueryOracleProvidersInfoResponse.decode(message.value); + }, + toProto(message: QueryOracleProvidersInfoResponse): Uint8Array { + return QueryOracleProvidersInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProvidersInfoResponse): QueryOracleProvidersInfoResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProvidersInfoResponse", + value: QueryOracleProvidersInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProvidersInfoResponse.typeUrl, QueryOracleProvidersInfoResponse); +function createBaseQueryOracleProviderPricesRequest(): QueryOracleProviderPricesRequest { + return { + provider: "" + }; +} +export const QueryOracleProviderPricesRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest", + is(o: any): o is QueryOracleProviderPricesRequest { + return o && (o.$typeUrl === QueryOracleProviderPricesRequest.typeUrl || typeof o.provider === "string"); + }, + isAmino(o: any): o is QueryOracleProviderPricesRequestAmino { + return o && (o.$typeUrl === QueryOracleProviderPricesRequest.typeUrl || typeof o.provider === "string"); + }, + encode(message: QueryOracleProviderPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.provider !== "") { + writer.uint32(10).string(message.provider); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProviderPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProviderPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provider = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProviderPricesRequest { + const message = createBaseQueryOracleProviderPricesRequest(); + message.provider = object.provider ?? ""; + return message; + }, + fromAmino(object: QueryOracleProviderPricesRequestAmino): QueryOracleProviderPricesRequest { + const message = createBaseQueryOracleProviderPricesRequest(); + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + return message; + }, + toAmino(message: QueryOracleProviderPricesRequest): QueryOracleProviderPricesRequestAmino { + const obj: any = {}; + obj.provider = message.provider === "" ? undefined : message.provider; + return obj; + }, + fromAminoMsg(object: QueryOracleProviderPricesRequestAminoMsg): QueryOracleProviderPricesRequest { + return QueryOracleProviderPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProviderPricesRequestProtoMsg): QueryOracleProviderPricesRequest { + return QueryOracleProviderPricesRequest.decode(message.value); + }, + toProto(message: QueryOracleProviderPricesRequest): Uint8Array { + return QueryOracleProviderPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProviderPricesRequest): QueryOracleProviderPricesRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesRequest", + value: QueryOracleProviderPricesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProviderPricesRequest.typeUrl, QueryOracleProviderPricesRequest); +function createBaseQueryOracleProviderPricesResponse(): QueryOracleProviderPricesResponse { + return { + providerState: [] + }; +} +export const QueryOracleProviderPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse", + is(o: any): o is QueryOracleProviderPricesResponse { + return o && (o.$typeUrl === QueryOracleProviderPricesResponse.typeUrl || Array.isArray(o.providerState) && (!o.providerState.length || ProviderState.is(o.providerState[0]))); + }, + isAmino(o: any): o is QueryOracleProviderPricesResponseAmino { + return o && (o.$typeUrl === QueryOracleProviderPricesResponse.typeUrl || Array.isArray(o.providerState) && (!o.providerState.length || ProviderState.isAmino(o.providerState[0]))); + }, + encode(message: QueryOracleProviderPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.providerState) { + ProviderState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOracleProviderPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOracleProviderPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providerState.push(ProviderState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOracleProviderPricesResponse { + const message = createBaseQueryOracleProviderPricesResponse(); + message.providerState = object.providerState?.map(e => ProviderState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOracleProviderPricesResponseAmino): QueryOracleProviderPricesResponse { + const message = createBaseQueryOracleProviderPricesResponse(); + message.providerState = object.providerState?.map(e => ProviderState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOracleProviderPricesResponse): QueryOracleProviderPricesResponseAmino { + const obj: any = {}; + if (message.providerState) { + obj.providerState = message.providerState.map(e => e ? ProviderState.toAmino(e) : undefined); + } else { + obj.providerState = message.providerState; + } + return obj; + }, + fromAminoMsg(object: QueryOracleProviderPricesResponseAminoMsg): QueryOracleProviderPricesResponse { + return QueryOracleProviderPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOracleProviderPricesResponseProtoMsg): QueryOracleProviderPricesResponse { + return QueryOracleProviderPricesResponse.decode(message.value); + }, + toProto(message: QueryOracleProviderPricesResponse): Uint8Array { + return QueryOracleProviderPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOracleProviderPricesResponse): QueryOracleProviderPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOracleProviderPricesResponse", + value: QueryOracleProviderPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOracleProviderPricesResponse.typeUrl, QueryOracleProviderPricesResponse); +function createBaseScalingOptions(): ScalingOptions { + return { + baseDecimals: 0, + quoteDecimals: 0 + }; +} +export const ScalingOptions = { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions", + is(o: any): o is ScalingOptions { + return o && (o.$typeUrl === ScalingOptions.typeUrl || typeof o.baseDecimals === "number" && typeof o.quoteDecimals === "number"); + }, + isAmino(o: any): o is ScalingOptionsAmino { + return o && (o.$typeUrl === ScalingOptions.typeUrl || typeof o.base_decimals === "number" && typeof o.quote_decimals === "number"); + }, + encode(message: ScalingOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseDecimals !== 0) { + writer.uint32(8).uint32(message.baseDecimals); + } + if (message.quoteDecimals !== 0) { + writer.uint32(16).uint32(message.quoteDecimals); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalingOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalingOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseDecimals = reader.uint32(); + break; + case 2: + message.quoteDecimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ScalingOptions { + const message = createBaseScalingOptions(); + message.baseDecimals = object.baseDecimals ?? 0; + message.quoteDecimals = object.quoteDecimals ?? 0; + return message; + }, + fromAmino(object: ScalingOptionsAmino): ScalingOptions { + const message = createBaseScalingOptions(); + if (object.base_decimals !== undefined && object.base_decimals !== null) { + message.baseDecimals = object.base_decimals; + } + if (object.quote_decimals !== undefined && object.quote_decimals !== null) { + message.quoteDecimals = object.quote_decimals; + } + return message; + }, + toAmino(message: ScalingOptions): ScalingOptionsAmino { + const obj: any = {}; + obj.base_decimals = message.baseDecimals === 0 ? undefined : message.baseDecimals; + obj.quote_decimals = message.quoteDecimals === 0 ? undefined : message.quoteDecimals; + return obj; + }, + fromAminoMsg(object: ScalingOptionsAminoMsg): ScalingOptions { + return ScalingOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ScalingOptionsProtoMsg): ScalingOptions { + return ScalingOptions.decode(message.value); + }, + toProto(message: ScalingOptions): Uint8Array { + return ScalingOptions.encode(message).finish(); + }, + toProtoMsg(message: ScalingOptions): ScalingOptionsProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.ScalingOptions", + value: ScalingOptions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ScalingOptions.typeUrl, ScalingOptions); +function createBaseQueryOraclePriceRequest(): QueryOraclePriceRequest { + return { + oracleType: 0, + base: "", + quote: "", + scalingOptions: undefined + }; +} +export const QueryOraclePriceRequest = { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest", + is(o: any): o is QueryOraclePriceRequest { + return o && (o.$typeUrl === QueryOraclePriceRequest.typeUrl || isSet(o.oracleType) && typeof o.base === "string" && typeof o.quote === "string"); + }, + isAmino(o: any): o is QueryOraclePriceRequestAmino { + return o && (o.$typeUrl === QueryOraclePriceRequest.typeUrl || isSet(o.oracle_type) && typeof o.base === "string" && typeof o.quote === "string"); + }, + encode(message: QueryOraclePriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oracleType !== 0) { + writer.uint32(8).int32(message.oracleType); + } + if (message.base !== "") { + writer.uint32(18).string(message.base); + } + if (message.quote !== "") { + writer.uint32(26).string(message.quote); + } + if (message.scalingOptions !== undefined) { + ScalingOptions.encode(message.scalingOptions, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOraclePriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOraclePriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oracleType = (reader.int32() as any); + break; + case 2: + message.base = reader.string(); + break; + case 3: + message.quote = reader.string(); + break; + case 4: + message.scalingOptions = ScalingOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOraclePriceRequest { + const message = createBaseQueryOraclePriceRequest(); + message.oracleType = object.oracleType ?? 0; + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + message.scalingOptions = object.scalingOptions !== undefined && object.scalingOptions !== null ? ScalingOptions.fromPartial(object.scalingOptions) : undefined; + return message; + }, + fromAmino(object: QueryOraclePriceRequestAmino): QueryOraclePriceRequest { + const message = createBaseQueryOraclePriceRequest(); + if (object.oracle_type !== undefined && object.oracle_type !== null) { + message.oracleType = object.oracle_type; + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.quote !== undefined && object.quote !== null) { + message.quote = object.quote; + } + if (object.scaling_options !== undefined && object.scaling_options !== null) { + message.scalingOptions = ScalingOptions.fromAmino(object.scaling_options); + } + return message; + }, + toAmino(message: QueryOraclePriceRequest): QueryOraclePriceRequestAmino { + const obj: any = {}; + obj.oracle_type = message.oracleType === 0 ? undefined : message.oracleType; + obj.base = message.base === "" ? undefined : message.base; + obj.quote = message.quote === "" ? undefined : message.quote; + obj.scaling_options = message.scalingOptions ? ScalingOptions.toAmino(message.scalingOptions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOraclePriceRequestAminoMsg): QueryOraclePriceRequest { + return QueryOraclePriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOraclePriceRequestProtoMsg): QueryOraclePriceRequest { + return QueryOraclePriceRequest.decode(message.value); + }, + toProto(message: QueryOraclePriceRequest): Uint8Array { + return QueryOraclePriceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOraclePriceRequest): QueryOraclePriceRequestProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceRequest", + value: QueryOraclePriceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOraclePriceRequest.typeUrl, QueryOraclePriceRequest); +function createBasePricePairState(): PricePairState { + return { + pairPrice: "", + basePrice: "", + quotePrice: "", + baseCumulativePrice: "", + quoteCumulativePrice: "", + baseTimestamp: BigInt(0), + quoteTimestamp: BigInt(0) + }; +} +export const PricePairState = { + typeUrl: "/injective.oracle.v1beta1.PricePairState", + is(o: any): o is PricePairState { + return o && (o.$typeUrl === PricePairState.typeUrl || typeof o.pairPrice === "string" && typeof o.basePrice === "string" && typeof o.quotePrice === "string" && typeof o.baseCumulativePrice === "string" && typeof o.quoteCumulativePrice === "string" && typeof o.baseTimestamp === "bigint" && typeof o.quoteTimestamp === "bigint"); + }, + isAmino(o: any): o is PricePairStateAmino { + return o && (o.$typeUrl === PricePairState.typeUrl || typeof o.pair_price === "string" && typeof o.base_price === "string" && typeof o.quote_price === "string" && typeof o.base_cumulative_price === "string" && typeof o.quote_cumulative_price === "string" && typeof o.base_timestamp === "bigint" && typeof o.quote_timestamp === "bigint"); + }, + encode(message: PricePairState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pairPrice !== "") { + writer.uint32(10).string(message.pairPrice); + } + if (message.basePrice !== "") { + writer.uint32(18).string(message.basePrice); + } + if (message.quotePrice !== "") { + writer.uint32(26).string(message.quotePrice); + } + if (message.baseCumulativePrice !== "") { + writer.uint32(34).string(message.baseCumulativePrice); + } + if (message.quoteCumulativePrice !== "") { + writer.uint32(42).string(message.quoteCumulativePrice); + } + if (message.baseTimestamp !== BigInt(0)) { + writer.uint32(48).int64(message.baseTimestamp); + } + if (message.quoteTimestamp !== BigInt(0)) { + writer.uint32(56).int64(message.quoteTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PricePairState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePricePairState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairPrice = reader.string(); + break; + case 2: + message.basePrice = reader.string(); + break; + case 3: + message.quotePrice = reader.string(); + break; + case 4: + message.baseCumulativePrice = reader.string(); + break; + case 5: + message.quoteCumulativePrice = reader.string(); + break; + case 6: + message.baseTimestamp = reader.int64(); + break; + case 7: + message.quoteTimestamp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PricePairState { + const message = createBasePricePairState(); + message.pairPrice = object.pairPrice ?? ""; + message.basePrice = object.basePrice ?? ""; + message.quotePrice = object.quotePrice ?? ""; + message.baseCumulativePrice = object.baseCumulativePrice ?? ""; + message.quoteCumulativePrice = object.quoteCumulativePrice ?? ""; + message.baseTimestamp = object.baseTimestamp !== undefined && object.baseTimestamp !== null ? BigInt(object.baseTimestamp.toString()) : BigInt(0); + message.quoteTimestamp = object.quoteTimestamp !== undefined && object.quoteTimestamp !== null ? BigInt(object.quoteTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PricePairStateAmino): PricePairState { + const message = createBasePricePairState(); + if (object.pair_price !== undefined && object.pair_price !== null) { + message.pairPrice = object.pair_price; + } + if (object.base_price !== undefined && object.base_price !== null) { + message.basePrice = object.base_price; + } + if (object.quote_price !== undefined && object.quote_price !== null) { + message.quotePrice = object.quote_price; + } + if (object.base_cumulative_price !== undefined && object.base_cumulative_price !== null) { + message.baseCumulativePrice = object.base_cumulative_price; + } + if (object.quote_cumulative_price !== undefined && object.quote_cumulative_price !== null) { + message.quoteCumulativePrice = object.quote_cumulative_price; + } + if (object.base_timestamp !== undefined && object.base_timestamp !== null) { + message.baseTimestamp = BigInt(object.base_timestamp); + } + if (object.quote_timestamp !== undefined && object.quote_timestamp !== null) { + message.quoteTimestamp = BigInt(object.quote_timestamp); + } + return message; + }, + toAmino(message: PricePairState): PricePairStateAmino { + const obj: any = {}; + obj.pair_price = message.pairPrice === "" ? undefined : message.pairPrice; + obj.base_price = message.basePrice === "" ? undefined : message.basePrice; + obj.quote_price = message.quotePrice === "" ? undefined : message.quotePrice; + obj.base_cumulative_price = message.baseCumulativePrice === "" ? undefined : message.baseCumulativePrice; + obj.quote_cumulative_price = message.quoteCumulativePrice === "" ? undefined : message.quoteCumulativePrice; + obj.base_timestamp = message.baseTimestamp !== BigInt(0) ? message.baseTimestamp?.toString() : undefined; + obj.quote_timestamp = message.quoteTimestamp !== BigInt(0) ? message.quoteTimestamp?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PricePairStateAminoMsg): PricePairState { + return PricePairState.fromAmino(object.value); + }, + fromProtoMsg(message: PricePairStateProtoMsg): PricePairState { + return PricePairState.decode(message.value); + }, + toProto(message: PricePairState): Uint8Array { + return PricePairState.encode(message).finish(); + }, + toProtoMsg(message: PricePairState): PricePairStateProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.PricePairState", + value: PricePairState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PricePairState.typeUrl, PricePairState); +function createBaseQueryOraclePriceResponse(): QueryOraclePriceResponse { + return { + pricePairState: undefined + }; +} +export const QueryOraclePriceResponse = { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse", + is(o: any): o is QueryOraclePriceResponse { + return o && o.$typeUrl === QueryOraclePriceResponse.typeUrl; + }, + isAmino(o: any): o is QueryOraclePriceResponseAmino { + return o && o.$typeUrl === QueryOraclePriceResponse.typeUrl; + }, + encode(message: QueryOraclePriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pricePairState !== undefined) { + PricePairState.encode(message.pricePairState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOraclePriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOraclePriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pricePairState = PricePairState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOraclePriceResponse { + const message = createBaseQueryOraclePriceResponse(); + message.pricePairState = object.pricePairState !== undefined && object.pricePairState !== null ? PricePairState.fromPartial(object.pricePairState) : undefined; + return message; + }, + fromAmino(object: QueryOraclePriceResponseAmino): QueryOraclePriceResponse { + const message = createBaseQueryOraclePriceResponse(); + if (object.price_pair_state !== undefined && object.price_pair_state !== null) { + message.pricePairState = PricePairState.fromAmino(object.price_pair_state); + } + return message; + }, + toAmino(message: QueryOraclePriceResponse): QueryOraclePriceResponseAmino { + const obj: any = {}; + obj.price_pair_state = message.pricePairState ? PricePairState.toAmino(message.pricePairState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOraclePriceResponseAminoMsg): QueryOraclePriceResponse { + return QueryOraclePriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOraclePriceResponseProtoMsg): QueryOraclePriceResponse { + return QueryOraclePriceResponse.decode(message.value); + }, + toProto(message: QueryOraclePriceResponse): Uint8Array { + return QueryOraclePriceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOraclePriceResponse): QueryOraclePriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.QueryOraclePriceResponse", + value: QueryOraclePriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOraclePriceResponse.typeUrl, QueryOraclePriceResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/oracle/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..6179a27f --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/tx.rpc.func.ts @@ -0,0 +1,51 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgRelayProviderPrices, MsgRelayPriceFeedPrice, MsgRelayBandRates, MsgRequestBandIBCRates, MsgRelayCoinbaseMessages, MsgRelayStorkPrices, MsgRelayPythPrices, MsgUpdateParams } from "./tx"; +export const createRelayProviderPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayProviderPrices.typeUrl, + encoders: toEncoders(MsgRelayProviderPrices), + converters: toConverters(MsgRelayProviderPrices) +}); +export const createRelayPriceFeedPrice = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPriceFeedPrice.typeUrl, + encoders: toEncoders(MsgRelayPriceFeedPrice), + converters: toConverters(MsgRelayPriceFeedPrice) +}); +export const createRelayBandRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayBandRates.typeUrl, + encoders: toEncoders(MsgRelayBandRates), + converters: toConverters(MsgRelayBandRates) +}); +export const createRequestBandIBCRates = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBandIBCRates.typeUrl, + encoders: toEncoders(MsgRequestBandIBCRates), + converters: toConverters(MsgRequestBandIBCRates) +}); +export const createRelayCoinbaseMessages = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayCoinbaseMessages.typeUrl, + encoders: toEncoders(MsgRelayCoinbaseMessages), + converters: toConverters(MsgRelayCoinbaseMessages) +}); +export const createRelayStorkMessage = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayStorkPrices.typeUrl, + encoders: toEncoders(MsgRelayStorkPrices), + converters: toConverters(MsgRelayStorkPrices) +}); +export const createRelayPythPrices = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRelayPythPrices.typeUrl, + encoders: toEncoders(MsgRelayPythPrices), + converters: toConverters(MsgRelayPythPrices) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/oracle/v1beta1/tx.ts b/libs/injectivejs/src/injective/oracle/v1beta1/tx.ts new file mode 100644 index 00000000..d87e3df4 --- /dev/null +++ b/libs/injectivejs/src/injective/oracle/v1beta1/tx.ts @@ -0,0 +1,1605 @@ +import { AssetPair, AssetPairAmino, PriceAttestation, PriceAttestationAmino, Params, ParamsAmino } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgRelayProviderPrice defines a SDK message for setting a price through the + * provider oracle. + */ +export interface MsgRelayProviderPrices { + sender: string; + provider: string; + symbols: string[]; + prices: string[]; +} +export interface MsgRelayProviderPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices"; + value: Uint8Array; +} +/** + * MsgRelayProviderPrice defines a SDK message for setting a price through the + * provider oracle. + */ +export interface MsgRelayProviderPricesAmino { + sender: string; + provider: string; + symbols: string[]; + prices: string[]; +} +export interface MsgRelayProviderPricesAminoMsg { + type: "oracle/MsgRelayProviderPrices"; + value: MsgRelayProviderPricesAmino; +} +export interface MsgRelayProviderPricesResponse {} +export interface MsgRelayProviderPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse"; + value: Uint8Array; +} +export interface MsgRelayProviderPricesResponseAmino {} +export interface MsgRelayProviderPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse"; + value: MsgRelayProviderPricesResponseAmino; +} +/** + * MsgRelayPriceFeedPrice defines a SDK message for setting a price through the + * pricefeed oracle. + */ +export interface MsgRelayPriceFeedPrice { + sender: string; + base: string[]; + quote: string[]; + /** price defines the price of the oracle base and quote */ + price: string[]; +} +export interface MsgRelayPriceFeedPriceProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice"; + value: Uint8Array; +} +/** + * MsgRelayPriceFeedPrice defines a SDK message for setting a price through the + * pricefeed oracle. + */ +export interface MsgRelayPriceFeedPriceAmino { + sender: string; + base: string[]; + quote: string[]; + /** price defines the price of the oracle base and quote */ + price: string[]; +} +export interface MsgRelayPriceFeedPriceAminoMsg { + type: "oracle/MsgRelayPriceFeedPrice"; + value: MsgRelayPriceFeedPriceAmino; +} +export interface MsgRelayPriceFeedPriceResponse {} +export interface MsgRelayPriceFeedPriceResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse"; + value: Uint8Array; +} +export interface MsgRelayPriceFeedPriceResponseAmino {} +export interface MsgRelayPriceFeedPriceResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse"; + value: MsgRelayPriceFeedPriceResponseAmino; +} +export interface MsgRelayBandRates { + relayer: string; + symbols: string[]; + rates: bigint[]; + resolveTimes: bigint[]; + requestIDs: bigint[]; +} +export interface MsgRelayBandRatesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates"; + value: Uint8Array; +} +export interface MsgRelayBandRatesAmino { + relayer: string; + symbols: string[]; + rates: string[]; + resolve_times: string[]; + requestIDs: string[]; +} +export interface MsgRelayBandRatesAminoMsg { + type: "oracle/MsgRelayBandRates"; + value: MsgRelayBandRatesAmino; +} +export interface MsgRelayBandRatesResponse {} +export interface MsgRelayBandRatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse"; + value: Uint8Array; +} +export interface MsgRelayBandRatesResponseAmino {} +export interface MsgRelayBandRatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse"; + value: MsgRelayBandRatesResponseAmino; +} +/** + * MsgRelayCoinbaseMessages defines a SDK message for relaying price messages + * from Coinbase API. + */ +export interface MsgRelayCoinbaseMessages { + sender: string; + messages: Uint8Array[]; + signatures: Uint8Array[]; +} +export interface MsgRelayCoinbaseMessagesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages"; + value: Uint8Array; +} +/** + * MsgRelayCoinbaseMessages defines a SDK message for relaying price messages + * from Coinbase API. + */ +export interface MsgRelayCoinbaseMessagesAmino { + sender: string; + messages: string[]; + signatures: string[]; +} +export interface MsgRelayCoinbaseMessagesAminoMsg { + type: "oracle/MsgRelayCoinbaseMessages"; + value: MsgRelayCoinbaseMessagesAmino; +} +export interface MsgRelayCoinbaseMessagesResponse {} +export interface MsgRelayCoinbaseMessagesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse"; + value: Uint8Array; +} +export interface MsgRelayCoinbaseMessagesResponseAmino {} +export interface MsgRelayCoinbaseMessagesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse"; + value: MsgRelayCoinbaseMessagesResponseAmino; +} +/** + * MsgRelayStorkPrices defines a SDK message for relaying price message + * from Stork API. + */ +export interface MsgRelayStorkPrices { + sender: string; + assetPairs: AssetPair[]; +} +export interface MsgRelayStorkPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices"; + value: Uint8Array; +} +/** + * MsgRelayStorkPrices defines a SDK message for relaying price message + * from Stork API. + */ +export interface MsgRelayStorkPricesAmino { + sender: string; + asset_pairs: AssetPairAmino[]; +} +export interface MsgRelayStorkPricesAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayStorkPrices"; + value: MsgRelayStorkPricesAmino; +} +export interface MsgRelayStorkPricesResponse {} +export interface MsgRelayStorkPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse"; + value: Uint8Array; +} +export interface MsgRelayStorkPricesResponseAmino {} +export interface MsgRelayStorkPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse"; + value: MsgRelayStorkPricesResponseAmino; +} +/** + * MsgRequestBandIBCRates defines a SDK message for requesting data from + * BandChain using IBC. + */ +export interface MsgRequestBandIBCRates { + sender: string; + requestId: bigint; +} +export interface MsgRequestBandIBCRatesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates"; + value: Uint8Array; +} +/** + * MsgRequestBandIBCRates defines a SDK message for requesting data from + * BandChain using IBC. + */ +export interface MsgRequestBandIBCRatesAmino { + sender: string; + request_id: string; +} +export interface MsgRequestBandIBCRatesAminoMsg { + type: "oracle/MsgRequestBandIBCRates"; + value: MsgRequestBandIBCRatesAmino; +} +/** MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. */ +export interface MsgRequestBandIBCRatesResponse {} +export interface MsgRequestBandIBCRatesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse"; + value: Uint8Array; +} +/** MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. */ +export interface MsgRequestBandIBCRatesResponseAmino {} +export interface MsgRequestBandIBCRatesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse"; + value: MsgRequestBandIBCRatesResponseAmino; +} +/** MsgRelayPythPrices defines a SDK message for updating Pyth prices */ +export interface MsgRelayPythPrices { + sender: string; + priceAttestations: PriceAttestation[]; +} +export interface MsgRelayPythPricesProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices"; + value: Uint8Array; +} +/** MsgRelayPythPrices defines a SDK message for updating Pyth prices */ +export interface MsgRelayPythPricesAmino { + sender: string; + price_attestations: PriceAttestationAmino[]; +} +export interface MsgRelayPythPricesAminoMsg { + type: "oracle/MsgRelayPythPrices"; + value: MsgRelayPythPricesAmino; +} +/** MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. */ +export interface MsgRelayPythPricesResponse {} +export interface MsgRelayPythPricesResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse"; + value: Uint8Array; +} +/** MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. */ +export interface MsgRelayPythPricesResponseAmino {} +export interface MsgRelayPythPricesResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse"; + value: MsgRelayPythPricesResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the oracle parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the oracle parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "oracle/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.oracle.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgRelayProviderPrices(): MsgRelayProviderPrices { + return { + sender: "", + provider: "", + symbols: [], + prices: [] + }; +} +export const MsgRelayProviderPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices", + aminoType: "oracle/MsgRelayProviderPrices", + is(o: any): o is MsgRelayProviderPrices { + return o && (o.$typeUrl === MsgRelayProviderPrices.typeUrl || typeof o.sender === "string" && typeof o.provider === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string")); + }, + isAmino(o: any): o is MsgRelayProviderPricesAmino { + return o && (o.$typeUrl === MsgRelayProviderPrices.typeUrl || typeof o.sender === "string" && typeof o.provider === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.prices) && (!o.prices.length || typeof o.prices[0] === "string")); + }, + encode(message: MsgRelayProviderPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.provider !== "") { + writer.uint32(18).string(message.provider); + } + for (const v of message.symbols) { + writer.uint32(26).string(v!); + } + for (const v of message.prices) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayProviderPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayProviderPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.provider = reader.string(); + break; + case 3: + message.symbols.push(reader.string()); + break; + case 4: + message.prices.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayProviderPrices { + const message = createBaseMsgRelayProviderPrices(); + message.sender = object.sender ?? ""; + message.provider = object.provider ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayProviderPricesAmino): MsgRelayProviderPrices { + const message = createBaseMsgRelayProviderPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = object.provider; + } + message.symbols = object.symbols?.map(e => e) || []; + message.prices = object.prices?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRelayProviderPrices): MsgRelayProviderPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.provider = message.provider === "" ? undefined : message.provider; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.prices) { + obj.prices = message.prices.map(e => e); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: MsgRelayProviderPricesAminoMsg): MsgRelayProviderPrices { + return MsgRelayProviderPrices.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayProviderPrices): MsgRelayProviderPricesAminoMsg { + return { + type: "oracle/MsgRelayProviderPrices", + value: MsgRelayProviderPrices.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayProviderPricesProtoMsg): MsgRelayProviderPrices { + return MsgRelayProviderPrices.decode(message.value); + }, + toProto(message: MsgRelayProviderPrices): Uint8Array { + return MsgRelayProviderPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayProviderPrices): MsgRelayProviderPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPrices", + value: MsgRelayProviderPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayProviderPrices.typeUrl, MsgRelayProviderPrices); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayProviderPrices.aminoType, MsgRelayProviderPrices.typeUrl); +function createBaseMsgRelayProviderPricesResponse(): MsgRelayProviderPricesResponse { + return {}; +} +export const MsgRelayProviderPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse", + is(o: any): o is MsgRelayProviderPricesResponse { + return o && o.$typeUrl === MsgRelayProviderPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayProviderPricesResponseAmino { + return o && o.$typeUrl === MsgRelayProviderPricesResponse.typeUrl; + }, + encode(_: MsgRelayProviderPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayProviderPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayProviderPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayProviderPricesResponse { + const message = createBaseMsgRelayProviderPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayProviderPricesResponseAmino): MsgRelayProviderPricesResponse { + const message = createBaseMsgRelayProviderPricesResponse(); + return message; + }, + toAmino(_: MsgRelayProviderPricesResponse): MsgRelayProviderPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayProviderPricesResponseAminoMsg): MsgRelayProviderPricesResponse { + return MsgRelayProviderPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayProviderPricesResponseProtoMsg): MsgRelayProviderPricesResponse { + return MsgRelayProviderPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayProviderPricesResponse): Uint8Array { + return MsgRelayProviderPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayProviderPricesResponse): MsgRelayProviderPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse", + value: MsgRelayProviderPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayProviderPricesResponse.typeUrl, MsgRelayProviderPricesResponse); +function createBaseMsgRelayPriceFeedPrice(): MsgRelayPriceFeedPrice { + return { + sender: "", + base: [], + quote: [], + price: [] + }; +} +export const MsgRelayPriceFeedPrice = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice", + aminoType: "oracle/MsgRelayPriceFeedPrice", + is(o: any): o is MsgRelayPriceFeedPrice { + return o && (o.$typeUrl === MsgRelayPriceFeedPrice.typeUrl || typeof o.sender === "string" && Array.isArray(o.base) && (!o.base.length || typeof o.base[0] === "string") && Array.isArray(o.quote) && (!o.quote.length || typeof o.quote[0] === "string") && Array.isArray(o.price) && (!o.price.length || typeof o.price[0] === "string")); + }, + isAmino(o: any): o is MsgRelayPriceFeedPriceAmino { + return o && (o.$typeUrl === MsgRelayPriceFeedPrice.typeUrl || typeof o.sender === "string" && Array.isArray(o.base) && (!o.base.length || typeof o.base[0] === "string") && Array.isArray(o.quote) && (!o.quote.length || typeof o.quote[0] === "string") && Array.isArray(o.price) && (!o.price.length || typeof o.price[0] === "string")); + }, + encode(message: MsgRelayPriceFeedPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.base) { + writer.uint32(18).string(v!); + } + for (const v of message.quote) { + writer.uint32(26).string(v!); + } + for (const v of message.price) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPriceFeedPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPriceFeedPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.base.push(reader.string()); + break; + case 3: + message.quote.push(reader.string()); + break; + case 4: + message.price.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayPriceFeedPrice { + const message = createBaseMsgRelayPriceFeedPrice(); + message.sender = object.sender ?? ""; + message.base = object.base?.map(e => e) || []; + message.quote = object.quote?.map(e => e) || []; + message.price = object.price?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayPriceFeedPriceAmino): MsgRelayPriceFeedPrice { + const message = createBaseMsgRelayPriceFeedPrice(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.base = object.base?.map(e => e) || []; + message.quote = object.quote?.map(e => e) || []; + message.price = object.price?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.base) { + obj.base = message.base.map(e => e); + } else { + obj.base = message.base; + } + if (message.quote) { + obj.quote = message.quote.map(e => e); + } else { + obj.quote = message.quote; + } + if (message.price) { + obj.price = message.price.map(e => e); + } else { + obj.price = message.price; + } + return obj; + }, + fromAminoMsg(object: MsgRelayPriceFeedPriceAminoMsg): MsgRelayPriceFeedPrice { + return MsgRelayPriceFeedPrice.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceAminoMsg { + return { + type: "oracle/MsgRelayPriceFeedPrice", + value: MsgRelayPriceFeedPrice.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayPriceFeedPriceProtoMsg): MsgRelayPriceFeedPrice { + return MsgRelayPriceFeedPrice.decode(message.value); + }, + toProto(message: MsgRelayPriceFeedPrice): Uint8Array { + return MsgRelayPriceFeedPrice.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPriceFeedPrice): MsgRelayPriceFeedPriceProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPrice", + value: MsgRelayPriceFeedPrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPriceFeedPrice.typeUrl, MsgRelayPriceFeedPrice); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayPriceFeedPrice.aminoType, MsgRelayPriceFeedPrice.typeUrl); +function createBaseMsgRelayPriceFeedPriceResponse(): MsgRelayPriceFeedPriceResponse { + return {}; +} +export const MsgRelayPriceFeedPriceResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse", + is(o: any): o is MsgRelayPriceFeedPriceResponse { + return o && o.$typeUrl === MsgRelayPriceFeedPriceResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayPriceFeedPriceResponseAmino { + return o && o.$typeUrl === MsgRelayPriceFeedPriceResponse.typeUrl; + }, + encode(_: MsgRelayPriceFeedPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPriceFeedPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPriceFeedPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayPriceFeedPriceResponse { + const message = createBaseMsgRelayPriceFeedPriceResponse(); + return message; + }, + fromAmino(_: MsgRelayPriceFeedPriceResponseAmino): MsgRelayPriceFeedPriceResponse { + const message = createBaseMsgRelayPriceFeedPriceResponse(); + return message; + }, + toAmino(_: MsgRelayPriceFeedPriceResponse): MsgRelayPriceFeedPriceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayPriceFeedPriceResponseAminoMsg): MsgRelayPriceFeedPriceResponse { + return MsgRelayPriceFeedPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayPriceFeedPriceResponseProtoMsg): MsgRelayPriceFeedPriceResponse { + return MsgRelayPriceFeedPriceResponse.decode(message.value); + }, + toProto(message: MsgRelayPriceFeedPriceResponse): Uint8Array { + return MsgRelayPriceFeedPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPriceFeedPriceResponse): MsgRelayPriceFeedPriceResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPriceFeedPriceResponse", + value: MsgRelayPriceFeedPriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPriceFeedPriceResponse.typeUrl, MsgRelayPriceFeedPriceResponse); +function createBaseMsgRelayBandRates(): MsgRelayBandRates { + return { + relayer: "", + symbols: [], + rates: [], + resolveTimes: [], + requestIDs: [] + }; +} +export const MsgRelayBandRates = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates", + aminoType: "oracle/MsgRelayBandRates", + is(o: any): o is MsgRelayBandRates { + return o && (o.$typeUrl === MsgRelayBandRates.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.rates) && (!o.rates.length || typeof o.rates[0] === "bigint") && Array.isArray(o.resolveTimes) && (!o.resolveTimes.length || typeof o.resolveTimes[0] === "bigint") && Array.isArray(o.requestIDs) && (!o.requestIDs.length || typeof o.requestIDs[0] === "bigint")); + }, + isAmino(o: any): o is MsgRelayBandRatesAmino { + return o && (o.$typeUrl === MsgRelayBandRates.typeUrl || typeof o.relayer === "string" && Array.isArray(o.symbols) && (!o.symbols.length || typeof o.symbols[0] === "string") && Array.isArray(o.rates) && (!o.rates.length || typeof o.rates[0] === "bigint") && Array.isArray(o.resolve_times) && (!o.resolve_times.length || typeof o.resolve_times[0] === "bigint") && Array.isArray(o.requestIDs) && (!o.requestIDs.length || typeof o.requestIDs[0] === "bigint")); + }, + encode(message: MsgRelayBandRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.relayer !== "") { + writer.uint32(10).string(message.relayer); + } + for (const v of message.symbols) { + writer.uint32(18).string(v!); + } + writer.uint32(26).fork(); + for (const v of message.rates) { + writer.uint64(v); + } + writer.ldelim(); + writer.uint32(34).fork(); + for (const v of message.resolveTimes) { + writer.uint64(v); + } + writer.ldelim(); + writer.uint32(42).fork(); + for (const v of message.requestIDs) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayBandRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayBandRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relayer = reader.string(); + break; + case 2: + message.symbols.push(reader.string()); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.rates.push(reader.uint64()); + } + } else { + message.rates.push(reader.uint64()); + } + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.resolveTimes.push(reader.uint64()); + } + } else { + message.resolveTimes.push(reader.uint64()); + } + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.requestIDs.push(reader.uint64()); + } + } else { + message.requestIDs.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayBandRates { + const message = createBaseMsgRelayBandRates(); + message.relayer = object.relayer ?? ""; + message.symbols = object.symbols?.map(e => e) || []; + message.rates = object.rates?.map(e => BigInt(e.toString())) || []; + message.resolveTimes = object.resolveTimes?.map(e => BigInt(e.toString())) || []; + message.requestIDs = object.requestIDs?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgRelayBandRatesAmino): MsgRelayBandRates { + const message = createBaseMsgRelayBandRates(); + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + message.symbols = object.symbols?.map(e => e) || []; + message.rates = object.rates?.map(e => BigInt(e)) || []; + message.resolveTimes = object.resolve_times?.map(e => BigInt(e)) || []; + message.requestIDs = object.requestIDs?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgRelayBandRates): MsgRelayBandRatesAmino { + const obj: any = {}; + obj.relayer = message.relayer === "" ? undefined : message.relayer; + if (message.symbols) { + obj.symbols = message.symbols.map(e => e); + } else { + obj.symbols = message.symbols; + } + if (message.rates) { + obj.rates = message.rates.map(e => e.toString()); + } else { + obj.rates = message.rates; + } + if (message.resolveTimes) { + obj.resolve_times = message.resolveTimes.map(e => e.toString()); + } else { + obj.resolve_times = message.resolveTimes; + } + if (message.requestIDs) { + obj.requestIDs = message.requestIDs.map(e => e.toString()); + } else { + obj.requestIDs = message.requestIDs; + } + return obj; + }, + fromAminoMsg(object: MsgRelayBandRatesAminoMsg): MsgRelayBandRates { + return MsgRelayBandRates.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayBandRates): MsgRelayBandRatesAminoMsg { + return { + type: "oracle/MsgRelayBandRates", + value: MsgRelayBandRates.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayBandRatesProtoMsg): MsgRelayBandRates { + return MsgRelayBandRates.decode(message.value); + }, + toProto(message: MsgRelayBandRates): Uint8Array { + return MsgRelayBandRates.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayBandRates): MsgRelayBandRatesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRates", + value: MsgRelayBandRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayBandRates.typeUrl, MsgRelayBandRates); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayBandRates.aminoType, MsgRelayBandRates.typeUrl); +function createBaseMsgRelayBandRatesResponse(): MsgRelayBandRatesResponse { + return {}; +} +export const MsgRelayBandRatesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse", + is(o: any): o is MsgRelayBandRatesResponse { + return o && o.$typeUrl === MsgRelayBandRatesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayBandRatesResponseAmino { + return o && o.$typeUrl === MsgRelayBandRatesResponse.typeUrl; + }, + encode(_: MsgRelayBandRatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayBandRatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayBandRatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayBandRatesResponse { + const message = createBaseMsgRelayBandRatesResponse(); + return message; + }, + fromAmino(_: MsgRelayBandRatesResponseAmino): MsgRelayBandRatesResponse { + const message = createBaseMsgRelayBandRatesResponse(); + return message; + }, + toAmino(_: MsgRelayBandRatesResponse): MsgRelayBandRatesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayBandRatesResponseAminoMsg): MsgRelayBandRatesResponse { + return MsgRelayBandRatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayBandRatesResponseProtoMsg): MsgRelayBandRatesResponse { + return MsgRelayBandRatesResponse.decode(message.value); + }, + toProto(message: MsgRelayBandRatesResponse): Uint8Array { + return MsgRelayBandRatesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayBandRatesResponse): MsgRelayBandRatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayBandRatesResponse", + value: MsgRelayBandRatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayBandRatesResponse.typeUrl, MsgRelayBandRatesResponse); +function createBaseMsgRelayCoinbaseMessages(): MsgRelayCoinbaseMessages { + return { + sender: "", + messages: [], + signatures: [] + }; +} +export const MsgRelayCoinbaseMessages = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages", + aminoType: "oracle/MsgRelayCoinbaseMessages", + is(o: any): o is MsgRelayCoinbaseMessages { + return o && (o.$typeUrl === MsgRelayCoinbaseMessages.typeUrl || typeof o.sender === "string" && Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MsgRelayCoinbaseMessagesAmino { + return o && (o.$typeUrl === MsgRelayCoinbaseMessages.typeUrl || typeof o.sender === "string" && Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + encode(message: MsgRelayCoinbaseMessages, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.messages) { + writer.uint32(18).bytes(v!); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayCoinbaseMessages { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayCoinbaseMessages(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.messages.push(reader.bytes()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayCoinbaseMessages { + const message = createBaseMsgRelayCoinbaseMessages(); + message.sender = object.sender ?? ""; + message.messages = object.messages?.map(e => e) || []; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRelayCoinbaseMessagesAmino): MsgRelayCoinbaseMessages { + const message = createBaseMsgRelayCoinbaseMessages(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.messages = object.messages?.map(e => bytesFromBase64(e)) || []; + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.messages) { + obj.messages = message.messages.map(e => base64FromBytes(e)); + } else { + obj.messages = message.messages; + } + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MsgRelayCoinbaseMessagesAminoMsg): MsgRelayCoinbaseMessages { + return MsgRelayCoinbaseMessages.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesAminoMsg { + return { + type: "oracle/MsgRelayCoinbaseMessages", + value: MsgRelayCoinbaseMessages.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayCoinbaseMessagesProtoMsg): MsgRelayCoinbaseMessages { + return MsgRelayCoinbaseMessages.decode(message.value); + }, + toProto(message: MsgRelayCoinbaseMessages): Uint8Array { + return MsgRelayCoinbaseMessages.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayCoinbaseMessages): MsgRelayCoinbaseMessagesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessages", + value: MsgRelayCoinbaseMessages.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayCoinbaseMessages.typeUrl, MsgRelayCoinbaseMessages); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayCoinbaseMessages.aminoType, MsgRelayCoinbaseMessages.typeUrl); +function createBaseMsgRelayCoinbaseMessagesResponse(): MsgRelayCoinbaseMessagesResponse { + return {}; +} +export const MsgRelayCoinbaseMessagesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse", + is(o: any): o is MsgRelayCoinbaseMessagesResponse { + return o && o.$typeUrl === MsgRelayCoinbaseMessagesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayCoinbaseMessagesResponseAmino { + return o && o.$typeUrl === MsgRelayCoinbaseMessagesResponse.typeUrl; + }, + encode(_: MsgRelayCoinbaseMessagesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayCoinbaseMessagesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayCoinbaseMessagesResponse { + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + return message; + }, + fromAmino(_: MsgRelayCoinbaseMessagesResponseAmino): MsgRelayCoinbaseMessagesResponse { + const message = createBaseMsgRelayCoinbaseMessagesResponse(); + return message; + }, + toAmino(_: MsgRelayCoinbaseMessagesResponse): MsgRelayCoinbaseMessagesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayCoinbaseMessagesResponseAminoMsg): MsgRelayCoinbaseMessagesResponse { + return MsgRelayCoinbaseMessagesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayCoinbaseMessagesResponseProtoMsg): MsgRelayCoinbaseMessagesResponse { + return MsgRelayCoinbaseMessagesResponse.decode(message.value); + }, + toProto(message: MsgRelayCoinbaseMessagesResponse): Uint8Array { + return MsgRelayCoinbaseMessagesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayCoinbaseMessagesResponse): MsgRelayCoinbaseMessagesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayCoinbaseMessagesResponse", + value: MsgRelayCoinbaseMessagesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayCoinbaseMessagesResponse.typeUrl, MsgRelayCoinbaseMessagesResponse); +function createBaseMsgRelayStorkPrices(): MsgRelayStorkPrices { + return { + sender: "", + assetPairs: [] + }; +} +export const MsgRelayStorkPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices", + is(o: any): o is MsgRelayStorkPrices { + return o && (o.$typeUrl === MsgRelayStorkPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.assetPairs) && (!o.assetPairs.length || AssetPair.is(o.assetPairs[0]))); + }, + isAmino(o: any): o is MsgRelayStorkPricesAmino { + return o && (o.$typeUrl === MsgRelayStorkPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.asset_pairs) && (!o.asset_pairs.length || AssetPair.isAmino(o.asset_pairs[0]))); + }, + encode(message: MsgRelayStorkPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.assetPairs) { + AssetPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayStorkPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayStorkPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.assetPairs.push(AssetPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayStorkPrices { + const message = createBaseMsgRelayStorkPrices(); + message.sender = object.sender ?? ""; + message.assetPairs = object.assetPairs?.map(e => AssetPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRelayStorkPricesAmino): MsgRelayStorkPrices { + const message = createBaseMsgRelayStorkPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.assetPairs = object.asset_pairs?.map(e => AssetPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRelayStorkPrices): MsgRelayStorkPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.assetPairs) { + obj.asset_pairs = message.assetPairs.map(e => e ? AssetPair.toAmino(e) : undefined); + } else { + obj.asset_pairs = message.assetPairs; + } + return obj; + }, + fromAminoMsg(object: MsgRelayStorkPricesAminoMsg): MsgRelayStorkPrices { + return MsgRelayStorkPrices.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayStorkPricesProtoMsg): MsgRelayStorkPrices { + return MsgRelayStorkPrices.decode(message.value); + }, + toProto(message: MsgRelayStorkPrices): Uint8Array { + return MsgRelayStorkPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayStorkPrices): MsgRelayStorkPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPrices", + value: MsgRelayStorkPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayStorkPrices.typeUrl, MsgRelayStorkPrices); +function createBaseMsgRelayStorkPricesResponse(): MsgRelayStorkPricesResponse { + return {}; +} +export const MsgRelayStorkPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse", + is(o: any): o is MsgRelayStorkPricesResponse { + return o && o.$typeUrl === MsgRelayStorkPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayStorkPricesResponseAmino { + return o && o.$typeUrl === MsgRelayStorkPricesResponse.typeUrl; + }, + encode(_: MsgRelayStorkPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayStorkPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayStorkPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayStorkPricesResponse { + const message = createBaseMsgRelayStorkPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayStorkPricesResponseAmino): MsgRelayStorkPricesResponse { + const message = createBaseMsgRelayStorkPricesResponse(); + return message; + }, + toAmino(_: MsgRelayStorkPricesResponse): MsgRelayStorkPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayStorkPricesResponseAminoMsg): MsgRelayStorkPricesResponse { + return MsgRelayStorkPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayStorkPricesResponseProtoMsg): MsgRelayStorkPricesResponse { + return MsgRelayStorkPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayStorkPricesResponse): Uint8Array { + return MsgRelayStorkPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayStorkPricesResponse): MsgRelayStorkPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayStorkPricesResponse", + value: MsgRelayStorkPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayStorkPricesResponse.typeUrl, MsgRelayStorkPricesResponse); +function createBaseMsgRequestBandIBCRates(): MsgRequestBandIBCRates { + return { + sender: "", + requestId: BigInt(0) + }; +} +export const MsgRequestBandIBCRates = { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates", + aminoType: "oracle/MsgRequestBandIBCRates", + is(o: any): o is MsgRequestBandIBCRates { + return o && (o.$typeUrl === MsgRequestBandIBCRates.typeUrl || typeof o.sender === "string" && typeof o.requestId === "bigint"); + }, + isAmino(o: any): o is MsgRequestBandIBCRatesAmino { + return o && (o.$typeUrl === MsgRequestBandIBCRates.typeUrl || typeof o.sender === "string" && typeof o.request_id === "bigint"); + }, + encode(message: MsgRequestBandIBCRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.requestId !== BigInt(0)) { + writer.uint32(16).uint64(message.requestId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBandIBCRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBandIBCRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.requestId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestBandIBCRates { + const message = createBaseMsgRequestBandIBCRates(); + message.sender = object.sender ?? ""; + message.requestId = object.requestId !== undefined && object.requestId !== null ? BigInt(object.requestId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgRequestBandIBCRatesAmino): MsgRequestBandIBCRates { + const message = createBaseMsgRequestBandIBCRates(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.request_id !== undefined && object.request_id !== null) { + message.requestId = BigInt(object.request_id); + } + return message; + }, + toAmino(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.request_id = message.requestId !== BigInt(0) ? message.requestId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgRequestBandIBCRatesAminoMsg): MsgRequestBandIBCRates { + return MsgRequestBandIBCRates.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesAminoMsg { + return { + type: "oracle/MsgRequestBandIBCRates", + value: MsgRequestBandIBCRates.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestBandIBCRatesProtoMsg): MsgRequestBandIBCRates { + return MsgRequestBandIBCRates.decode(message.value); + }, + toProto(message: MsgRequestBandIBCRates): Uint8Array { + return MsgRequestBandIBCRates.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBandIBCRates): MsgRequestBandIBCRatesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRates", + value: MsgRequestBandIBCRates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBandIBCRates.typeUrl, MsgRequestBandIBCRates); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestBandIBCRates.aminoType, MsgRequestBandIBCRates.typeUrl); +function createBaseMsgRequestBandIBCRatesResponse(): MsgRequestBandIBCRatesResponse { + return {}; +} +export const MsgRequestBandIBCRatesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse", + is(o: any): o is MsgRequestBandIBCRatesResponse { + return o && o.$typeUrl === MsgRequestBandIBCRatesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestBandIBCRatesResponseAmino { + return o && o.$typeUrl === MsgRequestBandIBCRatesResponse.typeUrl; + }, + encode(_: MsgRequestBandIBCRatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBandIBCRatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBandIBCRatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestBandIBCRatesResponse { + const message = createBaseMsgRequestBandIBCRatesResponse(); + return message; + }, + fromAmino(_: MsgRequestBandIBCRatesResponseAmino): MsgRequestBandIBCRatesResponse { + const message = createBaseMsgRequestBandIBCRatesResponse(); + return message; + }, + toAmino(_: MsgRequestBandIBCRatesResponse): MsgRequestBandIBCRatesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestBandIBCRatesResponseAminoMsg): MsgRequestBandIBCRatesResponse { + return MsgRequestBandIBCRatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestBandIBCRatesResponseProtoMsg): MsgRequestBandIBCRatesResponse { + return MsgRequestBandIBCRatesResponse.decode(message.value); + }, + toProto(message: MsgRequestBandIBCRatesResponse): Uint8Array { + return MsgRequestBandIBCRatesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBandIBCRatesResponse): MsgRequestBandIBCRatesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRequestBandIBCRatesResponse", + value: MsgRequestBandIBCRatesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBandIBCRatesResponse.typeUrl, MsgRequestBandIBCRatesResponse); +function createBaseMsgRelayPythPrices(): MsgRelayPythPrices { + return { + sender: "", + priceAttestations: [] + }; +} +export const MsgRelayPythPrices = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices", + aminoType: "oracle/MsgRelayPythPrices", + is(o: any): o is MsgRelayPythPrices { + return o && (o.$typeUrl === MsgRelayPythPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.priceAttestations) && (!o.priceAttestations.length || PriceAttestation.is(o.priceAttestations[0]))); + }, + isAmino(o: any): o is MsgRelayPythPricesAmino { + return o && (o.$typeUrl === MsgRelayPythPrices.typeUrl || typeof o.sender === "string" && Array.isArray(o.price_attestations) && (!o.price_attestations.length || PriceAttestation.isAmino(o.price_attestations[0]))); + }, + encode(message: MsgRelayPythPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.priceAttestations) { + PriceAttestation.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPythPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPythPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.priceAttestations.push(PriceAttestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRelayPythPrices { + const message = createBaseMsgRelayPythPrices(); + message.sender = object.sender ?? ""; + message.priceAttestations = object.priceAttestations?.map(e => PriceAttestation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRelayPythPricesAmino): MsgRelayPythPrices { + const message = createBaseMsgRelayPythPrices(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.priceAttestations = object.price_attestations?.map(e => PriceAttestation.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRelayPythPrices): MsgRelayPythPricesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + if (message.priceAttestations) { + obj.price_attestations = message.priceAttestations.map(e => e ? PriceAttestation.toAmino(e) : undefined); + } else { + obj.price_attestations = message.priceAttestations; + } + return obj; + }, + fromAminoMsg(object: MsgRelayPythPricesAminoMsg): MsgRelayPythPrices { + return MsgRelayPythPrices.fromAmino(object.value); + }, + toAminoMsg(message: MsgRelayPythPrices): MsgRelayPythPricesAminoMsg { + return { + type: "oracle/MsgRelayPythPrices", + value: MsgRelayPythPrices.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRelayPythPricesProtoMsg): MsgRelayPythPrices { + return MsgRelayPythPrices.decode(message.value); + }, + toProto(message: MsgRelayPythPrices): Uint8Array { + return MsgRelayPythPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPythPrices): MsgRelayPythPricesProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPrices", + value: MsgRelayPythPrices.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPythPrices.typeUrl, MsgRelayPythPrices); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRelayPythPrices.aminoType, MsgRelayPythPrices.typeUrl); +function createBaseMsgRelayPythPricesResponse(): MsgRelayPythPricesResponse { + return {}; +} +export const MsgRelayPythPricesResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse", + is(o: any): o is MsgRelayPythPricesResponse { + return o && o.$typeUrl === MsgRelayPythPricesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRelayPythPricesResponseAmino { + return o && o.$typeUrl === MsgRelayPythPricesResponse.typeUrl; + }, + encode(_: MsgRelayPythPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRelayPythPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRelayPythPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRelayPythPricesResponse { + const message = createBaseMsgRelayPythPricesResponse(); + return message; + }, + fromAmino(_: MsgRelayPythPricesResponseAmino): MsgRelayPythPricesResponse { + const message = createBaseMsgRelayPythPricesResponse(); + return message; + }, + toAmino(_: MsgRelayPythPricesResponse): MsgRelayPythPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRelayPythPricesResponseAminoMsg): MsgRelayPythPricesResponse { + return MsgRelayPythPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRelayPythPricesResponseProtoMsg): MsgRelayPythPricesResponse { + return MsgRelayPythPricesResponse.decode(message.value); + }, + toProto(message: MsgRelayPythPricesResponse): Uint8Array { + return MsgRelayPythPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRelayPythPricesResponse): MsgRelayPythPricesResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgRelayPythPricesResponse", + value: MsgRelayPythPricesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRelayPythPricesResponse.typeUrl, MsgRelayPythPricesResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParams", + aminoType: "oracle/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "oracle/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: "/injective.oracle.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.oracle.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/attestation.ts b/libs/injectivejs/src/injective/peggy/v1/attestation.ts new file mode 100644 index 00000000..2b00c1ac --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/attestation.ts @@ -0,0 +1,333 @@ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * ClaimType is the cosmos type of an event from the counterpart chain that can + * be handled + */ +export enum ClaimType { + CLAIM_TYPE_UNKNOWN = 0, + CLAIM_TYPE_DEPOSIT = 1, + CLAIM_TYPE_WITHDRAW = 2, + CLAIM_TYPE_ERC20_DEPLOYED = 3, + CLAIM_TYPE_VALSET_UPDATED = 4, + UNRECOGNIZED = -1, +} +export const ClaimTypeAmino = ClaimType; +export function claimTypeFromJSON(object: any): ClaimType { + switch (object) { + case 0: + case "CLAIM_TYPE_UNKNOWN": + return ClaimType.CLAIM_TYPE_UNKNOWN; + case 1: + case "CLAIM_TYPE_DEPOSIT": + return ClaimType.CLAIM_TYPE_DEPOSIT; + case 2: + case "CLAIM_TYPE_WITHDRAW": + return ClaimType.CLAIM_TYPE_WITHDRAW; + case 3: + case "CLAIM_TYPE_ERC20_DEPLOYED": + return ClaimType.CLAIM_TYPE_ERC20_DEPLOYED; + case 4: + case "CLAIM_TYPE_VALSET_UPDATED": + return ClaimType.CLAIM_TYPE_VALSET_UPDATED; + case -1: + case "UNRECOGNIZED": + default: + return ClaimType.UNRECOGNIZED; + } +} +export function claimTypeToJSON(object: ClaimType): string { + switch (object) { + case ClaimType.CLAIM_TYPE_UNKNOWN: + return "CLAIM_TYPE_UNKNOWN"; + case ClaimType.CLAIM_TYPE_DEPOSIT: + return "CLAIM_TYPE_DEPOSIT"; + case ClaimType.CLAIM_TYPE_WITHDRAW: + return "CLAIM_TYPE_WITHDRAW"; + case ClaimType.CLAIM_TYPE_ERC20_DEPLOYED: + return "CLAIM_TYPE_ERC20_DEPLOYED"; + case ClaimType.CLAIM_TYPE_VALSET_UPDATED: + return "CLAIM_TYPE_VALSET_UPDATED"; + case ClaimType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Attestation is an aggregate of `claims` that eventually becomes `observed` by + * all orchestrators + * EVENT_NONCE: + * EventNonce a nonce provided by the peggy contract that is unique per event + * fired These event nonces must be relayed in order. This is a correctness + * issue, if relaying out of order transaction replay attacks become possible + * OBSERVED: + * Observed indicates that >67% of validators have attested to the event, + * and that the event should be executed by the peggy state machine + * + * The actual content of the claims is passed in with the transaction making the + * claim and then passed through the call stack alongside the attestation while + * it is processed the key in which the attestation is stored is keyed on the + * exact details of the claim but there is no reason to store those exact + * details becuause the next message sender will kindly provide you with them. + */ +export interface Attestation { + observed: boolean; + votes: string[]; + height: bigint; + claim?: Any; +} +export interface AttestationProtoMsg { + typeUrl: "/injective.peggy.v1.Attestation"; + value: Uint8Array; +} +/** + * Attestation is an aggregate of `claims` that eventually becomes `observed` by + * all orchestrators + * EVENT_NONCE: + * EventNonce a nonce provided by the peggy contract that is unique per event + * fired These event nonces must be relayed in order. This is a correctness + * issue, if relaying out of order transaction replay attacks become possible + * OBSERVED: + * Observed indicates that >67% of validators have attested to the event, + * and that the event should be executed by the peggy state machine + * + * The actual content of the claims is passed in with the transaction making the + * claim and then passed through the call stack alongside the attestation while + * it is processed the key in which the attestation is stored is keyed on the + * exact details of the claim but there is no reason to store those exact + * details becuause the next message sender will kindly provide you with them. + */ +export interface AttestationAmino { + observed: boolean; + votes: string[]; + height: string; + claim?: AnyAmino; +} +export interface AttestationAminoMsg { + type: "/injective.peggy.v1.Attestation"; + value: AttestationAmino; +} +/** + * ERC20Token unique identifier for an Ethereum ERC20 token. + * CONTRACT: + * The contract address on ETH of the token, this could be a Cosmos + * originated token, if so it will be the ERC20 address of the representation + * (note: developers should look up the token symbol using the address on ETH to + * display for UI) + */ +export interface ERC20Token { + contract: string; + amount: string; +} +export interface ERC20TokenProtoMsg { + typeUrl: "/injective.peggy.v1.ERC20Token"; + value: Uint8Array; +} +/** + * ERC20Token unique identifier for an Ethereum ERC20 token. + * CONTRACT: + * The contract address on ETH of the token, this could be a Cosmos + * originated token, if so it will be the ERC20 address of the representation + * (note: developers should look up the token symbol using the address on ETH to + * display for UI) + */ +export interface ERC20TokenAmino { + contract: string; + amount: string; +} +export interface ERC20TokenAminoMsg { + type: "/injective.peggy.v1.ERC20Token"; + value: ERC20TokenAmino; +} +function createBaseAttestation(): Attestation { + return { + observed: false, + votes: [], + height: BigInt(0), + claim: undefined + }; +} +export const Attestation = { + typeUrl: "/injective.peggy.v1.Attestation", + is(o: any): o is Attestation { + return o && (o.$typeUrl === Attestation.typeUrl || typeof o.observed === "boolean" && Array.isArray(o.votes) && (!o.votes.length || typeof o.votes[0] === "string") && typeof o.height === "bigint"); + }, + isAmino(o: any): o is AttestationAmino { + return o && (o.$typeUrl === Attestation.typeUrl || typeof o.observed === "boolean" && Array.isArray(o.votes) && (!o.votes.length || typeof o.votes[0] === "string") && typeof o.height === "bigint"); + }, + encode(message: Attestation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.observed === true) { + writer.uint32(8).bool(message.observed); + } + for (const v of message.votes) { + writer.uint32(18).string(v!); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + if (message.claim !== undefined) { + Any.encode(message.claim, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Attestation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttestation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.observed = reader.bool(); + break; + case 2: + message.votes.push(reader.string()); + break; + case 3: + message.height = reader.uint64(); + break; + case 4: + message.claim = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Attestation { + const message = createBaseAttestation(); + message.observed = object.observed ?? false; + message.votes = object.votes?.map(e => e) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.claim = object.claim !== undefined && object.claim !== null ? Any.fromPartial(object.claim) : undefined; + return message; + }, + fromAmino(object: AttestationAmino): Attestation { + const message = createBaseAttestation(); + if (object.observed !== undefined && object.observed !== null) { + message.observed = object.observed; + } + message.votes = object.votes?.map(e => e) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.claim !== undefined && object.claim !== null) { + message.claim = Any.fromAmino(object.claim); + } + return message; + }, + toAmino(message: Attestation): AttestationAmino { + const obj: any = {}; + obj.observed = message.observed === false ? undefined : message.observed; + if (message.votes) { + obj.votes = message.votes.map(e => e); + } else { + obj.votes = message.votes; + } + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.claim = message.claim ? Any.toAmino(message.claim) : undefined; + return obj; + }, + fromAminoMsg(object: AttestationAminoMsg): Attestation { + return Attestation.fromAmino(object.value); + }, + fromProtoMsg(message: AttestationProtoMsg): Attestation { + return Attestation.decode(message.value); + }, + toProto(message: Attestation): Uint8Array { + return Attestation.encode(message).finish(); + }, + toProtoMsg(message: Attestation): AttestationProtoMsg { + return { + typeUrl: "/injective.peggy.v1.Attestation", + value: Attestation.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Attestation.typeUrl, Attestation); +function createBaseERC20Token(): ERC20Token { + return { + contract: "", + amount: "" + }; +} +export const ERC20Token = { + typeUrl: "/injective.peggy.v1.ERC20Token", + is(o: any): o is ERC20Token { + return o && (o.$typeUrl === ERC20Token.typeUrl || typeof o.contract === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is ERC20TokenAmino { + return o && (o.$typeUrl === ERC20Token.typeUrl || typeof o.contract === "string" && typeof o.amount === "string"); + }, + encode(message: ERC20Token, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contract !== "") { + writer.uint32(10).string(message.contract); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ERC20Token { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseERC20Token(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contract = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ERC20Token { + const message = createBaseERC20Token(); + message.contract = object.contract ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: ERC20TokenAmino): ERC20Token { + const message = createBaseERC20Token(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: ERC20Token): ERC20TokenAmino { + const obj: any = {}; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: ERC20TokenAminoMsg): ERC20Token { + return ERC20Token.fromAmino(object.value); + }, + fromProtoMsg(message: ERC20TokenProtoMsg): ERC20Token { + return ERC20Token.decode(message.value); + }, + toProto(message: ERC20Token): Uint8Array { + return ERC20Token.encode(message).finish(); + }, + toProtoMsg(message: ERC20Token): ERC20TokenProtoMsg { + return { + typeUrl: "/injective.peggy.v1.ERC20Token", + value: ERC20Token.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ERC20Token.typeUrl, ERC20Token); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/batch.ts b/libs/injectivejs/src/injective/peggy/v1/batch.ts new file mode 100644 index 00000000..c4bc396f --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/batch.ts @@ -0,0 +1,290 @@ +import { ERC20Token, ERC20TokenAmino } from "./attestation"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** OutgoingTxBatch represents a batch of transactions going from Peggy to ETH */ +export interface OutgoingTxBatch { + batchNonce: bigint; + batchTimeout: bigint; + transactions: OutgoingTransferTx[]; + tokenContract: string; + block: bigint; +} +export interface OutgoingTxBatchProtoMsg { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch"; + value: Uint8Array; +} +/** OutgoingTxBatch represents a batch of transactions going from Peggy to ETH */ +export interface OutgoingTxBatchAmino { + batch_nonce: string; + batch_timeout: string; + transactions: OutgoingTransferTxAmino[]; + token_contract: string; + block: string; +} +export interface OutgoingTxBatchAminoMsg { + type: "/injective.peggy.v1.OutgoingTxBatch"; + value: OutgoingTxBatchAmino; +} +/** OutgoingTransferTx represents an individual send from Peggy to ETH */ +export interface OutgoingTransferTx { + id: bigint; + sender: string; + destAddress: string; + erc20Token?: ERC20Token; + erc20Fee?: ERC20Token; +} +export interface OutgoingTransferTxProtoMsg { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx"; + value: Uint8Array; +} +/** OutgoingTransferTx represents an individual send from Peggy to ETH */ +export interface OutgoingTransferTxAmino { + id: string; + sender: string; + dest_address: string; + erc20_token?: ERC20TokenAmino; + erc20_fee?: ERC20TokenAmino; +} +export interface OutgoingTransferTxAminoMsg { + type: "/injective.peggy.v1.OutgoingTransferTx"; + value: OutgoingTransferTxAmino; +} +function createBaseOutgoingTxBatch(): OutgoingTxBatch { + return { + batchNonce: BigInt(0), + batchTimeout: BigInt(0), + transactions: [], + tokenContract: "", + block: BigInt(0) + }; +} +export const OutgoingTxBatch = { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch", + is(o: any): o is OutgoingTxBatch { + return o && (o.$typeUrl === OutgoingTxBatch.typeUrl || typeof o.batchNonce === "bigint" && typeof o.batchTimeout === "bigint" && Array.isArray(o.transactions) && (!o.transactions.length || OutgoingTransferTx.is(o.transactions[0])) && typeof o.tokenContract === "string" && typeof o.block === "bigint"); + }, + isAmino(o: any): o is OutgoingTxBatchAmino { + return o && (o.$typeUrl === OutgoingTxBatch.typeUrl || typeof o.batch_nonce === "bigint" && typeof o.batch_timeout === "bigint" && Array.isArray(o.transactions) && (!o.transactions.length || OutgoingTransferTx.isAmino(o.transactions[0])) && typeof o.token_contract === "string" && typeof o.block === "bigint"); + }, + encode(message: OutgoingTxBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.batchNonce); + } + if (message.batchTimeout !== BigInt(0)) { + writer.uint32(16).uint64(message.batchTimeout); + } + for (const v of message.transactions) { + OutgoingTransferTx.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.block !== BigInt(0)) { + writer.uint32(40).uint64(message.block); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OutgoingTxBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingTxBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchNonce = reader.uint64(); + break; + case 2: + message.batchTimeout = reader.uint64(); + break; + case 3: + message.transactions.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.block = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OutgoingTxBatch { + const message = createBaseOutgoingTxBatch(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.batchTimeout = object.batchTimeout !== undefined && object.batchTimeout !== null ? BigInt(object.batchTimeout.toString()) : BigInt(0); + message.transactions = object.transactions?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.tokenContract = object.tokenContract ?? ""; + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + return message; + }, + fromAmino(object: OutgoingTxBatchAmino): OutgoingTxBatch { + const message = createBaseOutgoingTxBatch(); + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.batch_timeout !== undefined && object.batch_timeout !== null) { + message.batchTimeout = BigInt(object.batch_timeout); + } + message.transactions = object.transactions?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + return message; + }, + toAmino(message: OutgoingTxBatch): OutgoingTxBatchAmino { + const obj: any = {}; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.batch_timeout = message.batchTimeout !== BigInt(0) ? message.batchTimeout?.toString() : undefined; + if (message.transactions) { + obj.transactions = message.transactions.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.transactions = message.transactions; + } + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.block = message.block !== BigInt(0) ? message.block?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: OutgoingTxBatchAminoMsg): OutgoingTxBatch { + return OutgoingTxBatch.fromAmino(object.value); + }, + fromProtoMsg(message: OutgoingTxBatchProtoMsg): OutgoingTxBatch { + return OutgoingTxBatch.decode(message.value); + }, + toProto(message: OutgoingTxBatch): Uint8Array { + return OutgoingTxBatch.encode(message).finish(); + }, + toProtoMsg(message: OutgoingTxBatch): OutgoingTxBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.OutgoingTxBatch", + value: OutgoingTxBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OutgoingTxBatch.typeUrl, OutgoingTxBatch); +function createBaseOutgoingTransferTx(): OutgoingTransferTx { + return { + id: BigInt(0), + sender: "", + destAddress: "", + erc20Token: undefined, + erc20Fee: undefined + }; +} +export const OutgoingTransferTx = { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx", + is(o: any): o is OutgoingTransferTx { + return o && (o.$typeUrl === OutgoingTransferTx.typeUrl || typeof o.id === "bigint" && typeof o.sender === "string" && typeof o.destAddress === "string"); + }, + isAmino(o: any): o is OutgoingTransferTxAmino { + return o && (o.$typeUrl === OutgoingTransferTx.typeUrl || typeof o.id === "bigint" && typeof o.sender === "string" && typeof o.dest_address === "string"); + }, + encode(message: OutgoingTransferTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.destAddress !== "") { + writer.uint32(26).string(message.destAddress); + } + if (message.erc20Token !== undefined) { + ERC20Token.encode(message.erc20Token, writer.uint32(34).fork()).ldelim(); + } + if (message.erc20Fee !== undefined) { + ERC20Token.encode(message.erc20Fee, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OutgoingTransferTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutgoingTransferTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.destAddress = reader.string(); + break; + case 4: + message.erc20Token = ERC20Token.decode(reader, reader.uint32()); + break; + case 5: + message.erc20Fee = ERC20Token.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OutgoingTransferTx { + const message = createBaseOutgoingTransferTx(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.destAddress = object.destAddress ?? ""; + message.erc20Token = object.erc20Token !== undefined && object.erc20Token !== null ? ERC20Token.fromPartial(object.erc20Token) : undefined; + message.erc20Fee = object.erc20Fee !== undefined && object.erc20Fee !== null ? ERC20Token.fromPartial(object.erc20Fee) : undefined; + return message; + }, + fromAmino(object: OutgoingTransferTxAmino): OutgoingTransferTx { + const message = createBaseOutgoingTransferTx(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.dest_address !== undefined && object.dest_address !== null) { + message.destAddress = object.dest_address; + } + if (object.erc20_token !== undefined && object.erc20_token !== null) { + message.erc20Token = ERC20Token.fromAmino(object.erc20_token); + } + if (object.erc20_fee !== undefined && object.erc20_fee !== null) { + message.erc20Fee = ERC20Token.fromAmino(object.erc20_fee); + } + return message; + }, + toAmino(message: OutgoingTransferTx): OutgoingTransferTxAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.dest_address = message.destAddress === "" ? undefined : message.destAddress; + obj.erc20_token = message.erc20Token ? ERC20Token.toAmino(message.erc20Token) : undefined; + obj.erc20_fee = message.erc20Fee ? ERC20Token.toAmino(message.erc20Fee) : undefined; + return obj; + }, + fromAminoMsg(object: OutgoingTransferTxAminoMsg): OutgoingTransferTx { + return OutgoingTransferTx.fromAmino(object.value); + }, + fromProtoMsg(message: OutgoingTransferTxProtoMsg): OutgoingTransferTx { + return OutgoingTransferTx.decode(message.value); + }, + toProto(message: OutgoingTransferTx): Uint8Array { + return OutgoingTransferTx.encode(message).finish(); + }, + toProtoMsg(message: OutgoingTransferTx): OutgoingTransferTxProtoMsg { + return { + typeUrl: "/injective.peggy.v1.OutgoingTransferTx", + value: OutgoingTransferTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OutgoingTransferTx.typeUrl, OutgoingTransferTx); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/ethereum_signer.ts b/libs/injectivejs/src/injective/peggy/v1/ethereum_signer.ts new file mode 100644 index 00000000..5c00229c --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/ethereum_signer.ts @@ -0,0 +1,38 @@ +/** SignType defines messages that have been signed by an orchestrator */ +export enum SignType { + SIGN_TYPE_UNKNOWN = 0, + SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE = 1, + SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH = 2, + UNRECOGNIZED = -1, +} +export const SignTypeAmino = SignType; +export function signTypeFromJSON(object: any): SignType { + switch (object) { + case 0: + case "SIGN_TYPE_UNKNOWN": + return SignType.SIGN_TYPE_UNKNOWN; + case 1: + case "SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE": + return SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE; + case 2: + case "SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH": + return SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH; + case -1: + case "UNRECOGNIZED": + default: + return SignType.UNRECOGNIZED; + } +} +export function signTypeToJSON(object: SignType): string { + switch (object) { + case SignType.SIGN_TYPE_UNKNOWN: + return "SIGN_TYPE_UNKNOWN"; + case SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE: + return "SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE"; + case SignType.SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH: + return "SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH"; + case SignType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/events.ts b/libs/injectivejs/src/injective/peggy/v1/events.ts new file mode 100644 index 00000000..bb0b7095 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/events.ts @@ -0,0 +1,2274 @@ +import { ClaimType } from "./attestation"; +import { BridgeValidator, BridgeValidatorAmino } from "./types"; +import { isSet, DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventAttestationObserved { + attestationType: ClaimType; + bridgeContract: string; + bridgeChainId: bigint; + attestationId: Uint8Array; + nonce: bigint; +} +export interface EventAttestationObservedProtoMsg { + typeUrl: "/injective.peggy.v1.EventAttestationObserved"; + value: Uint8Array; +} +export interface EventAttestationObservedAmino { + attestation_type: ClaimType; + bridge_contract: string; + bridge_chain_id: string; + attestation_id: string; + nonce: string; +} +export interface EventAttestationObservedAminoMsg { + type: "/injective.peggy.v1.EventAttestationObserved"; + value: EventAttestationObservedAmino; +} +export interface EventBridgeWithdrawCanceled { + bridgeContract: string; + bridgeChainId: bigint; +} +export interface EventBridgeWithdrawCanceledProtoMsg { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled"; + value: Uint8Array; +} +export interface EventBridgeWithdrawCanceledAmino { + bridge_contract: string; + bridge_chain_id: string; +} +export interface EventBridgeWithdrawCanceledAminoMsg { + type: "/injective.peggy.v1.EventBridgeWithdrawCanceled"; + value: EventBridgeWithdrawCanceledAmino; +} +export interface EventOutgoingBatch { + denom: string; + orchestratorAddress: string; + batchNonce: bigint; + batchTimeout: bigint; + batchTxIds: bigint[]; +} +export interface EventOutgoingBatchProtoMsg { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch"; + value: Uint8Array; +} +export interface EventOutgoingBatchAmino { + denom: string; + orchestrator_address: string; + batch_nonce: string; + batch_timeout: string; + batch_tx_ids: string[]; +} +export interface EventOutgoingBatchAminoMsg { + type: "/injective.peggy.v1.EventOutgoingBatch"; + value: EventOutgoingBatchAmino; +} +export interface EventOutgoingBatchCanceled { + bridgeContract: string; + bridgeChainId: bigint; + batchId: bigint; + nonce: bigint; +} +export interface EventOutgoingBatchCanceledProtoMsg { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled"; + value: Uint8Array; +} +export interface EventOutgoingBatchCanceledAmino { + bridge_contract: string; + bridge_chain_id: string; + batch_id: string; + nonce: string; +} +export interface EventOutgoingBatchCanceledAminoMsg { + type: "/injective.peggy.v1.EventOutgoingBatchCanceled"; + value: EventOutgoingBatchCanceledAmino; +} +export interface EventValsetUpdateRequest { + valsetNonce: bigint; + valsetHeight: bigint; + valsetMembers: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; +} +export interface EventValsetUpdateRequestProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest"; + value: Uint8Array; +} +export interface EventValsetUpdateRequestAmino { + valset_nonce: string; + valset_height: string; + valset_members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; +} +export interface EventValsetUpdateRequestAminoMsg { + type: "/injective.peggy.v1.EventValsetUpdateRequest"; + value: EventValsetUpdateRequestAmino; +} +export interface EventSetOrchestratorAddresses { + validatorAddress: string; + orchestratorAddress: string; + operatorEthAddress: string; +} +export interface EventSetOrchestratorAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses"; + value: Uint8Array; +} +export interface EventSetOrchestratorAddressesAmino { + validator_address: string; + orchestrator_address: string; + operator_eth_address: string; +} +export interface EventSetOrchestratorAddressesAminoMsg { + type: "/injective.peggy.v1.EventSetOrchestratorAddresses"; + value: EventSetOrchestratorAddressesAmino; +} +export interface EventValsetConfirm { + valsetNonce: bigint; + orchestratorAddress: string; +} +export interface EventValsetConfirmProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetConfirm"; + value: Uint8Array; +} +export interface EventValsetConfirmAmino { + valset_nonce: string; + orchestrator_address: string; +} +export interface EventValsetConfirmAminoMsg { + type: "/injective.peggy.v1.EventValsetConfirm"; + value: EventValsetConfirmAmino; +} +export interface EventSendToEth { + outgoingTxId: bigint; + sender: string; + receiver: string; + amount: string; + bridgeFee: string; +} +export interface EventSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.EventSendToEth"; + value: Uint8Array; +} +export interface EventSendToEthAmino { + outgoing_tx_id: string; + sender: string; + receiver: string; + amount: string; + bridge_fee: string; +} +export interface EventSendToEthAminoMsg { + type: "/injective.peggy.v1.EventSendToEth"; + value: EventSendToEthAmino; +} +export interface EventConfirmBatch { + batchNonce: bigint; + orchestratorAddress: string; +} +export interface EventConfirmBatchProtoMsg { + typeUrl: "/injective.peggy.v1.EventConfirmBatch"; + value: Uint8Array; +} +export interface EventConfirmBatchAmino { + batch_nonce: string; + orchestrator_address: string; +} +export interface EventConfirmBatchAminoMsg { + type: "/injective.peggy.v1.EventConfirmBatch"; + value: EventConfirmBatchAmino; +} +export interface EventAttestationVote { + eventNonce: bigint; + attestationId: Uint8Array; + voter: string; +} +export interface EventAttestationVoteProtoMsg { + typeUrl: "/injective.peggy.v1.EventAttestationVote"; + value: Uint8Array; +} +export interface EventAttestationVoteAmino { + event_nonce: string; + attestation_id: string; + voter: string; +} +export interface EventAttestationVoteAminoMsg { + type: "/injective.peggy.v1.EventAttestationVote"; + value: EventAttestationVoteAmino; +} +export interface EventDepositClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + ethereumSender: string; + cosmosReceiver: string; + tokenContract: string; + amount: string; + orchestratorAddress: string; + data: string; +} +export interface EventDepositClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventDepositClaim"; + value: Uint8Array; +} +export interface EventDepositClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + ethereum_sender: string; + cosmos_receiver: string; + token_contract: string; + amount: string; + orchestrator_address: string; + data: string; +} +export interface EventDepositClaimAminoMsg { + type: "/injective.peggy.v1.EventDepositClaim"; + value: EventDepositClaimAmino; +} +export interface EventWithdrawClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + batchNonce: bigint; + tokenContract: string; + orchestratorAddress: string; +} +export interface EventWithdrawClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim"; + value: Uint8Array; +} +export interface EventWithdrawClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + batch_nonce: string; + token_contract: string; + orchestrator_address: string; +} +export interface EventWithdrawClaimAminoMsg { + type: "/injective.peggy.v1.EventWithdrawClaim"; + value: EventWithdrawClaimAmino; +} +export interface EventERC20DeployedClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + cosmosDenom: string; + tokenContract: string; + name: string; + symbol: string; + decimals: bigint; + orchestratorAddress: string; +} +export interface EventERC20DeployedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim"; + value: Uint8Array; +} +export interface EventERC20DeployedClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + cosmos_denom: string; + token_contract: string; + name: string; + symbol: string; + decimals: string; + orchestrator_address: string; +} +export interface EventERC20DeployedClaimAminoMsg { + type: "/injective.peggy.v1.EventERC20DeployedClaim"; + value: EventERC20DeployedClaimAmino; +} +export interface EventValsetUpdateClaim { + eventNonce: bigint; + eventHeight: bigint; + attestationId: Uint8Array; + valsetNonce: bigint; + valsetMembers: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; + orchestratorAddress: string; +} +export interface EventValsetUpdateClaimProtoMsg { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim"; + value: Uint8Array; +} +export interface EventValsetUpdateClaimAmino { + event_nonce: string; + event_height: string; + attestation_id: string; + valset_nonce: string; + valset_members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; + orchestrator_address: string; +} +export interface EventValsetUpdateClaimAminoMsg { + type: "/injective.peggy.v1.EventValsetUpdateClaim"; + value: EventValsetUpdateClaimAmino; +} +export interface EventCancelSendToEth { + outgoingTxId: bigint; +} +export interface EventCancelSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth"; + value: Uint8Array; +} +export interface EventCancelSendToEthAmino { + outgoing_tx_id: string; +} +export interface EventCancelSendToEthAminoMsg { + type: "/injective.peggy.v1.EventCancelSendToEth"; + value: EventCancelSendToEthAmino; +} +export interface EventSubmitBadSignatureEvidence { + badEthSignature: string; + badEthSignatureSubject: string; +} +export interface EventSubmitBadSignatureEvidenceProtoMsg { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence"; + value: Uint8Array; +} +export interface EventSubmitBadSignatureEvidenceAmino { + bad_eth_signature: string; + bad_eth_signature_subject: string; +} +export interface EventSubmitBadSignatureEvidenceAminoMsg { + type: "/injective.peggy.v1.EventSubmitBadSignatureEvidence"; + value: EventSubmitBadSignatureEvidenceAmino; +} +export interface EventValidatorSlash { + power: bigint; + reason: string; + consensusAddress: string; + operatorAddress: string; + moniker: string; +} +export interface EventValidatorSlashProtoMsg { + typeUrl: "/injective.peggy.v1.EventValidatorSlash"; + value: Uint8Array; +} +export interface EventValidatorSlashAmino { + power: string; + reason: string; + consensus_address: string; + operator_address: string; + moniker: string; +} +export interface EventValidatorSlashAminoMsg { + type: "/injective.peggy.v1.EventValidatorSlash"; + value: EventValidatorSlashAmino; +} +function createBaseEventAttestationObserved(): EventAttestationObserved { + return { + attestationType: 0, + bridgeContract: "", + bridgeChainId: BigInt(0), + attestationId: new Uint8Array(), + nonce: BigInt(0) + }; +} +export const EventAttestationObserved = { + typeUrl: "/injective.peggy.v1.EventAttestationObserved", + is(o: any): o is EventAttestationObserved { + return o && (o.$typeUrl === EventAttestationObserved.typeUrl || isSet(o.attestationType) && typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is EventAttestationObservedAmino { + return o && (o.$typeUrl === EventAttestationObserved.typeUrl || isSet(o.attestation_type) && typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.nonce === "bigint"); + }, + encode(message: EventAttestationObserved, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.attestationType !== 0) { + writer.uint32(8).int32(message.attestationType); + } + if (message.bridgeContract !== "") { + writer.uint32(18).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(24).uint64(message.bridgeChainId); + } + if (message.attestationId.length !== 0) { + writer.uint32(34).bytes(message.attestationId); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(40).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttestationObserved { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttestationObserved(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attestationType = (reader.int32() as any); + break; + case 2: + message.bridgeContract = reader.string(); + break; + case 3: + message.bridgeChainId = reader.uint64(); + break; + case 4: + message.attestationId = reader.bytes(); + break; + case 5: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttestationObserved { + const message = createBaseEventAttestationObserved(); + message.attestationType = object.attestationType ?? 0; + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventAttestationObservedAmino): EventAttestationObserved { + const message = createBaseEventAttestationObserved(); + if (object.attestation_type !== undefined && object.attestation_type !== null) { + message.attestationType = object.attestation_type; + } + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: EventAttestationObserved): EventAttestationObservedAmino { + const obj: any = {}; + obj.attestation_type = message.attestationType === 0 ? undefined : message.attestationType; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventAttestationObservedAminoMsg): EventAttestationObserved { + return EventAttestationObserved.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttestationObservedProtoMsg): EventAttestationObserved { + return EventAttestationObserved.decode(message.value); + }, + toProto(message: EventAttestationObserved): Uint8Array { + return EventAttestationObserved.encode(message).finish(); + }, + toProtoMsg(message: EventAttestationObserved): EventAttestationObservedProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventAttestationObserved", + value: EventAttestationObserved.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttestationObserved.typeUrl, EventAttestationObserved); +function createBaseEventBridgeWithdrawCanceled(): EventBridgeWithdrawCanceled { + return { + bridgeContract: "", + bridgeChainId: BigInt(0) + }; +} +export const EventBridgeWithdrawCanceled = { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled", + is(o: any): o is EventBridgeWithdrawCanceled { + return o && (o.$typeUrl === EventBridgeWithdrawCanceled.typeUrl || typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint"); + }, + isAmino(o: any): o is EventBridgeWithdrawCanceledAmino { + return o && (o.$typeUrl === EventBridgeWithdrawCanceled.typeUrl || typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint"); + }, + encode(message: EventBridgeWithdrawCanceled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bridgeContract !== "") { + writer.uint32(10).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(16).uint64(message.bridgeChainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBridgeWithdrawCanceled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBridgeWithdrawCanceled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bridgeContract = reader.string(); + break; + case 2: + message.bridgeChainId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBridgeWithdrawCanceled { + const message = createBaseEventBridgeWithdrawCanceled(); + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventBridgeWithdrawCanceledAmino): EventBridgeWithdrawCanceled { + const message = createBaseEventBridgeWithdrawCanceled(); + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + return message; + }, + toAmino(message: EventBridgeWithdrawCanceled): EventBridgeWithdrawCanceledAmino { + const obj: any = {}; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventBridgeWithdrawCanceledAminoMsg): EventBridgeWithdrawCanceled { + return EventBridgeWithdrawCanceled.fromAmino(object.value); + }, + fromProtoMsg(message: EventBridgeWithdrawCanceledProtoMsg): EventBridgeWithdrawCanceled { + return EventBridgeWithdrawCanceled.decode(message.value); + }, + toProto(message: EventBridgeWithdrawCanceled): Uint8Array { + return EventBridgeWithdrawCanceled.encode(message).finish(); + }, + toProtoMsg(message: EventBridgeWithdrawCanceled): EventBridgeWithdrawCanceledProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventBridgeWithdrawCanceled", + value: EventBridgeWithdrawCanceled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBridgeWithdrawCanceled.typeUrl, EventBridgeWithdrawCanceled); +function createBaseEventOutgoingBatch(): EventOutgoingBatch { + return { + denom: "", + orchestratorAddress: "", + batchNonce: BigInt(0), + batchTimeout: BigInt(0), + batchTxIds: [] + }; +} +export const EventOutgoingBatch = { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch", + is(o: any): o is EventOutgoingBatch { + return o && (o.$typeUrl === EventOutgoingBatch.typeUrl || typeof o.denom === "string" && typeof o.orchestratorAddress === "string" && typeof o.batchNonce === "bigint" && typeof o.batchTimeout === "bigint" && Array.isArray(o.batchTxIds) && (!o.batchTxIds.length || typeof o.batchTxIds[0] === "bigint")); + }, + isAmino(o: any): o is EventOutgoingBatchAmino { + return o && (o.$typeUrl === EventOutgoingBatch.typeUrl || typeof o.denom === "string" && typeof o.orchestrator_address === "string" && typeof o.batch_nonce === "bigint" && typeof o.batch_timeout === "bigint" && Array.isArray(o.batch_tx_ids) && (!o.batch_tx_ids.length || typeof o.batch_tx_ids[0] === "bigint")); + }, + encode(message: EventOutgoingBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(24).uint64(message.batchNonce); + } + if (message.batchTimeout !== BigInt(0)) { + writer.uint32(32).uint64(message.batchTimeout); + } + writer.uint32(42).fork(); + for (const v of message.batchTxIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOutgoingBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOutgoingBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + case 3: + message.batchNonce = reader.uint64(); + break; + case 4: + message.batchTimeout = reader.uint64(); + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.batchTxIds.push(reader.uint64()); + } + } else { + message.batchTxIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOutgoingBatch { + const message = createBaseEventOutgoingBatch(); + message.denom = object.denom ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.batchTimeout = object.batchTimeout !== undefined && object.batchTimeout !== null ? BigInt(object.batchTimeout.toString()) : BigInt(0); + message.batchTxIds = object.batchTxIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: EventOutgoingBatchAmino): EventOutgoingBatch { + const message = createBaseEventOutgoingBatch(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.batch_timeout !== undefined && object.batch_timeout !== null) { + message.batchTimeout = BigInt(object.batch_timeout); + } + message.batchTxIds = object.batch_tx_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: EventOutgoingBatch): EventOutgoingBatchAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.batch_timeout = message.batchTimeout !== BigInt(0) ? message.batchTimeout?.toString() : undefined; + if (message.batchTxIds) { + obj.batch_tx_ids = message.batchTxIds.map(e => e.toString()); + } else { + obj.batch_tx_ids = message.batchTxIds; + } + return obj; + }, + fromAminoMsg(object: EventOutgoingBatchAminoMsg): EventOutgoingBatch { + return EventOutgoingBatch.fromAmino(object.value); + }, + fromProtoMsg(message: EventOutgoingBatchProtoMsg): EventOutgoingBatch { + return EventOutgoingBatch.decode(message.value); + }, + toProto(message: EventOutgoingBatch): Uint8Array { + return EventOutgoingBatch.encode(message).finish(); + }, + toProtoMsg(message: EventOutgoingBatch): EventOutgoingBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventOutgoingBatch", + value: EventOutgoingBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOutgoingBatch.typeUrl, EventOutgoingBatch); +function createBaseEventOutgoingBatchCanceled(): EventOutgoingBatchCanceled { + return { + bridgeContract: "", + bridgeChainId: BigInt(0), + batchId: BigInt(0), + nonce: BigInt(0) + }; +} +export const EventOutgoingBatchCanceled = { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled", + is(o: any): o is EventOutgoingBatchCanceled { + return o && (o.$typeUrl === EventOutgoingBatchCanceled.typeUrl || typeof o.bridgeContract === "string" && typeof o.bridgeChainId === "bigint" && typeof o.batchId === "bigint" && typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is EventOutgoingBatchCanceledAmino { + return o && (o.$typeUrl === EventOutgoingBatchCanceled.typeUrl || typeof o.bridge_contract === "string" && typeof o.bridge_chain_id === "bigint" && typeof o.batch_id === "bigint" && typeof o.nonce === "bigint"); + }, + encode(message: EventOutgoingBatchCanceled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bridgeContract !== "") { + writer.uint32(10).string(message.bridgeContract); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(16).uint64(message.bridgeChainId); + } + if (message.batchId !== BigInt(0)) { + writer.uint32(24).uint64(message.batchId); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(32).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventOutgoingBatchCanceled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventOutgoingBatchCanceled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bridgeContract = reader.string(); + break; + case 2: + message.bridgeChainId = reader.uint64(); + break; + case 3: + message.batchId = reader.uint64(); + break; + case 4: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventOutgoingBatchCanceled { + const message = createBaseEventOutgoingBatchCanceled(); + message.bridgeContract = object.bridgeContract ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.batchId = object.batchId !== undefined && object.batchId !== null ? BigInt(object.batchId.toString()) : BigInt(0); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventOutgoingBatchCanceledAmino): EventOutgoingBatchCanceled { + const message = createBaseEventOutgoingBatchCanceled(); + if (object.bridge_contract !== undefined && object.bridge_contract !== null) { + message.bridgeContract = object.bridge_contract; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.batch_id !== undefined && object.batch_id !== null) { + message.batchId = BigInt(object.batch_id); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: EventOutgoingBatchCanceled): EventOutgoingBatchCanceledAmino { + const obj: any = {}; + obj.bridge_contract = message.bridgeContract === "" ? undefined : message.bridgeContract; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.batch_id = message.batchId !== BigInt(0) ? message.batchId?.toString() : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventOutgoingBatchCanceledAminoMsg): EventOutgoingBatchCanceled { + return EventOutgoingBatchCanceled.fromAmino(object.value); + }, + fromProtoMsg(message: EventOutgoingBatchCanceledProtoMsg): EventOutgoingBatchCanceled { + return EventOutgoingBatchCanceled.decode(message.value); + }, + toProto(message: EventOutgoingBatchCanceled): Uint8Array { + return EventOutgoingBatchCanceled.encode(message).finish(); + }, + toProtoMsg(message: EventOutgoingBatchCanceled): EventOutgoingBatchCanceledProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventOutgoingBatchCanceled", + value: EventOutgoingBatchCanceled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventOutgoingBatchCanceled.typeUrl, EventOutgoingBatchCanceled); +function createBaseEventValsetUpdateRequest(): EventValsetUpdateRequest { + return { + valsetNonce: BigInt(0), + valsetHeight: BigInt(0), + valsetMembers: [], + rewardAmount: "", + rewardToken: "" + }; +} +export const EventValsetUpdateRequest = { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest", + is(o: any): o is EventValsetUpdateRequest { + return o && (o.$typeUrl === EventValsetUpdateRequest.typeUrl || typeof o.valsetNonce === "bigint" && typeof o.valsetHeight === "bigint" && Array.isArray(o.valsetMembers) && (!o.valsetMembers.length || BridgeValidator.is(o.valsetMembers[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string"); + }, + isAmino(o: any): o is EventValsetUpdateRequestAmino { + return o && (o.$typeUrl === EventValsetUpdateRequest.typeUrl || typeof o.valset_nonce === "bigint" && typeof o.valset_height === "bigint" && Array.isArray(o.valset_members) && (!o.valset_members.length || BridgeValidator.isAmino(o.valset_members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string"); + }, + encode(message: EventValsetUpdateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.valsetNonce); + } + if (message.valsetHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetHeight); + } + for (const v of message.valsetMembers) { + BridgeValidator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(34).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(42).string(message.rewardToken); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetUpdateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsetNonce = reader.uint64(); + break; + case 2: + message.valsetHeight = reader.uint64(); + break; + case 3: + message.valsetMembers.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 4: + message.rewardAmount = reader.string(); + break; + case 5: + message.rewardToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetUpdateRequest { + const message = createBaseEventValsetUpdateRequest(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.valsetHeight = object.valsetHeight !== undefined && object.valsetHeight !== null ? BigInt(object.valsetHeight.toString()) : BigInt(0); + message.valsetMembers = object.valsetMembers?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + return message; + }, + fromAmino(object: EventValsetUpdateRequestAmino): EventValsetUpdateRequest { + const message = createBaseEventValsetUpdateRequest(); + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.valset_height !== undefined && object.valset_height !== null) { + message.valsetHeight = BigInt(object.valset_height); + } + message.valsetMembers = object.valset_members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + return message; + }, + toAmino(message: EventValsetUpdateRequest): EventValsetUpdateRequestAmino { + const obj: any = {}; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.valset_height = message.valsetHeight !== BigInt(0) ? message.valsetHeight?.toString() : undefined; + if (message.valsetMembers) { + obj.valset_members = message.valsetMembers.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.valset_members = message.valsetMembers; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + return obj; + }, + fromAminoMsg(object: EventValsetUpdateRequestAminoMsg): EventValsetUpdateRequest { + return EventValsetUpdateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetUpdateRequestProtoMsg): EventValsetUpdateRequest { + return EventValsetUpdateRequest.decode(message.value); + }, + toProto(message: EventValsetUpdateRequest): Uint8Array { + return EventValsetUpdateRequest.encode(message).finish(); + }, + toProtoMsg(message: EventValsetUpdateRequest): EventValsetUpdateRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetUpdateRequest", + value: EventValsetUpdateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetUpdateRequest.typeUrl, EventValsetUpdateRequest); +function createBaseEventSetOrchestratorAddresses(): EventSetOrchestratorAddresses { + return { + validatorAddress: "", + orchestratorAddress: "", + operatorEthAddress: "" + }; +} +export const EventSetOrchestratorAddresses = { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses", + is(o: any): o is EventSetOrchestratorAddresses { + return o && (o.$typeUrl === EventSetOrchestratorAddresses.typeUrl || typeof o.validatorAddress === "string" && typeof o.orchestratorAddress === "string" && typeof o.operatorEthAddress === "string"); + }, + isAmino(o: any): o is EventSetOrchestratorAddressesAmino { + return o && (o.$typeUrl === EventSetOrchestratorAddresses.typeUrl || typeof o.validator_address === "string" && typeof o.orchestrator_address === "string" && typeof o.operator_eth_address === "string"); + }, + encode(message: EventSetOrchestratorAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + if (message.operatorEthAddress !== "") { + writer.uint32(26).string(message.operatorEthAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetOrchestratorAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetOrchestratorAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + case 3: + message.operatorEthAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetOrchestratorAddresses { + const message = createBaseEventSetOrchestratorAddresses(); + message.validatorAddress = object.validatorAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.operatorEthAddress = object.operatorEthAddress ?? ""; + return message; + }, + fromAmino(object: EventSetOrchestratorAddressesAmino): EventSetOrchestratorAddresses { + const message = createBaseEventSetOrchestratorAddresses(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.operator_eth_address !== undefined && object.operator_eth_address !== null) { + message.operatorEthAddress = object.operator_eth_address; + } + return message; + }, + toAmino(message: EventSetOrchestratorAddresses): EventSetOrchestratorAddressesAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.operator_eth_address = message.operatorEthAddress === "" ? undefined : message.operatorEthAddress; + return obj; + }, + fromAminoMsg(object: EventSetOrchestratorAddressesAminoMsg): EventSetOrchestratorAddresses { + return EventSetOrchestratorAddresses.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetOrchestratorAddressesProtoMsg): EventSetOrchestratorAddresses { + return EventSetOrchestratorAddresses.decode(message.value); + }, + toProto(message: EventSetOrchestratorAddresses): Uint8Array { + return EventSetOrchestratorAddresses.encode(message).finish(); + }, + toProtoMsg(message: EventSetOrchestratorAddresses): EventSetOrchestratorAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSetOrchestratorAddresses", + value: EventSetOrchestratorAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetOrchestratorAddresses.typeUrl, EventSetOrchestratorAddresses); +function createBaseEventValsetConfirm(): EventValsetConfirm { + return { + valsetNonce: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventValsetConfirm = { + typeUrl: "/injective.peggy.v1.EventValsetConfirm", + is(o: any): o is EventValsetConfirm { + return o && (o.$typeUrl === EventValsetConfirm.typeUrl || typeof o.valsetNonce === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventValsetConfirmAmino { + return o && (o.$typeUrl === EventValsetConfirm.typeUrl || typeof o.valset_nonce === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventValsetConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.valsetNonce); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsetNonce = reader.uint64(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetConfirm { + const message = createBaseEventValsetConfirm(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventValsetConfirmAmino): EventValsetConfirm { + const message = createBaseEventValsetConfirm(); + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventValsetConfirm): EventValsetConfirmAmino { + const obj: any = {}; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventValsetConfirmAminoMsg): EventValsetConfirm { + return EventValsetConfirm.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetConfirmProtoMsg): EventValsetConfirm { + return EventValsetConfirm.decode(message.value); + }, + toProto(message: EventValsetConfirm): Uint8Array { + return EventValsetConfirm.encode(message).finish(); + }, + toProtoMsg(message: EventValsetConfirm): EventValsetConfirmProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetConfirm", + value: EventValsetConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetConfirm.typeUrl, EventValsetConfirm); +function createBaseEventSendToEth(): EventSendToEth { + return { + outgoingTxId: BigInt(0), + sender: "", + receiver: "", + amount: "", + bridgeFee: "" + }; +} +export const EventSendToEth = { + typeUrl: "/injective.peggy.v1.EventSendToEth", + is(o: any): o is EventSendToEth { + return o && (o.$typeUrl === EventSendToEth.typeUrl || typeof o.outgoingTxId === "bigint" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.amount === "string" && typeof o.bridgeFee === "string"); + }, + isAmino(o: any): o is EventSendToEthAmino { + return o && (o.$typeUrl === EventSendToEth.typeUrl || typeof o.outgoing_tx_id === "bigint" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.amount === "string" && typeof o.bridge_fee === "string"); + }, + encode(message: EventSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.outgoingTxId !== BigInt(0)) { + writer.uint32(8).uint64(message.outgoingTxId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(26).string(message.receiver); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.bridgeFee !== "") { + writer.uint32(42).string(message.bridgeFee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outgoingTxId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.receiver = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.bridgeFee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSendToEth { + const message = createBaseEventSendToEth(); + message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? BigInt(object.outgoingTxId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.amount = object.amount ?? ""; + message.bridgeFee = object.bridgeFee ?? ""; + return message; + }, + fromAmino(object: EventSendToEthAmino): EventSendToEth { + const message = createBaseEventSendToEth(); + if (object.outgoing_tx_id !== undefined && object.outgoing_tx_id !== null) { + message.outgoingTxId = BigInt(object.outgoing_tx_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.bridge_fee !== undefined && object.bridge_fee !== null) { + message.bridgeFee = object.bridge_fee; + } + return message; + }, + toAmino(message: EventSendToEth): EventSendToEthAmino { + const obj: any = {}; + obj.outgoing_tx_id = message.outgoingTxId !== BigInt(0) ? message.outgoingTxId?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.bridge_fee = message.bridgeFee === "" ? undefined : message.bridgeFee; + return obj; + }, + fromAminoMsg(object: EventSendToEthAminoMsg): EventSendToEth { + return EventSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: EventSendToEthProtoMsg): EventSendToEth { + return EventSendToEth.decode(message.value); + }, + toProto(message: EventSendToEth): Uint8Array { + return EventSendToEth.encode(message).finish(); + }, + toProtoMsg(message: EventSendToEth): EventSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSendToEth", + value: EventSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSendToEth.typeUrl, EventSendToEth); +function createBaseEventConfirmBatch(): EventConfirmBatch { + return { + batchNonce: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventConfirmBatch = { + typeUrl: "/injective.peggy.v1.EventConfirmBatch", + is(o: any): o is EventConfirmBatch { + return o && (o.$typeUrl === EventConfirmBatch.typeUrl || typeof o.batchNonce === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventConfirmBatchAmino { + return o && (o.$typeUrl === EventConfirmBatch.typeUrl || typeof o.batch_nonce === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventConfirmBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.batchNonce); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventConfirmBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConfirmBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchNonce = reader.uint64(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventConfirmBatch { + const message = createBaseEventConfirmBatch(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventConfirmBatchAmino): EventConfirmBatch { + const message = createBaseEventConfirmBatch(); + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventConfirmBatch): EventConfirmBatchAmino { + const obj: any = {}; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventConfirmBatchAminoMsg): EventConfirmBatch { + return EventConfirmBatch.fromAmino(object.value); + }, + fromProtoMsg(message: EventConfirmBatchProtoMsg): EventConfirmBatch { + return EventConfirmBatch.decode(message.value); + }, + toProto(message: EventConfirmBatch): Uint8Array { + return EventConfirmBatch.encode(message).finish(); + }, + toProtoMsg(message: EventConfirmBatch): EventConfirmBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventConfirmBatch", + value: EventConfirmBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventConfirmBatch.typeUrl, EventConfirmBatch); +function createBaseEventAttestationVote(): EventAttestationVote { + return { + eventNonce: BigInt(0), + attestationId: new Uint8Array(), + voter: "" + }; +} +export const EventAttestationVote = { + typeUrl: "/injective.peggy.v1.EventAttestationVote", + is(o: any): o is EventAttestationVote { + return o && (o.$typeUrl === EventAttestationVote.typeUrl || typeof o.eventNonce === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.voter === "string"); + }, + isAmino(o: any): o is EventAttestationVoteAmino { + return o && (o.$typeUrl === EventAttestationVote.typeUrl || typeof o.event_nonce === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.voter === "string"); + }, + encode(message: EventAttestationVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.attestationId.length !== 0) { + writer.uint32(18).bytes(message.attestationId); + } + if (message.voter !== "") { + writer.uint32(26).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttestationVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttestationVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.attestationId = reader.bytes(); + break; + case 3: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttestationVote { + const message = createBaseEventAttestationVote(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: EventAttestationVoteAmino): EventAttestationVote { + const message = createBaseEventAttestationVote(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: EventAttestationVote): EventAttestationVoteAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: EventAttestationVoteAminoMsg): EventAttestationVote { + return EventAttestationVote.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttestationVoteProtoMsg): EventAttestationVote { + return EventAttestationVote.decode(message.value); + }, + toProto(message: EventAttestationVote): Uint8Array { + return EventAttestationVote.encode(message).finish(); + }, + toProtoMsg(message: EventAttestationVote): EventAttestationVoteProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventAttestationVote", + value: EventAttestationVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttestationVote.typeUrl, EventAttestationVote); +function createBaseEventDepositClaim(): EventDepositClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + ethereumSender: "", + cosmosReceiver: "", + tokenContract: "", + amount: "", + orchestratorAddress: "", + data: "" + }; +} +export const EventDepositClaim = { + typeUrl: "/injective.peggy.v1.EventDepositClaim", + is(o: any): o is EventDepositClaim { + return o && (o.$typeUrl === EventDepositClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.ethereumSender === "string" && typeof o.cosmosReceiver === "string" && typeof o.tokenContract === "string" && typeof o.amount === "string" && typeof o.orchestratorAddress === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is EventDepositClaimAmino { + return o && (o.$typeUrl === EventDepositClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.ethereum_sender === "string" && typeof o.cosmos_receiver === "string" && typeof o.token_contract === "string" && typeof o.amount === "string" && typeof o.orchestrator_address === "string" && typeof o.data === "string"); + }, + encode(message: EventDepositClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.ethereumSender !== "") { + writer.uint32(34).string(message.ethereumSender); + } + if (message.cosmosReceiver !== "") { + writer.uint32(42).string(message.cosmosReceiver); + } + if (message.tokenContract !== "") { + writer.uint32(50).string(message.tokenContract); + } + if (message.amount !== "") { + writer.uint32(58).string(message.amount); + } + if (message.orchestratorAddress !== "") { + writer.uint32(66).string(message.orchestratorAddress); + } + if (message.data !== "") { + writer.uint32(74).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventDepositClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventDepositClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.ethereumSender = reader.string(); + break; + case 5: + message.cosmosReceiver = reader.string(); + break; + case 6: + message.tokenContract = reader.string(); + break; + case 7: + message.amount = reader.string(); + break; + case 8: + message.orchestratorAddress = reader.string(); + break; + case 9: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventDepositClaim { + const message = createBaseEventDepositClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.ethereumSender = object.ethereumSender ?? ""; + message.cosmosReceiver = object.cosmosReceiver ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.amount = object.amount ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: EventDepositClaimAmino): EventDepositClaim { + const message = createBaseEventDepositClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.ethereum_sender !== undefined && object.ethereum_sender !== null) { + message.ethereumSender = object.ethereum_sender; + } + if (object.cosmos_receiver !== undefined && object.cosmos_receiver !== null) { + message.cosmosReceiver = object.cosmos_receiver; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: EventDepositClaim): EventDepositClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.ethereum_sender = message.ethereumSender === "" ? undefined : message.ethereumSender; + obj.cosmos_receiver = message.cosmosReceiver === "" ? undefined : message.cosmosReceiver; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: EventDepositClaimAminoMsg): EventDepositClaim { + return EventDepositClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventDepositClaimProtoMsg): EventDepositClaim { + return EventDepositClaim.decode(message.value); + }, + toProto(message: EventDepositClaim): Uint8Array { + return EventDepositClaim.encode(message).finish(); + }, + toProtoMsg(message: EventDepositClaim): EventDepositClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventDepositClaim", + value: EventDepositClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventDepositClaim.typeUrl, EventDepositClaim); +function createBaseEventWithdrawClaim(): EventWithdrawClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + batchNonce: BigInt(0), + tokenContract: "", + orchestratorAddress: "" + }; +} +export const EventWithdrawClaim = { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim", + is(o: any): o is EventWithdrawClaim { + return o && (o.$typeUrl === EventWithdrawClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.batchNonce === "bigint" && typeof o.tokenContract === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventWithdrawClaimAmino { + return o && (o.$typeUrl === EventWithdrawClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.batch_nonce === "bigint" && typeof o.token_contract === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventWithdrawClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(32).uint64(message.batchNonce); + } + if (message.tokenContract !== "") { + writer.uint32(42).string(message.tokenContract); + } + if (message.orchestratorAddress !== "") { + writer.uint32(50).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.batchNonce = reader.uint64(); + break; + case 5: + message.tokenContract = reader.string(); + break; + case 6: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventWithdrawClaim { + const message = createBaseEventWithdrawClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventWithdrawClaimAmino): EventWithdrawClaim { + const message = createBaseEventWithdrawClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventWithdrawClaim): EventWithdrawClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventWithdrawClaimAminoMsg): EventWithdrawClaim { + return EventWithdrawClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventWithdrawClaimProtoMsg): EventWithdrawClaim { + return EventWithdrawClaim.decode(message.value); + }, + toProto(message: EventWithdrawClaim): Uint8Array { + return EventWithdrawClaim.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawClaim): EventWithdrawClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventWithdrawClaim", + value: EventWithdrawClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventWithdrawClaim.typeUrl, EventWithdrawClaim); +function createBaseEventERC20DeployedClaim(): EventERC20DeployedClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + cosmosDenom: "", + tokenContract: "", + name: "", + symbol: "", + decimals: BigInt(0), + orchestratorAddress: "" + }; +} +export const EventERC20DeployedClaim = { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim", + is(o: any): o is EventERC20DeployedClaim { + return o && (o.$typeUrl === EventERC20DeployedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.cosmosDenom === "string" && typeof o.tokenContract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventERC20DeployedClaimAmino { + return o && (o.$typeUrl === EventERC20DeployedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.cosmos_denom === "string" && typeof o.token_contract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventERC20DeployedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.cosmosDenom !== "") { + writer.uint32(34).string(message.cosmosDenom); + } + if (message.tokenContract !== "") { + writer.uint32(42).string(message.tokenContract); + } + if (message.name !== "") { + writer.uint32(50).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(58).string(message.symbol); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(64).uint64(message.decimals); + } + if (message.orchestratorAddress !== "") { + writer.uint32(74).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventERC20DeployedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventERC20DeployedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.cosmosDenom = reader.string(); + break; + case 5: + message.tokenContract = reader.string(); + break; + case 6: + message.name = reader.string(); + break; + case 7: + message.symbol = reader.string(); + break; + case 8: + message.decimals = reader.uint64(); + break; + case 9: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventERC20DeployedClaim { + const message = createBaseEventERC20DeployedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.cosmosDenom = object.cosmosDenom ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventERC20DeployedClaimAmino): EventERC20DeployedClaim { + const message = createBaseEventERC20DeployedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.cosmos_denom !== undefined && object.cosmos_denom !== null) { + message.cosmosDenom = object.cosmos_denom; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventERC20DeployedClaim): EventERC20DeployedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.cosmos_denom = message.cosmosDenom === "" ? undefined : message.cosmosDenom; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventERC20DeployedClaimAminoMsg): EventERC20DeployedClaim { + return EventERC20DeployedClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventERC20DeployedClaimProtoMsg): EventERC20DeployedClaim { + return EventERC20DeployedClaim.decode(message.value); + }, + toProto(message: EventERC20DeployedClaim): Uint8Array { + return EventERC20DeployedClaim.encode(message).finish(); + }, + toProtoMsg(message: EventERC20DeployedClaim): EventERC20DeployedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventERC20DeployedClaim", + value: EventERC20DeployedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventERC20DeployedClaim.typeUrl, EventERC20DeployedClaim); +function createBaseEventValsetUpdateClaim(): EventValsetUpdateClaim { + return { + eventNonce: BigInt(0), + eventHeight: BigInt(0), + attestationId: new Uint8Array(), + valsetNonce: BigInt(0), + valsetMembers: [], + rewardAmount: "", + rewardToken: "", + orchestratorAddress: "" + }; +} +export const EventValsetUpdateClaim = { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim", + is(o: any): o is EventValsetUpdateClaim { + return o && (o.$typeUrl === EventValsetUpdateClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.eventHeight === "bigint" && (o.attestationId instanceof Uint8Array || typeof o.attestationId === "string") && typeof o.valsetNonce === "bigint" && Array.isArray(o.valsetMembers) && (!o.valsetMembers.length || BridgeValidator.is(o.valsetMembers[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is EventValsetUpdateClaimAmino { + return o && (o.$typeUrl === EventValsetUpdateClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.event_height === "bigint" && (o.attestation_id instanceof Uint8Array || typeof o.attestation_id === "string") && typeof o.valset_nonce === "bigint" && Array.isArray(o.valset_members) && (!o.valset_members.length || BridgeValidator.isAmino(o.valset_members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: EventValsetUpdateClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.eventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.eventHeight); + } + if (message.attestationId.length !== 0) { + writer.uint32(26).bytes(message.attestationId); + } + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(32).uint64(message.valsetNonce); + } + for (const v of message.valsetMembers) { + BridgeValidator.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(50).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(58).string(message.rewardToken); + } + if (message.orchestratorAddress !== "") { + writer.uint32(66).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValsetUpdateClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValsetUpdateClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.eventHeight = reader.uint64(); + break; + case 3: + message.attestationId = reader.bytes(); + break; + case 4: + message.valsetNonce = reader.uint64(); + break; + case 5: + message.valsetMembers.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 6: + message.rewardAmount = reader.string(); + break; + case 7: + message.rewardToken = reader.string(); + break; + case 8: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValsetUpdateClaim { + const message = createBaseEventValsetUpdateClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? BigInt(object.eventHeight.toString()) : BigInt(0); + message.attestationId = object.attestationId ?? new Uint8Array(); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.valsetMembers = object.valsetMembers?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: EventValsetUpdateClaimAmino): EventValsetUpdateClaim { + const message = createBaseEventValsetUpdateClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.event_height !== undefined && object.event_height !== null) { + message.eventHeight = BigInt(object.event_height); + } + if (object.attestation_id !== undefined && object.attestation_id !== null) { + message.attestationId = bytesFromBase64(object.attestation_id); + } + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + message.valsetMembers = object.valset_members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: EventValsetUpdateClaim): EventValsetUpdateClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.event_height = message.eventHeight !== BigInt(0) ? message.eventHeight?.toString() : undefined; + obj.attestation_id = message.attestationId ? base64FromBytes(message.attestationId) : undefined; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + if (message.valsetMembers) { + obj.valset_members = message.valsetMembers.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.valset_members = message.valsetMembers; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: EventValsetUpdateClaimAminoMsg): EventValsetUpdateClaim { + return EventValsetUpdateClaim.fromAmino(object.value); + }, + fromProtoMsg(message: EventValsetUpdateClaimProtoMsg): EventValsetUpdateClaim { + return EventValsetUpdateClaim.decode(message.value); + }, + toProto(message: EventValsetUpdateClaim): Uint8Array { + return EventValsetUpdateClaim.encode(message).finish(); + }, + toProtoMsg(message: EventValsetUpdateClaim): EventValsetUpdateClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValsetUpdateClaim", + value: EventValsetUpdateClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValsetUpdateClaim.typeUrl, EventValsetUpdateClaim); +function createBaseEventCancelSendToEth(): EventCancelSendToEth { + return { + outgoingTxId: BigInt(0) + }; +} +export const EventCancelSendToEth = { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth", + is(o: any): o is EventCancelSendToEth { + return o && (o.$typeUrl === EventCancelSendToEth.typeUrl || typeof o.outgoingTxId === "bigint"); + }, + isAmino(o: any): o is EventCancelSendToEthAmino { + return o && (o.$typeUrl === EventCancelSendToEth.typeUrl || typeof o.outgoing_tx_id === "bigint"); + }, + encode(message: EventCancelSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.outgoingTxId !== BigInt(0)) { + writer.uint32(8).uint64(message.outgoingTxId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCancelSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outgoingTxId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCancelSendToEth { + const message = createBaseEventCancelSendToEth(); + message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? BigInt(object.outgoingTxId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventCancelSendToEthAmino): EventCancelSendToEth { + const message = createBaseEventCancelSendToEth(); + if (object.outgoing_tx_id !== undefined && object.outgoing_tx_id !== null) { + message.outgoingTxId = BigInt(object.outgoing_tx_id); + } + return message; + }, + toAmino(message: EventCancelSendToEth): EventCancelSendToEthAmino { + const obj: any = {}; + obj.outgoing_tx_id = message.outgoingTxId !== BigInt(0) ? message.outgoingTxId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventCancelSendToEthAminoMsg): EventCancelSendToEth { + return EventCancelSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: EventCancelSendToEthProtoMsg): EventCancelSendToEth { + return EventCancelSendToEth.decode(message.value); + }, + toProto(message: EventCancelSendToEth): Uint8Array { + return EventCancelSendToEth.encode(message).finish(); + }, + toProtoMsg(message: EventCancelSendToEth): EventCancelSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventCancelSendToEth", + value: EventCancelSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCancelSendToEth.typeUrl, EventCancelSendToEth); +function createBaseEventSubmitBadSignatureEvidence(): EventSubmitBadSignatureEvidence { + return { + badEthSignature: "", + badEthSignatureSubject: "" + }; +} +export const EventSubmitBadSignatureEvidence = { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence", + is(o: any): o is EventSubmitBadSignatureEvidence { + return o && (o.$typeUrl === EventSubmitBadSignatureEvidence.typeUrl || typeof o.badEthSignature === "string" && typeof o.badEthSignatureSubject === "string"); + }, + isAmino(o: any): o is EventSubmitBadSignatureEvidenceAmino { + return o && (o.$typeUrl === EventSubmitBadSignatureEvidence.typeUrl || typeof o.bad_eth_signature === "string" && typeof o.bad_eth_signature_subject === "string"); + }, + encode(message: EventSubmitBadSignatureEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.badEthSignature !== "") { + writer.uint32(10).string(message.badEthSignature); + } + if (message.badEthSignatureSubject !== "") { + writer.uint32(18).string(message.badEthSignatureSubject); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitBadSignatureEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubmitBadSignatureEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.badEthSignature = reader.string(); + break; + case 2: + message.badEthSignatureSubject = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSubmitBadSignatureEvidence { + const message = createBaseEventSubmitBadSignatureEvidence(); + message.badEthSignature = object.badEthSignature ?? ""; + message.badEthSignatureSubject = object.badEthSignatureSubject ?? ""; + return message; + }, + fromAmino(object: EventSubmitBadSignatureEvidenceAmino): EventSubmitBadSignatureEvidence { + const message = createBaseEventSubmitBadSignatureEvidence(); + if (object.bad_eth_signature !== undefined && object.bad_eth_signature !== null) { + message.badEthSignature = object.bad_eth_signature; + } + if (object.bad_eth_signature_subject !== undefined && object.bad_eth_signature_subject !== null) { + message.badEthSignatureSubject = object.bad_eth_signature_subject; + } + return message; + }, + toAmino(message: EventSubmitBadSignatureEvidence): EventSubmitBadSignatureEvidenceAmino { + const obj: any = {}; + obj.bad_eth_signature = message.badEthSignature === "" ? undefined : message.badEthSignature; + obj.bad_eth_signature_subject = message.badEthSignatureSubject === "" ? undefined : message.badEthSignatureSubject; + return obj; + }, + fromAminoMsg(object: EventSubmitBadSignatureEvidenceAminoMsg): EventSubmitBadSignatureEvidence { + return EventSubmitBadSignatureEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: EventSubmitBadSignatureEvidenceProtoMsg): EventSubmitBadSignatureEvidence { + return EventSubmitBadSignatureEvidence.decode(message.value); + }, + toProto(message: EventSubmitBadSignatureEvidence): Uint8Array { + return EventSubmitBadSignatureEvidence.encode(message).finish(); + }, + toProtoMsg(message: EventSubmitBadSignatureEvidence): EventSubmitBadSignatureEvidenceProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventSubmitBadSignatureEvidence", + value: EventSubmitBadSignatureEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSubmitBadSignatureEvidence.typeUrl, EventSubmitBadSignatureEvidence); +function createBaseEventValidatorSlash(): EventValidatorSlash { + return { + power: BigInt(0), + reason: "", + consensusAddress: "", + operatorAddress: "", + moniker: "" + }; +} +export const EventValidatorSlash = { + typeUrl: "/injective.peggy.v1.EventValidatorSlash", + is(o: any): o is EventValidatorSlash { + return o && (o.$typeUrl === EventValidatorSlash.typeUrl || typeof o.power === "bigint" && typeof o.reason === "string" && typeof o.consensusAddress === "string" && typeof o.operatorAddress === "string" && typeof o.moniker === "string"); + }, + isAmino(o: any): o is EventValidatorSlashAmino { + return o && (o.$typeUrl === EventValidatorSlash.typeUrl || typeof o.power === "bigint" && typeof o.reason === "string" && typeof o.consensus_address === "string" && typeof o.operator_address === "string" && typeof o.moniker === "string"); + }, + encode(message: EventValidatorSlash, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.power !== BigInt(0)) { + writer.uint32(8).int64(message.power); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + if (message.consensusAddress !== "") { + writer.uint32(26).string(message.consensusAddress); + } + if (message.operatorAddress !== "") { + writer.uint32(34).string(message.operatorAddress); + } + if (message.moniker !== "") { + writer.uint32(42).string(message.moniker); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventValidatorSlash { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventValidatorSlash(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.power = reader.int64(); + break; + case 2: + message.reason = reader.string(); + break; + case 3: + message.consensusAddress = reader.string(); + break; + case 4: + message.operatorAddress = reader.string(); + break; + case 5: + message.moniker = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventValidatorSlash { + const message = createBaseEventValidatorSlash(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + message.reason = object.reason ?? ""; + message.consensusAddress = object.consensusAddress ?? ""; + message.operatorAddress = object.operatorAddress ?? ""; + message.moniker = object.moniker ?? ""; + return message; + }, + fromAmino(object: EventValidatorSlashAmino): EventValidatorSlash { + const message = createBaseEventValidatorSlash(); + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + if (object.consensus_address !== undefined && object.consensus_address !== null) { + message.consensusAddress = object.consensus_address; + } + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + return message; + }, + toAmino(message: EventValidatorSlash): EventValidatorSlashAmino { + const obj: any = {}; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + obj.reason = message.reason === "" ? undefined : message.reason; + obj.consensus_address = message.consensusAddress === "" ? undefined : message.consensusAddress; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + return obj; + }, + fromAminoMsg(object: EventValidatorSlashAminoMsg): EventValidatorSlash { + return EventValidatorSlash.fromAmino(object.value); + }, + fromProtoMsg(message: EventValidatorSlashProtoMsg): EventValidatorSlash { + return EventValidatorSlash.decode(message.value); + }, + toProto(message: EventValidatorSlash): Uint8Array { + return EventValidatorSlash.encode(message).finish(); + }, + toProtoMsg(message: EventValidatorSlash): EventValidatorSlashProtoMsg { + return { + typeUrl: "/injective.peggy.v1.EventValidatorSlash", + value: EventValidatorSlash.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventValidatorSlash.typeUrl, EventValidatorSlash); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/genesis.ts b/libs/injectivejs/src/injective/peggy/v1/genesis.ts new file mode 100644 index 00000000..d26c2e15 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/genesis.ts @@ -0,0 +1,308 @@ +import { Params, ParamsAmino } from "./params"; +import { Valset, ValsetAmino, ERC20ToDenom, ERC20ToDenomAmino } from "./types"; +import { MsgValsetConfirm, MsgValsetConfirmAmino, MsgConfirmBatch, MsgConfirmBatchAmino, MsgSetOrchestratorAddresses, MsgSetOrchestratorAddressesAmino } from "./msgs"; +import { OutgoingTxBatch, OutgoingTxBatchAmino, OutgoingTransferTx, OutgoingTransferTxAmino } from "./batch"; +import { Attestation, AttestationAmino } from "./attestation"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState struct */ +export interface GenesisState { + params?: Params; + lastObservedNonce: bigint; + valsets: Valset[]; + valsetConfirms: MsgValsetConfirm[]; + batches: OutgoingTxBatch[]; + batchConfirms: MsgConfirmBatch[]; + attestations: Attestation[]; + orchestratorAddresses: MsgSetOrchestratorAddresses[]; + erc20ToDenoms: ERC20ToDenom[]; + unbatchedTransfers: OutgoingTransferTx[]; + lastObservedEthereumHeight: bigint; + lastOutgoingBatchId: bigint; + lastOutgoingPoolId: bigint; + lastObservedValset: Valset; + ethereumBlacklist: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.peggy.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState struct */ +export interface GenesisStateAmino { + params?: ParamsAmino; + last_observed_nonce: string; + valsets: ValsetAmino[]; + valset_confirms: MsgValsetConfirmAmino[]; + batches: OutgoingTxBatchAmino[]; + batch_confirms: MsgConfirmBatchAmino[]; + attestations: AttestationAmino[]; + orchestrator_addresses: MsgSetOrchestratorAddressesAmino[]; + erc20_to_denoms: ERC20ToDenomAmino[]; + unbatched_transfers: OutgoingTransferTxAmino[]; + last_observed_ethereum_height: string; + last_outgoing_batch_id: string; + last_outgoing_pool_id: string; + last_observed_valset: ValsetAmino; + ethereum_blacklist: string[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.peggy.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: undefined, + lastObservedNonce: BigInt(0), + valsets: [], + valsetConfirms: [], + batches: [], + batchConfirms: [], + attestations: [], + orchestratorAddresses: [], + erc20ToDenoms: [], + unbatchedTransfers: [], + lastObservedEthereumHeight: BigInt(0), + lastOutgoingBatchId: BigInt(0), + lastOutgoingPoolId: BigInt(0), + lastObservedValset: Valset.fromPartial({}), + ethereumBlacklist: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.peggy.v1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.lastObservedNonce === "bigint" && Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0])) && Array.isArray(o.valsetConfirms) && (!o.valsetConfirms.length || MsgValsetConfirm.is(o.valsetConfirms[0])) && Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.is(o.batches[0])) && Array.isArray(o.batchConfirms) && (!o.batchConfirms.length || MsgConfirmBatch.is(o.batchConfirms[0])) && Array.isArray(o.attestations) && (!o.attestations.length || Attestation.is(o.attestations[0])) && Array.isArray(o.orchestratorAddresses) && (!o.orchestratorAddresses.length || MsgSetOrchestratorAddresses.is(o.orchestratorAddresses[0])) && Array.isArray(o.erc20ToDenoms) && (!o.erc20ToDenoms.length || ERC20ToDenom.is(o.erc20ToDenoms[0])) && Array.isArray(o.unbatchedTransfers) && (!o.unbatchedTransfers.length || OutgoingTransferTx.is(o.unbatchedTransfers[0])) && typeof o.lastObservedEthereumHeight === "bigint" && typeof o.lastOutgoingBatchId === "bigint" && typeof o.lastOutgoingPoolId === "bigint" && Valset.is(o.lastObservedValset) && Array.isArray(o.ethereumBlacklist) && (!o.ethereumBlacklist.length || typeof o.ethereumBlacklist[0] === "string")); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.last_observed_nonce === "bigint" && Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0])) && Array.isArray(o.valset_confirms) && (!o.valset_confirms.length || MsgValsetConfirm.isAmino(o.valset_confirms[0])) && Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.isAmino(o.batches[0])) && Array.isArray(o.batch_confirms) && (!o.batch_confirms.length || MsgConfirmBatch.isAmino(o.batch_confirms[0])) && Array.isArray(o.attestations) && (!o.attestations.length || Attestation.isAmino(o.attestations[0])) && Array.isArray(o.orchestrator_addresses) && (!o.orchestrator_addresses.length || MsgSetOrchestratorAddresses.isAmino(o.orchestrator_addresses[0])) && Array.isArray(o.erc20_to_denoms) && (!o.erc20_to_denoms.length || ERC20ToDenom.isAmino(o.erc20_to_denoms[0])) && Array.isArray(o.unbatched_transfers) && (!o.unbatched_transfers.length || OutgoingTransferTx.isAmino(o.unbatched_transfers[0])) && typeof o.last_observed_ethereum_height === "bigint" && typeof o.last_outgoing_batch_id === "bigint" && typeof o.last_outgoing_pool_id === "bigint" && Valset.isAmino(o.last_observed_valset) && Array.isArray(o.ethereum_blacklist) && (!o.ethereum_blacklist.length || typeof o.ethereum_blacklist[0] === "string")); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.lastObservedNonce !== BigInt(0)) { + writer.uint32(16).uint64(message.lastObservedNonce); + } + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.valsetConfirms) { + MsgValsetConfirm.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.batches) { + OutgoingTxBatch.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.batchConfirms) { + MsgConfirmBatch.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.attestations) { + Attestation.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.orchestratorAddresses) { + MsgSetOrchestratorAddresses.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.erc20ToDenoms) { + ERC20ToDenom.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.unbatchedTransfers) { + OutgoingTransferTx.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.lastObservedEthereumHeight !== BigInt(0)) { + writer.uint32(88).uint64(message.lastObservedEthereumHeight); + } + if (message.lastOutgoingBatchId !== BigInt(0)) { + writer.uint32(96).uint64(message.lastOutgoingBatchId); + } + if (message.lastOutgoingPoolId !== BigInt(0)) { + writer.uint32(104).uint64(message.lastOutgoingPoolId); + } + if (message.lastObservedValset !== undefined) { + Valset.encode(message.lastObservedValset, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.ethereumBlacklist) { + writer.uint32(122).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.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.lastObservedNonce = reader.uint64(); + break; + case 3: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + case 4: + message.valsetConfirms.push(MsgValsetConfirm.decode(reader, reader.uint32())); + break; + case 5: + message.batches.push(OutgoingTxBatch.decode(reader, reader.uint32())); + break; + case 6: + message.batchConfirms.push(MsgConfirmBatch.decode(reader, reader.uint32())); + break; + case 7: + message.attestations.push(Attestation.decode(reader, reader.uint32())); + break; + case 8: + message.orchestratorAddresses.push(MsgSetOrchestratorAddresses.decode(reader, reader.uint32())); + break; + case 9: + message.erc20ToDenoms.push(ERC20ToDenom.decode(reader, reader.uint32())); + break; + case 10: + message.unbatchedTransfers.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 11: + message.lastObservedEthereumHeight = reader.uint64(); + break; + case 12: + message.lastOutgoingBatchId = reader.uint64(); + break; + case 13: + message.lastOutgoingPoolId = reader.uint64(); + break; + case 14: + message.lastObservedValset = Valset.decode(reader, reader.uint32()); + break; + case 15: + message.ethereumBlacklist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.lastObservedNonce = object.lastObservedNonce !== undefined && object.lastObservedNonce !== null ? BigInt(object.lastObservedNonce.toString()) : BigInt(0); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + message.valsetConfirms = object.valsetConfirms?.map(e => MsgValsetConfirm.fromPartial(e)) || []; + message.batches = object.batches?.map(e => OutgoingTxBatch.fromPartial(e)) || []; + message.batchConfirms = object.batchConfirms?.map(e => MsgConfirmBatch.fromPartial(e)) || []; + message.attestations = object.attestations?.map(e => Attestation.fromPartial(e)) || []; + message.orchestratorAddresses = object.orchestratorAddresses?.map(e => MsgSetOrchestratorAddresses.fromPartial(e)) || []; + message.erc20ToDenoms = object.erc20ToDenoms?.map(e => ERC20ToDenom.fromPartial(e)) || []; + message.unbatchedTransfers = object.unbatchedTransfers?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.lastObservedEthereumHeight = object.lastObservedEthereumHeight !== undefined && object.lastObservedEthereumHeight !== null ? BigInt(object.lastObservedEthereumHeight.toString()) : BigInt(0); + message.lastOutgoingBatchId = object.lastOutgoingBatchId !== undefined && object.lastOutgoingBatchId !== null ? BigInt(object.lastOutgoingBatchId.toString()) : BigInt(0); + message.lastOutgoingPoolId = object.lastOutgoingPoolId !== undefined && object.lastOutgoingPoolId !== null ? BigInt(object.lastOutgoingPoolId.toString()) : BigInt(0); + message.lastObservedValset = object.lastObservedValset !== undefined && object.lastObservedValset !== null ? Valset.fromPartial(object.lastObservedValset) : undefined; + message.ethereumBlacklist = object.ethereumBlacklist?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_observed_nonce !== undefined && object.last_observed_nonce !== null) { + message.lastObservedNonce = BigInt(object.last_observed_nonce); + } + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + message.valsetConfirms = object.valset_confirms?.map(e => MsgValsetConfirm.fromAmino(e)) || []; + message.batches = object.batches?.map(e => OutgoingTxBatch.fromAmino(e)) || []; + message.batchConfirms = object.batch_confirms?.map(e => MsgConfirmBatch.fromAmino(e)) || []; + message.attestations = object.attestations?.map(e => Attestation.fromAmino(e)) || []; + message.orchestratorAddresses = object.orchestrator_addresses?.map(e => MsgSetOrchestratorAddresses.fromAmino(e)) || []; + message.erc20ToDenoms = object.erc20_to_denoms?.map(e => ERC20ToDenom.fromAmino(e)) || []; + message.unbatchedTransfers = object.unbatched_transfers?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + if (object.last_observed_ethereum_height !== undefined && object.last_observed_ethereum_height !== null) { + message.lastObservedEthereumHeight = BigInt(object.last_observed_ethereum_height); + } + if (object.last_outgoing_batch_id !== undefined && object.last_outgoing_batch_id !== null) { + message.lastOutgoingBatchId = BigInt(object.last_outgoing_batch_id); + } + if (object.last_outgoing_pool_id !== undefined && object.last_outgoing_pool_id !== null) { + message.lastOutgoingPoolId = BigInt(object.last_outgoing_pool_id); + } + if (object.last_observed_valset !== undefined && object.last_observed_valset !== null) { + message.lastObservedValset = Valset.fromAmino(object.last_observed_valset); + } + message.ethereumBlacklist = object.ethereum_blacklist?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.last_observed_nonce = message.lastObservedNonce !== BigInt(0) ? message.lastObservedNonce?.toString() : undefined; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + if (message.valsetConfirms) { + obj.valset_confirms = message.valsetConfirms.map(e => e ? MsgValsetConfirm.toAmino(e) : undefined); + } else { + obj.valset_confirms = message.valsetConfirms; + } + if (message.batches) { + obj.batches = message.batches.map(e => e ? OutgoingTxBatch.toAmino(e) : undefined); + } else { + obj.batches = message.batches; + } + if (message.batchConfirms) { + obj.batch_confirms = message.batchConfirms.map(e => e ? MsgConfirmBatch.toAmino(e) : undefined); + } else { + obj.batch_confirms = message.batchConfirms; + } + if (message.attestations) { + obj.attestations = message.attestations.map(e => e ? Attestation.toAmino(e) : undefined); + } else { + obj.attestations = message.attestations; + } + if (message.orchestratorAddresses) { + obj.orchestrator_addresses = message.orchestratorAddresses.map(e => e ? MsgSetOrchestratorAddresses.toAmino(e) : undefined); + } else { + obj.orchestrator_addresses = message.orchestratorAddresses; + } + if (message.erc20ToDenoms) { + obj.erc20_to_denoms = message.erc20ToDenoms.map(e => e ? ERC20ToDenom.toAmino(e) : undefined); + } else { + obj.erc20_to_denoms = message.erc20ToDenoms; + } + if (message.unbatchedTransfers) { + obj.unbatched_transfers = message.unbatchedTransfers.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.unbatched_transfers = message.unbatchedTransfers; + } + obj.last_observed_ethereum_height = message.lastObservedEthereumHeight !== BigInt(0) ? message.lastObservedEthereumHeight?.toString() : undefined; + obj.last_outgoing_batch_id = message.lastOutgoingBatchId !== BigInt(0) ? message.lastOutgoingBatchId?.toString() : undefined; + obj.last_outgoing_pool_id = message.lastOutgoingPoolId !== BigInt(0) ? message.lastOutgoingPoolId?.toString() : undefined; + obj.last_observed_valset = message.lastObservedValset ? Valset.toAmino(message.lastObservedValset) : undefined; + if (message.ethereumBlacklist) { + obj.ethereum_blacklist = message.ethereumBlacklist.map(e => e); + } else { + obj.ethereum_blacklist = message.ethereumBlacklist; + } + 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: "/injective.peggy.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/msgs.rpc.func.ts b/libs/injectivejs/src/injective/peggy/v1/msgs.rpc.func.ts new file mode 100644 index 00000000..24882c49 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/msgs.rpc.func.ts @@ -0,0 +1,87 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgValsetConfirm, MsgSendToEth, MsgRequestBatch, MsgConfirmBatch, MsgDepositClaim, MsgWithdrawClaim, MsgValsetUpdatedClaim, MsgERC20DeployedClaim, MsgSetOrchestratorAddresses, MsgCancelSendToEth, MsgSubmitBadSignatureEvidence, MsgUpdateParams, MsgBlacklistEthereumAddresses, MsgRevokeEthereumBlacklist } from "./msgs"; +export const createValsetConfirm = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetConfirm.typeUrl, + encoders: toEncoders(MsgValsetConfirm), + converters: toConverters(MsgValsetConfirm) +}); +export const createSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSendToEth.typeUrl, + encoders: toEncoders(MsgSendToEth), + converters: toConverters(MsgSendToEth) +}); +export const createRequestBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRequestBatch.typeUrl, + encoders: toEncoders(MsgRequestBatch), + converters: toConverters(MsgRequestBatch) +}); +export const createConfirmBatch = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgConfirmBatch.typeUrl, + encoders: toEncoders(MsgConfirmBatch), + converters: toConverters(MsgConfirmBatch) +}); +export const createDepositClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDepositClaim.typeUrl, + encoders: toEncoders(MsgDepositClaim), + converters: toConverters(MsgDepositClaim) +}); +export const createWithdrawClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgWithdrawClaim.typeUrl, + encoders: toEncoders(MsgWithdrawClaim), + converters: toConverters(MsgWithdrawClaim) +}); +export const createValsetUpdateClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgValsetUpdatedClaim.typeUrl, + encoders: toEncoders(MsgValsetUpdatedClaim), + converters: toConverters(MsgValsetUpdatedClaim) +}); +export const createERC20DeployedClaim = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgERC20DeployedClaim.typeUrl, + encoders: toEncoders(MsgERC20DeployedClaim), + converters: toConverters(MsgERC20DeployedClaim) +}); +export const createSetOrchestratorAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetOrchestratorAddresses.typeUrl, + encoders: toEncoders(MsgSetOrchestratorAddresses), + converters: toConverters(MsgSetOrchestratorAddresses) +}); +export const createCancelSendToEth = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCancelSendToEth.typeUrl, + encoders: toEncoders(MsgCancelSendToEth), + converters: toConverters(MsgCancelSendToEth) +}); +export const createSubmitBadSignatureEvidence = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSubmitBadSignatureEvidence.typeUrl, + encoders: toEncoders(MsgSubmitBadSignatureEvidence), + converters: toConverters(MsgSubmitBadSignatureEvidence) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createBlacklistEthereumAddresses = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBlacklistEthereumAddresses.typeUrl, + encoders: toEncoders(MsgBlacklistEthereumAddresses), + converters: toConverters(MsgBlacklistEthereumAddresses) +}); +export const createRevokeEthereumBlacklist = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeEthereumBlacklist.typeUrl, + encoders: toEncoders(MsgRevokeEthereumBlacklist), + converters: toConverters(MsgRevokeEthereumBlacklist) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/msgs.ts b/libs/injectivejs/src/injective/peggy/v1/msgs.ts new file mode 100644 index 00000000..32e90531 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/msgs.ts @@ -0,0 +1,3087 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BridgeValidator, BridgeValidatorAmino } from "./types"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { Params, ParamsAmino } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSetOrchestratorAddresses + * this message allows validators to delegate their voting responsibilities + * to a given key. This key is then used as an optional authentication method + * for sigining oracle claims + * VALIDATOR + * The validator field is a cosmosvaloper1... string (i.e. sdk.ValAddress) + * that references a validator in the active set + * ORCHESTRATOR + * The orchestrator field is a cosmos1... string (i.e. sdk.AccAddress) that + * references the key that is being delegated to + * ETH_ADDRESS + * This is a hex encoded 0x Ethereum public key that will be used by this + * validator on Ethereum + */ +export interface MsgSetOrchestratorAddresses { + sender: string; + orchestrator: string; + ethAddress: string; +} +export interface MsgSetOrchestratorAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses"; + value: Uint8Array; +} +/** + * MsgSetOrchestratorAddresses + * this message allows validators to delegate their voting responsibilities + * to a given key. This key is then used as an optional authentication method + * for sigining oracle claims + * VALIDATOR + * The validator field is a cosmosvaloper1... string (i.e. sdk.ValAddress) + * that references a validator in the active set + * ORCHESTRATOR + * The orchestrator field is a cosmos1... string (i.e. sdk.AccAddress) that + * references the key that is being delegated to + * ETH_ADDRESS + * This is a hex encoded 0x Ethereum public key that will be used by this + * validator on Ethereum + */ +export interface MsgSetOrchestratorAddressesAmino { + sender: string; + orchestrator: string; + eth_address: string; +} +export interface MsgSetOrchestratorAddressesAminoMsg { + type: "peggy/MsgSetOrchestratorAddresses"; + value: MsgSetOrchestratorAddressesAmino; +} +export interface MsgSetOrchestratorAddressesResponse {} +export interface MsgSetOrchestratorAddressesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse"; + value: Uint8Array; +} +export interface MsgSetOrchestratorAddressesResponseAmino {} +export interface MsgSetOrchestratorAddressesResponseAminoMsg { + type: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse"; + value: MsgSetOrchestratorAddressesResponseAmino; +} +/** + * MsgValsetConfirm + * this is the message sent by the validators when they wish to submit their + * signatures over the validator set at a given block height. A validator must + * first call MsgSetEthAddress to set their Ethereum address to be used for + * signing. Then someone (anyone) must make a ValsetRequest the request is + * essentially a messaging mechanism to determine which block all validators + * should submit signatures over. Finally validators sign the validator set, + * powers, and Ethereum addresses of the entire validator set at the height of a + * ValsetRequest and submit that signature with this message. + * + * If a sufficient number of validators (66% of voting power) (A) have set + * Ethereum addresses and (B) submit ValsetConfirm messages with their + * signatures it is then possible for anyone to view these signatures in the + * chain store and submit them to Ethereum to update the validator set + * ------------- + */ +export interface MsgValsetConfirm { + nonce: bigint; + orchestrator: string; + ethAddress: string; + signature: string; +} +export interface MsgValsetConfirmProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm"; + value: Uint8Array; +} +/** + * MsgValsetConfirm + * this is the message sent by the validators when they wish to submit their + * signatures over the validator set at a given block height. A validator must + * first call MsgSetEthAddress to set their Ethereum address to be used for + * signing. Then someone (anyone) must make a ValsetRequest the request is + * essentially a messaging mechanism to determine which block all validators + * should submit signatures over. Finally validators sign the validator set, + * powers, and Ethereum addresses of the entire validator set at the height of a + * ValsetRequest and submit that signature with this message. + * + * If a sufficient number of validators (66% of voting power) (A) have set + * Ethereum addresses and (B) submit ValsetConfirm messages with their + * signatures it is then possible for anyone to view these signatures in the + * chain store and submit them to Ethereum to update the validator set + * ------------- + */ +export interface MsgValsetConfirmAmino { + nonce: string; + orchestrator: string; + eth_address: string; + signature: string; +} +export interface MsgValsetConfirmAminoMsg { + type: "peggy/MsgValsetConfirm"; + value: MsgValsetConfirmAmino; +} +export interface MsgValsetConfirmResponse {} +export interface MsgValsetConfirmResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse"; + value: Uint8Array; +} +export interface MsgValsetConfirmResponseAmino {} +export interface MsgValsetConfirmResponseAminoMsg { + type: "/injective.peggy.v1.MsgValsetConfirmResponse"; + value: MsgValsetConfirmResponseAmino; +} +/** + * MsgSendToEth + * This is the message that a user calls when they want to bridge an asset + * it will later be removed when it is included in a batch and successfully + * submitted tokens are removed from the users balance immediately + * ------------- + * AMOUNT: + * the coin to send across the bridge, note the restriction that this is a + * single coin not a set of coins that is normal in other Cosmos messages + * FEE: + * the fee paid for the bridge, distinct from the fee paid to the chain to + * actually send this message in the first place. So a successful send has + * two layers of fees for the user + */ +export interface MsgSendToEth { + sender: string; + ethDest: string; + amount: Coin; + bridgeFee: Coin; +} +export interface MsgSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSendToEth"; + value: Uint8Array; +} +/** + * MsgSendToEth + * This is the message that a user calls when they want to bridge an asset + * it will later be removed when it is included in a batch and successfully + * submitted tokens are removed from the users balance immediately + * ------------- + * AMOUNT: + * the coin to send across the bridge, note the restriction that this is a + * single coin not a set of coins that is normal in other Cosmos messages + * FEE: + * the fee paid for the bridge, distinct from the fee paid to the chain to + * actually send this message in the first place. So a successful send has + * two layers of fees for the user + */ +export interface MsgSendToEthAmino { + sender: string; + eth_dest: string; + amount: CoinAmino; + bridge_fee: CoinAmino; +} +export interface MsgSendToEthAminoMsg { + type: "peggy/MsgSendToEth"; + value: MsgSendToEthAmino; +} +export interface MsgSendToEthResponse {} +export interface MsgSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse"; + value: Uint8Array; +} +export interface MsgSendToEthResponseAmino {} +export interface MsgSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.MsgSendToEthResponse"; + value: MsgSendToEthResponseAmino; +} +/** + * MsgRequestBatch + * this is a message anyone can send that requests a batch of transactions to + * send across the bridge be created for whatever block height this message is + * included in. This acts as a coordination point, the handler for this message + * looks at the AddToOutgoingPool tx's in the store and generates a batch, also + * available in the store tied to this message. The validators then grab this + * batch, sign it, submit the signatures with a MsgConfirmBatch before a relayer + * can finally submit the batch + * ------------- + */ +export interface MsgRequestBatch { + orchestrator: string; + denom: string; +} +export interface MsgRequestBatchProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRequestBatch"; + value: Uint8Array; +} +/** + * MsgRequestBatch + * this is a message anyone can send that requests a batch of transactions to + * send across the bridge be created for whatever block height this message is + * included in. This acts as a coordination point, the handler for this message + * looks at the AddToOutgoingPool tx's in the store and generates a batch, also + * available in the store tied to this message. The validators then grab this + * batch, sign it, submit the signatures with a MsgConfirmBatch before a relayer + * can finally submit the batch + * ------------- + */ +export interface MsgRequestBatchAmino { + orchestrator: string; + denom: string; +} +export interface MsgRequestBatchAminoMsg { + type: "peggy/MsgRequestBatch"; + value: MsgRequestBatchAmino; +} +export interface MsgRequestBatchResponse {} +export interface MsgRequestBatchResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse"; + value: Uint8Array; +} +export interface MsgRequestBatchResponseAmino {} +export interface MsgRequestBatchResponseAminoMsg { + type: "/injective.peggy.v1.MsgRequestBatchResponse"; + value: MsgRequestBatchResponseAmino; +} +/** + * MsgConfirmBatch + * When validators observe a MsgRequestBatch they form a batch by ordering + * transactions currently in the txqueue in order of highest to lowest fee, + * cutting off when the batch either reaches a hardcoded maximum size (to be + * decided, probably around 100) or when transactions stop being profitable + * (TODO determine this without nondeterminism) This message includes the batch + * as well as an Ethereum signature over this batch by the validator + * ------------- + */ +export interface MsgConfirmBatch { + nonce: bigint; + tokenContract: string; + ethSigner: string; + orchestrator: string; + signature: string; +} +export interface MsgConfirmBatchProtoMsg { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch"; + value: Uint8Array; +} +/** + * MsgConfirmBatch + * When validators observe a MsgRequestBatch they form a batch by ordering + * transactions currently in the txqueue in order of highest to lowest fee, + * cutting off when the batch either reaches a hardcoded maximum size (to be + * decided, probably around 100) or when transactions stop being profitable + * (TODO determine this without nondeterminism) This message includes the batch + * as well as an Ethereum signature over this batch by the validator + * ------------- + */ +export interface MsgConfirmBatchAmino { + nonce: string; + token_contract: string; + eth_signer: string; + orchestrator: string; + signature: string; +} +export interface MsgConfirmBatchAminoMsg { + type: "peggy/MsgConfirmBatch"; + value: MsgConfirmBatchAmino; +} +export interface MsgConfirmBatchResponse {} +export interface MsgConfirmBatchResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse"; + value: Uint8Array; +} +export interface MsgConfirmBatchResponseAmino {} +export interface MsgConfirmBatchResponseAminoMsg { + type: "/injective.peggy.v1.MsgConfirmBatchResponse"; + value: MsgConfirmBatchResponseAmino; +} +/** + * EthereumBridgeDepositClaim + * When more than 66% of the active validator set has + * claimed to have seen the deposit enter the ethereum blockchain coins are + * issued to the Cosmos address in question + * ------------- + */ +export interface MsgDepositClaim { + eventNonce: bigint; + blockHeight: bigint; + tokenContract: string; + amount: string; + ethereumSender: string; + cosmosReceiver: string; + orchestrator: string; + data: string; +} +export interface MsgDepositClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgDepositClaim"; + value: Uint8Array; +} +/** + * EthereumBridgeDepositClaim + * When more than 66% of the active validator set has + * claimed to have seen the deposit enter the ethereum blockchain coins are + * issued to the Cosmos address in question + * ------------- + */ +export interface MsgDepositClaimAmino { + event_nonce: string; + block_height: string; + token_contract: string; + amount: string; + ethereum_sender: string; + cosmos_receiver: string; + orchestrator: string; + data: string; +} +export interface MsgDepositClaimAminoMsg { + type: "peggy/MsgDepositClaim"; + value: MsgDepositClaimAmino; +} +export interface MsgDepositClaimResponse {} +export interface MsgDepositClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse"; + value: Uint8Array; +} +export interface MsgDepositClaimResponseAmino {} +export interface MsgDepositClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgDepositClaimResponse"; + value: MsgDepositClaimResponseAmino; +} +/** + * WithdrawClaim claims that a batch of withdrawal + * operations on the bridge contract was executed. + */ +export interface MsgWithdrawClaim { + eventNonce: bigint; + blockHeight: bigint; + batchNonce: bigint; + tokenContract: string; + orchestrator: string; +} +export interface MsgWithdrawClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim"; + value: Uint8Array; +} +/** + * WithdrawClaim claims that a batch of withdrawal + * operations on the bridge contract was executed. + */ +export interface MsgWithdrawClaimAmino { + event_nonce: string; + block_height: string; + batch_nonce: string; + token_contract: string; + orchestrator: string; +} +export interface MsgWithdrawClaimAminoMsg { + type: "peggy/MsgWithdrawClaim"; + value: MsgWithdrawClaimAmino; +} +export interface MsgWithdrawClaimResponse {} +export interface MsgWithdrawClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse"; + value: Uint8Array; +} +export interface MsgWithdrawClaimResponseAmino {} +export interface MsgWithdrawClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgWithdrawClaimResponse"; + value: MsgWithdrawClaimResponseAmino; +} +/** + * ERC20DeployedClaim allows the Cosmos module + * to learn about an ERC20 that someone deployed + * to represent a Cosmos asset + */ +export interface MsgERC20DeployedClaim { + eventNonce: bigint; + blockHeight: bigint; + cosmosDenom: string; + tokenContract: string; + name: string; + symbol: string; + decimals: bigint; + orchestrator: string; +} +export interface MsgERC20DeployedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim"; + value: Uint8Array; +} +/** + * ERC20DeployedClaim allows the Cosmos module + * to learn about an ERC20 that someone deployed + * to represent a Cosmos asset + */ +export interface MsgERC20DeployedClaimAmino { + event_nonce: string; + block_height: string; + cosmos_denom: string; + token_contract: string; + name: string; + symbol: string; + decimals: string; + orchestrator: string; +} +export interface MsgERC20DeployedClaimAminoMsg { + type: "peggy/MsgERC20DeployedClaim"; + value: MsgERC20DeployedClaimAmino; +} +export interface MsgERC20DeployedClaimResponse {} +export interface MsgERC20DeployedClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse"; + value: Uint8Array; +} +export interface MsgERC20DeployedClaimResponseAmino {} +export interface MsgERC20DeployedClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgERC20DeployedClaimResponse"; + value: MsgERC20DeployedClaimResponseAmino; +} +/** + * This call allows the sender (and only the sender) + * to cancel a given MsgSendToEth and recieve a refund + * of the tokens + */ +export interface MsgCancelSendToEth { + transactionId: bigint; + sender: string; +} +export interface MsgCancelSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth"; + value: Uint8Array; +} +/** + * This call allows the sender (and only the sender) + * to cancel a given MsgSendToEth and recieve a refund + * of the tokens + */ +export interface MsgCancelSendToEthAmino { + transaction_id: string; + sender: string; +} +export interface MsgCancelSendToEthAminoMsg { + type: "peggy/MsgCancelSendToEth"; + value: MsgCancelSendToEthAmino; +} +export interface MsgCancelSendToEthResponse {} +export interface MsgCancelSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse"; + value: Uint8Array; +} +export interface MsgCancelSendToEthResponseAmino {} +export interface MsgCancelSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.MsgCancelSendToEthResponse"; + value: MsgCancelSendToEthResponseAmino; +} +/** + * This call allows anyone to submit evidence that a + * validator has signed a valset, batch, or logic call that never + * existed. Subject contains the batch, valset, or logic call. + */ +export interface MsgSubmitBadSignatureEvidence { + subject?: Any; + signature: string; + sender: string; +} +export interface MsgSubmitBadSignatureEvidenceProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence"; + value: Uint8Array; +} +/** + * This call allows anyone to submit evidence that a + * validator has signed a valset, batch, or logic call that never + * existed. Subject contains the batch, valset, or logic call. + */ +export interface MsgSubmitBadSignatureEvidenceAmino { + subject?: AnyAmino; + signature: string; + sender: string; +} +export interface MsgSubmitBadSignatureEvidenceAminoMsg { + type: "peggy/MsgSubmitBadSignatureEvidence"; + value: MsgSubmitBadSignatureEvidenceAmino; +} +export interface MsgSubmitBadSignatureEvidenceResponse {} +export interface MsgSubmitBadSignatureEvidenceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse"; + value: Uint8Array; +} +export interface MsgSubmitBadSignatureEvidenceResponseAmino {} +export interface MsgSubmitBadSignatureEvidenceResponseAminoMsg { + type: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse"; + value: MsgSubmitBadSignatureEvidenceResponseAmino; +} +/** + * This informs the Cosmos module that a validator + * set has been updated. + */ +export interface MsgValsetUpdatedClaim { + eventNonce: bigint; + valsetNonce: bigint; + blockHeight: bigint; + members: BridgeValidator[]; + rewardAmount: string; + rewardToken: string; + orchestrator: string; +} +export interface MsgValsetUpdatedClaimProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim"; + value: Uint8Array; +} +/** + * This informs the Cosmos module that a validator + * set has been updated. + */ +export interface MsgValsetUpdatedClaimAmino { + event_nonce: string; + valset_nonce: string; + block_height: string; + members: BridgeValidatorAmino[]; + reward_amount: string; + reward_token: string; + orchestrator: string; +} +export interface MsgValsetUpdatedClaimAminoMsg { + type: "peggy/MsgValsetUpdatedClaim"; + value: MsgValsetUpdatedClaimAmino; +} +export interface MsgValsetUpdatedClaimResponse {} +export interface MsgValsetUpdatedClaimResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse"; + value: Uint8Array; +} +export interface MsgValsetUpdatedClaimResponseAmino {} +export interface MsgValsetUpdatedClaimResponseAminoMsg { + type: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse"; + value: MsgValsetUpdatedClaimResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the peggy parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.peggy.v1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the peggy parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "peggy/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.peggy.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgBlacklistEthereumAddresses defines the message used to add Ethereum + * addresses to peggy blacklist. + */ +export interface MsgBlacklistEthereumAddresses { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklistAddresses: string[]; +} +export interface MsgBlacklistEthereumAddressesProtoMsg { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses"; + value: Uint8Array; +} +/** + * MsgBlacklistEthereumAddresses defines the message used to add Ethereum + * addresses to peggy blacklist. + */ +export interface MsgBlacklistEthereumAddressesAmino { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklist_addresses: string[]; +} +export interface MsgBlacklistEthereumAddressesAminoMsg { + type: "peggy/MsgBlacklistEthereumAddresses"; + value: MsgBlacklistEthereumAddressesAmino; +} +/** + * MsgBlacklistEthereumAddressesResponse defines the + * MsgBlacklistEthereumAddresses response type. + */ +export interface MsgBlacklistEthereumAddressesResponse {} +export interface MsgBlacklistEthereumAddressesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse"; + value: Uint8Array; +} +/** + * MsgBlacklistEthereumAddressesResponse defines the + * MsgBlacklistEthereumAddresses response type. + */ +export interface MsgBlacklistEthereumAddressesResponseAmino {} +export interface MsgBlacklistEthereumAddressesResponseAminoMsg { + type: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse"; + value: MsgBlacklistEthereumAddressesResponseAmino; +} +/** + * MsgRevokeEthereumBlacklist defines the message used to remove Ethereum + * addresses from peggy blacklist. + */ +export interface MsgRevokeEthereumBlacklist { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklistAddresses: string[]; +} +export interface MsgRevokeEthereumBlacklistProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist"; + value: Uint8Array; +} +/** + * MsgRevokeEthereumBlacklist defines the message used to remove Ethereum + * addresses from peggy blacklist. + */ +export interface MsgRevokeEthereumBlacklistAmino { + /** signer address */ + signer: string; + /** Ethereum addresses to include in the blacklist */ + blacklist_addresses: string[]; +} +export interface MsgRevokeEthereumBlacklistAminoMsg { + type: "peggy/MsgRevokeEthereumBlacklist"; + value: MsgRevokeEthereumBlacklistAmino; +} +/** + * MsgRevokeEthereumBlacklistResponse defines the MsgRevokeEthereumBlacklist + * response type. + */ +export interface MsgRevokeEthereumBlacklistResponse {} +export interface MsgRevokeEthereumBlacklistResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse"; + value: Uint8Array; +} +/** + * MsgRevokeEthereumBlacklistResponse defines the MsgRevokeEthereumBlacklist + * response type. + */ +export interface MsgRevokeEthereumBlacklistResponseAmino {} +export interface MsgRevokeEthereumBlacklistResponseAminoMsg { + type: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse"; + value: MsgRevokeEthereumBlacklistResponseAmino; +} +function createBaseMsgSetOrchestratorAddresses(): MsgSetOrchestratorAddresses { + return { + sender: "", + orchestrator: "", + ethAddress: "" + }; +} +export const MsgSetOrchestratorAddresses = { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses", + aminoType: "peggy/MsgSetOrchestratorAddresses", + is(o: any): o is MsgSetOrchestratorAddresses { + return o && (o.$typeUrl === MsgSetOrchestratorAddresses.typeUrl || typeof o.sender === "string" && typeof o.orchestrator === "string" && typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is MsgSetOrchestratorAddressesAmino { + return o && (o.$typeUrl === MsgSetOrchestratorAddresses.typeUrl || typeof o.sender === "string" && typeof o.orchestrator === "string" && typeof o.eth_address === "string"); + }, + encode(message: MsgSetOrchestratorAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.orchestrator !== "") { + writer.uint32(18).string(message.orchestrator); + } + if (message.ethAddress !== "") { + writer.uint32(26).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetOrchestratorAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetOrchestratorAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.orchestrator = reader.string(); + break; + case 3: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSetOrchestratorAddresses { + const message = createBaseMsgSetOrchestratorAddresses(); + message.sender = object.sender ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetOrchestratorAddressesAmino): MsgSetOrchestratorAddresses { + const message = createBaseMsgSetOrchestratorAddresses(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: MsgSetOrchestratorAddressesAminoMsg): MsgSetOrchestratorAddresses { + return MsgSetOrchestratorAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesAminoMsg { + return { + type: "peggy/MsgSetOrchestratorAddresses", + value: MsgSetOrchestratorAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetOrchestratorAddressesProtoMsg): MsgSetOrchestratorAddresses { + return MsgSetOrchestratorAddresses.decode(message.value); + }, + toProto(message: MsgSetOrchestratorAddresses): Uint8Array { + return MsgSetOrchestratorAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgSetOrchestratorAddresses): MsgSetOrchestratorAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddresses", + value: MsgSetOrchestratorAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetOrchestratorAddresses.typeUrl, MsgSetOrchestratorAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetOrchestratorAddresses.aminoType, MsgSetOrchestratorAddresses.typeUrl); +function createBaseMsgSetOrchestratorAddressesResponse(): MsgSetOrchestratorAddressesResponse { + return {}; +} +export const MsgSetOrchestratorAddressesResponse = { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse", + is(o: any): o is MsgSetOrchestratorAddressesResponse { + return o && o.$typeUrl === MsgSetOrchestratorAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetOrchestratorAddressesResponseAmino { + return o && o.$typeUrl === MsgSetOrchestratorAddressesResponse.typeUrl; + }, + encode(_: MsgSetOrchestratorAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetOrchestratorAddressesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetOrchestratorAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSetOrchestratorAddressesResponse { + const message = createBaseMsgSetOrchestratorAddressesResponse(); + return message; + }, + fromAmino(_: MsgSetOrchestratorAddressesResponseAmino): MsgSetOrchestratorAddressesResponse { + const message = createBaseMsgSetOrchestratorAddressesResponse(); + return message; + }, + toAmino(_: MsgSetOrchestratorAddressesResponse): MsgSetOrchestratorAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetOrchestratorAddressesResponseAminoMsg): MsgSetOrchestratorAddressesResponse { + return MsgSetOrchestratorAddressesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetOrchestratorAddressesResponseProtoMsg): MsgSetOrchestratorAddressesResponse { + return MsgSetOrchestratorAddressesResponse.decode(message.value); + }, + toProto(message: MsgSetOrchestratorAddressesResponse): Uint8Array { + return MsgSetOrchestratorAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetOrchestratorAddressesResponse): MsgSetOrchestratorAddressesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSetOrchestratorAddressesResponse", + value: MsgSetOrchestratorAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetOrchestratorAddressesResponse.typeUrl, MsgSetOrchestratorAddressesResponse); +function createBaseMsgValsetConfirm(): MsgValsetConfirm { + return { + nonce: BigInt(0), + orchestrator: "", + ethAddress: "", + signature: "" + }; +} +export const MsgValsetConfirm = { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm", + aminoType: "peggy/MsgValsetConfirm", + is(o: any): o is MsgValsetConfirm { + return o && (o.$typeUrl === MsgValsetConfirm.typeUrl || typeof o.nonce === "bigint" && typeof o.orchestrator === "string" && typeof o.ethAddress === "string" && typeof o.signature === "string"); + }, + isAmino(o: any): o is MsgValsetConfirmAmino { + return o && (o.$typeUrl === MsgValsetConfirm.typeUrl || typeof o.nonce === "bigint" && typeof o.orchestrator === "string" && typeof o.eth_address === "string" && typeof o.signature === "string"); + }, + encode(message: MsgValsetConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.orchestrator !== "") { + writer.uint32(18).string(message.orchestrator); + } + if (message.ethAddress !== "") { + writer.uint32(26).string(message.ethAddress); + } + if (message.signature !== "") { + writer.uint32(34).string(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.orchestrator = reader.string(); + break; + case 3: + message.ethAddress = reader.string(); + break; + case 4: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgValsetConfirm { + const message = createBaseMsgValsetConfirm(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.orchestrator = object.orchestrator ?? ""; + message.ethAddress = object.ethAddress ?? ""; + message.signature = object.signature ?? ""; + return message; + }, + fromAmino(object: MsgValsetConfirmAmino): MsgValsetConfirm { + const message = createBaseMsgValsetConfirm(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + return message; + }, + toAmino(message: MsgValsetConfirm): MsgValsetConfirmAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + obj.signature = message.signature === "" ? undefined : message.signature; + return obj; + }, + fromAminoMsg(object: MsgValsetConfirmAminoMsg): MsgValsetConfirm { + return MsgValsetConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgValsetConfirm): MsgValsetConfirmAminoMsg { + return { + type: "peggy/MsgValsetConfirm", + value: MsgValsetConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgValsetConfirmProtoMsg): MsgValsetConfirm { + return MsgValsetConfirm.decode(message.value); + }, + toProto(message: MsgValsetConfirm): Uint8Array { + return MsgValsetConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetConfirm): MsgValsetConfirmProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetConfirm", + value: MsgValsetConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetConfirm.typeUrl, MsgValsetConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgValsetConfirm.aminoType, MsgValsetConfirm.typeUrl); +function createBaseMsgValsetConfirmResponse(): MsgValsetConfirmResponse { + return {}; +} +export const MsgValsetConfirmResponse = { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse", + is(o: any): o is MsgValsetConfirmResponse { + return o && o.$typeUrl === MsgValsetConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgValsetConfirmResponseAmino { + return o && o.$typeUrl === MsgValsetConfirmResponse.typeUrl; + }, + encode(_: MsgValsetConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgValsetConfirmResponse { + const message = createBaseMsgValsetConfirmResponse(); + return message; + }, + fromAmino(_: MsgValsetConfirmResponseAmino): MsgValsetConfirmResponse { + const message = createBaseMsgValsetConfirmResponse(); + return message; + }, + toAmino(_: MsgValsetConfirmResponse): MsgValsetConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgValsetConfirmResponseAminoMsg): MsgValsetConfirmResponse { + return MsgValsetConfirmResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgValsetConfirmResponseProtoMsg): MsgValsetConfirmResponse { + return MsgValsetConfirmResponse.decode(message.value); + }, + toProto(message: MsgValsetConfirmResponse): Uint8Array { + return MsgValsetConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetConfirmResponse): MsgValsetConfirmResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetConfirmResponse", + value: MsgValsetConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetConfirmResponse.typeUrl, MsgValsetConfirmResponse); +function createBaseMsgSendToEth(): MsgSendToEth { + return { + sender: "", + ethDest: "", + amount: Coin.fromPartial({}), + bridgeFee: Coin.fromPartial({}) + }; +} +export const MsgSendToEth = { + typeUrl: "/injective.peggy.v1.MsgSendToEth", + aminoType: "peggy/MsgSendToEth", + is(o: any): o is MsgSendToEth { + return o && (o.$typeUrl === MsgSendToEth.typeUrl || typeof o.sender === "string" && typeof o.ethDest === "string" && Coin.is(o.amount) && Coin.is(o.bridgeFee)); + }, + isAmino(o: any): o is MsgSendToEthAmino { + return o && (o.$typeUrl === MsgSendToEth.typeUrl || typeof o.sender === "string" && typeof o.eth_dest === "string" && Coin.isAmino(o.amount) && Coin.isAmino(o.bridge_fee)); + }, + encode(message: MsgSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.ethDest !== "") { + writer.uint32(18).string(message.ethDest); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.bridgeFee !== undefined) { + Coin.encode(message.bridgeFee, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.ethDest = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.bridgeFee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSendToEth { + const message = createBaseMsgSendToEth(); + message.sender = object.sender ?? ""; + message.ethDest = object.ethDest ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.bridgeFee = object.bridgeFee !== undefined && object.bridgeFee !== null ? Coin.fromPartial(object.bridgeFee) : undefined; + return message; + }, + fromAmino(object: MsgSendToEthAmino): MsgSendToEth { + const message = createBaseMsgSendToEth(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.eth_dest !== undefined && object.eth_dest !== null) { + message.ethDest = object.eth_dest; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.bridge_fee !== undefined && object.bridge_fee !== null) { + message.bridgeFee = Coin.fromAmino(object.bridge_fee); + } + return message; + }, + toAmino(message: MsgSendToEth): MsgSendToEthAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.eth_dest = message.ethDest === "" ? undefined : message.ethDest; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.bridge_fee = message.bridgeFee ? Coin.toAmino(message.bridgeFee) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendToEthAminoMsg): MsgSendToEth { + return MsgSendToEth.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendToEth): MsgSendToEthAminoMsg { + return { + type: "peggy/MsgSendToEth", + value: MsgSendToEth.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendToEthProtoMsg): MsgSendToEth { + return MsgSendToEth.decode(message.value); + }, + toProto(message: MsgSendToEth): Uint8Array { + return MsgSendToEth.encode(message).finish(); + }, + toProtoMsg(message: MsgSendToEth): MsgSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSendToEth", + value: MsgSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendToEth.typeUrl, MsgSendToEth); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendToEth.aminoType, MsgSendToEth.typeUrl); +function createBaseMsgSendToEthResponse(): MsgSendToEthResponse { + return {}; +} +export const MsgSendToEthResponse = { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse", + is(o: any): o is MsgSendToEthResponse { + return o && o.$typeUrl === MsgSendToEthResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendToEthResponseAmino { + return o && o.$typeUrl === MsgSendToEthResponse.typeUrl; + }, + encode(_: MsgSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSendToEthResponse { + const message = createBaseMsgSendToEthResponse(); + return message; + }, + fromAmino(_: MsgSendToEthResponseAmino): MsgSendToEthResponse { + const message = createBaseMsgSendToEthResponse(); + return message; + }, + toAmino(_: MsgSendToEthResponse): MsgSendToEthResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendToEthResponseAminoMsg): MsgSendToEthResponse { + return MsgSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendToEthResponseProtoMsg): MsgSendToEthResponse { + return MsgSendToEthResponse.decode(message.value); + }, + toProto(message: MsgSendToEthResponse): Uint8Array { + return MsgSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendToEthResponse): MsgSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSendToEthResponse", + value: MsgSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSendToEthResponse.typeUrl, MsgSendToEthResponse); +function createBaseMsgRequestBatch(): MsgRequestBatch { + return { + orchestrator: "", + denom: "" + }; +} +export const MsgRequestBatch = { + typeUrl: "/injective.peggy.v1.MsgRequestBatch", + aminoType: "peggy/MsgRequestBatch", + is(o: any): o is MsgRequestBatch { + return o && (o.$typeUrl === MsgRequestBatch.typeUrl || typeof o.orchestrator === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is MsgRequestBatchAmino { + return o && (o.$typeUrl === MsgRequestBatch.typeUrl || typeof o.orchestrator === "string" && typeof o.denom === "string"); + }, + encode(message: MsgRequestBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orchestrator !== "") { + writer.uint32(10).string(message.orchestrator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orchestrator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRequestBatch { + const message = createBaseMsgRequestBatch(); + message.orchestrator = object.orchestrator ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: MsgRequestBatchAmino): MsgRequestBatch { + const message = createBaseMsgRequestBatch(); + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: MsgRequestBatch): MsgRequestBatchAmino { + const obj: any = {}; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: MsgRequestBatchAminoMsg): MsgRequestBatch { + return MsgRequestBatch.fromAmino(object.value); + }, + toAminoMsg(message: MsgRequestBatch): MsgRequestBatchAminoMsg { + return { + type: "peggy/MsgRequestBatch", + value: MsgRequestBatch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRequestBatchProtoMsg): MsgRequestBatch { + return MsgRequestBatch.decode(message.value); + }, + toProto(message: MsgRequestBatch): Uint8Array { + return MsgRequestBatch.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBatch): MsgRequestBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRequestBatch", + value: MsgRequestBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBatch.typeUrl, MsgRequestBatch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRequestBatch.aminoType, MsgRequestBatch.typeUrl); +function createBaseMsgRequestBatchResponse(): MsgRequestBatchResponse { + return {}; +} +export const MsgRequestBatchResponse = { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse", + is(o: any): o is MsgRequestBatchResponse { + return o && o.$typeUrl === MsgRequestBatchResponse.typeUrl; + }, + isAmino(o: any): o is MsgRequestBatchResponseAmino { + return o && o.$typeUrl === MsgRequestBatchResponse.typeUrl; + }, + encode(_: MsgRequestBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestBatchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRequestBatchResponse { + const message = createBaseMsgRequestBatchResponse(); + return message; + }, + fromAmino(_: MsgRequestBatchResponseAmino): MsgRequestBatchResponse { + const message = createBaseMsgRequestBatchResponse(); + return message; + }, + toAmino(_: MsgRequestBatchResponse): MsgRequestBatchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestBatchResponseAminoMsg): MsgRequestBatchResponse { + return MsgRequestBatchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestBatchResponseProtoMsg): MsgRequestBatchResponse { + return MsgRequestBatchResponse.decode(message.value); + }, + toProto(message: MsgRequestBatchResponse): Uint8Array { + return MsgRequestBatchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestBatchResponse): MsgRequestBatchResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRequestBatchResponse", + value: MsgRequestBatchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRequestBatchResponse.typeUrl, MsgRequestBatchResponse); +function createBaseMsgConfirmBatch(): MsgConfirmBatch { + return { + nonce: BigInt(0), + tokenContract: "", + ethSigner: "", + orchestrator: "", + signature: "" + }; +} +export const MsgConfirmBatch = { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch", + aminoType: "peggy/MsgConfirmBatch", + is(o: any): o is MsgConfirmBatch { + return o && (o.$typeUrl === MsgConfirmBatch.typeUrl || typeof o.nonce === "bigint" && typeof o.tokenContract === "string" && typeof o.ethSigner === "string" && typeof o.orchestrator === "string" && typeof o.signature === "string"); + }, + isAmino(o: any): o is MsgConfirmBatchAmino { + return o && (o.$typeUrl === MsgConfirmBatch.typeUrl || typeof o.nonce === "bigint" && typeof o.token_contract === "string" && typeof o.eth_signer === "string" && typeof o.orchestrator === "string" && typeof o.signature === "string"); + }, + encode(message: MsgConfirmBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.tokenContract !== "") { + writer.uint32(18).string(message.tokenContract); + } + if (message.ethSigner !== "") { + writer.uint32(26).string(message.ethSigner); + } + if (message.orchestrator !== "") { + writer.uint32(34).string(message.orchestrator); + } + if (message.signature !== "") { + writer.uint32(42).string(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConfirmBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConfirmBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.tokenContract = reader.string(); + break; + case 3: + message.ethSigner = reader.string(); + break; + case 4: + message.orchestrator = reader.string(); + break; + case 5: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgConfirmBatch { + const message = createBaseMsgConfirmBatch(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.ethSigner = object.ethSigner ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.signature = object.signature ?? ""; + return message; + }, + fromAmino(object: MsgConfirmBatchAmino): MsgConfirmBatch { + const message = createBaseMsgConfirmBatch(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.eth_signer !== undefined && object.eth_signer !== null) { + message.ethSigner = object.eth_signer; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + return message; + }, + toAmino(message: MsgConfirmBatch): MsgConfirmBatchAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.eth_signer = message.ethSigner === "" ? undefined : message.ethSigner; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.signature = message.signature === "" ? undefined : message.signature; + return obj; + }, + fromAminoMsg(object: MsgConfirmBatchAminoMsg): MsgConfirmBatch { + return MsgConfirmBatch.fromAmino(object.value); + }, + toAminoMsg(message: MsgConfirmBatch): MsgConfirmBatchAminoMsg { + return { + type: "peggy/MsgConfirmBatch", + value: MsgConfirmBatch.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConfirmBatchProtoMsg): MsgConfirmBatch { + return MsgConfirmBatch.decode(message.value); + }, + toProto(message: MsgConfirmBatch): Uint8Array { + return MsgConfirmBatch.encode(message).finish(); + }, + toProtoMsg(message: MsgConfirmBatch): MsgConfirmBatchProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgConfirmBatch", + value: MsgConfirmBatch.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConfirmBatch.typeUrl, MsgConfirmBatch); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConfirmBatch.aminoType, MsgConfirmBatch.typeUrl); +function createBaseMsgConfirmBatchResponse(): MsgConfirmBatchResponse { + return {}; +} +export const MsgConfirmBatchResponse = { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse", + is(o: any): o is MsgConfirmBatchResponse { + return o && o.$typeUrl === MsgConfirmBatchResponse.typeUrl; + }, + isAmino(o: any): o is MsgConfirmBatchResponseAmino { + return o && o.$typeUrl === MsgConfirmBatchResponse.typeUrl; + }, + encode(_: MsgConfirmBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConfirmBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConfirmBatchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgConfirmBatchResponse { + const message = createBaseMsgConfirmBatchResponse(); + return message; + }, + fromAmino(_: MsgConfirmBatchResponseAmino): MsgConfirmBatchResponse { + const message = createBaseMsgConfirmBatchResponse(); + return message; + }, + toAmino(_: MsgConfirmBatchResponse): MsgConfirmBatchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConfirmBatchResponseAminoMsg): MsgConfirmBatchResponse { + return MsgConfirmBatchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgConfirmBatchResponseProtoMsg): MsgConfirmBatchResponse { + return MsgConfirmBatchResponse.decode(message.value); + }, + toProto(message: MsgConfirmBatchResponse): Uint8Array { + return MsgConfirmBatchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConfirmBatchResponse): MsgConfirmBatchResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgConfirmBatchResponse", + value: MsgConfirmBatchResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgConfirmBatchResponse.typeUrl, MsgConfirmBatchResponse); +function createBaseMsgDepositClaim(): MsgDepositClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + tokenContract: "", + amount: "", + ethereumSender: "", + cosmosReceiver: "", + orchestrator: "", + data: "" + }; +} +export const MsgDepositClaim = { + typeUrl: "/injective.peggy.v1.MsgDepositClaim", + aminoType: "peggy/MsgDepositClaim", + is(o: any): o is MsgDepositClaim { + return o && (o.$typeUrl === MsgDepositClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.tokenContract === "string" && typeof o.amount === "string" && typeof o.ethereumSender === "string" && typeof o.cosmosReceiver === "string" && typeof o.orchestrator === "string" && typeof o.data === "string"); + }, + isAmino(o: any): o is MsgDepositClaimAmino { + return o && (o.$typeUrl === MsgDepositClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.token_contract === "string" && typeof o.amount === "string" && typeof o.ethereum_sender === "string" && typeof o.cosmos_receiver === "string" && typeof o.orchestrator === "string" && typeof o.data === "string"); + }, + encode(message: MsgDepositClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.tokenContract !== "") { + writer.uint32(26).string(message.tokenContract); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.ethereumSender !== "") { + writer.uint32(42).string(message.ethereumSender); + } + if (message.cosmosReceiver !== "") { + writer.uint32(50).string(message.cosmosReceiver); + } + if (message.orchestrator !== "") { + writer.uint32(58).string(message.orchestrator); + } + if (message.data !== "") { + writer.uint32(66).string(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.tokenContract = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.ethereumSender = reader.string(); + break; + case 6: + message.cosmosReceiver = reader.string(); + break; + case 7: + message.orchestrator = reader.string(); + break; + case 8: + message.data = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDepositClaim { + const message = createBaseMsgDepositClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.amount = object.amount ?? ""; + message.ethereumSender = object.ethereumSender ?? ""; + message.cosmosReceiver = object.cosmosReceiver ?? ""; + message.orchestrator = object.orchestrator ?? ""; + message.data = object.data ?? ""; + return message; + }, + fromAmino(object: MsgDepositClaimAmino): MsgDepositClaim { + const message = createBaseMsgDepositClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.ethereum_sender !== undefined && object.ethereum_sender !== null) { + message.ethereumSender = object.ethereum_sender; + } + if (object.cosmos_receiver !== undefined && object.cosmos_receiver !== null) { + message.cosmosReceiver = object.cosmos_receiver; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + return message; + }, + toAmino(message: MsgDepositClaim): MsgDepositClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.ethereum_sender = message.ethereumSender === "" ? undefined : message.ethereumSender; + obj.cosmos_receiver = message.cosmosReceiver === "" ? undefined : message.cosmosReceiver; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + obj.data = message.data === "" ? undefined : message.data; + return obj; + }, + fromAminoMsg(object: MsgDepositClaimAminoMsg): MsgDepositClaim { + return MsgDepositClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositClaim): MsgDepositClaimAminoMsg { + return { + type: "peggy/MsgDepositClaim", + value: MsgDepositClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositClaimProtoMsg): MsgDepositClaim { + return MsgDepositClaim.decode(message.value); + }, + toProto(message: MsgDepositClaim): Uint8Array { + return MsgDepositClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositClaim): MsgDepositClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgDepositClaim", + value: MsgDepositClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositClaim.typeUrl, MsgDepositClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositClaim.aminoType, MsgDepositClaim.typeUrl); +function createBaseMsgDepositClaimResponse(): MsgDepositClaimResponse { + return {}; +} +export const MsgDepositClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse", + is(o: any): o is MsgDepositClaimResponse { + return o && o.$typeUrl === MsgDepositClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositClaimResponseAmino { + return o && o.$typeUrl === MsgDepositClaimResponse.typeUrl; + }, + encode(_: MsgDepositClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDepositClaimResponse { + const message = createBaseMsgDepositClaimResponse(); + return message; + }, + fromAmino(_: MsgDepositClaimResponseAmino): MsgDepositClaimResponse { + const message = createBaseMsgDepositClaimResponse(); + return message; + }, + toAmino(_: MsgDepositClaimResponse): MsgDepositClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositClaimResponseAminoMsg): MsgDepositClaimResponse { + return MsgDepositClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositClaimResponseProtoMsg): MsgDepositClaimResponse { + return MsgDepositClaimResponse.decode(message.value); + }, + toProto(message: MsgDepositClaimResponse): Uint8Array { + return MsgDepositClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositClaimResponse): MsgDepositClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgDepositClaimResponse", + value: MsgDepositClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDepositClaimResponse.typeUrl, MsgDepositClaimResponse); +function createBaseMsgWithdrawClaim(): MsgWithdrawClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + batchNonce: BigInt(0), + tokenContract: "", + orchestrator: "" + }; +} +export const MsgWithdrawClaim = { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim", + aminoType: "peggy/MsgWithdrawClaim", + is(o: any): o is MsgWithdrawClaim { + return o && (o.$typeUrl === MsgWithdrawClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.batchNonce === "bigint" && typeof o.tokenContract === "string" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgWithdrawClaimAmino { + return o && (o.$typeUrl === MsgWithdrawClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.batch_nonce === "bigint" && typeof o.token_contract === "string" && typeof o.orchestrator === "string"); + }, + encode(message: MsgWithdrawClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.batchNonce !== BigInt(0)) { + writer.uint32(24).uint64(message.batchNonce); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.orchestrator !== "") { + writer.uint32(42).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.batchNonce = reader.uint64(); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgWithdrawClaim { + const message = createBaseMsgWithdrawClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? BigInt(object.batchNonce.toString()) : BigInt(0); + message.tokenContract = object.tokenContract ?? ""; + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawClaimAmino): MsgWithdrawClaim { + const message = createBaseMsgWithdrawClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.batch_nonce !== undefined && object.batch_nonce !== null) { + message.batchNonce = BigInt(object.batch_nonce); + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgWithdrawClaim): MsgWithdrawClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.batch_nonce = message.batchNonce !== BigInt(0) ? message.batchNonce?.toString() : undefined; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgWithdrawClaimAminoMsg): MsgWithdrawClaim { + return MsgWithdrawClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawClaim): MsgWithdrawClaimAminoMsg { + return { + type: "peggy/MsgWithdrawClaim", + value: MsgWithdrawClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawClaimProtoMsg): MsgWithdrawClaim { + return MsgWithdrawClaim.decode(message.value); + }, + toProto(message: MsgWithdrawClaim): Uint8Array { + return MsgWithdrawClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawClaim): MsgWithdrawClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaim", + value: MsgWithdrawClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawClaim.typeUrl, MsgWithdrawClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawClaim.aminoType, MsgWithdrawClaim.typeUrl); +function createBaseMsgWithdrawClaimResponse(): MsgWithdrawClaimResponse { + return {}; +} +export const MsgWithdrawClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse", + is(o: any): o is MsgWithdrawClaimResponse { + return o && o.$typeUrl === MsgWithdrawClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawClaimResponseAmino { + return o && o.$typeUrl === MsgWithdrawClaimResponse.typeUrl; + }, + encode(_: MsgWithdrawClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgWithdrawClaimResponse { + const message = createBaseMsgWithdrawClaimResponse(); + return message; + }, + fromAmino(_: MsgWithdrawClaimResponseAmino): MsgWithdrawClaimResponse { + const message = createBaseMsgWithdrawClaimResponse(); + return message; + }, + toAmino(_: MsgWithdrawClaimResponse): MsgWithdrawClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawClaimResponseAminoMsg): MsgWithdrawClaimResponse { + return MsgWithdrawClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawClaimResponseProtoMsg): MsgWithdrawClaimResponse { + return MsgWithdrawClaimResponse.decode(message.value); + }, + toProto(message: MsgWithdrawClaimResponse): Uint8Array { + return MsgWithdrawClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawClaimResponse): MsgWithdrawClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgWithdrawClaimResponse", + value: MsgWithdrawClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgWithdrawClaimResponse.typeUrl, MsgWithdrawClaimResponse); +function createBaseMsgERC20DeployedClaim(): MsgERC20DeployedClaim { + return { + eventNonce: BigInt(0), + blockHeight: BigInt(0), + cosmosDenom: "", + tokenContract: "", + name: "", + symbol: "", + decimals: BigInt(0), + orchestrator: "" + }; +} +export const MsgERC20DeployedClaim = { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim", + aminoType: "peggy/MsgERC20DeployedClaim", + is(o: any): o is MsgERC20DeployedClaim { + return o && (o.$typeUrl === MsgERC20DeployedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.blockHeight === "bigint" && typeof o.cosmosDenom === "string" && typeof o.tokenContract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgERC20DeployedClaimAmino { + return o && (o.$typeUrl === MsgERC20DeployedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.block_height === "bigint" && typeof o.cosmos_denom === "string" && typeof o.token_contract === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "bigint" && typeof o.orchestrator === "string"); + }, + encode(message: MsgERC20DeployedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.blockHeight); + } + if (message.cosmosDenom !== "") { + writer.uint32(26).string(message.cosmosDenom); + } + if (message.tokenContract !== "") { + writer.uint32(34).string(message.tokenContract); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(50).string(message.symbol); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(56).uint64(message.decimals); + } + if (message.orchestrator !== "") { + writer.uint32(66).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgERC20DeployedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgERC20DeployedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.blockHeight = reader.uint64(); + break; + case 3: + message.cosmosDenom = reader.string(); + break; + case 4: + message.tokenContract = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.symbol = reader.string(); + break; + case 7: + message.decimals = reader.uint64(); + break; + case 8: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgERC20DeployedClaim { + const message = createBaseMsgERC20DeployedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.cosmosDenom = object.cosmosDenom ?? ""; + message.tokenContract = object.tokenContract ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgERC20DeployedClaimAmino): MsgERC20DeployedClaim { + const message = createBaseMsgERC20DeployedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.cosmos_denom !== undefined && object.cosmos_denom !== null) { + message.cosmosDenom = object.cosmos_denom; + } + if (object.token_contract !== undefined && object.token_contract !== null) { + message.tokenContract = object.token_contract; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.cosmos_denom = message.cosmosDenom === "" ? undefined : message.cosmosDenom; + obj.token_contract = message.tokenContract === "" ? undefined : message.tokenContract; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals?.toString() : undefined; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgERC20DeployedClaimAminoMsg): MsgERC20DeployedClaim { + return MsgERC20DeployedClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimAminoMsg { + return { + type: "peggy/MsgERC20DeployedClaim", + value: MsgERC20DeployedClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgERC20DeployedClaimProtoMsg): MsgERC20DeployedClaim { + return MsgERC20DeployedClaim.decode(message.value); + }, + toProto(message: MsgERC20DeployedClaim): Uint8Array { + return MsgERC20DeployedClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgERC20DeployedClaim): MsgERC20DeployedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaim", + value: MsgERC20DeployedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgERC20DeployedClaim.typeUrl, MsgERC20DeployedClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgERC20DeployedClaim.aminoType, MsgERC20DeployedClaim.typeUrl); +function createBaseMsgERC20DeployedClaimResponse(): MsgERC20DeployedClaimResponse { + return {}; +} +export const MsgERC20DeployedClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse", + is(o: any): o is MsgERC20DeployedClaimResponse { + return o && o.$typeUrl === MsgERC20DeployedClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgERC20DeployedClaimResponseAmino { + return o && o.$typeUrl === MsgERC20DeployedClaimResponse.typeUrl; + }, + encode(_: MsgERC20DeployedClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgERC20DeployedClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgERC20DeployedClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgERC20DeployedClaimResponse { + const message = createBaseMsgERC20DeployedClaimResponse(); + return message; + }, + fromAmino(_: MsgERC20DeployedClaimResponseAmino): MsgERC20DeployedClaimResponse { + const message = createBaseMsgERC20DeployedClaimResponse(); + return message; + }, + toAmino(_: MsgERC20DeployedClaimResponse): MsgERC20DeployedClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgERC20DeployedClaimResponseAminoMsg): MsgERC20DeployedClaimResponse { + return MsgERC20DeployedClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgERC20DeployedClaimResponseProtoMsg): MsgERC20DeployedClaimResponse { + return MsgERC20DeployedClaimResponse.decode(message.value); + }, + toProto(message: MsgERC20DeployedClaimResponse): Uint8Array { + return MsgERC20DeployedClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgERC20DeployedClaimResponse): MsgERC20DeployedClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgERC20DeployedClaimResponse", + value: MsgERC20DeployedClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgERC20DeployedClaimResponse.typeUrl, MsgERC20DeployedClaimResponse); +function createBaseMsgCancelSendToEth(): MsgCancelSendToEth { + return { + transactionId: BigInt(0), + sender: "" + }; +} +export const MsgCancelSendToEth = { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth", + aminoType: "peggy/MsgCancelSendToEth", + is(o: any): o is MsgCancelSendToEth { + return o && (o.$typeUrl === MsgCancelSendToEth.typeUrl || typeof o.transactionId === "bigint" && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCancelSendToEthAmino { + return o && (o.$typeUrl === MsgCancelSendToEth.typeUrl || typeof o.transaction_id === "bigint" && typeof o.sender === "string"); + }, + encode(message: MsgCancelSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transactionId !== BigInt(0)) { + writer.uint32(8).uint64(message.transactionId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transactionId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCancelSendToEth { + const message = createBaseMsgCancelSendToEth(); + message.transactionId = object.transactionId !== undefined && object.transactionId !== null ? BigInt(object.transactionId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgCancelSendToEthAmino): MsgCancelSendToEth { + const message = createBaseMsgCancelSendToEth(); + if (object.transaction_id !== undefined && object.transaction_id !== null) { + message.transactionId = BigInt(object.transaction_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgCancelSendToEth): MsgCancelSendToEthAmino { + const obj: any = {}; + obj.transaction_id = message.transactionId !== BigInt(0) ? message.transactionId?.toString() : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgCancelSendToEthAminoMsg): MsgCancelSendToEth { + return MsgCancelSendToEth.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelSendToEth): MsgCancelSendToEthAminoMsg { + return { + type: "peggy/MsgCancelSendToEth", + value: MsgCancelSendToEth.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelSendToEthProtoMsg): MsgCancelSendToEth { + return MsgCancelSendToEth.decode(message.value); + }, + toProto(message: MsgCancelSendToEth): Uint8Array { + return MsgCancelSendToEth.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSendToEth): MsgCancelSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEth", + value: MsgCancelSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSendToEth.typeUrl, MsgCancelSendToEth); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelSendToEth.aminoType, MsgCancelSendToEth.typeUrl); +function createBaseMsgCancelSendToEthResponse(): MsgCancelSendToEthResponse { + return {}; +} +export const MsgCancelSendToEthResponse = { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse", + is(o: any): o is MsgCancelSendToEthResponse { + return o && o.$typeUrl === MsgCancelSendToEthResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelSendToEthResponseAmino { + return o && o.$typeUrl === MsgCancelSendToEthResponse.typeUrl; + }, + encode(_: MsgCancelSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCancelSendToEthResponse { + const message = createBaseMsgCancelSendToEthResponse(); + return message; + }, + fromAmino(_: MsgCancelSendToEthResponseAmino): MsgCancelSendToEthResponse { + const message = createBaseMsgCancelSendToEthResponse(); + return message; + }, + toAmino(_: MsgCancelSendToEthResponse): MsgCancelSendToEthResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelSendToEthResponseAminoMsg): MsgCancelSendToEthResponse { + return MsgCancelSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelSendToEthResponseProtoMsg): MsgCancelSendToEthResponse { + return MsgCancelSendToEthResponse.decode(message.value); + }, + toProto(message: MsgCancelSendToEthResponse): Uint8Array { + return MsgCancelSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelSendToEthResponse): MsgCancelSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgCancelSendToEthResponse", + value: MsgCancelSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelSendToEthResponse.typeUrl, MsgCancelSendToEthResponse); +function createBaseMsgSubmitBadSignatureEvidence(): MsgSubmitBadSignatureEvidence { + return { + subject: undefined, + signature: "", + sender: "" + }; +} +export const MsgSubmitBadSignatureEvidence = { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence", + aminoType: "peggy/MsgSubmitBadSignatureEvidence", + is(o: any): o is MsgSubmitBadSignatureEvidence { + return o && (o.$typeUrl === MsgSubmitBadSignatureEvidence.typeUrl || typeof o.signature === "string" && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgSubmitBadSignatureEvidenceAmino { + return o && (o.$typeUrl === MsgSubmitBadSignatureEvidence.typeUrl || typeof o.signature === "string" && typeof o.sender === "string"); + }, + encode(message: MsgSubmitBadSignatureEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subject !== undefined) { + Any.encode(message.subject, writer.uint32(10).fork()).ldelim(); + } + if (message.signature !== "") { + writer.uint32(18).string(message.signature); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitBadSignatureEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitBadSignatureEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = Any.decode(reader, reader.uint32()); + break; + case 2: + message.signature = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgSubmitBadSignatureEvidence { + const message = createBaseMsgSubmitBadSignatureEvidence(); + message.subject = object.subject !== undefined && object.subject !== null ? Any.fromPartial(object.subject) : undefined; + message.signature = object.signature ?? ""; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgSubmitBadSignatureEvidenceAmino): MsgSubmitBadSignatureEvidence { + const message = createBaseMsgSubmitBadSignatureEvidence(); + if (object.subject !== undefined && object.subject !== null) { + message.subject = Any.fromAmino(object.subject); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceAmino { + const obj: any = {}; + obj.subject = message.subject ? Any.toAmino(message.subject) : undefined; + obj.signature = message.signature === "" ? undefined : message.signature; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: MsgSubmitBadSignatureEvidenceAminoMsg): MsgSubmitBadSignatureEvidence { + return MsgSubmitBadSignatureEvidence.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceAminoMsg { + return { + type: "peggy/MsgSubmitBadSignatureEvidence", + value: MsgSubmitBadSignatureEvidence.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitBadSignatureEvidenceProtoMsg): MsgSubmitBadSignatureEvidence { + return MsgSubmitBadSignatureEvidence.decode(message.value); + }, + toProto(message: MsgSubmitBadSignatureEvidence): Uint8Array { + return MsgSubmitBadSignatureEvidence.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitBadSignatureEvidence): MsgSubmitBadSignatureEvidenceProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidence", + value: MsgSubmitBadSignatureEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitBadSignatureEvidence.typeUrl, MsgSubmitBadSignatureEvidence); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitBadSignatureEvidence.aminoType, MsgSubmitBadSignatureEvidence.typeUrl); +function createBaseMsgSubmitBadSignatureEvidenceResponse(): MsgSubmitBadSignatureEvidenceResponse { + return {}; +} +export const MsgSubmitBadSignatureEvidenceResponse = { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse", + is(o: any): o is MsgSubmitBadSignatureEvidenceResponse { + return o && o.$typeUrl === MsgSubmitBadSignatureEvidenceResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubmitBadSignatureEvidenceResponseAmino { + return o && o.$typeUrl === MsgSubmitBadSignatureEvidenceResponse.typeUrl; + }, + encode(_: MsgSubmitBadSignatureEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitBadSignatureEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgSubmitBadSignatureEvidenceResponse { + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + return message; + }, + fromAmino(_: MsgSubmitBadSignatureEvidenceResponseAmino): MsgSubmitBadSignatureEvidenceResponse { + const message = createBaseMsgSubmitBadSignatureEvidenceResponse(); + return message; + }, + toAmino(_: MsgSubmitBadSignatureEvidenceResponse): MsgSubmitBadSignatureEvidenceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitBadSignatureEvidenceResponseAminoMsg): MsgSubmitBadSignatureEvidenceResponse { + return MsgSubmitBadSignatureEvidenceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubmitBadSignatureEvidenceResponseProtoMsg): MsgSubmitBadSignatureEvidenceResponse { + return MsgSubmitBadSignatureEvidenceResponse.decode(message.value); + }, + toProto(message: MsgSubmitBadSignatureEvidenceResponse): Uint8Array { + return MsgSubmitBadSignatureEvidenceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitBadSignatureEvidenceResponse): MsgSubmitBadSignatureEvidenceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgSubmitBadSignatureEvidenceResponse", + value: MsgSubmitBadSignatureEvidenceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSubmitBadSignatureEvidenceResponse.typeUrl, MsgSubmitBadSignatureEvidenceResponse); +function createBaseMsgValsetUpdatedClaim(): MsgValsetUpdatedClaim { + return { + eventNonce: BigInt(0), + valsetNonce: BigInt(0), + blockHeight: BigInt(0), + members: [], + rewardAmount: "", + rewardToken: "", + orchestrator: "" + }; +} +export const MsgValsetUpdatedClaim = { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim", + aminoType: "peggy/MsgValsetUpdatedClaim", + is(o: any): o is MsgValsetUpdatedClaim { + return o && (o.$typeUrl === MsgValsetUpdatedClaim.typeUrl || typeof o.eventNonce === "bigint" && typeof o.valsetNonce === "bigint" && typeof o.blockHeight === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.is(o.members[0])) && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string" && typeof o.orchestrator === "string"); + }, + isAmino(o: any): o is MsgValsetUpdatedClaimAmino { + return o && (o.$typeUrl === MsgValsetUpdatedClaim.typeUrl || typeof o.event_nonce === "bigint" && typeof o.valset_nonce === "bigint" && typeof o.block_height === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.isAmino(o.members[0])) && typeof o.reward_amount === "string" && typeof o.reward_token === "string" && typeof o.orchestrator === "string"); + }, + encode(message: MsgValsetUpdatedClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.eventNonce); + } + if (message.valsetNonce !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetNonce); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.blockHeight); + } + for (const v of message.members) { + BridgeValidator.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.rewardAmount !== "") { + writer.uint32(42).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(50).string(message.rewardToken); + } + if (message.orchestrator !== "") { + writer.uint32(58).string(message.orchestrator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetUpdatedClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetUpdatedClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventNonce = reader.uint64(); + break; + case 2: + message.valsetNonce = reader.uint64(); + break; + case 3: + message.blockHeight = reader.uint64(); + break; + case 4: + message.members.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 5: + message.rewardAmount = reader.string(); + break; + case 6: + message.rewardToken = reader.string(); + break; + case 7: + message.orchestrator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgValsetUpdatedClaim { + const message = createBaseMsgValsetUpdatedClaim(); + message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? BigInt(object.eventNonce.toString()) : BigInt(0); + message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? BigInt(object.valsetNonce.toString()) : BigInt(0); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.members = object.members?.map(e => BridgeValidator.fromPartial(e)) || []; + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + message.orchestrator = object.orchestrator ?? ""; + return message; + }, + fromAmino(object: MsgValsetUpdatedClaimAmino): MsgValsetUpdatedClaim { + const message = createBaseMsgValsetUpdatedClaim(); + if (object.event_nonce !== undefined && object.event_nonce !== null) { + message.eventNonce = BigInt(object.event_nonce); + } + if (object.valset_nonce !== undefined && object.valset_nonce !== null) { + message.valsetNonce = BigInt(object.valset_nonce); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + message.members = object.members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + if (object.orchestrator !== undefined && object.orchestrator !== null) { + message.orchestrator = object.orchestrator; + } + return message; + }, + toAmino(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimAmino { + const obj: any = {}; + obj.event_nonce = message.eventNonce !== BigInt(0) ? message.eventNonce?.toString() : undefined; + obj.valset_nonce = message.valsetNonce !== BigInt(0) ? message.valsetNonce?.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + if (message.members) { + obj.members = message.members.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + obj.orchestrator = message.orchestrator === "" ? undefined : message.orchestrator; + return obj; + }, + fromAminoMsg(object: MsgValsetUpdatedClaimAminoMsg): MsgValsetUpdatedClaim { + return MsgValsetUpdatedClaim.fromAmino(object.value); + }, + toAminoMsg(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimAminoMsg { + return { + type: "peggy/MsgValsetUpdatedClaim", + value: MsgValsetUpdatedClaim.toAmino(message) + }; + }, + fromProtoMsg(message: MsgValsetUpdatedClaimProtoMsg): MsgValsetUpdatedClaim { + return MsgValsetUpdatedClaim.decode(message.value); + }, + toProto(message: MsgValsetUpdatedClaim): Uint8Array { + return MsgValsetUpdatedClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetUpdatedClaim): MsgValsetUpdatedClaimProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaim", + value: MsgValsetUpdatedClaim.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetUpdatedClaim.typeUrl, MsgValsetUpdatedClaim); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgValsetUpdatedClaim.aminoType, MsgValsetUpdatedClaim.typeUrl); +function createBaseMsgValsetUpdatedClaimResponse(): MsgValsetUpdatedClaimResponse { + return {}; +} +export const MsgValsetUpdatedClaimResponse = { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse", + is(o: any): o is MsgValsetUpdatedClaimResponse { + return o && o.$typeUrl === MsgValsetUpdatedClaimResponse.typeUrl; + }, + isAmino(o: any): o is MsgValsetUpdatedClaimResponseAmino { + return o && o.$typeUrl === MsgValsetUpdatedClaimResponse.typeUrl; + }, + encode(_: MsgValsetUpdatedClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgValsetUpdatedClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgValsetUpdatedClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgValsetUpdatedClaimResponse { + const message = createBaseMsgValsetUpdatedClaimResponse(); + return message; + }, + fromAmino(_: MsgValsetUpdatedClaimResponseAmino): MsgValsetUpdatedClaimResponse { + const message = createBaseMsgValsetUpdatedClaimResponse(); + return message; + }, + toAmino(_: MsgValsetUpdatedClaimResponse): MsgValsetUpdatedClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgValsetUpdatedClaimResponseAminoMsg): MsgValsetUpdatedClaimResponse { + return MsgValsetUpdatedClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgValsetUpdatedClaimResponseProtoMsg): MsgValsetUpdatedClaimResponse { + return MsgValsetUpdatedClaimResponse.decode(message.value); + }, + toProto(message: MsgValsetUpdatedClaimResponse): Uint8Array { + return MsgValsetUpdatedClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgValsetUpdatedClaimResponse): MsgValsetUpdatedClaimResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgValsetUpdatedClaimResponse", + value: MsgValsetUpdatedClaimResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgValsetUpdatedClaimResponse.typeUrl, MsgValsetUpdatedClaimResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.peggy.v1.MsgUpdateParams", + aminoType: "peggy/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "peggy/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: "/injective.peggy.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgBlacklistEthereumAddresses(): MsgBlacklistEthereumAddresses { + return { + signer: "", + blacklistAddresses: [] + }; +} +export const MsgBlacklistEthereumAddresses = { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses", + aminoType: "peggy/MsgBlacklistEthereumAddresses", + is(o: any): o is MsgBlacklistEthereumAddresses { + return o && (o.$typeUrl === MsgBlacklistEthereumAddresses.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is MsgBlacklistEthereumAddressesAmino { + return o && (o.$typeUrl === MsgBlacklistEthereumAddresses.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: MsgBlacklistEthereumAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.blacklistAddresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBlacklistEthereumAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBlacklistEthereumAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBlacklistEthereumAddresses { + const message = createBaseMsgBlacklistEthereumAddresses(); + message.signer = object.signer ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgBlacklistEthereumAddressesAmino): MsgBlacklistEthereumAddresses { + const message = createBaseMsgBlacklistEthereumAddresses(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: MsgBlacklistEthereumAddressesAminoMsg): MsgBlacklistEthereumAddresses { + return MsgBlacklistEthereumAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesAminoMsg { + return { + type: "peggy/MsgBlacklistEthereumAddresses", + value: MsgBlacklistEthereumAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBlacklistEthereumAddressesProtoMsg): MsgBlacklistEthereumAddresses { + return MsgBlacklistEthereumAddresses.decode(message.value); + }, + toProto(message: MsgBlacklistEthereumAddresses): Uint8Array { + return MsgBlacklistEthereumAddresses.encode(message).finish(); + }, + toProtoMsg(message: MsgBlacklistEthereumAddresses): MsgBlacklistEthereumAddressesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddresses", + value: MsgBlacklistEthereumAddresses.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBlacklistEthereumAddresses.typeUrl, MsgBlacklistEthereumAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBlacklistEthereumAddresses.aminoType, MsgBlacklistEthereumAddresses.typeUrl); +function createBaseMsgBlacklistEthereumAddressesResponse(): MsgBlacklistEthereumAddressesResponse { + return {}; +} +export const MsgBlacklistEthereumAddressesResponse = { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse", + is(o: any): o is MsgBlacklistEthereumAddressesResponse { + return o && o.$typeUrl === MsgBlacklistEthereumAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgBlacklistEthereumAddressesResponseAmino { + return o && o.$typeUrl === MsgBlacklistEthereumAddressesResponse.typeUrl; + }, + encode(_: MsgBlacklistEthereumAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBlacklistEthereumAddressesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgBlacklistEthereumAddressesResponse { + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + return message; + }, + fromAmino(_: MsgBlacklistEthereumAddressesResponseAmino): MsgBlacklistEthereumAddressesResponse { + const message = createBaseMsgBlacklistEthereumAddressesResponse(); + return message; + }, + toAmino(_: MsgBlacklistEthereumAddressesResponse): MsgBlacklistEthereumAddressesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBlacklistEthereumAddressesResponseAminoMsg): MsgBlacklistEthereumAddressesResponse { + return MsgBlacklistEthereumAddressesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBlacklistEthereumAddressesResponseProtoMsg): MsgBlacklistEthereumAddressesResponse { + return MsgBlacklistEthereumAddressesResponse.decode(message.value); + }, + toProto(message: MsgBlacklistEthereumAddressesResponse): Uint8Array { + return MsgBlacklistEthereumAddressesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBlacklistEthereumAddressesResponse): MsgBlacklistEthereumAddressesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgBlacklistEthereumAddressesResponse", + value: MsgBlacklistEthereumAddressesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBlacklistEthereumAddressesResponse.typeUrl, MsgBlacklistEthereumAddressesResponse); +function createBaseMsgRevokeEthereumBlacklist(): MsgRevokeEthereumBlacklist { + return { + signer: "", + blacklistAddresses: [] + }; +} +export const MsgRevokeEthereumBlacklist = { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist", + aminoType: "peggy/MsgRevokeEthereumBlacklist", + is(o: any): o is MsgRevokeEthereumBlacklist { + return o && (o.$typeUrl === MsgRevokeEthereumBlacklist.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is MsgRevokeEthereumBlacklistAmino { + return o && (o.$typeUrl === MsgRevokeEthereumBlacklist.typeUrl || typeof o.signer === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: MsgRevokeEthereumBlacklist, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.blacklistAddresses) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeEthereumBlacklist { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeEthereumBlacklist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeEthereumBlacklist { + const message = createBaseMsgRevokeEthereumBlacklist(); + message.signer = object.signer ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRevokeEthereumBlacklistAmino): MsgRevokeEthereumBlacklist { + const message = createBaseMsgRevokeEthereumBlacklist(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: MsgRevokeEthereumBlacklistAminoMsg): MsgRevokeEthereumBlacklist { + return MsgRevokeEthereumBlacklist.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistAminoMsg { + return { + type: "peggy/MsgRevokeEthereumBlacklist", + value: MsgRevokeEthereumBlacklist.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeEthereumBlacklistProtoMsg): MsgRevokeEthereumBlacklist { + return MsgRevokeEthereumBlacklist.decode(message.value); + }, + toProto(message: MsgRevokeEthereumBlacklist): Uint8Array { + return MsgRevokeEthereumBlacklist.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeEthereumBlacklist): MsgRevokeEthereumBlacklistProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklist", + value: MsgRevokeEthereumBlacklist.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeEthereumBlacklist.typeUrl, MsgRevokeEthereumBlacklist); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeEthereumBlacklist.aminoType, MsgRevokeEthereumBlacklist.typeUrl); +function createBaseMsgRevokeEthereumBlacklistResponse(): MsgRevokeEthereumBlacklistResponse { + return {}; +} +export const MsgRevokeEthereumBlacklistResponse = { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse", + is(o: any): o is MsgRevokeEthereumBlacklistResponse { + return o && o.$typeUrl === MsgRevokeEthereumBlacklistResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeEthereumBlacklistResponseAmino { + return o && o.$typeUrl === MsgRevokeEthereumBlacklistResponse.typeUrl; + }, + encode(_: MsgRevokeEthereumBlacklistResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeEthereumBlacklistResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeEthereumBlacklistResponse { + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + return message; + }, + fromAmino(_: MsgRevokeEthereumBlacklistResponseAmino): MsgRevokeEthereumBlacklistResponse { + const message = createBaseMsgRevokeEthereumBlacklistResponse(); + return message; + }, + toAmino(_: MsgRevokeEthereumBlacklistResponse): MsgRevokeEthereumBlacklistResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeEthereumBlacklistResponseAminoMsg): MsgRevokeEthereumBlacklistResponse { + return MsgRevokeEthereumBlacklistResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRevokeEthereumBlacklistResponseProtoMsg): MsgRevokeEthereumBlacklistResponse { + return MsgRevokeEthereumBlacklistResponse.decode(message.value); + }, + toProto(message: MsgRevokeEthereumBlacklistResponse): Uint8Array { + return MsgRevokeEthereumBlacklistResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeEthereumBlacklistResponse): MsgRevokeEthereumBlacklistResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MsgRevokeEthereumBlacklistResponse", + value: MsgRevokeEthereumBlacklistResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeEthereumBlacklistResponse.typeUrl, MsgRevokeEthereumBlacklistResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/params.ts b/libs/injectivejs/src/injective/peggy/v1/params.ts new file mode 100644 index 00000000..8925790d --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/params.ts @@ -0,0 +1,392 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + peggyId: string; + contractSourceHash: string; + bridgeEthereumAddress: string; + bridgeChainId: bigint; + signedValsetsWindow: bigint; + signedBatchesWindow: bigint; + signedClaimsWindow: bigint; + targetBatchTimeout: bigint; + averageBlockTime: bigint; + averageEthereumBlockTime: bigint; + slashFractionValset: Uint8Array; + slashFractionBatch: Uint8Array; + slashFractionClaim: Uint8Array; + slashFractionConflictingClaim: Uint8Array; + unbondSlashingValsetsWindow: bigint; + slashFractionBadEthSignature: Uint8Array; + cosmosCoinDenom: string; + cosmosCoinErc20Contract: string; + claimSlashingEnabled: boolean; + bridgeContractStartHeight: bigint; + valsetReward: Coin; + admins: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.peggy.v1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + peggy_id: string; + contract_source_hash: string; + bridge_ethereum_address: string; + bridge_chain_id: string; + signed_valsets_window: string; + signed_batches_window: string; + signed_claims_window: string; + target_batch_timeout: string; + average_block_time: string; + average_ethereum_block_time: string; + slash_fraction_valset: string; + slash_fraction_batch: string; + slash_fraction_claim: string; + slash_fraction_conflicting_claim: string; + unbond_slashing_valsets_window: string; + slash_fraction_bad_eth_signature: string; + cosmos_coin_denom: string; + cosmos_coin_erc20_contract: string; + claim_slashing_enabled: boolean; + bridge_contract_start_height: string; + valset_reward: CoinAmino; + admins: string[]; +} +export interface ParamsAminoMsg { + type: "peggy/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + peggyId: "", + contractSourceHash: "", + bridgeEthereumAddress: "", + bridgeChainId: BigInt(0), + signedValsetsWindow: BigInt(0), + signedBatchesWindow: BigInt(0), + signedClaimsWindow: BigInt(0), + targetBatchTimeout: BigInt(0), + averageBlockTime: BigInt(0), + averageEthereumBlockTime: BigInt(0), + slashFractionValset: new Uint8Array(), + slashFractionBatch: new Uint8Array(), + slashFractionClaim: new Uint8Array(), + slashFractionConflictingClaim: new Uint8Array(), + unbondSlashingValsetsWindow: BigInt(0), + slashFractionBadEthSignature: new Uint8Array(), + cosmosCoinDenom: "", + cosmosCoinErc20Contract: "", + claimSlashingEnabled: false, + bridgeContractStartHeight: BigInt(0), + valsetReward: Coin.fromPartial({}), + admins: [] + }; +} +export const Params = { + typeUrl: "/injective.peggy.v1.Params", + aminoType: "peggy/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.peggyId === "string" && typeof o.contractSourceHash === "string" && typeof o.bridgeEthereumAddress === "string" && typeof o.bridgeChainId === "bigint" && typeof o.signedValsetsWindow === "bigint" && typeof o.signedBatchesWindow === "bigint" && typeof o.signedClaimsWindow === "bigint" && typeof o.targetBatchTimeout === "bigint" && typeof o.averageBlockTime === "bigint" && typeof o.averageEthereumBlockTime === "bigint" && (o.slashFractionValset instanceof Uint8Array || typeof o.slashFractionValset === "string") && (o.slashFractionBatch instanceof Uint8Array || typeof o.slashFractionBatch === "string") && (o.slashFractionClaim instanceof Uint8Array || typeof o.slashFractionClaim === "string") && (o.slashFractionConflictingClaim instanceof Uint8Array || typeof o.slashFractionConflictingClaim === "string") && typeof o.unbondSlashingValsetsWindow === "bigint" && (o.slashFractionBadEthSignature instanceof Uint8Array || typeof o.slashFractionBadEthSignature === "string") && typeof o.cosmosCoinDenom === "string" && typeof o.cosmosCoinErc20Contract === "string" && typeof o.claimSlashingEnabled === "boolean" && typeof o.bridgeContractStartHeight === "bigint" && Coin.is(o.valsetReward) && Array.isArray(o.admins) && (!o.admins.length || typeof o.admins[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.peggy_id === "string" && typeof o.contract_source_hash === "string" && typeof o.bridge_ethereum_address === "string" && typeof o.bridge_chain_id === "bigint" && typeof o.signed_valsets_window === "bigint" && typeof o.signed_batches_window === "bigint" && typeof o.signed_claims_window === "bigint" && typeof o.target_batch_timeout === "bigint" && typeof o.average_block_time === "bigint" && typeof o.average_ethereum_block_time === "bigint" && (o.slash_fraction_valset instanceof Uint8Array || typeof o.slash_fraction_valset === "string") && (o.slash_fraction_batch instanceof Uint8Array || typeof o.slash_fraction_batch === "string") && (o.slash_fraction_claim instanceof Uint8Array || typeof o.slash_fraction_claim === "string") && (o.slash_fraction_conflicting_claim instanceof Uint8Array || typeof o.slash_fraction_conflicting_claim === "string") && typeof o.unbond_slashing_valsets_window === "bigint" && (o.slash_fraction_bad_eth_signature instanceof Uint8Array || typeof o.slash_fraction_bad_eth_signature === "string") && typeof o.cosmos_coin_denom === "string" && typeof o.cosmos_coin_erc20_contract === "string" && typeof o.claim_slashing_enabled === "boolean" && typeof o.bridge_contract_start_height === "bigint" && Coin.isAmino(o.valset_reward) && Array.isArray(o.admins) && (!o.admins.length || typeof o.admins[0] === "string")); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.peggyId !== "") { + writer.uint32(10).string(message.peggyId); + } + if (message.contractSourceHash !== "") { + writer.uint32(18).string(message.contractSourceHash); + } + if (message.bridgeEthereumAddress !== "") { + writer.uint32(26).string(message.bridgeEthereumAddress); + } + if (message.bridgeChainId !== BigInt(0)) { + writer.uint32(32).uint64(message.bridgeChainId); + } + if (message.signedValsetsWindow !== BigInt(0)) { + writer.uint32(40).uint64(message.signedValsetsWindow); + } + if (message.signedBatchesWindow !== BigInt(0)) { + writer.uint32(48).uint64(message.signedBatchesWindow); + } + if (message.signedClaimsWindow !== BigInt(0)) { + writer.uint32(56).uint64(message.signedClaimsWindow); + } + if (message.targetBatchTimeout !== BigInt(0)) { + writer.uint32(64).uint64(message.targetBatchTimeout); + } + if (message.averageBlockTime !== BigInt(0)) { + writer.uint32(72).uint64(message.averageBlockTime); + } + if (message.averageEthereumBlockTime !== BigInt(0)) { + writer.uint32(80).uint64(message.averageEthereumBlockTime); + } + if (message.slashFractionValset.length !== 0) { + writer.uint32(90).bytes(message.slashFractionValset); + } + if (message.slashFractionBatch.length !== 0) { + writer.uint32(98).bytes(message.slashFractionBatch); + } + if (message.slashFractionClaim.length !== 0) { + writer.uint32(106).bytes(message.slashFractionClaim); + } + if (message.slashFractionConflictingClaim.length !== 0) { + writer.uint32(114).bytes(message.slashFractionConflictingClaim); + } + if (message.unbondSlashingValsetsWindow !== BigInt(0)) { + writer.uint32(120).uint64(message.unbondSlashingValsetsWindow); + } + if (message.slashFractionBadEthSignature.length !== 0) { + writer.uint32(130).bytes(message.slashFractionBadEthSignature); + } + if (message.cosmosCoinDenom !== "") { + writer.uint32(138).string(message.cosmosCoinDenom); + } + if (message.cosmosCoinErc20Contract !== "") { + writer.uint32(146).string(message.cosmosCoinErc20Contract); + } + if (message.claimSlashingEnabled === true) { + writer.uint32(152).bool(message.claimSlashingEnabled); + } + if (message.bridgeContractStartHeight !== BigInt(0)) { + writer.uint32(160).uint64(message.bridgeContractStartHeight); + } + if (message.valsetReward !== undefined) { + Coin.encode(message.valsetReward, writer.uint32(170).fork()).ldelim(); + } + for (const v of message.admins) { + writer.uint32(178).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.peggyId = reader.string(); + break; + case 2: + message.contractSourceHash = reader.string(); + break; + case 3: + message.bridgeEthereumAddress = reader.string(); + break; + case 4: + message.bridgeChainId = reader.uint64(); + break; + case 5: + message.signedValsetsWindow = reader.uint64(); + break; + case 6: + message.signedBatchesWindow = reader.uint64(); + break; + case 7: + message.signedClaimsWindow = reader.uint64(); + break; + case 8: + message.targetBatchTimeout = reader.uint64(); + break; + case 9: + message.averageBlockTime = reader.uint64(); + break; + case 10: + message.averageEthereumBlockTime = reader.uint64(); + break; + case 11: + message.slashFractionValset = reader.bytes(); + break; + case 12: + message.slashFractionBatch = reader.bytes(); + break; + case 13: + message.slashFractionClaim = reader.bytes(); + break; + case 14: + message.slashFractionConflictingClaim = reader.bytes(); + break; + case 15: + message.unbondSlashingValsetsWindow = reader.uint64(); + break; + case 16: + message.slashFractionBadEthSignature = reader.bytes(); + break; + case 17: + message.cosmosCoinDenom = reader.string(); + break; + case 18: + message.cosmosCoinErc20Contract = reader.string(); + break; + case 19: + message.claimSlashingEnabled = reader.bool(); + break; + case 20: + message.bridgeContractStartHeight = reader.uint64(); + break; + case 21: + message.valsetReward = Coin.decode(reader, reader.uint32()); + break; + case 22: + message.admins.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.peggyId = object.peggyId ?? ""; + message.contractSourceHash = object.contractSourceHash ?? ""; + message.bridgeEthereumAddress = object.bridgeEthereumAddress ?? ""; + message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? BigInt(object.bridgeChainId.toString()) : BigInt(0); + message.signedValsetsWindow = object.signedValsetsWindow !== undefined && object.signedValsetsWindow !== null ? BigInt(object.signedValsetsWindow.toString()) : BigInt(0); + message.signedBatchesWindow = object.signedBatchesWindow !== undefined && object.signedBatchesWindow !== null ? BigInt(object.signedBatchesWindow.toString()) : BigInt(0); + message.signedClaimsWindow = object.signedClaimsWindow !== undefined && object.signedClaimsWindow !== null ? BigInt(object.signedClaimsWindow.toString()) : BigInt(0); + message.targetBatchTimeout = object.targetBatchTimeout !== undefined && object.targetBatchTimeout !== null ? BigInt(object.targetBatchTimeout.toString()) : BigInt(0); + message.averageBlockTime = object.averageBlockTime !== undefined && object.averageBlockTime !== null ? BigInt(object.averageBlockTime.toString()) : BigInt(0); + message.averageEthereumBlockTime = object.averageEthereumBlockTime !== undefined && object.averageEthereumBlockTime !== null ? BigInt(object.averageEthereumBlockTime.toString()) : BigInt(0); + message.slashFractionValset = object.slashFractionValset ?? new Uint8Array(); + message.slashFractionBatch = object.slashFractionBatch ?? new Uint8Array(); + message.slashFractionClaim = object.slashFractionClaim ?? new Uint8Array(); + message.slashFractionConflictingClaim = object.slashFractionConflictingClaim ?? new Uint8Array(); + message.unbondSlashingValsetsWindow = object.unbondSlashingValsetsWindow !== undefined && object.unbondSlashingValsetsWindow !== null ? BigInt(object.unbondSlashingValsetsWindow.toString()) : BigInt(0); + message.slashFractionBadEthSignature = object.slashFractionBadEthSignature ?? new Uint8Array(); + message.cosmosCoinDenom = object.cosmosCoinDenom ?? ""; + message.cosmosCoinErc20Contract = object.cosmosCoinErc20Contract ?? ""; + message.claimSlashingEnabled = object.claimSlashingEnabled ?? false; + message.bridgeContractStartHeight = object.bridgeContractStartHeight !== undefined && object.bridgeContractStartHeight !== null ? BigInt(object.bridgeContractStartHeight.toString()) : BigInt(0); + message.valsetReward = object.valsetReward !== undefined && object.valsetReward !== null ? Coin.fromPartial(object.valsetReward) : undefined; + message.admins = object.admins?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.peggy_id !== undefined && object.peggy_id !== null) { + message.peggyId = object.peggy_id; + } + if (object.contract_source_hash !== undefined && object.contract_source_hash !== null) { + message.contractSourceHash = object.contract_source_hash; + } + if (object.bridge_ethereum_address !== undefined && object.bridge_ethereum_address !== null) { + message.bridgeEthereumAddress = object.bridge_ethereum_address; + } + if (object.bridge_chain_id !== undefined && object.bridge_chain_id !== null) { + message.bridgeChainId = BigInt(object.bridge_chain_id); + } + if (object.signed_valsets_window !== undefined && object.signed_valsets_window !== null) { + message.signedValsetsWindow = BigInt(object.signed_valsets_window); + } + if (object.signed_batches_window !== undefined && object.signed_batches_window !== null) { + message.signedBatchesWindow = BigInt(object.signed_batches_window); + } + if (object.signed_claims_window !== undefined && object.signed_claims_window !== null) { + message.signedClaimsWindow = BigInt(object.signed_claims_window); + } + if (object.target_batch_timeout !== undefined && object.target_batch_timeout !== null) { + message.targetBatchTimeout = BigInt(object.target_batch_timeout); + } + if (object.average_block_time !== undefined && object.average_block_time !== null) { + message.averageBlockTime = BigInt(object.average_block_time); + } + if (object.average_ethereum_block_time !== undefined && object.average_ethereum_block_time !== null) { + message.averageEthereumBlockTime = BigInt(object.average_ethereum_block_time); + } + if (object.slash_fraction_valset !== undefined && object.slash_fraction_valset !== null) { + message.slashFractionValset = bytesFromBase64(object.slash_fraction_valset); + } + if (object.slash_fraction_batch !== undefined && object.slash_fraction_batch !== null) { + message.slashFractionBatch = bytesFromBase64(object.slash_fraction_batch); + } + if (object.slash_fraction_claim !== undefined && object.slash_fraction_claim !== null) { + message.slashFractionClaim = bytesFromBase64(object.slash_fraction_claim); + } + if (object.slash_fraction_conflicting_claim !== undefined && object.slash_fraction_conflicting_claim !== null) { + message.slashFractionConflictingClaim = bytesFromBase64(object.slash_fraction_conflicting_claim); + } + if (object.unbond_slashing_valsets_window !== undefined && object.unbond_slashing_valsets_window !== null) { + message.unbondSlashingValsetsWindow = BigInt(object.unbond_slashing_valsets_window); + } + if (object.slash_fraction_bad_eth_signature !== undefined && object.slash_fraction_bad_eth_signature !== null) { + message.slashFractionBadEthSignature = bytesFromBase64(object.slash_fraction_bad_eth_signature); + } + if (object.cosmos_coin_denom !== undefined && object.cosmos_coin_denom !== null) { + message.cosmosCoinDenom = object.cosmos_coin_denom; + } + if (object.cosmos_coin_erc20_contract !== undefined && object.cosmos_coin_erc20_contract !== null) { + message.cosmosCoinErc20Contract = object.cosmos_coin_erc20_contract; + } + if (object.claim_slashing_enabled !== undefined && object.claim_slashing_enabled !== null) { + message.claimSlashingEnabled = object.claim_slashing_enabled; + } + if (object.bridge_contract_start_height !== undefined && object.bridge_contract_start_height !== null) { + message.bridgeContractStartHeight = BigInt(object.bridge_contract_start_height); + } + if (object.valset_reward !== undefined && object.valset_reward !== null) { + message.valsetReward = Coin.fromAmino(object.valset_reward); + } + message.admins = object.admins?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.peggy_id = message.peggyId === "" ? undefined : message.peggyId; + obj.contract_source_hash = message.contractSourceHash === "" ? undefined : message.contractSourceHash; + obj.bridge_ethereum_address = message.bridgeEthereumAddress === "" ? undefined : message.bridgeEthereumAddress; + obj.bridge_chain_id = message.bridgeChainId !== BigInt(0) ? message.bridgeChainId?.toString() : undefined; + obj.signed_valsets_window = message.signedValsetsWindow !== BigInt(0) ? message.signedValsetsWindow?.toString() : undefined; + obj.signed_batches_window = message.signedBatchesWindow !== BigInt(0) ? message.signedBatchesWindow?.toString() : undefined; + obj.signed_claims_window = message.signedClaimsWindow !== BigInt(0) ? message.signedClaimsWindow?.toString() : undefined; + obj.target_batch_timeout = message.targetBatchTimeout !== BigInt(0) ? message.targetBatchTimeout?.toString() : undefined; + obj.average_block_time = message.averageBlockTime !== BigInt(0) ? message.averageBlockTime?.toString() : undefined; + obj.average_ethereum_block_time = message.averageEthereumBlockTime !== BigInt(0) ? message.averageEthereumBlockTime?.toString() : undefined; + obj.slash_fraction_valset = message.slashFractionValset ? base64FromBytes(message.slashFractionValset) : undefined; + obj.slash_fraction_batch = message.slashFractionBatch ? base64FromBytes(message.slashFractionBatch) : undefined; + obj.slash_fraction_claim = message.slashFractionClaim ? base64FromBytes(message.slashFractionClaim) : undefined; + obj.slash_fraction_conflicting_claim = message.slashFractionConflictingClaim ? base64FromBytes(message.slashFractionConflictingClaim) : undefined; + obj.unbond_slashing_valsets_window = message.unbondSlashingValsetsWindow !== BigInt(0) ? message.unbondSlashingValsetsWindow?.toString() : undefined; + obj.slash_fraction_bad_eth_signature = message.slashFractionBadEthSignature ? base64FromBytes(message.slashFractionBadEthSignature) : undefined; + obj.cosmos_coin_denom = message.cosmosCoinDenom === "" ? undefined : message.cosmosCoinDenom; + obj.cosmos_coin_erc20_contract = message.cosmosCoinErc20Contract === "" ? undefined : message.cosmosCoinErc20Contract; + obj.claim_slashing_enabled = message.claimSlashingEnabled === false ? undefined : message.claimSlashingEnabled; + obj.bridge_contract_start_height = message.bridgeContractStartHeight !== BigInt(0) ? message.bridgeContractStartHeight?.toString() : undefined; + obj.valset_reward = message.valsetReward ? Coin.toAmino(message.valsetReward) : undefined; + if (message.admins) { + obj.admins = message.admins.map(e => e); + } else { + obj.admins = message.admins; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "peggy/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: "/injective.peggy.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/pool.ts b/libs/injectivejs/src/injective/peggy/v1/pool.ts new file mode 100644 index 00000000..3b46adc4 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/pool.ts @@ -0,0 +1,198 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** IDSet represents a set of IDs */ +export interface IDSet { + ids: bigint[]; +} +export interface IDSetProtoMsg { + typeUrl: "/injective.peggy.v1.IDSet"; + value: Uint8Array; +} +/** IDSet represents a set of IDs */ +export interface IDSetAmino { + ids: string[]; +} +export interface IDSetAminoMsg { + type: "/injective.peggy.v1.IDSet"; + value: IDSetAmino; +} +export interface BatchFees { + token: string; + totalFees: string; +} +export interface BatchFeesProtoMsg { + typeUrl: "/injective.peggy.v1.BatchFees"; + value: Uint8Array; +} +export interface BatchFeesAmino { + token: string; + total_fees: string; +} +export interface BatchFeesAminoMsg { + type: "/injective.peggy.v1.BatchFees"; + value: BatchFeesAmino; +} +function createBaseIDSet(): IDSet { + return { + ids: [] + }; +} +export const IDSet = { + typeUrl: "/injective.peggy.v1.IDSet", + is(o: any): o is IDSet { + return o && (o.$typeUrl === IDSet.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + isAmino(o: any): o is IDSetAmino { + return o && (o.$typeUrl === IDSet.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + encode(message: IDSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.ids) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IDSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIDSet(); + 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.ids.push(reader.uint64()); + } + } else { + message.ids.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): IDSet { + const message = createBaseIDSet(); + message.ids = object.ids?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: IDSetAmino): IDSet { + const message = createBaseIDSet(); + message.ids = object.ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: IDSet): IDSetAmino { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map(e => e.toString()); + } else { + obj.ids = message.ids; + } + return obj; + }, + fromAminoMsg(object: IDSetAminoMsg): IDSet { + return IDSet.fromAmino(object.value); + }, + fromProtoMsg(message: IDSetProtoMsg): IDSet { + return IDSet.decode(message.value); + }, + toProto(message: IDSet): Uint8Array { + return IDSet.encode(message).finish(); + }, + toProtoMsg(message: IDSet): IDSetProtoMsg { + return { + typeUrl: "/injective.peggy.v1.IDSet", + value: IDSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IDSet.typeUrl, IDSet); +function createBaseBatchFees(): BatchFees { + return { + token: "", + totalFees: "" + }; +} +export const BatchFees = { + typeUrl: "/injective.peggy.v1.BatchFees", + is(o: any): o is BatchFees { + return o && (o.$typeUrl === BatchFees.typeUrl || typeof o.token === "string" && typeof o.totalFees === "string"); + }, + isAmino(o: any): o is BatchFeesAmino { + return o && (o.$typeUrl === BatchFees.typeUrl || typeof o.token === "string" && typeof o.total_fees === "string"); + }, + encode(message: BatchFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + if (message.totalFees !== "") { + writer.uint32(18).string(message.totalFees); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchFees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchFees(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = reader.string(); + break; + case 2: + message.totalFees = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchFees { + const message = createBaseBatchFees(); + message.token = object.token ?? ""; + message.totalFees = object.totalFees ?? ""; + return message; + }, + fromAmino(object: BatchFeesAmino): BatchFees { + const message = createBaseBatchFees(); + if (object.token !== undefined && object.token !== null) { + message.token = object.token; + } + if (object.total_fees !== undefined && object.total_fees !== null) { + message.totalFees = object.total_fees; + } + return message; + }, + toAmino(message: BatchFees): BatchFeesAmino { + const obj: any = {}; + obj.token = message.token === "" ? undefined : message.token; + obj.total_fees = message.totalFees === "" ? undefined : message.totalFees; + return obj; + }, + fromAminoMsg(object: BatchFeesAminoMsg): BatchFees { + return BatchFees.fromAmino(object.value); + }, + fromProtoMsg(message: BatchFeesProtoMsg): BatchFees { + return BatchFees.decode(message.value); + }, + toProto(message: BatchFees): Uint8Array { + return BatchFees.encode(message).finish(); + }, + toProtoMsg(message: BatchFees): BatchFeesProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BatchFees", + value: BatchFees.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchFees.typeUrl, BatchFees); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/proposal.ts b/libs/injectivejs/src/injective/peggy/v1/proposal.ts new file mode 100644 index 00000000..cf60d937 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/proposal.ts @@ -0,0 +1,231 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface BlacklistEthereumAddressesProposal { + title: string; + description: string; + blacklistAddresses: string[]; +} +export interface BlacklistEthereumAddressesProposalProtoMsg { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal"; + value: Uint8Array; +} +export interface BlacklistEthereumAddressesProposalAmino { + title: string; + description: string; + blacklist_addresses: string[]; +} +export interface BlacklistEthereumAddressesProposalAminoMsg { + type: "/injective.peggy.v1.BlacklistEthereumAddressesProposal"; + value: BlacklistEthereumAddressesProposalAmino; +} +export interface RevokeEthereumBlacklistProposal { + title: string; + description: string; + blacklistAddresses: string[]; +} +export interface RevokeEthereumBlacklistProposalProtoMsg { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal"; + value: Uint8Array; +} +export interface RevokeEthereumBlacklistProposalAmino { + title: string; + description: string; + blacklist_addresses: string[]; +} +export interface RevokeEthereumBlacklistProposalAminoMsg { + type: "/injective.peggy.v1.RevokeEthereumBlacklistProposal"; + value: RevokeEthereumBlacklistProposalAmino; +} +function createBaseBlacklistEthereumAddressesProposal(): BlacklistEthereumAddressesProposal { + return { + title: "", + description: "", + blacklistAddresses: [] + }; +} +export const BlacklistEthereumAddressesProposal = { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal", + is(o: any): o is BlacklistEthereumAddressesProposal { + return o && (o.$typeUrl === BlacklistEthereumAddressesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is BlacklistEthereumAddressesProposalAmino { + return o && (o.$typeUrl === BlacklistEthereumAddressesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: BlacklistEthereumAddressesProposal, 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.blacklistAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlacklistEthereumAddressesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlacklistEthereumAddressesProposal(); + 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.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlacklistEthereumAddressesProposal { + const message = createBaseBlacklistEthereumAddressesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: BlacklistEthereumAddressesProposalAmino): BlacklistEthereumAddressesProposal { + const message = createBaseBlacklistEthereumAddressesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: BlacklistEthereumAddressesProposal): BlacklistEthereumAddressesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: BlacklistEthereumAddressesProposalAminoMsg): BlacklistEthereumAddressesProposal { + return BlacklistEthereumAddressesProposal.fromAmino(object.value); + }, + fromProtoMsg(message: BlacklistEthereumAddressesProposalProtoMsg): BlacklistEthereumAddressesProposal { + return BlacklistEthereumAddressesProposal.decode(message.value); + }, + toProto(message: BlacklistEthereumAddressesProposal): Uint8Array { + return BlacklistEthereumAddressesProposal.encode(message).finish(); + }, + toProtoMsg(message: BlacklistEthereumAddressesProposal): BlacklistEthereumAddressesProposalProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BlacklistEthereumAddressesProposal", + value: BlacklistEthereumAddressesProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlacklistEthereumAddressesProposal.typeUrl, BlacklistEthereumAddressesProposal); +function createBaseRevokeEthereumBlacklistProposal(): RevokeEthereumBlacklistProposal { + return { + title: "", + description: "", + blacklistAddresses: [] + }; +} +export const RevokeEthereumBlacklistProposal = { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal", + is(o: any): o is RevokeEthereumBlacklistProposal { + return o && (o.$typeUrl === RevokeEthereumBlacklistProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklistAddresses) && (!o.blacklistAddresses.length || typeof o.blacklistAddresses[0] === "string")); + }, + isAmino(o: any): o is RevokeEthereumBlacklistProposalAmino { + return o && (o.$typeUrl === RevokeEthereumBlacklistProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.blacklist_addresses) && (!o.blacklist_addresses.length || typeof o.blacklist_addresses[0] === "string")); + }, + encode(message: RevokeEthereumBlacklistProposal, 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.blacklistAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RevokeEthereumBlacklistProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokeEthereumBlacklistProposal(); + 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.blacklistAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RevokeEthereumBlacklistProposal { + const message = createBaseRevokeEthereumBlacklistProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.blacklistAddresses = object.blacklistAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: RevokeEthereumBlacklistProposalAmino): RevokeEthereumBlacklistProposal { + const message = createBaseRevokeEthereumBlacklistProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.blacklistAddresses = object.blacklist_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: RevokeEthereumBlacklistProposal): RevokeEthereumBlacklistProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.blacklistAddresses) { + obj.blacklist_addresses = message.blacklistAddresses.map(e => e); + } else { + obj.blacklist_addresses = message.blacklistAddresses; + } + return obj; + }, + fromAminoMsg(object: RevokeEthereumBlacklistProposalAminoMsg): RevokeEthereumBlacklistProposal { + return RevokeEthereumBlacklistProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RevokeEthereumBlacklistProposalProtoMsg): RevokeEthereumBlacklistProposal { + return RevokeEthereumBlacklistProposal.decode(message.value); + }, + toProto(message: RevokeEthereumBlacklistProposal): Uint8Array { + return RevokeEthereumBlacklistProposal.encode(message).finish(); + }, + toProtoMsg(message: RevokeEthereumBlacklistProposal): RevokeEthereumBlacklistProposalProtoMsg { + return { + typeUrl: "/injective.peggy.v1.RevokeEthereumBlacklistProposal", + value: RevokeEthereumBlacklistProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RevokeEthereumBlacklistProposal.typeUrl, RevokeEthereumBlacklistProposal); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/query.rpc.func.ts b/libs/injectivejs/src/injective/peggy/v1/query.rpc.func.ts new file mode 100644 index 00000000..962ccf47 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/query.rpc.func.ts @@ -0,0 +1,149 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryCurrentValsetRequest, QueryCurrentValsetResponse, QueryValsetRequestRequest, QueryValsetRequestResponse, QueryValsetConfirmRequest, QueryValsetConfirmResponse, QueryValsetConfirmsByNonceRequest, QueryValsetConfirmsByNonceResponse, QueryLastValsetRequestsRequest, QueryLastValsetRequestsResponse, QueryLastPendingValsetRequestByAddrRequest, QueryLastPendingValsetRequestByAddrResponse, QueryLastEventByAddrRequest, QueryLastEventByAddrResponse, QueryPendingSendToEth, QueryPendingSendToEthResponse, QueryBatchFeeRequest, QueryBatchFeeResponse, QueryOutgoingTxBatchesRequest, QueryOutgoingTxBatchesResponse, QueryLastPendingBatchRequestByAddrRequest, QueryLastPendingBatchRequestByAddrResponse, QueryBatchRequestByNonceRequest, QueryBatchRequestByNonceResponse, QueryBatchConfirmsRequest, QueryBatchConfirmsResponse, QueryERC20ToDenomRequest, QueryERC20ToDenomResponse, QueryDenomToERC20Request, QueryDenomToERC20Response, QueryDelegateKeysByValidatorAddress, QueryDelegateKeysByValidatorAddressResponse, QueryDelegateKeysByEthAddress, QueryDelegateKeysByEthAddressResponse, QueryDelegateKeysByOrchestratorAddress, QueryDelegateKeysByOrchestratorAddressResponse, QueryModuleStateRequest, QueryModuleStateResponse, MissingNoncesRequest, MissingNoncesResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.peggy.v1.Query", + method: "Params", + clientResolver +}); +export const createGetCurrentValset = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryCurrentValsetRequest.encode, + decode: QueryCurrentValsetResponse.decode, + service: "injective.peggy.v1.Query", + method: "CurrentValset", + clientResolver +}); +export const createGetValsetRequest = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetRequestRequest.encode, + decode: QueryValsetRequestResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetRequest", + clientResolver +}); +export const createGetValsetConfirm = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmRequest.encode, + decode: QueryValsetConfirmResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirm", + clientResolver +}); +export const createGetValsetConfirmsByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryValsetConfirmsByNonceRequest.encode, + decode: QueryValsetConfirmsByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "ValsetConfirmsByNonce", + clientResolver +}); +export const createGetLastValsetRequests = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastValsetRequestsRequest.encode, + decode: QueryLastValsetRequestsResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastValsetRequests", + clientResolver +}); +export const createGetLastPendingValsetRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingValsetRequestByAddrRequest.encode, + decode: QueryLastPendingValsetRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingValsetRequestByAddr", + clientResolver +}); +export const createGetLastEventByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastEventByAddrRequest.encode, + decode: QueryLastEventByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastEventByAddr", + clientResolver +}); +export const createGetGetPendingSendToEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryPendingSendToEth.encode, + decode: QueryPendingSendToEthResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetPendingSendToEth", + clientResolver +}); +export const createGetBatchFees = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchFeeRequest.encode, + decode: QueryBatchFeeResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchFees", + clientResolver +}); +export const createGetOutgoingTxBatches = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryOutgoingTxBatchesRequest.encode, + decode: QueryOutgoingTxBatchesResponse.decode, + service: "injective.peggy.v1.Query", + method: "OutgoingTxBatches", + clientResolver +}); +export const createGetLastPendingBatchRequestByAddr = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryLastPendingBatchRequestByAddrRequest.encode, + decode: QueryLastPendingBatchRequestByAddrResponse.decode, + service: "injective.peggy.v1.Query", + method: "LastPendingBatchRequestByAddr", + clientResolver +}); +export const createGetBatchRequestByNonce = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchRequestByNonceRequest.encode, + decode: QueryBatchRequestByNonceResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchRequestByNonce", + clientResolver +}); +export const createGetBatchConfirms = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryBatchConfirmsRequest.encode, + decode: QueryBatchConfirmsResponse.decode, + service: "injective.peggy.v1.Query", + method: "BatchConfirms", + clientResolver +}); +export const createGetERC20ToDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryERC20ToDenomRequest.encode, + decode: QueryERC20ToDenomResponse.decode, + service: "injective.peggy.v1.Query", + method: "ERC20ToDenom", + clientResolver +}); +export const createGetDenomToERC20 = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomToERC20Request.encode, + decode: QueryDenomToERC20Response.decode, + service: "injective.peggy.v1.Query", + method: "DenomToERC20", + clientResolver +}); +export const createGetGetDelegateKeyByValidator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByValidatorAddress.encode, + decode: QueryDelegateKeysByValidatorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByValidator", + clientResolver +}); +export const createGetGetDelegateKeyByEth = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByEthAddress.encode, + decode: QueryDelegateKeysByEthAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByEth", + clientResolver +}); +export const createGetGetDelegateKeyByOrchestrator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDelegateKeysByOrchestratorAddress.encode, + decode: QueryDelegateKeysByOrchestratorAddressResponse.decode, + service: "injective.peggy.v1.Query", + method: "GetDelegateKeyByOrchestrator", + clientResolver +}); +export const createGetPeggyModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.peggy.v1.Query", + method: "PeggyModuleState", + clientResolver +}); +export const createGetMissingPeggoNonces = (clientResolver?: RpcResolver) => buildQuery({ + encode: MissingNoncesRequest.encode, + decode: MissingNoncesResponse.decode, + service: "injective.peggy.v1.Query", + method: "MissingPeggoNonces", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/query.ts b/libs/injectivejs/src/injective/peggy/v1/query.ts new file mode 100644 index 00000000..f325d5d4 --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/query.ts @@ -0,0 +1,3578 @@ +import { Params, ParamsAmino } from "./params"; +import { Valset, ValsetAmino, LastClaimEvent, LastClaimEventAmino } from "./types"; +import { MsgValsetConfirm, MsgValsetConfirmAmino, MsgConfirmBatch, MsgConfirmBatchAmino } from "./msgs"; +import { BatchFees, BatchFeesAmino } from "./pool"; +import { OutgoingTxBatch, OutgoingTxBatchAmino, OutgoingTransferTx, OutgoingTransferTxAmino } from "./batch"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.peggy.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/injective.peggy.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +export interface QueryCurrentValsetRequest {} +export interface QueryCurrentValsetRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest"; + value: Uint8Array; +} +export interface QueryCurrentValsetRequestAmino {} +export interface QueryCurrentValsetRequestAminoMsg { + type: "/injective.peggy.v1.QueryCurrentValsetRequest"; + value: QueryCurrentValsetRequestAmino; +} +export interface QueryCurrentValsetResponse { + valset?: Valset; +} +export interface QueryCurrentValsetResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse"; + value: Uint8Array; +} +export interface QueryCurrentValsetResponseAmino { + valset?: ValsetAmino; +} +export interface QueryCurrentValsetResponseAminoMsg { + type: "/injective.peggy.v1.QueryCurrentValsetResponse"; + value: QueryCurrentValsetResponseAmino; +} +export interface QueryValsetRequestRequest { + nonce: bigint; +} +export interface QueryValsetRequestRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest"; + value: Uint8Array; +} +export interface QueryValsetRequestRequestAmino { + nonce: string; +} +export interface QueryValsetRequestRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetRequestRequest"; + value: QueryValsetRequestRequestAmino; +} +export interface QueryValsetRequestResponse { + valset?: Valset; +} +export interface QueryValsetRequestResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse"; + value: Uint8Array; +} +export interface QueryValsetRequestResponseAmino { + valset?: ValsetAmino; +} +export interface QueryValsetRequestResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetRequestResponse"; + value: QueryValsetRequestResponseAmino; +} +export interface QueryValsetConfirmRequest { + nonce: bigint; + address: string; +} +export interface QueryValsetConfirmRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest"; + value: Uint8Array; +} +export interface QueryValsetConfirmRequestAmino { + nonce: string; + address: string; +} +export interface QueryValsetConfirmRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmRequest"; + value: QueryValsetConfirmRequestAmino; +} +export interface QueryValsetConfirmResponse { + confirm?: MsgValsetConfirm; +} +export interface QueryValsetConfirmResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse"; + value: Uint8Array; +} +export interface QueryValsetConfirmResponseAmino { + confirm?: MsgValsetConfirmAmino; +} +export interface QueryValsetConfirmResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmResponse"; + value: QueryValsetConfirmResponseAmino; +} +export interface QueryValsetConfirmsByNonceRequest { + nonce: bigint; +} +export interface QueryValsetConfirmsByNonceRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest"; + value: Uint8Array; +} +export interface QueryValsetConfirmsByNonceRequestAmino { + nonce: string; +} +export interface QueryValsetConfirmsByNonceRequestAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest"; + value: QueryValsetConfirmsByNonceRequestAmino; +} +export interface QueryValsetConfirmsByNonceResponse { + confirms: MsgValsetConfirm[]; +} +export interface QueryValsetConfirmsByNonceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse"; + value: Uint8Array; +} +export interface QueryValsetConfirmsByNonceResponseAmino { + confirms: MsgValsetConfirmAmino[]; +} +export interface QueryValsetConfirmsByNonceResponseAminoMsg { + type: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse"; + value: QueryValsetConfirmsByNonceResponseAmino; +} +export interface QueryLastValsetRequestsRequest {} +export interface QueryLastValsetRequestsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest"; + value: Uint8Array; +} +export interface QueryLastValsetRequestsRequestAmino {} +export interface QueryLastValsetRequestsRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastValsetRequestsRequest"; + value: QueryLastValsetRequestsRequestAmino; +} +export interface QueryLastValsetRequestsResponse { + valsets: Valset[]; +} +export interface QueryLastValsetRequestsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse"; + value: Uint8Array; +} +export interface QueryLastValsetRequestsResponseAmino { + valsets: ValsetAmino[]; +} +export interface QueryLastValsetRequestsResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastValsetRequestsResponse"; + value: QueryLastValsetRequestsResponseAmino; +} +export interface QueryLastPendingValsetRequestByAddrRequest { + address: string; +} +export interface QueryLastPendingValsetRequestByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastPendingValsetRequestByAddrRequestAmino { + address: string; +} +export interface QueryLastPendingValsetRequestByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest"; + value: QueryLastPendingValsetRequestByAddrRequestAmino; +} +export interface QueryLastPendingValsetRequestByAddrResponse { + valsets: Valset[]; +} +export interface QueryLastPendingValsetRequestByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastPendingValsetRequestByAddrResponseAmino { + valsets: ValsetAmino[]; +} +export interface QueryLastPendingValsetRequestByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse"; + value: QueryLastPendingValsetRequestByAddrResponseAmino; +} +export interface QueryBatchFeeRequest {} +export interface QueryBatchFeeRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest"; + value: Uint8Array; +} +export interface QueryBatchFeeRequestAmino {} +export interface QueryBatchFeeRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchFeeRequest"; + value: QueryBatchFeeRequestAmino; +} +export interface QueryBatchFeeResponse { + batchFees: BatchFees[]; +} +export interface QueryBatchFeeResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse"; + value: Uint8Array; +} +export interface QueryBatchFeeResponseAmino { + batchFees: BatchFeesAmino[]; +} +export interface QueryBatchFeeResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchFeeResponse"; + value: QueryBatchFeeResponseAmino; +} +export interface QueryLastPendingBatchRequestByAddrRequest { + address: string; +} +export interface QueryLastPendingBatchRequestByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastPendingBatchRequestByAddrRequestAmino { + address: string; +} +export interface QueryLastPendingBatchRequestByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest"; + value: QueryLastPendingBatchRequestByAddrRequestAmino; +} +export interface QueryLastPendingBatchRequestByAddrResponse { + batch?: OutgoingTxBatch; +} +export interface QueryLastPendingBatchRequestByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastPendingBatchRequestByAddrResponseAmino { + batch?: OutgoingTxBatchAmino; +} +export interface QueryLastPendingBatchRequestByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse"; + value: QueryLastPendingBatchRequestByAddrResponseAmino; +} +export interface QueryOutgoingTxBatchesRequest {} +export interface QueryOutgoingTxBatchesRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest"; + value: Uint8Array; +} +export interface QueryOutgoingTxBatchesRequestAmino {} +export interface QueryOutgoingTxBatchesRequestAminoMsg { + type: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest"; + value: QueryOutgoingTxBatchesRequestAmino; +} +export interface QueryOutgoingTxBatchesResponse { + batches: OutgoingTxBatch[]; +} +export interface QueryOutgoingTxBatchesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse"; + value: Uint8Array; +} +export interface QueryOutgoingTxBatchesResponseAmino { + batches: OutgoingTxBatchAmino[]; +} +export interface QueryOutgoingTxBatchesResponseAminoMsg { + type: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse"; + value: QueryOutgoingTxBatchesResponseAmino; +} +export interface QueryBatchRequestByNonceRequest { + nonce: bigint; + contractAddress: string; +} +export interface QueryBatchRequestByNonceRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest"; + value: Uint8Array; +} +export interface QueryBatchRequestByNonceRequestAmino { + nonce: string; + contract_address: string; +} +export interface QueryBatchRequestByNonceRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchRequestByNonceRequest"; + value: QueryBatchRequestByNonceRequestAmino; +} +export interface QueryBatchRequestByNonceResponse { + batch?: OutgoingTxBatch; +} +export interface QueryBatchRequestByNonceResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse"; + value: Uint8Array; +} +export interface QueryBatchRequestByNonceResponseAmino { + batch?: OutgoingTxBatchAmino; +} +export interface QueryBatchRequestByNonceResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchRequestByNonceResponse"; + value: QueryBatchRequestByNonceResponseAmino; +} +export interface QueryBatchConfirmsRequest { + nonce: bigint; + contractAddress: string; +} +export interface QueryBatchConfirmsRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest"; + value: Uint8Array; +} +export interface QueryBatchConfirmsRequestAmino { + nonce: string; + contract_address: string; +} +export interface QueryBatchConfirmsRequestAminoMsg { + type: "/injective.peggy.v1.QueryBatchConfirmsRequest"; + value: QueryBatchConfirmsRequestAmino; +} +export interface QueryBatchConfirmsResponse { + confirms: MsgConfirmBatch[]; +} +export interface QueryBatchConfirmsResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse"; + value: Uint8Array; +} +export interface QueryBatchConfirmsResponseAmino { + confirms: MsgConfirmBatchAmino[]; +} +export interface QueryBatchConfirmsResponseAminoMsg { + type: "/injective.peggy.v1.QueryBatchConfirmsResponse"; + value: QueryBatchConfirmsResponseAmino; +} +export interface QueryLastEventByAddrRequest { + address: string; +} +export interface QueryLastEventByAddrRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest"; + value: Uint8Array; +} +export interface QueryLastEventByAddrRequestAmino { + address: string; +} +export interface QueryLastEventByAddrRequestAminoMsg { + type: "/injective.peggy.v1.QueryLastEventByAddrRequest"; + value: QueryLastEventByAddrRequestAmino; +} +export interface QueryLastEventByAddrResponse { + lastClaimEvent?: LastClaimEvent; +} +export interface QueryLastEventByAddrResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse"; + value: Uint8Array; +} +export interface QueryLastEventByAddrResponseAmino { + last_claim_event?: LastClaimEventAmino; +} +export interface QueryLastEventByAddrResponseAminoMsg { + type: "/injective.peggy.v1.QueryLastEventByAddrResponse"; + value: QueryLastEventByAddrResponseAmino; +} +export interface QueryERC20ToDenomRequest { + erc20: string; +} +export interface QueryERC20ToDenomRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest"; + value: Uint8Array; +} +export interface QueryERC20ToDenomRequestAmino { + erc20: string; +} +export interface QueryERC20ToDenomRequestAminoMsg { + type: "/injective.peggy.v1.QueryERC20ToDenomRequest"; + value: QueryERC20ToDenomRequestAmino; +} +export interface QueryERC20ToDenomResponse { + denom: string; + cosmosOriginated: boolean; +} +export interface QueryERC20ToDenomResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse"; + value: Uint8Array; +} +export interface QueryERC20ToDenomResponseAmino { + denom: string; + cosmos_originated: boolean; +} +export interface QueryERC20ToDenomResponseAminoMsg { + type: "/injective.peggy.v1.QueryERC20ToDenomResponse"; + value: QueryERC20ToDenomResponseAmino; +} +export interface QueryDenomToERC20Request { + denom: string; +} +export interface QueryDenomToERC20RequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request"; + value: Uint8Array; +} +export interface QueryDenomToERC20RequestAmino { + denom: string; +} +export interface QueryDenomToERC20RequestAminoMsg { + type: "/injective.peggy.v1.QueryDenomToERC20Request"; + value: QueryDenomToERC20RequestAmino; +} +export interface QueryDenomToERC20Response { + erc20: string; + cosmosOriginated: boolean; +} +export interface QueryDenomToERC20ResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response"; + value: Uint8Array; +} +export interface QueryDenomToERC20ResponseAmino { + erc20: string; + cosmos_originated: boolean; +} +export interface QueryDenomToERC20ResponseAminoMsg { + type: "/injective.peggy.v1.QueryDenomToERC20Response"; + value: QueryDenomToERC20ResponseAmino; +} +export interface QueryDelegateKeysByValidatorAddress { + validatorAddress: string; +} +export interface QueryDelegateKeysByValidatorAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByValidatorAddressAmino { + validator_address: string; +} +export interface QueryDelegateKeysByValidatorAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress"; + value: QueryDelegateKeysByValidatorAddressAmino; +} +export interface QueryDelegateKeysByValidatorAddressResponse { + ethAddress: string; + orchestratorAddress: string; +} +export interface QueryDelegateKeysByValidatorAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByValidatorAddressResponseAmino { + eth_address: string; + orchestrator_address: string; +} +export interface QueryDelegateKeysByValidatorAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse"; + value: QueryDelegateKeysByValidatorAddressResponseAmino; +} +export interface QueryDelegateKeysByEthAddress { + ethAddress: string; +} +export interface QueryDelegateKeysByEthAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByEthAddressAmino { + eth_address: string; +} +export interface QueryDelegateKeysByEthAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByEthAddress"; + value: QueryDelegateKeysByEthAddressAmino; +} +export interface QueryDelegateKeysByEthAddressResponse { + validatorAddress: string; + orchestratorAddress: string; +} +export interface QueryDelegateKeysByEthAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByEthAddressResponseAmino { + validator_address: string; + orchestrator_address: string; +} +export interface QueryDelegateKeysByEthAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse"; + value: QueryDelegateKeysByEthAddressResponseAmino; +} +export interface QueryDelegateKeysByOrchestratorAddress { + orchestratorAddress: string; +} +export interface QueryDelegateKeysByOrchestratorAddressProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress"; + value: Uint8Array; +} +export interface QueryDelegateKeysByOrchestratorAddressAmino { + orchestrator_address: string; +} +export interface QueryDelegateKeysByOrchestratorAddressAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress"; + value: QueryDelegateKeysByOrchestratorAddressAmino; +} +export interface QueryDelegateKeysByOrchestratorAddressResponse { + validatorAddress: string; + ethAddress: string; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse"; + value: Uint8Array; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseAmino { + validator_address: string; + eth_address: string; +} +export interface QueryDelegateKeysByOrchestratorAddressResponseAminoMsg { + type: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse"; + value: QueryDelegateKeysByOrchestratorAddressResponseAmino; +} +export interface QueryPendingSendToEth { + senderAddress: string; +} +export interface QueryPendingSendToEthProtoMsg { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth"; + value: Uint8Array; +} +export interface QueryPendingSendToEthAmino { + sender_address: string; +} +export interface QueryPendingSendToEthAminoMsg { + type: "/injective.peggy.v1.QueryPendingSendToEth"; + value: QueryPendingSendToEthAmino; +} +export interface QueryPendingSendToEthResponse { + transfersInBatches: OutgoingTransferTx[]; + unbatchedTransfers: OutgoingTransferTx[]; +} +export interface QueryPendingSendToEthResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse"; + value: Uint8Array; +} +export interface QueryPendingSendToEthResponseAmino { + transfers_in_batches: OutgoingTransferTxAmino[]; + unbatched_transfers: OutgoingTransferTxAmino[]; +} +export interface QueryPendingSendToEthResponseAminoMsg { + type: "/injective.peggy.v1.QueryPendingSendToEthResponse"; + value: QueryPendingSendToEthResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.peggy.v1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/PeggyModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.peggy.v1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +export interface MissingNoncesRequest {} +export interface MissingNoncesRequestProtoMsg { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest"; + value: Uint8Array; +} +export interface MissingNoncesRequestAmino {} +export interface MissingNoncesRequestAminoMsg { + type: "/injective.peggy.v1.MissingNoncesRequest"; + value: MissingNoncesRequestAmino; +} +export interface MissingNoncesResponse { + operatorAddresses: string[]; +} +export interface MissingNoncesResponseProtoMsg { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse"; + value: Uint8Array; +} +export interface MissingNoncesResponseAmino { + operator_addresses: string[]; +} +export interface MissingNoncesResponseAminoMsg { + type: "/injective.peggy.v1.MissingNoncesResponse"; + value: MissingNoncesResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.peggy.v1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.peggy.v1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryCurrentValsetRequest(): QueryCurrentValsetRequest { + return {}; +} +export const QueryCurrentValsetRequest = { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest", + is(o: any): o is QueryCurrentValsetRequest { + return o && o.$typeUrl === QueryCurrentValsetRequest.typeUrl; + }, + isAmino(o: any): o is QueryCurrentValsetRequestAmino { + return o && o.$typeUrl === QueryCurrentValsetRequest.typeUrl; + }, + encode(_: QueryCurrentValsetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentValsetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentValsetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryCurrentValsetRequest { + const message = createBaseQueryCurrentValsetRequest(); + return message; + }, + fromAmino(_: QueryCurrentValsetRequestAmino): QueryCurrentValsetRequest { + const message = createBaseQueryCurrentValsetRequest(); + return message; + }, + toAmino(_: QueryCurrentValsetRequest): QueryCurrentValsetRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCurrentValsetRequestAminoMsg): QueryCurrentValsetRequest { + return QueryCurrentValsetRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentValsetRequestProtoMsg): QueryCurrentValsetRequest { + return QueryCurrentValsetRequest.decode(message.value); + }, + toProto(message: QueryCurrentValsetRequest): Uint8Array { + return QueryCurrentValsetRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentValsetRequest): QueryCurrentValsetRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetRequest", + value: QueryCurrentValsetRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentValsetRequest.typeUrl, QueryCurrentValsetRequest); +function createBaseQueryCurrentValsetResponse(): QueryCurrentValsetResponse { + return { + valset: undefined + }; +} +export const QueryCurrentValsetResponse = { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse", + is(o: any): o is QueryCurrentValsetResponse { + return o && o.$typeUrl === QueryCurrentValsetResponse.typeUrl; + }, + isAmino(o: any): o is QueryCurrentValsetResponseAmino { + return o && o.$typeUrl === QueryCurrentValsetResponse.typeUrl; + }, + encode(message: QueryCurrentValsetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valset !== undefined) { + Valset.encode(message.valset, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentValsetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentValsetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valset = Valset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCurrentValsetResponse { + const message = createBaseQueryCurrentValsetResponse(); + message.valset = object.valset !== undefined && object.valset !== null ? Valset.fromPartial(object.valset) : undefined; + return message; + }, + fromAmino(object: QueryCurrentValsetResponseAmino): QueryCurrentValsetResponse { + const message = createBaseQueryCurrentValsetResponse(); + if (object.valset !== undefined && object.valset !== null) { + message.valset = Valset.fromAmino(object.valset); + } + return message; + }, + toAmino(message: QueryCurrentValsetResponse): QueryCurrentValsetResponseAmino { + const obj: any = {}; + obj.valset = message.valset ? Valset.toAmino(message.valset) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCurrentValsetResponseAminoMsg): QueryCurrentValsetResponse { + return QueryCurrentValsetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCurrentValsetResponseProtoMsg): QueryCurrentValsetResponse { + return QueryCurrentValsetResponse.decode(message.value); + }, + toProto(message: QueryCurrentValsetResponse): Uint8Array { + return QueryCurrentValsetResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentValsetResponse): QueryCurrentValsetResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryCurrentValsetResponse", + value: QueryCurrentValsetResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentValsetResponse.typeUrl, QueryCurrentValsetResponse); +function createBaseQueryValsetRequestRequest(): QueryValsetRequestRequest { + return { + nonce: BigInt(0) + }; +} +export const QueryValsetRequestRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest", + is(o: any): o is QueryValsetRequestRequest { + return o && (o.$typeUrl === QueryValsetRequestRequest.typeUrl || typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is QueryValsetRequestRequestAmino { + return o && (o.$typeUrl === QueryValsetRequestRequest.typeUrl || typeof o.nonce === "bigint"); + }, + encode(message: QueryValsetRequestRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetRequestRequest { + const message = createBaseQueryValsetRequestRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryValsetRequestRequestAmino): QueryValsetRequestRequest { + const message = createBaseQueryValsetRequestRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: QueryValsetRequestRequest): QueryValsetRequestRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetRequestRequestAminoMsg): QueryValsetRequestRequest { + return QueryValsetRequestRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetRequestRequestProtoMsg): QueryValsetRequestRequest { + return QueryValsetRequestRequest.decode(message.value); + }, + toProto(message: QueryValsetRequestRequest): Uint8Array { + return QueryValsetRequestRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetRequestRequest): QueryValsetRequestRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetRequestRequest", + value: QueryValsetRequestRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetRequestRequest.typeUrl, QueryValsetRequestRequest); +function createBaseQueryValsetRequestResponse(): QueryValsetRequestResponse { + return { + valset: undefined + }; +} +export const QueryValsetRequestResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse", + is(o: any): o is QueryValsetRequestResponse { + return o && o.$typeUrl === QueryValsetRequestResponse.typeUrl; + }, + isAmino(o: any): o is QueryValsetRequestResponseAmino { + return o && o.$typeUrl === QueryValsetRequestResponse.typeUrl; + }, + encode(message: QueryValsetRequestResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valset !== undefined) { + Valset.encode(message.valset, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valset = Valset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetRequestResponse { + const message = createBaseQueryValsetRequestResponse(); + message.valset = object.valset !== undefined && object.valset !== null ? Valset.fromPartial(object.valset) : undefined; + return message; + }, + fromAmino(object: QueryValsetRequestResponseAmino): QueryValsetRequestResponse { + const message = createBaseQueryValsetRequestResponse(); + if (object.valset !== undefined && object.valset !== null) { + message.valset = Valset.fromAmino(object.valset); + } + return message; + }, + toAmino(message: QueryValsetRequestResponse): QueryValsetRequestResponseAmino { + const obj: any = {}; + obj.valset = message.valset ? Valset.toAmino(message.valset) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetRequestResponseAminoMsg): QueryValsetRequestResponse { + return QueryValsetRequestResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetRequestResponseProtoMsg): QueryValsetRequestResponse { + return QueryValsetRequestResponse.decode(message.value); + }, + toProto(message: QueryValsetRequestResponse): Uint8Array { + return QueryValsetRequestResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetRequestResponse): QueryValsetRequestResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetRequestResponse", + value: QueryValsetRequestResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetRequestResponse.typeUrl, QueryValsetRequestResponse); +function createBaseQueryValsetConfirmRequest(): QueryValsetConfirmRequest { + return { + nonce: BigInt(0), + address: "" + }; +} +export const QueryValsetConfirmRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest", + is(o: any): o is QueryValsetConfirmRequest { + return o && (o.$typeUrl === QueryValsetConfirmRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryValsetConfirmRequestAmino { + return o && (o.$typeUrl === QueryValsetConfirmRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.address === "string"); + }, + encode(message: QueryValsetConfirmRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmRequest { + const message = createBaseQueryValsetConfirmRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryValsetConfirmRequestAmino): QueryValsetConfirmRequest { + const message = createBaseQueryValsetConfirmRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryValsetConfirmRequest): QueryValsetConfirmRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmRequestAminoMsg): QueryValsetConfirmRequest { + return QueryValsetConfirmRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmRequestProtoMsg): QueryValsetConfirmRequest { + return QueryValsetConfirmRequest.decode(message.value); + }, + toProto(message: QueryValsetConfirmRequest): Uint8Array { + return QueryValsetConfirmRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmRequest): QueryValsetConfirmRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmRequest", + value: QueryValsetConfirmRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmRequest.typeUrl, QueryValsetConfirmRequest); +function createBaseQueryValsetConfirmResponse(): QueryValsetConfirmResponse { + return { + confirm: undefined + }; +} +export const QueryValsetConfirmResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse", + is(o: any): o is QueryValsetConfirmResponse { + return o && o.$typeUrl === QueryValsetConfirmResponse.typeUrl; + }, + isAmino(o: any): o is QueryValsetConfirmResponseAmino { + return o && o.$typeUrl === QueryValsetConfirmResponse.typeUrl; + }, + encode(message: QueryValsetConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.confirm !== undefined) { + MsgValsetConfirm.encode(message.confirm, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirm = MsgValsetConfirm.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmResponse { + const message = createBaseQueryValsetConfirmResponse(); + message.confirm = object.confirm !== undefined && object.confirm !== null ? MsgValsetConfirm.fromPartial(object.confirm) : undefined; + return message; + }, + fromAmino(object: QueryValsetConfirmResponseAmino): QueryValsetConfirmResponse { + const message = createBaseQueryValsetConfirmResponse(); + if (object.confirm !== undefined && object.confirm !== null) { + message.confirm = MsgValsetConfirm.fromAmino(object.confirm); + } + return message; + }, + toAmino(message: QueryValsetConfirmResponse): QueryValsetConfirmResponseAmino { + const obj: any = {}; + obj.confirm = message.confirm ? MsgValsetConfirm.toAmino(message.confirm) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmResponseAminoMsg): QueryValsetConfirmResponse { + return QueryValsetConfirmResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmResponseProtoMsg): QueryValsetConfirmResponse { + return QueryValsetConfirmResponse.decode(message.value); + }, + toProto(message: QueryValsetConfirmResponse): Uint8Array { + return QueryValsetConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmResponse): QueryValsetConfirmResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmResponse", + value: QueryValsetConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmResponse.typeUrl, QueryValsetConfirmResponse); +function createBaseQueryValsetConfirmsByNonceRequest(): QueryValsetConfirmsByNonceRequest { + return { + nonce: BigInt(0) + }; +} +export const QueryValsetConfirmsByNonceRequest = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest", + is(o: any): o is QueryValsetConfirmsByNonceRequest { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceRequest.typeUrl || typeof o.nonce === "bigint"); + }, + isAmino(o: any): o is QueryValsetConfirmsByNonceRequestAmino { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceRequest.typeUrl || typeof o.nonce === "bigint"); + }, + encode(message: QueryValsetConfirmsByNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmsByNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmsByNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmsByNonceRequest { + const message = createBaseQueryValsetConfirmsByNonceRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryValsetConfirmsByNonceRequestAmino): QueryValsetConfirmsByNonceRequest { + const message = createBaseQueryValsetConfirmsByNonceRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + return message; + }, + toAmino(message: QueryValsetConfirmsByNonceRequest): QueryValsetConfirmsByNonceRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmsByNonceRequestAminoMsg): QueryValsetConfirmsByNonceRequest { + return QueryValsetConfirmsByNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmsByNonceRequestProtoMsg): QueryValsetConfirmsByNonceRequest { + return QueryValsetConfirmsByNonceRequest.decode(message.value); + }, + toProto(message: QueryValsetConfirmsByNonceRequest): Uint8Array { + return QueryValsetConfirmsByNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmsByNonceRequest): QueryValsetConfirmsByNonceRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceRequest", + value: QueryValsetConfirmsByNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmsByNonceRequest.typeUrl, QueryValsetConfirmsByNonceRequest); +function createBaseQueryValsetConfirmsByNonceResponse(): QueryValsetConfirmsByNonceResponse { + return { + confirms: [] + }; +} +export const QueryValsetConfirmsByNonceResponse = { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse", + is(o: any): o is QueryValsetConfirmsByNonceResponse { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgValsetConfirm.is(o.confirms[0]))); + }, + isAmino(o: any): o is QueryValsetConfirmsByNonceResponseAmino { + return o && (o.$typeUrl === QueryValsetConfirmsByNonceResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgValsetConfirm.isAmino(o.confirms[0]))); + }, + encode(message: QueryValsetConfirmsByNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.confirms) { + MsgValsetConfirm.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValsetConfirmsByNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValsetConfirmsByNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirms.push(MsgValsetConfirm.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryValsetConfirmsByNonceResponse { + const message = createBaseQueryValsetConfirmsByNonceResponse(); + message.confirms = object.confirms?.map(e => MsgValsetConfirm.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValsetConfirmsByNonceResponseAmino): QueryValsetConfirmsByNonceResponse { + const message = createBaseQueryValsetConfirmsByNonceResponse(); + message.confirms = object.confirms?.map(e => MsgValsetConfirm.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValsetConfirmsByNonceResponse): QueryValsetConfirmsByNonceResponseAmino { + const obj: any = {}; + if (message.confirms) { + obj.confirms = message.confirms.map(e => e ? MsgValsetConfirm.toAmino(e) : undefined); + } else { + obj.confirms = message.confirms; + } + return obj; + }, + fromAminoMsg(object: QueryValsetConfirmsByNonceResponseAminoMsg): QueryValsetConfirmsByNonceResponse { + return QueryValsetConfirmsByNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValsetConfirmsByNonceResponseProtoMsg): QueryValsetConfirmsByNonceResponse { + return QueryValsetConfirmsByNonceResponse.decode(message.value); + }, + toProto(message: QueryValsetConfirmsByNonceResponse): Uint8Array { + return QueryValsetConfirmsByNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValsetConfirmsByNonceResponse): QueryValsetConfirmsByNonceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryValsetConfirmsByNonceResponse", + value: QueryValsetConfirmsByNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValsetConfirmsByNonceResponse.typeUrl, QueryValsetConfirmsByNonceResponse); +function createBaseQueryLastValsetRequestsRequest(): QueryLastValsetRequestsRequest { + return {}; +} +export const QueryLastValsetRequestsRequest = { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest", + is(o: any): o is QueryLastValsetRequestsRequest { + return o && o.$typeUrl === QueryLastValsetRequestsRequest.typeUrl; + }, + isAmino(o: any): o is QueryLastValsetRequestsRequestAmino { + return o && o.$typeUrl === QueryLastValsetRequestsRequest.typeUrl; + }, + encode(_: QueryLastValsetRequestsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastValsetRequestsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastValsetRequestsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryLastValsetRequestsRequest { + const message = createBaseQueryLastValsetRequestsRequest(); + return message; + }, + fromAmino(_: QueryLastValsetRequestsRequestAmino): QueryLastValsetRequestsRequest { + const message = createBaseQueryLastValsetRequestsRequest(); + return message; + }, + toAmino(_: QueryLastValsetRequestsRequest): QueryLastValsetRequestsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLastValsetRequestsRequestAminoMsg): QueryLastValsetRequestsRequest { + return QueryLastValsetRequestsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastValsetRequestsRequestProtoMsg): QueryLastValsetRequestsRequest { + return QueryLastValsetRequestsRequest.decode(message.value); + }, + toProto(message: QueryLastValsetRequestsRequest): Uint8Array { + return QueryLastValsetRequestsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastValsetRequestsRequest): QueryLastValsetRequestsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsRequest", + value: QueryLastValsetRequestsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastValsetRequestsRequest.typeUrl, QueryLastValsetRequestsRequest); +function createBaseQueryLastValsetRequestsResponse(): QueryLastValsetRequestsResponse { + return { + valsets: [] + }; +} +export const QueryLastValsetRequestsResponse = { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse", + is(o: any): o is QueryLastValsetRequestsResponse { + return o && (o.$typeUrl === QueryLastValsetRequestsResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0]))); + }, + isAmino(o: any): o is QueryLastValsetRequestsResponseAmino { + return o && (o.$typeUrl === QueryLastValsetRequestsResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0]))); + }, + encode(message: QueryLastValsetRequestsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastValsetRequestsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastValsetRequestsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastValsetRequestsResponse { + const message = createBaseQueryLastValsetRequestsResponse(); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLastValsetRequestsResponseAmino): QueryLastValsetRequestsResponse { + const message = createBaseQueryLastValsetRequestsResponse(); + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLastValsetRequestsResponse): QueryLastValsetRequestsResponseAmino { + const obj: any = {}; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + return obj; + }, + fromAminoMsg(object: QueryLastValsetRequestsResponseAminoMsg): QueryLastValsetRequestsResponse { + return QueryLastValsetRequestsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastValsetRequestsResponseProtoMsg): QueryLastValsetRequestsResponse { + return QueryLastValsetRequestsResponse.decode(message.value); + }, + toProto(message: QueryLastValsetRequestsResponse): Uint8Array { + return QueryLastValsetRequestsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastValsetRequestsResponse): QueryLastValsetRequestsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastValsetRequestsResponse", + value: QueryLastValsetRequestsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastValsetRequestsResponse.typeUrl, QueryLastValsetRequestsResponse); +function createBaseQueryLastPendingValsetRequestByAddrRequest(): QueryLastPendingValsetRequestByAddrRequest { + return { + address: "" + }; +} +export const QueryLastPendingValsetRequestByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest", + is(o: any): o is QueryLastPendingValsetRequestByAddrRequest { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastPendingValsetRequestByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastPendingValsetRequestByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingValsetRequestByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + 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: DeepPartial): QueryLastPendingValsetRequestByAddrRequest { + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastPendingValsetRequestByAddrRequestAmino): QueryLastPendingValsetRequestByAddrRequest { + const message = createBaseQueryLastPendingValsetRequestByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastPendingValsetRequestByAddrRequest): QueryLastPendingValsetRequestByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastPendingValsetRequestByAddrRequestAminoMsg): QueryLastPendingValsetRequestByAddrRequest { + return QueryLastPendingValsetRequestByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingValsetRequestByAddrRequestProtoMsg): QueryLastPendingValsetRequestByAddrRequest { + return QueryLastPendingValsetRequestByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastPendingValsetRequestByAddrRequest): Uint8Array { + return QueryLastPendingValsetRequestByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingValsetRequestByAddrRequest): QueryLastPendingValsetRequestByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrRequest", + value: QueryLastPendingValsetRequestByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingValsetRequestByAddrRequest.typeUrl, QueryLastPendingValsetRequestByAddrRequest); +function createBaseQueryLastPendingValsetRequestByAddrResponse(): QueryLastPendingValsetRequestByAddrResponse { + return { + valsets: [] + }; +} +export const QueryLastPendingValsetRequestByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse", + is(o: any): o is QueryLastPendingValsetRequestByAddrResponse { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.is(o.valsets[0]))); + }, + isAmino(o: any): o is QueryLastPendingValsetRequestByAddrResponseAmino { + return o && (o.$typeUrl === QueryLastPendingValsetRequestByAddrResponse.typeUrl || Array.isArray(o.valsets) && (!o.valsets.length || Valset.isAmino(o.valsets[0]))); + }, + encode(message: QueryLastPendingValsetRequestByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.valsets) { + Valset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingValsetRequestByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsets.push(Valset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastPendingValsetRequestByAddrResponse { + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + message.valsets = object.valsets?.map(e => Valset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLastPendingValsetRequestByAddrResponseAmino): QueryLastPendingValsetRequestByAddrResponse { + const message = createBaseQueryLastPendingValsetRequestByAddrResponse(); + message.valsets = object.valsets?.map(e => Valset.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLastPendingValsetRequestByAddrResponse): QueryLastPendingValsetRequestByAddrResponseAmino { + const obj: any = {}; + if (message.valsets) { + obj.valsets = message.valsets.map(e => e ? Valset.toAmino(e) : undefined); + } else { + obj.valsets = message.valsets; + } + return obj; + }, + fromAminoMsg(object: QueryLastPendingValsetRequestByAddrResponseAminoMsg): QueryLastPendingValsetRequestByAddrResponse { + return QueryLastPendingValsetRequestByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingValsetRequestByAddrResponseProtoMsg): QueryLastPendingValsetRequestByAddrResponse { + return QueryLastPendingValsetRequestByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastPendingValsetRequestByAddrResponse): Uint8Array { + return QueryLastPendingValsetRequestByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingValsetRequestByAddrResponse): QueryLastPendingValsetRequestByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingValsetRequestByAddrResponse", + value: QueryLastPendingValsetRequestByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingValsetRequestByAddrResponse.typeUrl, QueryLastPendingValsetRequestByAddrResponse); +function createBaseQueryBatchFeeRequest(): QueryBatchFeeRequest { + return {}; +} +export const QueryBatchFeeRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest", + is(o: any): o is QueryBatchFeeRequest { + return o && o.$typeUrl === QueryBatchFeeRequest.typeUrl; + }, + isAmino(o: any): o is QueryBatchFeeRequestAmino { + return o && o.$typeUrl === QueryBatchFeeRequest.typeUrl; + }, + encode(_: QueryBatchFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryBatchFeeRequest { + const message = createBaseQueryBatchFeeRequest(); + return message; + }, + fromAmino(_: QueryBatchFeeRequestAmino): QueryBatchFeeRequest { + const message = createBaseQueryBatchFeeRequest(); + return message; + }, + toAmino(_: QueryBatchFeeRequest): QueryBatchFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBatchFeeRequestAminoMsg): QueryBatchFeeRequest { + return QueryBatchFeeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchFeeRequestProtoMsg): QueryBatchFeeRequest { + return QueryBatchFeeRequest.decode(message.value); + }, + toProto(message: QueryBatchFeeRequest): Uint8Array { + return QueryBatchFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchFeeRequest): QueryBatchFeeRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchFeeRequest", + value: QueryBatchFeeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchFeeRequest.typeUrl, QueryBatchFeeRequest); +function createBaseQueryBatchFeeResponse(): QueryBatchFeeResponse { + return { + batchFees: [] + }; +} +export const QueryBatchFeeResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse", + is(o: any): o is QueryBatchFeeResponse { + return o && (o.$typeUrl === QueryBatchFeeResponse.typeUrl || Array.isArray(o.batchFees) && (!o.batchFees.length || BatchFees.is(o.batchFees[0]))); + }, + isAmino(o: any): o is QueryBatchFeeResponseAmino { + return o && (o.$typeUrl === QueryBatchFeeResponse.typeUrl || Array.isArray(o.batchFees) && (!o.batchFees.length || BatchFees.isAmino(o.batchFees[0]))); + }, + encode(message: QueryBatchFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.batchFees) { + BatchFees.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batchFees.push(BatchFees.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchFeeResponse { + const message = createBaseQueryBatchFeeResponse(); + message.batchFees = object.batchFees?.map(e => BatchFees.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBatchFeeResponseAmino): QueryBatchFeeResponse { + const message = createBaseQueryBatchFeeResponse(); + message.batchFees = object.batchFees?.map(e => BatchFees.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBatchFeeResponse): QueryBatchFeeResponseAmino { + const obj: any = {}; + if (message.batchFees) { + obj.batchFees = message.batchFees.map(e => e ? BatchFees.toAmino(e) : undefined); + } else { + obj.batchFees = message.batchFees; + } + return obj; + }, + fromAminoMsg(object: QueryBatchFeeResponseAminoMsg): QueryBatchFeeResponse { + return QueryBatchFeeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchFeeResponseProtoMsg): QueryBatchFeeResponse { + return QueryBatchFeeResponse.decode(message.value); + }, + toProto(message: QueryBatchFeeResponse): Uint8Array { + return QueryBatchFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchFeeResponse): QueryBatchFeeResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchFeeResponse", + value: QueryBatchFeeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchFeeResponse.typeUrl, QueryBatchFeeResponse); +function createBaseQueryLastPendingBatchRequestByAddrRequest(): QueryLastPendingBatchRequestByAddrRequest { + return { + address: "" + }; +} +export const QueryLastPendingBatchRequestByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest", + is(o: any): o is QueryLastPendingBatchRequestByAddrRequest { + return o && (o.$typeUrl === QueryLastPendingBatchRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastPendingBatchRequestByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastPendingBatchRequestByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastPendingBatchRequestByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingBatchRequestByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + 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: DeepPartial): QueryLastPendingBatchRequestByAddrRequest { + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastPendingBatchRequestByAddrRequestAmino): QueryLastPendingBatchRequestByAddrRequest { + const message = createBaseQueryLastPendingBatchRequestByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastPendingBatchRequestByAddrRequest): QueryLastPendingBatchRequestByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastPendingBatchRequestByAddrRequestAminoMsg): QueryLastPendingBatchRequestByAddrRequest { + return QueryLastPendingBatchRequestByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingBatchRequestByAddrRequestProtoMsg): QueryLastPendingBatchRequestByAddrRequest { + return QueryLastPendingBatchRequestByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastPendingBatchRequestByAddrRequest): Uint8Array { + return QueryLastPendingBatchRequestByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingBatchRequestByAddrRequest): QueryLastPendingBatchRequestByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrRequest", + value: QueryLastPendingBatchRequestByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingBatchRequestByAddrRequest.typeUrl, QueryLastPendingBatchRequestByAddrRequest); +function createBaseQueryLastPendingBatchRequestByAddrResponse(): QueryLastPendingBatchRequestByAddrResponse { + return { + batch: undefined + }; +} +export const QueryLastPendingBatchRequestByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse", + is(o: any): o is QueryLastPendingBatchRequestByAddrResponse { + return o && o.$typeUrl === QueryLastPendingBatchRequestByAddrResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastPendingBatchRequestByAddrResponseAmino { + return o && o.$typeUrl === QueryLastPendingBatchRequestByAddrResponse.typeUrl; + }, + encode(message: QueryLastPendingBatchRequestByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batch !== undefined) { + OutgoingTxBatch.encode(message.batch, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastPendingBatchRequestByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = OutgoingTxBatch.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastPendingBatchRequestByAddrResponse { + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + message.batch = object.batch !== undefined && object.batch !== null ? OutgoingTxBatch.fromPartial(object.batch) : undefined; + return message; + }, + fromAmino(object: QueryLastPendingBatchRequestByAddrResponseAmino): QueryLastPendingBatchRequestByAddrResponse { + const message = createBaseQueryLastPendingBatchRequestByAddrResponse(); + if (object.batch !== undefined && object.batch !== null) { + message.batch = OutgoingTxBatch.fromAmino(object.batch); + } + return message; + }, + toAmino(message: QueryLastPendingBatchRequestByAddrResponse): QueryLastPendingBatchRequestByAddrResponseAmino { + const obj: any = {}; + obj.batch = message.batch ? OutgoingTxBatch.toAmino(message.batch) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastPendingBatchRequestByAddrResponseAminoMsg): QueryLastPendingBatchRequestByAddrResponse { + return QueryLastPendingBatchRequestByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastPendingBatchRequestByAddrResponseProtoMsg): QueryLastPendingBatchRequestByAddrResponse { + return QueryLastPendingBatchRequestByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastPendingBatchRequestByAddrResponse): Uint8Array { + return QueryLastPendingBatchRequestByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastPendingBatchRequestByAddrResponse): QueryLastPendingBatchRequestByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastPendingBatchRequestByAddrResponse", + value: QueryLastPendingBatchRequestByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastPendingBatchRequestByAddrResponse.typeUrl, QueryLastPendingBatchRequestByAddrResponse); +function createBaseQueryOutgoingTxBatchesRequest(): QueryOutgoingTxBatchesRequest { + return {}; +} +export const QueryOutgoingTxBatchesRequest = { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest", + is(o: any): o is QueryOutgoingTxBatchesRequest { + return o && o.$typeUrl === QueryOutgoingTxBatchesRequest.typeUrl; + }, + isAmino(o: any): o is QueryOutgoingTxBatchesRequestAmino { + return o && o.$typeUrl === QueryOutgoingTxBatchesRequest.typeUrl; + }, + encode(_: QueryOutgoingTxBatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOutgoingTxBatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOutgoingTxBatchesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryOutgoingTxBatchesRequest { + const message = createBaseQueryOutgoingTxBatchesRequest(); + return message; + }, + fromAmino(_: QueryOutgoingTxBatchesRequestAmino): QueryOutgoingTxBatchesRequest { + const message = createBaseQueryOutgoingTxBatchesRequest(); + return message; + }, + toAmino(_: QueryOutgoingTxBatchesRequest): QueryOutgoingTxBatchesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryOutgoingTxBatchesRequestAminoMsg): QueryOutgoingTxBatchesRequest { + return QueryOutgoingTxBatchesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOutgoingTxBatchesRequestProtoMsg): QueryOutgoingTxBatchesRequest { + return QueryOutgoingTxBatchesRequest.decode(message.value); + }, + toProto(message: QueryOutgoingTxBatchesRequest): Uint8Array { + return QueryOutgoingTxBatchesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOutgoingTxBatchesRequest): QueryOutgoingTxBatchesRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesRequest", + value: QueryOutgoingTxBatchesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOutgoingTxBatchesRequest.typeUrl, QueryOutgoingTxBatchesRequest); +function createBaseQueryOutgoingTxBatchesResponse(): QueryOutgoingTxBatchesResponse { + return { + batches: [] + }; +} +export const QueryOutgoingTxBatchesResponse = { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse", + is(o: any): o is QueryOutgoingTxBatchesResponse { + return o && (o.$typeUrl === QueryOutgoingTxBatchesResponse.typeUrl || Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.is(o.batches[0]))); + }, + isAmino(o: any): o is QueryOutgoingTxBatchesResponseAmino { + return o && (o.$typeUrl === QueryOutgoingTxBatchesResponse.typeUrl || Array.isArray(o.batches) && (!o.batches.length || OutgoingTxBatch.isAmino(o.batches[0]))); + }, + encode(message: QueryOutgoingTxBatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.batches) { + OutgoingTxBatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOutgoingTxBatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOutgoingTxBatchesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batches.push(OutgoingTxBatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryOutgoingTxBatchesResponse { + const message = createBaseQueryOutgoingTxBatchesResponse(); + message.batches = object.batches?.map(e => OutgoingTxBatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryOutgoingTxBatchesResponseAmino): QueryOutgoingTxBatchesResponse { + const message = createBaseQueryOutgoingTxBatchesResponse(); + message.batches = object.batches?.map(e => OutgoingTxBatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryOutgoingTxBatchesResponse): QueryOutgoingTxBatchesResponseAmino { + const obj: any = {}; + if (message.batches) { + obj.batches = message.batches.map(e => e ? OutgoingTxBatch.toAmino(e) : undefined); + } else { + obj.batches = message.batches; + } + return obj; + }, + fromAminoMsg(object: QueryOutgoingTxBatchesResponseAminoMsg): QueryOutgoingTxBatchesResponse { + return QueryOutgoingTxBatchesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOutgoingTxBatchesResponseProtoMsg): QueryOutgoingTxBatchesResponse { + return QueryOutgoingTxBatchesResponse.decode(message.value); + }, + toProto(message: QueryOutgoingTxBatchesResponse): Uint8Array { + return QueryOutgoingTxBatchesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOutgoingTxBatchesResponse): QueryOutgoingTxBatchesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryOutgoingTxBatchesResponse", + value: QueryOutgoingTxBatchesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryOutgoingTxBatchesResponse.typeUrl, QueryOutgoingTxBatchesResponse); +function createBaseQueryBatchRequestByNonceRequest(): QueryBatchRequestByNonceRequest { + return { + nonce: BigInt(0), + contractAddress: "" + }; +} +export const QueryBatchRequestByNonceRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest", + is(o: any): o is QueryBatchRequestByNonceRequest { + return o && (o.$typeUrl === QueryBatchRequestByNonceRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryBatchRequestByNonceRequestAmino { + return o && (o.$typeUrl === QueryBatchRequestByNonceRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contract_address === "string"); + }, + encode(message: QueryBatchRequestByNonceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchRequestByNonceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchRequestByNonceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchRequestByNonceRequest { + const message = createBaseQueryBatchRequestByNonceRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryBatchRequestByNonceRequestAmino): QueryBatchRequestByNonceRequest { + const message = createBaseQueryBatchRequestByNonceRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryBatchRequestByNonceRequest): QueryBatchRequestByNonceRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryBatchRequestByNonceRequestAminoMsg): QueryBatchRequestByNonceRequest { + return QueryBatchRequestByNonceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchRequestByNonceRequestProtoMsg): QueryBatchRequestByNonceRequest { + return QueryBatchRequestByNonceRequest.decode(message.value); + }, + toProto(message: QueryBatchRequestByNonceRequest): Uint8Array { + return QueryBatchRequestByNonceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchRequestByNonceRequest): QueryBatchRequestByNonceRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceRequest", + value: QueryBatchRequestByNonceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchRequestByNonceRequest.typeUrl, QueryBatchRequestByNonceRequest); +function createBaseQueryBatchRequestByNonceResponse(): QueryBatchRequestByNonceResponse { + return { + batch: undefined + }; +} +export const QueryBatchRequestByNonceResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse", + is(o: any): o is QueryBatchRequestByNonceResponse { + return o && o.$typeUrl === QueryBatchRequestByNonceResponse.typeUrl; + }, + isAmino(o: any): o is QueryBatchRequestByNonceResponseAmino { + return o && o.$typeUrl === QueryBatchRequestByNonceResponse.typeUrl; + }, + encode(message: QueryBatchRequestByNonceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batch !== undefined) { + OutgoingTxBatch.encode(message.batch, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchRequestByNonceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchRequestByNonceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = OutgoingTxBatch.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchRequestByNonceResponse { + const message = createBaseQueryBatchRequestByNonceResponse(); + message.batch = object.batch !== undefined && object.batch !== null ? OutgoingTxBatch.fromPartial(object.batch) : undefined; + return message; + }, + fromAmino(object: QueryBatchRequestByNonceResponseAmino): QueryBatchRequestByNonceResponse { + const message = createBaseQueryBatchRequestByNonceResponse(); + if (object.batch !== undefined && object.batch !== null) { + message.batch = OutgoingTxBatch.fromAmino(object.batch); + } + return message; + }, + toAmino(message: QueryBatchRequestByNonceResponse): QueryBatchRequestByNonceResponseAmino { + const obj: any = {}; + obj.batch = message.batch ? OutgoingTxBatch.toAmino(message.batch) : undefined; + return obj; + }, + fromAminoMsg(object: QueryBatchRequestByNonceResponseAminoMsg): QueryBatchRequestByNonceResponse { + return QueryBatchRequestByNonceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchRequestByNonceResponseProtoMsg): QueryBatchRequestByNonceResponse { + return QueryBatchRequestByNonceResponse.decode(message.value); + }, + toProto(message: QueryBatchRequestByNonceResponse): Uint8Array { + return QueryBatchRequestByNonceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchRequestByNonceResponse): QueryBatchRequestByNonceResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchRequestByNonceResponse", + value: QueryBatchRequestByNonceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchRequestByNonceResponse.typeUrl, QueryBatchRequestByNonceResponse); +function createBaseQueryBatchConfirmsRequest(): QueryBatchConfirmsRequest { + return { + nonce: BigInt(0), + contractAddress: "" + }; +} +export const QueryBatchConfirmsRequest = { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest", + is(o: any): o is QueryBatchConfirmsRequest { + return o && (o.$typeUrl === QueryBatchConfirmsRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryBatchConfirmsRequestAmino { + return o && (o.$typeUrl === QueryBatchConfirmsRequest.typeUrl || typeof o.nonce === "bigint" && typeof o.contract_address === "string"); + }, + encode(message: QueryBatchConfirmsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchConfirmsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchConfirmsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchConfirmsRequest { + const message = createBaseQueryBatchConfirmsRequest(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryBatchConfirmsRequestAmino): QueryBatchConfirmsRequest { + const message = createBaseQueryBatchConfirmsRequest(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryBatchConfirmsRequest): QueryBatchConfirmsRequestAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryBatchConfirmsRequestAminoMsg): QueryBatchConfirmsRequest { + return QueryBatchConfirmsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchConfirmsRequestProtoMsg): QueryBatchConfirmsRequest { + return QueryBatchConfirmsRequest.decode(message.value); + }, + toProto(message: QueryBatchConfirmsRequest): Uint8Array { + return QueryBatchConfirmsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchConfirmsRequest): QueryBatchConfirmsRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsRequest", + value: QueryBatchConfirmsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchConfirmsRequest.typeUrl, QueryBatchConfirmsRequest); +function createBaseQueryBatchConfirmsResponse(): QueryBatchConfirmsResponse { + return { + confirms: [] + }; +} +export const QueryBatchConfirmsResponse = { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse", + is(o: any): o is QueryBatchConfirmsResponse { + return o && (o.$typeUrl === QueryBatchConfirmsResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgConfirmBatch.is(o.confirms[0]))); + }, + isAmino(o: any): o is QueryBatchConfirmsResponseAmino { + return o && (o.$typeUrl === QueryBatchConfirmsResponse.typeUrl || Array.isArray(o.confirms) && (!o.confirms.length || MsgConfirmBatch.isAmino(o.confirms[0]))); + }, + encode(message: QueryBatchConfirmsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.confirms) { + MsgConfirmBatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchConfirmsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBatchConfirmsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirms.push(MsgConfirmBatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryBatchConfirmsResponse { + const message = createBaseQueryBatchConfirmsResponse(); + message.confirms = object.confirms?.map(e => MsgConfirmBatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryBatchConfirmsResponseAmino): QueryBatchConfirmsResponse { + const message = createBaseQueryBatchConfirmsResponse(); + message.confirms = object.confirms?.map(e => MsgConfirmBatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryBatchConfirmsResponse): QueryBatchConfirmsResponseAmino { + const obj: any = {}; + if (message.confirms) { + obj.confirms = message.confirms.map(e => e ? MsgConfirmBatch.toAmino(e) : undefined); + } else { + obj.confirms = message.confirms; + } + return obj; + }, + fromAminoMsg(object: QueryBatchConfirmsResponseAminoMsg): QueryBatchConfirmsResponse { + return QueryBatchConfirmsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBatchConfirmsResponseProtoMsg): QueryBatchConfirmsResponse { + return QueryBatchConfirmsResponse.decode(message.value); + }, + toProto(message: QueryBatchConfirmsResponse): Uint8Array { + return QueryBatchConfirmsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBatchConfirmsResponse): QueryBatchConfirmsResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryBatchConfirmsResponse", + value: QueryBatchConfirmsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBatchConfirmsResponse.typeUrl, QueryBatchConfirmsResponse); +function createBaseQueryLastEventByAddrRequest(): QueryLastEventByAddrRequest { + return { + address: "" + }; +} +export const QueryLastEventByAddrRequest = { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest", + is(o: any): o is QueryLastEventByAddrRequest { + return o && (o.$typeUrl === QueryLastEventByAddrRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryLastEventByAddrRequestAmino { + return o && (o.$typeUrl === QueryLastEventByAddrRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryLastEventByAddrRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastEventByAddrRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastEventByAddrRequest(); + 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: DeepPartial): QueryLastEventByAddrRequest { + const message = createBaseQueryLastEventByAddrRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryLastEventByAddrRequestAmino): QueryLastEventByAddrRequest { + const message = createBaseQueryLastEventByAddrRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryLastEventByAddrRequest): QueryLastEventByAddrRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryLastEventByAddrRequestAminoMsg): QueryLastEventByAddrRequest { + return QueryLastEventByAddrRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastEventByAddrRequestProtoMsg): QueryLastEventByAddrRequest { + return QueryLastEventByAddrRequest.decode(message.value); + }, + toProto(message: QueryLastEventByAddrRequest): Uint8Array { + return QueryLastEventByAddrRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLastEventByAddrRequest): QueryLastEventByAddrRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrRequest", + value: QueryLastEventByAddrRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastEventByAddrRequest.typeUrl, QueryLastEventByAddrRequest); +function createBaseQueryLastEventByAddrResponse(): QueryLastEventByAddrResponse { + return { + lastClaimEvent: undefined + }; +} +export const QueryLastEventByAddrResponse = { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse", + is(o: any): o is QueryLastEventByAddrResponse { + return o && o.$typeUrl === QueryLastEventByAddrResponse.typeUrl; + }, + isAmino(o: any): o is QueryLastEventByAddrResponseAmino { + return o && o.$typeUrl === QueryLastEventByAddrResponse.typeUrl; + }, + encode(message: QueryLastEventByAddrResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastClaimEvent !== undefined) { + LastClaimEvent.encode(message.lastClaimEvent, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastEventByAddrResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLastEventByAddrResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastClaimEvent = LastClaimEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryLastEventByAddrResponse { + const message = createBaseQueryLastEventByAddrResponse(); + message.lastClaimEvent = object.lastClaimEvent !== undefined && object.lastClaimEvent !== null ? LastClaimEvent.fromPartial(object.lastClaimEvent) : undefined; + return message; + }, + fromAmino(object: QueryLastEventByAddrResponseAmino): QueryLastEventByAddrResponse { + const message = createBaseQueryLastEventByAddrResponse(); + if (object.last_claim_event !== undefined && object.last_claim_event !== null) { + message.lastClaimEvent = LastClaimEvent.fromAmino(object.last_claim_event); + } + return message; + }, + toAmino(message: QueryLastEventByAddrResponse): QueryLastEventByAddrResponseAmino { + const obj: any = {}; + obj.last_claim_event = message.lastClaimEvent ? LastClaimEvent.toAmino(message.lastClaimEvent) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLastEventByAddrResponseAminoMsg): QueryLastEventByAddrResponse { + return QueryLastEventByAddrResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLastEventByAddrResponseProtoMsg): QueryLastEventByAddrResponse { + return QueryLastEventByAddrResponse.decode(message.value); + }, + toProto(message: QueryLastEventByAddrResponse): Uint8Array { + return QueryLastEventByAddrResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLastEventByAddrResponse): QueryLastEventByAddrResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryLastEventByAddrResponse", + value: QueryLastEventByAddrResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryLastEventByAddrResponse.typeUrl, QueryLastEventByAddrResponse); +function createBaseQueryERC20ToDenomRequest(): QueryERC20ToDenomRequest { + return { + erc20: "" + }; +} +export const QueryERC20ToDenomRequest = { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest", + is(o: any): o is QueryERC20ToDenomRequest { + return o && (o.$typeUrl === QueryERC20ToDenomRequest.typeUrl || typeof o.erc20 === "string"); + }, + isAmino(o: any): o is QueryERC20ToDenomRequestAmino { + return o && (o.$typeUrl === QueryERC20ToDenomRequest.typeUrl || typeof o.erc20 === "string"); + }, + encode(message: QueryERC20ToDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryERC20ToDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryERC20ToDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryERC20ToDenomRequest { + const message = createBaseQueryERC20ToDenomRequest(); + message.erc20 = object.erc20 ?? ""; + return message; + }, + fromAmino(object: QueryERC20ToDenomRequestAmino): QueryERC20ToDenomRequest { + const message = createBaseQueryERC20ToDenomRequest(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + return message; + }, + toAmino(message: QueryERC20ToDenomRequest): QueryERC20ToDenomRequestAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + return obj; + }, + fromAminoMsg(object: QueryERC20ToDenomRequestAminoMsg): QueryERC20ToDenomRequest { + return QueryERC20ToDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryERC20ToDenomRequestProtoMsg): QueryERC20ToDenomRequest { + return QueryERC20ToDenomRequest.decode(message.value); + }, + toProto(message: QueryERC20ToDenomRequest): Uint8Array { + return QueryERC20ToDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryERC20ToDenomRequest): QueryERC20ToDenomRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomRequest", + value: QueryERC20ToDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryERC20ToDenomRequest.typeUrl, QueryERC20ToDenomRequest); +function createBaseQueryERC20ToDenomResponse(): QueryERC20ToDenomResponse { + return { + denom: "", + cosmosOriginated: false + }; +} +export const QueryERC20ToDenomResponse = { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse", + is(o: any): o is QueryERC20ToDenomResponse { + return o && (o.$typeUrl === QueryERC20ToDenomResponse.typeUrl || typeof o.denom === "string" && typeof o.cosmosOriginated === "boolean"); + }, + isAmino(o: any): o is QueryERC20ToDenomResponseAmino { + return o && (o.$typeUrl === QueryERC20ToDenomResponse.typeUrl || typeof o.denom === "string" && typeof o.cosmos_originated === "boolean"); + }, + encode(message: QueryERC20ToDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.cosmosOriginated === true) { + writer.uint32(16).bool(message.cosmosOriginated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryERC20ToDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryERC20ToDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.cosmosOriginated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryERC20ToDenomResponse { + const message = createBaseQueryERC20ToDenomResponse(); + message.denom = object.denom ?? ""; + message.cosmosOriginated = object.cosmosOriginated ?? false; + return message; + }, + fromAmino(object: QueryERC20ToDenomResponseAmino): QueryERC20ToDenomResponse { + const message = createBaseQueryERC20ToDenomResponse(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cosmos_originated !== undefined && object.cosmos_originated !== null) { + message.cosmosOriginated = object.cosmos_originated; + } + return message; + }, + toAmino(message: QueryERC20ToDenomResponse): QueryERC20ToDenomResponseAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.cosmos_originated = message.cosmosOriginated === false ? undefined : message.cosmosOriginated; + return obj; + }, + fromAminoMsg(object: QueryERC20ToDenomResponseAminoMsg): QueryERC20ToDenomResponse { + return QueryERC20ToDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryERC20ToDenomResponseProtoMsg): QueryERC20ToDenomResponse { + return QueryERC20ToDenomResponse.decode(message.value); + }, + toProto(message: QueryERC20ToDenomResponse): Uint8Array { + return QueryERC20ToDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryERC20ToDenomResponse): QueryERC20ToDenomResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryERC20ToDenomResponse", + value: QueryERC20ToDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryERC20ToDenomResponse.typeUrl, QueryERC20ToDenomResponse); +function createBaseQueryDenomToERC20Request(): QueryDenomToERC20Request { + return { + denom: "" + }; +} +export const QueryDenomToERC20Request = { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request", + is(o: any): o is QueryDenomToERC20Request { + return o && (o.$typeUrl === QueryDenomToERC20Request.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomToERC20RequestAmino { + return o && (o.$typeUrl === QueryDenomToERC20Request.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomToERC20Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomToERC20Request { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomToERC20Request(); + 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: DeepPartial): QueryDenomToERC20Request { + const message = createBaseQueryDenomToERC20Request(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomToERC20RequestAmino): QueryDenomToERC20Request { + const message = createBaseQueryDenomToERC20Request(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomToERC20Request): QueryDenomToERC20RequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomToERC20RequestAminoMsg): QueryDenomToERC20Request { + return QueryDenomToERC20Request.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomToERC20RequestProtoMsg): QueryDenomToERC20Request { + return QueryDenomToERC20Request.decode(message.value); + }, + toProto(message: QueryDenomToERC20Request): Uint8Array { + return QueryDenomToERC20Request.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomToERC20Request): QueryDenomToERC20RequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Request", + value: QueryDenomToERC20Request.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomToERC20Request.typeUrl, QueryDenomToERC20Request); +function createBaseQueryDenomToERC20Response(): QueryDenomToERC20Response { + return { + erc20: "", + cosmosOriginated: false + }; +} +export const QueryDenomToERC20Response = { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response", + is(o: any): o is QueryDenomToERC20Response { + return o && (o.$typeUrl === QueryDenomToERC20Response.typeUrl || typeof o.erc20 === "string" && typeof o.cosmosOriginated === "boolean"); + }, + isAmino(o: any): o is QueryDenomToERC20ResponseAmino { + return o && (o.$typeUrl === QueryDenomToERC20Response.typeUrl || typeof o.erc20 === "string" && typeof o.cosmos_originated === "boolean"); + }, + encode(message: QueryDenomToERC20Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + if (message.cosmosOriginated === true) { + writer.uint32(16).bool(message.cosmosOriginated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomToERC20Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomToERC20Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + case 2: + message.cosmosOriginated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomToERC20Response { + const message = createBaseQueryDenomToERC20Response(); + message.erc20 = object.erc20 ?? ""; + message.cosmosOriginated = object.cosmosOriginated ?? false; + return message; + }, + fromAmino(object: QueryDenomToERC20ResponseAmino): QueryDenomToERC20Response { + const message = createBaseQueryDenomToERC20Response(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + if (object.cosmos_originated !== undefined && object.cosmos_originated !== null) { + message.cosmosOriginated = object.cosmos_originated; + } + return message; + }, + toAmino(message: QueryDenomToERC20Response): QueryDenomToERC20ResponseAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + obj.cosmos_originated = message.cosmosOriginated === false ? undefined : message.cosmosOriginated; + return obj; + }, + fromAminoMsg(object: QueryDenomToERC20ResponseAminoMsg): QueryDenomToERC20Response { + return QueryDenomToERC20Response.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomToERC20ResponseProtoMsg): QueryDenomToERC20Response { + return QueryDenomToERC20Response.decode(message.value); + }, + toProto(message: QueryDenomToERC20Response): Uint8Array { + return QueryDenomToERC20Response.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomToERC20Response): QueryDenomToERC20ResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDenomToERC20Response", + value: QueryDenomToERC20Response.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomToERC20Response.typeUrl, QueryDenomToERC20Response); +function createBaseQueryDelegateKeysByValidatorAddress(): QueryDelegateKeysByValidatorAddress { + return { + validatorAddress: "" + }; +} +export const QueryDelegateKeysByValidatorAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress", + is(o: any): o is QueryDelegateKeysByValidatorAddress { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddress.typeUrl || typeof o.validatorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByValidatorAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddress.typeUrl || typeof o.validator_address === "string"); + }, + encode(message: QueryDelegateKeysByValidatorAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByValidatorAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByValidatorAddress(); + 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: DeepPartial): QueryDelegateKeysByValidatorAddress { + const message = createBaseQueryDelegateKeysByValidatorAddress(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByValidatorAddressAmino): QueryDelegateKeysByValidatorAddress { + const message = createBaseQueryDelegateKeysByValidatorAddress(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByValidatorAddress): QueryDelegateKeysByValidatorAddressAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByValidatorAddressAminoMsg): QueryDelegateKeysByValidatorAddress { + return QueryDelegateKeysByValidatorAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByValidatorAddressProtoMsg): QueryDelegateKeysByValidatorAddress { + return QueryDelegateKeysByValidatorAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByValidatorAddress): Uint8Array { + return QueryDelegateKeysByValidatorAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByValidatorAddress): QueryDelegateKeysByValidatorAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddress", + value: QueryDelegateKeysByValidatorAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByValidatorAddress.typeUrl, QueryDelegateKeysByValidatorAddress); +function createBaseQueryDelegateKeysByValidatorAddressResponse(): QueryDelegateKeysByValidatorAddressResponse { + return { + ethAddress: "", + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByValidatorAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse", + is(o: any): o is QueryDelegateKeysByValidatorAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddressResponse.typeUrl || typeof o.ethAddress === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByValidatorAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByValidatorAddressResponse.typeUrl || typeof o.eth_address === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByValidatorAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethAddress !== "") { + writer.uint32(10).string(message.ethAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByValidatorAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByValidatorAddressResponse { + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + message.ethAddress = object.ethAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByValidatorAddressResponseAmino): QueryDelegateKeysByValidatorAddressResponse { + const message = createBaseQueryDelegateKeysByValidatorAddressResponse(); + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByValidatorAddressResponse): QueryDelegateKeysByValidatorAddressResponseAmino { + const obj: any = {}; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByValidatorAddressResponseAminoMsg): QueryDelegateKeysByValidatorAddressResponse { + return QueryDelegateKeysByValidatorAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByValidatorAddressResponseProtoMsg): QueryDelegateKeysByValidatorAddressResponse { + return QueryDelegateKeysByValidatorAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByValidatorAddressResponse): Uint8Array { + return QueryDelegateKeysByValidatorAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByValidatorAddressResponse): QueryDelegateKeysByValidatorAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByValidatorAddressResponse", + value: QueryDelegateKeysByValidatorAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByValidatorAddressResponse.typeUrl, QueryDelegateKeysByValidatorAddressResponse); +function createBaseQueryDelegateKeysByEthAddress(): QueryDelegateKeysByEthAddress { + return { + ethAddress: "" + }; +} +export const QueryDelegateKeysByEthAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress", + is(o: any): o is QueryDelegateKeysByEthAddress { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddress.typeUrl || typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByEthAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddress.typeUrl || typeof o.eth_address === "string"); + }, + encode(message: QueryDelegateKeysByEthAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethAddress !== "") { + writer.uint32(10).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByEthAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByEthAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByEthAddress { + const message = createBaseQueryDelegateKeysByEthAddress(); + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByEthAddressAmino): QueryDelegateKeysByEthAddress { + const message = createBaseQueryDelegateKeysByEthAddress(); + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByEthAddress): QueryDelegateKeysByEthAddressAmino { + const obj: any = {}; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByEthAddressAminoMsg): QueryDelegateKeysByEthAddress { + return QueryDelegateKeysByEthAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByEthAddressProtoMsg): QueryDelegateKeysByEthAddress { + return QueryDelegateKeysByEthAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByEthAddress): Uint8Array { + return QueryDelegateKeysByEthAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByEthAddress): QueryDelegateKeysByEthAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddress", + value: QueryDelegateKeysByEthAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByEthAddress.typeUrl, QueryDelegateKeysByEthAddress); +function createBaseQueryDelegateKeysByEthAddressResponse(): QueryDelegateKeysByEthAddressResponse { + return { + validatorAddress: "", + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByEthAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse", + is(o: any): o is QueryDelegateKeysByEthAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddressResponse.typeUrl || typeof o.validatorAddress === "string" && typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByEthAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByEthAddressResponse.typeUrl || typeof o.validator_address === "string" && typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByEthAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.orchestratorAddress !== "") { + writer.uint32(18).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByEthAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByEthAddressResponse { + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + message.validatorAddress = object.validatorAddress ?? ""; + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByEthAddressResponseAmino): QueryDelegateKeysByEthAddressResponse { + const message = createBaseQueryDelegateKeysByEthAddressResponse(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByEthAddressResponse): QueryDelegateKeysByEthAddressResponseAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByEthAddressResponseAminoMsg): QueryDelegateKeysByEthAddressResponse { + return QueryDelegateKeysByEthAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByEthAddressResponseProtoMsg): QueryDelegateKeysByEthAddressResponse { + return QueryDelegateKeysByEthAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByEthAddressResponse): Uint8Array { + return QueryDelegateKeysByEthAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByEthAddressResponse): QueryDelegateKeysByEthAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByEthAddressResponse", + value: QueryDelegateKeysByEthAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByEthAddressResponse.typeUrl, QueryDelegateKeysByEthAddressResponse); +function createBaseQueryDelegateKeysByOrchestratorAddress(): QueryDelegateKeysByOrchestratorAddress { + return { + orchestratorAddress: "" + }; +} +export const QueryDelegateKeysByOrchestratorAddress = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress", + is(o: any): o is QueryDelegateKeysByOrchestratorAddress { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddress.typeUrl || typeof o.orchestratorAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByOrchestratorAddressAmino { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddress.typeUrl || typeof o.orchestrator_address === "string"); + }, + encode(message: QueryDelegateKeysByOrchestratorAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orchestratorAddress !== "") { + writer.uint32(10).string(message.orchestratorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByOrchestratorAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orchestratorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByOrchestratorAddress { + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + message.orchestratorAddress = object.orchestratorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByOrchestratorAddressAmino): QueryDelegateKeysByOrchestratorAddress { + const message = createBaseQueryDelegateKeysByOrchestratorAddress(); + if (object.orchestrator_address !== undefined && object.orchestrator_address !== null) { + message.orchestratorAddress = object.orchestrator_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByOrchestratorAddress): QueryDelegateKeysByOrchestratorAddressAmino { + const obj: any = {}; + obj.orchestrator_address = message.orchestratorAddress === "" ? undefined : message.orchestratorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByOrchestratorAddressAminoMsg): QueryDelegateKeysByOrchestratorAddress { + return QueryDelegateKeysByOrchestratorAddress.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByOrchestratorAddressProtoMsg): QueryDelegateKeysByOrchestratorAddress { + return QueryDelegateKeysByOrchestratorAddress.decode(message.value); + }, + toProto(message: QueryDelegateKeysByOrchestratorAddress): Uint8Array { + return QueryDelegateKeysByOrchestratorAddress.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByOrchestratorAddress): QueryDelegateKeysByOrchestratorAddressProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddress", + value: QueryDelegateKeysByOrchestratorAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByOrchestratorAddress.typeUrl, QueryDelegateKeysByOrchestratorAddress); +function createBaseQueryDelegateKeysByOrchestratorAddressResponse(): QueryDelegateKeysByOrchestratorAddressResponse { + return { + validatorAddress: "", + ethAddress: "" + }; +} +export const QueryDelegateKeysByOrchestratorAddressResponse = { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse", + is(o: any): o is QueryDelegateKeysByOrchestratorAddressResponse { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddressResponse.typeUrl || typeof o.validatorAddress === "string" && typeof o.ethAddress === "string"); + }, + isAmino(o: any): o is QueryDelegateKeysByOrchestratorAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegateKeysByOrchestratorAddressResponse.typeUrl || typeof o.validator_address === "string" && typeof o.eth_address === "string"); + }, + encode(message: QueryDelegateKeysByOrchestratorAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.ethAddress !== "") { + writer.uint32(18).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegateKeysByOrchestratorAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDelegateKeysByOrchestratorAddressResponse { + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + message.validatorAddress = object.validatorAddress ?? ""; + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegateKeysByOrchestratorAddressResponseAmino): QueryDelegateKeysByOrchestratorAddressResponse { + const message = createBaseQueryDelegateKeysByOrchestratorAddressResponse(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: QueryDelegateKeysByOrchestratorAddressResponse): QueryDelegateKeysByOrchestratorAddressResponseAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegateKeysByOrchestratorAddressResponseAminoMsg): QueryDelegateKeysByOrchestratorAddressResponse { + return QueryDelegateKeysByOrchestratorAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegateKeysByOrchestratorAddressResponseProtoMsg): QueryDelegateKeysByOrchestratorAddressResponse { + return QueryDelegateKeysByOrchestratorAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegateKeysByOrchestratorAddressResponse): Uint8Array { + return QueryDelegateKeysByOrchestratorAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegateKeysByOrchestratorAddressResponse): QueryDelegateKeysByOrchestratorAddressResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryDelegateKeysByOrchestratorAddressResponse", + value: QueryDelegateKeysByOrchestratorAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDelegateKeysByOrchestratorAddressResponse.typeUrl, QueryDelegateKeysByOrchestratorAddressResponse); +function createBaseQueryPendingSendToEth(): QueryPendingSendToEth { + return { + senderAddress: "" + }; +} +export const QueryPendingSendToEth = { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth", + is(o: any): o is QueryPendingSendToEth { + return o && (o.$typeUrl === QueryPendingSendToEth.typeUrl || typeof o.senderAddress === "string"); + }, + isAmino(o: any): o is QueryPendingSendToEthAmino { + return o && (o.$typeUrl === QueryPendingSendToEth.typeUrl || typeof o.sender_address === "string"); + }, + encode(message: QueryPendingSendToEth, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.senderAddress !== "") { + writer.uint32(10).string(message.senderAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingSendToEth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingSendToEth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingSendToEth { + const message = createBaseQueryPendingSendToEth(); + message.senderAddress = object.senderAddress ?? ""; + return message; + }, + fromAmino(object: QueryPendingSendToEthAmino): QueryPendingSendToEth { + const message = createBaseQueryPendingSendToEth(); + if (object.sender_address !== undefined && object.sender_address !== null) { + message.senderAddress = object.sender_address; + } + return message; + }, + toAmino(message: QueryPendingSendToEth): QueryPendingSendToEthAmino { + const obj: any = {}; + obj.sender_address = message.senderAddress === "" ? undefined : message.senderAddress; + return obj; + }, + fromAminoMsg(object: QueryPendingSendToEthAminoMsg): QueryPendingSendToEth { + return QueryPendingSendToEth.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingSendToEthProtoMsg): QueryPendingSendToEth { + return QueryPendingSendToEth.decode(message.value); + }, + toProto(message: QueryPendingSendToEth): Uint8Array { + return QueryPendingSendToEth.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingSendToEth): QueryPendingSendToEthProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEth", + value: QueryPendingSendToEth.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingSendToEth.typeUrl, QueryPendingSendToEth); +function createBaseQueryPendingSendToEthResponse(): QueryPendingSendToEthResponse { + return { + transfersInBatches: [], + unbatchedTransfers: [] + }; +} +export const QueryPendingSendToEthResponse = { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse", + is(o: any): o is QueryPendingSendToEthResponse { + return o && (o.$typeUrl === QueryPendingSendToEthResponse.typeUrl || Array.isArray(o.transfersInBatches) && (!o.transfersInBatches.length || OutgoingTransferTx.is(o.transfersInBatches[0])) && Array.isArray(o.unbatchedTransfers) && (!o.unbatchedTransfers.length || OutgoingTransferTx.is(o.unbatchedTransfers[0]))); + }, + isAmino(o: any): o is QueryPendingSendToEthResponseAmino { + return o && (o.$typeUrl === QueryPendingSendToEthResponse.typeUrl || Array.isArray(o.transfers_in_batches) && (!o.transfers_in_batches.length || OutgoingTransferTx.isAmino(o.transfers_in_batches[0])) && Array.isArray(o.unbatched_transfers) && (!o.unbatched_transfers.length || OutgoingTransferTx.isAmino(o.unbatched_transfers[0]))); + }, + encode(message: QueryPendingSendToEthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.transfersInBatches) { + OutgoingTransferTx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.unbatchedTransfers) { + OutgoingTransferTx.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingSendToEthResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingSendToEthResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transfersInBatches.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + case 2: + message.unbatchedTransfers.push(OutgoingTransferTx.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryPendingSendToEthResponse { + const message = createBaseQueryPendingSendToEthResponse(); + message.transfersInBatches = object.transfersInBatches?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + message.unbatchedTransfers = object.unbatchedTransfers?.map(e => OutgoingTransferTx.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPendingSendToEthResponseAmino): QueryPendingSendToEthResponse { + const message = createBaseQueryPendingSendToEthResponse(); + message.transfersInBatches = object.transfers_in_batches?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + message.unbatchedTransfers = object.unbatched_transfers?.map(e => OutgoingTransferTx.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPendingSendToEthResponse): QueryPendingSendToEthResponseAmino { + const obj: any = {}; + if (message.transfersInBatches) { + obj.transfers_in_batches = message.transfersInBatches.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.transfers_in_batches = message.transfersInBatches; + } + if (message.unbatchedTransfers) { + obj.unbatched_transfers = message.unbatchedTransfers.map(e => e ? OutgoingTransferTx.toAmino(e) : undefined); + } else { + obj.unbatched_transfers = message.unbatchedTransfers; + } + return obj; + }, + fromAminoMsg(object: QueryPendingSendToEthResponseAminoMsg): QueryPendingSendToEthResponse { + return QueryPendingSendToEthResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingSendToEthResponseProtoMsg): QueryPendingSendToEthResponse { + return QueryPendingSendToEthResponse.decode(message.value); + }, + toProto(message: QueryPendingSendToEthResponse): Uint8Array { + return QueryPendingSendToEthResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingSendToEthResponse): QueryPendingSendToEthResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryPendingSendToEthResponse", + value: QueryPendingSendToEthResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryPendingSendToEthResponse.typeUrl, QueryPendingSendToEthResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseMissingNoncesRequest(): MissingNoncesRequest { + return {}; +} +export const MissingNoncesRequest = { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest", + is(o: any): o is MissingNoncesRequest { + return o && o.$typeUrl === MissingNoncesRequest.typeUrl; + }, + isAmino(o: any): o is MissingNoncesRequestAmino { + return o && o.$typeUrl === MissingNoncesRequest.typeUrl; + }, + encode(_: MissingNoncesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MissingNoncesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMissingNoncesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MissingNoncesRequest { + const message = createBaseMissingNoncesRequest(); + return message; + }, + fromAmino(_: MissingNoncesRequestAmino): MissingNoncesRequest { + const message = createBaseMissingNoncesRequest(); + return message; + }, + toAmino(_: MissingNoncesRequest): MissingNoncesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MissingNoncesRequestAminoMsg): MissingNoncesRequest { + return MissingNoncesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MissingNoncesRequestProtoMsg): MissingNoncesRequest { + return MissingNoncesRequest.decode(message.value); + }, + toProto(message: MissingNoncesRequest): Uint8Array { + return MissingNoncesRequest.encode(message).finish(); + }, + toProtoMsg(message: MissingNoncesRequest): MissingNoncesRequestProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MissingNoncesRequest", + value: MissingNoncesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MissingNoncesRequest.typeUrl, MissingNoncesRequest); +function createBaseMissingNoncesResponse(): MissingNoncesResponse { + return { + operatorAddresses: [] + }; +} +export const MissingNoncesResponse = { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse", + is(o: any): o is MissingNoncesResponse { + return o && (o.$typeUrl === MissingNoncesResponse.typeUrl || Array.isArray(o.operatorAddresses) && (!o.operatorAddresses.length || typeof o.operatorAddresses[0] === "string")); + }, + isAmino(o: any): o is MissingNoncesResponseAmino { + return o && (o.$typeUrl === MissingNoncesResponse.typeUrl || Array.isArray(o.operator_addresses) && (!o.operator_addresses.length || typeof o.operator_addresses[0] === "string")); + }, + encode(message: MissingNoncesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.operatorAddresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MissingNoncesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMissingNoncesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MissingNoncesResponse { + const message = createBaseMissingNoncesResponse(); + message.operatorAddresses = object.operatorAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: MissingNoncesResponseAmino): MissingNoncesResponse { + const message = createBaseMissingNoncesResponse(); + message.operatorAddresses = object.operator_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MissingNoncesResponse): MissingNoncesResponseAmino { + const obj: any = {}; + if (message.operatorAddresses) { + obj.operator_addresses = message.operatorAddresses.map(e => e); + } else { + obj.operator_addresses = message.operatorAddresses; + } + return obj; + }, + fromAminoMsg(object: MissingNoncesResponseAminoMsg): MissingNoncesResponse { + return MissingNoncesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MissingNoncesResponseProtoMsg): MissingNoncesResponse { + return MissingNoncesResponse.decode(message.value); + }, + toProto(message: MissingNoncesResponse): Uint8Array { + return MissingNoncesResponse.encode(message).finish(); + }, + toProtoMsg(message: MissingNoncesResponse): MissingNoncesResponseProtoMsg { + return { + typeUrl: "/injective.peggy.v1.MissingNoncesResponse", + value: MissingNoncesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MissingNoncesResponse.typeUrl, MissingNoncesResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/peggy/v1/types.ts b/libs/injectivejs/src/injective/peggy/v1/types.ts new file mode 100644 index 00000000..37fbe06a --- /dev/null +++ b/libs/injectivejs/src/injective/peggy/v1/types.ts @@ -0,0 +1,575 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** BridgeValidator represents a validator's ETH address and its power */ +export interface BridgeValidator { + power: bigint; + ethereumAddress: string; +} +export interface BridgeValidatorProtoMsg { + typeUrl: "/injective.peggy.v1.BridgeValidator"; + value: Uint8Array; +} +/** BridgeValidator represents a validator's ETH address and its power */ +export interface BridgeValidatorAmino { + power: string; + ethereum_address: string; +} +export interface BridgeValidatorAminoMsg { + type: "/injective.peggy.v1.BridgeValidator"; + value: BridgeValidatorAmino; +} +/** + * Valset is the Ethereum Bridge Multsig Set, each peggy validator also + * maintains an ETH key to sign messages, these are used to check signatures on + * ETH because of the significant gas savings + */ +export interface Valset { + nonce: bigint; + members: BridgeValidator[]; + height: bigint; + rewardAmount: string; + /** the reward token in it's Ethereum hex address representation */ + rewardToken: string; +} +export interface ValsetProtoMsg { + typeUrl: "/injective.peggy.v1.Valset"; + value: Uint8Array; +} +/** + * Valset is the Ethereum Bridge Multsig Set, each peggy validator also + * maintains an ETH key to sign messages, these are used to check signatures on + * ETH because of the significant gas savings + */ +export interface ValsetAmino { + nonce: string; + members: BridgeValidatorAmino[]; + height: string; + reward_amount: string; + /** the reward token in it's Ethereum hex address representation */ + reward_token: string; +} +export interface ValsetAminoMsg { + type: "/injective.peggy.v1.Valset"; + value: ValsetAmino; +} +/** + * LastObservedEthereumBlockHeight stores the last observed + * Ethereum block height along with the Cosmos block height that + * it was observed at. These two numbers can be used to project + * outward and always produce batches with timeouts in the future + * even if no Ethereum block height has been relayed for a long time + */ +export interface LastObservedEthereumBlockHeight { + cosmosBlockHeight: bigint; + ethereumBlockHeight: bigint; +} +export interface LastObservedEthereumBlockHeightProtoMsg { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight"; + value: Uint8Array; +} +/** + * LastObservedEthereumBlockHeight stores the last observed + * Ethereum block height along with the Cosmos block height that + * it was observed at. These two numbers can be used to project + * outward and always produce batches with timeouts in the future + * even if no Ethereum block height has been relayed for a long time + */ +export interface LastObservedEthereumBlockHeightAmino { + cosmos_block_height: string; + ethereum_block_height: string; +} +export interface LastObservedEthereumBlockHeightAminoMsg { + type: "/injective.peggy.v1.LastObservedEthereumBlockHeight"; + value: LastObservedEthereumBlockHeightAmino; +} +/** LastClaimEvent stores last claim event details of validator. */ +export interface LastClaimEvent { + ethereumEventNonce: bigint; + ethereumEventHeight: bigint; +} +export interface LastClaimEventProtoMsg { + typeUrl: "/injective.peggy.v1.LastClaimEvent"; + value: Uint8Array; +} +/** LastClaimEvent stores last claim event details of validator. */ +export interface LastClaimEventAmino { + ethereum_event_nonce: string; + ethereum_event_height: string; +} +export interface LastClaimEventAminoMsg { + type: "/injective.peggy.v1.LastClaimEvent"; + value: LastClaimEventAmino; +} +/** + * This records the relationship between an ERC20 token and the denom + * of the corresponding Cosmos originated asset + */ +export interface ERC20ToDenom { + erc20: string; + denom: string; +} +export interface ERC20ToDenomProtoMsg { + typeUrl: "/injective.peggy.v1.ERC20ToDenom"; + value: Uint8Array; +} +/** + * This records the relationship between an ERC20 token and the denom + * of the corresponding Cosmos originated asset + */ +export interface ERC20ToDenomAmino { + erc20: string; + denom: string; +} +export interface ERC20ToDenomAminoMsg { + type: "/injective.peggy.v1.ERC20ToDenom"; + value: ERC20ToDenomAmino; +} +function createBaseBridgeValidator(): BridgeValidator { + return { + power: BigInt(0), + ethereumAddress: "" + }; +} +export const BridgeValidator = { + typeUrl: "/injective.peggy.v1.BridgeValidator", + is(o: any): o is BridgeValidator { + return o && (o.$typeUrl === BridgeValidator.typeUrl || typeof o.power === "bigint" && typeof o.ethereumAddress === "string"); + }, + isAmino(o: any): o is BridgeValidatorAmino { + return o && (o.$typeUrl === BridgeValidator.typeUrl || typeof o.power === "bigint" && typeof o.ethereum_address === "string"); + }, + encode(message: BridgeValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.power !== BigInt(0)) { + writer.uint32(8).uint64(message.power); + } + if (message.ethereumAddress !== "") { + writer.uint32(18).string(message.ethereumAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BridgeValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBridgeValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.power = reader.uint64(); + break; + case 2: + message.ethereumAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BridgeValidator { + const message = createBaseBridgeValidator(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + message.ethereumAddress = object.ethereumAddress ?? ""; + return message; + }, + fromAmino(object: BridgeValidatorAmino): BridgeValidator { + const message = createBaseBridgeValidator(); + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.ethereum_address !== undefined && object.ethereum_address !== null) { + message.ethereumAddress = object.ethereum_address; + } + return message; + }, + toAmino(message: BridgeValidator): BridgeValidatorAmino { + const obj: any = {}; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + obj.ethereum_address = message.ethereumAddress === "" ? undefined : message.ethereumAddress; + return obj; + }, + fromAminoMsg(object: BridgeValidatorAminoMsg): BridgeValidator { + return BridgeValidator.fromAmino(object.value); + }, + fromProtoMsg(message: BridgeValidatorProtoMsg): BridgeValidator { + return BridgeValidator.decode(message.value); + }, + toProto(message: BridgeValidator): Uint8Array { + return BridgeValidator.encode(message).finish(); + }, + toProtoMsg(message: BridgeValidator): BridgeValidatorProtoMsg { + return { + typeUrl: "/injective.peggy.v1.BridgeValidator", + value: BridgeValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BridgeValidator.typeUrl, BridgeValidator); +function createBaseValset(): Valset { + return { + nonce: BigInt(0), + members: [], + height: BigInt(0), + rewardAmount: "", + rewardToken: "" + }; +} +export const Valset = { + typeUrl: "/injective.peggy.v1.Valset", + is(o: any): o is Valset { + return o && (o.$typeUrl === Valset.typeUrl || typeof o.nonce === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.is(o.members[0])) && typeof o.height === "bigint" && typeof o.rewardAmount === "string" && typeof o.rewardToken === "string"); + }, + isAmino(o: any): o is ValsetAmino { + return o && (o.$typeUrl === Valset.typeUrl || typeof o.nonce === "bigint" && Array.isArray(o.members) && (!o.members.length || BridgeValidator.isAmino(o.members[0])) && typeof o.height === "bigint" && typeof o.reward_amount === "string" && typeof o.reward_token === "string"); + }, + encode(message: Valset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nonce !== BigInt(0)) { + writer.uint32(8).uint64(message.nonce); + } + for (const v of message.members) { + BridgeValidator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + if (message.rewardAmount !== "") { + writer.uint32(34).string(message.rewardAmount); + } + if (message.rewardToken !== "") { + writer.uint32(42).string(message.rewardToken); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Valset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nonce = reader.uint64(); + break; + case 2: + message.members.push(BridgeValidator.decode(reader, reader.uint32())); + break; + case 3: + message.height = reader.uint64(); + break; + case 4: + message.rewardAmount = reader.string(); + break; + case 5: + message.rewardToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Valset { + const message = createBaseValset(); + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.members = object.members?.map(e => BridgeValidator.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.rewardAmount = object.rewardAmount ?? ""; + message.rewardToken = object.rewardToken ?? ""; + return message; + }, + fromAmino(object: ValsetAmino): Valset { + const message = createBaseValset(); + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + message.members = object.members?.map(e => BridgeValidator.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.reward_amount !== undefined && object.reward_amount !== null) { + message.rewardAmount = object.reward_amount; + } + if (object.reward_token !== undefined && object.reward_token !== null) { + message.rewardToken = object.reward_token; + } + return message; + }, + toAmino(message: Valset): ValsetAmino { + const obj: any = {}; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce?.toString() : undefined; + if (message.members) { + obj.members = message.members.map(e => e ? BridgeValidator.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.reward_amount = message.rewardAmount === "" ? undefined : message.rewardAmount; + obj.reward_token = message.rewardToken === "" ? undefined : message.rewardToken; + return obj; + }, + fromAminoMsg(object: ValsetAminoMsg): Valset { + return Valset.fromAmino(object.value); + }, + fromProtoMsg(message: ValsetProtoMsg): Valset { + return Valset.decode(message.value); + }, + toProto(message: Valset): Uint8Array { + return Valset.encode(message).finish(); + }, + toProtoMsg(message: Valset): ValsetProtoMsg { + return { + typeUrl: "/injective.peggy.v1.Valset", + value: Valset.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Valset.typeUrl, Valset); +function createBaseLastObservedEthereumBlockHeight(): LastObservedEthereumBlockHeight { + return { + cosmosBlockHeight: BigInt(0), + ethereumBlockHeight: BigInt(0) + }; +} +export const LastObservedEthereumBlockHeight = { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight", + is(o: any): o is LastObservedEthereumBlockHeight { + return o && (o.$typeUrl === LastObservedEthereumBlockHeight.typeUrl || typeof o.cosmosBlockHeight === "bigint" && typeof o.ethereumBlockHeight === "bigint"); + }, + isAmino(o: any): o is LastObservedEthereumBlockHeightAmino { + return o && (o.$typeUrl === LastObservedEthereumBlockHeight.typeUrl || typeof o.cosmos_block_height === "bigint" && typeof o.ethereum_block_height === "bigint"); + }, + encode(message: LastObservedEthereumBlockHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cosmosBlockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.cosmosBlockHeight); + } + if (message.ethereumBlockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.ethereumBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastObservedEthereumBlockHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastObservedEthereumBlockHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmosBlockHeight = reader.uint64(); + break; + case 2: + message.ethereumBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastObservedEthereumBlockHeight { + const message = createBaseLastObservedEthereumBlockHeight(); + message.cosmosBlockHeight = object.cosmosBlockHeight !== undefined && object.cosmosBlockHeight !== null ? BigInt(object.cosmosBlockHeight.toString()) : BigInt(0); + message.ethereumBlockHeight = object.ethereumBlockHeight !== undefined && object.ethereumBlockHeight !== null ? BigInt(object.ethereumBlockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastObservedEthereumBlockHeightAmino): LastObservedEthereumBlockHeight { + const message = createBaseLastObservedEthereumBlockHeight(); + if (object.cosmos_block_height !== undefined && object.cosmos_block_height !== null) { + message.cosmosBlockHeight = BigInt(object.cosmos_block_height); + } + if (object.ethereum_block_height !== undefined && object.ethereum_block_height !== null) { + message.ethereumBlockHeight = BigInt(object.ethereum_block_height); + } + return message; + }, + toAmino(message: LastObservedEthereumBlockHeight): LastObservedEthereumBlockHeightAmino { + const obj: any = {}; + obj.cosmos_block_height = message.cosmosBlockHeight !== BigInt(0) ? message.cosmosBlockHeight?.toString() : undefined; + obj.ethereum_block_height = message.ethereumBlockHeight !== BigInt(0) ? message.ethereumBlockHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastObservedEthereumBlockHeightAminoMsg): LastObservedEthereumBlockHeight { + return LastObservedEthereumBlockHeight.fromAmino(object.value); + }, + fromProtoMsg(message: LastObservedEthereumBlockHeightProtoMsg): LastObservedEthereumBlockHeight { + return LastObservedEthereumBlockHeight.decode(message.value); + }, + toProto(message: LastObservedEthereumBlockHeight): Uint8Array { + return LastObservedEthereumBlockHeight.encode(message).finish(); + }, + toProtoMsg(message: LastObservedEthereumBlockHeight): LastObservedEthereumBlockHeightProtoMsg { + return { + typeUrl: "/injective.peggy.v1.LastObservedEthereumBlockHeight", + value: LastObservedEthereumBlockHeight.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastObservedEthereumBlockHeight.typeUrl, LastObservedEthereumBlockHeight); +function createBaseLastClaimEvent(): LastClaimEvent { + return { + ethereumEventNonce: BigInt(0), + ethereumEventHeight: BigInt(0) + }; +} +export const LastClaimEvent = { + typeUrl: "/injective.peggy.v1.LastClaimEvent", + is(o: any): o is LastClaimEvent { + return o && (o.$typeUrl === LastClaimEvent.typeUrl || typeof o.ethereumEventNonce === "bigint" && typeof o.ethereumEventHeight === "bigint"); + }, + isAmino(o: any): o is LastClaimEventAmino { + return o && (o.$typeUrl === LastClaimEvent.typeUrl || typeof o.ethereum_event_nonce === "bigint" && typeof o.ethereum_event_height === "bigint"); + }, + encode(message: LastClaimEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ethereumEventNonce !== BigInt(0)) { + writer.uint32(8).uint64(message.ethereumEventNonce); + } + if (message.ethereumEventHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.ethereumEventHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastClaimEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastClaimEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ethereumEventNonce = reader.uint64(); + break; + case 2: + message.ethereumEventHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LastClaimEvent { + const message = createBaseLastClaimEvent(); + message.ethereumEventNonce = object.ethereumEventNonce !== undefined && object.ethereumEventNonce !== null ? BigInt(object.ethereumEventNonce.toString()) : BigInt(0); + message.ethereumEventHeight = object.ethereumEventHeight !== undefined && object.ethereumEventHeight !== null ? BigInt(object.ethereumEventHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastClaimEventAmino): LastClaimEvent { + const message = createBaseLastClaimEvent(); + if (object.ethereum_event_nonce !== undefined && object.ethereum_event_nonce !== null) { + message.ethereumEventNonce = BigInt(object.ethereum_event_nonce); + } + if (object.ethereum_event_height !== undefined && object.ethereum_event_height !== null) { + message.ethereumEventHeight = BigInt(object.ethereum_event_height); + } + return message; + }, + toAmino(message: LastClaimEvent): LastClaimEventAmino { + const obj: any = {}; + obj.ethereum_event_nonce = message.ethereumEventNonce !== BigInt(0) ? message.ethereumEventNonce?.toString() : undefined; + obj.ethereum_event_height = message.ethereumEventHeight !== BigInt(0) ? message.ethereumEventHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastClaimEventAminoMsg): LastClaimEvent { + return LastClaimEvent.fromAmino(object.value); + }, + fromProtoMsg(message: LastClaimEventProtoMsg): LastClaimEvent { + return LastClaimEvent.decode(message.value); + }, + toProto(message: LastClaimEvent): Uint8Array { + return LastClaimEvent.encode(message).finish(); + }, + toProtoMsg(message: LastClaimEvent): LastClaimEventProtoMsg { + return { + typeUrl: "/injective.peggy.v1.LastClaimEvent", + value: LastClaimEvent.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LastClaimEvent.typeUrl, LastClaimEvent); +function createBaseERC20ToDenom(): ERC20ToDenom { + return { + erc20: "", + denom: "" + }; +} +export const ERC20ToDenom = { + typeUrl: "/injective.peggy.v1.ERC20ToDenom", + is(o: any): o is ERC20ToDenom { + return o && (o.$typeUrl === ERC20ToDenom.typeUrl || typeof o.erc20 === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is ERC20ToDenomAmino { + return o && (o.$typeUrl === ERC20ToDenom.typeUrl || typeof o.erc20 === "string" && typeof o.denom === "string"); + }, + encode(message: ERC20ToDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.erc20 !== "") { + writer.uint32(10).string(message.erc20); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ERC20ToDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseERC20ToDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.erc20 = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ERC20ToDenom { + const message = createBaseERC20ToDenom(); + message.erc20 = object.erc20 ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: ERC20ToDenomAmino): ERC20ToDenom { + const message = createBaseERC20ToDenom(); + if (object.erc20 !== undefined && object.erc20 !== null) { + message.erc20 = object.erc20; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: ERC20ToDenom): ERC20ToDenomAmino { + const obj: any = {}; + obj.erc20 = message.erc20 === "" ? undefined : message.erc20; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: ERC20ToDenomAminoMsg): ERC20ToDenom { + return ERC20ToDenom.fromAmino(object.value); + }, + fromProtoMsg(message: ERC20ToDenomProtoMsg): ERC20ToDenom { + return ERC20ToDenom.decode(message.value); + }, + toProto(message: ERC20ToDenom): Uint8Array { + return ERC20ToDenom.encode(message).finish(); + }, + toProtoMsg(message: ERC20ToDenom): ERC20ToDenomProtoMsg { + return { + typeUrl: "/injective.peggy.v1.ERC20ToDenom", + value: ERC20ToDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ERC20ToDenom.typeUrl, ERC20ToDenom); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/events.ts b/libs/injectivejs/src/injective/permissions/v1beta1/events.ts new file mode 100644 index 00000000..0b4fbba0 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/events.ts @@ -0,0 +1,102 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventSetVoucher { + addr: string; + voucher: Coin; +} +export interface EventSetVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher"; + value: Uint8Array; +} +export interface EventSetVoucherAmino { + addr: string; + voucher: CoinAmino; +} +export interface EventSetVoucherAminoMsg { + type: "/injective.permissions.v1beta1.EventSetVoucher"; + value: EventSetVoucherAmino; +} +function createBaseEventSetVoucher(): EventSetVoucher { + return { + addr: "", + voucher: Coin.fromPartial({}) + }; +} +export const EventSetVoucher = { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher", + is(o: any): o is EventSetVoucher { + return o && (o.$typeUrl === EventSetVoucher.typeUrl || typeof o.addr === "string" && Coin.is(o.voucher)); + }, + isAmino(o: any): o is EventSetVoucherAmino { + return o && (o.$typeUrl === EventSetVoucher.typeUrl || typeof o.addr === "string" && Coin.isAmino(o.voucher)); + }, + encode(message: EventSetVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addr !== "") { + writer.uint32(10).string(message.addr); + } + if (message.voucher !== undefined) { + Coin.encode(message.voucher, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addr = reader.string(); + break; + case 2: + message.voucher = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetVoucher { + const message = createBaseEventSetVoucher(); + message.addr = object.addr ?? ""; + message.voucher = object.voucher !== undefined && object.voucher !== null ? Coin.fromPartial(object.voucher) : undefined; + return message; + }, + fromAmino(object: EventSetVoucherAmino): EventSetVoucher { + const message = createBaseEventSetVoucher(); + if (object.addr !== undefined && object.addr !== null) { + message.addr = object.addr; + } + if (object.voucher !== undefined && object.voucher !== null) { + message.voucher = Coin.fromAmino(object.voucher); + } + return message; + }, + toAmino(message: EventSetVoucher): EventSetVoucherAmino { + const obj: any = {}; + obj.addr = message.addr === "" ? undefined : message.addr; + obj.voucher = message.voucher ? Coin.toAmino(message.voucher) : undefined; + return obj; + }, + fromAminoMsg(object: EventSetVoucherAminoMsg): EventSetVoucher { + return EventSetVoucher.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetVoucherProtoMsg): EventSetVoucher { + return EventSetVoucher.decode(message.value); + }, + toProto(message: EventSetVoucher): Uint8Array { + return EventSetVoucher.encode(message).finish(); + }, + toProtoMsg(message: EventSetVoucher): EventSetVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.EventSetVoucher", + value: EventSetVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetVoucher.typeUrl, EventSetVoucher); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/genesis.ts b/libs/injectivejs/src/injective/permissions/v1beta1/genesis.ts new file mode 100644 index 00000000..3920fd81 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/genesis.ts @@ -0,0 +1,109 @@ +import { Params, ParamsAmino } from "./params"; +import { Namespace, NamespaceAmino } from "./permissions"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the permissions module's genesis state. */ +export interface GenesisState { + /** params defines the parameters of the module. */ + params: Params; + namespaces: Namespace[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.permissions.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the permissions module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the parameters of the module. */ + params: ParamsAmino; + namespaces: NamespaceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.permissions.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + namespaces: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.permissions.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.is(o.namespaces[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.isAmino(o.namespaces[0]))); + }, + 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.namespaces) { + Namespace.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.namespaces.push(Namespace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.namespaces = object.namespaces?.map(e => Namespace.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.namespaces = object.namespaces?.map(e => Namespace.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.namespaces) { + obj.namespaces = message.namespaces.map(e => e ? Namespace.toAmino(e) : undefined); + } else { + obj.namespaces = message.namespaces; + } + 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: "/injective.permissions.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/params.ts b/libs/injectivejs/src/injective/permissions/v1beta1/params.ts new file mode 100644 index 00000000..24aa6bb5 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/params.ts @@ -0,0 +1,97 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Params defines the parameters for the permissions module. */ +export interface Params { + wasmHookQueryMaxGas: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the permissions module. */ +export interface ParamsAmino { + wasm_hook_query_max_gas: string; +} +export interface ParamsAminoMsg { + type: "permissions/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + wasmHookQueryMaxGas: BigInt(0) + }; +} +export const Params = { + typeUrl: "/injective.permissions.v1beta1.Params", + aminoType: "permissions/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.wasmHookQueryMaxGas === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.wasm_hook_query_max_gas === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.wasmHookQueryMaxGas !== BigInt(0)) { + writer.uint32(8).uint64(message.wasmHookQueryMaxGas); + } + 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.wasmHookQueryMaxGas = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.wasmHookQueryMaxGas = object.wasmHookQueryMaxGas !== undefined && object.wasmHookQueryMaxGas !== null ? BigInt(object.wasmHookQueryMaxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.wasm_hook_query_max_gas !== undefined && object.wasm_hook_query_max_gas !== null) { + message.wasmHookQueryMaxGas = BigInt(object.wasm_hook_query_max_gas); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.wasm_hook_query_max_gas = message.wasmHookQueryMaxGas !== BigInt(0) ? message.wasmHookQueryMaxGas?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "permissions/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: "/injective.permissions.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/permissions.ts b/libs/injectivejs/src/injective/permissions/v1beta1/permissions.ts new file mode 100644 index 00000000..6cd42f27 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/permissions.ts @@ -0,0 +1,709 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** each Action enum value should be a power of two */ +export enum Action { + UNSPECIFIED = 0, + MINT = 1, + RECEIVE = 2, + BURN = 4, + UNRECOGNIZED = -1, +} +export const ActionAmino = Action; +export function actionFromJSON(object: any): Action { + switch (object) { + case 0: + case "UNSPECIFIED": + return Action.UNSPECIFIED; + case 1: + case "MINT": + return Action.MINT; + case 2: + case "RECEIVE": + return Action.RECEIVE; + case 4: + case "BURN": + return Action.BURN; + case -1: + case "UNRECOGNIZED": + default: + return Action.UNRECOGNIZED; + } +} +export function actionToJSON(object: Action): string { + switch (object) { + case Action.UNSPECIFIED: + return "UNSPECIFIED"; + case Action.MINT: + return "MINT"; + case Action.RECEIVE: + return "RECEIVE"; + case Action.BURN: + return "BURN"; + case Action.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Namespace defines a permissions namespace */ +export interface Namespace { + /** tokenfactory denom to which this namespace applies to */ + denom: string; + /** address of smart contract to apply code-based restrictions */ + wasmHook: string; + mintsPaused: boolean; + sendsPaused: boolean; + burnsPaused: boolean; + /** permissions for each role */ + rolePermissions: Role[]; + addressRoles: AddressRoles[]; +} +export interface NamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Namespace"; + value: Uint8Array; +} +/** Namespace defines a permissions namespace */ +export interface NamespaceAmino { + /** tokenfactory denom to which this namespace applies to */ + denom: string; + /** address of smart contract to apply code-based restrictions */ + wasm_hook: string; + mints_paused: boolean; + sends_paused: boolean; + burns_paused: boolean; + /** permissions for each role */ + role_permissions: RoleAmino[]; + address_roles: AddressRolesAmino[]; +} +export interface NamespaceAminoMsg { + type: "/injective.permissions.v1beta1.Namespace"; + value: NamespaceAmino; +} +export interface AddressRoles { + address: string; + roles: string[]; +} +export interface AddressRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.AddressRoles"; + value: Uint8Array; +} +export interface AddressRolesAmino { + address: string; + roles: string[]; +} +export interface AddressRolesAminoMsg { + type: "/injective.permissions.v1beta1.AddressRoles"; + value: AddressRolesAmino; +} +/** Role is only used for storage */ +export interface Role { + role: string; + permissions: number; +} +export interface RoleProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Role"; + value: Uint8Array; +} +/** Role is only used for storage */ +export interface RoleAmino { + role: string; + permissions: number; +} +export interface RoleAminoMsg { + type: "/injective.permissions.v1beta1.Role"; + value: RoleAmino; +} +/** used in storage */ +export interface RoleIDs { + roleIds: number[]; +} +export interface RoleIDsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.RoleIDs"; + value: Uint8Array; +} +/** used in storage */ +export interface RoleIDsAmino { + role_ids: number[]; +} +export interface RoleIDsAminoMsg { + type: "/injective.permissions.v1beta1.RoleIDs"; + value: RoleIDsAmino; +} +export interface Voucher { + coins: Coin[]; +} +export interface VoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.Voucher"; + value: Uint8Array; +} +export interface VoucherAmino { + coins: CoinAmino[]; +} +export interface VoucherAminoMsg { + type: "/injective.permissions.v1beta1.Voucher"; + value: VoucherAmino; +} +export interface AddressVoucher { + address: string; + voucher?: Voucher; +} +export interface AddressVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher"; + value: Uint8Array; +} +export interface AddressVoucherAmino { + address: string; + voucher?: VoucherAmino; +} +export interface AddressVoucherAminoMsg { + type: "/injective.permissions.v1beta1.AddressVoucher"; + value: AddressVoucherAmino; +} +function createBaseNamespace(): Namespace { + return { + denom: "", + wasmHook: "", + mintsPaused: false, + sendsPaused: false, + burnsPaused: false, + rolePermissions: [], + addressRoles: [] + }; +} +export const Namespace = { + typeUrl: "/injective.permissions.v1beta1.Namespace", + is(o: any): o is Namespace { + return o && (o.$typeUrl === Namespace.typeUrl || typeof o.denom === "string" && typeof o.wasmHook === "string" && typeof o.mintsPaused === "boolean" && typeof o.sendsPaused === "boolean" && typeof o.burnsPaused === "boolean" && Array.isArray(o.rolePermissions) && (!o.rolePermissions.length || Role.is(o.rolePermissions[0])) && Array.isArray(o.addressRoles) && (!o.addressRoles.length || AddressRoles.is(o.addressRoles[0]))); + }, + isAmino(o: any): o is NamespaceAmino { + return o && (o.$typeUrl === Namespace.typeUrl || typeof o.denom === "string" && typeof o.wasm_hook === "string" && typeof o.mints_paused === "boolean" && typeof o.sends_paused === "boolean" && typeof o.burns_paused === "boolean" && Array.isArray(o.role_permissions) && (!o.role_permissions.length || Role.isAmino(o.role_permissions[0])) && Array.isArray(o.address_roles) && (!o.address_roles.length || AddressRoles.isAmino(o.address_roles[0]))); + }, + encode(message: Namespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.wasmHook !== "") { + writer.uint32(18).string(message.wasmHook); + } + if (message.mintsPaused === true) { + writer.uint32(24).bool(message.mintsPaused); + } + if (message.sendsPaused === true) { + writer.uint32(32).bool(message.sendsPaused); + } + if (message.burnsPaused === true) { + writer.uint32(40).bool(message.burnsPaused); + } + for (const v of message.rolePermissions) { + Role.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.addressRoles) { + AddressRoles.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Namespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.wasmHook = reader.string(); + break; + case 3: + message.mintsPaused = reader.bool(); + break; + case 4: + message.sendsPaused = reader.bool(); + break; + case 5: + message.burnsPaused = reader.bool(); + break; + case 6: + message.rolePermissions.push(Role.decode(reader, reader.uint32())); + break; + case 7: + message.addressRoles.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Namespace { + const message = createBaseNamespace(); + message.denom = object.denom ?? ""; + message.wasmHook = object.wasmHook ?? ""; + message.mintsPaused = object.mintsPaused ?? false; + message.sendsPaused = object.sendsPaused ?? false; + message.burnsPaused = object.burnsPaused ?? false; + message.rolePermissions = object.rolePermissions?.map(e => Role.fromPartial(e)) || []; + message.addressRoles = object.addressRoles?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: NamespaceAmino): Namespace { + const message = createBaseNamespace(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.wasm_hook !== undefined && object.wasm_hook !== null) { + message.wasmHook = object.wasm_hook; + } + if (object.mints_paused !== undefined && object.mints_paused !== null) { + message.mintsPaused = object.mints_paused; + } + if (object.sends_paused !== undefined && object.sends_paused !== null) { + message.sendsPaused = object.sends_paused; + } + if (object.burns_paused !== undefined && object.burns_paused !== null) { + message.burnsPaused = object.burns_paused; + } + message.rolePermissions = object.role_permissions?.map(e => Role.fromAmino(e)) || []; + message.addressRoles = object.address_roles?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: Namespace): NamespaceAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.wasm_hook = message.wasmHook === "" ? undefined : message.wasmHook; + obj.mints_paused = message.mintsPaused === false ? undefined : message.mintsPaused; + obj.sends_paused = message.sendsPaused === false ? undefined : message.sendsPaused; + obj.burns_paused = message.burnsPaused === false ? undefined : message.burnsPaused; + if (message.rolePermissions) { + obj.role_permissions = message.rolePermissions.map(e => e ? Role.toAmino(e) : undefined); + } else { + obj.role_permissions = message.rolePermissions; + } + if (message.addressRoles) { + obj.address_roles = message.addressRoles.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles = message.addressRoles; + } + return obj; + }, + fromAminoMsg(object: NamespaceAminoMsg): Namespace { + return Namespace.fromAmino(object.value); + }, + fromProtoMsg(message: NamespaceProtoMsg): Namespace { + return Namespace.decode(message.value); + }, + toProto(message: Namespace): Uint8Array { + return Namespace.encode(message).finish(); + }, + toProtoMsg(message: Namespace): NamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Namespace", + value: Namespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Namespace.typeUrl, Namespace); +function createBaseAddressRoles(): AddressRoles { + return { + address: "", + roles: [] + }; +} +export const AddressRoles = { + typeUrl: "/injective.permissions.v1beta1.AddressRoles", + is(o: any): o is AddressRoles { + return o && (o.$typeUrl === AddressRoles.typeUrl || typeof o.address === "string" && Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + isAmino(o: any): o is AddressRolesAmino { + return o && (o.$typeUrl === AddressRoles.typeUrl || typeof o.address === "string" && Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + encode(message: AddressRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.roles) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.roles.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AddressRoles { + const message = createBaseAddressRoles(); + message.address = object.address ?? ""; + message.roles = object.roles?.map(e => e) || []; + return message; + }, + fromAmino(object: AddressRolesAmino): AddressRoles { + const message = createBaseAddressRoles(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.roles = object.roles?.map(e => e) || []; + return message; + }, + toAmino(message: AddressRoles): AddressRolesAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.roles) { + obj.roles = message.roles.map(e => e); + } else { + obj.roles = message.roles; + } + return obj; + }, + fromAminoMsg(object: AddressRolesAminoMsg): AddressRoles { + return AddressRoles.fromAmino(object.value); + }, + fromProtoMsg(message: AddressRolesProtoMsg): AddressRoles { + return AddressRoles.decode(message.value); + }, + toProto(message: AddressRoles): Uint8Array { + return AddressRoles.encode(message).finish(); + }, + toProtoMsg(message: AddressRoles): AddressRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.AddressRoles", + value: AddressRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressRoles.typeUrl, AddressRoles); +function createBaseRole(): Role { + return { + role: "", + permissions: 0 + }; +} +export const Role = { + typeUrl: "/injective.permissions.v1beta1.Role", + is(o: any): o is Role { + return o && (o.$typeUrl === Role.typeUrl || typeof o.role === "string" && typeof o.permissions === "number"); + }, + isAmino(o: any): o is RoleAmino { + return o && (o.$typeUrl === Role.typeUrl || typeof o.role === "string" && typeof o.permissions === "number"); + }, + encode(message: Role, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.role !== "") { + writer.uint32(10).string(message.role); + } + if (message.permissions !== 0) { + writer.uint32(16).uint32(message.permissions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Role { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRole(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permissions = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Role { + const message = createBaseRole(); + message.role = object.role ?? ""; + message.permissions = object.permissions ?? 0; + return message; + }, + fromAmino(object: RoleAmino): Role { + const message = createBaseRole(); + if (object.role !== undefined && object.role !== null) { + message.role = object.role; + } + if (object.permissions !== undefined && object.permissions !== null) { + message.permissions = object.permissions; + } + return message; + }, + toAmino(message: Role): RoleAmino { + const obj: any = {}; + obj.role = message.role === "" ? undefined : message.role; + obj.permissions = message.permissions === 0 ? undefined : message.permissions; + return obj; + }, + fromAminoMsg(object: RoleAminoMsg): Role { + return Role.fromAmino(object.value); + }, + fromProtoMsg(message: RoleProtoMsg): Role { + return Role.decode(message.value); + }, + toProto(message: Role): Uint8Array { + return Role.encode(message).finish(); + }, + toProtoMsg(message: Role): RoleProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Role", + value: Role.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Role.typeUrl, Role); +function createBaseRoleIDs(): RoleIDs { + return { + roleIds: [] + }; +} +export const RoleIDs = { + typeUrl: "/injective.permissions.v1beta1.RoleIDs", + is(o: any): o is RoleIDs { + return o && (o.$typeUrl === RoleIDs.typeUrl || Array.isArray(o.roleIds) && (!o.roleIds.length || typeof o.roleIds[0] === "number")); + }, + isAmino(o: any): o is RoleIDsAmino { + return o && (o.$typeUrl === RoleIDs.typeUrl || Array.isArray(o.role_ids) && (!o.role_ids.length || typeof o.role_ids[0] === "number")); + }, + encode(message: RoleIDs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.roleIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RoleIDs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRoleIDs(); + 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.roleIds.push(reader.uint32()); + } + } else { + message.roleIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RoleIDs { + const message = createBaseRoleIDs(); + message.roleIds = object.roleIds?.map(e => e) || []; + return message; + }, + fromAmino(object: RoleIDsAmino): RoleIDs { + const message = createBaseRoleIDs(); + message.roleIds = object.role_ids?.map(e => e) || []; + return message; + }, + toAmino(message: RoleIDs): RoleIDsAmino { + const obj: any = {}; + if (message.roleIds) { + obj.role_ids = message.roleIds.map(e => e); + } else { + obj.role_ids = message.roleIds; + } + return obj; + }, + fromAminoMsg(object: RoleIDsAminoMsg): RoleIDs { + return RoleIDs.fromAmino(object.value); + }, + fromProtoMsg(message: RoleIDsProtoMsg): RoleIDs { + return RoleIDs.decode(message.value); + }, + toProto(message: RoleIDs): Uint8Array { + return RoleIDs.encode(message).finish(); + }, + toProtoMsg(message: RoleIDs): RoleIDsProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.RoleIDs", + value: RoleIDs.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RoleIDs.typeUrl, RoleIDs); +function createBaseVoucher(): Voucher { + return { + coins: [] + }; +} +export const Voucher = { + typeUrl: "/injective.permissions.v1beta1.Voucher", + is(o: any): o is Voucher { + return o && (o.$typeUrl === Voucher.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isAmino(o: any): o is VoucherAmino { + return o && (o.$typeUrl === Voucher.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, + encode(message: Voucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Voucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Voucher { + const message = createBaseVoucher(); + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: VoucherAmino): Voucher { + const message = createBaseVoucher(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Voucher): VoucherAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: VoucherAminoMsg): Voucher { + return Voucher.fromAmino(object.value); + }, + fromProtoMsg(message: VoucherProtoMsg): Voucher { + return Voucher.decode(message.value); + }, + toProto(message: Voucher): Uint8Array { + return Voucher.encode(message).finish(); + }, + toProtoMsg(message: Voucher): VoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.Voucher", + value: Voucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Voucher.typeUrl, Voucher); +function createBaseAddressVoucher(): AddressVoucher { + return { + address: "", + voucher: undefined + }; +} +export const AddressVoucher = { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher", + is(o: any): o is AddressVoucher { + return o && (o.$typeUrl === AddressVoucher.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is AddressVoucherAmino { + return o && (o.$typeUrl === AddressVoucher.typeUrl || typeof o.address === "string"); + }, + encode(message: AddressVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.voucher !== undefined) { + Voucher.encode(message.voucher, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressVoucher(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.voucher = Voucher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): AddressVoucher { + const message = createBaseAddressVoucher(); + message.address = object.address ?? ""; + message.voucher = object.voucher !== undefined && object.voucher !== null ? Voucher.fromPartial(object.voucher) : undefined; + return message; + }, + fromAmino(object: AddressVoucherAmino): AddressVoucher { + const message = createBaseAddressVoucher(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.voucher !== undefined && object.voucher !== null) { + message.voucher = Voucher.fromAmino(object.voucher); + } + return message; + }, + toAmino(message: AddressVoucher): AddressVoucherAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.voucher = message.voucher ? Voucher.toAmino(message.voucher) : undefined; + return obj; + }, + fromAminoMsg(object: AddressVoucherAminoMsg): AddressVoucher { + return AddressVoucher.fromAmino(object.value); + }, + fromProtoMsg(message: AddressVoucherProtoMsg): AddressVoucher { + return AddressVoucher.decode(message.value); + }, + toProto(message: AddressVoucher): Uint8Array { + return AddressVoucher.encode(message).finish(); + }, + toProtoMsg(message: AddressVoucher): AddressVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.AddressVoucher", + value: AddressVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressVoucher.typeUrl, AddressVoucher); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/permissions/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..364cc281 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/query.rpc.func.ts @@ -0,0 +1,44 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllNamespacesRequest, QueryAllNamespacesResponse, QueryNamespaceByDenomRequest, QueryNamespaceByDenomResponse, QueryAddressRolesRequest, QueryAddressRolesResponse, QueryAddressesByRoleRequest, QueryAddressesByRoleResponse, QueryVouchersForAddressRequest, QueryVouchersForAddressResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetAllNamespaces = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAllNamespacesRequest.encode, + decode: QueryAllNamespacesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AllNamespaces", + clientResolver +}); +export const createGetNamespaceByDenom = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryNamespaceByDenomRequest.encode, + decode: QueryNamespaceByDenomResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "NamespaceByDenom", + clientResolver +}); +export const createGetAddressRoles = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressRolesRequest.encode, + decode: QueryAddressRolesResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressRoles", + clientResolver +}); +export const createGetAddressesByRole = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryAddressesByRoleRequest.encode, + decode: QueryAddressesByRoleResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "AddressesByRole", + clientResolver +}); +export const createGetVouchersForAddress = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryVouchersForAddressRequest.encode, + decode: QueryVouchersForAddressResponse.decode, + service: "injective.permissions.v1beta1.Query", + method: "VouchersForAddress", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/query.ts b/libs/injectivejs/src/injective/permissions/v1beta1/query.ts new file mode 100644 index 00000000..adce6867 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/query.ts @@ -0,0 +1,1084 @@ +import { Params, ParamsAmino } from "./params"; +import { Namespace, NamespaceAmino } from "./permissions"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/injective.permissions.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: "/injective.permissions.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryAllNamespacesRequest is the request type for the Query/AllNamespaces RPC + * method. + */ +export interface QueryAllNamespacesRequest {} +export interface QueryAllNamespacesRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest"; + value: Uint8Array; +} +/** + * QueryAllNamespacesRequest is the request type for the Query/AllNamespaces RPC + * method. + */ +export interface QueryAllNamespacesRequestAmino {} +export interface QueryAllNamespacesRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAllNamespacesRequest"; + value: QueryAllNamespacesRequestAmino; +} +/** + * QueryAllNamespacesResponse is the response type for the Query/AllNamespaces + * RPC method. + */ +export interface QueryAllNamespacesResponse { + namespaces: Namespace[]; +} +export interface QueryAllNamespacesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse"; + value: Uint8Array; +} +/** + * QueryAllNamespacesResponse is the response type for the Query/AllNamespaces + * RPC method. + */ +export interface QueryAllNamespacesResponseAmino { + namespaces: NamespaceAmino[]; +} +export interface QueryAllNamespacesResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAllNamespacesResponse"; + value: QueryAllNamespacesResponseAmino; +} +/** + * QueryNamespaceByDenomRequest is the request type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomRequest { + denom: string; + includeRoles: boolean; +} +export interface QueryNamespaceByDenomRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest"; + value: Uint8Array; +} +/** + * QueryNamespaceByDenomRequest is the request type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomRequestAmino { + denom: string; + include_roles: boolean; +} +export interface QueryNamespaceByDenomRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest"; + value: QueryNamespaceByDenomRequestAmino; +} +/** + * QueryNamespaceByDenomResponse is the response type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomResponse { + namespace?: Namespace; +} +export interface QueryNamespaceByDenomResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse"; + value: Uint8Array; +} +/** + * QueryNamespaceByDenomResponse is the response type for the + * Query/NamespaceByDenom RPC method. + */ +export interface QueryNamespaceByDenomResponseAmino { + namespace?: NamespaceAmino; +} +export interface QueryNamespaceByDenomResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse"; + value: QueryNamespaceByDenomResponseAmino; +} +/** + * QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole + * RPC method. + */ +export interface QueryAddressesByRoleRequest { + denom: string; + role: string; +} +export interface QueryAddressesByRoleRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest"; + value: Uint8Array; +} +/** + * QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole + * RPC method. + */ +export interface QueryAddressesByRoleRequestAmino { + denom: string; + role: string; +} +export interface QueryAddressesByRoleRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest"; + value: QueryAddressesByRoleRequestAmino; +} +/** + * QueryAddressesByRoleResponse is the response type for the + * Query/AddressesByRole RPC method. + */ +export interface QueryAddressesByRoleResponse { + addresses: string[]; +} +export interface QueryAddressesByRoleResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse"; + value: Uint8Array; +} +/** + * QueryAddressesByRoleResponse is the response type for the + * Query/AddressesByRole RPC method. + */ +export interface QueryAddressesByRoleResponseAmino { + addresses: string[]; +} +export interface QueryAddressesByRoleResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse"; + value: QueryAddressesByRoleResponseAmino; +} +export interface QueryAddressRolesRequest { + denom: string; + address: string; +} +export interface QueryAddressRolesRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest"; + value: Uint8Array; +} +export interface QueryAddressRolesRequestAmino { + denom: string; + address: string; +} +export interface QueryAddressRolesRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressRolesRequest"; + value: QueryAddressRolesRequestAmino; +} +export interface QueryAddressRolesResponse { + roles: string[]; +} +export interface QueryAddressRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse"; + value: Uint8Array; +} +export interface QueryAddressRolesResponseAmino { + roles: string[]; +} +export interface QueryAddressRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryAddressRolesResponse"; + value: QueryAddressRolesResponseAmino; +} +export interface QueryVouchersForAddressRequest { + address: string; +} +export interface QueryVouchersForAddressRequestProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest"; + value: Uint8Array; +} +export interface QueryVouchersForAddressRequestAmino { + address: string; +} +export interface QueryVouchersForAddressRequestAminoMsg { + type: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest"; + value: QueryVouchersForAddressRequestAmino; +} +export interface QueryVouchersForAddressResponse { + vouchers: Coin[]; +} +export interface QueryVouchersForAddressResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse"; + value: Uint8Array; +} +export interface QueryVouchersForAddressResponseAmino { + vouchers: CoinAmino[]; +} +export interface QueryVouchersForAddressResponseAminoMsg { + type: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse"; + value: QueryVouchersForAddressResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryAllNamespacesRequest(): QueryAllNamespacesRequest { + return {}; +} +export const QueryAllNamespacesRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest", + is(o: any): o is QueryAllNamespacesRequest { + return o && o.$typeUrl === QueryAllNamespacesRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllNamespacesRequestAmino { + return o && o.$typeUrl === QueryAllNamespacesRequest.typeUrl; + }, + encode(_: QueryAllNamespacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllNamespacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNamespacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryAllNamespacesRequest { + const message = createBaseQueryAllNamespacesRequest(); + return message; + }, + fromAmino(_: QueryAllNamespacesRequestAmino): QueryAllNamespacesRequest { + const message = createBaseQueryAllNamespacesRequest(); + return message; + }, + toAmino(_: QueryAllNamespacesRequest): QueryAllNamespacesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllNamespacesRequestAminoMsg): QueryAllNamespacesRequest { + return QueryAllNamespacesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllNamespacesRequestProtoMsg): QueryAllNamespacesRequest { + return QueryAllNamespacesRequest.decode(message.value); + }, + toProto(message: QueryAllNamespacesRequest): Uint8Array { + return QueryAllNamespacesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllNamespacesRequest): QueryAllNamespacesRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesRequest", + value: QueryAllNamespacesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllNamespacesRequest.typeUrl, QueryAllNamespacesRequest); +function createBaseQueryAllNamespacesResponse(): QueryAllNamespacesResponse { + return { + namespaces: [] + }; +} +export const QueryAllNamespacesResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse", + is(o: any): o is QueryAllNamespacesResponse { + return o && (o.$typeUrl === QueryAllNamespacesResponse.typeUrl || Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.is(o.namespaces[0]))); + }, + isAmino(o: any): o is QueryAllNamespacesResponseAmino { + return o && (o.$typeUrl === QueryAllNamespacesResponse.typeUrl || Array.isArray(o.namespaces) && (!o.namespaces.length || Namespace.isAmino(o.namespaces[0]))); + }, + encode(message: QueryAllNamespacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.namespaces) { + Namespace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllNamespacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNamespacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespaces.push(Namespace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAllNamespacesResponse { + const message = createBaseQueryAllNamespacesResponse(); + message.namespaces = object.namespaces?.map(e => Namespace.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllNamespacesResponseAmino): QueryAllNamespacesResponse { + const message = createBaseQueryAllNamespacesResponse(); + message.namespaces = object.namespaces?.map(e => Namespace.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllNamespacesResponse): QueryAllNamespacesResponseAmino { + const obj: any = {}; + if (message.namespaces) { + obj.namespaces = message.namespaces.map(e => e ? Namespace.toAmino(e) : undefined); + } else { + obj.namespaces = message.namespaces; + } + return obj; + }, + fromAminoMsg(object: QueryAllNamespacesResponseAminoMsg): QueryAllNamespacesResponse { + return QueryAllNamespacesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllNamespacesResponseProtoMsg): QueryAllNamespacesResponse { + return QueryAllNamespacesResponse.decode(message.value); + }, + toProto(message: QueryAllNamespacesResponse): Uint8Array { + return QueryAllNamespacesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllNamespacesResponse): QueryAllNamespacesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAllNamespacesResponse", + value: QueryAllNamespacesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllNamespacesResponse.typeUrl, QueryAllNamespacesResponse); +function createBaseQueryNamespaceByDenomRequest(): QueryNamespaceByDenomRequest { + return { + denom: "", + includeRoles: false + }; +} +export const QueryNamespaceByDenomRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest", + is(o: any): o is QueryNamespaceByDenomRequest { + return o && (o.$typeUrl === QueryNamespaceByDenomRequest.typeUrl || typeof o.denom === "string" && typeof o.includeRoles === "boolean"); + }, + isAmino(o: any): o is QueryNamespaceByDenomRequestAmino { + return o && (o.$typeUrl === QueryNamespaceByDenomRequest.typeUrl || typeof o.denom === "string" && typeof o.include_roles === "boolean"); + }, + encode(message: QueryNamespaceByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.includeRoles === true) { + writer.uint32(16).bool(message.includeRoles); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNamespaceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNamespaceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.includeRoles = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryNamespaceByDenomRequest { + const message = createBaseQueryNamespaceByDenomRequest(); + message.denom = object.denom ?? ""; + message.includeRoles = object.includeRoles ?? false; + return message; + }, + fromAmino(object: QueryNamespaceByDenomRequestAmino): QueryNamespaceByDenomRequest { + const message = createBaseQueryNamespaceByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.include_roles !== undefined && object.include_roles !== null) { + message.includeRoles = object.include_roles; + } + return message; + }, + toAmino(message: QueryNamespaceByDenomRequest): QueryNamespaceByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.include_roles = message.includeRoles === false ? undefined : message.includeRoles; + return obj; + }, + fromAminoMsg(object: QueryNamespaceByDenomRequestAminoMsg): QueryNamespaceByDenomRequest { + return QueryNamespaceByDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNamespaceByDenomRequestProtoMsg): QueryNamespaceByDenomRequest { + return QueryNamespaceByDenomRequest.decode(message.value); + }, + toProto(message: QueryNamespaceByDenomRequest): Uint8Array { + return QueryNamespaceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNamespaceByDenomRequest): QueryNamespaceByDenomRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomRequest", + value: QueryNamespaceByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNamespaceByDenomRequest.typeUrl, QueryNamespaceByDenomRequest); +function createBaseQueryNamespaceByDenomResponse(): QueryNamespaceByDenomResponse { + return { + namespace: undefined + }; +} +export const QueryNamespaceByDenomResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse", + is(o: any): o is QueryNamespaceByDenomResponse { + return o && o.$typeUrl === QueryNamespaceByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QueryNamespaceByDenomResponseAmino { + return o && o.$typeUrl === QueryNamespaceByDenomResponse.typeUrl; + }, + encode(message: QueryNamespaceByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.namespace !== undefined) { + Namespace.encode(message.namespace, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNamespaceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNamespaceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespace = Namespace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryNamespaceByDenomResponse { + const message = createBaseQueryNamespaceByDenomResponse(); + message.namespace = object.namespace !== undefined && object.namespace !== null ? Namespace.fromPartial(object.namespace) : undefined; + return message; + }, + fromAmino(object: QueryNamespaceByDenomResponseAmino): QueryNamespaceByDenomResponse { + const message = createBaseQueryNamespaceByDenomResponse(); + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = Namespace.fromAmino(object.namespace); + } + return message; + }, + toAmino(message: QueryNamespaceByDenomResponse): QueryNamespaceByDenomResponseAmino { + const obj: any = {}; + obj.namespace = message.namespace ? Namespace.toAmino(message.namespace) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNamespaceByDenomResponseAminoMsg): QueryNamespaceByDenomResponse { + return QueryNamespaceByDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNamespaceByDenomResponseProtoMsg): QueryNamespaceByDenomResponse { + return QueryNamespaceByDenomResponse.decode(message.value); + }, + toProto(message: QueryNamespaceByDenomResponse): Uint8Array { + return QueryNamespaceByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNamespaceByDenomResponse): QueryNamespaceByDenomResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryNamespaceByDenomResponse", + value: QueryNamespaceByDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNamespaceByDenomResponse.typeUrl, QueryNamespaceByDenomResponse); +function createBaseQueryAddressesByRoleRequest(): QueryAddressesByRoleRequest { + return { + denom: "", + role: "" + }; +} +export const QueryAddressesByRoleRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest", + is(o: any): o is QueryAddressesByRoleRequest { + return o && (o.$typeUrl === QueryAddressesByRoleRequest.typeUrl || typeof o.denom === "string" && typeof o.role === "string"); + }, + isAmino(o: any): o is QueryAddressesByRoleRequestAmino { + return o && (o.$typeUrl === QueryAddressesByRoleRequest.typeUrl || typeof o.denom === "string" && typeof o.role === "string"); + }, + encode(message: QueryAddressesByRoleRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.role !== "") { + writer.uint32(18).string(message.role); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressesByRoleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressesByRoleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.role = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressesByRoleRequest { + const message = createBaseQueryAddressesByRoleRequest(); + message.denom = object.denom ?? ""; + message.role = object.role ?? ""; + return message; + }, + fromAmino(object: QueryAddressesByRoleRequestAmino): QueryAddressesByRoleRequest { + const message = createBaseQueryAddressesByRoleRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.role !== undefined && object.role !== null) { + message.role = object.role; + } + return message; + }, + toAmino(message: QueryAddressesByRoleRequest): QueryAddressesByRoleRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.role = message.role === "" ? undefined : message.role; + return obj; + }, + fromAminoMsg(object: QueryAddressesByRoleRequestAminoMsg): QueryAddressesByRoleRequest { + return QueryAddressesByRoleRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressesByRoleRequestProtoMsg): QueryAddressesByRoleRequest { + return QueryAddressesByRoleRequest.decode(message.value); + }, + toProto(message: QueryAddressesByRoleRequest): Uint8Array { + return QueryAddressesByRoleRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressesByRoleRequest): QueryAddressesByRoleRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleRequest", + value: QueryAddressesByRoleRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressesByRoleRequest.typeUrl, QueryAddressesByRoleRequest); +function createBaseQueryAddressesByRoleResponse(): QueryAddressesByRoleResponse { + return { + addresses: [] + }; +} +export const QueryAddressesByRoleResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse", + is(o: any): o is QueryAddressesByRoleResponse { + return o && (o.$typeUrl === QueryAddressesByRoleResponse.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is QueryAddressesByRoleResponseAmino { + return o && (o.$typeUrl === QueryAddressesByRoleResponse.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: QueryAddressesByRoleResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressesByRoleResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressesByRoleResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressesByRoleResponse { + const message = createBaseQueryAddressesByRoleResponse(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAddressesByRoleResponseAmino): QueryAddressesByRoleResponse { + const message = createBaseQueryAddressesByRoleResponse(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAddressesByRoleResponse): QueryAddressesByRoleResponseAmino { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: QueryAddressesByRoleResponseAminoMsg): QueryAddressesByRoleResponse { + return QueryAddressesByRoleResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressesByRoleResponseProtoMsg): QueryAddressesByRoleResponse { + return QueryAddressesByRoleResponse.decode(message.value); + }, + toProto(message: QueryAddressesByRoleResponse): Uint8Array { + return QueryAddressesByRoleResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressesByRoleResponse): QueryAddressesByRoleResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressesByRoleResponse", + value: QueryAddressesByRoleResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressesByRoleResponse.typeUrl, QueryAddressesByRoleResponse); +function createBaseQueryAddressRolesRequest(): QueryAddressRolesRequest { + return { + denom: "", + address: "" + }; +} +export const QueryAddressRolesRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest", + is(o: any): o is QueryAddressRolesRequest { + return o && (o.$typeUrl === QueryAddressRolesRequest.typeUrl || typeof o.denom === "string" && typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAddressRolesRequestAmino { + return o && (o.$typeUrl === QueryAddressRolesRequest.typeUrl || typeof o.denom === "string" && typeof o.address === "string"); + }, + encode(message: QueryAddressRolesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressRolesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressRolesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressRolesRequest { + const message = createBaseQueryAddressRolesRequest(); + message.denom = object.denom ?? ""; + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAddressRolesRequestAmino): QueryAddressRolesRequest { + const message = createBaseQueryAddressRolesRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAddressRolesRequest): QueryAddressRolesRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAddressRolesRequestAminoMsg): QueryAddressRolesRequest { + return QueryAddressRolesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressRolesRequestProtoMsg): QueryAddressRolesRequest { + return QueryAddressRolesRequest.decode(message.value); + }, + toProto(message: QueryAddressRolesRequest): Uint8Array { + return QueryAddressRolesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressRolesRequest): QueryAddressRolesRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesRequest", + value: QueryAddressRolesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressRolesRequest.typeUrl, QueryAddressRolesRequest); +function createBaseQueryAddressRolesResponse(): QueryAddressRolesResponse { + return { + roles: [] + }; +} +export const QueryAddressRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse", + is(o: any): o is QueryAddressRolesResponse { + return o && (o.$typeUrl === QueryAddressRolesResponse.typeUrl || Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + isAmino(o: any): o is QueryAddressRolesResponseAmino { + return o && (o.$typeUrl === QueryAddressRolesResponse.typeUrl || Array.isArray(o.roles) && (!o.roles.length || typeof o.roles[0] === "string")); + }, + encode(message: QueryAddressRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.roles) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAddressRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAddressRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roles.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryAddressRolesResponse { + const message = createBaseQueryAddressRolesResponse(); + message.roles = object.roles?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAddressRolesResponseAmino): QueryAddressRolesResponse { + const message = createBaseQueryAddressRolesResponse(); + message.roles = object.roles?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAddressRolesResponse): QueryAddressRolesResponseAmino { + const obj: any = {}; + if (message.roles) { + obj.roles = message.roles.map(e => e); + } else { + obj.roles = message.roles; + } + return obj; + }, + fromAminoMsg(object: QueryAddressRolesResponseAminoMsg): QueryAddressRolesResponse { + return QueryAddressRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAddressRolesResponseProtoMsg): QueryAddressRolesResponse { + return QueryAddressRolesResponse.decode(message.value); + }, + toProto(message: QueryAddressRolesResponse): Uint8Array { + return QueryAddressRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAddressRolesResponse): QueryAddressRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryAddressRolesResponse", + value: QueryAddressRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAddressRolesResponse.typeUrl, QueryAddressRolesResponse); +function createBaseQueryVouchersForAddressRequest(): QueryVouchersForAddressRequest { + return { + address: "" + }; +} +export const QueryVouchersForAddressRequest = { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest", + is(o: any): o is QueryVouchersForAddressRequest { + return o && (o.$typeUrl === QueryVouchersForAddressRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryVouchersForAddressRequestAmino { + return o && (o.$typeUrl === QueryVouchersForAddressRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryVouchersForAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVouchersForAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVouchersForAddressRequest(); + 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: DeepPartial): QueryVouchersForAddressRequest { + const message = createBaseQueryVouchersForAddressRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryVouchersForAddressRequestAmino): QueryVouchersForAddressRequest { + const message = createBaseQueryVouchersForAddressRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryVouchersForAddressRequest): QueryVouchersForAddressRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryVouchersForAddressRequestAminoMsg): QueryVouchersForAddressRequest { + return QueryVouchersForAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVouchersForAddressRequestProtoMsg): QueryVouchersForAddressRequest { + return QueryVouchersForAddressRequest.decode(message.value); + }, + toProto(message: QueryVouchersForAddressRequest): Uint8Array { + return QueryVouchersForAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVouchersForAddressRequest): QueryVouchersForAddressRequestProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressRequest", + value: QueryVouchersForAddressRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVouchersForAddressRequest.typeUrl, QueryVouchersForAddressRequest); +function createBaseQueryVouchersForAddressResponse(): QueryVouchersForAddressResponse { + return { + vouchers: [] + }; +} +export const QueryVouchersForAddressResponse = { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse", + is(o: any): o is QueryVouchersForAddressResponse { + return o && (o.$typeUrl === QueryVouchersForAddressResponse.typeUrl || Array.isArray(o.vouchers) && (!o.vouchers.length || Coin.is(o.vouchers[0]))); + }, + isAmino(o: any): o is QueryVouchersForAddressResponseAmino { + return o && (o.$typeUrl === QueryVouchersForAddressResponse.typeUrl || Array.isArray(o.vouchers) && (!o.vouchers.length || Coin.isAmino(o.vouchers[0]))); + }, + encode(message: QueryVouchersForAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.vouchers) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVouchersForAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVouchersForAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vouchers.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryVouchersForAddressResponse { + const message = createBaseQueryVouchersForAddressResponse(); + message.vouchers = object.vouchers?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryVouchersForAddressResponseAmino): QueryVouchersForAddressResponse { + const message = createBaseQueryVouchersForAddressResponse(); + message.vouchers = object.vouchers?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryVouchersForAddressResponse): QueryVouchersForAddressResponseAmino { + const obj: any = {}; + if (message.vouchers) { + obj.vouchers = message.vouchers.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.vouchers = message.vouchers; + } + return obj; + }, + fromAminoMsg(object: QueryVouchersForAddressResponseAminoMsg): QueryVouchersForAddressResponse { + return QueryVouchersForAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVouchersForAddressResponseProtoMsg): QueryVouchersForAddressResponse { + return QueryVouchersForAddressResponse.decode(message.value); + }, + toProto(message: QueryVouchersForAddressResponse): Uint8Array { + return QueryVouchersForAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVouchersForAddressResponse): QueryVouchersForAddressResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.QueryVouchersForAddressResponse", + value: QueryVouchersForAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryVouchersForAddressResponse.typeUrl, QueryVouchersForAddressResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/permissions/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..7f8a521e --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/tx.rpc.func.ts @@ -0,0 +1,45 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateParams, MsgCreateNamespace, MsgDeleteNamespace, MsgUpdateNamespace, MsgUpdateNamespaceRoles, MsgRevokeNamespaceRoles, MsgClaimVoucher } from "./tx"; +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createCreateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateNamespace.typeUrl, + encoders: toEncoders(MsgCreateNamespace), + converters: toConverters(MsgCreateNamespace) +}); +export const createDeleteNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeleteNamespace.typeUrl, + encoders: toEncoders(MsgDeleteNamespace), + converters: toConverters(MsgDeleteNamespace) +}); +export const createUpdateNamespace = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespace.typeUrl, + encoders: toEncoders(MsgUpdateNamespace), + converters: toConverters(MsgUpdateNamespace) +}); +export const createUpdateNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateNamespaceRoles.typeUrl, + encoders: toEncoders(MsgUpdateNamespaceRoles), + converters: toConverters(MsgUpdateNamespaceRoles) +}); +export const createRevokeNamespaceRoles = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRevokeNamespaceRoles.typeUrl, + encoders: toEncoders(MsgRevokeNamespaceRoles), + converters: toConverters(MsgRevokeNamespaceRoles) +}); +export const createClaimVoucher = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgClaimVoucher.typeUrl, + encoders: toEncoders(MsgClaimVoucher), + converters: toConverters(MsgClaimVoucher) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/permissions/v1beta1/tx.ts b/libs/injectivejs/src/injective/permissions/v1beta1/tx.ts new file mode 100644 index 00000000..e3dc4630 --- /dev/null +++ b/libs/injectivejs/src/injective/permissions/v1beta1/tx.ts @@ -0,0 +1,1682 @@ +import { Params, ParamsAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { Namespace, NamespaceAmino, Role, RoleAmino, AddressRoles, AddressRolesAmino } from "./permissions"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the permissions parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the permissions parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "permissions/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgCreateNamespace { + sender: string; + namespace: Namespace; +} +export interface MsgCreateNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace"; + value: Uint8Array; +} +export interface MsgCreateNamespaceAmino { + sender: string; + namespace: NamespaceAmino; +} +export interface MsgCreateNamespaceAminoMsg { + type: "permissions/MsgCreateNamespace"; + value: MsgCreateNamespaceAmino; +} +export interface MsgCreateNamespaceResponse {} +export interface MsgCreateNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse"; + value: Uint8Array; +} +export interface MsgCreateNamespaceResponseAmino {} +export interface MsgCreateNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse"; + value: MsgCreateNamespaceResponseAmino; +} +export interface MsgDeleteNamespace { + sender: string; + namespaceDenom: string; +} +export interface MsgDeleteNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace"; + value: Uint8Array; +} +export interface MsgDeleteNamespaceAmino { + sender: string; + namespace_denom: string; +} +export interface MsgDeleteNamespaceAminoMsg { + type: "permissions/MsgDeleteNamespace"; + value: MsgDeleteNamespaceAmino; +} +export interface MsgDeleteNamespaceResponse {} +export interface MsgDeleteNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse"; + value: Uint8Array; +} +export interface MsgDeleteNamespaceResponseAmino {} +export interface MsgDeleteNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse"; + value: MsgDeleteNamespaceResponseAmino; +} +export interface MsgUpdateNamespace { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** address of smart contract to apply code-based restrictions */ + wasmHook?: MsgUpdateNamespace_MsgSetWasmHook; + mintsPaused?: MsgUpdateNamespace_MsgSetMintsPaused; + sendsPaused?: MsgUpdateNamespace_MsgSetSendsPaused; + burnsPaused?: MsgUpdateNamespace_MsgSetBurnsPaused; +} +export interface MsgUpdateNamespaceProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** address of smart contract to apply code-based restrictions */ + wasm_hook?: MsgUpdateNamespace_MsgSetWasmHookAmino; + mints_paused?: MsgUpdateNamespace_MsgSetMintsPausedAmino; + sends_paused?: MsgUpdateNamespace_MsgSetSendsPausedAmino; + burns_paused?: MsgUpdateNamespace_MsgSetBurnsPausedAmino; +} +export interface MsgUpdateNamespaceAminoMsg { + type: "permissions/MsgUpdateNamespace"; + value: MsgUpdateNamespaceAmino; +} +export interface MsgUpdateNamespace_MsgSetWasmHook { + newValue: string; +} +export interface MsgUpdateNamespace_MsgSetWasmHookProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetWasmHookAmino { + new_value: string; +} +export interface MsgUpdateNamespace_MsgSetWasmHookAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetWasmHook"; + value: MsgUpdateNamespace_MsgSetWasmHookAmino; +} +export interface MsgUpdateNamespace_MsgSetMintsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetMintsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetMintsPaused"; + value: MsgUpdateNamespace_MsgSetMintsPausedAmino; +} +export interface MsgUpdateNamespace_MsgSetSendsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetSendsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetSendsPaused"; + value: MsgUpdateNamespace_MsgSetSendsPausedAmino; +} +export interface MsgUpdateNamespace_MsgSetBurnsPaused { + newValue: boolean; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused"; + value: Uint8Array; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedAmino { + new_value: boolean; +} +export interface MsgUpdateNamespace_MsgSetBurnsPausedAminoMsg { + type: "/injective.permissions.v1beta1.MsgSetBurnsPaused"; + value: MsgUpdateNamespace_MsgSetBurnsPausedAmino; +} +export interface MsgUpdateNamespaceResponse {} +export interface MsgUpdateNamespaceResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceResponseAmino {} +export interface MsgUpdateNamespaceResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse"; + value: MsgUpdateNamespaceResponseAmino; +} +export interface MsgUpdateNamespaceRoles { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** new role definitions or updated permissions for existing roles */ + rolePermissions: Role[]; + /** new addresses to add or new roles for existing addresses to */ + addressRoles: AddressRoles[]; +} +export interface MsgUpdateNamespaceRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceRolesAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** new role definitions or updated permissions for existing roles */ + role_permissions: RoleAmino[]; + /** new addresses to add or new roles for existing addresses to */ + address_roles: AddressRolesAmino[]; +} +export interface MsgUpdateNamespaceRolesAminoMsg { + type: "permissions/MsgUpdateNamespaceRoles"; + value: MsgUpdateNamespaceRolesAmino; +} +export interface MsgUpdateNamespaceRolesResponse {} +export interface MsgUpdateNamespaceRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse"; + value: Uint8Array; +} +export interface MsgUpdateNamespaceRolesResponseAmino {} +export interface MsgUpdateNamespaceRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse"; + value: MsgUpdateNamespaceRolesResponseAmino; +} +export interface MsgRevokeNamespaceRoles { + sender: string; + /** namespace denom to which this updates are applied */ + namespaceDenom: string; + /** {"address" => array of roles to revoke from this address} */ + addressRolesToRevoke: AddressRoles[]; +} +export interface MsgRevokeNamespaceRolesProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles"; + value: Uint8Array; +} +export interface MsgRevokeNamespaceRolesAmino { + sender: string; + /** namespace denom to which this updates are applied */ + namespace_denom: string; + /** {"address" => array of roles to revoke from this address} */ + address_roles_to_revoke: AddressRolesAmino[]; +} +export interface MsgRevokeNamespaceRolesAminoMsg { + type: "permissions/MsgRevokeNamespaceRoles"; + value: MsgRevokeNamespaceRolesAmino; +} +export interface MsgRevokeNamespaceRolesResponse {} +export interface MsgRevokeNamespaceRolesResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse"; + value: Uint8Array; +} +export interface MsgRevokeNamespaceRolesResponseAmino {} +export interface MsgRevokeNamespaceRolesResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse"; + value: MsgRevokeNamespaceRolesResponseAmino; +} +export interface MsgClaimVoucher { + sender: string; + denom: string; +} +export interface MsgClaimVoucherProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher"; + value: Uint8Array; +} +export interface MsgClaimVoucherAmino { + sender: string; + denom: string; +} +export interface MsgClaimVoucherAminoMsg { + type: "permissions/MsgClaimVoucher"; + value: MsgClaimVoucherAmino; +} +export interface MsgClaimVoucherResponse {} +export interface MsgClaimVoucherResponseProtoMsg { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse"; + value: Uint8Array; +} +export interface MsgClaimVoucherResponseAmino {} +export interface MsgClaimVoucherResponseAminoMsg { + type: "/injective.permissions.v1beta1.MsgClaimVoucherResponse"; + value: MsgClaimVoucherResponseAmino; +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParams", + aminoType: "permissions/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "permissions/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: "/injective.permissions.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgCreateNamespace(): MsgCreateNamespace { + return { + sender: "", + namespace: Namespace.fromPartial({}) + }; +} +export const MsgCreateNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace", + aminoType: "permissions/MsgCreateNamespace", + is(o: any): o is MsgCreateNamespace { + return o && (o.$typeUrl === MsgCreateNamespace.typeUrl || typeof o.sender === "string" && Namespace.is(o.namespace)); + }, + isAmino(o: any): o is MsgCreateNamespaceAmino { + return o && (o.$typeUrl === MsgCreateNamespace.typeUrl || typeof o.sender === "string" && Namespace.isAmino(o.namespace)); + }, + encode(message: MsgCreateNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespace !== undefined) { + Namespace.encode(message.namespace, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespace = Namespace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateNamespace { + const message = createBaseMsgCreateNamespace(); + message.sender = object.sender ?? ""; + message.namespace = object.namespace !== undefined && object.namespace !== null ? Namespace.fromPartial(object.namespace) : undefined; + return message; + }, + fromAmino(object: MsgCreateNamespaceAmino): MsgCreateNamespace { + const message = createBaseMsgCreateNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace !== undefined && object.namespace !== null) { + message.namespace = Namespace.fromAmino(object.namespace); + } + return message; + }, + toAmino(message: MsgCreateNamespace): MsgCreateNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace = message.namespace ? Namespace.toAmino(message.namespace) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateNamespaceAminoMsg): MsgCreateNamespace { + return MsgCreateNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateNamespace): MsgCreateNamespaceAminoMsg { + return { + type: "permissions/MsgCreateNamespace", + value: MsgCreateNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateNamespaceProtoMsg): MsgCreateNamespace { + return MsgCreateNamespace.decode(message.value); + }, + toProto(message: MsgCreateNamespace): Uint8Array { + return MsgCreateNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateNamespace): MsgCreateNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespace", + value: MsgCreateNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateNamespace.typeUrl, MsgCreateNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateNamespace.aminoType, MsgCreateNamespace.typeUrl); +function createBaseMsgCreateNamespaceResponse(): MsgCreateNamespaceResponse { + return {}; +} +export const MsgCreateNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse", + is(o: any): o is MsgCreateNamespaceResponse { + return o && o.$typeUrl === MsgCreateNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateNamespaceResponseAmino { + return o && o.$typeUrl === MsgCreateNamespaceResponse.typeUrl; + }, + encode(_: MsgCreateNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgCreateNamespaceResponse { + const message = createBaseMsgCreateNamespaceResponse(); + return message; + }, + fromAmino(_: MsgCreateNamespaceResponseAmino): MsgCreateNamespaceResponse { + const message = createBaseMsgCreateNamespaceResponse(); + return message; + }, + toAmino(_: MsgCreateNamespaceResponse): MsgCreateNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateNamespaceResponseAminoMsg): MsgCreateNamespaceResponse { + return MsgCreateNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateNamespaceResponseProtoMsg): MsgCreateNamespaceResponse { + return MsgCreateNamespaceResponse.decode(message.value); + }, + toProto(message: MsgCreateNamespaceResponse): Uint8Array { + return MsgCreateNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateNamespaceResponse): MsgCreateNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgCreateNamespaceResponse", + value: MsgCreateNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateNamespaceResponse.typeUrl, MsgCreateNamespaceResponse); +function createBaseMsgDeleteNamespace(): MsgDeleteNamespace { + return { + sender: "", + namespaceDenom: "" + }; +} +export const MsgDeleteNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace", + aminoType: "permissions/MsgDeleteNamespace", + is(o: any): o is MsgDeleteNamespace { + return o && (o.$typeUrl === MsgDeleteNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string"); + }, + isAmino(o: any): o is MsgDeleteNamespaceAmino { + return o && (o.$typeUrl === MsgDeleteNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string"); + }, + encode(message: MsgDeleteNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeleteNamespace { + const message = createBaseMsgDeleteNamespace(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + return message; + }, + fromAmino(object: MsgDeleteNamespaceAmino): MsgDeleteNamespace { + const message = createBaseMsgDeleteNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + return message; + }, + toAmino(message: MsgDeleteNamespace): MsgDeleteNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + return obj; + }, + fromAminoMsg(object: MsgDeleteNamespaceAminoMsg): MsgDeleteNamespace { + return MsgDeleteNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeleteNamespace): MsgDeleteNamespaceAminoMsg { + return { + type: "permissions/MsgDeleteNamespace", + value: MsgDeleteNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDeleteNamespaceProtoMsg): MsgDeleteNamespace { + return MsgDeleteNamespace.decode(message.value); + }, + toProto(message: MsgDeleteNamespace): Uint8Array { + return MsgDeleteNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteNamespace): MsgDeleteNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespace", + value: MsgDeleteNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeleteNamespace.typeUrl, MsgDeleteNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeleteNamespace.aminoType, MsgDeleteNamespace.typeUrl); +function createBaseMsgDeleteNamespaceResponse(): MsgDeleteNamespaceResponse { + return {}; +} +export const MsgDeleteNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse", + is(o: any): o is MsgDeleteNamespaceResponse { + return o && o.$typeUrl === MsgDeleteNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgDeleteNamespaceResponseAmino { + return o && o.$typeUrl === MsgDeleteNamespaceResponse.typeUrl; + }, + encode(_: MsgDeleteNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDeleteNamespaceResponse { + const message = createBaseMsgDeleteNamespaceResponse(); + return message; + }, + fromAmino(_: MsgDeleteNamespaceResponseAmino): MsgDeleteNamespaceResponse { + const message = createBaseMsgDeleteNamespaceResponse(); + return message; + }, + toAmino(_: MsgDeleteNamespaceResponse): MsgDeleteNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeleteNamespaceResponseAminoMsg): MsgDeleteNamespaceResponse { + return MsgDeleteNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeleteNamespaceResponseProtoMsg): MsgDeleteNamespaceResponse { + return MsgDeleteNamespaceResponse.decode(message.value); + }, + toProto(message: MsgDeleteNamespaceResponse): Uint8Array { + return MsgDeleteNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteNamespaceResponse): MsgDeleteNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgDeleteNamespaceResponse", + value: MsgDeleteNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeleteNamespaceResponse.typeUrl, MsgDeleteNamespaceResponse); +function createBaseMsgUpdateNamespace(): MsgUpdateNamespace { + return { + sender: "", + namespaceDenom: "", + wasmHook: undefined, + mintsPaused: undefined, + sendsPaused: undefined, + burnsPaused: undefined + }; +} +export const MsgUpdateNamespace = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace", + aminoType: "permissions/MsgUpdateNamespace", + is(o: any): o is MsgUpdateNamespace { + return o && (o.$typeUrl === MsgUpdateNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string"); + }, + isAmino(o: any): o is MsgUpdateNamespaceAmino { + return o && (o.$typeUrl === MsgUpdateNamespace.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string"); + }, + encode(message: MsgUpdateNamespace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + if (message.wasmHook !== undefined) { + MsgUpdateNamespace_MsgSetWasmHook.encode(message.wasmHook, writer.uint32(26).fork()).ldelim(); + } + if (message.mintsPaused !== undefined) { + MsgUpdateNamespace_MsgSetMintsPaused.encode(message.mintsPaused, writer.uint32(34).fork()).ldelim(); + } + if (message.sendsPaused !== undefined) { + MsgUpdateNamespace_MsgSetSendsPaused.encode(message.sendsPaused, writer.uint32(42).fork()).ldelim(); + } + if (message.burnsPaused !== undefined) { + MsgUpdateNamespace_MsgSetBurnsPaused.encode(message.burnsPaused, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.wasmHook = MsgUpdateNamespace_MsgSetWasmHook.decode(reader, reader.uint32()); + break; + case 4: + message.mintsPaused = MsgUpdateNamespace_MsgSetMintsPaused.decode(reader, reader.uint32()); + break; + case 5: + message.sendsPaused = MsgUpdateNamespace_MsgSetSendsPaused.decode(reader, reader.uint32()); + break; + case 6: + message.burnsPaused = MsgUpdateNamespace_MsgSetBurnsPaused.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace { + const message = createBaseMsgUpdateNamespace(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.wasmHook = object.wasmHook !== undefined && object.wasmHook !== null ? MsgUpdateNamespace_MsgSetWasmHook.fromPartial(object.wasmHook) : undefined; + message.mintsPaused = object.mintsPaused !== undefined && object.mintsPaused !== null ? MsgUpdateNamespace_MsgSetMintsPaused.fromPartial(object.mintsPaused) : undefined; + message.sendsPaused = object.sendsPaused !== undefined && object.sendsPaused !== null ? MsgUpdateNamespace_MsgSetSendsPaused.fromPartial(object.sendsPaused) : undefined; + message.burnsPaused = object.burnsPaused !== undefined && object.burnsPaused !== null ? MsgUpdateNamespace_MsgSetBurnsPaused.fromPartial(object.burnsPaused) : undefined; + return message; + }, + fromAmino(object: MsgUpdateNamespaceAmino): MsgUpdateNamespace { + const message = createBaseMsgUpdateNamespace(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + if (object.wasm_hook !== undefined && object.wasm_hook !== null) { + message.wasmHook = MsgUpdateNamespace_MsgSetWasmHook.fromAmino(object.wasm_hook); + } + if (object.mints_paused !== undefined && object.mints_paused !== null) { + message.mintsPaused = MsgUpdateNamespace_MsgSetMintsPaused.fromAmino(object.mints_paused); + } + if (object.sends_paused !== undefined && object.sends_paused !== null) { + message.sendsPaused = MsgUpdateNamespace_MsgSetSendsPaused.fromAmino(object.sends_paused); + } + if (object.burns_paused !== undefined && object.burns_paused !== null) { + message.burnsPaused = MsgUpdateNamespace_MsgSetBurnsPaused.fromAmino(object.burns_paused); + } + return message; + }, + toAmino(message: MsgUpdateNamespace): MsgUpdateNamespaceAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + obj.wasm_hook = message.wasmHook ? MsgUpdateNamespace_MsgSetWasmHook.toAmino(message.wasmHook) : undefined; + obj.mints_paused = message.mintsPaused ? MsgUpdateNamespace_MsgSetMintsPaused.toAmino(message.mintsPaused) : undefined; + obj.sends_paused = message.sendsPaused ? MsgUpdateNamespace_MsgSetSendsPaused.toAmino(message.sendsPaused) : undefined; + obj.burns_paused = message.burnsPaused ? MsgUpdateNamespace_MsgSetBurnsPaused.toAmino(message.burnsPaused) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceAminoMsg): MsgUpdateNamespace { + return MsgUpdateNamespace.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateNamespace): MsgUpdateNamespaceAminoMsg { + return { + type: "permissions/MsgUpdateNamespace", + value: MsgUpdateNamespace.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateNamespaceProtoMsg): MsgUpdateNamespace { + return MsgUpdateNamespace.decode(message.value); + }, + toProto(message: MsgUpdateNamespace): Uint8Array { + return MsgUpdateNamespace.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace): MsgUpdateNamespaceProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespace", + value: MsgUpdateNamespace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace.typeUrl, MsgUpdateNamespace); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateNamespace.aminoType, MsgUpdateNamespace.typeUrl); +function createBaseMsgUpdateNamespace_MsgSetWasmHook(): MsgUpdateNamespace_MsgSetWasmHook { + return { + newValue: "" + }; +} +export const MsgUpdateNamespace_MsgSetWasmHook = { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook", + is(o: any): o is MsgUpdateNamespace_MsgSetWasmHook { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetWasmHook.typeUrl || typeof o.newValue === "string"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetWasmHookAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetWasmHook.typeUrl || typeof o.new_value === "string"); + }, + encode(message: MsgUpdateNamespace_MsgSetWasmHook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue !== "") { + writer.uint32(10).string(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetWasmHook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetWasmHook { + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + message.newValue = object.newValue ?? ""; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetWasmHookAmino): MsgUpdateNamespace_MsgSetWasmHook { + const message = createBaseMsgUpdateNamespace_MsgSetWasmHook(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetWasmHook): MsgUpdateNamespace_MsgSetWasmHookAmino { + const obj: any = {}; + obj.new_value = message.newValue === "" ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetWasmHookAminoMsg): MsgUpdateNamespace_MsgSetWasmHook { + return MsgUpdateNamespace_MsgSetWasmHook.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetWasmHookProtoMsg): MsgUpdateNamespace_MsgSetWasmHook { + return MsgUpdateNamespace_MsgSetWasmHook.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetWasmHook): Uint8Array { + return MsgUpdateNamespace_MsgSetWasmHook.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetWasmHook): MsgUpdateNamespace_MsgSetWasmHookProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetWasmHook", + value: MsgUpdateNamespace_MsgSetWasmHook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetWasmHook.typeUrl, MsgUpdateNamespace_MsgSetWasmHook); +function createBaseMsgUpdateNamespace_MsgSetMintsPaused(): MsgUpdateNamespace_MsgSetMintsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetMintsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetMintsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetMintsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetMintsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetMintsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetMintsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetMintsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetMintsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetMintsPausedAmino): MsgUpdateNamespace_MsgSetMintsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetMintsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetMintsPaused): MsgUpdateNamespace_MsgSetMintsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetMintsPausedAminoMsg): MsgUpdateNamespace_MsgSetMintsPaused { + return MsgUpdateNamespace_MsgSetMintsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetMintsPausedProtoMsg): MsgUpdateNamespace_MsgSetMintsPaused { + return MsgUpdateNamespace_MsgSetMintsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetMintsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetMintsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetMintsPaused): MsgUpdateNamespace_MsgSetMintsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetMintsPaused", + value: MsgUpdateNamespace_MsgSetMintsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetMintsPaused.typeUrl, MsgUpdateNamespace_MsgSetMintsPaused); +function createBaseMsgUpdateNamespace_MsgSetSendsPaused(): MsgUpdateNamespace_MsgSetSendsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetSendsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetSendsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetSendsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetSendsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetSendsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetSendsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetSendsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetSendsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetSendsPausedAmino): MsgUpdateNamespace_MsgSetSendsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetSendsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetSendsPaused): MsgUpdateNamespace_MsgSetSendsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetSendsPausedAminoMsg): MsgUpdateNamespace_MsgSetSendsPaused { + return MsgUpdateNamespace_MsgSetSendsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetSendsPausedProtoMsg): MsgUpdateNamespace_MsgSetSendsPaused { + return MsgUpdateNamespace_MsgSetSendsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetSendsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetSendsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetSendsPaused): MsgUpdateNamespace_MsgSetSendsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetSendsPaused", + value: MsgUpdateNamespace_MsgSetSendsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetSendsPaused.typeUrl, MsgUpdateNamespace_MsgSetSendsPaused); +function createBaseMsgUpdateNamespace_MsgSetBurnsPaused(): MsgUpdateNamespace_MsgSetBurnsPaused { + return { + newValue: false + }; +} +export const MsgUpdateNamespace_MsgSetBurnsPaused = { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused", + is(o: any): o is MsgUpdateNamespace_MsgSetBurnsPaused { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl || typeof o.newValue === "boolean"); + }, + isAmino(o: any): o is MsgUpdateNamespace_MsgSetBurnsPausedAmino { + return o && (o.$typeUrl === MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl || typeof o.new_value === "boolean"); + }, + encode(message: MsgUpdateNamespace_MsgSetBurnsPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newValue === true) { + writer.uint32(8).bool(message.newValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespace_MsgSetBurnsPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newValue = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespace_MsgSetBurnsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + message.newValue = object.newValue ?? false; + return message; + }, + fromAmino(object: MsgUpdateNamespace_MsgSetBurnsPausedAmino): MsgUpdateNamespace_MsgSetBurnsPaused { + const message = createBaseMsgUpdateNamespace_MsgSetBurnsPaused(); + if (object.new_value !== undefined && object.new_value !== null) { + message.newValue = object.new_value; + } + return message; + }, + toAmino(message: MsgUpdateNamespace_MsgSetBurnsPaused): MsgUpdateNamespace_MsgSetBurnsPausedAmino { + const obj: any = {}; + obj.new_value = message.newValue === false ? undefined : message.newValue; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespace_MsgSetBurnsPausedAminoMsg): MsgUpdateNamespace_MsgSetBurnsPaused { + return MsgUpdateNamespace_MsgSetBurnsPaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg): MsgUpdateNamespace_MsgSetBurnsPaused { + return MsgUpdateNamespace_MsgSetBurnsPaused.decode(message.value); + }, + toProto(message: MsgUpdateNamespace_MsgSetBurnsPaused): Uint8Array { + return MsgUpdateNamespace_MsgSetBurnsPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespace_MsgSetBurnsPaused): MsgUpdateNamespace_MsgSetBurnsPausedProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgSetBurnsPaused", + value: MsgUpdateNamespace_MsgSetBurnsPaused.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespace_MsgSetBurnsPaused.typeUrl, MsgUpdateNamespace_MsgSetBurnsPaused); +function createBaseMsgUpdateNamespaceResponse(): MsgUpdateNamespaceResponse { + return {}; +} +export const MsgUpdateNamespaceResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse", + is(o: any): o is MsgUpdateNamespaceResponse { + return o && o.$typeUrl === MsgUpdateNamespaceResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateNamespaceResponseAmino { + return o && o.$typeUrl === MsgUpdateNamespaceResponse.typeUrl; + }, + encode(_: MsgUpdateNamespaceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateNamespaceResponse { + const message = createBaseMsgUpdateNamespaceResponse(); + return message; + }, + fromAmino(_: MsgUpdateNamespaceResponseAmino): MsgUpdateNamespaceResponse { + const message = createBaseMsgUpdateNamespaceResponse(); + return message; + }, + toAmino(_: MsgUpdateNamespaceResponse): MsgUpdateNamespaceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceResponseAminoMsg): MsgUpdateNamespaceResponse { + return MsgUpdateNamespaceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespaceResponseProtoMsg): MsgUpdateNamespaceResponse { + return MsgUpdateNamespaceResponse.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceResponse): Uint8Array { + return MsgUpdateNamespaceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceResponse): MsgUpdateNamespaceResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceResponse", + value: MsgUpdateNamespaceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceResponse.typeUrl, MsgUpdateNamespaceResponse); +function createBaseMsgUpdateNamespaceRoles(): MsgUpdateNamespaceRoles { + return { + sender: "", + namespaceDenom: "", + rolePermissions: [], + addressRoles: [] + }; +} +export const MsgUpdateNamespaceRoles = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles", + aminoType: "permissions/MsgUpdateNamespaceRoles", + is(o: any): o is MsgUpdateNamespaceRoles { + return o && (o.$typeUrl === MsgUpdateNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string" && Array.isArray(o.rolePermissions) && (!o.rolePermissions.length || Role.is(o.rolePermissions[0])) && Array.isArray(o.addressRoles) && (!o.addressRoles.length || AddressRoles.is(o.addressRoles[0]))); + }, + isAmino(o: any): o is MsgUpdateNamespaceRolesAmino { + return o && (o.$typeUrl === MsgUpdateNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string" && Array.isArray(o.role_permissions) && (!o.role_permissions.length || Role.isAmino(o.role_permissions[0])) && Array.isArray(o.address_roles) && (!o.address_roles.length || AddressRoles.isAmino(o.address_roles[0]))); + }, + encode(message: MsgUpdateNamespaceRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + for (const v of message.rolePermissions) { + Role.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.addressRoles) { + AddressRoles.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.rolePermissions.push(Role.decode(reader, reader.uint32())); + break; + case 4: + message.addressRoles.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateNamespaceRoles { + const message = createBaseMsgUpdateNamespaceRoles(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.rolePermissions = object.rolePermissions?.map(e => Role.fromPartial(e)) || []; + message.addressRoles = object.addressRoles?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateNamespaceRolesAmino): MsgUpdateNamespaceRoles { + const message = createBaseMsgUpdateNamespaceRoles(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + message.rolePermissions = object.role_permissions?.map(e => Role.fromAmino(e)) || []; + message.addressRoles = object.address_roles?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + if (message.rolePermissions) { + obj.role_permissions = message.rolePermissions.map(e => e ? Role.toAmino(e) : undefined); + } else { + obj.role_permissions = message.rolePermissions; + } + if (message.addressRoles) { + obj.address_roles = message.addressRoles.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles = message.addressRoles; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceRolesAminoMsg): MsgUpdateNamespaceRoles { + return MsgUpdateNamespaceRoles.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesAminoMsg { + return { + type: "permissions/MsgUpdateNamespaceRoles", + value: MsgUpdateNamespaceRoles.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateNamespaceRolesProtoMsg): MsgUpdateNamespaceRoles { + return MsgUpdateNamespaceRoles.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceRoles): Uint8Array { + return MsgUpdateNamespaceRoles.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceRoles): MsgUpdateNamespaceRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRoles", + value: MsgUpdateNamespaceRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceRoles.typeUrl, MsgUpdateNamespaceRoles); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateNamespaceRoles.aminoType, MsgUpdateNamespaceRoles.typeUrl); +function createBaseMsgUpdateNamespaceRolesResponse(): MsgUpdateNamespaceRolesResponse { + return {}; +} +export const MsgUpdateNamespaceRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse", + is(o: any): o is MsgUpdateNamespaceRolesResponse { + return o && o.$typeUrl === MsgUpdateNamespaceRolesResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateNamespaceRolesResponseAmino { + return o && o.$typeUrl === MsgUpdateNamespaceRolesResponse.typeUrl; + }, + encode(_: MsgUpdateNamespaceRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNamespaceRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateNamespaceRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateNamespaceRolesResponse { + const message = createBaseMsgUpdateNamespaceRolesResponse(); + return message; + }, + fromAmino(_: MsgUpdateNamespaceRolesResponseAmino): MsgUpdateNamespaceRolesResponse { + const message = createBaseMsgUpdateNamespaceRolesResponse(); + return message; + }, + toAmino(_: MsgUpdateNamespaceRolesResponse): MsgUpdateNamespaceRolesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateNamespaceRolesResponseAminoMsg): MsgUpdateNamespaceRolesResponse { + return MsgUpdateNamespaceRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateNamespaceRolesResponseProtoMsg): MsgUpdateNamespaceRolesResponse { + return MsgUpdateNamespaceRolesResponse.decode(message.value); + }, + toProto(message: MsgUpdateNamespaceRolesResponse): Uint8Array { + return MsgUpdateNamespaceRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateNamespaceRolesResponse): MsgUpdateNamespaceRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgUpdateNamespaceRolesResponse", + value: MsgUpdateNamespaceRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateNamespaceRolesResponse.typeUrl, MsgUpdateNamespaceRolesResponse); +function createBaseMsgRevokeNamespaceRoles(): MsgRevokeNamespaceRoles { + return { + sender: "", + namespaceDenom: "", + addressRolesToRevoke: [] + }; +} +export const MsgRevokeNamespaceRoles = { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles", + aminoType: "permissions/MsgRevokeNamespaceRoles", + is(o: any): o is MsgRevokeNamespaceRoles { + return o && (o.$typeUrl === MsgRevokeNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespaceDenom === "string" && Array.isArray(o.addressRolesToRevoke) && (!o.addressRolesToRevoke.length || AddressRoles.is(o.addressRolesToRevoke[0]))); + }, + isAmino(o: any): o is MsgRevokeNamespaceRolesAmino { + return o && (o.$typeUrl === MsgRevokeNamespaceRoles.typeUrl || typeof o.sender === "string" && typeof o.namespace_denom === "string" && Array.isArray(o.address_roles_to_revoke) && (!o.address_roles_to_revoke.length || AddressRoles.isAmino(o.address_roles_to_revoke[0]))); + }, + encode(message: MsgRevokeNamespaceRoles, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.namespaceDenom !== "") { + writer.uint32(18).string(message.namespaceDenom); + } + for (const v of message.addressRolesToRevoke) { + AddressRoles.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeNamespaceRoles { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeNamespaceRoles(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.namespaceDenom = reader.string(); + break; + case 3: + message.addressRolesToRevoke.push(AddressRoles.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRevokeNamespaceRoles { + const message = createBaseMsgRevokeNamespaceRoles(); + message.sender = object.sender ?? ""; + message.namespaceDenom = object.namespaceDenom ?? ""; + message.addressRolesToRevoke = object.addressRolesToRevoke?.map(e => AddressRoles.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgRevokeNamespaceRolesAmino): MsgRevokeNamespaceRoles { + const message = createBaseMsgRevokeNamespaceRoles(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.namespace_denom !== undefined && object.namespace_denom !== null) { + message.namespaceDenom = object.namespace_denom; + } + message.addressRolesToRevoke = object.address_roles_to_revoke?.map(e => AddressRoles.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.namespace_denom = message.namespaceDenom === "" ? undefined : message.namespaceDenom; + if (message.addressRolesToRevoke) { + obj.address_roles_to_revoke = message.addressRolesToRevoke.map(e => e ? AddressRoles.toAmino(e) : undefined); + } else { + obj.address_roles_to_revoke = message.addressRolesToRevoke; + } + return obj; + }, + fromAminoMsg(object: MsgRevokeNamespaceRolesAminoMsg): MsgRevokeNamespaceRoles { + return MsgRevokeNamespaceRoles.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesAminoMsg { + return { + type: "permissions/MsgRevokeNamespaceRoles", + value: MsgRevokeNamespaceRoles.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeNamespaceRolesProtoMsg): MsgRevokeNamespaceRoles { + return MsgRevokeNamespaceRoles.decode(message.value); + }, + toProto(message: MsgRevokeNamespaceRoles): Uint8Array { + return MsgRevokeNamespaceRoles.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeNamespaceRoles): MsgRevokeNamespaceRolesProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRoles", + value: MsgRevokeNamespaceRoles.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeNamespaceRoles.typeUrl, MsgRevokeNamespaceRoles); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeNamespaceRoles.aminoType, MsgRevokeNamespaceRoles.typeUrl); +function createBaseMsgRevokeNamespaceRolesResponse(): MsgRevokeNamespaceRolesResponse { + return {}; +} +export const MsgRevokeNamespaceRolesResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse", + is(o: any): o is MsgRevokeNamespaceRolesResponse { + return o && o.$typeUrl === MsgRevokeNamespaceRolesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeNamespaceRolesResponseAmino { + return o && o.$typeUrl === MsgRevokeNamespaceRolesResponse.typeUrl; + }, + encode(_: MsgRevokeNamespaceRolesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeNamespaceRolesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeNamespaceRolesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRevokeNamespaceRolesResponse { + const message = createBaseMsgRevokeNamespaceRolesResponse(); + return message; + }, + fromAmino(_: MsgRevokeNamespaceRolesResponseAmino): MsgRevokeNamespaceRolesResponse { + const message = createBaseMsgRevokeNamespaceRolesResponse(); + return message; + }, + toAmino(_: MsgRevokeNamespaceRolesResponse): MsgRevokeNamespaceRolesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeNamespaceRolesResponseAminoMsg): MsgRevokeNamespaceRolesResponse { + return MsgRevokeNamespaceRolesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRevokeNamespaceRolesResponseProtoMsg): MsgRevokeNamespaceRolesResponse { + return MsgRevokeNamespaceRolesResponse.decode(message.value); + }, + toProto(message: MsgRevokeNamespaceRolesResponse): Uint8Array { + return MsgRevokeNamespaceRolesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeNamespaceRolesResponse): MsgRevokeNamespaceRolesResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgRevokeNamespaceRolesResponse", + value: MsgRevokeNamespaceRolesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRevokeNamespaceRolesResponse.typeUrl, MsgRevokeNamespaceRolesResponse); +function createBaseMsgClaimVoucher(): MsgClaimVoucher { + return { + sender: "", + denom: "" + }; +} +export const MsgClaimVoucher = { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher", + aminoType: "permissions/MsgClaimVoucher", + is(o: any): o is MsgClaimVoucher { + return o && (o.$typeUrl === MsgClaimVoucher.typeUrl || typeof o.sender === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is MsgClaimVoucherAmino { + return o && (o.$typeUrl === MsgClaimVoucher.typeUrl || typeof o.sender === "string" && typeof o.denom === "string"); + }, + encode(message: MsgClaimVoucher, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaimVoucher { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimVoucher(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgClaimVoucher { + const message = createBaseMsgClaimVoucher(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: MsgClaimVoucherAmino): MsgClaimVoucher { + const message = createBaseMsgClaimVoucher(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: MsgClaimVoucher): MsgClaimVoucherAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: MsgClaimVoucherAminoMsg): MsgClaimVoucher { + return MsgClaimVoucher.fromAmino(object.value); + }, + toAminoMsg(message: MsgClaimVoucher): MsgClaimVoucherAminoMsg { + return { + type: "permissions/MsgClaimVoucher", + value: MsgClaimVoucher.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClaimVoucherProtoMsg): MsgClaimVoucher { + return MsgClaimVoucher.decode(message.value); + }, + toProto(message: MsgClaimVoucher): Uint8Array { + return MsgClaimVoucher.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimVoucher): MsgClaimVoucherProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucher", + value: MsgClaimVoucher.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClaimVoucher.typeUrl, MsgClaimVoucher); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClaimVoucher.aminoType, MsgClaimVoucher.typeUrl); +function createBaseMsgClaimVoucherResponse(): MsgClaimVoucherResponse { + return {}; +} +export const MsgClaimVoucherResponse = { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse", + is(o: any): o is MsgClaimVoucherResponse { + return o && o.$typeUrl === MsgClaimVoucherResponse.typeUrl; + }, + isAmino(o: any): o is MsgClaimVoucherResponseAmino { + return o && o.$typeUrl === MsgClaimVoucherResponse.typeUrl; + }, + encode(_: MsgClaimVoucherResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaimVoucherResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimVoucherResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgClaimVoucherResponse { + const message = createBaseMsgClaimVoucherResponse(); + return message; + }, + fromAmino(_: MsgClaimVoucherResponseAmino): MsgClaimVoucherResponse { + const message = createBaseMsgClaimVoucherResponse(); + return message; + }, + toAmino(_: MsgClaimVoucherResponse): MsgClaimVoucherResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClaimVoucherResponseAminoMsg): MsgClaimVoucherResponse { + return MsgClaimVoucherResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClaimVoucherResponseProtoMsg): MsgClaimVoucherResponse { + return MsgClaimVoucherResponse.decode(message.value); + }, + toProto(message: MsgClaimVoucherResponse): Uint8Array { + return MsgClaimVoucherResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimVoucherResponse): MsgClaimVoucherResponseProtoMsg { + return { + typeUrl: "/injective.permissions.v1beta1.MsgClaimVoucherResponse", + value: MsgClaimVoucherResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClaimVoucherResponse.typeUrl, MsgClaimVoucherResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/stream/v1beta1/query.ts b/libs/injectivejs/src/injective/stream/v1beta1/query.ts new file mode 100644 index 00000000..9bdabccf --- /dev/null +++ b/libs/injectivejs/src/injective/stream/v1beta1/query.ts @@ -0,0 +1,2870 @@ +import { Level, LevelAmino, Deposit, DepositAmino, SpotLimitOrder, SpotLimitOrderAmino, DerivativeLimitOrder, DerivativeLimitOrderAmino, PositionDelta, PositionDeltaAmino } from "../../exchange/v1beta1/exchange"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum OrderUpdateStatus { + Unspecified = 0, + Booked = 1, + Matched = 2, + Cancelled = 3, + UNRECOGNIZED = -1, +} +export const OrderUpdateStatusAmino = OrderUpdateStatus; +export function orderUpdateStatusFromJSON(object: any): OrderUpdateStatus { + switch (object) { + case 0: + case "Unspecified": + return OrderUpdateStatus.Unspecified; + case 1: + case "Booked": + return OrderUpdateStatus.Booked; + case 2: + case "Matched": + return OrderUpdateStatus.Matched; + case 3: + case "Cancelled": + return OrderUpdateStatus.Cancelled; + case -1: + case "UNRECOGNIZED": + default: + return OrderUpdateStatus.UNRECOGNIZED; + } +} +export function orderUpdateStatusToJSON(object: OrderUpdateStatus): string { + switch (object) { + case OrderUpdateStatus.Unspecified: + return "Unspecified"; + case OrderUpdateStatus.Booked: + return "Booked"; + case OrderUpdateStatus.Matched: + return "Matched"; + case OrderUpdateStatus.Cancelled: + return "Cancelled"; + case OrderUpdateStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface StreamRequest { + bankBalancesFilter?: BankBalancesFilter; + subaccountDepositsFilter?: SubaccountDepositsFilter; + spotTradesFilter?: TradesFilter; + derivativeTradesFilter?: TradesFilter; + spotOrdersFilter?: OrdersFilter; + derivativeOrdersFilter?: OrdersFilter; + spotOrderbooksFilter?: OrderbookFilter; + derivativeOrderbooksFilter?: OrderbookFilter; + positionsFilter?: PositionsFilter; + oraclePriceFilter?: OraclePriceFilter; +} +export interface StreamRequestProtoMsg { + typeUrl: "/injective.stream.v1beta1.StreamRequest"; + value: Uint8Array; +} +export interface StreamRequestAmino { + bank_balances_filter?: BankBalancesFilterAmino; + subaccount_deposits_filter?: SubaccountDepositsFilterAmino; + spot_trades_filter?: TradesFilterAmino; + derivative_trades_filter?: TradesFilterAmino; + spot_orders_filter?: OrdersFilterAmino; + derivative_orders_filter?: OrdersFilterAmino; + spot_orderbooks_filter?: OrderbookFilterAmino; + derivative_orderbooks_filter?: OrderbookFilterAmino; + positions_filter?: PositionsFilterAmino; + oracle_price_filter?: OraclePriceFilterAmino; +} +export interface StreamRequestAminoMsg { + type: "/injective.stream.v1beta1.StreamRequest"; + value: StreamRequestAmino; +} +export interface StreamResponse { + blockHeight: bigint; + blockTime: bigint; + bankBalances: BankBalance[]; + subaccountDeposits: SubaccountDeposits[]; + spotTrades: SpotTrade[]; + derivativeTrades: DerivativeTrade[]; + spotOrders: SpotOrderUpdate[]; + derivativeOrders: DerivativeOrderUpdate[]; + spotOrderbookUpdates: OrderbookUpdate[]; + derivativeOrderbookUpdates: OrderbookUpdate[]; + positions: Position[]; + oraclePrices: OraclePrice[]; +} +export interface StreamResponseProtoMsg { + typeUrl: "/injective.stream.v1beta1.StreamResponse"; + value: Uint8Array; +} +export interface StreamResponseAmino { + block_height: string; + block_time: string; + bank_balances: BankBalanceAmino[]; + subaccount_deposits: SubaccountDepositsAmino[]; + spot_trades: SpotTradeAmino[]; + derivative_trades: DerivativeTradeAmino[]; + spot_orders: SpotOrderUpdateAmino[]; + derivative_orders: DerivativeOrderUpdateAmino[]; + spot_orderbook_updates: OrderbookUpdateAmino[]; + derivative_orderbook_updates: OrderbookUpdateAmino[]; + positions: PositionAmino[]; + oracle_prices: OraclePriceAmino[]; +} +export interface StreamResponseAminoMsg { + type: "/injective.stream.v1beta1.StreamResponse"; + value: StreamResponseAmino; +} +export interface OrderbookUpdate { + seq: bigint; + orderbook?: Orderbook; +} +export interface OrderbookUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate"; + value: Uint8Array; +} +export interface OrderbookUpdateAmino { + seq: string; + orderbook?: OrderbookAmino; +} +export interface OrderbookUpdateAminoMsg { + type: "/injective.stream.v1beta1.OrderbookUpdate"; + value: OrderbookUpdateAmino; +} +export interface Orderbook { + marketId: string; + buyLevels: Level[]; + sellLevels: Level[]; +} +export interface OrderbookProtoMsg { + typeUrl: "/injective.stream.v1beta1.Orderbook"; + value: Uint8Array; +} +export interface OrderbookAmino { + market_id: string; + buy_levels: LevelAmino[]; + sell_levels: LevelAmino[]; +} +export interface OrderbookAminoMsg { + type: "/injective.stream.v1beta1.Orderbook"; + value: OrderbookAmino; +} +export interface BankBalance { + account: string; + balances: Coin[]; +} +export interface BankBalanceProtoMsg { + typeUrl: "/injective.stream.v1beta1.BankBalance"; + value: Uint8Array; +} +export interface BankBalanceAmino { + account: string; + balances: CoinAmino[]; +} +export interface BankBalanceAminoMsg { + type: "/injective.stream.v1beta1.BankBalance"; + value: BankBalanceAmino; +} +export interface SubaccountDeposits { + subaccountId: string; + deposits: SubaccountDeposit[]; +} +export interface SubaccountDepositsProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits"; + value: Uint8Array; +} +export interface SubaccountDepositsAmino { + subaccount_id: string; + deposits: SubaccountDepositAmino[]; +} +export interface SubaccountDepositsAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDeposits"; + value: SubaccountDepositsAmino; +} +export interface SubaccountDeposit { + denom: string; + deposit: Deposit; +} +export interface SubaccountDepositProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit"; + value: Uint8Array; +} +export interface SubaccountDepositAmino { + denom: string; + deposit: DepositAmino; +} +export interface SubaccountDepositAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDeposit"; + value: SubaccountDepositAmino; +} +export interface SpotOrderUpdate { + status: OrderUpdateStatus; + orderHash: Uint8Array; + cid: string; + order?: SpotOrder; +} +export interface SpotOrderUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate"; + value: Uint8Array; +} +export interface SpotOrderUpdateAmino { + status: OrderUpdateStatus; + order_hash: string; + cid: string; + order?: SpotOrderAmino; +} +export interface SpotOrderUpdateAminoMsg { + type: "/injective.stream.v1beta1.SpotOrderUpdate"; + value: SpotOrderUpdateAmino; +} +export interface SpotOrder { + marketId: string; + order: SpotLimitOrder; +} +export interface SpotOrderProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotOrder"; + value: Uint8Array; +} +export interface SpotOrderAmino { + market_id: string; + order: SpotLimitOrderAmino; +} +export interface SpotOrderAminoMsg { + type: "/injective.stream.v1beta1.SpotOrder"; + value: SpotOrderAmino; +} +export interface DerivativeOrderUpdate { + status: OrderUpdateStatus; + orderHash: Uint8Array; + cid: string; + order?: DerivativeOrder; +} +export interface DerivativeOrderUpdateProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate"; + value: Uint8Array; +} +export interface DerivativeOrderUpdateAmino { + status: OrderUpdateStatus; + order_hash: string; + cid: string; + order?: DerivativeOrderAmino; +} +export interface DerivativeOrderUpdateAminoMsg { + type: "/injective.stream.v1beta1.DerivativeOrderUpdate"; + value: DerivativeOrderUpdateAmino; +} +export interface DerivativeOrder { + marketId: string; + order: DerivativeLimitOrder; + isMarket: boolean; +} +export interface DerivativeOrderProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder"; + value: Uint8Array; +} +export interface DerivativeOrderAmino { + market_id: string; + order: DerivativeLimitOrderAmino; + is_market: boolean; +} +export interface DerivativeOrderAminoMsg { + type: "/injective.stream.v1beta1.DerivativeOrder"; + value: DerivativeOrderAmino; +} +export interface Position { + marketId: string; + subaccountId: string; + isLong: boolean; + quantity: string; + entryPrice: string; + margin: string; + cumulativeFundingEntry: string; +} +export interface PositionProtoMsg { + typeUrl: "/injective.stream.v1beta1.Position"; + value: Uint8Array; +} +export interface PositionAmino { + market_id: string; + subaccount_id: string; + isLong: boolean; + quantity: string; + entry_price: string; + margin: string; + cumulative_funding_entry: string; +} +export interface PositionAminoMsg { + type: "/injective.stream.v1beta1.Position"; + value: PositionAmino; +} +export interface OraclePrice { + symbol: string; + price: string; + type: string; +} +export interface OraclePriceProtoMsg { + typeUrl: "/injective.stream.v1beta1.OraclePrice"; + value: Uint8Array; +} +export interface OraclePriceAmino { + symbol: string; + price: string; + type: string; +} +export interface OraclePriceAminoMsg { + type: "/injective.stream.v1beta1.OraclePrice"; + value: OraclePriceAmino; +} +export interface SpotTrade { + marketId: string; + isBuy: boolean; + executionType: string; + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccountId: string; + fee: string; + orderHash: Uint8Array; + feeRecipientAddress?: string; + cid: string; + tradeId: string; +} +export interface SpotTradeProtoMsg { + typeUrl: "/injective.stream.v1beta1.SpotTrade"; + value: Uint8Array; +} +export interface SpotTradeAmino { + market_id: string; + is_buy: boolean; + executionType: string; + quantity: string; + price: string; + /** bytes32 subaccount ID that executed the trade */ + subaccount_id: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + trade_id: string; +} +export interface SpotTradeAminoMsg { + type: "/injective.stream.v1beta1.SpotTrade"; + value: SpotTradeAmino; +} +export interface DerivativeTrade { + marketId: string; + isBuy: boolean; + executionType: string; + subaccountId: string; + positionDelta?: PositionDelta; + payout: string; + fee: string; + orderHash: string; + feeRecipientAddress?: string; + cid: string; + tradeId: string; +} +export interface DerivativeTradeProtoMsg { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade"; + value: Uint8Array; +} +export interface DerivativeTradeAmino { + market_id: string; + is_buy: boolean; + executionType: string; + subaccount_id: string; + position_delta?: PositionDeltaAmino; + payout: string; + fee: string; + order_hash: string; + fee_recipient_address?: string; + cid: string; + trade_id: string; +} +export interface DerivativeTradeAminoMsg { + type: "/injective.stream.v1beta1.DerivativeTrade"; + value: DerivativeTradeAmino; +} +export interface TradesFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface TradesFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.TradesFilter"; + value: Uint8Array; +} +export interface TradesFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface TradesFilterAminoMsg { + type: "/injective.stream.v1beta1.TradesFilter"; + value: TradesFilterAmino; +} +export interface PositionsFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface PositionsFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.PositionsFilter"; + value: Uint8Array; +} +export interface PositionsFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface PositionsFilterAminoMsg { + type: "/injective.stream.v1beta1.PositionsFilter"; + value: PositionsFilterAmino; +} +export interface OrdersFilter { + subaccountIds: string[]; + marketIds: string[]; +} +export interface OrdersFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrdersFilter"; + value: Uint8Array; +} +export interface OrdersFilterAmino { + subaccount_ids: string[]; + market_ids: string[]; +} +export interface OrdersFilterAminoMsg { + type: "/injective.stream.v1beta1.OrdersFilter"; + value: OrdersFilterAmino; +} +export interface OrderbookFilter { + marketIds: string[]; +} +export interface OrderbookFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter"; + value: Uint8Array; +} +export interface OrderbookFilterAmino { + market_ids: string[]; +} +export interface OrderbookFilterAminoMsg { + type: "/injective.stream.v1beta1.OrderbookFilter"; + value: OrderbookFilterAmino; +} +export interface BankBalancesFilter { + accounts: string[]; +} +export interface BankBalancesFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter"; + value: Uint8Array; +} +export interface BankBalancesFilterAmino { + accounts: string[]; +} +export interface BankBalancesFilterAminoMsg { + type: "/injective.stream.v1beta1.BankBalancesFilter"; + value: BankBalancesFilterAmino; +} +export interface SubaccountDepositsFilter { + subaccountIds: string[]; +} +export interface SubaccountDepositsFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter"; + value: Uint8Array; +} +export interface SubaccountDepositsFilterAmino { + subaccount_ids: string[]; +} +export interface SubaccountDepositsFilterAminoMsg { + type: "/injective.stream.v1beta1.SubaccountDepositsFilter"; + value: SubaccountDepositsFilterAmino; +} +export interface OraclePriceFilter { + symbol: string[]; +} +export interface OraclePriceFilterProtoMsg { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter"; + value: Uint8Array; +} +export interface OraclePriceFilterAmino { + symbol: string[]; +} +export interface OraclePriceFilterAminoMsg { + type: "/injective.stream.v1beta1.OraclePriceFilter"; + value: OraclePriceFilterAmino; +} +function createBaseStreamRequest(): StreamRequest { + return { + bankBalancesFilter: undefined, + subaccountDepositsFilter: undefined, + spotTradesFilter: undefined, + derivativeTradesFilter: undefined, + spotOrdersFilter: undefined, + derivativeOrdersFilter: undefined, + spotOrderbooksFilter: undefined, + derivativeOrderbooksFilter: undefined, + positionsFilter: undefined, + oraclePriceFilter: undefined + }; +} +export const StreamRequest = { + typeUrl: "/injective.stream.v1beta1.StreamRequest", + is(o: any): o is StreamRequest { + return o && o.$typeUrl === StreamRequest.typeUrl; + }, + isAmino(o: any): o is StreamRequestAmino { + return o && o.$typeUrl === StreamRequest.typeUrl; + }, + encode(message: StreamRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bankBalancesFilter !== undefined) { + BankBalancesFilter.encode(message.bankBalancesFilter, writer.uint32(10).fork()).ldelim(); + } + if (message.subaccountDepositsFilter !== undefined) { + SubaccountDepositsFilter.encode(message.subaccountDepositsFilter, writer.uint32(18).fork()).ldelim(); + } + if (message.spotTradesFilter !== undefined) { + TradesFilter.encode(message.spotTradesFilter, writer.uint32(26).fork()).ldelim(); + } + if (message.derivativeTradesFilter !== undefined) { + TradesFilter.encode(message.derivativeTradesFilter, writer.uint32(34).fork()).ldelim(); + } + if (message.spotOrdersFilter !== undefined) { + OrdersFilter.encode(message.spotOrdersFilter, writer.uint32(42).fork()).ldelim(); + } + if (message.derivativeOrdersFilter !== undefined) { + OrdersFilter.encode(message.derivativeOrdersFilter, writer.uint32(50).fork()).ldelim(); + } + if (message.spotOrderbooksFilter !== undefined) { + OrderbookFilter.encode(message.spotOrderbooksFilter, writer.uint32(58).fork()).ldelim(); + } + if (message.derivativeOrderbooksFilter !== undefined) { + OrderbookFilter.encode(message.derivativeOrderbooksFilter, writer.uint32(66).fork()).ldelim(); + } + if (message.positionsFilter !== undefined) { + PositionsFilter.encode(message.positionsFilter, writer.uint32(74).fork()).ldelim(); + } + if (message.oraclePriceFilter !== undefined) { + OraclePriceFilter.encode(message.oraclePriceFilter, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bankBalancesFilter = BankBalancesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountDepositsFilter = SubaccountDepositsFilter.decode(reader, reader.uint32()); + break; + case 3: + message.spotTradesFilter = TradesFilter.decode(reader, reader.uint32()); + break; + case 4: + message.derivativeTradesFilter = TradesFilter.decode(reader, reader.uint32()); + break; + case 5: + message.spotOrdersFilter = OrdersFilter.decode(reader, reader.uint32()); + break; + case 6: + message.derivativeOrdersFilter = OrdersFilter.decode(reader, reader.uint32()); + break; + case 7: + message.spotOrderbooksFilter = OrderbookFilter.decode(reader, reader.uint32()); + break; + case 8: + message.derivativeOrderbooksFilter = OrderbookFilter.decode(reader, reader.uint32()); + break; + case 9: + message.positionsFilter = PositionsFilter.decode(reader, reader.uint32()); + break; + case 10: + message.oraclePriceFilter = OraclePriceFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StreamRequest { + const message = createBaseStreamRequest(); + message.bankBalancesFilter = object.bankBalancesFilter !== undefined && object.bankBalancesFilter !== null ? BankBalancesFilter.fromPartial(object.bankBalancesFilter) : undefined; + message.subaccountDepositsFilter = object.subaccountDepositsFilter !== undefined && object.subaccountDepositsFilter !== null ? SubaccountDepositsFilter.fromPartial(object.subaccountDepositsFilter) : undefined; + message.spotTradesFilter = object.spotTradesFilter !== undefined && object.spotTradesFilter !== null ? TradesFilter.fromPartial(object.spotTradesFilter) : undefined; + message.derivativeTradesFilter = object.derivativeTradesFilter !== undefined && object.derivativeTradesFilter !== null ? TradesFilter.fromPartial(object.derivativeTradesFilter) : undefined; + message.spotOrdersFilter = object.spotOrdersFilter !== undefined && object.spotOrdersFilter !== null ? OrdersFilter.fromPartial(object.spotOrdersFilter) : undefined; + message.derivativeOrdersFilter = object.derivativeOrdersFilter !== undefined && object.derivativeOrdersFilter !== null ? OrdersFilter.fromPartial(object.derivativeOrdersFilter) : undefined; + message.spotOrderbooksFilter = object.spotOrderbooksFilter !== undefined && object.spotOrderbooksFilter !== null ? OrderbookFilter.fromPartial(object.spotOrderbooksFilter) : undefined; + message.derivativeOrderbooksFilter = object.derivativeOrderbooksFilter !== undefined && object.derivativeOrderbooksFilter !== null ? OrderbookFilter.fromPartial(object.derivativeOrderbooksFilter) : undefined; + message.positionsFilter = object.positionsFilter !== undefined && object.positionsFilter !== null ? PositionsFilter.fromPartial(object.positionsFilter) : undefined; + message.oraclePriceFilter = object.oraclePriceFilter !== undefined && object.oraclePriceFilter !== null ? OraclePriceFilter.fromPartial(object.oraclePriceFilter) : undefined; + return message; + }, + fromAmino(object: StreamRequestAmino): StreamRequest { + const message = createBaseStreamRequest(); + if (object.bank_balances_filter !== undefined && object.bank_balances_filter !== null) { + message.bankBalancesFilter = BankBalancesFilter.fromAmino(object.bank_balances_filter); + } + if (object.subaccount_deposits_filter !== undefined && object.subaccount_deposits_filter !== null) { + message.subaccountDepositsFilter = SubaccountDepositsFilter.fromAmino(object.subaccount_deposits_filter); + } + if (object.spot_trades_filter !== undefined && object.spot_trades_filter !== null) { + message.spotTradesFilter = TradesFilter.fromAmino(object.spot_trades_filter); + } + if (object.derivative_trades_filter !== undefined && object.derivative_trades_filter !== null) { + message.derivativeTradesFilter = TradesFilter.fromAmino(object.derivative_trades_filter); + } + if (object.spot_orders_filter !== undefined && object.spot_orders_filter !== null) { + message.spotOrdersFilter = OrdersFilter.fromAmino(object.spot_orders_filter); + } + if (object.derivative_orders_filter !== undefined && object.derivative_orders_filter !== null) { + message.derivativeOrdersFilter = OrdersFilter.fromAmino(object.derivative_orders_filter); + } + if (object.spot_orderbooks_filter !== undefined && object.spot_orderbooks_filter !== null) { + message.spotOrderbooksFilter = OrderbookFilter.fromAmino(object.spot_orderbooks_filter); + } + if (object.derivative_orderbooks_filter !== undefined && object.derivative_orderbooks_filter !== null) { + message.derivativeOrderbooksFilter = OrderbookFilter.fromAmino(object.derivative_orderbooks_filter); + } + if (object.positions_filter !== undefined && object.positions_filter !== null) { + message.positionsFilter = PositionsFilter.fromAmino(object.positions_filter); + } + if (object.oracle_price_filter !== undefined && object.oracle_price_filter !== null) { + message.oraclePriceFilter = OraclePriceFilter.fromAmino(object.oracle_price_filter); + } + return message; + }, + toAmino(message: StreamRequest): StreamRequestAmino { + const obj: any = {}; + obj.bank_balances_filter = message.bankBalancesFilter ? BankBalancesFilter.toAmino(message.bankBalancesFilter) : undefined; + obj.subaccount_deposits_filter = message.subaccountDepositsFilter ? SubaccountDepositsFilter.toAmino(message.subaccountDepositsFilter) : undefined; + obj.spot_trades_filter = message.spotTradesFilter ? TradesFilter.toAmino(message.spotTradesFilter) : undefined; + obj.derivative_trades_filter = message.derivativeTradesFilter ? TradesFilter.toAmino(message.derivativeTradesFilter) : undefined; + obj.spot_orders_filter = message.spotOrdersFilter ? OrdersFilter.toAmino(message.spotOrdersFilter) : undefined; + obj.derivative_orders_filter = message.derivativeOrdersFilter ? OrdersFilter.toAmino(message.derivativeOrdersFilter) : undefined; + obj.spot_orderbooks_filter = message.spotOrderbooksFilter ? OrderbookFilter.toAmino(message.spotOrderbooksFilter) : undefined; + obj.derivative_orderbooks_filter = message.derivativeOrderbooksFilter ? OrderbookFilter.toAmino(message.derivativeOrderbooksFilter) : undefined; + obj.positions_filter = message.positionsFilter ? PositionsFilter.toAmino(message.positionsFilter) : undefined; + obj.oracle_price_filter = message.oraclePriceFilter ? OraclePriceFilter.toAmino(message.oraclePriceFilter) : undefined; + return obj; + }, + fromAminoMsg(object: StreamRequestAminoMsg): StreamRequest { + return StreamRequest.fromAmino(object.value); + }, + fromProtoMsg(message: StreamRequestProtoMsg): StreamRequest { + return StreamRequest.decode(message.value); + }, + toProto(message: StreamRequest): Uint8Array { + return StreamRequest.encode(message).finish(); + }, + toProtoMsg(message: StreamRequest): StreamRequestProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.StreamRequest", + value: StreamRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StreamRequest.typeUrl, StreamRequest); +function createBaseStreamResponse(): StreamResponse { + return { + blockHeight: BigInt(0), + blockTime: BigInt(0), + bankBalances: [], + subaccountDeposits: [], + spotTrades: [], + derivativeTrades: [], + spotOrders: [], + derivativeOrders: [], + spotOrderbookUpdates: [], + derivativeOrderbookUpdates: [], + positions: [], + oraclePrices: [] + }; +} +export const StreamResponse = { + typeUrl: "/injective.stream.v1beta1.StreamResponse", + is(o: any): o is StreamResponse { + return o && (o.$typeUrl === StreamResponse.typeUrl || typeof o.blockHeight === "bigint" && typeof o.blockTime === "bigint" && Array.isArray(o.bankBalances) && (!o.bankBalances.length || BankBalance.is(o.bankBalances[0])) && Array.isArray(o.subaccountDeposits) && (!o.subaccountDeposits.length || SubaccountDeposits.is(o.subaccountDeposits[0])) && Array.isArray(o.spotTrades) && (!o.spotTrades.length || SpotTrade.is(o.spotTrades[0])) && Array.isArray(o.derivativeTrades) && (!o.derivativeTrades.length || DerivativeTrade.is(o.derivativeTrades[0])) && Array.isArray(o.spotOrders) && (!o.spotOrders.length || SpotOrderUpdate.is(o.spotOrders[0])) && Array.isArray(o.derivativeOrders) && (!o.derivativeOrders.length || DerivativeOrderUpdate.is(o.derivativeOrders[0])) && Array.isArray(o.spotOrderbookUpdates) && (!o.spotOrderbookUpdates.length || OrderbookUpdate.is(o.spotOrderbookUpdates[0])) && Array.isArray(o.derivativeOrderbookUpdates) && (!o.derivativeOrderbookUpdates.length || OrderbookUpdate.is(o.derivativeOrderbookUpdates[0])) && Array.isArray(o.positions) && (!o.positions.length || Position.is(o.positions[0])) && Array.isArray(o.oraclePrices) && (!o.oraclePrices.length || OraclePrice.is(o.oraclePrices[0]))); + }, + isAmino(o: any): o is StreamResponseAmino { + return o && (o.$typeUrl === StreamResponse.typeUrl || typeof o.block_height === "bigint" && typeof o.block_time === "bigint" && Array.isArray(o.bank_balances) && (!o.bank_balances.length || BankBalance.isAmino(o.bank_balances[0])) && Array.isArray(o.subaccount_deposits) && (!o.subaccount_deposits.length || SubaccountDeposits.isAmino(o.subaccount_deposits[0])) && Array.isArray(o.spot_trades) && (!o.spot_trades.length || SpotTrade.isAmino(o.spot_trades[0])) && Array.isArray(o.derivative_trades) && (!o.derivative_trades.length || DerivativeTrade.isAmino(o.derivative_trades[0])) && Array.isArray(o.spot_orders) && (!o.spot_orders.length || SpotOrderUpdate.isAmino(o.spot_orders[0])) && Array.isArray(o.derivative_orders) && (!o.derivative_orders.length || DerivativeOrderUpdate.isAmino(o.derivative_orders[0])) && Array.isArray(o.spot_orderbook_updates) && (!o.spot_orderbook_updates.length || OrderbookUpdate.isAmino(o.spot_orderbook_updates[0])) && Array.isArray(o.derivative_orderbook_updates) && (!o.derivative_orderbook_updates.length || OrderbookUpdate.isAmino(o.derivative_orderbook_updates[0])) && Array.isArray(o.positions) && (!o.positions.length || Position.isAmino(o.positions[0])) && Array.isArray(o.oracle_prices) && (!o.oracle_prices.length || OraclePrice.isAmino(o.oracle_prices[0]))); + }, + encode(message: StreamResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.blockHeight); + } + if (message.blockTime !== BigInt(0)) { + writer.uint32(16).int64(message.blockTime); + } + for (const v of message.bankBalances) { + BankBalance.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.subaccountDeposits) { + SubaccountDeposits.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.spotTrades) { + SpotTrade.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.derivativeTrades) { + DerivativeTrade.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.spotOrders) { + SpotOrderUpdate.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.derivativeOrders) { + DerivativeOrderUpdate.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.spotOrderbookUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.derivativeOrderbookUpdates) { + OrderbookUpdate.encode(v!, writer.uint32(82).fork()).ldelim(); + } + for (const v of message.positions) { + Position.encode(v!, writer.uint32(90).fork()).ldelim(); + } + for (const v of message.oraclePrices) { + OraclePrice.encode(v!, writer.uint32(98).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.blockTime = reader.int64(); + break; + case 3: + message.bankBalances.push(BankBalance.decode(reader, reader.uint32())); + break; + case 4: + message.subaccountDeposits.push(SubaccountDeposits.decode(reader, reader.uint32())); + break; + case 5: + message.spotTrades.push(SpotTrade.decode(reader, reader.uint32())); + break; + case 6: + message.derivativeTrades.push(DerivativeTrade.decode(reader, reader.uint32())); + break; + case 7: + message.spotOrders.push(SpotOrderUpdate.decode(reader, reader.uint32())); + break; + case 8: + message.derivativeOrders.push(DerivativeOrderUpdate.decode(reader, reader.uint32())); + break; + case 9: + message.spotOrderbookUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 10: + message.derivativeOrderbookUpdates.push(OrderbookUpdate.decode(reader, reader.uint32())); + break; + case 11: + message.positions.push(Position.decode(reader, reader.uint32())); + break; + case 12: + message.oraclePrices.push(OraclePrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): StreamResponse { + const message = createBaseStreamResponse(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.blockTime = object.blockTime !== undefined && object.blockTime !== null ? BigInt(object.blockTime.toString()) : BigInt(0); + message.bankBalances = object.bankBalances?.map(e => BankBalance.fromPartial(e)) || []; + message.subaccountDeposits = object.subaccountDeposits?.map(e => SubaccountDeposits.fromPartial(e)) || []; + message.spotTrades = object.spotTrades?.map(e => SpotTrade.fromPartial(e)) || []; + message.derivativeTrades = object.derivativeTrades?.map(e => DerivativeTrade.fromPartial(e)) || []; + message.spotOrders = object.spotOrders?.map(e => SpotOrderUpdate.fromPartial(e)) || []; + message.derivativeOrders = object.derivativeOrders?.map(e => DerivativeOrderUpdate.fromPartial(e)) || []; + message.spotOrderbookUpdates = object.spotOrderbookUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.derivativeOrderbookUpdates = object.derivativeOrderbookUpdates?.map(e => OrderbookUpdate.fromPartial(e)) || []; + message.positions = object.positions?.map(e => Position.fromPartial(e)) || []; + message.oraclePrices = object.oraclePrices?.map(e => OraclePrice.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StreamResponseAmino): StreamResponse { + const message = createBaseStreamResponse(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.block_time !== undefined && object.block_time !== null) { + message.blockTime = BigInt(object.block_time); + } + message.bankBalances = object.bank_balances?.map(e => BankBalance.fromAmino(e)) || []; + message.subaccountDeposits = object.subaccount_deposits?.map(e => SubaccountDeposits.fromAmino(e)) || []; + message.spotTrades = object.spot_trades?.map(e => SpotTrade.fromAmino(e)) || []; + message.derivativeTrades = object.derivative_trades?.map(e => DerivativeTrade.fromAmino(e)) || []; + message.spotOrders = object.spot_orders?.map(e => SpotOrderUpdate.fromAmino(e)) || []; + message.derivativeOrders = object.derivative_orders?.map(e => DerivativeOrderUpdate.fromAmino(e)) || []; + message.spotOrderbookUpdates = object.spot_orderbook_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.derivativeOrderbookUpdates = object.derivative_orderbook_updates?.map(e => OrderbookUpdate.fromAmino(e)) || []; + message.positions = object.positions?.map(e => Position.fromAmino(e)) || []; + message.oraclePrices = object.oracle_prices?.map(e => OraclePrice.fromAmino(e)) || []; + return message; + }, + toAmino(message: StreamResponse): StreamResponseAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; + obj.block_time = message.blockTime !== BigInt(0) ? message.blockTime?.toString() : undefined; + if (message.bankBalances) { + obj.bank_balances = message.bankBalances.map(e => e ? BankBalance.toAmino(e) : undefined); + } else { + obj.bank_balances = message.bankBalances; + } + if (message.subaccountDeposits) { + obj.subaccount_deposits = message.subaccountDeposits.map(e => e ? SubaccountDeposits.toAmino(e) : undefined); + } else { + obj.subaccount_deposits = message.subaccountDeposits; + } + if (message.spotTrades) { + obj.spot_trades = message.spotTrades.map(e => e ? SpotTrade.toAmino(e) : undefined); + } else { + obj.spot_trades = message.spotTrades; + } + if (message.derivativeTrades) { + obj.derivative_trades = message.derivativeTrades.map(e => e ? DerivativeTrade.toAmino(e) : undefined); + } else { + obj.derivative_trades = message.derivativeTrades; + } + if (message.spotOrders) { + obj.spot_orders = message.spotOrders.map(e => e ? SpotOrderUpdate.toAmino(e) : undefined); + } else { + obj.spot_orders = message.spotOrders; + } + if (message.derivativeOrders) { + obj.derivative_orders = message.derivativeOrders.map(e => e ? DerivativeOrderUpdate.toAmino(e) : undefined); + } else { + obj.derivative_orders = message.derivativeOrders; + } + if (message.spotOrderbookUpdates) { + obj.spot_orderbook_updates = message.spotOrderbookUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.spot_orderbook_updates = message.spotOrderbookUpdates; + } + if (message.derivativeOrderbookUpdates) { + obj.derivative_orderbook_updates = message.derivativeOrderbookUpdates.map(e => e ? OrderbookUpdate.toAmino(e) : undefined); + } else { + obj.derivative_orderbook_updates = message.derivativeOrderbookUpdates; + } + if (message.positions) { + obj.positions = message.positions.map(e => e ? Position.toAmino(e) : undefined); + } else { + obj.positions = message.positions; + } + if (message.oraclePrices) { + obj.oracle_prices = message.oraclePrices.map(e => e ? OraclePrice.toAmino(e) : undefined); + } else { + obj.oracle_prices = message.oraclePrices; + } + return obj; + }, + fromAminoMsg(object: StreamResponseAminoMsg): StreamResponse { + return StreamResponse.fromAmino(object.value); + }, + fromProtoMsg(message: StreamResponseProtoMsg): StreamResponse { + return StreamResponse.decode(message.value); + }, + toProto(message: StreamResponse): Uint8Array { + return StreamResponse.encode(message).finish(); + }, + toProtoMsg(message: StreamResponse): StreamResponseProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.StreamResponse", + value: StreamResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StreamResponse.typeUrl, StreamResponse); +function createBaseOrderbookUpdate(): OrderbookUpdate { + return { + seq: BigInt(0), + orderbook: undefined + }; +} +export const OrderbookUpdate = { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate", + is(o: any): o is OrderbookUpdate { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + isAmino(o: any): o is OrderbookUpdateAmino { + return o && (o.$typeUrl === OrderbookUpdate.typeUrl || typeof o.seq === "bigint"); + }, + encode(message: OrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seq !== BigInt(0)) { + writer.uint32(8).uint64(message.seq); + } + if (message.orderbook !== undefined) { + Orderbook.encode(message.orderbook, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seq = reader.uint64(); + break; + case 2: + message.orderbook = Orderbook.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + message.seq = object.seq !== undefined && object.seq !== null ? BigInt(object.seq.toString()) : BigInt(0); + message.orderbook = object.orderbook !== undefined && object.orderbook !== null ? Orderbook.fromPartial(object.orderbook) : undefined; + return message; + }, + fromAmino(object: OrderbookUpdateAmino): OrderbookUpdate { + const message = createBaseOrderbookUpdate(); + if (object.seq !== undefined && object.seq !== null) { + message.seq = BigInt(object.seq); + } + if (object.orderbook !== undefined && object.orderbook !== null) { + message.orderbook = Orderbook.fromAmino(object.orderbook); + } + return message; + }, + toAmino(message: OrderbookUpdate): OrderbookUpdateAmino { + const obj: any = {}; + obj.seq = message.seq !== BigInt(0) ? message.seq?.toString() : undefined; + obj.orderbook = message.orderbook ? Orderbook.toAmino(message.orderbook) : undefined; + return obj; + }, + fromAminoMsg(object: OrderbookUpdateAminoMsg): OrderbookUpdate { + return OrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookUpdateProtoMsg): OrderbookUpdate { + return OrderbookUpdate.decode(message.value); + }, + toProto(message: OrderbookUpdate): Uint8Array { + return OrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: OrderbookUpdate): OrderbookUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrderbookUpdate", + value: OrderbookUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookUpdate.typeUrl, OrderbookUpdate); +function createBaseOrderbook(): Orderbook { + return { + marketId: "", + buyLevels: [], + sellLevels: [] + }; +} +export const Orderbook = { + typeUrl: "/injective.stream.v1beta1.Orderbook", + is(o: any): o is Orderbook { + return o && (o.$typeUrl === Orderbook.typeUrl || typeof o.marketId === "string" && Array.isArray(o.buyLevels) && (!o.buyLevels.length || Level.is(o.buyLevels[0])) && Array.isArray(o.sellLevels) && (!o.sellLevels.length || Level.is(o.sellLevels[0]))); + }, + isAmino(o: any): o is OrderbookAmino { + return o && (o.$typeUrl === Orderbook.typeUrl || typeof o.market_id === "string" && Array.isArray(o.buy_levels) && (!o.buy_levels.length || Level.isAmino(o.buy_levels[0])) && Array.isArray(o.sell_levels) && (!o.sell_levels.length || Level.isAmino(o.sell_levels[0]))); + }, + encode(message: Orderbook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + for (const v of message.buyLevels) { + Level.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.sellLevels) { + Level.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Orderbook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.buyLevels.push(Level.decode(reader, reader.uint32())); + break; + case 3: + message.sellLevels.push(Level.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Orderbook { + const message = createBaseOrderbook(); + message.marketId = object.marketId ?? ""; + message.buyLevels = object.buyLevels?.map(e => Level.fromPartial(e)) || []; + message.sellLevels = object.sellLevels?.map(e => Level.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OrderbookAmino): Orderbook { + const message = createBaseOrderbook(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.buyLevels = object.buy_levels?.map(e => Level.fromAmino(e)) || []; + message.sellLevels = object.sell_levels?.map(e => Level.fromAmino(e)) || []; + return message; + }, + toAmino(message: Orderbook): OrderbookAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + if (message.buyLevels) { + obj.buy_levels = message.buyLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.buy_levels = message.buyLevels; + } + if (message.sellLevels) { + obj.sell_levels = message.sellLevels.map(e => e ? Level.toAmino(e) : undefined); + } else { + obj.sell_levels = message.sellLevels; + } + return obj; + }, + fromAminoMsg(object: OrderbookAminoMsg): Orderbook { + return Orderbook.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookProtoMsg): Orderbook { + return Orderbook.decode(message.value); + }, + toProto(message: Orderbook): Uint8Array { + return Orderbook.encode(message).finish(); + }, + toProtoMsg(message: Orderbook): OrderbookProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.Orderbook", + value: Orderbook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Orderbook.typeUrl, Orderbook); +function createBaseBankBalance(): BankBalance { + return { + account: "", + balances: [] + }; +} +export const BankBalance = { + typeUrl: "/injective.stream.v1beta1.BankBalance", + is(o: any): o is BankBalance { + return o && (o.$typeUrl === BankBalance.typeUrl || typeof o.account === "string" && Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isAmino(o: any): o is BankBalanceAmino { + return o && (o.$typeUrl === BankBalance.typeUrl || typeof o.account === "string" && Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: BankBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BankBalance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBankBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BankBalance { + const message = createBaseBankBalance(); + message.account = object.account ?? ""; + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BankBalanceAmino): BankBalance { + const message = createBaseBankBalance(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: BankBalance): BankBalanceAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + return obj; + }, + fromAminoMsg(object: BankBalanceAminoMsg): BankBalance { + return BankBalance.fromAmino(object.value); + }, + fromProtoMsg(message: BankBalanceProtoMsg): BankBalance { + return BankBalance.decode(message.value); + }, + toProto(message: BankBalance): Uint8Array { + return BankBalance.encode(message).finish(); + }, + toProtoMsg(message: BankBalance): BankBalanceProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.BankBalance", + value: BankBalance.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BankBalance.typeUrl, BankBalance); +function createBaseSubaccountDeposits(): SubaccountDeposits { + return { + subaccountId: "", + deposits: [] + }; +} +export const SubaccountDeposits = { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits", + is(o: any): o is SubaccountDeposits { + return o && (o.$typeUrl === SubaccountDeposits.typeUrl || typeof o.subaccountId === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.is(o.deposits[0]))); + }, + isAmino(o: any): o is SubaccountDepositsAmino { + return o && (o.$typeUrl === SubaccountDeposits.typeUrl || typeof o.subaccount_id === "string" && Array.isArray(o.deposits) && (!o.deposits.length || SubaccountDeposit.isAmino(o.deposits[0]))); + }, + encode(message: SubaccountDeposits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== "") { + writer.uint32(10).string(message.subaccountId); + } + for (const v of message.deposits) { + SubaccountDeposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = reader.string(); + break; + case 2: + message.deposits.push(SubaccountDeposit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposits { + const message = createBaseSubaccountDeposits(); + message.subaccountId = object.subaccountId ?? ""; + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SubaccountDepositsAmino): SubaccountDeposits { + const message = createBaseSubaccountDeposits(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + message.deposits = object.deposits?.map(e => SubaccountDeposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: SubaccountDeposits): SubaccountDepositsAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? SubaccountDeposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + return obj; + }, + fromAminoMsg(object: SubaccountDepositsAminoMsg): SubaccountDeposits { + return SubaccountDeposits.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositsProtoMsg): SubaccountDeposits { + return SubaccountDeposits.decode(message.value); + }, + toProto(message: SubaccountDeposits): Uint8Array { + return SubaccountDeposits.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposits): SubaccountDepositsProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposits", + value: SubaccountDeposits.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposits.typeUrl, SubaccountDeposits); +function createBaseSubaccountDeposit(): SubaccountDeposit { + return { + denom: "", + deposit: Deposit.fromPartial({}) + }; +} +export const SubaccountDeposit = { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit", + is(o: any): o is SubaccountDeposit { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || typeof o.denom === "string" && Deposit.is(o.deposit)); + }, + isAmino(o: any): o is SubaccountDepositAmino { + return o && (o.$typeUrl === SubaccountDeposit.typeUrl || typeof o.denom === "string" && Deposit.isAmino(o.deposit)); + }, + encode(message: SubaccountDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + message.denom = object.denom ?? ""; + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: SubaccountDepositAmino): SubaccountDeposit { + const message = createBaseSubaccountDeposit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: SubaccountDeposit): SubaccountDepositAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountDepositAminoMsg): SubaccountDeposit { + return SubaccountDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositProtoMsg): SubaccountDeposit { + return SubaccountDeposit.decode(message.value); + }, + toProto(message: SubaccountDeposit): Uint8Array { + return SubaccountDeposit.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDeposit): SubaccountDepositProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDeposit", + value: SubaccountDeposit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDeposit.typeUrl, SubaccountDeposit); +function createBaseSpotOrderUpdate(): SpotOrderUpdate { + return { + status: 0, + orderHash: new Uint8Array(), + cid: "", + order: undefined + }; +} +export const SpotOrderUpdate = { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate", + is(o: any): o is SpotOrderUpdate { + return o && (o.$typeUrl === SpotOrderUpdate.typeUrl || isSet(o.status) && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is SpotOrderUpdateAmino { + return o && (o.$typeUrl === SpotOrderUpdate.typeUrl || isSet(o.status) && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: SpotOrderUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + if (message.order !== undefined) { + SpotOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrderUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrderUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + case 2: + message.orderHash = reader.bytes(); + break; + case 3: + message.cid = reader.string(); + break; + case 4: + message.order = SpotOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrderUpdate { + const message = createBaseSpotOrderUpdate(); + message.status = object.status ?? 0; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.cid = object.cid ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: SpotOrderUpdateAmino): SpotOrderUpdate { + const message = createBaseSpotOrderUpdate(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: SpotOrderUpdate): SpotOrderUpdateAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.order = message.order ? SpotOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: SpotOrderUpdateAminoMsg): SpotOrderUpdate { + return SpotOrderUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderUpdateProtoMsg): SpotOrderUpdate { + return SpotOrderUpdate.decode(message.value); + }, + toProto(message: SpotOrderUpdate): Uint8Array { + return SpotOrderUpdate.encode(message).finish(); + }, + toProtoMsg(message: SpotOrderUpdate): SpotOrderUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotOrderUpdate", + value: SpotOrderUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrderUpdate.typeUrl, SpotOrderUpdate); +function createBaseSpotOrder(): SpotOrder { + return { + marketId: "", + order: SpotLimitOrder.fromPartial({}) + }; +} +export const SpotOrder = { + typeUrl: "/injective.stream.v1beta1.SpotOrder", + is(o: any): o is SpotOrder { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.marketId === "string" && SpotLimitOrder.is(o.order)); + }, + isAmino(o: any): o is SpotOrderAmino { + return o && (o.$typeUrl === SpotOrder.typeUrl || typeof o.market_id === "string" && SpotLimitOrder.isAmino(o.order)); + }, + encode(message: SpotOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + SpotLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = SpotLimitOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotOrder { + const message = createBaseSpotOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? SpotLimitOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: SpotOrderAmino): SpotOrder { + const message = createBaseSpotOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = SpotLimitOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: SpotOrder): SpotOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? SpotLimitOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: SpotOrderAminoMsg): SpotOrder { + return SpotOrder.fromAmino(object.value); + }, + fromProtoMsg(message: SpotOrderProtoMsg): SpotOrder { + return SpotOrder.decode(message.value); + }, + toProto(message: SpotOrder): Uint8Array { + return SpotOrder.encode(message).finish(); + }, + toProtoMsg(message: SpotOrder): SpotOrderProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotOrder", + value: SpotOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotOrder.typeUrl, SpotOrder); +function createBaseDerivativeOrderUpdate(): DerivativeOrderUpdate { + return { + status: 0, + orderHash: new Uint8Array(), + cid: "", + order: undefined + }; +} +export const DerivativeOrderUpdate = { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate", + is(o: any): o is DerivativeOrderUpdate { + return o && (o.$typeUrl === DerivativeOrderUpdate.typeUrl || isSet(o.status) && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string"); + }, + isAmino(o: any): o is DerivativeOrderUpdateAmino { + return o && (o.$typeUrl === DerivativeOrderUpdate.typeUrl || isSet(o.status) && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string"); + }, + encode(message: DerivativeOrderUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.orderHash.length !== 0) { + writer.uint32(18).bytes(message.orderHash); + } + if (message.cid !== "") { + writer.uint32(26).string(message.cid); + } + if (message.order !== undefined) { + DerivativeOrder.encode(message.order, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrderUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrderUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + case 2: + message.orderHash = reader.bytes(); + break; + case 3: + message.cid = reader.string(); + break; + case 4: + message.order = DerivativeOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrderUpdate { + const message = createBaseDerivativeOrderUpdate(); + message.status = object.status ?? 0; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.cid = object.cid ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: DerivativeOrderUpdateAmino): DerivativeOrderUpdate { + const message = createBaseDerivativeOrderUpdate(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: DerivativeOrderUpdate): DerivativeOrderUpdateAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.order = message.order ? DerivativeOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: DerivativeOrderUpdateAminoMsg): DerivativeOrderUpdate { + return DerivativeOrderUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderUpdateProtoMsg): DerivativeOrderUpdate { + return DerivativeOrderUpdate.decode(message.value); + }, + toProto(message: DerivativeOrderUpdate): Uint8Array { + return DerivativeOrderUpdate.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrderUpdate): DerivativeOrderUpdateProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeOrderUpdate", + value: DerivativeOrderUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrderUpdate.typeUrl, DerivativeOrderUpdate); +function createBaseDerivativeOrder(): DerivativeOrder { + return { + marketId: "", + order: DerivativeLimitOrder.fromPartial({}), + isMarket: false + }; +} +export const DerivativeOrder = { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder", + is(o: any): o is DerivativeOrder { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.marketId === "string" && DerivativeLimitOrder.is(o.order) && typeof o.isMarket === "boolean"); + }, + isAmino(o: any): o is DerivativeOrderAmino { + return o && (o.$typeUrl === DerivativeOrder.typeUrl || typeof o.market_id === "string" && DerivativeLimitOrder.isAmino(o.order) && typeof o.is_market === "boolean"); + }, + encode(message: DerivativeOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.order !== undefined) { + DerivativeLimitOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.isMarket === true) { + writer.uint32(24).bool(message.isMarket); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.order = DerivativeLimitOrder.decode(reader, reader.uint32()); + break; + case 3: + message.isMarket = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeOrder { + const message = createBaseDerivativeOrder(); + message.marketId = object.marketId ?? ""; + message.order = object.order !== undefined && object.order !== null ? DerivativeLimitOrder.fromPartial(object.order) : undefined; + message.isMarket = object.isMarket ?? false; + return message; + }, + fromAmino(object: DerivativeOrderAmino): DerivativeOrder { + const message = createBaseDerivativeOrder(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.order !== undefined && object.order !== null) { + message.order = DerivativeLimitOrder.fromAmino(object.order); + } + if (object.is_market !== undefined && object.is_market !== null) { + message.isMarket = object.is_market; + } + return message; + }, + toAmino(message: DerivativeOrder): DerivativeOrderAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.order = message.order ? DerivativeLimitOrder.toAmino(message.order) : undefined; + obj.is_market = message.isMarket === false ? undefined : message.isMarket; + return obj; + }, + fromAminoMsg(object: DerivativeOrderAminoMsg): DerivativeOrder { + return DerivativeOrder.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeOrderProtoMsg): DerivativeOrder { + return DerivativeOrder.decode(message.value); + }, + toProto(message: DerivativeOrder): Uint8Array { + return DerivativeOrder.encode(message).finish(); + }, + toProtoMsg(message: DerivativeOrder): DerivativeOrderProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeOrder", + value: DerivativeOrder.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeOrder.typeUrl, DerivativeOrder); +function createBasePosition(): Position { + return { + marketId: "", + subaccountId: "", + isLong: false, + quantity: "", + entryPrice: "", + margin: "", + cumulativeFundingEntry: "" + }; +} +export const Position = { + typeUrl: "/injective.stream.v1beta1.Position", + is(o: any): o is Position { + return o && (o.$typeUrl === Position.typeUrl || typeof o.marketId === "string" && typeof o.subaccountId === "string" && typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entryPrice === "string" && typeof o.margin === "string" && typeof o.cumulativeFundingEntry === "string"); + }, + isAmino(o: any): o is PositionAmino { + return o && (o.$typeUrl === Position.typeUrl || typeof o.market_id === "string" && typeof o.subaccount_id === "string" && typeof o.isLong === "boolean" && typeof o.quantity === "string" && typeof o.entry_price === "string" && typeof o.margin === "string" && typeof o.cumulative_funding_entry === "string"); + }, + encode(message: Position, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.subaccountId !== "") { + writer.uint32(18).string(message.subaccountId); + } + if (message.isLong === true) { + writer.uint32(24).bool(message.isLong); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.entryPrice !== "") { + writer.uint32(42).string(message.entryPrice); + } + if (message.margin !== "") { + writer.uint32(50).string(message.margin); + } + if (message.cumulativeFundingEntry !== "") { + writer.uint32(58).string(message.cumulativeFundingEntry); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Position { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.subaccountId = reader.string(); + break; + case 3: + message.isLong = reader.bool(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.entryPrice = reader.string(); + break; + case 6: + message.margin = reader.string(); + break; + case 7: + message.cumulativeFundingEntry = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Position { + const message = createBasePosition(); + message.marketId = object.marketId ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.isLong = object.isLong ?? false; + message.quantity = object.quantity ?? ""; + message.entryPrice = object.entryPrice ?? ""; + message.margin = object.margin ?? ""; + message.cumulativeFundingEntry = object.cumulativeFundingEntry ?? ""; + return message; + }, + fromAmino(object: PositionAmino): Position { + const message = createBasePosition(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.isLong !== undefined && object.isLong !== null) { + message.isLong = object.isLong; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.entry_price !== undefined && object.entry_price !== null) { + message.entryPrice = object.entry_price; + } + if (object.margin !== undefined && object.margin !== null) { + message.margin = object.margin; + } + if (object.cumulative_funding_entry !== undefined && object.cumulative_funding_entry !== null) { + message.cumulativeFundingEntry = object.cumulative_funding_entry; + } + return message; + }, + toAmino(message: Position): PositionAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.isLong = message.isLong === false ? undefined : message.isLong; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.entry_price = message.entryPrice === "" ? undefined : message.entryPrice; + obj.margin = message.margin === "" ? undefined : message.margin; + obj.cumulative_funding_entry = message.cumulativeFundingEntry === "" ? undefined : message.cumulativeFundingEntry; + return obj; + }, + fromAminoMsg(object: PositionAminoMsg): Position { + return Position.fromAmino(object.value); + }, + fromProtoMsg(message: PositionProtoMsg): Position { + return Position.decode(message.value); + }, + toProto(message: Position): Uint8Array { + return Position.encode(message).finish(); + }, + toProtoMsg(message: Position): PositionProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.Position", + value: Position.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Position.typeUrl, Position); +function createBaseOraclePrice(): OraclePrice { + return { + symbol: "", + price: "", + type: "" + }; +} +export const OraclePrice = { + typeUrl: "/injective.stream.v1beta1.OraclePrice", + is(o: any): o is OraclePrice { + return o && (o.$typeUrl === OraclePrice.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.type === "string"); + }, + isAmino(o: any): o is OraclePriceAmino { + return o && (o.$typeUrl === OraclePrice.typeUrl || typeof o.symbol === "string" && typeof o.price === "string" && typeof o.type === "string"); + }, + encode(message: OraclePrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.price !== "") { + writer.uint32(18).string(message.price); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OraclePrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOraclePrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.price = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OraclePrice { + const message = createBaseOraclePrice(); + message.symbol = object.symbol ?? ""; + message.price = object.price ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: OraclePriceAmino): OraclePrice { + const message = createBaseOraclePrice(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: OraclePrice): OraclePriceAmino { + const obj: any = {}; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.price = message.price === "" ? undefined : message.price; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: OraclePriceAminoMsg): OraclePrice { + return OraclePrice.fromAmino(object.value); + }, + fromProtoMsg(message: OraclePriceProtoMsg): OraclePrice { + return OraclePrice.decode(message.value); + }, + toProto(message: OraclePrice): Uint8Array { + return OraclePrice.encode(message).finish(); + }, + toProtoMsg(message: OraclePrice): OraclePriceProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OraclePrice", + value: OraclePrice.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OraclePrice.typeUrl, OraclePrice); +function createBaseSpotTrade(): SpotTrade { + return { + marketId: "", + isBuy: false, + executionType: "", + quantity: "", + price: "", + subaccountId: "", + fee: "", + orderHash: new Uint8Array(), + feeRecipientAddress: undefined, + cid: "", + tradeId: "" + }; +} +export const SpotTrade = { + typeUrl: "/injective.stream.v1beta1.SpotTrade", + is(o: any): o is SpotTrade { + return o && (o.$typeUrl === SpotTrade.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.executionType === "string" && typeof o.quantity === "string" && typeof o.price === "string" && typeof o.subaccountId === "string" && typeof o.fee === "string" && (o.orderHash instanceof Uint8Array || typeof o.orderHash === "string") && typeof o.cid === "string" && typeof o.tradeId === "string"); + }, + isAmino(o: any): o is SpotTradeAmino { + return o && (o.$typeUrl === SpotTrade.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.executionType === "string" && typeof o.quantity === "string" && typeof o.price === "string" && typeof o.subaccount_id === "string" && typeof o.fee === "string" && (o.order_hash instanceof Uint8Array || typeof o.order_hash === "string") && typeof o.cid === "string" && typeof o.trade_id === "string"); + }, + encode(message: SpotTrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== "") { + writer.uint32(26).string(message.executionType); + } + if (message.quantity !== "") { + writer.uint32(34).string(message.quantity); + } + if (message.price !== "") { + writer.uint32(42).string(message.price); + } + if (message.subaccountId !== "") { + writer.uint32(50).string(message.subaccountId); + } + if (message.fee !== "") { + writer.uint32(58).string(message.fee); + } + if (message.orderHash.length !== 0) { + writer.uint32(66).bytes(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(74).string(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(82).string(message.cid); + } + if (message.tradeId !== "") { + writer.uint32(90).string(message.tradeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotTrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotTrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = reader.string(); + break; + case 4: + message.quantity = reader.string(); + break; + case 5: + message.price = reader.string(); + break; + case 6: + message.subaccountId = reader.string(); + break; + case 7: + message.fee = reader.string(); + break; + case 8: + message.orderHash = reader.bytes(); + break; + case 9: + message.feeRecipientAddress = reader.string(); + break; + case 10: + message.cid = reader.string(); + break; + case 11: + message.tradeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SpotTrade { + const message = createBaseSpotTrade(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? ""; + message.quantity = object.quantity ?? ""; + message.price = object.price ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? new Uint8Array(); + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.tradeId = object.tradeId ?? ""; + return message; + }, + fromAmino(object: SpotTradeAmino): SpotTrade { + const message = createBaseSpotTrade(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = bytesFromBase64(object.order_hash); + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = object.fee_recipient_address; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.trade_id !== undefined && object.trade_id !== null) { + message.tradeId = object.trade_id; + } + return message; + }, + toAmino(message: SpotTrade): SpotTradeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === "" ? undefined : message.executionType; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.price = message.price === "" ? undefined : message.price; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash ? base64FromBytes(message.orderHash) : undefined; + obj.fee_recipient_address = message.feeRecipientAddress === null ? undefined : message.feeRecipientAddress; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.trade_id = message.tradeId === "" ? undefined : message.tradeId; + return obj; + }, + fromAminoMsg(object: SpotTradeAminoMsg): SpotTrade { + return SpotTrade.fromAmino(object.value); + }, + fromProtoMsg(message: SpotTradeProtoMsg): SpotTrade { + return SpotTrade.decode(message.value); + }, + toProto(message: SpotTrade): Uint8Array { + return SpotTrade.encode(message).finish(); + }, + toProtoMsg(message: SpotTrade): SpotTradeProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SpotTrade", + value: SpotTrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotTrade.typeUrl, SpotTrade); +function createBaseDerivativeTrade(): DerivativeTrade { + return { + marketId: "", + isBuy: false, + executionType: "", + subaccountId: "", + positionDelta: undefined, + payout: "", + fee: "", + orderHash: "", + feeRecipientAddress: undefined, + cid: "", + tradeId: "" + }; +} +export const DerivativeTrade = { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade", + is(o: any): o is DerivativeTrade { + return o && (o.$typeUrl === DerivativeTrade.typeUrl || typeof o.marketId === "string" && typeof o.isBuy === "boolean" && typeof o.executionType === "string" && typeof o.subaccountId === "string" && typeof o.payout === "string" && typeof o.fee === "string" && typeof o.orderHash === "string" && typeof o.cid === "string" && typeof o.tradeId === "string"); + }, + isAmino(o: any): o is DerivativeTradeAmino { + return o && (o.$typeUrl === DerivativeTrade.typeUrl || typeof o.market_id === "string" && typeof o.is_buy === "boolean" && typeof o.executionType === "string" && typeof o.subaccount_id === "string" && typeof o.payout === "string" && typeof o.fee === "string" && typeof o.order_hash === "string" && typeof o.cid === "string" && typeof o.trade_id === "string"); + }, + encode(message: DerivativeTrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== "") { + writer.uint32(10).string(message.marketId); + } + if (message.isBuy === true) { + writer.uint32(16).bool(message.isBuy); + } + if (message.executionType !== "") { + writer.uint32(26).string(message.executionType); + } + if (message.subaccountId !== "") { + writer.uint32(34).string(message.subaccountId); + } + if (message.positionDelta !== undefined) { + PositionDelta.encode(message.positionDelta, writer.uint32(42).fork()).ldelim(); + } + if (message.payout !== "") { + writer.uint32(50).string(message.payout); + } + if (message.fee !== "") { + writer.uint32(58).string(message.fee); + } + if (message.orderHash !== "") { + writer.uint32(66).string(message.orderHash); + } + if (message.feeRecipientAddress !== undefined) { + writer.uint32(74).string(message.feeRecipientAddress); + } + if (message.cid !== "") { + writer.uint32(82).string(message.cid); + } + if (message.tradeId !== "") { + writer.uint32(90).string(message.tradeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DerivativeTrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDerivativeTrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.string(); + break; + case 2: + message.isBuy = reader.bool(); + break; + case 3: + message.executionType = reader.string(); + break; + case 4: + message.subaccountId = reader.string(); + break; + case 5: + message.positionDelta = PositionDelta.decode(reader, reader.uint32()); + break; + case 6: + message.payout = reader.string(); + break; + case 7: + message.fee = reader.string(); + break; + case 8: + message.orderHash = reader.string(); + break; + case 9: + message.feeRecipientAddress = reader.string(); + break; + case 10: + message.cid = reader.string(); + break; + case 11: + message.tradeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DerivativeTrade { + const message = createBaseDerivativeTrade(); + message.marketId = object.marketId ?? ""; + message.isBuy = object.isBuy ?? false; + message.executionType = object.executionType ?? ""; + message.subaccountId = object.subaccountId ?? ""; + message.positionDelta = object.positionDelta !== undefined && object.positionDelta !== null ? PositionDelta.fromPartial(object.positionDelta) : undefined; + message.payout = object.payout ?? ""; + message.fee = object.fee ?? ""; + message.orderHash = object.orderHash ?? ""; + message.feeRecipientAddress = object.feeRecipientAddress ?? undefined; + message.cid = object.cid ?? ""; + message.tradeId = object.tradeId ?? ""; + return message; + }, + fromAmino(object: DerivativeTradeAmino): DerivativeTrade { + const message = createBaseDerivativeTrade(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.executionType !== undefined && object.executionType !== null) { + message.executionType = object.executionType; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = object.subaccount_id; + } + if (object.position_delta !== undefined && object.position_delta !== null) { + message.positionDelta = PositionDelta.fromAmino(object.position_delta); + } + if (object.payout !== undefined && object.payout !== null) { + message.payout = object.payout; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = object.fee; + } + if (object.order_hash !== undefined && object.order_hash !== null) { + message.orderHash = object.order_hash; + } + if (object.fee_recipient_address !== undefined && object.fee_recipient_address !== null) { + message.feeRecipientAddress = object.fee_recipient_address; + } + if (object.cid !== undefined && object.cid !== null) { + message.cid = object.cid; + } + if (object.trade_id !== undefined && object.trade_id !== null) { + message.tradeId = object.trade_id; + } + return message; + }, + toAmino(message: DerivativeTrade): DerivativeTradeAmino { + const obj: any = {}; + obj.market_id = message.marketId === "" ? undefined : message.marketId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.executionType = message.executionType === "" ? undefined : message.executionType; + obj.subaccount_id = message.subaccountId === "" ? undefined : message.subaccountId; + obj.position_delta = message.positionDelta ? PositionDelta.toAmino(message.positionDelta) : undefined; + obj.payout = message.payout === "" ? undefined : message.payout; + obj.fee = message.fee === "" ? undefined : message.fee; + obj.order_hash = message.orderHash === "" ? undefined : message.orderHash; + obj.fee_recipient_address = message.feeRecipientAddress === null ? undefined : message.feeRecipientAddress; + obj.cid = message.cid === "" ? undefined : message.cid; + obj.trade_id = message.tradeId === "" ? undefined : message.tradeId; + return obj; + }, + fromAminoMsg(object: DerivativeTradeAminoMsg): DerivativeTrade { + return DerivativeTrade.fromAmino(object.value); + }, + fromProtoMsg(message: DerivativeTradeProtoMsg): DerivativeTrade { + return DerivativeTrade.decode(message.value); + }, + toProto(message: DerivativeTrade): Uint8Array { + return DerivativeTrade.encode(message).finish(); + }, + toProtoMsg(message: DerivativeTrade): DerivativeTradeProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.DerivativeTrade", + value: DerivativeTrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DerivativeTrade.typeUrl, DerivativeTrade); +function createBaseTradesFilter(): TradesFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const TradesFilter = { + typeUrl: "/injective.stream.v1beta1.TradesFilter", + is(o: any): o is TradesFilter { + return o && (o.$typeUrl === TradesFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is TradesFilterAmino { + return o && (o.$typeUrl === TradesFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: TradesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TradesFilter { + const message = createBaseTradesFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: TradesFilterAmino): TradesFilter { + const message = createBaseTradesFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: TradesFilter): TradesFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: TradesFilterAminoMsg): TradesFilter { + return TradesFilter.fromAmino(object.value); + }, + fromProtoMsg(message: TradesFilterProtoMsg): TradesFilter { + return TradesFilter.decode(message.value); + }, + toProto(message: TradesFilter): Uint8Array { + return TradesFilter.encode(message).finish(); + }, + toProtoMsg(message: TradesFilter): TradesFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.TradesFilter", + value: TradesFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradesFilter.typeUrl, TradesFilter); +function createBasePositionsFilter(): PositionsFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const PositionsFilter = { + typeUrl: "/injective.stream.v1beta1.PositionsFilter", + is(o: any): o is PositionsFilter { + return o && (o.$typeUrl === PositionsFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is PositionsFilterAmino { + return o && (o.$typeUrl === PositionsFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: PositionsFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionsFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PositionsFilter { + const message = createBasePositionsFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: PositionsFilterAmino): PositionsFilter { + const message = createBasePositionsFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: PositionsFilter): PositionsFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: PositionsFilterAminoMsg): PositionsFilter { + return PositionsFilter.fromAmino(object.value); + }, + fromProtoMsg(message: PositionsFilterProtoMsg): PositionsFilter { + return PositionsFilter.decode(message.value); + }, + toProto(message: PositionsFilter): Uint8Array { + return PositionsFilter.encode(message).finish(); + }, + toProtoMsg(message: PositionsFilter): PositionsFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.PositionsFilter", + value: PositionsFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PositionsFilter.typeUrl, PositionsFilter); +function createBaseOrdersFilter(): OrdersFilter { + return { + subaccountIds: [], + marketIds: [] + }; +} +export const OrdersFilter = { + typeUrl: "/injective.stream.v1beta1.OrdersFilter", + is(o: any): o is OrdersFilter { + return o && (o.$typeUrl === OrdersFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string") && Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is OrdersFilterAmino { + return o && (o.$typeUrl === OrdersFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string") && Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: OrdersFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + for (const v of message.marketIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrdersFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrdersFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + case 2: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrdersFilter { + const message = createBaseOrdersFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: OrdersFilterAmino): OrdersFilter { + const message = createBaseOrdersFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: OrdersFilter): OrdersFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: OrdersFilterAminoMsg): OrdersFilter { + return OrdersFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OrdersFilterProtoMsg): OrdersFilter { + return OrdersFilter.decode(message.value); + }, + toProto(message: OrdersFilter): Uint8Array { + return OrdersFilter.encode(message).finish(); + }, + toProtoMsg(message: OrdersFilter): OrdersFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrdersFilter", + value: OrdersFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrdersFilter.typeUrl, OrdersFilter); +function createBaseOrderbookFilter(): OrderbookFilter { + return { + marketIds: [] + }; +} +export const OrderbookFilter = { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter", + is(o: any): o is OrderbookFilter { + return o && (o.$typeUrl === OrderbookFilter.typeUrl || Array.isArray(o.marketIds) && (!o.marketIds.length || typeof o.marketIds[0] === "string")); + }, + isAmino(o: any): o is OrderbookFilterAmino { + return o && (o.$typeUrl === OrderbookFilter.typeUrl || Array.isArray(o.market_ids) && (!o.market_ids.length || typeof o.market_ids[0] === "string")); + }, + encode(message: OrderbookFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OrderbookFilter { + const message = createBaseOrderbookFilter(); + message.marketIds = object.marketIds?.map(e => e) || []; + return message; + }, + fromAmino(object: OrderbookFilterAmino): OrderbookFilter { + const message = createBaseOrderbookFilter(); + message.marketIds = object.market_ids?.map(e => e) || []; + return message; + }, + toAmino(message: OrderbookFilter): OrderbookFilterAmino { + const obj: any = {}; + if (message.marketIds) { + obj.market_ids = message.marketIds.map(e => e); + } else { + obj.market_ids = message.marketIds; + } + return obj; + }, + fromAminoMsg(object: OrderbookFilterAminoMsg): OrderbookFilter { + return OrderbookFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookFilterProtoMsg): OrderbookFilter { + return OrderbookFilter.decode(message.value); + }, + toProto(message: OrderbookFilter): Uint8Array { + return OrderbookFilter.encode(message).finish(); + }, + toProtoMsg(message: OrderbookFilter): OrderbookFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OrderbookFilter", + value: OrderbookFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OrderbookFilter.typeUrl, OrderbookFilter); +function createBaseBankBalancesFilter(): BankBalancesFilter { + return { + accounts: [] + }; +} +export const BankBalancesFilter = { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter", + is(o: any): o is BankBalancesFilter { + return o && (o.$typeUrl === BankBalancesFilter.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + isAmino(o: any): o is BankBalancesFilterAmino { + return o && (o.$typeUrl === BankBalancesFilter.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || typeof o.accounts[0] === "string")); + }, + encode(message: BankBalancesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BankBalancesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBankBalancesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BankBalancesFilter { + const message = createBaseBankBalancesFilter(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + fromAmino(object: BankBalancesFilterAmino): BankBalancesFilter { + const message = createBaseBankBalancesFilter(); + message.accounts = object.accounts?.map(e => e) || []; + return message; + }, + toAmino(message: BankBalancesFilter): BankBalancesFilterAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: BankBalancesFilterAminoMsg): BankBalancesFilter { + return BankBalancesFilter.fromAmino(object.value); + }, + fromProtoMsg(message: BankBalancesFilterProtoMsg): BankBalancesFilter { + return BankBalancesFilter.decode(message.value); + }, + toProto(message: BankBalancesFilter): Uint8Array { + return BankBalancesFilter.encode(message).finish(); + }, + toProtoMsg(message: BankBalancesFilter): BankBalancesFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.BankBalancesFilter", + value: BankBalancesFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BankBalancesFilter.typeUrl, BankBalancesFilter); +function createBaseSubaccountDepositsFilter(): SubaccountDepositsFilter { + return { + subaccountIds: [] + }; +} +export const SubaccountDepositsFilter = { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter", + is(o: any): o is SubaccountDepositsFilter { + return o && (o.$typeUrl === SubaccountDepositsFilter.typeUrl || Array.isArray(o.subaccountIds) && (!o.subaccountIds.length || typeof o.subaccountIds[0] === "string")); + }, + isAmino(o: any): o is SubaccountDepositsFilterAmino { + return o && (o.$typeUrl === SubaccountDepositsFilter.typeUrl || Array.isArray(o.subaccount_ids) && (!o.subaccount_ids.length || typeof o.subaccount_ids[0] === "string")); + }, + encode(message: SubaccountDepositsFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccountIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountDepositsFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountDepositsFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SubaccountDepositsFilter { + const message = createBaseSubaccountDepositsFilter(); + message.subaccountIds = object.subaccountIds?.map(e => e) || []; + return message; + }, + fromAmino(object: SubaccountDepositsFilterAmino): SubaccountDepositsFilter { + const message = createBaseSubaccountDepositsFilter(); + message.subaccountIds = object.subaccount_ids?.map(e => e) || []; + return message; + }, + toAmino(message: SubaccountDepositsFilter): SubaccountDepositsFilterAmino { + const obj: any = {}; + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e); + } else { + obj.subaccount_ids = message.subaccountIds; + } + return obj; + }, + fromAminoMsg(object: SubaccountDepositsFilterAminoMsg): SubaccountDepositsFilter { + return SubaccountDepositsFilter.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountDepositsFilterProtoMsg): SubaccountDepositsFilter { + return SubaccountDepositsFilter.decode(message.value); + }, + toProto(message: SubaccountDepositsFilter): Uint8Array { + return SubaccountDepositsFilter.encode(message).finish(); + }, + toProtoMsg(message: SubaccountDepositsFilter): SubaccountDepositsFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.SubaccountDepositsFilter", + value: SubaccountDepositsFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SubaccountDepositsFilter.typeUrl, SubaccountDepositsFilter); +function createBaseOraclePriceFilter(): OraclePriceFilter { + return { + symbol: [] + }; +} +export const OraclePriceFilter = { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter", + is(o: any): o is OraclePriceFilter { + return o && (o.$typeUrl === OraclePriceFilter.typeUrl || Array.isArray(o.symbol) && (!o.symbol.length || typeof o.symbol[0] === "string")); + }, + isAmino(o: any): o is OraclePriceFilterAmino { + return o && (o.$typeUrl === OraclePriceFilter.typeUrl || Array.isArray(o.symbol) && (!o.symbol.length || typeof o.symbol[0] === "string")); + }, + encode(message: OraclePriceFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.symbol) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OraclePriceFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOraclePriceFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): OraclePriceFilter { + const message = createBaseOraclePriceFilter(); + message.symbol = object.symbol?.map(e => e) || []; + return message; + }, + fromAmino(object: OraclePriceFilterAmino): OraclePriceFilter { + const message = createBaseOraclePriceFilter(); + message.symbol = object.symbol?.map(e => e) || []; + return message; + }, + toAmino(message: OraclePriceFilter): OraclePriceFilterAmino { + const obj: any = {}; + if (message.symbol) { + obj.symbol = message.symbol.map(e => e); + } else { + obj.symbol = message.symbol; + } + return obj; + }, + fromAminoMsg(object: OraclePriceFilterAminoMsg): OraclePriceFilter { + return OraclePriceFilter.fromAmino(object.value); + }, + fromProtoMsg(message: OraclePriceFilterProtoMsg): OraclePriceFilter { + return OraclePriceFilter.decode(message.value); + }, + toProto(message: OraclePriceFilter): Uint8Array { + return OraclePriceFilter.encode(message).finish(); + }, + toProtoMsg(message: OraclePriceFilter): OraclePriceFilterProtoMsg { + return { + typeUrl: "/injective.stream.v1beta1.OraclePriceFilter", + value: OraclePriceFilter.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(OraclePriceFilter.typeUrl, OraclePriceFilter); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/authorityMetadata.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/authorityMetadata.ts new file mode 100644 index 00000000..4497aa5e --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/authorityMetadata.ts @@ -0,0 +1,99 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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 injective address */ + admin: string; +} +export interface DenomAuthorityMetadataProtoMsg { + typeUrl: "/injective.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 injective address */ + admin: string; +} +export interface DenomAuthorityMetadataAminoMsg { + type: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata"; + value: DenomAuthorityMetadataAmino; +} +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + admin: "" + }; +} +export const DenomAuthorityMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata", + is(o: any): o is DenomAuthorityMetadata { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + isAmino(o: any): o is DenomAuthorityMetadataAmino { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: DenomAuthorityMetadataProtoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.decode(message.value); + }, + toProto(message: DenomAuthorityMetadata): Uint8Array { + return DenomAuthorityMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.DenomAuthorityMetadata", + value: DenomAuthorityMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomAuthorityMetadata.typeUrl, DenomAuthorityMetadata); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/events.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/events.ts new file mode 100644 index 00000000..38852b9d --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/events.ts @@ -0,0 +1,495 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Metadata, MetadataAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventCreateTFDenom { + account: string; + denom: string; +} +export interface EventCreateTFDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom"; + value: Uint8Array; +} +export interface EventCreateTFDenomAmino { + account: string; + denom: string; +} +export interface EventCreateTFDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventCreateTFDenom"; + value: EventCreateTFDenomAmino; +} +export interface EventMintTFDenom { + recipientAddress: string; + amount: Coin; +} +export interface EventMintTFDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom"; + value: Uint8Array; +} +export interface EventMintTFDenomAmino { + recipient_address: string; + amount: CoinAmino; +} +export interface EventMintTFDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventMintTFDenom"; + value: EventMintTFDenomAmino; +} +export interface EventBurnDenom { + burnerAddress: string; + amount: Coin; +} +export interface EventBurnDenomProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom"; + value: Uint8Array; +} +export interface EventBurnDenomAmino { + burner_address: string; + amount: CoinAmino; +} +export interface EventBurnDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventBurnDenom"; + value: EventBurnDenomAmino; +} +export interface EventChangeTFAdmin { + denom: string; + newAdminAddress: string; +} +export interface EventChangeTFAdminProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin"; + value: Uint8Array; +} +export interface EventChangeTFAdminAmino { + denom: string; + new_admin_address: string; +} +export interface EventChangeTFAdminAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin"; + value: EventChangeTFAdminAmino; +} +export interface EventSetTFDenomMetadata { + denom: string; + metadata: Metadata; +} +export interface EventSetTFDenomMetadataProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata"; + value: Uint8Array; +} +export interface EventSetTFDenomMetadataAmino { + denom: string; + metadata: MetadataAmino; +} +export interface EventSetTFDenomMetadataAminoMsg { + type: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata"; + value: EventSetTFDenomMetadataAmino; +} +function createBaseEventCreateTFDenom(): EventCreateTFDenom { + return { + account: "", + denom: "" + }; +} +export const EventCreateTFDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom", + is(o: any): o is EventCreateTFDenom { + return o && (o.$typeUrl === EventCreateTFDenom.typeUrl || typeof o.account === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is EventCreateTFDenomAmino { + return o && (o.$typeUrl === EventCreateTFDenom.typeUrl || typeof o.account === "string" && typeof o.denom === "string"); + }, + encode(message: EventCreateTFDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateTFDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateTFDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventCreateTFDenom { + const message = createBaseEventCreateTFDenom(); + message.account = object.account ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: EventCreateTFDenomAmino): EventCreateTFDenom { + const message = createBaseEventCreateTFDenom(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: EventCreateTFDenom): EventCreateTFDenomAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: EventCreateTFDenomAminoMsg): EventCreateTFDenom { + return EventCreateTFDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventCreateTFDenomProtoMsg): EventCreateTFDenom { + return EventCreateTFDenom.decode(message.value); + }, + toProto(message: EventCreateTFDenom): Uint8Array { + return EventCreateTFDenom.encode(message).finish(); + }, + toProtoMsg(message: EventCreateTFDenom): EventCreateTFDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventCreateTFDenom", + value: EventCreateTFDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventCreateTFDenom.typeUrl, EventCreateTFDenom); +function createBaseEventMintTFDenom(): EventMintTFDenom { + return { + recipientAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventMintTFDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom", + is(o: any): o is EventMintTFDenom { + return o && (o.$typeUrl === EventMintTFDenom.typeUrl || typeof o.recipientAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventMintTFDenomAmino { + return o && (o.$typeUrl === EventMintTFDenom.typeUrl || typeof o.recipient_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventMintTFDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.recipientAddress !== "") { + writer.uint32(10).string(message.recipientAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventMintTFDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMintTFDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipientAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventMintTFDenom { + const message = createBaseEventMintTFDenom(); + message.recipientAddress = object.recipientAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventMintTFDenomAmino): EventMintTFDenom { + const message = createBaseEventMintTFDenom(); + if (object.recipient_address !== undefined && object.recipient_address !== null) { + message.recipientAddress = object.recipient_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventMintTFDenom): EventMintTFDenomAmino { + const obj: any = {}; + obj.recipient_address = message.recipientAddress === "" ? undefined : message.recipientAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventMintTFDenomAminoMsg): EventMintTFDenom { + return EventMintTFDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventMintTFDenomProtoMsg): EventMintTFDenom { + return EventMintTFDenom.decode(message.value); + }, + toProto(message: EventMintTFDenom): Uint8Array { + return EventMintTFDenom.encode(message).finish(); + }, + toProtoMsg(message: EventMintTFDenom): EventMintTFDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventMintTFDenom", + value: EventMintTFDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventMintTFDenom.typeUrl, EventMintTFDenom); +function createBaseEventBurnDenom(): EventBurnDenom { + return { + burnerAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const EventBurnDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom", + is(o: any): o is EventBurnDenom { + return o && (o.$typeUrl === EventBurnDenom.typeUrl || typeof o.burnerAddress === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is EventBurnDenomAmino { + return o && (o.$typeUrl === EventBurnDenom.typeUrl || typeof o.burner_address === "string" && Coin.isAmino(o.amount)); + }, + encode(message: EventBurnDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.burnerAddress !== "") { + writer.uint32(10).string(message.burnerAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBurnDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBurnDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burnerAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventBurnDenom { + const message = createBaseEventBurnDenom(); + message.burnerAddress = object.burnerAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: EventBurnDenomAmino): EventBurnDenom { + const message = createBaseEventBurnDenom(); + if (object.burner_address !== undefined && object.burner_address !== null) { + message.burnerAddress = object.burner_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: EventBurnDenom): EventBurnDenomAmino { + const obj: any = {}; + obj.burner_address = message.burnerAddress === "" ? undefined : message.burnerAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: EventBurnDenomAminoMsg): EventBurnDenom { + return EventBurnDenom.fromAmino(object.value); + }, + fromProtoMsg(message: EventBurnDenomProtoMsg): EventBurnDenom { + return EventBurnDenom.decode(message.value); + }, + toProto(message: EventBurnDenom): Uint8Array { + return EventBurnDenom.encode(message).finish(); + }, + toProtoMsg(message: EventBurnDenom): EventBurnDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventBurnDenom", + value: EventBurnDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventBurnDenom.typeUrl, EventBurnDenom); +function createBaseEventChangeTFAdmin(): EventChangeTFAdmin { + return { + denom: "", + newAdminAddress: "" + }; +} +export const EventChangeTFAdmin = { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin", + is(o: any): o is EventChangeTFAdmin { + return o && (o.$typeUrl === EventChangeTFAdmin.typeUrl || typeof o.denom === "string" && typeof o.newAdminAddress === "string"); + }, + isAmino(o: any): o is EventChangeTFAdminAmino { + return o && (o.$typeUrl === EventChangeTFAdmin.typeUrl || typeof o.denom === "string" && typeof o.new_admin_address === "string"); + }, + encode(message: EventChangeTFAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.newAdminAddress !== "") { + writer.uint32(18).string(message.newAdminAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventChangeTFAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventChangeTFAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.newAdminAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventChangeTFAdmin { + const message = createBaseEventChangeTFAdmin(); + message.denom = object.denom ?? ""; + message.newAdminAddress = object.newAdminAddress ?? ""; + return message; + }, + fromAmino(object: EventChangeTFAdminAmino): EventChangeTFAdmin { + const message = createBaseEventChangeTFAdmin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin_address !== undefined && object.new_admin_address !== null) { + message.newAdminAddress = object.new_admin_address; + } + return message; + }, + toAmino(message: EventChangeTFAdmin): EventChangeTFAdminAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.new_admin_address = message.newAdminAddress === "" ? undefined : message.newAdminAddress; + return obj; + }, + fromAminoMsg(object: EventChangeTFAdminAminoMsg): EventChangeTFAdmin { + return EventChangeTFAdmin.fromAmino(object.value); + }, + fromProtoMsg(message: EventChangeTFAdminProtoMsg): EventChangeTFAdmin { + return EventChangeTFAdmin.decode(message.value); + }, + toProto(message: EventChangeTFAdmin): Uint8Array { + return EventChangeTFAdmin.encode(message).finish(); + }, + toProtoMsg(message: EventChangeTFAdmin): EventChangeTFAdminProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventChangeTFAdmin", + value: EventChangeTFAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventChangeTFAdmin.typeUrl, EventChangeTFAdmin); +function createBaseEventSetTFDenomMetadata(): EventSetTFDenomMetadata { + return { + denom: "", + metadata: Metadata.fromPartial({}) + }; +} +export const EventSetTFDenomMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata", + is(o: any): o is EventSetTFDenomMetadata { + return o && (o.$typeUrl === EventSetTFDenomMetadata.typeUrl || typeof o.denom === "string" && Metadata.is(o.metadata)); + }, + isAmino(o: any): o is EventSetTFDenomMetadataAmino { + return o && (o.$typeUrl === EventSetTFDenomMetadata.typeUrl || typeof o.denom === "string" && Metadata.isAmino(o.metadata)); + }, + encode(message: EventSetTFDenomMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSetTFDenomMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSetTFDenomMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventSetTFDenomMetadata { + const message = createBaseEventSetTFDenomMetadata(); + message.denom = object.denom ?? ""; + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: EventSetTFDenomMetadataAmino): EventSetTFDenomMetadata { + const message = createBaseEventSetTFDenomMetadata(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: EventSetTFDenomMetadata): EventSetTFDenomMetadataAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: EventSetTFDenomMetadataAminoMsg): EventSetTFDenomMetadata { + return EventSetTFDenomMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: EventSetTFDenomMetadataProtoMsg): EventSetTFDenomMetadata { + return EventSetTFDenomMetadata.decode(message.value); + }, + toProto(message: EventSetTFDenomMetadata): Uint8Array { + return EventSetTFDenomMetadata.encode(message).finish(); + }, + toProtoMsg(message: EventSetTFDenomMetadata): EventSetTFDenomMetadataProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.EventSetTFDenomMetadata", + value: EventSetTFDenomMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventSetTFDenomMetadata.typeUrl, EventSetTFDenomMetadata); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/genesis.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/genesis.ts new file mode 100644 index 00000000..13aeef22 --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/genesis.ts @@ -0,0 +1,259 @@ +import { Params, ParamsAmino } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisState { + /** params defines the parameters of the module. */ + params: Params; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the parameters of the module. */ + params: ParamsAmino; + factory_denoms: GenesisDenomAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.tokenfactory.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** + * 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; + name: string; + symbol: string; + decimals: number; +} +export interface GenesisDenomProtoMsg { + typeUrl: "/injective.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; + name: string; + symbol: string; + decimals: number; +} +export interface GenesisDenomAminoMsg { + type: "/injective.tokenfactory.v1beta1.GenesisDenom"; + value: GenesisDenomAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + factoryDenoms: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.factoryDenoms) && (!o.factoryDenoms.length || GenesisDenom.is(o.factoryDenoms[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.factory_denoms) && (!o.factory_denoms.length || GenesisDenom.isAmino(o.factory_denoms[0]))); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: "", + authorityMetadata: DenomAuthorityMetadata.fromPartial({}), + name: "", + symbol: "", + decimals: 0 + }; +} +export const GenesisDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisDenom", + is(o: any): o is GenesisDenom { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.is(o.authorityMetadata) && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + isAmino(o: any): o is GenesisDenomAmino { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.isAmino(o.authority_metadata) && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + 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(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(34).string(message.symbol); + } + if (message.decimals !== 0) { + writer.uint32(40).uint32(message.decimals); + } + 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; + case 3: + message.name = reader.string(); + break; + case 4: + message.symbol = reader.string(); + break; + case 5: + message.decimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals ?? 0; + 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); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = object.decimals; + } + 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; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals === 0 ? undefined : message.decimals; + return obj; + }, + fromAminoMsg(object: GenesisDenomAminoMsg): GenesisDenom { + return GenesisDenom.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisDenomProtoMsg): GenesisDenom { + return GenesisDenom.decode(message.value); + }, + toProto(message: GenesisDenom): Uint8Array { + return GenesisDenom.encode(message).finish(); + }, + toProtoMsg(message: GenesisDenom): GenesisDenomProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.GenesisDenom", + value: GenesisDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisDenom.typeUrl, GenesisDenom); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/params.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/params.ts new file mode 100644 index 00000000..bb4a1ef3 --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/params.ts @@ -0,0 +1,100 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** Params defines the parameters for the tokenfactory module. */ +export interface Params { + denomCreationFee: Coin[]; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsAmino { + denom_creation_fee: CoinAmino[]; +} +export interface ParamsAminoMsg { + type: "injective/tokenfactory/Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + denomCreationFee: [] + }; +} +export const Params = { + typeUrl: "/injective.tokenfactory.v1beta1.Params", + aminoType: "injective/tokenfactory/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denomCreationFee) && (!o.denomCreationFee.length || Coin.is(o.denomCreationFee[0]))); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denom_creation_fee) && (!o.denom_creation_fee.length || Coin.isAmino(o.denom_creation_fee[0]))); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomCreationFee) { + Coin.encode(v!, 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.denomCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denom_creation_fee?.map(e => Coin.fromAmino(e)) || []; + 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; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "injective/tokenfactory/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: "/injective.tokenfactory.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.rpc.func.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.rpc.func.ts new file mode 100644 index 00000000..f18ad34f --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.rpc.func.ts @@ -0,0 +1,30 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryParamsRequest.encode, + decode: QueryParamsResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "Params", + clientResolver +}); +export const createGetDenomAuthorityMetadata = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomAuthorityMetadataRequest.encode, + decode: QueryDenomAuthorityMetadataResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomAuthorityMetadata", + clientResolver +}); +export const createGetDenomsFromCreator = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryDenomsFromCreatorRequest.encode, + decode: QueryDenomsFromCreatorResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "DenomsFromCreator", + clientResolver +}); +export const createGetTokenfactoryModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.tokenfactory.v1beta1.Query", + method: "TokenfactoryModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.ts new file mode 100644 index 00000000..3a0d5408 --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/query.ts @@ -0,0 +1,714 @@ +import { Params, ParamsAmino } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino } from "./authorityMetadata"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** 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: "/injective.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: "/injective.tokenfactory.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequest { + creator: string; + subDenom: string; +} +export interface QueryDenomAuthorityMetadataRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestAmino { + creator: string; + sub_denom: string; +} +export interface QueryDenomAuthorityMetadataRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; + value: QueryDenomAuthorityMetadataRequestAmino; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata; +} +export interface QueryDenomAuthorityMetadataResponseProtoMsg { + typeUrl: "/injective.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: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse"; + value: QueryDenomAuthorityMetadataResponseAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestAmino { + creator: string; +} +export interface QueryDenomsFromCreatorRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; + value: QueryDenomsFromCreatorRequestAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseAmino { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; + value: QueryDenomsFromCreatorResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the + * Query/TokenfactoryModuleState RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + creator: "", + subDenom: "" + }; +} +export const QueryDenomAuthorityMetadataRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + is(o: any): o is QueryDenomAuthorityMetadataRequest { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.creator === "string" && typeof o.subDenom === "string"); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.creator === "string" && typeof o.sub_denom === "string"); + }, + encode(message: QueryDenomAuthorityMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.subDenom !== "") { + writer.uint32(18).string(message.subDenom); + } + 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.creator = reader.string(); + break; + case 2: + message.subDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.creator = object.creator ?? ""; + message.subDenom = object.subDenom ?? ""; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.sub_denom !== undefined && object.sub_denom !== null) { + message.subDenom = object.sub_denom; + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.sub_denom = message.subDenom === "" ? undefined : message.subDenom; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataRequestAminoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataRequestProtoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataRequest): Uint8Array { + return QueryDenomAuthorityMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + value: QueryDenomAuthorityMetadataRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataRequest.typeUrl, QueryDenomAuthorityMetadataRequest); +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const QueryDenomAuthorityMetadataResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + is(o: any): o is QueryDenomAuthorityMetadataResponse { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.is(o.authorityMetadata)); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.isAmino(o.authority_metadata)); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataResponseProtoMsg): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataResponse): Uint8Array { + return QueryDenomAuthorityMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + value: QueryDenomAuthorityMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataResponse.typeUrl, QueryDenomAuthorityMetadataResponse); +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: "" + }; +} +export const QueryDenomsFromCreatorRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + is(o: any): o is QueryDenomsFromCreatorRequest { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + isAmino(o: any): o is QueryDenomsFromCreatorRequestAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomsFromCreatorRequestProtoMsg): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorRequest): Uint8Array { + return QueryDenomsFromCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + value: QueryDenomsFromCreatorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorRequest.typeUrl, QueryDenomsFromCreatorRequest); +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [] + }; +} +export const QueryDenomsFromCreatorResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + is(o: any): o is QueryDenomsFromCreatorResponse { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QueryDenomsFromCreatorResponseAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: QueryDenomsFromCreatorResponseProtoMsg): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorResponse): Uint8Array { + return QueryDenomsFromCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + value: QueryDenomsFromCreatorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorResponse.typeUrl, QueryDenomsFromCreatorResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts new file mode 100644 index 00000000..dd53b620 --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.rpc.func.ts @@ -0,0 +1,39 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgUpdateParams } from "./tx"; +export const createCreateDenom = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgCreateDenom.typeUrl, + encoders: toEncoders(MsgCreateDenom), + converters: toConverters(MsgCreateDenom) +}); +export const createMint = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgMint.typeUrl, + encoders: toEncoders(MsgMint), + converters: toConverters(MsgMint) +}); +export const createBurn = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgBurn.typeUrl, + encoders: toEncoders(MsgBurn), + converters: toConverters(MsgBurn) +}); +export const createChangeAdmin = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgChangeAdmin.typeUrl, + encoders: toEncoders(MsgChangeAdmin), + converters: toConverters(MsgChangeAdmin) +}); +export const createSetDenomMetadata = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgSetDenomMetadata.typeUrl, + encoders: toEncoders(MsgSetDenomMetadata), + converters: toConverters(MsgSetDenomMetadata) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.ts b/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.ts new file mode 100644 index 00000000..707eeec0 --- /dev/null +++ b/libs/injectivejs/src/injective/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,1208 @@ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { Metadata, MetadataAmino, Params, ParamsAmino } from "../../../cosmos/bank/v1beta1/bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * 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; + name: string; + symbol: string; + decimals: number; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: "/injective.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; + name: string; + symbol: string; + decimals: number; +} +export interface MsgCreateDenomAminoMsg { + type: "injective/tokenfactory/create-denom"; + value: MsgCreateDenomAmino; +} +/** + * 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: "/injective.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: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse"; + value: MsgCreateDenomResponseAmino; +} +/** + * 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; +} +export interface MsgMintProtoMsg { + typeUrl: "/injective.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; +} +export interface MsgMintAminoMsg { + type: "injective/tokenfactory/mint"; + value: MsgMintAmino; +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse"; + value: Uint8Array; +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgMintResponse"; + value: MsgMintResponseAmino; +} +/** + * 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; +} +export interface MsgBurnProtoMsg { + typeUrl: "/injective.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; +} +export interface MsgBurnAminoMsg { + type: "injective/tokenfactory/burn"; + value: MsgBurnAmino; +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse"; + value: Uint8Array; +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgBurnResponse"; + value: MsgBurnResponseAmino; +} +/** + * 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: "/injective.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: "injective/tokenfactory/change-admin"; + value: MsgChangeAdminAmino; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse"; + value: Uint8Array; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse"; + value: MsgChangeAdminResponseAmino; +} +/** + * 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: "/injective.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: "injective/tokenfactory/set-denom-metadata"; + value: MsgSetDenomMetadataAmino; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; + value: Uint8Array; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseAmino {} +export interface MsgSetDenomMetadataResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; + value: MsgSetDenomMetadataResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the tokenfactory parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the tokenfactory parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "injective/tokenfactory/update-params"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: "", + subdenom: "", + name: "", + symbol: "", + decimals: 0 + }; +} +export const MsgCreateDenom = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenom", + aminoType: "injective/tokenfactory/create-denom", + is(o: any): o is MsgCreateDenom { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + isAmino(o: any): o is MsgCreateDenomAmino { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.decimals === "number"); + }, + 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); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(34).string(message.symbol); + } + if (message.decimals !== 0) { + writer.uint32(40).uint32(message.decimals); + } + 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; + case 3: + message.name = reader.string(); + break; + case 4: + message.symbol = reader.string(); + break; + case 5: + message.decimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.subdenom = object.subdenom ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.decimals = object.decimals ?? 0; + 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; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = object.decimals; + } + return message; + }, + toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subdenom = message.subdenom === "" ? undefined : message.subdenom; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.decimals = message.decimals === 0 ? undefined : message.decimals; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenom): MsgCreateDenomAminoMsg { + return { + type: "injective/tokenfactory/create-denom", + 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: "/injective.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDenom.typeUrl, MsgCreateDenom); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDenom.aminoType, MsgCreateDenom.typeUrl); +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: "" + }; +} +export const MsgCreateDenomResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse", + is(o: any): o is MsgCreateDenomResponse { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.newTokenDenom === "string"); + }, + isAmino(o: any): o is MsgCreateDenomResponseAmino { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.new_token_denom === "string"); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: MsgCreateDenomResponseProtoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgCreateDenomResponse", + value: MsgCreateDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateDenomResponse.typeUrl, MsgCreateDenomResponse); +function createBaseMsgMint(): MsgMint { + return { + sender: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgMint = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMint", + aminoType: "injective/tokenfactory/mint", + is(o: any): o is MsgMint { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgMintAmino { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + toAminoMsg(message: MsgMint): MsgMintAminoMsg { + return { + type: "injective/tokenfactory/mint", + 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: "/injective.tokenfactory.v1beta1.MsgMint", + value: MsgMint.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMint.typeUrl, MsgMint); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMint.aminoType, MsgMint.typeUrl); +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse", + is(o: any): o is MsgMintResponse { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isAmino(o: any): o is MsgMintResponseAmino { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgMintResponseProtoMsg): MsgMintResponse { + return MsgMintResponse.decode(message.value); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgMintResponse", + value: MsgMintResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMintResponse.typeUrl, MsgMintResponse); +function createBaseMsgBurn(): MsgBurn { + return { + sender: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBurn = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurn", + aminoType: "injective/tokenfactory/burn", + is(o: any): o is MsgBurn { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.is(o.amount)); + }, + isAmino(o: any): o is MsgBurnAmino { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount)); + }, + 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(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurn): MsgBurnAminoMsg { + return { + type: "injective/tokenfactory/burn", + 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: "/injective.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBurn.typeUrl, MsgBurn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBurn.aminoType, MsgBurn.typeUrl); +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse", + is(o: any): o is MsgBurnResponse { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isAmino(o: any): o is MsgBurnResponseAmino { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg): MsgBurnResponse { + return MsgBurnResponse.decode(message.value); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgBurnResponse", + value: MsgBurnResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgBurnResponse.typeUrl, MsgBurnResponse); +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: "", + denom: "", + newAdmin: "" + }; +} +export const MsgChangeAdmin = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdmin", + aminoType: "injective/tokenfactory/change-admin", + is(o: any): o is MsgChangeAdmin { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.newAdmin === "string"); + }, + isAmino(o: any): o is MsgChangeAdminAmino { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.new_admin === "string"); + }, + 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: DeepPartial): 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: "injective/tokenfactory/change-admin", + 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: "/injective.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChangeAdmin.typeUrl, MsgChangeAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChangeAdmin.aminoType, MsgChangeAdmin.typeUrl); +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} +export const MsgChangeAdminResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse", + is(o: any): o is MsgChangeAdminResponse { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgChangeAdminResponseAmino { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgChangeAdminResponseProtoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value); + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgChangeAdminResponse", + value: MsgChangeAdminResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChangeAdminResponse.typeUrl, MsgChangeAdminResponse); +function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { + return { + sender: "", + metadata: Metadata.fromPartial({}) + }; +} +export const MsgSetDenomMetadata = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata", + aminoType: "injective/tokenfactory/set-denom-metadata", + is(o: any): o is MsgSetDenomMetadata { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.is(o.metadata)); + }, + isAmino(o: any): o is MsgSetDenomMetadataAmino { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.isAmino(o.metadata)); + }, + 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: DeepPartial): 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: "injective/tokenfactory/set-denom-metadata", + 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: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomMetadata.typeUrl, MsgSetDenomMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomMetadata.aminoType, MsgSetDenomMetadata.typeUrl); +function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { + return {}; +} +export const MsgSetDenomMetadataResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + is(o: any): o is MsgSetDenomMetadataResponse { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDenomMetadataResponseAmino { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgSetDenomMetadataResponseProtoMsg): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.decode(message.value); + }, + toProto(message: MsgSetDenomMetadataResponse): Uint8Array { + return MsgSetDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + value: MsgSetDenomMetadataResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomMetadataResponse.typeUrl, MsgSetDenomMetadataResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParams", + aminoType: "injective/tokenfactory/update-params", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "injective/tokenfactory/update-params", + 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: "/injective.tokenfactory.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.tokenfactory.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/types/v1beta1/account.ts b/libs/injectivejs/src/injective/types/v1beta1/account.ts new file mode 100644 index 00000000..08000833 --- /dev/null +++ b/libs/injectivejs/src/injective/types/v1beta1/account.ts @@ -0,0 +1,110 @@ +import { BaseAccount, BaseAccountAmino } from "../../../cosmos/auth/v1beta1/auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * EthAccount implements the authtypes.AccountI interface and embeds an + * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. + */ +export interface EthAccount { + baseAccount?: BaseAccount; + codeHash: Uint8Array; +} +export interface EthAccountProtoMsg { + typeUrl: "/injective.types.v1beta1.EthAccount"; + value: Uint8Array; +} +/** + * EthAccount implements the authtypes.AccountI interface and embeds an + * authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. + */ +export interface EthAccountAmino { + base_account?: BaseAccountAmino; + code_hash: string; +} +export interface EthAccountAminoMsg { + type: "/injective.types.v1beta1.EthAccount"; + value: EthAccountAmino; +} +function createBaseEthAccount(): EthAccount { + return { + baseAccount: undefined, + codeHash: new Uint8Array() + }; +} +export const EthAccount = { + typeUrl: "/injective.types.v1beta1.EthAccount", + is(o: any): o is EthAccount { + return o && (o.$typeUrl === EthAccount.typeUrl || o.codeHash instanceof Uint8Array || typeof o.codeHash === "string"); + }, + isAmino(o: any): o is EthAccountAmino { + return o && (o.$typeUrl === EthAccount.typeUrl || o.code_hash instanceof Uint8Array || typeof o.code_hash === "string"); + }, + encode(message: EthAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.codeHash.length !== 0) { + writer.uint32(18).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EthAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEthAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EthAccount { + const message = createBaseEthAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: EthAccountAmino): EthAccount { + const message = createBaseEthAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: EthAccount): EthAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: EthAccountAminoMsg): EthAccount { + return EthAccount.fromAmino(object.value); + }, + fromProtoMsg(message: EthAccountProtoMsg): EthAccount { + return EthAccount.decode(message.value); + }, + toProto(message: EthAccount): Uint8Array { + return EthAccount.encode(message).finish(); + }, + toProtoMsg(message: EthAccount): EthAccountProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.EthAccount", + value: EthAccount.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EthAccount.typeUrl, EthAccount); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/types/v1beta1/tx_ext.ts b/libs/injectivejs/src/injective/types/v1beta1/tx_ext.ts new file mode 100644 index 00000000..ac7f44f2 --- /dev/null +++ b/libs/injectivejs/src/injective/types/v1beta1/tx_ext.ts @@ -0,0 +1,139 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface ExtensionOptionsWeb3Tx { + /** + * typedDataChainID used only in EIP712 Domain and should match + * Ethereum network ID in a Web3 provider (e.g. Metamask). + */ + typedDataChainID: bigint; + /** + * feePayer is an account address for the fee payer. It will be validated + * during EIP712 signature checking. + */ + feePayer: string; + /** + * feePayerSig is a signature data from the fee paying account, + * allows to perform fee delegation when using EIP712 Domain. + */ + feePayerSig: Uint8Array; +} +export interface ExtensionOptionsWeb3TxProtoMsg { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx"; + value: Uint8Array; +} +export interface ExtensionOptionsWeb3TxAmino { + /** + * typedDataChainID used only in EIP712 Domain and should match + * Ethereum network ID in a Web3 provider (e.g. Metamask). + */ + typedDataChainID: string; + /** + * feePayer is an account address for the fee payer. It will be validated + * during EIP712 signature checking. + */ + feePayer: string; + /** + * feePayerSig is a signature data from the fee paying account, + * allows to perform fee delegation when using EIP712 Domain. + */ + feePayerSig: string; +} +export interface ExtensionOptionsWeb3TxAminoMsg { + type: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx"; + value: ExtensionOptionsWeb3TxAmino; +} +function createBaseExtensionOptionsWeb3Tx(): ExtensionOptionsWeb3Tx { + return { + typedDataChainID: BigInt(0), + feePayer: "", + feePayerSig: new Uint8Array() + }; +} +export const ExtensionOptionsWeb3Tx = { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx", + is(o: any): o is ExtensionOptionsWeb3Tx { + return o && (o.$typeUrl === ExtensionOptionsWeb3Tx.typeUrl || typeof o.typedDataChainID === "bigint" && typeof o.feePayer === "string" && (o.feePayerSig instanceof Uint8Array || typeof o.feePayerSig === "string")); + }, + isAmino(o: any): o is ExtensionOptionsWeb3TxAmino { + return o && (o.$typeUrl === ExtensionOptionsWeb3Tx.typeUrl || typeof o.typedDataChainID === "bigint" && typeof o.feePayer === "string" && (o.feePayerSig instanceof Uint8Array || typeof o.feePayerSig === "string")); + }, + encode(message: ExtensionOptionsWeb3Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.typedDataChainID !== BigInt(0)) { + writer.uint32(8).uint64(message.typedDataChainID); + } + if (message.feePayer !== "") { + writer.uint32(18).string(message.feePayer); + } + if (message.feePayerSig.length !== 0) { + writer.uint32(26).bytes(message.feePayerSig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionOptionsWeb3Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionOptionsWeb3Tx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typedDataChainID = reader.uint64(); + break; + case 2: + message.feePayer = reader.string(); + break; + case 3: + message.feePayerSig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtensionOptionsWeb3Tx { + const message = createBaseExtensionOptionsWeb3Tx(); + message.typedDataChainID = object.typedDataChainID !== undefined && object.typedDataChainID !== null ? BigInt(object.typedDataChainID.toString()) : BigInt(0); + message.feePayer = object.feePayer ?? ""; + message.feePayerSig = object.feePayerSig ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtensionOptionsWeb3TxAmino): ExtensionOptionsWeb3Tx { + const message = createBaseExtensionOptionsWeb3Tx(); + if (object.typedDataChainID !== undefined && object.typedDataChainID !== null) { + message.typedDataChainID = BigInt(object.typedDataChainID); + } + if (object.feePayer !== undefined && object.feePayer !== null) { + message.feePayer = object.feePayer; + } + if (object.feePayerSig !== undefined && object.feePayerSig !== null) { + message.feePayerSig = bytesFromBase64(object.feePayerSig); + } + return message; + }, + toAmino(message: ExtensionOptionsWeb3Tx): ExtensionOptionsWeb3TxAmino { + const obj: any = {}; + obj.typedDataChainID = message.typedDataChainID !== BigInt(0) ? message.typedDataChainID?.toString() : undefined; + obj.feePayer = message.feePayer === "" ? undefined : message.feePayer; + obj.feePayerSig = message.feePayerSig ? base64FromBytes(message.feePayerSig) : undefined; + return obj; + }, + fromAminoMsg(object: ExtensionOptionsWeb3TxAminoMsg): ExtensionOptionsWeb3Tx { + return ExtensionOptionsWeb3Tx.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionOptionsWeb3TxProtoMsg): ExtensionOptionsWeb3Tx { + return ExtensionOptionsWeb3Tx.decode(message.value); + }, + toProto(message: ExtensionOptionsWeb3Tx): Uint8Array { + return ExtensionOptionsWeb3Tx.encode(message).finish(); + }, + toProtoMsg(message: ExtensionOptionsWeb3Tx): ExtensionOptionsWeb3TxProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.ExtensionOptionsWeb3Tx", + value: ExtensionOptionsWeb3Tx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtensionOptionsWeb3Tx.typeUrl, ExtensionOptionsWeb3Tx); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/types/v1beta1/tx_response.ts b/libs/injectivejs/src/injective/types/v1beta1/tx_response.ts new file mode 100644 index 00000000..14002e46 --- /dev/null +++ b/libs/injectivejs/src/injective/types/v1beta1/tx_response.ts @@ -0,0 +1,197 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * base header ak message type, we can cast the bytes into corresponding message + * response type + */ +export interface TxResponseGenericMessage { + header: string; + data: Uint8Array; +} +export interface TxResponseGenericMessageProtoMsg { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage"; + value: Uint8Array; +} +/** + * base header ak message type, we can cast the bytes into corresponding message + * response type + */ +export interface TxResponseGenericMessageAmino { + header: string; + data: string; +} +export interface TxResponseGenericMessageAminoMsg { + type: "/injective.types.v1beta1.TxResponseGenericMessage"; + value: TxResponseGenericMessageAmino; +} +/** improvised message to unpack length prefixed messages in tx response data */ +export interface TxResponseData { + messages: TxResponseGenericMessage[]; +} +export interface TxResponseDataProtoMsg { + typeUrl: "/injective.types.v1beta1.TxResponseData"; + value: Uint8Array; +} +/** improvised message to unpack length prefixed messages in tx response data */ +export interface TxResponseDataAmino { + messages: TxResponseGenericMessageAmino[]; +} +export interface TxResponseDataAminoMsg { + type: "/injective.types.v1beta1.TxResponseData"; + value: TxResponseDataAmino; +} +function createBaseTxResponseGenericMessage(): TxResponseGenericMessage { + return { + header: "", + data: new Uint8Array() + }; +} +export const TxResponseGenericMessage = { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage", + is(o: any): o is TxResponseGenericMessage { + return o && (o.$typeUrl === TxResponseGenericMessage.typeUrl || typeof o.header === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is TxResponseGenericMessageAmino { + return o && (o.$typeUrl === TxResponseGenericMessage.typeUrl || typeof o.header === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: TxResponseGenericMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== "") { + writer.uint32(10).string(message.header); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponseGenericMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponseGenericMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponseGenericMessage { + const message = createBaseTxResponseGenericMessage(); + message.header = object.header ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxResponseGenericMessageAmino): TxResponseGenericMessage { + const message = createBaseTxResponseGenericMessage(); + if (object.header !== undefined && object.header !== null) { + message.header = object.header; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: TxResponseGenericMessage): TxResponseGenericMessageAmino { + const obj: any = {}; + obj.header = message.header === "" ? undefined : message.header; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: TxResponseGenericMessageAminoMsg): TxResponseGenericMessage { + return TxResponseGenericMessage.fromAmino(object.value); + }, + fromProtoMsg(message: TxResponseGenericMessageProtoMsg): TxResponseGenericMessage { + return TxResponseGenericMessage.decode(message.value); + }, + toProto(message: TxResponseGenericMessage): Uint8Array { + return TxResponseGenericMessage.encode(message).finish(); + }, + toProtoMsg(message: TxResponseGenericMessage): TxResponseGenericMessageProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.TxResponseGenericMessage", + value: TxResponseGenericMessage.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponseGenericMessage.typeUrl, TxResponseGenericMessage); +function createBaseTxResponseData(): TxResponseData { + return { + messages: [] + }; +} +export const TxResponseData = { + typeUrl: "/injective.types.v1beta1.TxResponseData", + is(o: any): o is TxResponseData { + return o && (o.$typeUrl === TxResponseData.typeUrl || Array.isArray(o.messages) && (!o.messages.length || TxResponseGenericMessage.is(o.messages[0]))); + }, + isAmino(o: any): o is TxResponseDataAmino { + return o && (o.$typeUrl === TxResponseData.typeUrl || Array.isArray(o.messages) && (!o.messages.length || TxResponseGenericMessage.isAmino(o.messages[0]))); + }, + encode(message: TxResponseData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + TxResponseGenericMessage.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponseData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponseData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(TxResponseGenericMessage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResponseData { + const message = createBaseTxResponseData(); + message.messages = object.messages?.map(e => TxResponseGenericMessage.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxResponseDataAmino): TxResponseData { + const message = createBaseTxResponseData(); + message.messages = object.messages?.map(e => TxResponseGenericMessage.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxResponseData): TxResponseDataAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? TxResponseGenericMessage.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + return obj; + }, + fromAminoMsg(object: TxResponseDataAminoMsg): TxResponseData { + return TxResponseData.fromAmino(object.value); + }, + fromProtoMsg(message: TxResponseDataProtoMsg): TxResponseData { + return TxResponseData.decode(message.value); + }, + toProto(message: TxResponseData): Uint8Array { + return TxResponseData.encode(message).finish(); + }, + toProtoMsg(message: TxResponseData): TxResponseDataProtoMsg { + return { + typeUrl: "/injective.types.v1beta1.TxResponseData", + value: TxResponseData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResponseData.typeUrl, TxResponseData); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/events.ts b/libs/injectivejs/src/injective/wasmx/v1/events.ts new file mode 100644 index 00000000..b579a219 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/events.ts @@ -0,0 +1,396 @@ +import { FundingMode } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface EventContractExecution { + contractAddress: string; + response: Uint8Array; + otherError: string; + executionError: string; +} +export interface EventContractExecutionProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractExecution"; + value: Uint8Array; +} +export interface EventContractExecutionAmino { + contract_address: string; + response: string; + other_error: string; + execution_error: string; +} +export interface EventContractExecutionAminoMsg { + type: "/injective.wasmx.v1.EventContractExecution"; + value: EventContractExecutionAmino; +} +export interface EventContractRegistered { + contractAddress: string; + gasPrice: bigint; + shouldPinContract: boolean; + isMigrationAllowed: boolean; + codeId: bigint; + adminAddress: string; + granterAddress: string; + fundingMode: FundingMode; +} +export interface EventContractRegisteredProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractRegistered"; + value: Uint8Array; +} +export interface EventContractRegisteredAmino { + contract_address: string; + gas_price: string; + should_pin_contract: boolean; + is_migration_allowed: boolean; + code_id: string; + admin_address: string; + granter_address: string; + funding_mode: FundingMode; +} +export interface EventContractRegisteredAminoMsg { + type: "/injective.wasmx.v1.EventContractRegistered"; + value: EventContractRegisteredAmino; +} +export interface EventContractDeregistered { + contractAddress: string; +} +export interface EventContractDeregisteredProtoMsg { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered"; + value: Uint8Array; +} +export interface EventContractDeregisteredAmino { + contract_address: string; +} +export interface EventContractDeregisteredAminoMsg { + type: "/injective.wasmx.v1.EventContractDeregistered"; + value: EventContractDeregisteredAmino; +} +function createBaseEventContractExecution(): EventContractExecution { + return { + contractAddress: "", + response: new Uint8Array(), + otherError: "", + executionError: "" + }; +} +export const EventContractExecution = { + typeUrl: "/injective.wasmx.v1.EventContractExecution", + is(o: any): o is EventContractExecution { + return o && (o.$typeUrl === EventContractExecution.typeUrl || typeof o.contractAddress === "string" && (o.response instanceof Uint8Array || typeof o.response === "string") && typeof o.otherError === "string" && typeof o.executionError === "string"); + }, + isAmino(o: any): o is EventContractExecutionAmino { + return o && (o.$typeUrl === EventContractExecution.typeUrl || typeof o.contract_address === "string" && (o.response instanceof Uint8Array || typeof o.response === "string") && typeof o.other_error === "string" && typeof o.execution_error === "string"); + }, + encode(message: EventContractExecution, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.response.length !== 0) { + writer.uint32(18).bytes(message.response); + } + if (message.otherError !== "") { + writer.uint32(26).string(message.otherError); + } + if (message.executionError !== "") { + writer.uint32(34).string(message.executionError); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractExecution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.response = reader.bytes(); + break; + case 3: + message.otherError = reader.string(); + break; + case 4: + message.executionError = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractExecution { + const message = createBaseEventContractExecution(); + message.contractAddress = object.contractAddress ?? ""; + message.response = object.response ?? new Uint8Array(); + message.otherError = object.otherError ?? ""; + message.executionError = object.executionError ?? ""; + return message; + }, + fromAmino(object: EventContractExecutionAmino): EventContractExecution { + const message = createBaseEventContractExecution(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.response !== undefined && object.response !== null) { + message.response = bytesFromBase64(object.response); + } + if (object.other_error !== undefined && object.other_error !== null) { + message.otherError = object.other_error; + } + if (object.execution_error !== undefined && object.execution_error !== null) { + message.executionError = object.execution_error; + } + return message; + }, + toAmino(message: EventContractExecution): EventContractExecutionAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.response = message.response ? base64FromBytes(message.response) : undefined; + obj.other_error = message.otherError === "" ? undefined : message.otherError; + obj.execution_error = message.executionError === "" ? undefined : message.executionError; + return obj; + }, + fromAminoMsg(object: EventContractExecutionAminoMsg): EventContractExecution { + return EventContractExecution.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractExecutionProtoMsg): EventContractExecution { + return EventContractExecution.decode(message.value); + }, + toProto(message: EventContractExecution): Uint8Array { + return EventContractExecution.encode(message).finish(); + }, + toProtoMsg(message: EventContractExecution): EventContractExecutionProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractExecution", + value: EventContractExecution.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractExecution.typeUrl, EventContractExecution); +function createBaseEventContractRegistered(): EventContractRegistered { + return { + contractAddress: "", + gasPrice: BigInt(0), + shouldPinContract: false, + isMigrationAllowed: false, + codeId: BigInt(0), + adminAddress: "", + granterAddress: "", + fundingMode: 0 + }; +} +export const EventContractRegistered = { + typeUrl: "/injective.wasmx.v1.EventContractRegistered", + is(o: any): o is EventContractRegistered { + return o && (o.$typeUrl === EventContractRegistered.typeUrl || typeof o.contractAddress === "string" && typeof o.gasPrice === "bigint" && typeof o.shouldPinContract === "boolean" && typeof o.isMigrationAllowed === "boolean" && typeof o.codeId === "bigint" && typeof o.adminAddress === "string" && typeof o.granterAddress === "string" && isSet(o.fundingMode)); + }, + isAmino(o: any): o is EventContractRegisteredAmino { + return o && (o.$typeUrl === EventContractRegistered.typeUrl || typeof o.contract_address === "string" && typeof o.gas_price === "bigint" && typeof o.should_pin_contract === "boolean" && typeof o.is_migration_allowed === "boolean" && typeof o.code_id === "bigint" && typeof o.admin_address === "string" && typeof o.granter_address === "string" && isSet(o.funding_mode)); + }, + encode(message: EventContractRegistered, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(24).uint64(message.gasPrice); + } + if (message.shouldPinContract === true) { + writer.uint32(32).bool(message.shouldPinContract); + } + if (message.isMigrationAllowed === true) { + writer.uint32(40).bool(message.isMigrationAllowed); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(48).uint64(message.codeId); + } + if (message.adminAddress !== "") { + writer.uint32(58).string(message.adminAddress); + } + if (message.granterAddress !== "") { + writer.uint32(66).string(message.granterAddress); + } + if (message.fundingMode !== 0) { + writer.uint32(72).int32(message.fundingMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractRegistered { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractRegistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 3: + message.gasPrice = reader.uint64(); + break; + case 4: + message.shouldPinContract = reader.bool(); + break; + case 5: + message.isMigrationAllowed = reader.bool(); + break; + case 6: + message.codeId = reader.uint64(); + break; + case 7: + message.adminAddress = reader.string(); + break; + case 8: + message.granterAddress = reader.string(); + break; + case 9: + message.fundingMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractRegistered { + const message = createBaseEventContractRegistered(); + message.contractAddress = object.contractAddress ?? ""; + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.shouldPinContract = object.shouldPinContract ?? false; + message.isMigrationAllowed = object.isMigrationAllowed ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? ""; + message.granterAddress = object.granterAddress ?? ""; + message.fundingMode = object.fundingMode ?? 0; + return message; + }, + fromAmino(object: EventContractRegisteredAmino): EventContractRegistered { + const message = createBaseEventContractRegistered(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.should_pin_contract !== undefined && object.should_pin_contract !== null) { + message.shouldPinContract = object.should_pin_contract; + } + if (object.is_migration_allowed !== undefined && object.is_migration_allowed !== null) { + message.isMigrationAllowed = object.is_migration_allowed; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.funding_mode !== undefined && object.funding_mode !== null) { + message.fundingMode = object.funding_mode; + } + return message; + }, + toAmino(message: EventContractRegistered): EventContractRegisteredAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.should_pin_contract = message.shouldPinContract === false ? undefined : message.shouldPinContract; + obj.is_migration_allowed = message.isMigrationAllowed === false ? undefined : message.isMigrationAllowed; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === "" ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === "" ? undefined : message.granterAddress; + obj.funding_mode = message.fundingMode === 0 ? undefined : message.fundingMode; + return obj; + }, + fromAminoMsg(object: EventContractRegisteredAminoMsg): EventContractRegistered { + return EventContractRegistered.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractRegisteredProtoMsg): EventContractRegistered { + return EventContractRegistered.decode(message.value); + }, + toProto(message: EventContractRegistered): Uint8Array { + return EventContractRegistered.encode(message).finish(); + }, + toProtoMsg(message: EventContractRegistered): EventContractRegisteredProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractRegistered", + value: EventContractRegistered.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractRegistered.typeUrl, EventContractRegistered); +function createBaseEventContractDeregistered(): EventContractDeregistered { + return { + contractAddress: "" + }; +} +export const EventContractDeregistered = { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered", + is(o: any): o is EventContractDeregistered { + return o && (o.$typeUrl === EventContractDeregistered.typeUrl || typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is EventContractDeregisteredAmino { + return o && (o.$typeUrl === EventContractDeregistered.typeUrl || typeof o.contract_address === "string"); + }, + encode(message: EventContractDeregistered, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventContractDeregistered { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventContractDeregistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventContractDeregistered { + const message = createBaseEventContractDeregistered(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: EventContractDeregisteredAmino): EventContractDeregistered { + const message = createBaseEventContractDeregistered(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: EventContractDeregistered): EventContractDeregisteredAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: EventContractDeregisteredAminoMsg): EventContractDeregistered { + return EventContractDeregistered.fromAmino(object.value); + }, + fromProtoMsg(message: EventContractDeregisteredProtoMsg): EventContractDeregistered { + return EventContractDeregistered.decode(message.value); + }, + toProto(message: EventContractDeregistered): Uint8Array { + return EventContractDeregistered.encode(message).finish(); + }, + toProtoMsg(message: EventContractDeregistered): EventContractDeregisteredProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.EventContractDeregistered", + value: EventContractDeregistered.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventContractDeregistered.typeUrl, EventContractDeregistered); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/genesis.ts b/libs/injectivejs/src/injective/wasmx/v1/genesis.ts new file mode 100644 index 00000000..ffe48f34 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/genesis.ts @@ -0,0 +1,214 @@ +import { RegisteredContract, RegisteredContractAmino, Params, ParamsAmino } from "./wasmx"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface RegisteredContractWithAddress { + address: string; + registeredContract?: RegisteredContract; +} +export interface RegisteredContractWithAddressProtoMsg { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress"; + value: Uint8Array; +} +export interface RegisteredContractWithAddressAmino { + address: string; + registered_contract?: RegisteredContractAmino; +} +export interface RegisteredContractWithAddressAminoMsg { + type: "/injective.wasmx.v1.RegisteredContractWithAddress"; + value: RegisteredContractWithAddressAmino; +} +/** GenesisState defines the wasmx module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of related to wasmx. */ + params: Params; + /** + * registered_contracts is an array containing the genesis registered + * contracts + */ + registeredContracts: RegisteredContractWithAddress[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/injective.wasmx.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the wasmx module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of related to wasmx. */ + params: ParamsAmino; + /** + * registered_contracts is an array containing the genesis registered + * contracts + */ + registered_contracts: RegisteredContractWithAddressAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/injective.wasmx.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseRegisteredContractWithAddress(): RegisteredContractWithAddress { + return { + address: "", + registeredContract: undefined + }; +} +export const RegisteredContractWithAddress = { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress", + is(o: any): o is RegisteredContractWithAddress { + return o && (o.$typeUrl === RegisteredContractWithAddress.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is RegisteredContractWithAddressAmino { + return o && (o.$typeUrl === RegisteredContractWithAddress.typeUrl || typeof o.address === "string"); + }, + encode(message: RegisteredContractWithAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.registeredContract !== undefined) { + RegisteredContract.encode(message.registeredContract, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredContractWithAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisteredContractWithAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.registeredContract = RegisteredContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RegisteredContractWithAddress { + const message = createBaseRegisteredContractWithAddress(); + message.address = object.address ?? ""; + message.registeredContract = object.registeredContract !== undefined && object.registeredContract !== null ? RegisteredContract.fromPartial(object.registeredContract) : undefined; + return message; + }, + fromAmino(object: RegisteredContractWithAddressAmino): RegisteredContractWithAddress { + const message = createBaseRegisteredContractWithAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.registered_contract !== undefined && object.registered_contract !== null) { + message.registeredContract = RegisteredContract.fromAmino(object.registered_contract); + } + return message; + }, + toAmino(message: RegisteredContractWithAddress): RegisteredContractWithAddressAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.registered_contract = message.registeredContract ? RegisteredContract.toAmino(message.registeredContract) : undefined; + return obj; + }, + fromAminoMsg(object: RegisteredContractWithAddressAminoMsg): RegisteredContractWithAddress { + return RegisteredContractWithAddress.fromAmino(object.value); + }, + fromProtoMsg(message: RegisteredContractWithAddressProtoMsg): RegisteredContractWithAddress { + return RegisteredContractWithAddress.decode(message.value); + }, + toProto(message: RegisteredContractWithAddress): Uint8Array { + return RegisteredContractWithAddress.encode(message).finish(); + }, + toProtoMsg(message: RegisteredContractWithAddress): RegisteredContractWithAddressProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.RegisteredContractWithAddress", + value: RegisteredContractWithAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RegisteredContractWithAddress.typeUrl, RegisteredContractWithAddress); +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + registeredContracts: [] + }; +} +export const GenesisState = { + typeUrl: "/injective.wasmx.v1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.registeredContracts) && (!o.registeredContracts.length || RegisteredContractWithAddress.is(o.registeredContracts[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.registered_contracts) && (!o.registered_contracts.length || RegisteredContractWithAddress.isAmino(o.registered_contracts[0]))); + }, + 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.registeredContracts) { + RegisteredContractWithAddress.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.registeredContracts.push(RegisteredContractWithAddress.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.registeredContracts = object.registeredContracts?.map(e => RegisteredContractWithAddress.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.registeredContracts = object.registered_contracts?.map(e => RegisteredContractWithAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.registeredContracts) { + obj.registered_contracts = message.registeredContracts.map(e => e ? RegisteredContractWithAddress.toAmino(e) : undefined); + } else { + obj.registered_contracts = message.registeredContracts; + } + 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: "/injective.wasmx.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/proposal.ts b/libs/injectivejs/src/injective/wasmx/v1/proposal.ts new file mode 100644 index 00000000..7b8680f3 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/proposal.ts @@ -0,0 +1,769 @@ +import { StoreCodeProposal, StoreCodeProposalAmino } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export enum FundingMode { + Unspecified = 0, + SelfFunded = 1, + GrantOnly = 2, + Dual = 3, + UNRECOGNIZED = -1, +} +export const FundingModeAmino = FundingMode; +export function fundingModeFromJSON(object: any): FundingMode { + switch (object) { + case 0: + case "Unspecified": + return FundingMode.Unspecified; + case 1: + case "SelfFunded": + return FundingMode.SelfFunded; + case 2: + case "GrantOnly": + return FundingMode.GrantOnly; + case 3: + case "Dual": + return FundingMode.Dual; + case -1: + case "UNRECOGNIZED": + default: + return FundingMode.UNRECOGNIZED; + } +} +export function fundingModeToJSON(object: FundingMode): string { + switch (object) { + case FundingMode.Unspecified: + return "Unspecified"; + case FundingMode.SelfFunded: + return "SelfFunded"; + case FundingMode.GrantOnly: + return "GrantOnly"; + case FundingMode.Dual: + return "Dual"; + case FundingMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface ContractRegistrationRequestProposal { + title: string; + description: string; + contractRegistrationRequest: ContractRegistrationRequest; +} +export interface ContractRegistrationRequestProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal"; + value: Uint8Array; +} +export interface ContractRegistrationRequestProposalAmino { + title: string; + description: string; + contract_registration_request: ContractRegistrationRequestAmino; +} +export interface ContractRegistrationRequestProposalAminoMsg { + type: "wasmx/ContractRegistrationRequestProposal"; + value: ContractRegistrationRequestProposalAmino; +} +export interface BatchContractRegistrationRequestProposal { + title: string; + description: string; + contractRegistrationRequests: ContractRegistrationRequest[]; +} +export interface BatchContractRegistrationRequestProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal"; + value: Uint8Array; +} +export interface BatchContractRegistrationRequestProposalAmino { + title: string; + description: string; + contract_registration_requests: ContractRegistrationRequestAmino[]; +} +export interface BatchContractRegistrationRequestProposalAminoMsg { + type: "wasmx/BatchContractRegistrationRequestProposal"; + value: BatchContractRegistrationRequestProposalAmino; +} +export interface BatchContractDeregistrationProposal { + title: string; + description: string; + contracts: string[]; +} +export interface BatchContractDeregistrationProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal"; + value: Uint8Array; +} +export interface BatchContractDeregistrationProposalAmino { + title: string; + description: string; + contracts: string[]; +} +export interface BatchContractDeregistrationProposalAminoMsg { + type: "wasmx/BatchContractDeregistrationProposal"; + value: BatchContractDeregistrationProposalAmino; +} +export interface ContractRegistrationRequest { + /** Unique Identifier for contract instance to be registered. */ + contractAddress: string; + /** Maximum gas to be used for the smart contract execution. */ + gasLimit: bigint; + /** gas price to be used for the smart contract execution. */ + gasPrice: bigint; + shouldPinContract: boolean; + /** + * if true contract owner can update it, if false only current code_id will be + * allowed to be executed + */ + isMigrationAllowed: boolean; + /** + * code_id of the contract being registered - will be verified upon every + * execution but only if is_migration_allowed is false + */ + codeId: bigint; + /** + * Optional address of admin account (that will be allowed to pause or update + * contract params) + */ + adminAddress: string; + /** + * Optional address of the contract that grants fees. Must be set if + * funding_mode is other than SelfFunded + */ + granterAddress: string; + /** Specifies how the contract will fund its execution */ + fundingMode: FundingMode; +} +export interface ContractRegistrationRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest"; + value: Uint8Array; +} +export interface ContractRegistrationRequestAmino { + /** Unique Identifier for contract instance to be registered. */ + contract_address: string; + /** Maximum gas to be used for the smart contract execution. */ + gas_limit: string; + /** gas price to be used for the smart contract execution. */ + gas_price: string; + should_pin_contract: boolean; + /** + * if true contract owner can update it, if false only current code_id will be + * allowed to be executed + */ + is_migration_allowed: boolean; + /** + * code_id of the contract being registered - will be verified upon every + * execution but only if is_migration_allowed is false + */ + code_id: string; + /** + * Optional address of admin account (that will be allowed to pause or update + * contract params) + */ + admin_address: string; + /** + * Optional address of the contract that grants fees. Must be set if + * funding_mode is other than SelfFunded + */ + granter_address: string; + /** Specifies how the contract will fund its execution */ + funding_mode: FundingMode; +} +export interface ContractRegistrationRequestAminoMsg { + type: "/injective.wasmx.v1.ContractRegistrationRequest"; + value: ContractRegistrationRequestAmino; +} +export interface BatchStoreCodeProposal { + title: string; + description: string; + proposals: StoreCodeProposal[]; +} +export interface BatchStoreCodeProposalProtoMsg { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal"; + value: Uint8Array; +} +export interface BatchStoreCodeProposalAmino { + title: string; + description: string; + proposals: StoreCodeProposalAmino[]; +} +export interface BatchStoreCodeProposalAminoMsg { + type: "wasmx/BatchStoreCodeProposal"; + value: BatchStoreCodeProposalAmino; +} +function createBaseContractRegistrationRequestProposal(): ContractRegistrationRequestProposal { + return { + title: "", + description: "", + contractRegistrationRequest: ContractRegistrationRequest.fromPartial({}) + }; +} +export const ContractRegistrationRequestProposal = { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal", + aminoType: "wasmx/ContractRegistrationRequestProposal", + is(o: any): o is ContractRegistrationRequestProposal { + return o && (o.$typeUrl === ContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && ContractRegistrationRequest.is(o.contractRegistrationRequest)); + }, + isAmino(o: any): o is ContractRegistrationRequestProposalAmino { + return o && (o.$typeUrl === ContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && ContractRegistrationRequest.isAmino(o.contract_registration_request)); + }, + encode(message: ContractRegistrationRequestProposal, 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.contractRegistrationRequest !== undefined) { + ContractRegistrationRequest.encode(message.contractRegistrationRequest, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractRegistrationRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractRegistrationRequestProposal(); + 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.contractRegistrationRequest = ContractRegistrationRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractRegistrationRequestProposal { + const message = createBaseContractRegistrationRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractRegistrationRequest = object.contractRegistrationRequest !== undefined && object.contractRegistrationRequest !== null ? ContractRegistrationRequest.fromPartial(object.contractRegistrationRequest) : undefined; + return message; + }, + fromAmino(object: ContractRegistrationRequestProposalAmino): ContractRegistrationRequestProposal { + const message = createBaseContractRegistrationRequestProposal(); + 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_registration_request !== undefined && object.contract_registration_request !== null) { + message.contractRegistrationRequest = ContractRegistrationRequest.fromAmino(object.contract_registration_request); + } + return message; + }, + toAmino(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract_registration_request = message.contractRegistrationRequest ? ContractRegistrationRequest.toAmino(message.contractRegistrationRequest) : undefined; + return obj; + }, + fromAminoMsg(object: ContractRegistrationRequestProposalAminoMsg): ContractRegistrationRequestProposal { + return ContractRegistrationRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalAminoMsg { + return { + type: "wasmx/ContractRegistrationRequestProposal", + value: ContractRegistrationRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ContractRegistrationRequestProposalProtoMsg): ContractRegistrationRequestProposal { + return ContractRegistrationRequestProposal.decode(message.value); + }, + toProto(message: ContractRegistrationRequestProposal): Uint8Array { + return ContractRegistrationRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: ContractRegistrationRequestProposal): ContractRegistrationRequestProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequestProposal", + value: ContractRegistrationRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractRegistrationRequestProposal.typeUrl, ContractRegistrationRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractRegistrationRequestProposal.aminoType, ContractRegistrationRequestProposal.typeUrl); +function createBaseBatchContractRegistrationRequestProposal(): BatchContractRegistrationRequestProposal { + return { + title: "", + description: "", + contractRegistrationRequests: [] + }; +} +export const BatchContractRegistrationRequestProposal = { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal", + aminoType: "wasmx/BatchContractRegistrationRequestProposal", + is(o: any): o is BatchContractRegistrationRequestProposal { + return o && (o.$typeUrl === BatchContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contractRegistrationRequests) && (!o.contractRegistrationRequests.length || ContractRegistrationRequest.is(o.contractRegistrationRequests[0]))); + }, + isAmino(o: any): o is BatchContractRegistrationRequestProposalAmino { + return o && (o.$typeUrl === BatchContractRegistrationRequestProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contract_registration_requests) && (!o.contract_registration_requests.length || ContractRegistrationRequest.isAmino(o.contract_registration_requests[0]))); + }, + encode(message: BatchContractRegistrationRequestProposal, 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.contractRegistrationRequests) { + ContractRegistrationRequest.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchContractRegistrationRequestProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchContractRegistrationRequestProposal(); + 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.contractRegistrationRequests.push(ContractRegistrationRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchContractRegistrationRequestProposal { + const message = createBaseBatchContractRegistrationRequestProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractRegistrationRequests = object.contractRegistrationRequests?.map(e => ContractRegistrationRequest.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchContractRegistrationRequestProposalAmino): BatchContractRegistrationRequestProposal { + const message = createBaseBatchContractRegistrationRequestProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contractRegistrationRequests = object.contract_registration_requests?.map(e => ContractRegistrationRequest.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contractRegistrationRequests) { + obj.contract_registration_requests = message.contractRegistrationRequests.map(e => e ? ContractRegistrationRequest.toAmino(e) : undefined); + } else { + obj.contract_registration_requests = message.contractRegistrationRequests; + } + return obj; + }, + fromAminoMsg(object: BatchContractRegistrationRequestProposalAminoMsg): BatchContractRegistrationRequestProposal { + return BatchContractRegistrationRequestProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalAminoMsg { + return { + type: "wasmx/BatchContractRegistrationRequestProposal", + value: BatchContractRegistrationRequestProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchContractRegistrationRequestProposalProtoMsg): BatchContractRegistrationRequestProposal { + return BatchContractRegistrationRequestProposal.decode(message.value); + }, + toProto(message: BatchContractRegistrationRequestProposal): Uint8Array { + return BatchContractRegistrationRequestProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchContractRegistrationRequestProposal): BatchContractRegistrationRequestProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchContractRegistrationRequestProposal", + value: BatchContractRegistrationRequestProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchContractRegistrationRequestProposal.typeUrl, BatchContractRegistrationRequestProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchContractRegistrationRequestProposal.aminoType, BatchContractRegistrationRequestProposal.typeUrl); +function createBaseBatchContractDeregistrationProposal(): BatchContractDeregistrationProposal { + return { + title: "", + description: "", + contracts: [] + }; +} +export const BatchContractDeregistrationProposal = { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal", + aminoType: "wasmx/BatchContractDeregistrationProposal", + is(o: any): o is BatchContractDeregistrationProposal { + return o && (o.$typeUrl === BatchContractDeregistrationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isAmino(o: any): o is BatchContractDeregistrationProposalAmino { + return o && (o.$typeUrl === BatchContractDeregistrationProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + encode(message: BatchContractDeregistrationProposal, 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.contracts) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchContractDeregistrationProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchContractDeregistrationProposal(); + 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.contracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchContractDeregistrationProposal { + const message = createBaseBatchContractDeregistrationProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contracts = object.contracts?.map(e => e) || []; + return message; + }, + fromAmino(object: BatchContractDeregistrationProposalAmino): BatchContractDeregistrationProposal { + const message = createBaseBatchContractDeregistrationProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contracts = object.contracts?.map(e => e) || []; + return message; + }, + toAmino(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } + return obj; + }, + fromAminoMsg(object: BatchContractDeregistrationProposalAminoMsg): BatchContractDeregistrationProposal { + return BatchContractDeregistrationProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalAminoMsg { + return { + type: "wasmx/BatchContractDeregistrationProposal", + value: BatchContractDeregistrationProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchContractDeregistrationProposalProtoMsg): BatchContractDeregistrationProposal { + return BatchContractDeregistrationProposal.decode(message.value); + }, + toProto(message: BatchContractDeregistrationProposal): Uint8Array { + return BatchContractDeregistrationProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchContractDeregistrationProposal): BatchContractDeregistrationProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchContractDeregistrationProposal", + value: BatchContractDeregistrationProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchContractDeregistrationProposal.typeUrl, BatchContractDeregistrationProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchContractDeregistrationProposal.aminoType, BatchContractDeregistrationProposal.typeUrl); +function createBaseContractRegistrationRequest(): ContractRegistrationRequest { + return { + contractAddress: "", + gasLimit: BigInt(0), + gasPrice: BigInt(0), + shouldPinContract: false, + isMigrationAllowed: false, + codeId: BigInt(0), + adminAddress: "", + granterAddress: "", + fundingMode: 0 + }; +} +export const ContractRegistrationRequest = { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest", + is(o: any): o is ContractRegistrationRequest { + return o && (o.$typeUrl === ContractRegistrationRequest.typeUrl || typeof o.contractAddress === "string" && typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint" && typeof o.shouldPinContract === "boolean" && typeof o.isMigrationAllowed === "boolean" && typeof o.codeId === "bigint" && typeof o.adminAddress === "string" && typeof o.granterAddress === "string" && isSet(o.fundingMode)); + }, + isAmino(o: any): o is ContractRegistrationRequestAmino { + return o && (o.$typeUrl === ContractRegistrationRequest.typeUrl || typeof o.contract_address === "string" && typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint" && typeof o.should_pin_contract === "boolean" && typeof o.is_migration_allowed === "boolean" && typeof o.code_id === "bigint" && typeof o.admin_address === "string" && typeof o.granter_address === "string" && isSet(o.funding_mode)); + }, + encode(message: ContractRegistrationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(24).uint64(message.gasPrice); + } + if (message.shouldPinContract === true) { + writer.uint32(32).bool(message.shouldPinContract); + } + if (message.isMigrationAllowed === true) { + writer.uint32(40).bool(message.isMigrationAllowed); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(48).uint64(message.codeId); + } + if (message.adminAddress !== "") { + writer.uint32(58).string(message.adminAddress); + } + if (message.granterAddress !== "") { + writer.uint32(66).string(message.granterAddress); + } + if (message.fundingMode !== 0) { + writer.uint32(72).int32(message.fundingMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractRegistrationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractRegistrationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.gasPrice = reader.uint64(); + break; + case 4: + message.shouldPinContract = reader.bool(); + break; + case 5: + message.isMigrationAllowed = reader.bool(); + break; + case 6: + message.codeId = reader.uint64(); + break; + case 7: + message.adminAddress = reader.string(); + break; + case 8: + message.granterAddress = reader.string(); + break; + case 9: + message.fundingMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ContractRegistrationRequest { + const message = createBaseContractRegistrationRequest(); + message.contractAddress = object.contractAddress ?? ""; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.shouldPinContract = object.shouldPinContract ?? false; + message.isMigrationAllowed = object.isMigrationAllowed ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? ""; + message.granterAddress = object.granterAddress ?? ""; + message.fundingMode = object.fundingMode ?? 0; + return message; + }, + fromAmino(object: ContractRegistrationRequestAmino): ContractRegistrationRequest { + const message = createBaseContractRegistrationRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.should_pin_contract !== undefined && object.should_pin_contract !== null) { + message.shouldPinContract = object.should_pin_contract; + } + if (object.is_migration_allowed !== undefined && object.is_migration_allowed !== null) { + message.isMigrationAllowed = object.is_migration_allowed; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.funding_mode !== undefined && object.funding_mode !== null) { + message.fundingMode = object.funding_mode; + } + return message; + }, + toAmino(message: ContractRegistrationRequest): ContractRegistrationRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.should_pin_contract = message.shouldPinContract === false ? undefined : message.shouldPinContract; + obj.is_migration_allowed = message.isMigrationAllowed === false ? undefined : message.isMigrationAllowed; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === "" ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === "" ? undefined : message.granterAddress; + obj.funding_mode = message.fundingMode === 0 ? undefined : message.fundingMode; + return obj; + }, + fromAminoMsg(object: ContractRegistrationRequestAminoMsg): ContractRegistrationRequest { + return ContractRegistrationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ContractRegistrationRequestProtoMsg): ContractRegistrationRequest { + return ContractRegistrationRequest.decode(message.value); + }, + toProto(message: ContractRegistrationRequest): Uint8Array { + return ContractRegistrationRequest.encode(message).finish(); + }, + toProtoMsg(message: ContractRegistrationRequest): ContractRegistrationRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.ContractRegistrationRequest", + value: ContractRegistrationRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ContractRegistrationRequest.typeUrl, ContractRegistrationRequest); +function createBaseBatchStoreCodeProposal(): BatchStoreCodeProposal { + return { + title: "", + description: "", + proposals: [] + }; +} +export const BatchStoreCodeProposal = { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal", + aminoType: "wasmx/BatchStoreCodeProposal", + is(o: any): o is BatchStoreCodeProposal { + return o && (o.$typeUrl === BatchStoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || StoreCodeProposal.is(o.proposals[0]))); + }, + isAmino(o: any): o is BatchStoreCodeProposalAmino { + return o && (o.$typeUrl === BatchStoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.proposals) && (!o.proposals.length || StoreCodeProposal.isAmino(o.proposals[0]))); + }, + encode(message: BatchStoreCodeProposal, 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.proposals) { + StoreCodeProposal.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchStoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchStoreCodeProposal(); + 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.proposals.push(StoreCodeProposal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BatchStoreCodeProposal { + const message = createBaseBatchStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.proposals = object.proposals?.map(e => StoreCodeProposal.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchStoreCodeProposalAmino): BatchStoreCodeProposal { + const message = createBaseBatchStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.proposals = object.proposals?.map(e => StoreCodeProposal.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchStoreCodeProposal): BatchStoreCodeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? StoreCodeProposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + return obj; + }, + fromAminoMsg(object: BatchStoreCodeProposalAminoMsg): BatchStoreCodeProposal { + return BatchStoreCodeProposal.fromAmino(object.value); + }, + toAminoMsg(message: BatchStoreCodeProposal): BatchStoreCodeProposalAminoMsg { + return { + type: "wasmx/BatchStoreCodeProposal", + value: BatchStoreCodeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: BatchStoreCodeProposalProtoMsg): BatchStoreCodeProposal { + return BatchStoreCodeProposal.decode(message.value); + }, + toProto(message: BatchStoreCodeProposal): Uint8Array { + return BatchStoreCodeProposal.encode(message).finish(); + }, + toProtoMsg(message: BatchStoreCodeProposal): BatchStoreCodeProposalProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.BatchStoreCodeProposal", + value: BatchStoreCodeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BatchStoreCodeProposal.typeUrl, BatchStoreCodeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchStoreCodeProposal.aminoType, BatchStoreCodeProposal.typeUrl); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/query.rpc.func.ts b/libs/injectivejs/src/injective/wasmx/v1/query.rpc.func.ts new file mode 100644 index 00000000..22d53477 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/query.rpc.func.ts @@ -0,0 +1,23 @@ +import { RpcResolver, buildQuery } from "../../../helper-func-types"; +import { QueryWasmxParamsRequest, QueryWasmxParamsResponse, QueryContractRegistrationInfoRequest, QueryContractRegistrationInfoResponse, QueryModuleStateRequest, QueryModuleStateResponse } from "./query"; +export const createGetWasmxParams = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmxParamsRequest.encode, + decode: QueryWasmxParamsResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxParams", + clientResolver +}); +export const createGetContractRegistrationInfo = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryContractRegistrationInfoRequest.encode, + decode: QueryContractRegistrationInfoResponse.decode, + service: "injective.wasmx.v1.Query", + method: "ContractRegistrationInfo", + clientResolver +}); +export const createGetWasmxModuleState = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryModuleStateRequest.encode, + decode: QueryModuleStateResponse.decode, + service: "injective.wasmx.v1.Query", + method: "WasmxModuleState", + clientResolver +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/query.ts b/libs/injectivejs/src/injective/wasmx/v1/query.ts new file mode 100644 index 00000000..002a060c --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/query.ts @@ -0,0 +1,509 @@ +import { Params, ParamsAmino, RegisteredContract, RegisteredContractAmino } from "./wasmx"; +import { GenesisState, GenesisStateAmino } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsRequest {} +export interface QueryWasmxParamsRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest"; + value: Uint8Array; +} +/** + * QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsRequestAmino {} +export interface QueryWasmxParamsRequestAminoMsg { + type: "/injective.wasmx.v1.QueryWasmxParamsRequest"; + value: QueryWasmxParamsRequestAmino; +} +/** + * QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsResponse { + params: Params; +} +export interface QueryWasmxParamsResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse"; + value: Uint8Array; +} +/** + * QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC + * method. + */ +export interface QueryWasmxParamsResponseAmino { + params: ParamsAmino; +} +export interface QueryWasmxParamsResponseAminoMsg { + type: "/injective.wasmx.v1.QueryWasmxParamsResponse"; + value: QueryWasmxParamsResponseAmino; +} +/** + * QueryModuleStateRequest is the request type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** + * QueryModuleStateRequest is the request type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/injective.wasmx.v1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** + * QueryModuleStateResponse is the response type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateResponse { + state?: GenesisState; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** + * QueryModuleStateResponse is the response type for the Query/WasmxModuleState + * RPC method. + */ +export interface QueryModuleStateResponseAmino { + state?: GenesisStateAmino; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/injective.wasmx.v1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +/** Contract registration info */ +export interface QueryContractRegistrationInfoRequest { + contractAddress: string; +} +export interface QueryContractRegistrationInfoRequestProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest"; + value: Uint8Array; +} +/** Contract registration info */ +export interface QueryContractRegistrationInfoRequestAmino { + contract_address: string; +} +export interface QueryContractRegistrationInfoRequestAminoMsg { + type: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest"; + value: QueryContractRegistrationInfoRequestAmino; +} +export interface QueryContractRegistrationInfoResponse { + contract?: RegisteredContract; +} +export interface QueryContractRegistrationInfoResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse"; + value: Uint8Array; +} +export interface QueryContractRegistrationInfoResponseAmino { + contract?: RegisteredContractAmino; +} +export interface QueryContractRegistrationInfoResponseAminoMsg { + type: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse"; + value: QueryContractRegistrationInfoResponseAmino; +} +function createBaseQueryWasmxParamsRequest(): QueryWasmxParamsRequest { + return {}; +} +export const QueryWasmxParamsRequest = { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest", + is(o: any): o is QueryWasmxParamsRequest { + return o && o.$typeUrl === QueryWasmxParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryWasmxParamsRequestAmino { + return o && o.$typeUrl === QueryWasmxParamsRequest.typeUrl; + }, + encode(_: QueryWasmxParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmxParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmxParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryWasmxParamsRequest { + const message = createBaseQueryWasmxParamsRequest(); + return message; + }, + fromAmino(_: QueryWasmxParamsRequestAmino): QueryWasmxParamsRequest { + const message = createBaseQueryWasmxParamsRequest(); + return message; + }, + toAmino(_: QueryWasmxParamsRequest): QueryWasmxParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryWasmxParamsRequestAminoMsg): QueryWasmxParamsRequest { + return QueryWasmxParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryWasmxParamsRequestProtoMsg): QueryWasmxParamsRequest { + return QueryWasmxParamsRequest.decode(message.value); + }, + toProto(message: QueryWasmxParamsRequest): Uint8Array { + return QueryWasmxParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmxParamsRequest): QueryWasmxParamsRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsRequest", + value: QueryWasmxParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmxParamsRequest.typeUrl, QueryWasmxParamsRequest); +function createBaseQueryWasmxParamsResponse(): QueryWasmxParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryWasmxParamsResponse = { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse", + is(o: any): o is QueryWasmxParamsResponse { + return o && (o.$typeUrl === QueryWasmxParamsResponse.typeUrl || Params.is(o.params)); + }, + isAmino(o: any): o is QueryWasmxParamsResponseAmino { + return o && (o.$typeUrl === QueryWasmxParamsResponse.typeUrl || Params.isAmino(o.params)); + }, + encode(message: QueryWasmxParamsResponse, 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): QueryWasmxParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmxParamsResponse(); + 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: DeepPartial): QueryWasmxParamsResponse { + const message = createBaseQueryWasmxParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryWasmxParamsResponseAmino): QueryWasmxParamsResponse { + const message = createBaseQueryWasmxParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryWasmxParamsResponse): QueryWasmxParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryWasmxParamsResponseAminoMsg): QueryWasmxParamsResponse { + return QueryWasmxParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryWasmxParamsResponseProtoMsg): QueryWasmxParamsResponse { + return QueryWasmxParamsResponse.decode(message.value); + }, + toProto(message: QueryWasmxParamsResponse): Uint8Array { + return QueryWasmxParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmxParamsResponse): QueryWasmxParamsResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryWasmxParamsResponse", + value: QueryWasmxParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmxParamsResponse.typeUrl, QueryWasmxParamsResponse); +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest", + is(o: any): o is QueryModuleStateRequest { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateRequestAmino { + return o && o.$typeUrl === QueryModuleStateRequest.typeUrl; + }, + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateRequest.typeUrl, QueryModuleStateRequest); +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + state: undefined + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse", + is(o: any): o is QueryModuleStateResponse { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleStateResponseAmino { + return o && o.$typeUrl === QueryModuleStateResponse.typeUrl; + }, + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + GenesisState.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = GenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.state = object.state !== undefined && object.state !== null ? GenesisState.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = GenesisState.fromAmino(object.state); + } + return message; + }, + toAmino(message: QueryModuleStateResponse): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.state = message.state ? GenesisState.toAmino(message.state) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryModuleStateResponse.typeUrl, QueryModuleStateResponse); +function createBaseQueryContractRegistrationInfoRequest(): QueryContractRegistrationInfoRequest { + return { + contractAddress: "" + }; +} +export const QueryContractRegistrationInfoRequest = { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest", + is(o: any): o is QueryContractRegistrationInfoRequest { + return o && (o.$typeUrl === QueryContractRegistrationInfoRequest.typeUrl || typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is QueryContractRegistrationInfoRequestAmino { + return o && (o.$typeUrl === QueryContractRegistrationInfoRequest.typeUrl || typeof o.contract_address === "string"); + }, + encode(message: QueryContractRegistrationInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractRegistrationInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractRegistrationInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractRegistrationInfoRequest { + const message = createBaseQueryContractRegistrationInfoRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryContractRegistrationInfoRequestAmino): QueryContractRegistrationInfoRequest { + const message = createBaseQueryContractRegistrationInfoRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryContractRegistrationInfoRequest): QueryContractRegistrationInfoRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryContractRegistrationInfoRequestAminoMsg): QueryContractRegistrationInfoRequest { + return QueryContractRegistrationInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractRegistrationInfoRequestProtoMsg): QueryContractRegistrationInfoRequest { + return QueryContractRegistrationInfoRequest.decode(message.value); + }, + toProto(message: QueryContractRegistrationInfoRequest): Uint8Array { + return QueryContractRegistrationInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractRegistrationInfoRequest): QueryContractRegistrationInfoRequestProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoRequest", + value: QueryContractRegistrationInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractRegistrationInfoRequest.typeUrl, QueryContractRegistrationInfoRequest); +function createBaseQueryContractRegistrationInfoResponse(): QueryContractRegistrationInfoResponse { + return { + contract: undefined + }; +} +export const QueryContractRegistrationInfoResponse = { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse", + is(o: any): o is QueryContractRegistrationInfoResponse { + return o && o.$typeUrl === QueryContractRegistrationInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryContractRegistrationInfoResponseAmino { + return o && o.$typeUrl === QueryContractRegistrationInfoResponse.typeUrl; + }, + encode(message: QueryContractRegistrationInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contract !== undefined) { + RegisteredContract.encode(message.contract, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractRegistrationInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractRegistrationInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contract = RegisteredContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryContractRegistrationInfoResponse { + const message = createBaseQueryContractRegistrationInfoResponse(); + message.contract = object.contract !== undefined && object.contract !== null ? RegisteredContract.fromPartial(object.contract) : undefined; + return message; + }, + fromAmino(object: QueryContractRegistrationInfoResponseAmino): QueryContractRegistrationInfoResponse { + const message = createBaseQueryContractRegistrationInfoResponse(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = RegisteredContract.fromAmino(object.contract); + } + return message; + }, + toAmino(message: QueryContractRegistrationInfoResponse): QueryContractRegistrationInfoResponseAmino { + const obj: any = {}; + obj.contract = message.contract ? RegisteredContract.toAmino(message.contract) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractRegistrationInfoResponseAminoMsg): QueryContractRegistrationInfoResponse { + return QueryContractRegistrationInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractRegistrationInfoResponseProtoMsg): QueryContractRegistrationInfoResponse { + return QueryContractRegistrationInfoResponse.decode(message.value); + }, + toProto(message: QueryContractRegistrationInfoResponse): Uint8Array { + return QueryContractRegistrationInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractRegistrationInfoResponse): QueryContractRegistrationInfoResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.QueryContractRegistrationInfoResponse", + value: QueryContractRegistrationInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryContractRegistrationInfoResponse.typeUrl, QueryContractRegistrationInfoResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/tx.rpc.func.ts b/libs/injectivejs/src/injective/wasmx/v1/tx.rpc.func.ts new file mode 100644 index 00000000..9f6c3d0c --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/tx.rpc.func.ts @@ -0,0 +1,39 @@ +import { buildTx, SigningClientResolver } from "../../../helper-func-types"; +import { toEncoders, toConverters } from "@interchainjs/cosmos/utils"; +import { MsgUpdateContract, MsgActivateContract, MsgDeactivateContract, MsgExecuteContractCompat, MsgUpdateParams, MsgRegisterContract } from "./tx"; +export const createUpdateRegistryContractParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateContract.typeUrl, + encoders: toEncoders(MsgUpdateContract), + converters: toConverters(MsgUpdateContract) +}); +export const createActivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgActivateContract.typeUrl, + encoders: toEncoders(MsgActivateContract), + converters: toConverters(MsgActivateContract) +}); +export const createDeactivateRegistryContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgDeactivateContract.typeUrl, + encoders: toEncoders(MsgDeactivateContract), + converters: toConverters(MsgDeactivateContract) +}); +export const createExecuteContractCompat = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgExecuteContractCompat.typeUrl, + encoders: toEncoders(MsgExecuteContractCompat), + converters: toConverters(MsgExecuteContractCompat) +}); +export const createUpdateParams = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgUpdateParams.typeUrl, + encoders: toEncoders(MsgUpdateParams), + converters: toConverters(MsgUpdateParams) +}); +export const createRegisterContract = (clientResolver?: SigningClientResolver) => buildTx({ + clientResolver, + typeUrl: MsgRegisterContract.typeUrl, + encoders: toEncoders(MsgRegisterContract), + converters: toConverters(MsgRegisterContract) +}); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/tx.ts b/libs/injectivejs/src/injective/wasmx/v1/tx.ts new file mode 100644 index 00000000..a8b9a574 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/tx.ts @@ -0,0 +1,1174 @@ +import { Params, ParamsAmino } from "./wasmx"; +import { ContractRegistrationRequest, ContractRegistrationRequestAmino } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgExecuteContractCompat submits the given message data to a smart contract, + * compatible with EIP712 + */ +export interface MsgExecuteContractCompat { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: string; + /** Funds coins that are transferred to the contract on execution */ + funds: string; +} +export interface MsgExecuteContractCompatProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat"; + value: Uint8Array; +} +/** + * MsgExecuteContractCompat submits the given message data to a smart contract, + * compatible with EIP712 + */ +export interface MsgExecuteContractCompatAmino { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: string; + /** Funds coins that are transferred to the contract on execution */ + funds: string; +} +export interface MsgExecuteContractCompatAminoMsg { + type: "wasmx/MsgExecuteContractCompat"; + value: MsgExecuteContractCompatAmino; +} +/** MsgExecuteContractCompatResponse returns execution result data. */ +export interface MsgExecuteContractCompatResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractCompatResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse"; + value: Uint8Array; +} +/** MsgExecuteContractCompatResponse returns execution result data. */ +export interface MsgExecuteContractCompatResponseAmino { + /** Data contains bytes to returned from the contract */ + data: string; +} +export interface MsgExecuteContractCompatResponseAminoMsg { + type: "/injective.wasmx.v1.MsgExecuteContractCompatResponse"; + value: MsgExecuteContractCompatResponseAmino; +} +export interface MsgUpdateContract { + sender: string; + /** Unique Identifier for contract instance to be registered. */ + contractAddress: string; + /** Maximum gas to be used for the smart contract execution. */ + gasLimit: bigint; + /** gas price to be used for the smart contract execution. */ + gasPrice: bigint; + /** optional - admin account that will be allowed to perform any changes */ + adminAddress?: string; +} +export interface MsgUpdateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract"; + value: Uint8Array; +} +export interface MsgUpdateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be registered. */ + contract_address: string; + /** Maximum gas to be used for the smart contract execution. */ + gas_limit: string; + /** gas price to be used for the smart contract execution. */ + gas_price: string; + /** optional - admin account that will be allowed to perform any changes */ + admin_address?: string; +} +export interface MsgUpdateContractAminoMsg { + type: "wasmx/MsgUpdateContract"; + value: MsgUpdateContractAmino; +} +export interface MsgUpdateContractResponse {} +export interface MsgUpdateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse"; + value: Uint8Array; +} +export interface MsgUpdateContractResponseAmino {} +export interface MsgUpdateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgUpdateContractResponse"; + value: MsgUpdateContractResponseAmino; +} +export interface MsgActivateContract { + sender: string; + /** Unique Identifier for contract instance to be activated. */ + contractAddress: string; +} +export interface MsgActivateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgActivateContract"; + value: Uint8Array; +} +export interface MsgActivateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be activated. */ + contract_address: string; +} +export interface MsgActivateContractAminoMsg { + type: "wasmx/MsgActivateContract"; + value: MsgActivateContractAmino; +} +export interface MsgActivateContractResponse {} +export interface MsgActivateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse"; + value: Uint8Array; +} +export interface MsgActivateContractResponseAmino {} +export interface MsgActivateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgActivateContractResponse"; + value: MsgActivateContractResponseAmino; +} +export interface MsgDeactivateContract { + sender: string; + /** Unique Identifier for contract instance to be deactivated. */ + contractAddress: string; +} +export interface MsgDeactivateContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract"; + value: Uint8Array; +} +export interface MsgDeactivateContractAmino { + sender: string; + /** Unique Identifier for contract instance to be deactivated. */ + contract_address: string; +} +export interface MsgDeactivateContractAminoMsg { + type: "wasmx/MsgDeactivateContract"; + value: MsgDeactivateContractAmino; +} +export interface MsgDeactivateContractResponse {} +export interface MsgDeactivateContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse"; + value: Uint8Array; +} +export interface MsgDeactivateContractResponseAmino {} +export interface MsgDeactivateContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgDeactivateContractResponse"; + value: MsgDeactivateContractResponseAmino; +} +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the wasmx parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the wasmx parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "wasmx/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/injective.wasmx.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgRegisterContract { + sender: string; + contractRegistrationRequest: ContractRegistrationRequest; +} +export interface MsgRegisterContractProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract"; + value: Uint8Array; +} +export interface MsgRegisterContractAmino { + sender: string; + contract_registration_request: ContractRegistrationRequestAmino; +} +export interface MsgRegisterContractAminoMsg { + type: "wasmx/MsgRegisterContract"; + value: MsgRegisterContractAmino; +} +export interface MsgRegisterContractResponse {} +export interface MsgRegisterContractResponseProtoMsg { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse"; + value: Uint8Array; +} +export interface MsgRegisterContractResponseAmino {} +export interface MsgRegisterContractResponseAminoMsg { + type: "/injective.wasmx.v1.MsgRegisterContractResponse"; + value: MsgRegisterContractResponseAmino; +} +function createBaseMsgExecuteContractCompat(): MsgExecuteContractCompat { + return { + sender: "", + contract: "", + msg: "", + funds: "" + }; +} +export const MsgExecuteContractCompat = { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat", + aminoType: "wasmx/MsgExecuteContractCompat", + is(o: any): o is MsgExecuteContractCompat { + return o && (o.$typeUrl === MsgExecuteContractCompat.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.msg === "string" && typeof o.funds === "string"); + }, + isAmino(o: any): o is MsgExecuteContractCompatAmino { + return o && (o.$typeUrl === MsgExecuteContractCompat.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.msg === "string" && typeof o.funds === "string"); + }, + encode(message: MsgExecuteContractCompat, 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 !== "") { + writer.uint32(26).string(message.msg); + } + if (message.funds !== "") { + writer.uint32(34).string(message.funds); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractCompat { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractCompat(); + 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.string(); + break; + case 4: + message.funds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgExecuteContractCompat { + const message = createBaseMsgExecuteContractCompat(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? ""; + message.funds = object.funds ?? ""; + return message; + }, + fromAmino(object: MsgExecuteContractCompatAmino): MsgExecuteContractCompat { + const message = createBaseMsgExecuteContractCompat(); + 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 = object.msg; + } + if (object.funds !== undefined && object.funds !== null) { + message.funds = object.funds; + } + return message; + }, + toAmino(message: MsgExecuteContractCompat): MsgExecuteContractCompatAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg === "" ? undefined : message.msg; + obj.funds = message.funds === "" ? undefined : message.funds; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractCompatAminoMsg): MsgExecuteContractCompat { + return MsgExecuteContractCompat.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractCompat): MsgExecuteContractCompatAminoMsg { + return { + type: "wasmx/MsgExecuteContractCompat", + value: MsgExecuteContractCompat.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractCompatProtoMsg): MsgExecuteContractCompat { + return MsgExecuteContractCompat.decode(message.value); + }, + toProto(message: MsgExecuteContractCompat): Uint8Array { + return MsgExecuteContractCompat.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractCompat): MsgExecuteContractCompatProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompat", + value: MsgExecuteContractCompat.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractCompat.typeUrl, MsgExecuteContractCompat); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContractCompat.aminoType, MsgExecuteContractCompat.typeUrl); +function createBaseMsgExecuteContractCompatResponse(): MsgExecuteContractCompatResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractCompatResponse = { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse", + is(o: any): o is MsgExecuteContractCompatResponse { + return o && (o.$typeUrl === MsgExecuteContractCompatResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgExecuteContractCompatResponseAmino { + return o && (o.$typeUrl === MsgExecuteContractCompatResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: MsgExecuteContractCompatResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractCompatResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractCompatResponse(); + 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: DeepPartial): MsgExecuteContractCompatResponse { + const message = createBaseMsgExecuteContractCompatResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractCompatResponseAmino): MsgExecuteContractCompatResponse { + const message = createBaseMsgExecuteContractCompatResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractCompatResponse): MsgExecuteContractCompatResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractCompatResponseAminoMsg): MsgExecuteContractCompatResponse { + return MsgExecuteContractCompatResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExecuteContractCompatResponseProtoMsg): MsgExecuteContractCompatResponse { + return MsgExecuteContractCompatResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractCompatResponse): Uint8Array { + return MsgExecuteContractCompatResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractCompatResponse): MsgExecuteContractCompatResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgExecuteContractCompatResponse", + value: MsgExecuteContractCompatResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractCompatResponse.typeUrl, MsgExecuteContractCompatResponse); +function createBaseMsgUpdateContract(): MsgUpdateContract { + return { + sender: "", + contractAddress: "", + gasLimit: BigInt(0), + gasPrice: BigInt(0), + adminAddress: undefined + }; +} +export const MsgUpdateContract = { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract", + aminoType: "wasmx/MsgUpdateContract", + is(o: any): o is MsgUpdateContract { + return o && (o.$typeUrl === MsgUpdateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string" && typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint"); + }, + isAmino(o: any): o is MsgUpdateContractAmino { + return o && (o.$typeUrl === MsgUpdateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string" && typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint"); + }, + encode(message: MsgUpdateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(24).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(32).uint64(message.gasPrice); + } + if (message.adminAddress !== undefined) { + writer.uint32(42).string(message.adminAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.gasLimit = reader.uint64(); + break; + case 4: + message.gasPrice = reader.uint64(); + break; + case 5: + message.adminAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgUpdateContract { + const message = createBaseMsgUpdateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.adminAddress = object.adminAddress ?? undefined; + return message; + }, + fromAmino(object: MsgUpdateContractAmino): MsgUpdateContract { + const message = createBaseMsgUpdateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + return message; + }, + toAmino(message: MsgUpdateContract): MsgUpdateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.admin_address = message.adminAddress === null ? undefined : message.adminAddress; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractAminoMsg): MsgUpdateContract { + return MsgUpdateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateContract): MsgUpdateContractAminoMsg { + return { + type: "wasmx/MsgUpdateContract", + value: MsgUpdateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateContractProtoMsg): MsgUpdateContract { + return MsgUpdateContract.decode(message.value); + }, + toProto(message: MsgUpdateContract): Uint8Array { + return MsgUpdateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContract): MsgUpdateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateContract", + value: MsgUpdateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContract.typeUrl, MsgUpdateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContract.aminoType, MsgUpdateContract.typeUrl); +function createBaseMsgUpdateContractResponse(): MsgUpdateContractResponse { + return {}; +} +export const MsgUpdateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse", + is(o: any): o is MsgUpdateContractResponse { + return o && o.$typeUrl === MsgUpdateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateContractResponseAmino { + return o && o.$typeUrl === MsgUpdateContractResponse.typeUrl; + }, + encode(_: MsgUpdateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgUpdateContractResponse { + const message = createBaseMsgUpdateContractResponse(); + return message; + }, + fromAmino(_: MsgUpdateContractResponseAmino): MsgUpdateContractResponse { + const message = createBaseMsgUpdateContractResponse(); + return message; + }, + toAmino(_: MsgUpdateContractResponse): MsgUpdateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateContractResponseAminoMsg): MsgUpdateContractResponse { + return MsgUpdateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateContractResponseProtoMsg): MsgUpdateContractResponse { + return MsgUpdateContractResponse.decode(message.value); + }, + toProto(message: MsgUpdateContractResponse): Uint8Array { + return MsgUpdateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateContractResponse): MsgUpdateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateContractResponse", + value: MsgUpdateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateContractResponse.typeUrl, MsgUpdateContractResponse); +function createBaseMsgActivateContract(): MsgActivateContract { + return { + sender: "", + contractAddress: "" + }; +} +export const MsgActivateContract = { + typeUrl: "/injective.wasmx.v1.MsgActivateContract", + aminoType: "wasmx/MsgActivateContract", + is(o: any): o is MsgActivateContract { + return o && (o.$typeUrl === MsgActivateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is MsgActivateContractAmino { + return o && (o.$typeUrl === MsgActivateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string"); + }, + encode(message: MsgActivateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgActivateContract { + const message = createBaseMsgActivateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: MsgActivateContractAmino): MsgActivateContract { + const message = createBaseMsgActivateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: MsgActivateContract): MsgActivateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: MsgActivateContractAminoMsg): MsgActivateContract { + return MsgActivateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgActivateContract): MsgActivateContractAminoMsg { + return { + type: "wasmx/MsgActivateContract", + value: MsgActivateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgActivateContractProtoMsg): MsgActivateContract { + return MsgActivateContract.decode(message.value); + }, + toProto(message: MsgActivateContract): Uint8Array { + return MsgActivateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateContract): MsgActivateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgActivateContract", + value: MsgActivateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateContract.typeUrl, MsgActivateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgActivateContract.aminoType, MsgActivateContract.typeUrl); +function createBaseMsgActivateContractResponse(): MsgActivateContractResponse { + return {}; +} +export const MsgActivateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse", + is(o: any): o is MsgActivateContractResponse { + return o && o.$typeUrl === MsgActivateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgActivateContractResponseAmino { + return o && o.$typeUrl === MsgActivateContractResponse.typeUrl; + }, + encode(_: MsgActivateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgActivateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgActivateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgActivateContractResponse { + const message = createBaseMsgActivateContractResponse(); + return message; + }, + fromAmino(_: MsgActivateContractResponseAmino): MsgActivateContractResponse { + const message = createBaseMsgActivateContractResponse(); + return message; + }, + toAmino(_: MsgActivateContractResponse): MsgActivateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgActivateContractResponseAminoMsg): MsgActivateContractResponse { + return MsgActivateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgActivateContractResponseProtoMsg): MsgActivateContractResponse { + return MsgActivateContractResponse.decode(message.value); + }, + toProto(message: MsgActivateContractResponse): Uint8Array { + return MsgActivateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgActivateContractResponse): MsgActivateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgActivateContractResponse", + value: MsgActivateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgActivateContractResponse.typeUrl, MsgActivateContractResponse); +function createBaseMsgDeactivateContract(): MsgDeactivateContract { + return { + sender: "", + contractAddress: "" + }; +} +export const MsgDeactivateContract = { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract", + aminoType: "wasmx/MsgDeactivateContract", + is(o: any): o is MsgDeactivateContract { + return o && (o.$typeUrl === MsgDeactivateContract.typeUrl || typeof o.sender === "string" && typeof o.contractAddress === "string"); + }, + isAmino(o: any): o is MsgDeactivateContractAmino { + return o && (o.$typeUrl === MsgDeactivateContract.typeUrl || typeof o.sender === "string" && typeof o.contract_address === "string"); + }, + encode(message: MsgDeactivateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeactivateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeactivateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgDeactivateContract { + const message = createBaseMsgDeactivateContract(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: MsgDeactivateContractAmino): MsgDeactivateContract { + const message = createBaseMsgDeactivateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: MsgDeactivateContract): MsgDeactivateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: MsgDeactivateContractAminoMsg): MsgDeactivateContract { + return MsgDeactivateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeactivateContract): MsgDeactivateContractAminoMsg { + return { + type: "wasmx/MsgDeactivateContract", + value: MsgDeactivateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDeactivateContractProtoMsg): MsgDeactivateContract { + return MsgDeactivateContract.decode(message.value); + }, + toProto(message: MsgDeactivateContract): Uint8Array { + return MsgDeactivateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgDeactivateContract): MsgDeactivateContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContract", + value: MsgDeactivateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeactivateContract.typeUrl, MsgDeactivateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeactivateContract.aminoType, MsgDeactivateContract.typeUrl); +function createBaseMsgDeactivateContractResponse(): MsgDeactivateContractResponse { + return {}; +} +export const MsgDeactivateContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse", + is(o: any): o is MsgDeactivateContractResponse { + return o && o.$typeUrl === MsgDeactivateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgDeactivateContractResponseAmino { + return o && o.$typeUrl === MsgDeactivateContractResponse.typeUrl; + }, + encode(_: MsgDeactivateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeactivateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeactivateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgDeactivateContractResponse { + const message = createBaseMsgDeactivateContractResponse(); + return message; + }, + fromAmino(_: MsgDeactivateContractResponseAmino): MsgDeactivateContractResponse { + const message = createBaseMsgDeactivateContractResponse(); + return message; + }, + toAmino(_: MsgDeactivateContractResponse): MsgDeactivateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeactivateContractResponseAminoMsg): MsgDeactivateContractResponse { + return MsgDeactivateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeactivateContractResponseProtoMsg): MsgDeactivateContractResponse { + return MsgDeactivateContractResponse.decode(message.value); + }, + toProto(message: MsgDeactivateContractResponse): Uint8Array { + return MsgDeactivateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeactivateContractResponse): MsgDeactivateContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgDeactivateContractResponse", + value: MsgDeactivateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgDeactivateContractResponse.typeUrl, MsgDeactivateContractResponse); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/injective.wasmx.v1.MsgUpdateParams", + aminoType: "wasmx/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + 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: DeepPartial): 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: "wasmx/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: "/injective.wasmx.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + 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(_: DeepPartial): 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); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +function createBaseMsgRegisterContract(): MsgRegisterContract { + return { + sender: "", + contractRegistrationRequest: ContractRegistrationRequest.fromPartial({}) + }; +} +export const MsgRegisterContract = { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract", + aminoType: "wasmx/MsgRegisterContract", + is(o: any): o is MsgRegisterContract { + return o && (o.$typeUrl === MsgRegisterContract.typeUrl || typeof o.sender === "string" && ContractRegistrationRequest.is(o.contractRegistrationRequest)); + }, + isAmino(o: any): o is MsgRegisterContractAmino { + return o && (o.$typeUrl === MsgRegisterContract.typeUrl || typeof o.sender === "string" && ContractRegistrationRequest.isAmino(o.contract_registration_request)); + }, + encode(message: MsgRegisterContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractRegistrationRequest !== undefined) { + ContractRegistrationRequest.encode(message.contractRegistrationRequest, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractRegistrationRequest = ContractRegistrationRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): MsgRegisterContract { + const message = createBaseMsgRegisterContract(); + message.sender = object.sender ?? ""; + message.contractRegistrationRequest = object.contractRegistrationRequest !== undefined && object.contractRegistrationRequest !== null ? ContractRegistrationRequest.fromPartial(object.contractRegistrationRequest) : undefined; + return message; + }, + fromAmino(object: MsgRegisterContractAmino): MsgRegisterContract { + const message = createBaseMsgRegisterContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_registration_request !== undefined && object.contract_registration_request !== null) { + message.contractRegistrationRequest = ContractRegistrationRequest.fromAmino(object.contract_registration_request); + } + return message; + }, + toAmino(message: MsgRegisterContract): MsgRegisterContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_registration_request = message.contractRegistrationRequest ? ContractRegistrationRequest.toAmino(message.contractRegistrationRequest) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRegisterContractAminoMsg): MsgRegisterContract { + return MsgRegisterContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgRegisterContract): MsgRegisterContractAminoMsg { + return { + type: "wasmx/MsgRegisterContract", + value: MsgRegisterContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRegisterContractProtoMsg): MsgRegisterContract { + return MsgRegisterContract.decode(message.value); + }, + toProto(message: MsgRegisterContract): Uint8Array { + return MsgRegisterContract.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterContract): MsgRegisterContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgRegisterContract", + value: MsgRegisterContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRegisterContract.typeUrl, MsgRegisterContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterContract.aminoType, MsgRegisterContract.typeUrl); +function createBaseMsgRegisterContractResponse(): MsgRegisterContractResponse { + return {}; +} +export const MsgRegisterContractResponse = { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse", + is(o: any): o is MsgRegisterContractResponse { + return o && o.$typeUrl === MsgRegisterContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgRegisterContractResponseAmino { + return o && o.$typeUrl === MsgRegisterContractResponse.typeUrl; + }, + encode(_: MsgRegisterContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): MsgRegisterContractResponse { + const message = createBaseMsgRegisterContractResponse(); + return message; + }, + fromAmino(_: MsgRegisterContractResponseAmino): MsgRegisterContractResponse { + const message = createBaseMsgRegisterContractResponse(); + return message; + }, + toAmino(_: MsgRegisterContractResponse): MsgRegisterContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterContractResponseAminoMsg): MsgRegisterContractResponse { + return MsgRegisterContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterContractResponseProtoMsg): MsgRegisterContractResponse { + return MsgRegisterContractResponse.decode(message.value); + }, + toProto(message: MsgRegisterContractResponse): Uint8Array { + return MsgRegisterContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterContractResponse): MsgRegisterContractResponseProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.MsgRegisterContractResponse", + value: MsgRegisterContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRegisterContractResponse.typeUrl, MsgRegisterContractResponse); \ No newline at end of file diff --git a/libs/injectivejs/src/injective/wasmx/v1/wasmx.ts b/libs/injectivejs/src/injective/wasmx/v1/wasmx.ts new file mode 100644 index 00000000..3cb66691 --- /dev/null +++ b/libs/injectivejs/src/injective/wasmx/v1/wasmx.ts @@ -0,0 +1,379 @@ +import { AccessConfig, AccessConfigAmino } from "../../../cosmwasm/wasm/v1/types"; +import { FundingMode } from "./proposal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** + * Set the status to active to indicate that contracts can be executed in + * begin blocker. + */ + isExecutionEnabled: boolean; + /** + * Maximum aggregate total gas to be used for the contract executions in the + * BeginBlocker. + */ + maxBeginBlockTotalGas: bigint; + /** + * the maximum gas limit each individual contract can consume in the + * BeginBlocker. + */ + maxContractGasLimit: bigint; + /** + * min_gas_price defines the minimum gas price the contracts must pay to be + * executed in the BeginBlocker. + */ + minGasPrice: bigint; + registerContractAccess: AccessConfig; +} +export interface ParamsProtoMsg { + typeUrl: "/injective.wasmx.v1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * Set the status to active to indicate that contracts can be executed in + * begin blocker. + */ + is_execution_enabled: boolean; + /** + * Maximum aggregate total gas to be used for the contract executions in the + * BeginBlocker. + */ + max_begin_block_total_gas: string; + /** + * the maximum gas limit each individual contract can consume in the + * BeginBlocker. + */ + max_contract_gas_limit: string; + /** + * min_gas_price defines the minimum gas price the contracts must pay to be + * executed in the BeginBlocker. + */ + min_gas_price: string; + register_contract_access: AccessConfigAmino; +} +export interface ParamsAminoMsg { + type: "wasmx/Params"; + value: ParamsAmino; +} +export interface RegisteredContract { + /** limit of gas per BB execution */ + gasLimit: bigint; + /** gas price that contract is willing to pay for execution in BeginBlocker */ + gasPrice: bigint; + /** is contract currently active */ + isExecutable: boolean; + /** + * code_id that is allowed to be executed (to prevent malicious updates) - if + * nil/0 any code_id can be executed + */ + codeId?: bigint; + /** optional - admin addr that is allowed to update contract data */ + adminAddress?: string; + /** + * Optional: address of the contract granting fee + * Must be set if fund_mode is GrantOnly + */ + granterAddress?: string; + /** funding mode */ + fundMode: FundingMode; +} +export interface RegisteredContractProtoMsg { + typeUrl: "/injective.wasmx.v1.RegisteredContract"; + value: Uint8Array; +} +export interface RegisteredContractAmino { + /** limit of gas per BB execution */ + gas_limit: string; + /** gas price that contract is willing to pay for execution in BeginBlocker */ + gas_price: string; + /** is contract currently active */ + is_executable: boolean; + /** + * code_id that is allowed to be executed (to prevent malicious updates) - if + * nil/0 any code_id can be executed + */ + code_id?: string; + /** optional - admin addr that is allowed to update contract data */ + admin_address?: string; + /** + * Optional: address of the contract granting fee + * Must be set if fund_mode is GrantOnly + */ + granter_address?: string; + /** funding mode */ + fund_mode: FundingMode; +} +export interface RegisteredContractAminoMsg { + type: "/injective.wasmx.v1.RegisteredContract"; + value: RegisteredContractAmino; +} +function createBaseParams(): Params { + return { + isExecutionEnabled: false, + maxBeginBlockTotalGas: BigInt(0), + maxContractGasLimit: BigInt(0), + minGasPrice: BigInt(0), + registerContractAccess: AccessConfig.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/injective.wasmx.v1.Params", + aminoType: "wasmx/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.isExecutionEnabled === "boolean" && typeof o.maxBeginBlockTotalGas === "bigint" && typeof o.maxContractGasLimit === "bigint" && typeof o.minGasPrice === "bigint" && AccessConfig.is(o.registerContractAccess)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.is_execution_enabled === "boolean" && typeof o.max_begin_block_total_gas === "bigint" && typeof o.max_contract_gas_limit === "bigint" && typeof o.min_gas_price === "bigint" && AccessConfig.isAmino(o.register_contract_access)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isExecutionEnabled === true) { + writer.uint32(8).bool(message.isExecutionEnabled); + } + if (message.maxBeginBlockTotalGas !== BigInt(0)) { + writer.uint32(16).uint64(message.maxBeginBlockTotalGas); + } + if (message.maxContractGasLimit !== BigInt(0)) { + writer.uint32(24).uint64(message.maxContractGasLimit); + } + if (message.minGasPrice !== BigInt(0)) { + writer.uint32(32).uint64(message.minGasPrice); + } + if (message.registerContractAccess !== undefined) { + AccessConfig.encode(message.registerContractAccess, writer.uint32(42).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.isExecutionEnabled = reader.bool(); + break; + case 2: + message.maxBeginBlockTotalGas = reader.uint64(); + break; + case 3: + message.maxContractGasLimit = reader.uint64(); + break; + case 4: + message.minGasPrice = reader.uint64(); + break; + case 5: + message.registerContractAccess = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.isExecutionEnabled = object.isExecutionEnabled ?? false; + message.maxBeginBlockTotalGas = object.maxBeginBlockTotalGas !== undefined && object.maxBeginBlockTotalGas !== null ? BigInt(object.maxBeginBlockTotalGas.toString()) : BigInt(0); + message.maxContractGasLimit = object.maxContractGasLimit !== undefined && object.maxContractGasLimit !== null ? BigInt(object.maxContractGasLimit.toString()) : BigInt(0); + message.minGasPrice = object.minGasPrice !== undefined && object.minGasPrice !== null ? BigInt(object.minGasPrice.toString()) : BigInt(0); + message.registerContractAccess = object.registerContractAccess !== undefined && object.registerContractAccess !== null ? AccessConfig.fromPartial(object.registerContractAccess) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.is_execution_enabled !== undefined && object.is_execution_enabled !== null) { + message.isExecutionEnabled = object.is_execution_enabled; + } + if (object.max_begin_block_total_gas !== undefined && object.max_begin_block_total_gas !== null) { + message.maxBeginBlockTotalGas = BigInt(object.max_begin_block_total_gas); + } + if (object.max_contract_gas_limit !== undefined && object.max_contract_gas_limit !== null) { + message.maxContractGasLimit = BigInt(object.max_contract_gas_limit); + } + if (object.min_gas_price !== undefined && object.min_gas_price !== null) { + message.minGasPrice = BigInt(object.min_gas_price); + } + if (object.register_contract_access !== undefined && object.register_contract_access !== null) { + message.registerContractAccess = AccessConfig.fromAmino(object.register_contract_access); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.is_execution_enabled = message.isExecutionEnabled === false ? undefined : message.isExecutionEnabled; + obj.max_begin_block_total_gas = message.maxBeginBlockTotalGas !== BigInt(0) ? message.maxBeginBlockTotalGas?.toString() : undefined; + obj.max_contract_gas_limit = message.maxContractGasLimit !== BigInt(0) ? message.maxContractGasLimit?.toString() : undefined; + obj.min_gas_price = message.minGasPrice !== BigInt(0) ? message.minGasPrice?.toString() : undefined; + obj.register_contract_access = message.registerContractAccess ? AccessConfig.toAmino(message.registerContractAccess) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "wasmx/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: "/injective.wasmx.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseRegisteredContract(): RegisteredContract { + return { + gasLimit: BigInt(0), + gasPrice: BigInt(0), + isExecutable: false, + codeId: undefined, + adminAddress: undefined, + granterAddress: undefined, + fundMode: 0 + }; +} +export const RegisteredContract = { + typeUrl: "/injective.wasmx.v1.RegisteredContract", + is(o: any): o is RegisteredContract { + return o && (o.$typeUrl === RegisteredContract.typeUrl || typeof o.gasLimit === "bigint" && typeof o.gasPrice === "bigint" && typeof o.isExecutable === "boolean" && isSet(o.fundMode)); + }, + isAmino(o: any): o is RegisteredContractAmino { + return o && (o.$typeUrl === RegisteredContract.typeUrl || typeof o.gas_limit === "bigint" && typeof o.gas_price === "bigint" && typeof o.is_executable === "boolean" && isSet(o.fund_mode)); + }, + encode(message: RegisteredContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasLimit !== BigInt(0)) { + writer.uint32(8).uint64(message.gasLimit); + } + if (message.gasPrice !== BigInt(0)) { + writer.uint32(16).uint64(message.gasPrice); + } + if (message.isExecutable === true) { + writer.uint32(24).bool(message.isExecutable); + } + if (message.codeId !== undefined) { + writer.uint32(32).uint64(message.codeId); + } + if (message.adminAddress !== undefined) { + writer.uint32(42).string(message.adminAddress); + } + if (message.granterAddress !== undefined) { + writer.uint32(50).string(message.granterAddress); + } + if (message.fundMode !== 0) { + writer.uint32(56).int32(message.fundMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisteredContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasLimit = reader.uint64(); + break; + case 2: + message.gasPrice = reader.uint64(); + break; + case 3: + message.isExecutable = reader.bool(); + break; + case 4: + message.codeId = reader.uint64(); + break; + case 5: + message.adminAddress = reader.string(); + break; + case 6: + message.granterAddress = reader.string(); + break; + case 7: + message.fundMode = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RegisteredContract { + const message = createBaseRegisteredContract(); + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.gasPrice = object.gasPrice !== undefined && object.gasPrice !== null ? BigInt(object.gasPrice.toString()) : BigInt(0); + message.isExecutable = object.isExecutable ?? false; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : undefined; + message.adminAddress = object.adminAddress ?? undefined; + message.granterAddress = object.granterAddress ?? undefined; + message.fundMode = object.fundMode ?? 0; + return message; + }, + fromAmino(object: RegisteredContractAmino): RegisteredContract { + const message = createBaseRegisteredContract(); + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.gas_price !== undefined && object.gas_price !== null) { + message.gasPrice = BigInt(object.gas_price); + } + if (object.is_executable !== undefined && object.is_executable !== null) { + message.isExecutable = object.is_executable; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.granter_address !== undefined && object.granter_address !== null) { + message.granterAddress = object.granter_address; + } + if (object.fund_mode !== undefined && object.fund_mode !== null) { + message.fundMode = object.fund_mode; + } + return message; + }, + toAmino(message: RegisteredContract): RegisteredContractAmino { + const obj: any = {}; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit?.toString() : undefined; + obj.gas_price = message.gasPrice !== BigInt(0) ? message.gasPrice?.toString() : undefined; + obj.is_executable = message.isExecutable === false ? undefined : message.isExecutable; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.admin_address = message.adminAddress === null ? undefined : message.adminAddress; + obj.granter_address = message.granterAddress === null ? undefined : message.granterAddress; + obj.fund_mode = message.fundMode === 0 ? undefined : message.fundMode; + return obj; + }, + fromAminoMsg(object: RegisteredContractAminoMsg): RegisteredContract { + return RegisteredContract.fromAmino(object.value); + }, + fromProtoMsg(message: RegisteredContractProtoMsg): RegisteredContract { + return RegisteredContract.decode(message.value); + }, + toProto(message: RegisteredContract): Uint8Array { + return RegisteredContract.encode(message).finish(); + }, + toProtoMsg(message: RegisteredContract): RegisteredContractProtoMsg { + return { + typeUrl: "/injective.wasmx.v1.RegisteredContract", + value: RegisteredContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RegisteredContract.typeUrl, RegisteredContract); \ No newline at end of file diff --git a/libs/injectivejs/src/registry.ts b/libs/injectivejs/src/registry.ts new file mode 100644 index 00000000..d78fce75 --- /dev/null +++ b/libs/injectivejs/src/registry.ts @@ -0,0 +1,218 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + +import { BinaryReader } from "./binary"; +import { Any, AnyAmino } from "./google/protobuf/any"; +import { IProtoType, TelescopeGeneratedCodec } from "./types"; + +export class GlobalDecoderRegistry { + static registry: { + [key: string]: TelescopeGeneratedCodec; + } = {}; + + static aminoProtoMapping: { + [key: string]: string; + } = {}; + + static registerAminoProtoMapping(aminoType: string, typeUrl: string) { + GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl; + } + + static register( + key: string, + decoder: TelescopeGeneratedCodec + ) { + GlobalDecoderRegistry.registry[key] = decoder; + } + static getDecoder( + key: string + ): TelescopeGeneratedCodec { + return GlobalDecoderRegistry.registry[key]; + } + static getDecoderByInstance( + obj: unknown + ): TelescopeGeneratedCodec | null { + if (obj === undefined || obj === null) { + return null; + } + const protoType = obj as IProtoType; + + if (protoType.$typeUrl) { + return GlobalDecoderRegistry.getDecoder( + protoType.$typeUrl + ); + } + + for (const key in GlobalDecoderRegistry.registry) { + if ( + Object.prototype.hasOwnProperty.call( + GlobalDecoderRegistry.registry, + key + ) + ) { + const element = GlobalDecoderRegistry.registry[key]; + + if (element.is!(obj)) { + return element; + } + + if (element.isSDK && element.isSDK(obj)) { + return element; + } + + if (element.isAmino && element.isAmino(obj)) { + return element; + } + } + } + + return null; + } + static getDecoderByAminoType( + type: string + ): TelescopeGeneratedCodec | null { + if (type === undefined || type === null) { + return null; + } + + const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type]; + + if (!typeUrl) { + return null; + } + + return GlobalDecoderRegistry.getDecoder(typeUrl); + } + static wrapAny(obj: unknown): Any { + if(Any.is(obj)){ + return obj; + } + + const decoder = getDecoderByInstance(obj); + + return { + typeUrl: decoder.typeUrl, + value: decoder.encode(obj).finish(), + }; + } + static unwrapAny(input: BinaryReader | Uint8Array | Any) { + let data; + + if (Any.is(input)) { + data = input; + } else { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + + data = Any.decode(reader, reader.uint32()); + } + + const decoder = GlobalDecoderRegistry.getDecoder( + data.typeUrl + ); + + if (!decoder) { + return data; + } + + return decoder.decode(data.value); + } + static fromJSON(object: any): T { + const decoder = getDecoderByInstance(object); + return decoder.fromJSON!(object); + } + static toJSON(message: T): any { + const decoder = getDecoderByInstance(message); + return decoder.toJSON!(message); + } + static fromPartial(object: unknown): T { + const decoder = getDecoderByInstance(object); + return decoder ? decoder.fromPartial(object) : (object as T); + } + static fromSDK(object: SDK): T { + const decoder = getDecoderByInstance(object); + return decoder.fromSDK!(object); + } + static fromSDKJSON(object: any): SDK { + const decoder = getDecoderByInstance(object); + return decoder.fromSDKJSON!(object); + } + static toSDK(object: T): SDK { + const decoder = getDecoderByInstance(object); + return decoder.toSDK!(object); + } + static fromAmino(object: Amino): T { + const decoder = getDecoderByInstance(object); + return decoder.fromAmino!(object); + } + static fromAminoMsg(object: AnyAmino): T { + const decoder = GlobalDecoderRegistry.getDecoderByAminoType< + T, + unknown, + Amino + >(object.type); + + if (!decoder) { + throw new Error(`There's no decoder for the amino type ${object.type}`); + } + + return decoder.fromAminoMsg!(object); + } + static toAmino(object: T): Amino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAmino!(data); + } + static toAminoMsg(object: T): AnyAmino { + let data: any; + let decoder: TelescopeGeneratedCodec; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAminoMsg!(data); + } +} + +function getDecoderByInstance( + obj: unknown +): TelescopeGeneratedCodec { + const decoder = GlobalDecoderRegistry.getDecoderByInstance( + obj + ); + + if (!decoder) { + throw new Error( + `There's no decoder for the instance ${JSON.stringify(obj)}` + ); + } + + return decoder; +} + +GlobalDecoderRegistry.register(Any.typeUrl, Any); diff --git a/libs/injectivejs/src/tendermint/abci/types.ts b/libs/injectivejs/src/tendermint/abci/types.ts new file mode 100644 index 00000000..4759afd1 --- /dev/null +++ b/libs/injectivejs/src/tendermint/abci/types.ts @@ -0,0 +1,6283 @@ +import { Timestamp } from "../../google/protobuf/timestamp"; +import { ConsensusParams, ConsensusParamsAmino } from "../types/params"; +import { ProofOps, ProofOpsAmino } from "../crypto/proof"; +import { PublicKey, PublicKeyAmino } from "../crypto/keys"; +import { BlockIDFlag } from "../types/validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} +export const CheckTxTypeAmino = CheckTxType; +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + case CheckTxType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} +export const ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result; +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + case ResponseOfferSnapshot_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} +export const ResponseApplySnapshotChunk_ResultAmino = ResponseApplySnapshotChunk_Result; +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +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_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 MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { + switch (object) { + case 0: + case "UNKNOWN": + return MisbehaviorType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return MisbehaviorType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return MisbehaviorType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return MisbehaviorType.UNRECOGNIZED; + } +} +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { + switch (object) { + case MisbehaviorType.UNKNOWN: + return "UNKNOWN"; + case MisbehaviorType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case MisbehaviorType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + case MisbehaviorType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Request { + echo?: RequestEcho; + flush?: RequestFlush; + info?: RequestInfo; + initChain?: RequestInitChain; + query?: RequestQuery; + checkTx?: RequestCheckTx; + 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"; + value: Uint8Array; +} +export interface RequestAmino { + echo?: RequestEchoAmino; + flush?: RequestFlushAmino; + info?: RequestInfoAmino; + init_chain?: RequestInitChainAmino; + query?: RequestQueryAmino; + check_tx?: RequestCheckTxAmino; + 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"; + value: RequestAmino; +} +export interface RequestEcho { + message: string; +} +export interface RequestEchoProtoMsg { + typeUrl: "/tendermint.abci.RequestEcho"; + value: Uint8Array; +} +export interface RequestEchoAmino { + message: string; +} +export interface RequestEchoAminoMsg { + type: "/tendermint.abci.RequestEcho"; + value: RequestEchoAmino; +} +export interface RequestFlush {} +export interface RequestFlushProtoMsg { + typeUrl: "/tendermint.abci.RequestFlush"; + value: Uint8Array; +} +export interface RequestFlushAmino {} +export interface RequestFlushAminoMsg { + type: "/tendermint.abci.RequestFlush"; + value: RequestFlushAmino; +} +export interface RequestInfo { + version: string; + blockVersion: bigint; + p2pVersion: bigint; + abciVersion: string; +} +export interface RequestInfoProtoMsg { + typeUrl: "/tendermint.abci.RequestInfo"; + value: Uint8Array; +} +export interface RequestInfoAmino { + version: string; + block_version: string; + p2p_version: string; + abci_version: string; +} +export interface RequestInfoAminoMsg { + type: "/tendermint.abci.RequestInfo"; + value: RequestInfoAmino; +} +export interface RequestInitChain { + time: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: bigint; +} +export interface RequestInitChainProtoMsg { + typeUrl: "/tendermint.abci.RequestInitChain"; + value: Uint8Array; +} +export interface RequestInitChainAmino { + time: string; + chain_id: string; + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_state_bytes: string; + initial_height: string; +} +export interface RequestInitChainAminoMsg { + type: "/tendermint.abci.RequestInitChain"; + value: RequestInitChainAmino; +} +export interface RequestQuery { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +export interface RequestQueryProtoMsg { + typeUrl: "/tendermint.abci.RequestQuery"; + value: Uint8Array; +} +export interface RequestQueryAmino { + data: string; + path: string; + height: string; + prove: boolean; +} +export interface RequestQueryAminoMsg { + type: "/tendermint.abci.RequestQuery"; + value: RequestQueryAmino; +} +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestCheckTxProtoMsg { + typeUrl: "/tendermint.abci.RequestCheckTx"; + value: Uint8Array; +} +export interface RequestCheckTxAmino { + tx: string; + type: CheckTxType; +} +export interface RequestCheckTxAminoMsg { + type: "/tendermint.abci.RequestCheckTx"; + value: RequestCheckTxAmino; +} +export interface RequestCommit {} +export interface RequestCommitProtoMsg { + typeUrl: "/tendermint.abci.RequestCommit"; + value: Uint8Array; +} +export interface RequestCommitAmino {} +export interface RequestCommitAminoMsg { + type: "/tendermint.abci.RequestCommit"; + value: RequestCommitAmino; +} +/** lists available snapshots */ +export interface RequestListSnapshots {} +export interface RequestListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.RequestListSnapshots"; + value: Uint8Array; +} +/** lists available snapshots */ +export interface RequestListSnapshotsAmino {} +export interface RequestListSnapshotsAminoMsg { + type: "/tendermint.abci.RequestListSnapshots"; + value: RequestListSnapshotsAmino; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} +export interface RequestOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.RequestOfferSnapshot"; + value: Uint8Array; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotAmino { + /** snapshot offered by peers */ + snapshot?: SnapshotAmino; + /** light client-verified app hash for snapshot height */ + app_hash: string; +} +export interface RequestOfferSnapshotAminoMsg { + type: "/tendermint.abci.RequestOfferSnapshot"; + value: RequestOfferSnapshotAmino; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: bigint; + format: number; + chunk: number; +} +export interface RequestLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkAmino { + height: string; + format: number; + chunk: number; +} +export interface RequestLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: RequestLoadSnapshotChunkAmino; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface RequestApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; + value: Uint8Array; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkAmino { + index: number; + chunk: string; + sender: string; +} +export interface RequestApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestApplySnapshotChunk"; + value: RequestApplySnapshotChunkAmino; +} +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 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; +} +/** 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; +} +/** 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; +} +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 Response { + exception?: ResponseException; + echo?: ResponseEcho; + flush?: ResponseFlush; + info?: ResponseInfo; + initChain?: ResponseInitChain; + query?: ResponseQuery; + checkTx?: ResponseCheckTx; + 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"; + value: Uint8Array; +} +export interface ResponseAmino { + exception?: ResponseExceptionAmino; + echo?: ResponseEchoAmino; + flush?: ResponseFlushAmino; + info?: ResponseInfoAmino; + init_chain?: ResponseInitChainAmino; + query?: ResponseQueryAmino; + check_tx?: ResponseCheckTxAmino; + 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"; + value: ResponseAmino; +} +/** nondeterministic */ +export interface ResponseException { + error: string; +} +export interface ResponseExceptionProtoMsg { + typeUrl: "/tendermint.abci.ResponseException"; + value: Uint8Array; +} +/** nondeterministic */ +export interface ResponseExceptionAmino { + error: string; +} +export interface ResponseExceptionAminoMsg { + type: "/tendermint.abci.ResponseException"; + value: ResponseExceptionAmino; +} +export interface ResponseEcho { + message: string; +} +export interface ResponseEchoProtoMsg { + typeUrl: "/tendermint.abci.ResponseEcho"; + value: Uint8Array; +} +export interface ResponseEchoAmino { + message: string; +} +export interface ResponseEchoAminoMsg { + type: "/tendermint.abci.ResponseEcho"; + value: ResponseEchoAmino; +} +export interface ResponseFlush {} +export interface ResponseFlushProtoMsg { + typeUrl: "/tendermint.abci.ResponseFlush"; + value: Uint8Array; +} +export interface ResponseFlushAmino {} +export interface ResponseFlushAminoMsg { + type: "/tendermint.abci.ResponseFlush"; + value: ResponseFlushAmino; +} +export interface ResponseInfo { + data: string; + version: string; + appVersion: bigint; + lastBlockHeight: bigint; + lastBlockAppHash: Uint8Array; +} +export interface ResponseInfoProtoMsg { + typeUrl: "/tendermint.abci.ResponseInfo"; + value: Uint8Array; +} +export interface ResponseInfoAmino { + data: string; + version: string; + app_version: string; + last_block_height: string; + last_block_app_hash: string; +} +export interface ResponseInfoAminoMsg { + type: "/tendermint.abci.ResponseInfo"; + value: ResponseInfoAmino; +} +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} +export interface ResponseInitChainProtoMsg { + typeUrl: "/tendermint.abci.ResponseInitChain"; + value: Uint8Array; +} +export interface ResponseInitChainAmino { + consensus_params?: ConsensusParamsAmino; + validators: ValidatorUpdateAmino[]; + app_hash: string; +} +export interface ResponseInitChainAminoMsg { + type: "/tendermint.abci.ResponseInitChain"; + value: ResponseInitChainAmino; +} +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: bigint; + codespace: string; +} +export interface ResponseQueryProtoMsg { + typeUrl: "/tendermint.abci.ResponseQuery"; + value: Uint8Array; +} +export interface ResponseQueryAmino { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: string; + key: string; + value: string; + proof_ops?: ProofOpsAmino; + height: string; + codespace: string; +} +export interface ResponseQueryAminoMsg { + type: "/tendermint.abci.ResponseQuery"; + value: ResponseQueryAmino; +} +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: bigint; + gasUsed: bigint; + events: Event[]; + codespace: string; +} +export interface ResponseCheckTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseCheckTx"; + value: Uint8Array; +} +export interface ResponseCheckTxAmino { + code: number; + data: string; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gas_wanted: string; + gas_used: string; + events: EventAmino[]; + codespace: string; +} +export interface ResponseCheckTxAminoMsg { + type: "/tendermint.abci.ResponseCheckTx"; + value: ResponseCheckTxAmino; +} +export interface ResponseCommit { + retainHeight: bigint; +} +export interface ResponseCommitProtoMsg { + typeUrl: "/tendermint.abci.ResponseCommit"; + value: Uint8Array; +} +export interface ResponseCommitAmino { + retain_height: string; +} +export interface ResponseCommitAminoMsg { + type: "/tendermint.abci.ResponseCommit"; + value: ResponseCommitAmino; +} +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} +export interface ResponseListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.ResponseListSnapshots"; + value: Uint8Array; +} +export interface ResponseListSnapshotsAmino { + snapshots: SnapshotAmino[]; +} +export interface ResponseListSnapshotsAminoMsg { + type: "/tendermint.abci.ResponseListSnapshots"; + value: ResponseListSnapshotsAmino; +} +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; + value: Uint8Array; +} +export interface ResponseOfferSnapshotAmino { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotAminoMsg { + type: "/tendermint.abci.ResponseOfferSnapshot"; + value: ResponseOfferSnapshotAmino; +} +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} +export interface ResponseLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: Uint8Array; +} +export interface ResponseLoadSnapshotChunkAmino { + chunk: string; +} +export interface ResponseLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: ResponseLoadSnapshotChunkAmino; +} +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} +export interface ResponseApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: Uint8Array; +} +export interface ResponseApplySnapshotChunkAmino { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetch_chunks: number[]; + /** Chunk senders to reject and ban */ + reject_senders: string[]; +} +export interface ResponseApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: ResponseApplySnapshotChunkAmino; +} +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; + value: Uint8Array; +} +export interface ResponsePrepareProposalAmino { + txs: string[]; +} +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; + value: Uint8Array; +} +export interface ResponseProcessProposalAmino { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; +} +export interface ResponseExtendVote { + voteExtension: Uint8Array; +} +export interface ResponseExtendVoteProtoMsg { + typeUrl: "/tendermint.abci.ResponseExtendVote"; + value: Uint8Array; +} +export interface ResponseExtendVoteAmino { + vote_extension: string; +} +export interface ResponseExtendVoteAminoMsg { + type: "/tendermint.abci.ResponseExtendVote"; + value: ResponseExtendVoteAmino; +} +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 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 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; +} +/** + * 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; +} +/** + * Event allows application developers to attach additional information to + * ResponseFinalizeBlock and ResponseCheckTx. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string; + attributes: EventAttribute[]; +} +export interface EventProtoMsg { + typeUrl: "/tendermint.abci.Event"; + value: Uint8Array; +} +/** + * Event allows application developers to attach additional information to + * ResponseFinalizeBlock and ResponseCheckTx. + * Later, transactions may be queried using these events. + */ +export interface EventAmino { + type: string; + attributes: EventAttributeAmino[]; +} +export interface EventAminoMsg { + type: "/tendermint.abci.Event"; + value: EventAmino; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: string; + value: string; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeProtoMsg { + typeUrl: "/tendermint.abci.EventAttribute"; + value: Uint8Array; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeAmino { + key: string; + value: string; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeAminoMsg { + type: "/tendermint.abci.EventAttribute"; + value: EventAttributeAmino; +} +/** + * 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; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: bigint; + index: number; + tx: Uint8Array; + result: ExecTxResult; +} +export interface TxResultProtoMsg { + typeUrl: "/tendermint.abci.TxResult"; + value: Uint8Array; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultAmino { + height: string; + index: number; + tx: string; + result: ExecTxResultAmino; +} +export interface TxResultAminoMsg { + type: "/tendermint.abci.TxResult"; + value: TxResultAmino; +} +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.abci.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + /** The first 20 bytes of SHA256(public key) */ + address: string; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.abci.Validator"; + value: ValidatorAmino; +} +export interface ValidatorUpdate { + pubKey: PublicKey; + power: bigint; +} +export interface ValidatorUpdateProtoMsg { + typeUrl: "/tendermint.abci.ValidatorUpdate"; + value: Uint8Array; +} +export interface ValidatorUpdateAmino { + pub_key: PublicKeyAmino; + power: string; +} +export interface ValidatorUpdateAminoMsg { + type: "/tendermint.abci.ValidatorUpdate"; + value: ValidatorUpdateAmino; +} +export interface VoteInfo { + validator: Validator; + blockIdFlag: BlockIDFlag; +} +export interface VoteInfoProtoMsg { + typeUrl: "/tendermint.abci.VoteInfo"; + value: Uint8Array; +} +export interface VoteInfoAmino { + validator: ValidatorAmino; + block_id_flag: BlockIDFlag; +} +export interface VoteInfoAminoMsg { + type: "/tendermint.abci.VoteInfo"; + value: VoteInfoAmino; +} +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 Misbehavior { + type: MisbehaviorType; + /** The offending validator */ + validator: Validator; + /** The height when the offense occurred */ + height: bigint; + /** The corresponding time where the offense occurred */ + time: Date; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: bigint; +} +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; + value: Uint8Array; +} +export interface MisbehaviorAmino { + type: MisbehaviorType; + /** The offending validator */ + validator: ValidatorAmino; + /** The height when the offense occurred */ + height: string; + /** The corresponding time where the offense occurred */ + time: string; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + total_voting_power: string; +} +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; +} +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: bigint; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} +export interface SnapshotProtoMsg { + typeUrl: "/tendermint.abci.Snapshot"; + value: Uint8Array; +} +export interface SnapshotAmino { + /** The height at which the snapshot was taken */ + height: string; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: string; + /** Arbitrary application metadata */ + metadata: string; +} +export interface SnapshotAminoMsg { + type: "/tendermint.abci.Snapshot"; + value: SnapshotAmino; +} +function createBaseRequest(): Request { + return { + 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 Request = { + typeUrl: "/tendermint.abci.Request", + is(o: any): o is Request { + return o && o.$typeUrl === Request.typeUrl; + }, + isAmino(o: any): o is RequestAmino { + return o && o.$typeUrl === Request.typeUrl; + }, + encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).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.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.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 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Request { + const message = createBaseRequest(); + 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.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.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : 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 { + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + 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.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + 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 { + const obj: any = {}; + 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.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; + obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; + obj.check_tx = message.checkTx ? RequestCheckTx.toAmino(message.checkTx) : 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 { + return Request.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProtoMsg): Request { + return Request.decode(message.value); + }, + toProto(message: Request): Uint8Array { + return Request.encode(message).finish(); + }, + toProtoMsg(message: Request): RequestProtoMsg { + return { + typeUrl: "/tendermint.abci.Request", + value: Request.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Request.typeUrl, Request); +function createBaseRequestEcho(): RequestEcho { + return { + message: "" + }; +} +export const RequestEcho = { + typeUrl: "/tendermint.abci.RequestEcho", + is(o: any): o is RequestEcho { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is RequestEchoAmino { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestEcho { + const message = createBaseRequestEcho(); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: RequestEchoAmino): RequestEcho { + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: RequestEcho): RequestEchoAmino { + const obj: any = {}; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { + return RequestEcho.fromAmino(object.value); + }, + fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { + return RequestEcho.decode(message.value); + }, + toProto(message: RequestEcho): Uint8Array { + return RequestEcho.encode(message).finish(); + }, + toProtoMsg(message: RequestEcho): RequestEchoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestEcho", + value: RequestEcho.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestEcho.typeUrl, RequestEcho); +function createBaseRequestFlush(): RequestFlush { + return {}; +} +export const RequestFlush = { + typeUrl: "/tendermint.abci.RequestFlush", + is(o: any): o is RequestFlush { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + isAmino(o: any): o is RequestFlushAmino { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + fromAmino(_: RequestFlushAmino): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + toAmino(_: RequestFlush): RequestFlushAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { + return RequestFlush.fromAmino(object.value); + }, + fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { + return RequestFlush.decode(message.value); + }, + toProto(message: RequestFlush): Uint8Array { + return RequestFlush.encode(message).finish(); + }, + toProtoMsg(message: RequestFlush): RequestFlushProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestFlush", + value: RequestFlush.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestFlush.typeUrl, RequestFlush); +function createBaseRequestInfo(): RequestInfo { + return { + version: "", + blockVersion: BigInt(0), + p2pVersion: BigInt(0), + abciVersion: "" + }; +} +export const RequestInfo = { + typeUrl: "/tendermint.abci.RequestInfo", + is(o: any): o is RequestInfo { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.blockVersion === "bigint" && typeof o.p2pVersion === "bigint" && typeof o.abciVersion === "string"); + }, + isAmino(o: any): o is RequestInfoAmino { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.block_version === "bigint" && typeof o.p2p_version === "bigint" && typeof o.abci_version === "string"); + }, + encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.blockVersion !== BigInt(0)) { + writer.uint32(16).uint64(message.blockVersion); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + case 4: + message.abciVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestInfo { + const message = createBaseRequestInfo(); + 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 { + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + 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 { + const obj: any = {}; + 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 { + return RequestInfo.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { + return RequestInfo.decode(message.value); + }, + toProto(message: RequestInfo): Uint8Array { + return RequestInfo.encode(message).finish(); + }, + toProtoMsg(message: RequestInfo): RequestInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInfo", + value: RequestInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestInfo.typeUrl, RequestInfo); +function createBaseRequestInitChain(): RequestInitChain { + return { + time: new Date(), + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: BigInt(0) + }; +} +export const RequestInitChain = { + typeUrl: "/tendermint.abci.RequestInitChain", + is(o: any): o is RequestInitChain { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.is(o.time) && typeof o.chainId === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appStateBytes instanceof Uint8Array || typeof o.appStateBytes === "string") && typeof o.initialHeight === "bigint"); + }, + isAmino(o: any): o is RequestInitChainAmino { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.isAmino(o.time) && typeof o.chain_id === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_state_bytes instanceof Uint8Array || typeof o.app_state_bytes === "string") && typeof o.initial_height === "bigint"); + }, + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (message.initialHeight !== BigInt(0)) { + writer.uint32(48).int64(message.initialHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestInitChain { + const message = createBaseRequestInitChain(); + message.time = object.time ?? undefined; + message.chainId = object.chainId ?? ""; + message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; + message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appStateBytes = object.appStateBytes ?? new Uint8Array(); + message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? BigInt(object.initialHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RequestInitChainAmino): RequestInitChain { + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + 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_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; + }, + toAmino(message: RequestInitChain): RequestInitChainAmino { + const obj: any = {}; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + 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_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; + obj.initial_height = message.initialHeight !== BigInt(0) ? message.initialHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { + return RequestInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { + return RequestInitChain.decode(message.value); + }, + toProto(message: RequestInitChain): Uint8Array { + return RequestInitChain.encode(message).finish(); + }, + toProtoMsg(message: RequestInitChain): RequestInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInitChain", + value: RequestInitChain.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestInitChain.typeUrl, RequestInitChain); +function createBaseRequestQuery(): RequestQuery { + return { + data: new Uint8Array(), + path: "", + height: BigInt(0), + prove: false + }; +} +export const RequestQuery = { + typeUrl: "/tendermint.abci.RequestQuery", + is(o: any): o is RequestQuery { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + isAmino(o: any): o is RequestQueryAmino { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + encode(message: RequestQuery, 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): RequestQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestQuery(); + 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: DeepPartial): RequestQuery { + const message = createBaseRequestQuery(); + 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: RequestQueryAmino): RequestQuery { + const message = createBaseRequestQuery(); + 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: RequestQuery): RequestQueryAmino { + 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: RequestQueryAminoMsg): RequestQuery { + return RequestQuery.fromAmino(object.value); + }, + fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { + return RequestQuery.decode(message.value); + }, + toProto(message: RequestQuery): Uint8Array { + return RequestQuery.encode(message).finish(); + }, + toProtoMsg(message: RequestQuery): RequestQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestQuery", + value: RequestQuery.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestQuery.typeUrl, RequestQuery); +function createBaseRequestCheckTx(): RequestCheckTx { + return { + tx: new Uint8Array(), + type: 0 + }; +} +export const RequestCheckTx = { + typeUrl: "/tendermint.abci.RequestCheckTx", + is(o: any): o is RequestCheckTx { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + isAmino(o: any): o is RequestCheckTxAmino { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + 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: DeepPartial): 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; + return obj; + }, + fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { + return RequestCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { + return RequestCheckTx.decode(message.value); + }, + toProto(message: RequestCheckTx): Uint8Array { + return RequestCheckTx.encode(message).finish(); + }, + toProtoMsg(message: RequestCheckTx): RequestCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCheckTx", + value: RequestCheckTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestCheckTx.typeUrl, RequestCheckTx); +function createBaseRequestCommit(): RequestCommit { + return {}; +} +export const RequestCommit = { + typeUrl: "/tendermint.abci.RequestCommit", + is(o: any): o is RequestCommit { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + isAmino(o: any): o is RequestCommitAmino { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + fromAmino(_: RequestCommitAmino): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + toAmino(_: RequestCommit): RequestCommitAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { + return RequestCommit.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { + return RequestCommit.decode(message.value); + }, + toProto(message: RequestCommit): Uint8Array { + return RequestCommit.encode(message).finish(); + }, + toProtoMsg(message: RequestCommit): RequestCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCommit", + value: RequestCommit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestCommit.typeUrl, RequestCommit); +function createBaseRequestListSnapshots(): RequestListSnapshots { + return {}; +} +export const RequestListSnapshots = { + typeUrl: "/tendermint.abci.RequestListSnapshots", + is(o: any): o is RequestListSnapshots { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + isAmino(o: any): o is RequestListSnapshotsAmino { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { + return RequestListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { + return RequestListSnapshots.decode(message.value); + }, + toProto(message: RequestListSnapshots): Uint8Array { + return RequestListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: RequestListSnapshots): RequestListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestListSnapshots", + value: RequestListSnapshots.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestListSnapshots.typeUrl, RequestListSnapshots); +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { + snapshot: undefined, + appHash: new Uint8Array() + }; +} +export const RequestOfferSnapshot = { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + is(o: any): o is RequestOfferSnapshot { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.appHash instanceof Uint8Array || typeof o.appHash === "string"); + }, + isAmino(o: any): o is RequestOfferSnapshotAmino { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.app_hash instanceof Uint8Array || typeof o.app_hash === "string"); + }, + encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + message.snapshot = object.snapshot !== undefined && object.snapshot !== null ? Snapshot.fromPartial(object.snapshot) : undefined; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; + }, + toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { + const obj: any = {}; + obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.decode(message.value); + }, + toProto(message: RequestOfferSnapshot): Uint8Array { + return RequestOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: RequestOfferSnapshot): RequestOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + value: RequestOfferSnapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestOfferSnapshot.typeUrl, RequestOfferSnapshot); +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { + height: BigInt(0), + format: 0, + chunk: 0 + }; +} +export const RequestLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + is(o: any): o is RequestLoadSnapshotChunk { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + isAmino(o: any): o is RequestLoadSnapshotChunkAmino { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + encode(message: RequestLoadSnapshotChunk, 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.chunk !== 0) { + writer.uint32(24).uint32(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestLoadSnapshotChunk(); + 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.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.format = object.format ?? 0; + message.chunk = object.chunk ?? 0; + return message; + }, + fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + 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.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; + }, + toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunk = message.chunk === 0 ? undefined : message.chunk; + return obj; + }, + fromAminoMsg(object: RequestLoadSnapshotChunkAminoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestLoadSnapshotChunkProtoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.decode(message.value); + }, + toProto(message: RequestLoadSnapshotChunk): Uint8Array { + return RequestLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + value: RequestLoadSnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestLoadSnapshotChunk.typeUrl, RequestLoadSnapshotChunk); +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { + index: 0, + chunk: new Uint8Array(), + sender: "" + }; +} +export const RequestApplySnapshotChunk = { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + is(o: any): o is RequestApplySnapshotChunk { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + isAmino(o: any): o is RequestApplySnapshotChunkAmino { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + message.index = object.index ?? 0; + message.chunk = object.chunk ?? new Uint8Array(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: RequestApplySnapshotChunkAminoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestApplySnapshotChunkProtoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.decode(message.value); + }, + toProto(message: RequestApplySnapshotChunk): Uint8Array { + return RequestApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + value: RequestApplySnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestApplySnapshotChunk.typeUrl, RequestApplySnapshotChunk); +function createBaseRequestPrepareProposal(): RequestPrepareProposal { + return { + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + is(o: any): o is RequestPrepareProposal { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.maxTxBytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.is(o.localLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestPrepareProposalAmino { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.max_tx_bytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.isAmino(o.local_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); + } + for (const v of message.txs) { + writer.uint32(18).bytes(v!); + } + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + 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): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = reader.int64(); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: RequestPrepareProposalAmino): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); + } + 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); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + 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: RequestPrepareProposal): RequestPrepareProposalAmino { + const obj: any = {}; + 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: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); + }, + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestPrepareProposal.typeUrl, RequestPrepareProposal); +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + is(o: any): o is RequestProcessProposal { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.proposedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestProcessProposalAmino { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: RequestProcessProposal): RequestProcessProposalAmino { + const obj: any = {}; + 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: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); + }, + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestProcessProposal.typeUrl, RequestProcessProposal); +function createBaseRequestExtendVote(): RequestExtendVote { + return { + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestExtendVote = { + typeUrl: "/tendermint.abci.RequestExtendVote", + is(o: any): o is RequestExtendVote { + return o && (o.$typeUrl === RequestExtendVote.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.proposedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestExtendVoteAmino { + return o && (o.$typeUrl === RequestExtendVote.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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): RequestExtendVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestExtendVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: RequestExtendVote): RequestExtendVoteAmino { + const obj: any = {}; + 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: RequestExtendVoteAminoMsg): RequestExtendVote { + return RequestExtendVote.fromAmino(object.value); + }, + fromProtoMsg(message: RequestExtendVoteProtoMsg): RequestExtendVote { + return RequestExtendVote.decode(message.value); + }, + toProto(message: RequestExtendVote): Uint8Array { + return RequestExtendVote.encode(message).finish(); + }, + toProtoMsg(message: RequestExtendVote): RequestExtendVoteProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestExtendVote", + value: RequestExtendVote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestExtendVote.typeUrl, RequestExtendVote); +function createBaseRequestVerifyVoteExtension(): RequestVerifyVoteExtension { + return { + hash: new Uint8Array(), + validatorAddress: new Uint8Array(), + height: BigInt(0), + voteExtension: new Uint8Array() + }; +} +export const RequestVerifyVoteExtension = { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + is(o: any): o is RequestVerifyVoteExtension { + return o && (o.$typeUrl === RequestVerifyVoteExtension.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && typeof o.height === "bigint" && (o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string")); + }, + isAmino(o: any): o is RequestVerifyVoteExtensionAmino { + return o && (o.$typeUrl === RequestVerifyVoteExtension.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.height === "bigint" && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string")); + }, + 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): RequestVerifyVoteExtension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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(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(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: RequestVerifyVoteExtensionAminoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.fromAmino(object.value); + }, + fromProtoMsg(message: RequestVerifyVoteExtensionProtoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.decode(message.value); + }, + toProto(message: RequestVerifyVoteExtension): Uint8Array { + return RequestVerifyVoteExtension.encode(message).finish(); + }, + toProtoMsg(message: RequestVerifyVoteExtension): RequestVerifyVoteExtensionProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + value: RequestVerifyVoteExtension.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestVerifyVoteExtension.typeUrl, RequestVerifyVoteExtension); +function createBaseRequestFinalizeBlock(): RequestFinalizeBlock { + return { + txs: [], + decidedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestFinalizeBlock = { + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + is(o: any): o is RequestFinalizeBlock { + return o && (o.$typeUrl === RequestFinalizeBlock.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.decidedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is RequestFinalizeBlockAmino { + return o && (o.$typeUrl === RequestFinalizeBlock.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.decided_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestFinalizeBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.decidedLastCommit !== undefined) { + CommitInfo.encode(message.decidedLastCommit, 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): RequestFinalizeBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFinalizeBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.decidedLastCommit = 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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); + } + 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: RequestFinalizeBlock): RequestFinalizeBlockAmino { + const obj: any = {}; + 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: RequestFinalizeBlockAminoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.fromAmino(object.value); + }, + fromProtoMsg(message: RequestFinalizeBlockProtoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.decode(message.value); + }, + toProto(message: RequestFinalizeBlock): Uint8Array { + return RequestFinalizeBlock.encode(message).finish(); + }, + toProtoMsg(message: RequestFinalizeBlock): RequestFinalizeBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + value: RequestFinalizeBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestFinalizeBlock.typeUrl, RequestFinalizeBlock); +function createBaseResponse(): Response { + return { + 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 Response = { + typeUrl: "/tendermint.abci.Response", + is(o: any): o is Response { + return o && o.$typeUrl === Response.typeUrl; + }, + isAmino(o: any): o is ResponseAmino { + return o && o.$typeUrl === Response.typeUrl; + }, + 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.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): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + 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); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: ResponseAmino): Response { + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + 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 = ResponseInfo.fromAmino(object.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: ResponseAminoMsg): Response { + return Response.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseProtoMsg): Response { + return Response.decode(message.value); + }, + toProto(message: Response): Uint8Array { + return Response.encode(message).finish(); + }, + toProtoMsg(message: Response): ResponseProtoMsg { + return { + typeUrl: "/tendermint.abci.Response", + value: Response.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Response.typeUrl, Response); +function createBaseResponseException(): ResponseException { + return { + error: "" + }; +} +export const ResponseException = { + typeUrl: "/tendermint.abci.ResponseException", + is(o: any): o is ResponseException { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + isAmino(o: any): o is ResponseExceptionAmino { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + 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): ResponseException { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseException(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; + return message; + }, + fromAmino(object: ResponseExceptionAmino): ResponseException { + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: ResponseException): ResponseExceptionAmino { + const obj: any = {}; + obj.error = message.error === "" ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { + return ResponseException.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { + return ResponseException.decode(message.value); + }, + toProto(message: ResponseException): Uint8Array { + return ResponseException.encode(message).finish(); + }, + toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseException", + value: ResponseException.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseException.typeUrl, ResponseException); +function createBaseResponseEcho(): ResponseEcho { + return { + message: "" + }; +} +export const ResponseEcho = { + typeUrl: "/tendermint.abci.ResponseEcho", + is(o: any): o is ResponseEcho { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is ResponseEchoAmino { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + } + 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseEcho.typeUrl, ResponseEcho); +function createBaseResponseFlush(): ResponseFlush { + return {}; +} +export const ResponseFlush = { + typeUrl: "/tendermint.abci.ResponseFlush", + is(o: any): o is ResponseFlush { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + isAmino(o: any): o is ResponseFlushAmino { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + 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; + } + } + return message; + }, + fromPartial(_: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseFlush.typeUrl, ResponseFlush); +function createBaseResponseInfo(): ResponseInfo { + return { + data: "", + version: "", + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), + lastBlockAppHash: new Uint8Array() + }; +} +export const ResponseInfo = { + typeUrl: "/tendermint.abci.ResponseInfo", + is(o: any): o is ResponseInfo { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.appVersion === "bigint" && typeof o.lastBlockHeight === "bigint" && (o.lastBlockAppHash instanceof Uint8Array || typeof o.lastBlockAppHash === "string")); + }, + isAmino(o: any): o is ResponseInfoAmino { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.app_version === "bigint" && typeof o.last_block_height === "bigint" && (o.last_block_app_hash instanceof Uint8Array || typeof o.last_block_app_hash === "string")); + }, + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.appVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.appVersion); + } + if (message.lastBlockHeight !== BigInt(0)) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); + } + return writer; + }, + 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 = createBaseResponseInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: ResponseInfoAmino): ResponseInfo { + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + 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: ResponseInfo): ResponseInfoAmino { + 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; + return obj; + }, + fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { + return ResponseInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { + return ResponseInfo.decode(message.value); + }, + toProto(message: ResponseInfo): Uint8Array { + return ResponseInfo.encode(message).finish(); + }, + toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInfo", + value: ResponseInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseInfo.typeUrl, ResponseInfo); +function createBaseResponseInitChain(): ResponseInitChain { + return { + consensusParams: undefined, + validators: [], + appHash: new Uint8Array() + }; +} +export const ResponseInitChain = { + typeUrl: "/tendermint.abci.ResponseInitChain", + is(o: any): o is ResponseInitChain { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appHash instanceof Uint8Array || typeof o.appHash === "string")); + }, + isAmino(o: any): o is ResponseInitChainAmino { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, + 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): ResponseInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInitChain(); + 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(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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: 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: 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.validators = message.validators; + } + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { + return ResponseInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { + return ResponseInitChain.decode(message.value); + }, + toProto(message: ResponseInitChain): Uint8Array { + return ResponseInitChain.encode(message).finish(); + }, + toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInitChain", + value: ResponseInitChain.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseInitChain.typeUrl, ResponseInitChain); +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: "", + info: "", + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: BigInt(0), + codespace: "" + }; +} +export const ResponseQuery = { + typeUrl: "/tendermint.abci.ResponseQuery", + is(o: any): o is ResponseQuery { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseQueryAmino { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + encode(message: ResponseQuery, 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): ResponseQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseQuery(); + 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: DeepPartial): 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 ?? ""; + 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); + } + 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: ResponseQuery): ResponseQueryAmino { + 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: ResponseQueryAminoMsg): ResponseQuery { + return ResponseQuery.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { + return ResponseQuery.decode(message.value); + }, + toProto(message: ResponseQuery): Uint8Array { + return ResponseQuery.encode(message).finish(); + }, + toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseQuery", + value: ResponseQuery.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseQuery.typeUrl, ResponseQuery); +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: "" + }; +} +export const ResponseCheckTx = { + typeUrl: "/tendermint.abci.ResponseCheckTx", + is(o: any): o is ResponseCheckTx { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseCheckTxAmino { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string"); + }, + encode(message: ResponseCheckTx, 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): ResponseCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCheckTx(); + 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: DeepPartial): 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: 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: ResponseCheckTx): ResponseCheckTxAmino { + 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: ResponseCheckTxAminoMsg): ResponseCheckTx { + return ResponseCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { + return ResponseCheckTx.decode(message.value); + }, + toProto(message: ResponseCheckTx): Uint8Array { + return ResponseCheckTx.encode(message).finish(); + }, + toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCheckTx", + value: ResponseCheckTx.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseCheckTx.typeUrl, ResponseCheckTx); +function createBaseResponseCommit(): ResponseCommit { + return { + retainHeight: BigInt(0) + }; +} +export const ResponseCommit = { + typeUrl: "/tendermint.abci.ResponseCommit", + is(o: any): o is ResponseCommit { + return o && (o.$typeUrl === ResponseCommit.typeUrl || typeof o.retainHeight === "bigint"); + }, + isAmino(o: any): o is ResponseCommitAmino { + return o && (o.$typeUrl === ResponseCommit.typeUrl || typeof o.retain_height === "bigint"); + }, + encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.retainHeight !== BigInt(0)) { + writer.uint32(24).int64(message.retainHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseCommit { + const message = createBaseResponseCommit(); + 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.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; + }, + toAmino(message: ResponseCommit): ResponseCommitAmino { + const obj: any = {}; + obj.retain_height = message.retainHeight !== BigInt(0) ? message.retainHeight?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { + return ResponseCommit.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { + return ResponseCommit.decode(message.value); + }, + toProto(message: ResponseCommit): Uint8Array { + return ResponseCommit.encode(message).finish(); + }, + toProtoMsg(message: ResponseCommit): ResponseCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCommit", + value: ResponseCommit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseCommit.typeUrl, ResponseCommit); +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { + snapshots: [] + }; +} +export const ResponseListSnapshots = { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + is(o: any): o is ResponseListSnapshots { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.is(o.snapshots[0]))); + }, + isAmino(o: any): o is ResponseListSnapshotsAmino { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.isAmino(o.snapshots[0]))); + }, + encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; + }, + toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map(e => e ? Snapshot.toAmino(e) : undefined); + } else { + obj.snapshots = message.snapshots; + } + return obj; + }, + fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { + return ResponseListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { + return ResponseListSnapshots.decode(message.value); + }, + toProto(message: ResponseListSnapshots): Uint8Array { + return ResponseListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: ResponseListSnapshots): ResponseListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + value: ResponseListSnapshots.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseListSnapshots.typeUrl, ResponseListSnapshots); +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { + result: 0 + }; +} +export const ResponseOfferSnapshot = { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + is(o: any): o is ResponseOfferSnapshot { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is ResponseOfferSnapshotAmino { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseOfferSnapshot(); + 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: DeepPartial): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.decode(message.value); + }, + toProto(message: ResponseOfferSnapshot): Uint8Array { + return ResponseOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: ResponseOfferSnapshot): ResponseOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + value: ResponseOfferSnapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseOfferSnapshot.typeUrl, ResponseOfferSnapshot); +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { + chunk: new Uint8Array() + }; +} +export const ResponseLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + is(o: any): o is ResponseLoadSnapshotChunk { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + isAmino(o: any): o is ResponseLoadSnapshotChunkAmino { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chunk.length !== 0) { + writer.uint32(10).bytes(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + message.chunk = object.chunk ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; + }, + toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { + const obj: any = {}; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseLoadSnapshotChunkProtoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.decode(message.value); + }, + toProto(message: ResponseLoadSnapshotChunk): Uint8Array { + return ResponseLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + value: ResponseLoadSnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseLoadSnapshotChunk.typeUrl, ResponseLoadSnapshotChunk); +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { + result: 0, + refetchChunks: [], + rejectSenders: [] + }; +} +export const ResponseApplySnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + is(o: any): o is ResponseApplySnapshotChunk { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetchChunks) && (!o.refetchChunks.length || typeof o.refetchChunks[0] === "number") && Array.isArray(o.rejectSenders) && (!o.rejectSenders.length || typeof o.rejectSenders[0] === "string")); + }, + isAmino(o: any): o is ResponseApplySnapshotChunkAmino { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetch_chunks) && (!o.refetch_chunks.length || typeof o.refetch_chunks[0] === "number") && Array.isArray(o.reject_senders) && (!o.reject_senders.length || typeof o.reject_senders[0] === "string")); + }, + encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + message.result = object.result ?? 0; + message.refetchChunks = object.refetchChunks?.map(e => e) || []; + message.rejectSenders = object.rejectSenders?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; + }, + toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + if (message.refetchChunks) { + obj.refetch_chunks = message.refetchChunks.map(e => e); + } else { + obj.refetch_chunks = message.refetchChunks; + } + if (message.rejectSenders) { + obj.reject_senders = message.rejectSenders.map(e => e); + } else { + obj.reject_senders = message.rejectSenders; + } + return obj; + }, + fromAminoMsg(object: ResponseApplySnapshotChunkAminoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseApplySnapshotChunkProtoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.decode(message.value); + }, + toProto(message: ResponseApplySnapshotChunk): Uint8Array { + return ResponseApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + value: ResponseApplySnapshotChunk.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseApplySnapshotChunk.typeUrl, ResponseApplySnapshotChunk); +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { + return { + txs: [] + }; +} +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + is(o: any): o is ResponsePrepareProposal { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is ResponsePrepareProposalAmino { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponsePrepareProposal.typeUrl, ResponsePrepareProposal); +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + is(o: any): o is ResponseProcessProposal { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + isAmino(o: any): o is ResponseProcessProposalAmino { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseProcessProposal.typeUrl, ResponseProcessProposal); +function createBaseResponseExtendVote(): ResponseExtendVote { + return { + voteExtension: new Uint8Array() + }; +} +export const ResponseExtendVote = { + typeUrl: "/tendermint.abci.ResponseExtendVote", + is(o: any): o is ResponseExtendVote { + return o && (o.$typeUrl === ResponseExtendVote.typeUrl || o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string"); + }, + isAmino(o: any): o is ResponseExtendVoteAmino { + return o && (o.$typeUrl === ResponseExtendVote.typeUrl || o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseExtendVote.typeUrl, ResponseExtendVote); +function createBaseResponseVerifyVoteExtension(): ResponseVerifyVoteExtension { + return { + status: 0 + }; +} +export const ResponseVerifyVoteExtension = { + typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension", + is(o: any): o is ResponseVerifyVoteExtension { + return o && (o.$typeUrl === ResponseVerifyVoteExtension.typeUrl || isSet(o.status)); + }, + isAmino(o: any): o is ResponseVerifyVoteExtensionAmino { + return o && (o.$typeUrl === ResponseVerifyVoteExtension.typeUrl || isSet(o.status)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ResponseVerifyVoteExtension.typeUrl, ResponseVerifyVoteExtension); +function createBaseResponseFinalizeBlock(): ResponseFinalizeBlock { + return { + events: [], + txResults: [], + validatorUpdates: [], + consensusParamUpdates: undefined, + appHash: new Uint8Array() + }; +} +export const ResponseFinalizeBlock = { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + is(o: any): o is ResponseFinalizeBlock { + return o && (o.$typeUrl === ResponseFinalizeBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && Array.isArray(o.txResults) && (!o.txResults.length || ExecTxResult.is(o.txResults[0])) && Array.isArray(o.validatorUpdates) && (!o.validatorUpdates.length || ValidatorUpdate.is(o.validatorUpdates[0])) && (o.appHash instanceof Uint8Array || typeof o.appHash === "string")); + }, + isAmino(o: any): o is ResponseFinalizeBlockAmino { + return o && (o.$typeUrl === ResponseFinalizeBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && Array.isArray(o.tx_results) && (!o.tx_results.length || ExecTxResult.isAmino(o.tx_results[0])) && Array.isArray(o.validator_updates) && (!o.validator_updates.length || ValidatorUpdate.isAmino(o.validator_updates[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, + 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.appHash.length !== 0) { + writer.uint32(42).bytes(message.appHash); + } + return writer; + }, + 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 = createBaseResponseFinalizeBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 2: + message.txResults.push(ExecTxResult.decode(reader, reader.uint32())); + break; + case 3: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 4: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 5: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 (message.txResults) { + obj.tx_results = message.txResults.map(e => e ? ExecTxResult.toAmino(e) : undefined); + } else { + obj.tx_results = message.txResults; + } + 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.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseFinalizeBlockAminoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseFinalizeBlockProtoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.decode(message.value); + }, + toProto(message: ResponseFinalizeBlock): Uint8Array { + return ResponseFinalizeBlock.encode(message).finish(); + }, + toProtoMsg(message: ResponseFinalizeBlock): ResponseFinalizeBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + value: ResponseFinalizeBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponseFinalizeBlock.typeUrl, ResponseFinalizeBlock); +function createBaseCommitInfo(): CommitInfo { + return { + round: 0, + votes: [] + }; +} +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + is(o: any): o is CommitInfo { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.is(o.votes[0]))); + }, + isAmino(o: any): o is CommitInfoAmino { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.isAmino(o.votes[0]))); + }, + encode(message: CommitInfo, 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(); + } + 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.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + return message; + }, + 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: CommitInfo): CommitInfoAmino { + 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); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); + }, + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); + }, + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); + }, + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommitInfo.typeUrl, CommitInfo); +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { + return { + round: 0, + votes: [] + }; +} +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + is(o: any): o is ExtendedCommitInfo { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.is(o.votes[0]))); + }, + isAmino(o: any): o is ExtendedCommitInfoAmino { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.isAmino(o.votes[0]))); + }, + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + 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 = createBaseExtendedCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; + return message; + }, + 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 ? ExtendedVoteInfo.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); + }, + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommitInfo.typeUrl, ExtendedCommitInfo); +function createBaseEvent(): Event { + return { + type: "", + attributes: [] + }; +} +export const Event = { + typeUrl: "/tendermint.abci.Event", + is(o: any): o is Event { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.is(o.attributes[0]))); + }, + isAmino(o: any): o is EventAmino { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.isAmino(o.attributes[0]))); + }, + encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Event { + const message = createBaseEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAmino): Event { + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: Event): EventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? EventAttribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: EventAminoMsg): Event { + return Event.fromAmino(object.value); + }, + fromProtoMsg(message: EventProtoMsg): Event { + return Event.decode(message.value); + }, + toProto(message: Event): Uint8Array { + return Event.encode(message).finish(); + }, + toProtoMsg(message: Event): EventProtoMsg { + return { + typeUrl: "/tendermint.abci.Event", + value: Event.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Event.typeUrl, Event); +function createBaseEventAttribute(): EventAttribute { + return { + key: "", + value: "", + index: false + }; +} +export const EventAttribute = { + typeUrl: "/tendermint.abci.EventAttribute", + is(o: any): o is EventAttribute { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + isAmino(o: any): o is EventAttributeAmino { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.index === true) { + writer.uint32(24).bool(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttribute(); + 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; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EventAttribute { + const message = createBaseEventAttribute(); + 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 = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; + }, + toAmino(message: EventAttribute): EventAttributeAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + obj.index = message.index === false ? undefined : message.index; + return obj; + }, + fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { + return EventAttribute.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { + return EventAttribute.decode(message.value); + }, + toProto(message: EventAttribute): Uint8Array { + return EventAttribute.encode(message).finish(); + }, + toProtoMsg(message: EventAttribute): EventAttributeProtoMsg { + return { + typeUrl: "/tendermint.abci.EventAttribute", + value: EventAttribute.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EventAttribute.typeUrl, 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", + is(o: any): o is ExecTxResult { + return o && (o.$typeUrl === ExecTxResult.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ExecTxResultAmino { + return o && (o.$typeUrl === ExecTxResult.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExecTxResult.typeUrl, ExecTxResult); +function createBaseTxResult(): TxResult { + return { + height: BigInt(0), + index: 0, + tx: new Uint8Array(), + result: ExecTxResult.fromPartial({}) + }; +} +export const TxResult = { + typeUrl: "/tendermint.abci.TxResult", + is(o: any): o is TxResult { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ExecTxResult.is(o.result)); + }, + isAmino(o: any): o is TxResultAmino { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ExecTxResult.isAmino(o.result)); + }, + encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index); + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx); + } + if (message.result !== undefined) { + ExecTxResult.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ExecTxResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxResult { + const message = createBaseTxResult(); + 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 ? ExecTxResult.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: TxResultAmino): TxResult { + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ExecTxResult.fromAmino(object.result); + } + return message; + }, + toAmino(message: TxResult): TxResultAmino { + const obj: any = {}; + 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 ? ExecTxResult.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: TxResultAminoMsg): TxResult { + return TxResult.fromAmino(object.value); + }, + fromProtoMsg(message: TxResultProtoMsg): TxResult { + return TxResult.decode(message.value); + }, + toProto(message: TxResult): Uint8Array { + return TxResult.encode(message).finish(); + }, + toProtoMsg(message: TxResult): TxResultProtoMsg { + return { + typeUrl: "/tendermint.abci.TxResult", + value: TxResult.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxResult.typeUrl, TxResult); +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + power: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.abci.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.power !== BigInt(0)) { + writer.uint32(24).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.abci.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +function createBaseValidatorUpdate(): ValidatorUpdate { + return { + pubKey: PublicKey.fromPartial({}), + power: BigInt(0) + }; +} +export const ValidatorUpdate = { + typeUrl: "/tendermint.abci.ValidatorUpdate", + is(o: any): o is ValidatorUpdate { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.is(o.pubKey) && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorUpdateAmino { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.isAmino(o.pub_key) && typeof o.power === "bigint"); + }, + encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.power = message.power !== BigInt(0) ? message.power?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { + return ValidatorUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { + return ValidatorUpdate.decode(message.value); + }, + toProto(message: ValidatorUpdate): Uint8Array { + return ValidatorUpdate.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdate): ValidatorUpdateProtoMsg { + return { + typeUrl: "/tendermint.abci.ValidatorUpdate", + value: ValidatorUpdate.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorUpdate.typeUrl, ValidatorUpdate); +function createBaseVoteInfo(): VoteInfo { + return { + validator: Validator.fromPartial({}), + blockIdFlag: 0 + }; +} +export const VoteInfo = { + typeUrl: "/tendermint.abci.VoteInfo", + is(o: any): o is VoteInfo { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.is(o.validator) && isSet(o.blockIdFlag)); + }, + isAmino(o: any): o is VoteInfoAmino { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.isAmino(o.validator) && isSet(o.block_id_flag)); + }, + encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.blockIdFlag !== 0) { + writer.uint32(24).int32(message.blockIdFlag); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.blockIdFlag = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VoteInfo { + const message = createBaseVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.blockIdFlag = object.blockIdFlag ?? 0; + return message; + }, + fromAmino(object: VoteInfoAmino): VoteInfo { + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + 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.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + return obj; + }, + fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { + return VoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { + return VoteInfo.decode(message.value); + }, + toProto(message: VoteInfo): Uint8Array { + return VoteInfo.encode(message).finish(); + }, + toProtoMsg(message: VoteInfo): VoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.VoteInfo", + value: VoteInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VoteInfo.typeUrl, VoteInfo); +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + voteExtension: new Uint8Array(), + extensionSignature: new Uint8Array(), + blockIdFlag: 0 + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + is(o: any): o is ExtendedVoteInfo { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.is(o.validator) && (o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string") && isSet(o.blockIdFlag)); + }, + isAmino(o: any): o is ExtendedVoteInfoAmino { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.isAmino(o.validator) && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string") && isSet(o.block_id_flag)); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedVoteInfo.typeUrl, ExtendedVoteInfo); +function createBaseMisbehavior(): Misbehavior { + return { + type: 0, + validator: Validator.fromPartial({}), + height: BigInt(0), + time: new Date(), + totalVotingPower: BigInt(0) + }; +} +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + is(o: any): o is Misbehavior { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.is(o.validator) && typeof o.height === "bigint" && Timestamp.is(o.time) && typeof o.totalVotingPower === "bigint"); + }, + isAmino(o: any): o is MisbehaviorAmino { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.isAmino(o.validator) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && typeof o.total_voting_power === "bigint"); + }, + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + 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.totalVotingPower !== BigInt(0)) { + writer.uint32(40).int64(message.totalVotingPower); + } + return writer; + }, + 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 = createBaseMisbehavior(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = (reader.int32() as any); + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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); + message.time = object.time ?? undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + 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.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: Misbehavior): MisbehaviorAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); + }, + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); + }, + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); + }, + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { + return { + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Misbehavior.typeUrl, Misbehavior); +function createBaseSnapshot(): Snapshot { + return { + height: BigInt(0), + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: new Uint8Array() + }; +} +export const Snapshot = { + typeUrl: "/tendermint.abci.Snapshot", + is(o: any): o is Snapshot { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + isAmino(o: any): o is SnapshotAmino { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + 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.length !== 0) { + writer.uint32(42).bytes(message.metadata); + } + 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 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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 ?? new Uint8Array(); + 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 = bytesFromBase64(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 ? base64FromBytes(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotAminoMsg): Snapshot { + return Snapshot.fromAmino(object.value); + }, + fromProtoMsg(message: SnapshotProtoMsg): Snapshot { + return Snapshot.decode(message.value); + }, + toProto(message: Snapshot): Uint8Array { + return Snapshot.encode(message).finish(); + }, + toProtoMsg(message: Snapshot): SnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.Snapshot", + value: Snapshot.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Snapshot.typeUrl, Snapshot); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/crypto/keys.ts b/libs/injectivejs/src/tendermint/crypto/keys.ts new file mode 100644 index 00000000..9dc8476b --- /dev/null +++ b/libs/injectivejs/src/tendermint/crypto/keys.ts @@ -0,0 +1,103 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKey { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} +export interface PublicKeyProtoMsg { + typeUrl: "/tendermint.crypto.PublicKey"; + value: Uint8Array; +} +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKeyAmino { + ed25519?: string; + secp256k1?: string; +} +export interface PublicKeyAminoMsg { + type: "/tendermint.crypto.PublicKey"; + value: PublicKeyAmino; +} +function createBasePublicKey(): PublicKey { + return { + ed25519: undefined, + secp256k1: undefined + }; +} +export const PublicKey = { + typeUrl: "/tendermint.crypto.PublicKey", + is(o: any): o is PublicKey { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + isAmino(o: any): o is PublicKeyAmino { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePublicKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; + return message; + }, + fromAmino(object: PublicKeyAmino): PublicKey { + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + toAmino(message: PublicKey): PublicKeyAmino { + const obj: any = {}; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; + return obj; + }, + fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { + return PublicKey.fromAmino(object.value); + }, + fromProtoMsg(message: PublicKeyProtoMsg): PublicKey { + return PublicKey.decode(message.value); + }, + toProto(message: PublicKey): Uint8Array { + return PublicKey.encode(message).finish(); + }, + toProtoMsg(message: PublicKey): PublicKeyProtoMsg { + return { + typeUrl: "/tendermint.crypto.PublicKey", + value: PublicKey.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PublicKey.typeUrl, PublicKey); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/crypto/proof.ts b/libs/injectivejs/src/tendermint/crypto/proof.ts new file mode 100644 index 00000000..5f372fcf --- /dev/null +++ b/libs/injectivejs/src/tendermint/crypto/proof.ts @@ -0,0 +1,555 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Proof { + total: bigint; + index: bigint; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ProofProtoMsg { + typeUrl: "/tendermint.crypto.Proof"; + value: Uint8Array; +} +export interface ProofAmino { + total: string; + index: string; + leaf_hash: string; + aunts: string[]; +} +export interface ProofAminoMsg { + type: "/tendermint.crypto.Proof"; + value: ProofAmino; +} +export interface ValueOp { + /** Encoded in ProofOp.Key. */ + key: Uint8Array; + /** To encode in ProofOp.Data */ + proof?: Proof; +} +export interface ValueOpProtoMsg { + typeUrl: "/tendermint.crypto.ValueOp"; + value: Uint8Array; +} +export interface ValueOpAmino { + /** Encoded in ProofOp.Key. */ + key: string; + /** To encode in ProofOp.Data */ + proof?: ProofAmino; +} +export interface ValueOpAminoMsg { + type: "/tendermint.crypto.ValueOp"; + value: ValueOpAmino; +} +export interface DominoOp { + key: string; + input: string; + output: string; +} +export interface DominoOpProtoMsg { + typeUrl: "/tendermint.crypto.DominoOp"; + value: Uint8Array; +} +export interface DominoOpAmino { + key: string; + input: string; + output: string; +} +export interface DominoOpAminoMsg { + type: "/tendermint.crypto.DominoOp"; + value: DominoOpAmino; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} +export interface ProofOpProtoMsg { + typeUrl: "/tendermint.crypto.ProofOp"; + value: Uint8Array; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpAmino { + type: string; + key: string; + data: string; +} +export interface ProofOpAminoMsg { + type: "/tendermint.crypto.ProofOp"; + value: ProofOpAmino; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOps { + ops: ProofOp[]; +} +export interface ProofOpsProtoMsg { + typeUrl: "/tendermint.crypto.ProofOps"; + value: Uint8Array; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsAmino { + ops: ProofOpAmino[]; +} +export interface ProofOpsAminoMsg { + type: "/tendermint.crypto.ProofOps"; + value: ProofOpsAmino; +} +function createBaseProof(): Proof { + return { + total: BigInt(0), + index: BigInt(0), + leafHash: new Uint8Array(), + aunts: [] + }; +} +export const Proof = { + typeUrl: "/tendermint.crypto.Proof", + is(o: any): o is Proof { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leafHash instanceof Uint8Array || typeof o.leafHash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + isAmino(o: any): o is ProofAmino { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leaf_hash instanceof Uint8Array || typeof o.leaf_hash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== BigInt(0)) { + writer.uint32(8).int64(message.total); + } + if (message.index !== BigInt(0)) { + writer.uint32(16).int64(message.index); + } + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); + } + for (const v of message.aunts) { + writer.uint32(34).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proof { + const message = createBaseProof(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map(e => e) || []; + return message; + }, + fromAmino(object: ProofAmino): Proof { + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Proof): ProofAmino { + const obj: any = {}; + obj.total = message.total !== BigInt(0) ? message.total?.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index?.toString() : undefined; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; + if (message.aunts) { + obj.aunts = message.aunts.map(e => base64FromBytes(e)); + } else { + obj.aunts = message.aunts; + } + return obj; + }, + fromAminoMsg(object: ProofAminoMsg): Proof { + return Proof.fromAmino(object.value); + }, + fromProtoMsg(message: ProofProtoMsg): Proof { + return Proof.decode(message.value); + }, + toProto(message: Proof): Uint8Array { + return Proof.encode(message).finish(); + }, + toProtoMsg(message: Proof): ProofProtoMsg { + return { + typeUrl: "/tendermint.crypto.Proof", + value: Proof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proof.typeUrl, Proof); +function createBaseValueOp(): ValueOp { + return { + key: new Uint8Array(), + proof: undefined + }; +} +export const ValueOp = { + typeUrl: "/tendermint.crypto.ValueOp", + is(o: any): o is ValueOp { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is ValueOpAmino { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValueOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: ValueOpAmino): ValueOp { + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: ValueOp): ValueOpAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: ValueOpAminoMsg): ValueOp { + return ValueOp.fromAmino(object.value); + }, + fromProtoMsg(message: ValueOpProtoMsg): ValueOp { + return ValueOp.decode(message.value); + }, + toProto(message: ValueOp): Uint8Array { + return ValueOp.encode(message).finish(); + }, + toProtoMsg(message: ValueOp): ValueOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ValueOp", + value: ValueOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValueOp.typeUrl, ValueOp); +function createBaseDominoOp(): DominoOp { + return { + key: "", + input: "", + output: "" + }; +} +export const DominoOp = { + typeUrl: "/tendermint.crypto.DominoOp", + is(o: any): o is DominoOp { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + isAmino(o: any): o is DominoOpAmino { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.input !== "") { + writer.uint32(18).string(message.input); + } + if (message.output !== "") { + writer.uint32(26).string(message.output); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDominoOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; + return message; + }, + fromAmino(object: DominoOpAmino): DominoOp { + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; + }, + toAmino(message: DominoOp): DominoOpAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.input = message.input === "" ? undefined : message.input; + obj.output = message.output === "" ? undefined : message.output; + return obj; + }, + fromAminoMsg(object: DominoOpAminoMsg): DominoOp { + return DominoOp.fromAmino(object.value); + }, + fromProtoMsg(message: DominoOpProtoMsg): DominoOp { + return DominoOp.decode(message.value); + }, + toProto(message: DominoOp): Uint8Array { + return DominoOp.encode(message).finish(); + }, + toProtoMsg(message: DominoOp): DominoOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.DominoOp", + value: DominoOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DominoOp.typeUrl, DominoOp); +function createBaseProofOp(): ProofOp { + return { + type: "", + key: new Uint8Array(), + data: new Uint8Array() + }; +} +export const ProofOp = { + typeUrl: "/tendermint.crypto.ProofOp", + is(o: any): o is ProofOp { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is ProofOpAmino { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: ProofOpProtoMsg): ProofOp { + return ProofOp.decode(message.value); + }, + toProto(message: ProofOp): Uint8Array { + return ProofOp.encode(message).finish(); + }, + toProtoMsg(message: ProofOp): ProofOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOp", + value: ProofOp.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProofOp.typeUrl, ProofOp); +function createBaseProofOps(): ProofOps { + return { + ops: [] + }; +} +export const ProofOps = { + typeUrl: "/tendermint.crypto.ProofOps", + is(o: any): o is ProofOps { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.is(o.ops[0]))); + }, + isAmino(o: any): o is ProofOpsAmino { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.isAmino(o.ops[0]))); + }, + 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: DeepPartial): 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); + }, + fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { + return ProofOps.decode(message.value); + }, + toProto(message: ProofOps): Uint8Array { + return ProofOps.encode(message).finish(); + }, + toProtoMsg(message: ProofOps): ProofOpsProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOps", + value: ProofOps.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ProofOps.typeUrl, ProofOps); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/types/block.ts b/libs/injectivejs/src/tendermint/types/block.ts new file mode 100644 index 00000000..16763b51 --- /dev/null +++ b/libs/injectivejs/src/tendermint/types/block.ts @@ -0,0 +1,131 @@ +import { Header, HeaderAmino, Data, DataAmino, Commit, CommitAmino } from "./types"; +import { EvidenceList, EvidenceListAmino } from "./evidence"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Block { + header: Header; + data: Data; + evidence: EvidenceList; + lastCommit?: Commit; +} +export interface BlockProtoMsg { + typeUrl: "/tendermint.types.Block"; + value: Uint8Array; +} +export interface BlockAmino { + header: HeaderAmino; + data: DataAmino; + evidence: EvidenceListAmino; + last_commit?: CommitAmino; +} +export interface BlockAminoMsg { + type: "/tendermint.types.Block"; + value: BlockAmino; +} +function createBaseBlock(): Block { + return { + header: Header.fromPartial({}), + data: Data.fromPartial({}), + evidence: EvidenceList.fromPartial({}), + lastCommit: undefined + }; +} +export const Block = { + typeUrl: "/tendermint.types.Block", + is(o: any): o is Block { + return o && (o.$typeUrl === Block.typeUrl || Header.is(o.header) && Data.is(o.data) && EvidenceList.is(o.evidence)); + }, + isAmino(o: any): o is BlockAmino { + return o && (o.$typeUrl === Block.typeUrl || Header.isAmino(o.header) && Data.isAmino(o.data) && EvidenceList.isAmino(o.evidence)); + }, + 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: DeepPartial): 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) : undefined; + obj.data = message.data ? Data.toAmino(message.data) : undefined; + obj.evidence = message.evidence ? EvidenceList.toAmino(message.evidence) : undefined; + obj.last_commit = message.lastCommit ? Commit.toAmino(message.lastCommit) : undefined; + return obj; + }, + fromAminoMsg(object: BlockAminoMsg): Block { + return Block.fromAmino(object.value); + }, + fromProtoMsg(message: BlockProtoMsg): Block { + return Block.decode(message.value); + }, + toProto(message: Block): Uint8Array { + return Block.encode(message).finish(); + }, + toProtoMsg(message: Block): BlockProtoMsg { + return { + typeUrl: "/tendermint.types.Block", + value: Block.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Block.typeUrl, Block); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/types/evidence.ts b/libs/injectivejs/src/tendermint/types/evidence.ts new file mode 100644 index 00000000..696b6c8a --- /dev/null +++ b/libs/injectivejs/src/tendermint/types/evidence.ts @@ -0,0 +1,476 @@ +import { Vote, VoteAmino, LightBlock, LightBlockAmino } from "./types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Validator, ValidatorAmino } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Evidence { + duplicateVoteEvidence?: DuplicateVoteEvidence; + lightClientAttackEvidence?: LightClientAttackEvidence; +} +export interface EvidenceProtoMsg { + typeUrl: "/tendermint.types.Evidence"; + value: Uint8Array; +} +export interface EvidenceAmino { + duplicate_vote_evidence?: DuplicateVoteEvidenceAmino; + light_client_attack_evidence?: LightClientAttackEvidenceAmino; +} +export interface EvidenceAminoMsg { + type: "/tendermint.types.Evidence"; + value: EvidenceAmino; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidence { + voteA?: Vote; + voteB?: Vote; + totalVotingPower: bigint; + validatorPower: bigint; + timestamp: Date; +} +export interface DuplicateVoteEvidenceProtoMsg { + typeUrl: "/tendermint.types.DuplicateVoteEvidence"; + value: Uint8Array; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidenceAmino { + vote_a?: VoteAmino; + vote_b?: VoteAmino; + total_voting_power: string; + validator_power: string; + timestamp: string; +} +export interface DuplicateVoteEvidenceAminoMsg { + type: "/tendermint.types.DuplicateVoteEvidence"; + value: DuplicateVoteEvidenceAmino; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidence { + conflictingBlock?: LightBlock; + commonHeight: bigint; + byzantineValidators: Validator[]; + totalVotingPower: bigint; + timestamp: Date; +} +export interface LightClientAttackEvidenceProtoMsg { + typeUrl: "/tendermint.types.LightClientAttackEvidence"; + value: Uint8Array; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidenceAmino { + conflicting_block?: LightBlockAmino; + common_height: string; + byzantine_validators: ValidatorAmino[]; + total_voting_power: string; + timestamp: string; +} +export interface LightClientAttackEvidenceAminoMsg { + type: "/tendermint.types.LightClientAttackEvidence"; + value: LightClientAttackEvidenceAmino; +} +export interface EvidenceList { + evidence: Evidence[]; +} +export interface EvidenceListProtoMsg { + typeUrl: "/tendermint.types.EvidenceList"; + value: Uint8Array; +} +export interface EvidenceListAmino { + evidence: EvidenceAmino[]; +} +export interface EvidenceListAminoMsg { + type: "/tendermint.types.EvidenceList"; + value: EvidenceListAmino; +} +function createBaseEvidence(): Evidence { + return { + duplicateVoteEvidence: undefined, + lightClientAttackEvidence: undefined + }; +} +export const Evidence = { + typeUrl: "/tendermint.types.Evidence", + is(o: any): o is Evidence { + return o && o.$typeUrl === Evidence.typeUrl; + }, + isAmino(o: any): o is EvidenceAmino { + return o && o.$typeUrl === Evidence.typeUrl; + }, + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); + } + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Evidence { + const message = createBaseEvidence(); + message.duplicateVoteEvidence = object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) : undefined; + message.lightClientAttackEvidence = object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) : undefined; + return message; + }, + fromAmino(object: EvidenceAmino): Evidence { + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; + }, + toAmino(message: Evidence): EvidenceAmino { + const obj: any = {}; + obj.duplicate_vote_evidence = message.duplicateVoteEvidence ? DuplicateVoteEvidence.toAmino(message.duplicateVoteEvidence) : undefined; + obj.light_client_attack_evidence = message.lightClientAttackEvidence ? LightClientAttackEvidence.toAmino(message.lightClientAttackEvidence) : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceAminoMsg): Evidence { + return Evidence.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceProtoMsg): Evidence { + return Evidence.decode(message.value); + }, + toProto(message: Evidence): Uint8Array { + return Evidence.encode(message).finish(); + }, + toProtoMsg(message: Evidence): EvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.Evidence", + value: Evidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Evidence.typeUrl, Evidence); +function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { + return { + voteA: undefined, + voteB: undefined, + totalVotingPower: BigInt(0), + validatorPower: BigInt(0), + timestamp: new Date() + }; +} +export const DuplicateVoteEvidence = { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + is(o: any): o is DuplicateVoteEvidence { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.totalVotingPower === "bigint" && typeof o.validatorPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isAmino(o: any): o is DuplicateVoteEvidenceAmino { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.total_voting_power === "bigint" && typeof o.validator_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, + encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); + } + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + if (message.validatorPower !== BigInt(0)) { + writer.uint32(32).int64(message.validatorPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuplicateVoteEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + message.voteA = object.voteA !== undefined && object.voteA !== null ? Vote.fromPartial(object.voteA) : undefined; + message.voteB = object.voteB !== undefined && object.voteB !== null ? Vote.fromPartial(object.voteB) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.validatorPower = object.validatorPower !== undefined && object.validatorPower !== null ? BigInt(object.validatorPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { + const obj: any = {}; + obj.vote_a = message.voteA ? Vote.toAmino(message.voteA) : undefined; + obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + obj.validator_power = message.validatorPower !== BigInt(0) ? message.validatorPower?.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: DuplicateVoteEvidenceProtoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.decode(message.value); + }, + toProto(message: DuplicateVoteEvidence): Uint8Array { + return DuplicateVoteEvidence.encode(message).finish(); + }, + toProtoMsg(message: DuplicateVoteEvidence): DuplicateVoteEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + value: DuplicateVoteEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DuplicateVoteEvidence.typeUrl, DuplicateVoteEvidence); +function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { + return { + conflictingBlock: undefined, + commonHeight: BigInt(0), + byzantineValidators: [], + totalVotingPower: BigInt(0), + timestamp: new Date() + }; +} +export const LightClientAttackEvidence = { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + is(o: any): o is LightClientAttackEvidence { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.commonHeight === "bigint" && Array.isArray(o.byzantineValidators) && (!o.byzantineValidators.length || Validator.is(o.byzantineValidators[0])) && typeof o.totalVotingPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isAmino(o: any): o is LightClientAttackEvidenceAmino { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.common_height === "bigint" && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Validator.isAmino(o.byzantine_validators[0])) && typeof o.total_voting_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, + encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); + } + if (message.commonHeight !== BigInt(0)) { + writer.uint32(16).int64(message.commonHeight); + } + for (const v of message.byzantineValidators) { + Validator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(32).int64(message.totalVotingPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightClientAttackEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + message.conflictingBlock = object.conflictingBlock !== undefined && object.conflictingBlock !== null ? LightBlock.fromPartial(object.conflictingBlock) : undefined; + message.commonHeight = object.commonHeight !== undefined && object.commonHeight !== null ? BigInt(object.commonHeight.toString()) : BigInt(0); + message.byzantineValidators = object.byzantineValidators?.map(e => Validator.fromPartial(e)) || []; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { + const obj: any = {}; + obj.conflicting_block = message.conflictingBlock ? LightBlock.toAmino(message.conflictingBlock) : undefined; + obj.common_height = message.commonHeight !== BigInt(0) ? message.commonHeight?.toString() : undefined; + if (message.byzantineValidators) { + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.byzantine_validators = message.byzantineValidators; + } + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: LightClientAttackEvidenceProtoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.decode(message.value); + }, + toProto(message: LightClientAttackEvidence): Uint8Array { + return LightClientAttackEvidence.encode(message).finish(); + }, + toProtoMsg(message: LightClientAttackEvidence): LightClientAttackEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + value: LightClientAttackEvidence.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LightClientAttackEvidence.typeUrl, LightClientAttackEvidence); +function createBaseEvidenceList(): EvidenceList { + return { + evidence: [] + }; +} +export const EvidenceList = { + typeUrl: "/tendermint.types.EvidenceList", + is(o: any): o is EvidenceList { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.is(o.evidence[0]))); + }, + isAmino(o: any): o is EvidenceListAmino { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.isAmino(o.evidence[0]))); + }, + encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.evidence) { + Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EvidenceListAmino): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; + }, + toAmino(message: EvidenceList): EvidenceListAmino { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map(e => e ? Evidence.toAmino(e) : undefined); + } else { + obj.evidence = message.evidence; + } + return obj; + }, + fromAminoMsg(object: EvidenceListAminoMsg): EvidenceList { + return EvidenceList.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceListProtoMsg): EvidenceList { + return EvidenceList.decode(message.value); + }, + toProto(message: EvidenceList): Uint8Array { + return EvidenceList.encode(message).finish(); + }, + toProtoMsg(message: EvidenceList): EvidenceListProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceList", + value: EvidenceList.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EvidenceList.typeUrl, EvidenceList); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/types/params.ts b/libs/injectivejs/src/tendermint/types/params.ts new file mode 100644 index 00000000..0b15190e --- /dev/null +++ b/libs/injectivejs/src/tendermint/types/params.ts @@ -0,0 +1,814 @@ +import { Duration, DurationAmino } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; + abci?: ABCIParams; +} +export interface ConsensusParamsProtoMsg { + typeUrl: "/tendermint.types.ConsensusParams"; + value: Uint8Array; +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + version?: VersionParamsAmino; + abci?: ABCIParamsAmino; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.types.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: bigint; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: bigint; +} +export interface BlockParamsProtoMsg { + typeUrl: "/tendermint.types.BlockParams"; + value: Uint8Array; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + max_bytes: string; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + max_gas: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.types.BlockParams"; + value: BlockParamsAmino; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: bigint; + /** + * Max age of evidence, in time. + * + * 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). + */ + maxAgeDuration: Duration; + /** + * 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. + * Default is 1048576 or 1MB + */ + maxBytes: bigint; +} +export interface EvidenceParamsProtoMsg { + typeUrl: "/tendermint.types.EvidenceParams"; + value: Uint8Array; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsAmino { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + max_age_num_blocks: string; + /** + * Max age of evidence, in time. + * + * 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). + */ + max_age_duration: DurationAmino; + /** + * 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. + * Default is 1048576 or 1MB + */ + max_bytes: string; +} +export interface EvidenceParamsAminoMsg { + type: "/tendermint.types.EvidenceParams"; + value: EvidenceParamsAmino; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} +export interface ValidatorParamsProtoMsg { + typeUrl: "/tendermint.types.ValidatorParams"; + value: Uint8Array; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsAmino { + pub_key_types: string[]; +} +export interface ValidatorParamsAminoMsg { + type: "/tendermint.types.ValidatorParams"; + value: ValidatorParamsAmino; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + app: bigint; +} +export interface VersionParamsProtoMsg { + typeUrl: "/tendermint.types.VersionParams"; + value: Uint8Array; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsAmino { + app: string; +} +export interface VersionParamsAminoMsg { + type: "/tendermint.types.VersionParams"; + value: VersionParamsAmino; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: bigint; + blockMaxGas: bigint; +} +export interface HashedParamsProtoMsg { + typeUrl: "/tendermint.types.HashedParams"; + value: Uint8Array; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsAmino { + block_max_bytes: string; + block_max_gas: string; +} +export interface HashedParamsAminoMsg { + type: "/tendermint.types.HashedParams"; + value: HashedParamsAmino; +} +/** 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; +} +function createBaseConsensusParams(): ConsensusParams { + return { + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined, + abci: undefined + }; +} +export const ConsensusParams = { + typeUrl: "/tendermint.types.ConsensusParams", + is(o: any): o is ConsensusParams { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + isAmino(o: any): o is ConsensusParamsAmino { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + 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 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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; + message.abci = object.abci !== undefined && object.abci !== null ? ABCIParams.fromPartial(object.abci) : 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); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + 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 { + 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.abci = message.abci ? ABCIParams.toAmino(message.abci) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { + return ConsensusParams.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { + return ConsensusParams.decode(message.value); + }, + toProto(message: ConsensusParams): Uint8Array { + return ConsensusParams.encode(message).finish(); + }, + toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ConsensusParams", + value: ConsensusParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConsensusParams.typeUrl, ConsensusParams); +function createBaseBlockParams(): BlockParams { + return { + maxBytes: BigInt(0), + maxGas: BigInt(0) + }; +} +export const BlockParams = { + typeUrl: "/tendermint.types.BlockParams", + is(o: any): o is BlockParams { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.maxBytes === "bigint" && typeof o.maxGas === "bigint"); + }, + isAmino(o: any): o is BlockParamsAmino { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.max_bytes === "bigint" && typeof o.max_gas === "bigint"); + }, + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== BigInt(0)) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): 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); + 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); + } + 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; + return obj; + }, + fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { + return BlockParams.fromAmino(object.value); + }, + fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { + return BlockParams.decode(message.value); + }, + toProto(message: BlockParams): Uint8Array { + return BlockParams.encode(message).finish(); + }, + toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + return { + typeUrl: "/tendermint.types.BlockParams", + value: BlockParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockParams.typeUrl, BlockParams); +function createBaseEvidenceParams(): EvidenceParams { + return { + maxAgeNumBlocks: BigInt(0), + maxAgeDuration: Duration.fromPartial({}), + maxBytes: BigInt(0) + }; +} +export const EvidenceParams = { + typeUrl: "/tendermint.types.EvidenceParams", + is(o: any): o is EvidenceParams { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.maxAgeNumBlocks === "bigint" && Duration.is(o.maxAgeDuration) && typeof o.maxBytes === "bigint"); + }, + isAmino(o: any): o is EvidenceParamsAmino { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.max_age_num_blocks === "bigint" && Duration.isAmino(o.max_age_duration) && typeof o.max_bytes === "bigint"); + }, + encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAgeNumBlocks !== BigInt(0)) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBytes !== BigInt(0)) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0); + message.maxAgeDuration = object.maxAgeDuration !== undefined && object.maxAgeDuration !== null ? Duration.fromPartial(object.maxAgeDuration) : undefined; + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EvidenceParamsAmino): EvidenceParams { + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; + }, + toAmino(message: EvidenceParams): EvidenceParamsAmino { + const obj: any = {}; + obj.max_age_num_blocks = message.maxAgeNumBlocks !== BigInt(0) ? message.maxAgeNumBlocks?.toString() : undefined; + obj.max_age_duration = message.maxAgeDuration ? Duration.toAmino(message.maxAgeDuration) : undefined; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { + return EvidenceParams.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceParamsProtoMsg): EvidenceParams { + return EvidenceParams.decode(message.value); + }, + toProto(message: EvidenceParams): Uint8Array { + return EvidenceParams.encode(message).finish(); + }, + toProtoMsg(message: EvidenceParams): EvidenceParamsProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceParams", + value: EvidenceParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EvidenceParams.typeUrl, EvidenceParams); +function createBaseValidatorParams(): ValidatorParams { + return { + pubKeyTypes: [] + }; +} +export const ValidatorParams = { + typeUrl: "/tendermint.types.ValidatorParams", + is(o: any): o is ValidatorParams { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pubKeyTypes) && (!o.pubKeyTypes.length || typeof o.pubKeyTypes[0] === "string")); + }, + isAmino(o: any): o is ValidatorParamsAmino { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pub_key_types) && (!o.pub_key_types.length || typeof o.pub_key_types[0] === "string")); + }, + encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map(e => e) || []; + return message; + }, + fromAmino(object: ValidatorParamsAmino): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; + }, + toAmino(message: ValidatorParams): ValidatorParamsAmino { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pub_key_types = message.pubKeyTypes.map(e => e); + } else { + obj.pub_key_types = message.pubKeyTypes; + } + return obj; + }, + fromAminoMsg(object: ValidatorParamsAminoMsg): ValidatorParams { + return ValidatorParams.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorParamsProtoMsg): ValidatorParams { + return ValidatorParams.decode(message.value); + }, + toProto(message: ValidatorParams): Uint8Array { + return ValidatorParams.encode(message).finish(); + }, + toProtoMsg(message: ValidatorParams): ValidatorParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorParams", + value: ValidatorParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorParams.typeUrl, ValidatorParams); +function createBaseVersionParams(): VersionParams { + return { + app: BigInt(0) + }; +} +export const VersionParams = { + typeUrl: "/tendermint.types.VersionParams", + is(o: any): o is VersionParams { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + isAmino(o: any): o is VersionParamsAmino { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): VersionParams { + const message = createBaseVersionParams(); + 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 !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: VersionParams): VersionParamsAmino { + const obj: any = {}; + obj.app = message.app !== BigInt(0) ? message.app?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { + return VersionParams.fromAmino(object.value); + }, + fromProtoMsg(message: VersionParamsProtoMsg): VersionParams { + return VersionParams.decode(message.value); + }, + toProto(message: VersionParams): Uint8Array { + return VersionParams.encode(message).finish(); + }, + toProtoMsg(message: VersionParams): VersionParamsProtoMsg { + return { + typeUrl: "/tendermint.types.VersionParams", + value: VersionParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(VersionParams.typeUrl, VersionParams); +function createBaseHashedParams(): HashedParams { + return { + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0) + }; +} +export const HashedParams = { + typeUrl: "/tendermint.types.HashedParams", + is(o: any): o is HashedParams { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.blockMaxBytes === "bigint" && typeof o.blockMaxGas === "bigint"); + }, + isAmino(o: any): o is HashedParamsAmino { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.block_max_bytes === "bigint" && typeof o.block_max_gas === "bigint"); + }, + encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockMaxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (message.blockMaxGas !== BigInt(0)) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHashedParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? BigInt(object.blockMaxBytes.toString()) : BigInt(0); + message.blockMaxGas = object.blockMaxGas !== undefined && object.blockMaxGas !== null ? BigInt(object.blockMaxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HashedParamsAmino): HashedParams { + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; + }, + toAmino(message: HashedParams): HashedParamsAmino { + const obj: any = {}; + obj.block_max_bytes = message.blockMaxBytes !== BigInt(0) ? message.blockMaxBytes?.toString() : undefined; + obj.block_max_gas = message.blockMaxGas !== BigInt(0) ? message.blockMaxGas?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { + return HashedParams.fromAmino(object.value); + }, + fromProtoMsg(message: HashedParamsProtoMsg): HashedParams { + return HashedParams.decode(message.value); + }, + toProto(message: HashedParams): Uint8Array { + return HashedParams.encode(message).finish(); + }, + toProtoMsg(message: HashedParams): HashedParamsProtoMsg { + return { + typeUrl: "/tendermint.types.HashedParams", + value: HashedParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(HashedParams.typeUrl, HashedParams); +function createBaseABCIParams(): ABCIParams { + return { + voteExtensionsEnableHeight: BigInt(0) + }; +} +export const ABCIParams = { + typeUrl: "/tendermint.types.ABCIParams", + is(o: any): o is ABCIParams { + return o && (o.$typeUrl === ABCIParams.typeUrl || typeof o.voteExtensionsEnableHeight === "bigint"); + }, + isAmino(o: any): o is ABCIParamsAmino { + return o && (o.$typeUrl === ABCIParams.typeUrl || typeof o.vote_extensions_enable_height === "bigint"); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ABCIParams.typeUrl, ABCIParams); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/types/types.ts b/libs/injectivejs/src/tendermint/types/types.ts new file mode 100644 index 00000000..c44fd8af --- /dev/null +++ b/libs/injectivejs/src/tendermint/types/types.ts @@ -0,0 +1,2157 @@ +import { Proof, ProofAmino } from "../crypto/proof"; +import { Consensus, ConsensusAmino } from "../version/types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { BlockIDFlag, ValidatorSet, ValidatorSetAmino } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1, +} +export const SignedMsgTypeAmino = SignedMsgType; +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case "SIGNED_MSG_TYPE_UNKNOWN": + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + case 1: + case "SIGNED_MSG_TYPE_PREVOTE": + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + case 2: + case "SIGNED_MSG_TYPE_PRECOMMIT": + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + case 32: + case "SIGNED_MSG_TYPE_PROPOSAL": + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + case -1: + case "UNRECOGNIZED": + default: + return SignedMsgType.UNRECOGNIZED; + } +} +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return "SIGNED_MSG_TYPE_UNKNOWN"; + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return "SIGNED_MSG_TYPE_PREVOTE"; + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return "SIGNED_MSG_TYPE_PRECOMMIT"; + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} +export interface PartSetHeaderProtoMsg { + typeUrl: "/tendermint.types.PartSetHeader"; + value: Uint8Array; +} +/** PartsetHeader */ +export interface PartSetHeaderAmino { + total: number; + hash: string; +} +export interface PartSetHeaderAminoMsg { + type: "/tendermint.types.PartSetHeader"; + value: PartSetHeaderAmino; +} +export interface Part { + index: number; + bytes: Uint8Array; + proof: Proof; +} +export interface PartProtoMsg { + typeUrl: "/tendermint.types.Part"; + value: Uint8Array; +} +export interface PartAmino { + index: number; + bytes: string; + proof: ProofAmino; +} +export interface PartAminoMsg { + type: "/tendermint.types.Part"; + value: PartAmino; +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader: PartSetHeader; +} +export interface BlockIDProtoMsg { + typeUrl: "/tendermint.types.BlockID"; + value: Uint8Array; +} +/** BlockID */ +export interface BlockIDAmino { + hash: string; + part_set_header: PartSetHeaderAmino; +} +export interface BlockIDAminoMsg { + type: "/tendermint.types.BlockID"; + value: BlockIDAmino; +} +/** Header defines the structure of a 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; + /** transactions */ + 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; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} +export interface HeaderProtoMsg { + typeUrl: "/tendermint.types.Header"; + value: Uint8Array; +} +/** Header defines the structure of a 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; + /** transactions */ + 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; + /** root hash of all results from the txs from the previous block */ + last_results_hash: string; + /** consensus info */ + evidence_hash: string; + /** original proposer of the block */ + proposer_address: string; +} +export interface HeaderAminoMsg { + type: "/tendermint.types.Header"; + value: HeaderAmino; +} +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: Uint8Array[]; +} +export interface DataProtoMsg { + typeUrl: "/tendermint.types.Data"; + value: Uint8Array; +} +/** Data contains the set of transactions included in the block */ +export interface DataAmino { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: string[]; +} +export interface DataAminoMsg { + type: "/tendermint.types.Data"; + value: DataAmino; +} +/** + * 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 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; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: bigint; + round: number; + blockId: BlockID; + signatures: CommitSig[]; +} +export interface CommitProtoMsg { + typeUrl: "/tendermint.types.Commit"; + value: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitAmino { + height: string; + round: number; + block_id: BlockIDAmino; + signatures: CommitSigAmino[]; +} +export interface CommitAminoMsg { + type: "/tendermint.types.Commit"; + value: CommitAmino; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp: Date; + signature: Uint8Array; +} +export interface CommitSigProtoMsg { + typeUrl: "/tendermint.types.CommitSig"; + value: Uint8Array; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigAmino { + block_id_flag: BlockIDFlag; + validator_address: string; + timestamp: string; + signature: string; +} +export interface CommitSigAminoMsg { + type: "/tendermint.types.CommitSig"; + value: CommitSigAmino; +} +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; +} +/** + * 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; +} +export interface Proposal { + type: SignedMsgType; + height: bigint; + round: number; + polRound: number; + blockId: BlockID; + timestamp: Date; + signature: Uint8Array; +} +export interface ProposalProtoMsg { + typeUrl: "/tendermint.types.Proposal"; + value: Uint8Array; +} +export interface ProposalAmino { + type: SignedMsgType; + height: string; + round: number; + pol_round: number; + block_id: BlockIDAmino; + timestamp: string; + signature: string; +} +export interface ProposalAminoMsg { + type: "/tendermint.types.Proposal"; + value: ProposalAmino; +} +export interface SignedHeader { + header?: Header; + commit?: Commit; +} +export interface SignedHeaderProtoMsg { + typeUrl: "/tendermint.types.SignedHeader"; + value: Uint8Array; +} +export interface SignedHeaderAmino { + header?: HeaderAmino; + commit?: CommitAmino; +} +export interface SignedHeaderAminoMsg { + type: "/tendermint.types.SignedHeader"; + value: SignedHeaderAmino; +} +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} +export interface LightBlockProtoMsg { + typeUrl: "/tendermint.types.LightBlock"; + value: Uint8Array; +} +export interface LightBlockAmino { + signed_header?: SignedHeaderAmino; + validator_set?: ValidatorSetAmino; +} +export interface LightBlockAminoMsg { + type: "/tendermint.types.LightBlock"; + value: LightBlockAmino; +} +export interface BlockMeta { + blockId: BlockID; + blockSize: bigint; + header: Header; + numTxs: bigint; +} +export interface BlockMetaProtoMsg { + typeUrl: "/tendermint.types.BlockMeta"; + value: Uint8Array; +} +export interface BlockMetaAmino { + block_id: BlockIDAmino; + block_size: string; + header: HeaderAmino; + num_txs: string; +} +export interface BlockMetaAminoMsg { + type: "/tendermint.types.BlockMeta"; + value: BlockMetaAmino; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array; + data: Uint8Array; + proof?: Proof; +} +export interface TxProofProtoMsg { + typeUrl: "/tendermint.types.TxProof"; + value: Uint8Array; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofAmino { + root_hash: string; + data: string; + proof?: ProofAmino; +} +export interface TxProofAminoMsg { + type: "/tendermint.types.TxProof"; + value: TxProofAmino; +} +function createBasePartSetHeader(): PartSetHeader { + return { + total: 0, + hash: new Uint8Array() + }; +} +export const PartSetHeader = { + typeUrl: "/tendermint.types.PartSetHeader", + is(o: any): o is PartSetHeader { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + isAmino(o: any): o is PartSetHeaderAmino { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== 0) { + writer.uint32(8).uint32(message.total); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePartSetHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: PartSetHeaderAmino): PartSetHeader { + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: PartSetHeader): PartSetHeaderAmino { + const obj: any = {}; + obj.total = message.total === 0 ? undefined : message.total; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { + return PartSetHeader.fromAmino(object.value); + }, + fromProtoMsg(message: PartSetHeaderProtoMsg): PartSetHeader { + return PartSetHeader.decode(message.value); + }, + toProto(message: PartSetHeader): Uint8Array { + return PartSetHeader.encode(message).finish(); + }, + toProtoMsg(message: PartSetHeader): PartSetHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.PartSetHeader", + value: PartSetHeader.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PartSetHeader.typeUrl, PartSetHeader); +function createBasePart(): Part { + return { + index: 0, + bytes: new Uint8Array(), + proof: Proof.fromPartial({}) + }; +} +export const Part = { + typeUrl: "/tendermint.types.Part", + is(o: any): o is Part { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.is(o.proof)); + }, + isAmino(o: any): o is PartAmino { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.isAmino(o.proof)); + }, + encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.bytes.length !== 0) { + writer.uint32(18).bytes(message.bytes); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: PartAmino): Part { + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: Part): PartAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: PartAminoMsg): Part { + return Part.fromAmino(object.value); + }, + fromProtoMsg(message: PartProtoMsg): Part { + return Part.decode(message.value); + }, + toProto(message: Part): Uint8Array { + return Part.encode(message).finish(); + }, + toProtoMsg(message: Part): PartProtoMsg { + return { + typeUrl: "/tendermint.types.Part", + value: Part.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Part.typeUrl, Part); +function createBaseBlockID(): BlockID { + return { + hash: new Uint8Array(), + partSetHeader: PartSetHeader.fromPartial({}) + }; +} +export const BlockID = { + typeUrl: "/tendermint.types.BlockID", + is(o: any): o is BlockID { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.is(o.partSetHeader)); + }, + isAmino(o: any): o is BlockIDAmino { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.isAmino(o.part_set_header)); + }, + encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = object.partSetHeader !== undefined && object.partSetHeader !== null ? PartSetHeader.fromPartial(object.partSetHeader) : undefined; + return message; + }, + fromAmino(object: BlockIDAmino): BlockID { + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; + }, + toAmino(message: BlockID): BlockIDAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; + return obj; + }, + fromAminoMsg(object: BlockIDAminoMsg): BlockID { + return BlockID.fromAmino(object.value); + }, + fromProtoMsg(message: BlockIDProtoMsg): BlockID { + return BlockID.decode(message.value); + }, + toProto(message: BlockID): Uint8Array { + return BlockID.encode(message).finish(); + }, + toProtoMsg(message: BlockID): BlockIDProtoMsg { + return { + typeUrl: "/tendermint.types.BlockID", + value: BlockID.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockID.typeUrl, BlockID); +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: new Uint8Array() + }; +} +export const Header = { + typeUrl: "/tendermint.types.Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || Consensus.is(o.version) && typeof o.chainId === "string" && typeof o.height === "bigint" && Timestamp.is(o.time) && BlockID.is(o.lastBlockId) && (o.lastCommitHash instanceof Uint8Array || typeof o.lastCommitHash === "string") && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && (o.validatorsHash instanceof Uint8Array || typeof o.validatorsHash === "string") && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.consensusHash instanceof Uint8Array || typeof o.consensusHash === "string") && (o.appHash instanceof Uint8Array || typeof o.appHash === "string") && (o.lastResultsHash instanceof Uint8Array || typeof o.lastResultsHash === "string") && (o.evidenceHash instanceof Uint8Array || typeof o.evidenceHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || Consensus.isAmino(o.version) && typeof o.chain_id === "string" && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && BlockID.isAmino(o.last_block_id) && (o.last_commit_hash instanceof Uint8Array || typeof o.last_commit_hash === "string") && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && (o.validators_hash instanceof Uint8Array || typeof o.validators_hash === "string") && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.consensus_hash instanceof Uint8Array || typeof o.consensus_hash === "string") && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string") && (o.last_results_hash instanceof Uint8Array || typeof o.last_results_hash === "string") && (o.evidence_hash instanceof Uint8Array || typeof o.evidence_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + 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.length !== 0) { + writer.uint32(114).bytes(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.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial
): 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 ?? new Uint8Array(); + 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 = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.version = message.version ? Consensus.toAmino(message.version) : undefined; + 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)) : undefined; + obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; + 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 ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/tendermint.types.Header", + value: Header.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Header.typeUrl, Header); +function createBaseData(): Data { + return { + txs: [] + }; +} +export const Data = { + typeUrl: "/tendermint.types.Data", + is(o: any): o is Data { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is DataAmino { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseData(); + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: DataAmino): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Data): DataAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: DataAminoMsg): Data { + return Data.fromAmino(object.value); + }, + fromProtoMsg(message: DataProtoMsg): Data { + return Data.decode(message.value); + }, + toProto(message: Data): Uint8Array { + return Data.encode(message).finish(); + }, + toProtoMsg(message: Data): DataProtoMsg { + return { + typeUrl: "/tendermint.types.Data", + value: Data.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Data.typeUrl, Data); +function createBaseVote(): Vote { + return { + type: 0, + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array(), + extension: new Uint8Array(), + extensionSignature: new Uint8Array() + }; +} +export const Vote = { + typeUrl: "/tendermint.types.Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && typeof o.validatorIndex === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string")); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.validator_index === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string")); + }, + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); + } + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); + } + 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 { + 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.type = (reader.int32() as any); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + 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; + } + } + return message; + }, + fromPartial(object: DeepPartial): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + 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.timestamp = object.timestamp ?? undefined; + 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 { + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + 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); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + 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 { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + 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; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + 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 { + return Vote.fromAmino(object.value); + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/tendermint.types.Vote", + value: Vote.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +function createBaseCommit(): Commit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + signatures: [] + }; +} +export const Commit = { + typeUrl: "/tendermint.types.Commit", + is(o: any): o is Commit { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.is(o.signatures[0]))); + }, + isAmino(o: any): o is CommitAmino { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.isAmino(o.signatures[0]))); + }, + encode(message: Commit, 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.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommit(); + 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.signatures.push(CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Commit { + const message = createBaseCommit(); + 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.signatures = object.signatures?.map(e => CommitSig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommitAmino): Commit { + const message = createBaseCommit(); + 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.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Commit): CommitAmino { + 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.signatures) { + obj.signatures = message.signatures.map(e => e ? CommitSig.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: CommitAminoMsg): Commit { + return Commit.fromAmino(object.value); + }, + fromProtoMsg(message: CommitProtoMsg): Commit { + return Commit.decode(message.value); + }, + toProto(message: Commit): Uint8Array { + return Commit.encode(message).finish(); + }, + toProtoMsg(message: Commit): CommitProtoMsg { + return { + typeUrl: "/tendermint.types.Commit", + value: Commit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Commit.typeUrl, Commit); +function createBaseCommitSig(): CommitSig { + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const CommitSig = { + typeUrl: "/tendermint.types.CommitSig", + is(o: any): o is CommitSig { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.blockIdFlag) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is CommitSigAmino { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: CommitSig, 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); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitSig(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: CommitSigAmino): CommitSig { + const message = createBaseCommitSig(); + 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); + } + return message; + }, + toAmino(message: CommitSig): CommitSigAmino { + 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; + return obj; + }, + fromAminoMsg(object: CommitSigAminoMsg): CommitSig { + return CommitSig.fromAmino(object.value); + }, + fromProtoMsg(message: CommitSigProtoMsg): CommitSig { + return CommitSig.decode(message.value); + }, + toProto(message: CommitSig): Uint8Array { + return CommitSig.encode(message).finish(); + }, + toProtoMsg(message: CommitSig): CommitSigProtoMsg { + return { + typeUrl: "/tendermint.types.CommitSig", + value: CommitSig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CommitSig.typeUrl, CommitSig); +function createBaseExtendedCommit(): ExtendedCommit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + extendedSignatures: [] + }; +} +export const ExtendedCommit = { + typeUrl: "/tendermint.types.ExtendedCommit", + is(o: any): o is ExtendedCommit { + return o && (o.$typeUrl === ExtendedCommit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Array.isArray(o.extendedSignatures) && (!o.extendedSignatures.length || ExtendedCommitSig.is(o.extendedSignatures[0]))); + }, + isAmino(o: any): o is ExtendedCommitAmino { + return o && (o.$typeUrl === ExtendedCommit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Array.isArray(o.extended_signatures) && (!o.extended_signatures.length || ExtendedCommitSig.isAmino(o.extended_signatures[0]))); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommit.typeUrl, ExtendedCommit); +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", + is(o: any): o is ExtendedCommitSig { + return o && (o.$typeUrl === ExtendedCommitSig.typeUrl || isSet(o.blockIdFlag) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extensionSignature instanceof Uint8Array || typeof o.extensionSignature === "string")); + }, + isAmino(o: any): o is ExtendedCommitSigAmino { + return o && (o.$typeUrl === ExtendedCommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.extension instanceof Uint8Array || typeof o.extension === "string") && (o.extension_signature instanceof Uint8Array || typeof o.extension_signature === "string")); + }, + 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: DeepPartial): 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() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedCommitSig.typeUrl, ExtendedCommitSig); +function createBaseProposal(): Proposal { + return { + type: 0, + height: BigInt(0), + round: 0, + polRound: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const Proposal = { + typeUrl: "/tendermint.types.Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.polRound === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.pol_round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(58).bytes(message.signature); + } + 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.type = (reader.int32() as any); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + 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.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + 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); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.pol_round = message.polRound === 0 ? undefined : message.polRound; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/tendermint.types.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +function createBaseSignedHeader(): SignedHeader { + return { + header: undefined, + commit: undefined + }; +} +export const SignedHeader = { + typeUrl: "/tendermint.types.SignedHeader", + is(o: any): o is SignedHeader { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + isAmino(o: any): o is SignedHeaderAmino { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SignedHeader { + const message = createBaseSignedHeader(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? Commit.fromPartial(object.commit) : undefined; + return message; + }, + fromAmino(object: SignedHeaderAmino): SignedHeader { + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; + }, + toAmino(message: SignedHeader): SignedHeaderAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.commit = message.commit ? Commit.toAmino(message.commit) : undefined; + return obj; + }, + fromAminoMsg(object: SignedHeaderAminoMsg): SignedHeader { + return SignedHeader.fromAmino(object.value); + }, + fromProtoMsg(message: SignedHeaderProtoMsg): SignedHeader { + return SignedHeader.decode(message.value); + }, + toProto(message: SignedHeader): Uint8Array { + return SignedHeader.encode(message).finish(); + }, + toProtoMsg(message: SignedHeader): SignedHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.SignedHeader", + value: SignedHeader.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignedHeader.typeUrl, SignedHeader); +function createBaseLightBlock(): LightBlock { + return { + signedHeader: undefined, + validatorSet: undefined + }; +} +export const LightBlock = { + typeUrl: "/tendermint.types.LightBlock", + is(o: any): o is LightBlock { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + isAmino(o: any): o is LightBlockAmino { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; + message.validatorSet = object.validatorSet !== undefined && object.validatorSet !== null ? ValidatorSet.fromPartial(object.validatorSet) : undefined; + return message; + }, + fromAmino(object: LightBlockAmino): LightBlock { + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; + }, + toAmino(message: LightBlock): LightBlockAmino { + const obj: any = {}; + obj.signed_header = message.signedHeader ? SignedHeader.toAmino(message.signedHeader) : undefined; + obj.validator_set = message.validatorSet ? ValidatorSet.toAmino(message.validatorSet) : undefined; + return obj; + }, + fromAminoMsg(object: LightBlockAminoMsg): LightBlock { + return LightBlock.fromAmino(object.value); + }, + fromProtoMsg(message: LightBlockProtoMsg): LightBlock { + return LightBlock.decode(message.value); + }, + toProto(message: LightBlock): Uint8Array { + return LightBlock.encode(message).finish(); + }, + toProtoMsg(message: LightBlock): LightBlockProtoMsg { + return { + typeUrl: "/tendermint.types.LightBlock", + value: LightBlock.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LightBlock.typeUrl, LightBlock); +function createBaseBlockMeta(): BlockMeta { + return { + blockId: BlockID.fromPartial({}), + blockSize: BigInt(0), + header: Header.fromPartial({}), + numTxs: BigInt(0) + }; +} +export const BlockMeta = { + typeUrl: "/tendermint.types.BlockMeta", + is(o: any): o is BlockMeta { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.is(o.blockId) && typeof o.blockSize === "bigint" && Header.is(o.header) && typeof o.numTxs === "bigint"); + }, + isAmino(o: any): o is BlockMetaAmino { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.isAmino(o.block_id) && typeof o.block_size === "bigint" && Header.isAmino(o.header) && typeof o.num_txs === "bigint"); + }, + encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (message.blockSize !== BigInt(0)) { + writer.uint32(16).int64(message.blockSize); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + } + if (message.numTxs !== BigInt(0)) { + writer.uint32(32).int64(message.numTxs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockMeta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.blockSize = object.blockSize !== undefined && object.blockSize !== null ? BigInt(object.blockSize.toString()) : BigInt(0); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.numTxs = object.numTxs !== undefined && object.numTxs !== null ? BigInt(object.numTxs.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockMetaAmino): BlockMeta { + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; + }, + toAmino(message: BlockMeta): BlockMetaAmino { + const obj: any = {}; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block_size = message.blockSize !== BigInt(0) ? message.blockSize?.toString() : undefined; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.num_txs = message.numTxs !== BigInt(0) ? message.numTxs?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { + return BlockMeta.fromAmino(object.value); + }, + fromProtoMsg(message: BlockMetaProtoMsg): BlockMeta { + return BlockMeta.decode(message.value); + }, + toProto(message: BlockMeta): Uint8Array { + return BlockMeta.encode(message).finish(); + }, + toProtoMsg(message: BlockMeta): BlockMetaProtoMsg { + return { + typeUrl: "/tendermint.types.BlockMeta", + value: BlockMeta.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BlockMeta.typeUrl, BlockMeta); +function createBaseTxProof(): TxProof { + return { + rootHash: new Uint8Array(), + data: new Uint8Array(), + proof: undefined + }; +} +export const TxProof = { + typeUrl: "/tendermint.types.TxProof", + is(o: any): o is TxProof { + return o && (o.$typeUrl === TxProof.typeUrl || (o.rootHash instanceof Uint8Array || typeof o.rootHash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is TxProofAmino { + return o && (o.$typeUrl === TxProof.typeUrl || (o.root_hash instanceof Uint8Array || typeof o.root_hash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: TxProofAmino): TxProof { + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: TxProof): TxProofAmino { + const obj: any = {}; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: TxProofAminoMsg): TxProof { + return TxProof.fromAmino(object.value); + }, + fromProtoMsg(message: TxProofProtoMsg): TxProof { + return TxProof.decode(message.value); + }, + toProto(message: TxProof): Uint8Array { + return TxProof.encode(message).finish(); + }, + toProtoMsg(message: TxProof): TxProofProtoMsg { + return { + typeUrl: "/tendermint.types.TxProof", + value: TxProof.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxProof.typeUrl, TxProof); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/types/validator.ts b/libs/injectivejs/src/tendermint/types/validator.ts new file mode 100644 index 00000000..0c652786 --- /dev/null +++ b/libs/injectivejs/src/tendermint/types/validator.ts @@ -0,0 +1,389 @@ +import { PublicKey, PublicKeyAmino } from "../crypto/keys"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** 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 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; + totalVotingPower: bigint; +} +export interface ValidatorSetProtoMsg { + typeUrl: "/tendermint.types.ValidatorSet"; + value: Uint8Array; +} +export interface ValidatorSetAmino { + validators: ValidatorAmino[]; + proposer?: ValidatorAmino; + total_voting_power: string; +} +export interface ValidatorSetAminoMsg { + type: "/tendermint.types.ValidatorSet"; + value: ValidatorSetAmino; +} +export interface Validator { + address: Uint8Array; + pubKey: PublicKey; + votingPower: bigint; + proposerPriority: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.types.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + address: string; + pub_key: PublicKeyAmino; + voting_power: string; + proposer_priority: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.types.Validator"; + value: ValidatorAmino; +} +export interface SimpleValidator { + pubKey?: PublicKey; + votingPower: bigint; +} +export interface SimpleValidatorProtoMsg { + typeUrl: "/tendermint.types.SimpleValidator"; + value: Uint8Array; +} +export interface SimpleValidatorAmino { + pub_key?: PublicKeyAmino; + voting_power: string; +} +export interface SimpleValidatorAminoMsg { + type: "/tendermint.types.SimpleValidator"; + value: SimpleValidatorAmino; +} +function createBaseValidatorSet(): ValidatorSet { + return { + validators: [], + proposer: undefined, + totalVotingPower: BigInt(0) + }; +} +export const ValidatorSet = { + typeUrl: "/tendermint.types.ValidatorSet", + is(o: any): o is ValidatorSet { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])) && typeof o.totalVotingPower === "bigint"); + }, + isAmino(o: any): o is ValidatorSetAmino { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])) && typeof o.total_voting_power === "bigint"); + }, + encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.proposer = object.proposer !== undefined && object.proposer !== null ? Validator.fromPartial(object.proposer) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorSetAmino): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: ValidatorSet): ValidatorSetAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.proposer = message.proposer ? Validator.toAmino(message.proposer) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { + return ValidatorSet.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorSetProtoMsg): ValidatorSet { + return ValidatorSet.decode(message.value); + }, + toProto(message: ValidatorSet): Uint8Array { + return ValidatorSet.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSet): ValidatorSetProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorSet", + value: ValidatorSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorSet.typeUrl, ValidatorSet); +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + pubKey: PublicKey.fromPartial({}), + votingPower: BigInt(0), + proposerPriority: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.types.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.is(o.pubKey) && typeof o.votingPower === "bigint" && typeof o.proposerPriority === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.isAmino(o.pub_key) && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint"); + }, + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(24).int64(message.votingPower); + } + if (message.proposerPriority !== BigInt(0)) { + writer.uint32(32).int64(message.proposerPriority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower?.toString() : undefined; + obj.proposer_priority = message.proposerPriority !== BigInt(0) ? message.proposerPriority?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.Validator", + value: Validator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +function createBaseSimpleValidator(): SimpleValidator { + return { + pubKey: undefined, + votingPower: BigInt(0) + }; +} +export const SimpleValidator = { + typeUrl: "/tendermint.types.SimpleValidator", + is(o: any): o is SimpleValidator { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.votingPower === "bigint"); + }, + isAmino(o: any): o is SimpleValidatorAmino { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.voting_power === "bigint"); + }, + encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(16).int64(message.votingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimpleValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SimpleValidatorAmino): SimpleValidator { + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; + }, + toAmino(message: SimpleValidator): SimpleValidatorAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { + return SimpleValidator.fromAmino(object.value); + }, + fromProtoMsg(message: SimpleValidatorProtoMsg): SimpleValidator { + return SimpleValidator.decode(message.value); + }, + toProto(message: SimpleValidator): Uint8Array { + return SimpleValidator.encode(message).finish(); + }, + toProtoMsg(message: SimpleValidator): SimpleValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.SimpleValidator", + value: SimpleValidator.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SimpleValidator.typeUrl, SimpleValidator); \ No newline at end of file diff --git a/libs/injectivejs/src/tendermint/version/types.ts b/libs/injectivejs/src/tendermint/version/types.ts new file mode 100644 index 00000000..824f3644 --- /dev/null +++ b/libs/injectivejs/src/tendermint/version/types.ts @@ -0,0 +1,219 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { DeepPartial } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface App { + protocol: bigint; + software: string; +} +export interface AppProtoMsg { + typeUrl: "/tendermint.version.App"; + value: Uint8Array; +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppAmino { + protocol: string; + software: string; +} +export interface AppAminoMsg { + type: "/tendermint.version.App"; + value: AppAmino; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface Consensus { + block: bigint; + app: bigint; +} +export interface ConsensusProtoMsg { + typeUrl: "/tendermint.version.Consensus"; + value: Uint8Array; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusAmino { + block: string; + app: string; +} +export interface ConsensusAminoMsg { + type: "/tendermint.version.Consensus"; + value: ConsensusAmino; +} +function createBaseApp(): App { + return { + protocol: BigInt(0), + software: "" + }; +} +export const App = { + typeUrl: "/tendermint.version.App", + is(o: any): o is App { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + isAmino(o: any): o is AppAmino { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocol !== BigInt(0)) { + writer.uint32(8).uint64(message.protocol); + } + if (message.software !== "") { + writer.uint32(18).string(message.software); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): App { + const message = createBaseApp(); + message.protocol = object.protocol !== undefined && object.protocol !== null ? BigInt(object.protocol.toString()) : BigInt(0); + message.software = object.software ?? ""; + return message; + }, + fromAmino(object: AppAmino): App { + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; + }, + toAmino(message: App): AppAmino { + const obj: any = {}; + obj.protocol = message.protocol !== BigInt(0) ? message.protocol?.toString() : undefined; + obj.software = message.software === "" ? undefined : message.software; + return obj; + }, + fromAminoMsg(object: AppAminoMsg): App { + return App.fromAmino(object.value); + }, + fromProtoMsg(message: AppProtoMsg): App { + return App.decode(message.value); + }, + toProto(message: App): Uint8Array { + return App.encode(message).finish(); + }, + toProtoMsg(message: App): AppProtoMsg { + return { + typeUrl: "/tendermint.version.App", + value: App.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(App.typeUrl, App); +function createBaseConsensus(): Consensus { + return { + block: BigInt(0), + app: BigInt(0) + }; +} +export const Consensus = { + typeUrl: "/tendermint.version.Consensus", + is(o: any): o is Consensus { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isAmino(o: any): o is ConsensusAmino { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== BigInt(0)) { + writer.uint32(8).uint64(message.block); + } + if (message.app !== BigInt(0)) { + writer.uint32(16).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Consensus { + const message = createBaseConsensus(); + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusAmino): Consensus { + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: Consensus): ConsensusAmino { + const obj: any = {}; + obj.block = message.block !== BigInt(0) ? message.block?.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusAminoMsg): Consensus { + return Consensus.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusProtoMsg): Consensus { + return Consensus.decode(message.value); + }, + toProto(message: Consensus): Uint8Array { + return Consensus.encode(message).finish(); + }, + toProtoMsg(message: Consensus): ConsensusProtoMsg { + return { + typeUrl: "/tendermint.version.Consensus", + value: Consensus.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Consensus.typeUrl, Consensus); \ No newline at end of file diff --git a/libs/injectivejs/src/types.ts b/libs/injectivejs/src/types.ts new file mode 100644 index 00000000..a91926e7 --- /dev/null +++ b/libs/injectivejs/src/types.ts @@ -0,0 +1,155 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + +import { IBinaryReader, IBinaryWriter } from "./binary"; +import { Any } from "./google/protobuf/any"; +import { OfflineSigner } from "@interchainjs/cosmos/types/wallet"; +import { HttpEndpoint } from "@interchainjs/types"; + +export type ProtoMsg = Omit & { typeUrl: any }; + +export interface IAminoMsg { + type: any; + value: Amino; +} + +export interface IProtoType { + $typeUrl?: any; +} + +/** + * A type generated by Telescope 1.0. + */ +export interface TelescopeGeneratedCodec< + T = unknown, + SDK = unknown, + Amino = unknown +> { + readonly typeUrl: string; + readonly aminoType?: string; + is?(o: unknown): o is T; + isSDK?(o: unknown): o is SDK; + isAmino?(o: unknown): o is Amino; + encode: (message: T, writer?: IBinaryWriter | any) => IBinaryWriter | any; + decode: (input: IBinaryReader | Uint8Array | any, length?: number) => T; + fromPartial: (object: any) => T | any; + fromJSON?: (object: any) => T | any; + toJSON?: (message: T | any) => any; + fromSDK?: (sdk: SDK) => T; + fromSDKJSON?: (object: any) => SDK; + toSDK?: (message: T) => SDK; + fromAmino?: (amino: Amino) => T; + toAmino?: (message: T) => Amino; + fromAminoMsg?: (aminoMsg: IAminoMsg) => T; + toAminoMsg?: (message: T) => IAminoMsg; + toProto?: (message: T) => Uint8Array; + fromProtoMsg?: (message: ProtoMsg) => T; + toProtoMsg?: (message: T) => Any; +} + +export type TelescopeGeneratedType< + T = unknown, + SDK = unknown, + Amino = unknown +> = TelescopeGeneratedCodec; + +export type GeneratedType = TelescopeGeneratedCodec; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +export type EncodeObject = Message; + +export interface Message { + typeUrl: string; + value: T; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface TxRpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; + signAndBroadcast?( + signerAddress: string, + messages: EncodeObject[], + fee: StdFee | "auto" | number, + memo: string + ): Promise; +} + +export interface SigningClientParams { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +} diff --git a/libs/injectivejs/src/utf8.ts b/libs/injectivejs/src/utf8.ts new file mode 100644 index 00000000..4d16a562 --- /dev/null +++ b/libs/injectivejs/src/utf8.ts @@ -0,0 +1,148 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// 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 its author, 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. + +"use strict"; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start; + if (len < 1) return ""; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/libs/injectivejs/src/varint.ts b/libs/injectivejs/src/varint.ts new file mode 100644 index 00000000..9df34fb2 --- /dev/null +++ b/libs/injectivejs/src/varint.ts @@ -0,0 +1,488 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright 2008 Google Inc. All rights reserved. +// +// 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. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error("invalid varint"); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error("invalid varint"); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ); +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; +} diff --git a/libs/injectivejs/tsconfig.esm.json b/libs/injectivejs/tsconfig.esm.json new file mode 100644 index 00000000..800d7506 --- /dev/null +++ b/libs/injectivejs/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "es2022", + "rootDir": "src/", + "declaration": false + } +} diff --git a/libs/injectivejs/tsconfig.json b/libs/injectivejs/tsconfig.json new file mode 100644 index 00000000..1a9d5696 --- /dev/null +++ b/libs/injectivejs/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src/" + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"] +} diff --git a/libs/interchain-query/package.json b/libs/interchain-query/package.json index 599ce8a9..433d0603 100644 --- a/libs/interchain-query/package.json +++ b/libs/interchain-query/package.json @@ -22,13 +22,6 @@ "build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy", "build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy", "lint": "eslint . --fix", - "starship": "starship --config ./starship/configs/config.yaml", - "starship:local": "starship --config ./starship/configs/config.local.yaml", - "starship:test": "jest --config ./jest.starship.config.js --verbose --bail", - "starship:debug": "jest --config ./jest.starship.config.js --runInBand --verbose --bail", - "starship:watch": "jest --watch --config ./jest.starship.config.js", - "starship:all": "yarn starship start", - "starship:clean": "yarn starship stop", "prepare": "npm run build" }, "dependencies": { diff --git a/libs/interchainjs/src/binary.ts b/libs/interchainjs/src/binary.ts index 32ed676e..1f9d1f8c 100644 --- a/libs/interchainjs/src/binary.ts +++ b/libs/interchainjs/src/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/cosmos/auth/v1beta1/query.ts b/libs/interchainjs/src/cosmos/auth/v1beta1/query.ts index 92299eea..13eb3d8e 100644 --- a/libs/interchainjs/src/cosmos/auth/v1beta1/query.ts +++ b/libs/interchainjs/src/cosmos/auth/v1beta1/query.ts @@ -1,6 +1,7 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "../../base/query/v1beta1/pagination"; import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any"; import { Params, ParamsAmino, BaseAccount, BaseAccountProtoMsg, BaseAccountAmino, ModuleAccount, ModuleAccountProtoMsg } from "./auth"; +import { EthAccount, EthAccountProtoMsg } from "../../../injective/types/v1beta1/account"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; @@ -37,7 +38,7 @@ export interface QueryAccountsRequestAminoMsg { */ export interface QueryAccountsResponse { /** accounts are the existing accounts */ - accounts: (BaseAccount | Any)[] | Any[]; + accounts: (BaseAccount | EthAccount | Any)[] | Any[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; } @@ -46,7 +47,7 @@ export interface QueryAccountsResponseProtoMsg { value: Uint8Array; } export type QueryAccountsResponseEncoded = Omit & { - /** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | AnyProtoMsg)[]; + /** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg)[]; }; /** * QueryAccountsResponse is the response type for the Query/Accounts RPC method. @@ -84,14 +85,14 @@ export interface QueryAccountRequestAminoMsg { /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponse { /** account defines the account of the corresponding address. */ - account?: BaseAccount | Any | undefined; + account?: BaseAccount | EthAccount | Any | undefined; } export interface QueryAccountResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; value: Uint8Array; } export type QueryAccountResponseEncoded = Omit & { - /** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | AnyProtoMsg | undefined; + /** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | EthAccountProtoMsg | AnyProtoMsg | undefined; }; /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponseAmino { @@ -570,10 +571,10 @@ export const QueryAccountsResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", aminoType: "cosmos-sdk/QueryAccountsResponse", is(o: any): o is QueryAccountsResponse { - return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.is(o.accounts[0]) || EthAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); }, isAmino(o: any): o is QueryAccountsResponseAmino { - return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isAmino(o.accounts[0]) || EthAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); }, encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { diff --git a/libs/interchainjs/src/cosmos/gov/v1/tx.ts b/libs/interchainjs/src/cosmos/gov/v1/tx.ts index f9003793..d74ae580 100644 --- a/libs/interchainjs/src/cosmos/gov/v1/tx.ts +++ b/libs/interchainjs/src/cosmos/gov/v1/tx.ts @@ -5,7 +5,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; import { TextProposal, TextProposalProtoMsg } from "../v1beta1/gov"; import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; -import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, UpgradeProposal, UpgradeProposalProtoMsg } from "../../../ibc/core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; @@ -105,7 +104,7 @@ export interface MsgSubmitProposalResponseAminoMsg { */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ - content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined; /** authority must be the gov module address. */ authority: string; } @@ -114,7 +113,7 @@ export interface MsgExecLegacyContentProtoMsg { value: Uint8Array; } export type MsgExecLegacyContentEncoded = Omit & { - /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. diff --git a/libs/interchainjs/src/cosmos/gov/v1beta1/gov.ts b/libs/interchainjs/src/cosmos/gov/v1beta1/gov.ts index f0bc1a0e..1877915d 100644 --- a/libs/interchainjs/src/cosmos/gov/v1beta1/gov.ts +++ b/libs/interchainjs/src/cosmos/gov/v1beta1/gov.ts @@ -4,7 +4,6 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino } from "../../../google/protobuf/duration"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; -import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, UpgradeProposal, UpgradeProposalProtoMsg } from "../../../ibc/core/client/v1/client"; import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; @@ -235,7 +234,7 @@ export interface Proposal { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** content is the proposal's content. */ - content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined; /** status defines the proposal status. */ status: ProposalStatus; /** @@ -260,7 +259,7 @@ export interface ProposalProtoMsg { value: Uint8Array; } export type ProposalEncoded = Omit & { - /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined; }; /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { diff --git a/libs/interchainjs/src/cosmos/gov/v1beta1/tx.ts b/libs/interchainjs/src/cosmos/gov/v1beta1/tx.ts index df28a21e..778766a5 100644 --- a/libs/interchainjs/src/cosmos/gov/v1beta1/tx.ts +++ b/libs/interchainjs/src/cosmos/gov/v1beta1/tx.ts @@ -3,7 +3,6 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, TextProposal, TextProposalProtoMsg } from "./gov"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution"; import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade"; -import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, UpgradeProposal, UpgradeProposalProtoMsg } from "../../../ibc/core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { DeepPartial, isSet } from "../../../helpers"; import { GlobalDecoderRegistry } from "../../../registry"; @@ -13,7 +12,7 @@ import { GlobalDecoderRegistry } from "../../../registry"; */ export interface MsgSubmitProposal { /** content is the proposal's content. */ - content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined; /** initial_deposit is the deposit value that must be paid at proposal submission. */ initialDeposit: Coin[]; /** proposer is the account address of the proposer. */ @@ -24,7 +23,7 @@ export interface MsgSubmitProposalProtoMsg { value: Uint8Array; } export type MsgSubmitProposalEncoded = Omit & { - /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary diff --git a/libs/interchainjs/src/cosmos/ics23/v1/proofs.ts b/libs/interchainjs/src/cosmos/ics23/v1/proofs.ts index c36d57da..27759bde 100644 --- a/libs/interchainjs/src/cosmos/ics23/v1/proofs.ts +++ b/libs/interchainjs/src/cosmos/ics23/v1/proofs.ts @@ -417,7 +417,10 @@ export interface ProofSpec { */ leafSpec?: LeafOp; innerSpec?: InnerSpec; - /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + /** + * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + * the max_depth is interpreted as 128 if set to 0 + */ maxDepth: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ minDepth: number; @@ -451,7 +454,10 @@ export interface ProofSpecAmino { */ leaf_spec?: LeafOpAmino; inner_spec?: InnerSpecAmino; - /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + /** + * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + * the max_depth is interpreted as 128 if set to 0 + */ max_depth: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ min_depth: number; @@ -485,6 +491,7 @@ export interface InnerSpec { childOrder: number[]; childSize: number; minPrefixLength: number; + /** the max prefix length must be less than the minimum prefix length + child size */ maxPrefixLength: number; /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ emptyChild: Uint8Array; @@ -514,6 +521,7 @@ export interface InnerSpecAmino { child_order: number[]; child_size: number; min_prefix_length: number; + /** the max prefix length must be less than the minimum prefix length + child size */ 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; diff --git a/libs/interchainjs/src/cosmwasm/wasm/v1/query.rpc.func.ts b/libs/interchainjs/src/cosmwasm/wasm/v1/query.rpc.func.ts index eed9fbf1..8a0c89f5 100644 --- a/libs/interchainjs/src/cosmwasm/wasm/v1/query.rpc.func.ts +++ b/libs/interchainjs/src/cosmwasm/wasm/v1/query.rpc.func.ts @@ -1,5 +1,5 @@ import { RpcResolver, buildQuery } from "../../../helper-func-types"; -import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryCodeInfoRequest, QueryCodeInfoResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryWasmLimitsConfigRequest, QueryWasmLimitsConfigResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; export const createGetContractInfo = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryContractInfoRequest.encode, decode: QueryContractInfoResponse.decode, @@ -56,6 +56,13 @@ export const createGetCodes = (clientResolver?: RpcResolver) => buildQuery buildQuery({ + encode: QueryCodeInfoRequest.encode, + decode: QueryCodeInfoResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "CodeInfo", + clientResolver +}); export const createGetPinnedCodes = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryPinnedCodesRequest.encode, decode: QueryPinnedCodesResponse.decode, @@ -77,6 +84,13 @@ export const createGetContractsByCreator = (clientResolver?: RpcResolver) => bui method: "ContractsByCreator", clientResolver }); +export const createGetWasmLimitsConfig = (clientResolver?: RpcResolver) => buildQuery({ + encode: QueryWasmLimitsConfigRequest.encode, + decode: QueryWasmLimitsConfigResponse.decode, + service: "cosmwasm.wasm.v1.Query", + method: "WasmLimitsConfig", + clientResolver +}); export const createGetBuildAddress = (clientResolver?: RpcResolver) => buildQuery({ encode: QueryBuildAddressRequest.encode, decode: QueryBuildAddressResponse.decode, diff --git a/libs/interchainjs/src/cosmwasm/wasm/v1/query.ts b/libs/interchainjs/src/cosmwasm/wasm/v1/query.ts index 3c8b6575..cd8c0b8e 100644 --- a/libs/interchainjs/src/cosmwasm/wasm/v1/query.ts +++ b/libs/interchainjs/src/cosmwasm/wasm/v1/query.ts @@ -113,7 +113,7 @@ export interface QueryContractHistoryResponseAminoMsg { * RPC method */ export interface QueryContractsByCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ + /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; @@ -127,7 +127,7 @@ export interface QueryContractsByCodeRequestProtoMsg { * RPC method */ export interface QueryContractsByCodeRequestAmino { - /** grpc-gateway_out does not support Go style CodID */ + /** grpc-gateway_out does not support Go style CodeID */ code_id: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; @@ -322,7 +322,7 @@ export interface QuerySmartContractStateResponseAminoMsg { } /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequest { - /** grpc-gateway_out does not support Go style CodID */ + /** grpc-gateway_out does not support Go style CodeID */ codeId: bigint; } export interface QueryCodeRequestProtoMsg { @@ -331,13 +331,53 @@ export interface QueryCodeRequestProtoMsg { } /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequestAmino { - /** grpc-gateway_out does not support Go style CodID */ + /** grpc-gateway_out does not support Go style CodeID */ code_id: string; } export interface QueryCodeRequestAminoMsg { type: "wasm/QueryCodeRequest"; value: QueryCodeRequestAmino; } +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequest { + /** grpc-gateway_out does not support Go style CodeID */ + codeId: bigint; +} +export interface QueryCodeInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest"; + value: Uint8Array; +} +/** QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoRequestAmino { + /** grpc-gateway_out does not support Go style CodeID */ + code_id: string; +} +export interface QueryCodeInfoRequestAminoMsg { + type: "wasm/QueryCodeInfoRequest"; + value: QueryCodeInfoRequestAmino; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponse { + codeId: bigint; + creator: string; + checksum: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface QueryCodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse"; + value: Uint8Array; +} +/** QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method */ +export interface QueryCodeInfoResponseAmino { + code_id: string; + creator: string; + checksum: string; + instantiate_permission: AccessConfigAmino; +} +export interface QueryCodeInfoResponseAminoMsg { + type: "wasm/QueryCodeInfoResponse"; + value: QueryCodeInfoResponseAmino; +} /** CodeInfoResponse contains code meta data from CodeInfo */ export interface CodeInfoResponse { codeId: bigint; @@ -552,6 +592,48 @@ export interface QueryContractsByCreatorResponseAminoMsg { type: "wasm/QueryContractsByCreatorResponse"; value: QueryContractsByCreatorResponseAmino; } +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequest {} +export interface QueryWasmLimitsConfigRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigRequest is the request type for the + * Query/WasmLimitsConfig RPC method. + */ +export interface QueryWasmLimitsConfigRequestAmino {} +export interface QueryWasmLimitsConfigRequestAminoMsg { + type: "wasm/QueryWasmLimitsConfigRequest"; + value: QueryWasmLimitsConfigRequestAmino; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponse { + config: string; +} +export interface QueryWasmLimitsConfigResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse"; + value: Uint8Array; +} +/** + * QueryWasmLimitsConfigResponse is the response type for the + * Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for + * static validation of Wasm files. + */ +export interface QueryWasmLimitsConfigResponseAmino { + config: string; +} +export interface QueryWasmLimitsConfigResponseAminoMsg { + type: "wasm/QueryWasmLimitsConfigResponse"; + value: QueryWasmLimitsConfigResponseAmino; +} /** * QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC * method. @@ -1746,6 +1828,198 @@ export const QueryCodeRequest = { }; GlobalDecoderRegistry.register(QueryCodeRequest.typeUrl, QueryCodeRequest); GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeRequest.aminoType, QueryCodeRequest.typeUrl); +function createBaseQueryCodeInfoRequest(): QueryCodeInfoRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + aminoType: "wasm/QueryCodeInfoRequest", + is(o: any): o is QueryCodeInfoRequest { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isAmino(o: any): o is QueryCodeInfoRequestAmino { + return o && (o.$typeUrl === QueryCodeInfoRequest.typeUrl || typeof o.code_id === "bigint"); + }, + encode(message: QueryCodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeInfoRequestAmino): QueryCodeInfoRequest { + const message = createBaseQueryCodeInfoRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeInfoRequest): QueryCodeInfoRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeInfoRequestAminoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestAminoMsg { + return { + type: "wasm/QueryCodeInfoRequest", + value: QueryCodeInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoRequestProtoMsg): QueryCodeInfoRequest { + return QueryCodeInfoRequest.decode(message.value); + }, + toProto(message: QueryCodeInfoRequest): Uint8Array { + return QueryCodeInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoRequest): QueryCodeInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoRequest", + value: QueryCodeInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoRequest.typeUrl, QueryCodeInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoRequest.aminoType, QueryCodeInfoRequest.typeUrl); +function createBaseQueryCodeInfoResponse(): QueryCodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + checksum: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const QueryCodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + aminoType: "wasm/QueryCodeInfoResponse", + is(o: any): o is QueryCodeInfoResponse { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isAmino(o: any): o is QueryCodeInfoResponseAmino { + return o && (o.$typeUrl === QueryCodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, + encode(message: QueryCodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: QueryCodeInfoResponseAmino): QueryCodeInfoResponse { + const message = createBaseQueryCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: QueryCodeInfoResponse): QueryCodeInfoResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId?.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryCodeInfoResponseAminoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseAminoMsg { + return { + type: "wasm/QueryCodeInfoResponse", + value: QueryCodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeInfoResponseProtoMsg): QueryCodeInfoResponse { + return QueryCodeInfoResponse.decode(message.value); + }, + toProto(message: QueryCodeInfoResponse): Uint8Array { + return QueryCodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeInfoResponse): QueryCodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeInfoResponse", + value: QueryCodeInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeInfoResponse.typeUrl, QueryCodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeInfoResponse.aminoType, QueryCodeInfoResponse.typeUrl); function createBaseCodeInfoResponse(): CodeInfoResponse { return { codeId: BigInt(0), @@ -2624,6 +2898,149 @@ export const QueryContractsByCreatorResponse = { }; GlobalDecoderRegistry.register(QueryContractsByCreatorResponse.typeUrl, QueryContractsByCreatorResponse); GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorResponse.aminoType, QueryContractsByCreatorResponse.typeUrl); +function createBaseQueryWasmLimitsConfigRequest(): QueryWasmLimitsConfigRequest { + return {}; +} +export const QueryWasmLimitsConfigRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + aminoType: "wasm/QueryWasmLimitsConfigRequest", + is(o: any): o is QueryWasmLimitsConfigRequest { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + isAmino(o: any): o is QueryWasmLimitsConfigRequestAmino { + return o && o.$typeUrl === QueryWasmLimitsConfigRequest.typeUrl; + }, + encode(_: QueryWasmLimitsConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: DeepPartial): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + fromAmino(_: QueryWasmLimitsConfigRequestAmino): QueryWasmLimitsConfigRequest { + const message = createBaseQueryWasmLimitsConfigRequest(); + return message; + }, + toAmino(_: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigRequestAminoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigRequestProtoMsg): QueryWasmLimitsConfigRequest { + return QueryWasmLimitsConfigRequest.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigRequest): Uint8Array { + return QueryWasmLimitsConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigRequest): QueryWasmLimitsConfigRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigRequest", + value: QueryWasmLimitsConfigRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigRequest.typeUrl, QueryWasmLimitsConfigRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigRequest.aminoType, QueryWasmLimitsConfigRequest.typeUrl); +function createBaseQueryWasmLimitsConfigResponse(): QueryWasmLimitsConfigResponse { + return { + config: "" + }; +} +export const QueryWasmLimitsConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + aminoType: "wasm/QueryWasmLimitsConfigResponse", + is(o: any): o is QueryWasmLimitsConfigResponse { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + isAmino(o: any): o is QueryWasmLimitsConfigResponseAmino { + return o && (o.$typeUrl === QueryWasmLimitsConfigResponse.typeUrl || typeof o.config === "string"); + }, + encode(message: QueryWasmLimitsConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.config !== "") { + writer.uint32(10).string(message.config); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryWasmLimitsConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryWasmLimitsConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + message.config = object.config ?? ""; + return message; + }, + fromAmino(object: QueryWasmLimitsConfigResponseAmino): QueryWasmLimitsConfigResponse { + const message = createBaseQueryWasmLimitsConfigResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = object.config; + } + return message; + }, + toAmino(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAmino { + const obj: any = {}; + obj.config = message.config === "" ? undefined : message.config; + return obj; + }, + fromAminoMsg(object: QueryWasmLimitsConfigResponseAminoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseAminoMsg { + return { + type: "wasm/QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryWasmLimitsConfigResponseProtoMsg): QueryWasmLimitsConfigResponse { + return QueryWasmLimitsConfigResponse.decode(message.value); + }, + toProto(message: QueryWasmLimitsConfigResponse): Uint8Array { + return QueryWasmLimitsConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryWasmLimitsConfigResponse): QueryWasmLimitsConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryWasmLimitsConfigResponse", + value: QueryWasmLimitsConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryWasmLimitsConfigResponse.typeUrl, QueryWasmLimitsConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryWasmLimitsConfigResponse.aminoType, QueryWasmLimitsConfigResponse.typeUrl); function createBaseQueryBuildAddressRequest(): QueryBuildAddressRequest { return { codeHash: "", diff --git a/libs/interchainjs/src/cosmwasm/wasm/v1/tx.ts b/libs/interchainjs/src/cosmwasm/wasm/v1/tx.ts index 78d085b9..c97c9907 100644 --- a/libs/interchainjs/src/cosmwasm/wasm/v1/tx.ts +++ b/libs/interchainjs/src/cosmwasm/wasm/v1/tx.ts @@ -126,7 +126,7 @@ export interface MsgInstantiateContractResponseAminoMsg { } /** * 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 +155,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 */ @@ -662,7 +662,7 @@ export interface MsgStoreAndInstantiateContract { 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 is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ msg: Uint8Array; @@ -708,7 +708,7 @@ export interface MsgStoreAndInstantiateContractAmino { 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 is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ msg: any; diff --git a/libs/interchainjs/src/extern.ts b/libs/interchainjs/src/extern.ts index 98523711..dd4c7d6e 100644 --- a/libs/interchainjs/src/extern.ts +++ b/libs/interchainjs/src/extern.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/google/api/http.ts b/libs/interchainjs/src/google/api/http.ts index d990263c..3fd3a11b 100644 --- a/libs/interchainjs/src/google/api/http.ts +++ b/libs/interchainjs/src/google/api/http.ts @@ -54,7 +54,7 @@ export interface HttpAminoMsg { value: HttpAmino; } /** - * # gRPC Transcoding + * gRPC Transcoding * * gRPC Transcoding is a feature for mapping between a gRPC method and one or * more HTTP REST endpoints. It allows developers to build a single API service @@ -95,9 +95,8 @@ export interface HttpAminoMsg { * * This enables an HTTP REST to gRPC mapping as below: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` * * Any fields in the request message which are not bound by the path template * automatically become HTTP query parameters if there is no HTTP request body. @@ -121,11 +120,9 @@ export interface HttpAminoMsg { * * This enables a HTTP JSON to RPC mapping as below: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: - * "foo"))` + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` * * Note that fields which are mapped to URL query parameters must have a * primitive type or a repeated primitive type or a non-repeated message type. @@ -155,10 +152,8 @@ export interface HttpAminoMsg { * representation of the JSON in the request body is determined by * protos JSON encoding: * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" message { text: "Hi!" })` + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` * * The special name `*` can be used in the body mapping to define that * every field not bound by the path template should be mapped to the @@ -181,10 +176,8 @@ export interface HttpAminoMsg { * * The following HTTP JSON to RPC mapping is enabled: * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` * * Note that when using `*` in the body mapping, it is not possible to * have HTTP parameters, as all fields not bound by the path end in @@ -212,13 +205,13 @@ export interface HttpAminoMsg { * * This enables the following two alternative HTTP JSON to RPC mappings: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: - * "123456")` + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` * - * ## Rules for HTTP mapping + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping * * 1. Leaf request fields (recursive expansion nested messages in the request * message) are classified into three categories: @@ -237,7 +230,7 @@ export interface HttpAminoMsg { * request body, all * fields are passed via URL path and URL query parameters. * - * ### Path template syntax + * Path template syntax * * Template = "/" Segments [ Verb ] ; * Segments = Segment { "/" Segment } ; @@ -276,7 +269,7 @@ export interface HttpAminoMsg { * Document](https://developers.google.com/discovery/v1/reference/apis) as * `{+var}`. * - * ## Using gRPC API Service Configuration + * Using gRPC API Service Configuration * * gRPC API Service Configuration (service config) is a configuration language * for configuring a gRPC service to become a user-facing product. The @@ -291,15 +284,14 @@ export interface HttpAminoMsg { * specified in the service config will override any matching transcoding * configuration in the proto. * - * Example: + * The following example selects a gRPC method and applies an `HttpRule` to it: * * http: * rules: - * # Selects a gRPC method and applies HttpRule to it. * - selector: example.v1.Messaging.GetMessage * get: /v1/messages/{message_id}/{sub.subfield} * - * ## Special notes + * Special notes * * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the * proto to JSON conversion must follow the [proto3 @@ -385,7 +377,7 @@ export interface HttpRuleProtoMsg { value: Uint8Array; } /** - * # gRPC Transcoding + * gRPC Transcoding * * gRPC Transcoding is a feature for mapping between a gRPC method and one or * more HTTP REST endpoints. It allows developers to build a single API service @@ -426,9 +418,8 @@ export interface HttpRuleProtoMsg { * * This enables an HTTP REST to gRPC mapping as below: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` * * Any fields in the request message which are not bound by the path template * automatically become HTTP query parameters if there is no HTTP request body. @@ -452,11 +443,9 @@ export interface HttpRuleProtoMsg { * * This enables a HTTP JSON to RPC mapping as below: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: - * "foo"))` + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` * * Note that fields which are mapped to URL query parameters must have a * primitive type or a repeated primitive type or a non-repeated message type. @@ -486,10 +475,8 @@ export interface HttpRuleProtoMsg { * representation of the JSON in the request body is determined by * protos JSON encoding: * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" message { text: "Hi!" })` + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` * * The special name `*` can be used in the body mapping to define that * every field not bound by the path template should be mapped to the @@ -512,10 +499,8 @@ export interface HttpRuleProtoMsg { * * The following HTTP JSON to RPC mapping is enabled: * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` * * Note that when using `*` in the body mapping, it is not possible to * have HTTP parameters, as all fields not bound by the path end in @@ -543,13 +528,13 @@ export interface HttpRuleProtoMsg { * * This enables the following two alternative HTTP JSON to RPC mappings: * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: - * "123456")` + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` * - * ## Rules for HTTP mapping + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping * * 1. Leaf request fields (recursive expansion nested messages in the request * message) are classified into three categories: @@ -568,7 +553,7 @@ export interface HttpRuleProtoMsg { * request body, all * fields are passed via URL path and URL query parameters. * - * ### Path template syntax + * Path template syntax * * Template = "/" Segments [ Verb ] ; * Segments = Segment { "/" Segment } ; @@ -607,7 +592,7 @@ export interface HttpRuleProtoMsg { * Document](https://developers.google.com/discovery/v1/reference/apis) as * `{+var}`. * - * ## Using gRPC API Service Configuration + * Using gRPC API Service Configuration * * gRPC API Service Configuration (service config) is a configuration language * for configuring a gRPC service to become a user-facing product. The @@ -622,15 +607,14 @@ export interface HttpRuleProtoMsg { * specified in the service config will override any matching transcoding * configuration in the proto. * - * Example: + * The following example selects a gRPC method and applies an `HttpRule` to it: * * http: * rules: - * # Selects a gRPC method and applies HttpRule to it. * - selector: example.v1.Messaging.GetMessage * get: /v1/messages/{message_id}/{sub.subfield} * - * ## Special notes + * Special notes * * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the * proto to JSON conversion must follow the [proto3 diff --git a/libs/interchainjs/src/google/protobuf/descriptor.ts b/libs/interchainjs/src/google/protobuf/descriptor.ts index 48e84349..53b60923 100644 --- a/libs/interchainjs/src/google/protobuf/descriptor.ts +++ b/libs/interchainjs/src/google/protobuf/descriptor.ts @@ -27,7 +27,7 @@ export enum Edition { EDITION_2024 = 1001, /** * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be - * used or relyed on outside of tests. + * used or relied on outside of tests. */ EDITION_1_TEST_ONLY = 1, EDITION_2_TEST_ONLY = 2, @@ -471,11 +471,7 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "UNRECOGNIZED"; } } -/** - * If set to RETENTION_SOURCE, the option will be omitted from the binary. - * Note: as of January 2023, support for this is in progress and does not yet - * have an effect (b/264593489). - */ +/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ export enum FieldOptions_OptionRetention { RETENTION_UNKNOWN = 0, RETENTION_RUNTIME = 1, @@ -516,8 +512,7 @@ export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRe /** * This indicates the types of entities that the field may apply to when used * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. Note: as of January 2023, support for this is - * in progress and does not yet have an effect (b/264593489). + * option on any kind of entity. */ export enum FieldOptions_OptionTargetType { TARGET_TYPE_UNKNOWN = 0, @@ -969,9 +964,17 @@ export interface FileDescriptorProto { * The supported values are "proto2", "proto3", and "editions". * * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. */ syntax: string; - /** The edition of the proto file. */ + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ edition: Edition; } export interface FileDescriptorProtoProtoMsg { @@ -1011,9 +1014,17 @@ export interface FileDescriptorProtoAmino { * The supported values are "proto2", "proto3", and "editions". * * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. */ syntax: string; - /** The edition of the proto file. */ + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ edition: Edition; } export interface FileDescriptorProtoAminoMsg { @@ -1650,7 +1661,12 @@ export interface FileOptions { * determining the ruby package. */ rubyPackage: string; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. @@ -1776,7 +1792,12 @@ export interface FileOptionsAmino { * determining the ruby package. */ ruby_package: string; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** * The parser stores options it doesn't recognize here. @@ -1861,7 +1882,12 @@ export interface MessageOptions { */ /** @deprecated */ deprecatedLegacyJsonFieldConflicts: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -1943,7 +1969,12 @@ export interface MessageOptionsAmino { */ /** @deprecated */ deprecated_legacy_json_field_conflicts: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionAmino[]; @@ -1954,12 +1985,13 @@ export interface MessageOptionsAminoMsg { } export interface FieldOptions { /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * 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 only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - * type "bytes" in the open source release -- sorry, we'll try to include - * other types in a future version! + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. */ ctype: FieldOptions_CType; /** @@ -2034,7 +2066,12 @@ export interface FieldOptions { retention: FieldOptions_OptionRetention; targets: FieldOptions_OptionTargetType[]; editionDefaults: FieldOptions_EditionDefault[]; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; featureSupport?: FieldOptions_FeatureSupport; /** The parser stores options it doesn't recognize here. See above. */ @@ -2046,12 +2083,13 @@ export interface FieldOptionsProtoMsg { } export interface FieldOptionsAmino { /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * 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 only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - * type "bytes" in the open source release -- sorry, we'll try to include - * other types in a future version! + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. */ ctype: FieldOptions_CType; /** @@ -2126,7 +2164,12 @@ export interface FieldOptionsAmino { retention: FieldOptions_OptionRetention; targets: FieldOptions_OptionTargetType[]; edition_defaults: FieldOptions_EditionDefaultAmino[]; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; feature_support?: FieldOptions_FeatureSupportAmino; /** The parser stores options it doesn't recognize here. See above. */ @@ -2213,7 +2256,12 @@ export interface FieldOptions_FeatureSupportAminoMsg { value: FieldOptions_FeatureSupportAmino; } export interface OneofOptions { - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -2223,7 +2271,12 @@ export interface OneofOptionsProtoMsg { value: Uint8Array; } export interface OneofOptionsAmino { - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionAmino[]; @@ -2255,7 +2308,12 @@ export interface EnumOptions { */ /** @deprecated */ deprecatedLegacyJsonFieldConflicts: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -2287,7 +2345,12 @@ export interface EnumOptionsAmino { */ /** @deprecated */ deprecated_legacy_json_field_conflicts: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionAmino[]; @@ -2304,7 +2367,12 @@ export interface EnumValueOptions { * this is a formalization for deprecating enum values. */ deprecated: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** * Indicate that fields annotated with this enum value should not be printed @@ -2312,6 +2380,8 @@ export interface EnumValueOptions { * credentials. */ debugRedact: boolean; + /** Information about the support window of a feature value. */ + featureSupport?: FieldOptions_FeatureSupport; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -2327,7 +2397,12 @@ export interface EnumValueOptionsAmino { * this is a formalization for deprecating enum values. */ deprecated: boolean; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** * Indicate that fields annotated with this enum value should not be printed @@ -2335,6 +2410,8 @@ export interface EnumValueOptionsAmino { * credentials. */ debug_redact: boolean; + /** Information about the support window of a feature value. */ + feature_support?: FieldOptions_FeatureSupportAmino; /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionAmino[]; } @@ -2343,7 +2420,12 @@ export interface EnumValueOptionsAminoMsg { value: EnumValueOptionsAmino; } export interface ServiceOptions { - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** * Is this service deprecated? @@ -2360,7 +2442,12 @@ export interface ServiceOptionsProtoMsg { value: Uint8Array; } export interface ServiceOptionsAmino { - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** * Is this service deprecated? @@ -2385,7 +2472,12 @@ export interface MethodOptions { */ deprecated: boolean; idempotencyLevel: MethodOptions_IdempotencyLevel; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSet; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -2403,7 +2495,12 @@ export interface MethodOptionsAmino { */ deprecated: boolean; idempotency_level: MethodOptions_IdempotencyLevel; - /** Any features defined in the specific edition. */ + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + */ features?: FeatureSetAmino; /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionAmino[]; @@ -5798,6 +5895,7 @@ function createBaseEnumValueOptions(): EnumValueOptions { deprecated: false, features: undefined, debugRedact: false, + featureSupport: undefined, uninterpretedOption: [] }; } @@ -5819,6 +5917,9 @@ export const EnumValueOptions = { if (message.debugRedact === true) { writer.uint32(24).bool(message.debugRedact); } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).ldelim(); + } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -5840,6 +5941,9 @@ export const EnumValueOptions = { case 3: message.debugRedact = reader.bool(); break; + case 4: + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + break; case 999: message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; @@ -5855,6 +5959,7 @@ export const EnumValueOptions = { message.deprecated = object.deprecated ?? false; message.features = object.features !== undefined && object.features !== null ? FeatureSet.fromPartial(object.features) : undefined; message.debugRedact = object.debugRedact ?? false; + message.featureSupport = object.featureSupport !== undefined && object.featureSupport !== null ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) : undefined; message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -5869,6 +5974,9 @@ export const EnumValueOptions = { if (object.debug_redact !== undefined && object.debug_redact !== null) { message.debugRedact = object.debug_redact; } + if (object.feature_support !== undefined && object.feature_support !== null) { + message.featureSupport = FieldOptions_FeatureSupport.fromAmino(object.feature_support); + } message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; return message; }, @@ -5877,6 +5985,7 @@ export const EnumValueOptions = { obj.deprecated = message.deprecated === false ? undefined : message.deprecated; obj.features = message.features ? FeatureSet.toAmino(message.features) : undefined; obj.debug_redact = message.debugRedact === false ? undefined : message.debugRedact; + obj.feature_support = message.featureSupport ? FieldOptions_FeatureSupport.toAmino(message.featureSupport) : undefined; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { diff --git a/libs/interchainjs/src/helper-func-types.ts b/libs/interchainjs/src/helper-func-types.ts index 9d6c2167..89c4980f 100644 --- a/libs/interchainjs/src/helper-func-types.ts +++ b/libs/interchainjs/src/helper-func-types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/helpers.ts b/libs/interchainjs/src/helpers.ts index 3f7213c0..1179995a 100644 --- a/libs/interchainjs/src/helpers.ts +++ b/libs/interchainjs/src/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/ibc/applications/transfer/v1/transfer.ts b/libs/interchainjs/src/ibc/applications/transfer/v1/transfer.ts index 41a63af9..12d6526c 100644 --- a/libs/interchainjs/src/ibc/applications/transfer/v1/transfer.ts +++ b/libs/interchainjs/src/ibc/applications/transfer/v1/transfer.ts @@ -45,6 +45,60 @@ export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; value: ParamsAmino; } +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface Forwarding { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: Hop[]; +} +export interface ForwardingProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Forwarding"; + value: Uint8Array; +} +/** + * Forwarding defines a list of port ID, channel ID pairs determining the path + * through which a packet must be forwarded, and an unwind boolean indicating if + * the coin should be unwinded to its native chain before forwarding. + */ +export interface ForwardingAmino { + /** optional unwinding for the token transfered */ + unwind: boolean; + /** optional intermediate path through which packet will be forwarded */ + hops: HopAmino[]; +} +export interface ForwardingAminoMsg { + type: "cosmos-sdk/Forwarding"; + value: ForwardingAmino; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface Hop { + portId: string; + channelId: string; +} +export interface HopProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Hop"; + value: Uint8Array; +} +/** + * Hop defines a port ID, channel ID pair specifying where tokens must be forwarded + * next in a multihop transfer. + */ +export interface HopAmino { + port_id: string; + channel_id: string; +} +export interface HopAminoMsg { + type: "cosmos-sdk/Hop"; + value: HopAmino; +} function createBaseParams(): Params { return { sendEnabled: false, @@ -134,4 +188,186 @@ export const Params = { } }; GlobalDecoderRegistry.register(Params.typeUrl, Params); -GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseForwarding(): Forwarding { + return { + unwind: false, + hops: [] + }; +} +export const Forwarding = { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + aminoType: "cosmos-sdk/Forwarding", + is(o: any): o is Forwarding { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.is(o.hops[0]))); + }, + isAmino(o: any): o is ForwardingAmino { + return o && (o.$typeUrl === Forwarding.typeUrl || typeof o.unwind === "boolean" && Array.isArray(o.hops) && (!o.hops.length || Hop.isAmino(o.hops[0]))); + }, + encode(message: Forwarding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unwind === true) { + writer.uint32(8).bool(message.unwind); + } + for (const v of message.hops) { + Hop.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Forwarding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForwarding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unwind = reader.bool(); + break; + case 2: + message.hops.push(Hop.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: DeepPartial): Forwarding { + const message = createBaseForwarding(); + message.unwind = object.unwind ?? false; + message.hops = object.hops?.map(e => Hop.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ForwardingAmino): Forwarding { + const message = createBaseForwarding(); + if (object.unwind !== undefined && object.unwind !== null) { + message.unwind = object.unwind; + } + message.hops = object.hops?.map(e => Hop.fromAmino(e)) || []; + return message; + }, + toAmino(message: Forwarding): ForwardingAmino { + const obj: any = {}; + obj.unwind = message.unwind === false ? undefined : message.unwind; + if (message.hops) { + obj.hops = message.hops.map(e => e ? Hop.toAmino(e) : undefined); + } else { + obj.hops = message.hops; + } + return obj; + }, + fromAminoMsg(object: ForwardingAminoMsg): Forwarding { + return Forwarding.fromAmino(object.value); + }, + toAminoMsg(message: Forwarding): ForwardingAminoMsg { + return { + type: "cosmos-sdk/Forwarding", + value: Forwarding.toAmino(message) + }; + }, + fromProtoMsg(message: ForwardingProtoMsg): Forwarding { + return Forwarding.decode(message.value); + }, + toProto(message: Forwarding): Uint8Array { + return Forwarding.encode(message).finish(); + }, + toProtoMsg(message: Forwarding): ForwardingProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Forwarding", + value: Forwarding.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Forwarding.typeUrl, Forwarding); +GlobalDecoderRegistry.registerAminoProtoMapping(Forwarding.aminoType, Forwarding.typeUrl); +function createBaseHop(): Hop { + return { + portId: "", + channelId: "" + }; +} +export const Hop = { + typeUrl: "/ibc.applications.transfer.v1.Hop", + aminoType: "cosmos-sdk/Hop", + is(o: any): o is Hop { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isAmino(o: any): o is HopAmino { + return o && (o.$typeUrl === Hop.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: Hop, 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): Hop { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHop(); + 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: DeepPartial): Hop { + const message = createBaseHop(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: HopAmino): Hop { + const message = createBaseHop(); + 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: Hop): HopAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: HopAminoMsg): Hop { + return Hop.fromAmino(object.value); + }, + toAminoMsg(message: Hop): HopAminoMsg { + return { + type: "cosmos-sdk/Hop", + value: Hop.toAmino(message) + }; + }, + fromProtoMsg(message: HopProtoMsg): Hop { + return Hop.decode(message.value); + }, + toProto(message: Hop): Uint8Array { + return Hop.encode(message).finish(); + }, + toProtoMsg(message: Hop): HopProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Hop", + value: Hop.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Hop.typeUrl, Hop); +GlobalDecoderRegistry.registerAminoProtoMapping(Hop.aminoType, Hop.typeUrl); \ No newline at end of file diff --git a/libs/interchainjs/src/ibc/applications/transfer/v1/tx.ts b/libs/interchainjs/src/ibc/applications/transfer/v1/tx.ts index 566edde6..f4fb581c 100644 --- a/libs/interchainjs/src/ibc/applications/transfer/v1/tx.ts +++ b/libs/interchainjs/src/ibc/applications/transfer/v1/tx.ts @@ -1,5 +1,6 @@ import { Coin, CoinAmino } from "../../../../cosmos/base/v1beta1/coin"; import { Height, HeightAmino, Params, ParamsAmino } from "../../../core/client/v1/client"; +import { Forwarding, ForwardingAmino } from "./transfer"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; @@ -34,6 +35,8 @@ export interface MsgTransfer { memo: string; /** tokens to be transferred */ tokens: Coin[]; + /** optional forwarding information */ + forwarding?: Forwarding; } export interface MsgTransferProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; @@ -70,6 +73,8 @@ export interface MsgTransferAmino { memo: string; /** tokens to be transferred */ tokens: CoinAmino[]; + /** optional forwarding information */ + forwarding?: ForwardingAmino; } export interface MsgTransferAminoMsg { type: "cosmos-sdk/MsgTransfer"; @@ -151,7 +156,8 @@ function createBaseMsgTransfer(): MsgTransfer { timeoutHeight: Height.fromPartial({}), timeoutTimestamp: BigInt(0), memo: "", - tokens: [] + tokens: [], + forwarding: undefined }; } export const MsgTransfer = { @@ -191,6 +197,9 @@ export const MsgTransfer = { for (const v of message.tokens) { Coin.encode(v!, writer.uint32(74).fork()).ldelim(); } + if (message.forwarding !== undefined) { + Forwarding.encode(message.forwarding, writer.uint32(82).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { @@ -227,6 +236,9 @@ export const MsgTransfer = { case 9: message.tokens.push(Coin.decode(reader, reader.uint32())); break; + case 10: + message.forwarding = Forwarding.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -245,6 +257,7 @@ export const MsgTransfer = { message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); message.memo = object.memo ?? ""; message.tokens = object.tokens?.map(e => Coin.fromPartial(e)) || []; + message.forwarding = object.forwarding !== undefined && object.forwarding !== null ? Forwarding.fromPartial(object.forwarding) : undefined; return message; }, fromAmino(object: MsgTransferAmino): MsgTransfer { @@ -274,6 +287,9 @@ export const MsgTransfer = { message.memo = object.memo; } message.tokens = object.tokens?.map(e => Coin.fromAmino(e)) || []; + if (object.forwarding !== undefined && object.forwarding !== null) { + message.forwarding = Forwarding.fromAmino(object.forwarding); + } return message; }, toAmino(message: MsgTransfer): MsgTransferAmino { @@ -291,6 +307,7 @@ export const MsgTransfer = { } else { obj.tokens = message.tokens; } + obj.forwarding = message.forwarding ? Forwarding.toAmino(message.forwarding) : undefined; return obj; }, fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { diff --git a/libs/interchainjs/src/ibc/core/channel/v1/tx.ts b/libs/interchainjs/src/ibc/core/channel/v1/tx.ts index 2770cc5f..b7023355 100644 --- a/libs/interchainjs/src/ibc/core/channel/v1/tx.ts +++ b/libs/interchainjs/src/ibc/core/channel/v1/tx.ts @@ -762,13 +762,13 @@ export interface MsgChannelUpgradeTimeoutAminoMsg { type: "cosmos-sdk/MsgChannelUpgradeTimeout"; value: MsgChannelUpgradeTimeoutAmino; } -/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +/** MsgChannelUpgradeTimeoutResponse 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 */ +/** MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type */ export interface MsgChannelUpgradeTimeoutResponseAmino {} export interface MsgChannelUpgradeTimeoutResponseAminoMsg { type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; diff --git a/libs/interchainjs/src/ibc/core/client/v1/client.ts b/libs/interchainjs/src/ibc/core/client/v1/client.ts index eac32ca4..f6c36539 100644 --- a/libs/interchainjs/src/ibc/core/client/v1/client.ts +++ b/libs/interchainjs/src/ibc/core/client/v1/client.ts @@ -1,5 +1,4 @@ import { Any, AnyAmino } from "../../../../google/protobuf/any"; -import { Plan, PlanAmino } from "../../../../cosmos/upgrade/v1beta1/upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { DeepPartial } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; @@ -98,6 +97,9 @@ export interface ClientConsensusStatesAminoMsg { * breaking changes In these cases, the RevisionNumber is incremented so that * height continues to be monitonically increasing even as the RevisionHeight * gets reset + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. */ export interface Height { /** the revision that the client is currently on */ @@ -120,6 +122,9 @@ export interface HeightProtoMsg { * breaking changes In these cases, the RevisionNumber is incremented so that * height continues to be monitonically increasing even as the RevisionHeight * gets reset + * + * Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. + * This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. */ export interface HeightAmino { /** the revision that the client is currently on */ @@ -157,108 +162,6 @@ export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; value: ParamsAmino; } -/** - * 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; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subjectClientId: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substituteClientId: string; -} -export interface ClientUpdateProposalProtoMsg { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal"; - value: Uint8Array; -} -/** - * 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; - /** the description of the proposal */ - description: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id: string; -} -export interface ClientUpdateProposalAminoMsg { - type: "cosmos-sdk/ClientUpdateProposal"; - value: ClientUpdateProposalAmino; -} -/** - * 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; - 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 - */ - upgradedClientState?: Any; -} -export interface UpgradeProposalProtoMsg { - typeUrl: "/ibc.core.client.v1.UpgradeProposal"; - value: Uint8Array; -} -/** - * 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; - 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 - */ - upgraded_client_state?: AnyAmino; -} -export interface UpgradeProposalAminoMsg { - type: "cosmos-sdk/UpgradeProposal"; - value: UpgradeProposalAmino; -} function createBaseIdentifiedClientState(): IdentifiedClientState { return { clientId: "", @@ -589,8 +492,8 @@ export const Height = { }, 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; + obj.revision_number = message.revisionNumber ? message.revisionNumber?.toString() : "0"; + obj.revision_height = message.revisionHeight ? message.revisionHeight?.toString() : "0"; return obj; }, fromAminoMsg(object: HeightAminoMsg): Height { @@ -696,232 +599,4 @@ export const Params = { } }; GlobalDecoderRegistry.register(Params.typeUrl, Params); -GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); -function createBaseClientUpdateProposal(): ClientUpdateProposal { - return { - title: "", - description: "", - subjectClientId: "", - substituteClientId: "" - }; -} -export const ClientUpdateProposal = { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - aminoType: "cosmos-sdk/ClientUpdateProposal", - is(o: any): o is ClientUpdateProposal { - return o && (o.$typeUrl === ClientUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.subjectClientId === "string" && typeof o.substituteClientId === "string"); - }, - isAmino(o: any): o is ClientUpdateProposalAmino { - return o && (o.$typeUrl === ClientUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string"); - }, - encode(message: ClientUpdateProposal, 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.subjectClientId !== "") { - writer.uint32(26).string(message.subjectClientId); - } - if (message.substituteClientId !== "") { - writer.uint32(34).string(message.substituteClientId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClientUpdateProposal(); - 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.subjectClientId = reader.string(); - break; - case 4: - message.substituteClientId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: DeepPartial): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.subjectClientId = object.subjectClientId ?? ""; - message.substituteClientId = object.substituteClientId ?? ""; - return message; - }, - fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - 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; - } - return message; - }, - toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { - const obj: any = {}; - obj.title = message.title === "" ? undefined : message.title; - obj.description = message.description === "" ? undefined : message.description; - obj.subject_client_id = message.subjectClientId === "" ? undefined : message.subjectClientId; - obj.substitute_client_id = message.substituteClientId === "" ? undefined : message.substituteClientId; - return obj; - }, - fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { - return ClientUpdateProposal.fromAmino(object.value); - }, - toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { - return { - type: "cosmos-sdk/ClientUpdateProposal", - value: ClientUpdateProposal.toAmino(message) - }; - }, - fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { - return ClientUpdateProposal.decode(message.value); - }, - toProto(message: ClientUpdateProposal): Uint8Array { - return ClientUpdateProposal.encode(message).finish(); - }, - toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - value: ClientUpdateProposal.encode(message).finish() - }; - } -}; -GlobalDecoderRegistry.register(ClientUpdateProposal.typeUrl, ClientUpdateProposal); -GlobalDecoderRegistry.registerAminoProtoMapping(ClientUpdateProposal.aminoType, ClientUpdateProposal.typeUrl); -function createBaseUpgradeProposal(): UpgradeProposal { - return { - title: "", - description: "", - plan: Plan.fromPartial({}), - upgradedClientState: undefined - }; -} -export const UpgradeProposal = { - typeUrl: "/ibc.core.client.v1.UpgradeProposal", - aminoType: "cosmos-sdk/UpgradeProposal", - is(o: any): o is UpgradeProposal { - return o && (o.$typeUrl === UpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.is(o.plan)); - }, - isAmino(o: any): o is UpgradeProposalAmino { - return o && (o.$typeUrl === UpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isAmino(o.plan)); - }, - encode(message: UpgradeProposal, 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.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgradedClientState !== undefined) { - Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpgradeProposal(); - 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.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgradedClientState = Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: DeepPartial): UpgradeProposal { - const message = createBaseUpgradeProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - 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; - return message; - }, - fromAmino(object: UpgradeProposalAmino): UpgradeProposal { - const message = createBaseUpgradeProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - 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); - } - return message; - }, - toAmino(message: UpgradeProposal): UpgradeProposalAmino { - 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.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; - return obj; - }, - fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { - return UpgradeProposal.fromAmino(object.value); - }, - toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { - return { - type: "cosmos-sdk/UpgradeProposal", - value: UpgradeProposal.toAmino(message) - }; - }, - fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { - return UpgradeProposal.decode(message.value); - }, - toProto(message: UpgradeProposal): Uint8Array { - return UpgradeProposal.encode(message).finish(); - }, - toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.UpgradeProposal", - value: UpgradeProposal.encode(message).finish() - }; - } -}; -GlobalDecoderRegistry.register(UpgradeProposal.typeUrl, UpgradeProposal); -GlobalDecoderRegistry.registerAminoProtoMapping(UpgradeProposal.aminoType, UpgradeProposal.typeUrl); \ No newline at end of file +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/libs/interchainjs/src/ibc/core/client/v1/tx.ts b/libs/interchainjs/src/ibc/core/client/v1/tx.ts index de0d64f7..c0281aac 100644 --- a/libs/interchainjs/src/ibc/core/client/v1/tx.ts +++ b/libs/interchainjs/src/ibc/core/client/v1/tx.ts @@ -37,13 +37,17 @@ export interface MsgCreateClientAminoMsg { value: MsgCreateClientAmino; } /** MsgCreateClientResponse defines the Msg/CreateClient response type. */ -export interface MsgCreateClientResponse {} +export interface MsgCreateClientResponse { + clientId: string; +} export interface MsgCreateClientResponseProtoMsg { typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; value: Uint8Array; } /** MsgCreateClientResponse defines the Msg/CreateClient response type. */ -export interface MsgCreateClientResponseAmino {} +export interface MsgCreateClientResponseAmino { + client_id: string; +} export interface MsgCreateClientResponseAminoMsg { type: "cosmos-sdk/MsgCreateClientResponse"; value: MsgCreateClientResponseAmino; @@ -451,18 +455,23 @@ export const MsgCreateClient = { GlobalDecoderRegistry.register(MsgCreateClient.typeUrl, MsgCreateClient); GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClient.aminoType, MsgCreateClient.typeUrl); function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { - return {}; + return { + clientId: "" + }; } export const MsgCreateClientResponse = { typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", aminoType: "cosmos-sdk/MsgCreateClientResponse", is(o: any): o is MsgCreateClientResponse { - return o && o.$typeUrl === MsgCreateClientResponse.typeUrl; + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.clientId === "string"); }, isAmino(o: any): o is MsgCreateClientResponseAmino { - return o && o.$typeUrl === MsgCreateClientResponse.typeUrl; + return o && (o.$typeUrl === MsgCreateClientResponse.typeUrl || typeof o.client_id === "string"); }, - encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { @@ -472,6 +481,9 @@ export const MsgCreateClientResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -479,16 +491,21 @@ export const MsgCreateClientResponse = { } return message; }, - fromPartial(_: DeepPartial): MsgCreateClientResponse { + fromPartial(object: DeepPartial): MsgCreateClientResponse { const message = createBaseMsgCreateClientResponse(); + message.clientId = object.clientId ?? ""; return message; }, - fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { + fromAmino(object: MsgCreateClientResponseAmino): MsgCreateClientResponse { const message = createBaseMsgCreateClientResponse(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } return message; }, - toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { + toAmino(message: MsgCreateClientResponse): MsgCreateClientResponseAmino { const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; return obj; }, fromAminoMsg(object: MsgCreateClientResponseAminoMsg): MsgCreateClientResponse { diff --git a/libs/interchainjs/src/ibc/core/commitment/v1/commitment.ts b/libs/interchainjs/src/ibc/core/commitment/v1/commitment.ts index 5061d630..051efcdf 100644 --- a/libs/interchainjs/src/ibc/core/commitment/v1/commitment.ts +++ b/libs/interchainjs/src/ibc/core/commitment/v1/commitment.ts @@ -48,30 +48,6 @@ export interface MerklePrefixAminoMsg { type: "cosmos-sdk/MerklePrefix"; value: MerklePrefixAmino; } -/** - * 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 - */ -export interface MerklePath { - keyPath: string[]; -} -export interface MerklePathProtoMsg { - typeUrl: "/ibc.core.commitment.v1.MerklePath"; - value: Uint8Array; -} -/** - * 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 - */ -export interface MerklePathAmino { - key_path: string[]; -} -export interface MerklePathAminoMsg { - type: "cosmos-sdk/MerklePath"; - value: MerklePathAmino; -} /** * MerkleProof is a wrapper type over a chain of CommitmentProofs. * It demonstrates membership or non-membership for an element or set of @@ -256,86 +232,6 @@ export const MerklePrefix = { }; GlobalDecoderRegistry.register(MerklePrefix.typeUrl, MerklePrefix); GlobalDecoderRegistry.registerAminoProtoMapping(MerklePrefix.aminoType, MerklePrefix.typeUrl); -function createBaseMerklePath(): MerklePath { - return { - keyPath: [] - }; -} -export const MerklePath = { - typeUrl: "/ibc.core.commitment.v1.MerklePath", - aminoType: "cosmos-sdk/MerklePath", - is(o: any): o is MerklePath { - return o && (o.$typeUrl === MerklePath.typeUrl || Array.isArray(o.keyPath) && (!o.keyPath.length || typeof o.keyPath[0] === "string")); - }, - isAmino(o: any): o is MerklePathAmino { - return o && (o.$typeUrl === MerklePath.typeUrl || Array.isArray(o.key_path) && (!o.key_path.length || typeof o.key_path[0] === "string")); - }, - encode(message: MerklePath, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.keyPath) { - writer.uint32(10).string(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MerklePath { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMerklePath(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.keyPath.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: DeepPartial): MerklePath { - const message = createBaseMerklePath(); - message.keyPath = object.keyPath?.map(e => e) || []; - return message; - }, - fromAmino(object: MerklePathAmino): MerklePath { - const message = createBaseMerklePath(); - message.keyPath = object.key_path?.map(e => e) || []; - return message; - }, - toAmino(message: MerklePath): MerklePathAmino { - const obj: any = {}; - if (message.keyPath) { - obj.key_path = message.keyPath.map(e => e); - } else { - obj.key_path = message.keyPath; - } - return obj; - }, - fromAminoMsg(object: MerklePathAminoMsg): MerklePath { - return MerklePath.fromAmino(object.value); - }, - toAminoMsg(message: MerklePath): MerklePathAminoMsg { - return { - type: "cosmos-sdk/MerklePath", - value: MerklePath.toAmino(message) - }; - }, - fromProtoMsg(message: MerklePathProtoMsg): MerklePath { - return MerklePath.decode(message.value); - }, - toProto(message: MerklePath): Uint8Array { - return MerklePath.encode(message).finish(); - }, - toProtoMsg(message: MerklePath): MerklePathProtoMsg { - return { - typeUrl: "/ibc.core.commitment.v1.MerklePath", - value: MerklePath.encode(message).finish() - }; - } -}; -GlobalDecoderRegistry.register(MerklePath.typeUrl, MerklePath); -GlobalDecoderRegistry.registerAminoProtoMapping(MerklePath.aminoType, MerklePath.typeUrl); function createBaseMerkleProof(): MerkleProof { return { proofs: [] diff --git a/libs/interchainjs/src/ibc/core/connection/v1/tx.ts b/libs/interchainjs/src/ibc/core/connection/v1/tx.ts index cb3ad6d9..fd194d48 100644 --- a/libs/interchainjs/src/ibc/core/connection/v1/tx.ts +++ b/libs/interchainjs/src/ibc/core/connection/v1/tx.ts @@ -61,6 +61,8 @@ export interface MsgConnectionOpenTry { /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ previousConnectionId: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ clientState?: Any; counterparty: Counterparty; delayPeriod: bigint; @@ -71,13 +73,18 @@ export interface MsgConnectionOpenTry { * INIT` */ proofInit: Uint8Array; - /** proof of client state included in message */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proofClient: Uint8Array; - /** proof of client consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ consensusHeight: Height; signer: string; - /** optional proof data for host state machines that are unable to introspect their own consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ hostConsensusStateProof: Uint8Array; } export interface MsgConnectionOpenTryProtoMsg { @@ -93,6 +100,8 @@ export interface MsgConnectionOpenTryAmino { /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ previous_connection_id: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ client_state?: AnyAmino; counterparty: CounterpartyAmino; delay_period: string; @@ -103,13 +112,18 @@ export interface MsgConnectionOpenTryAmino { * INIT` */ proof_init: string; - /** proof of client state included in message */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proof_client: string; - /** proof of client consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ consensus_height: HeightAmino; signer: string; - /** optional proof data for host state machines that are unable to introspect their own consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ host_consensus_state_proof: string; } export interface MsgConnectionOpenTryAminoMsg { @@ -136,6 +150,8 @@ export interface MsgConnectionOpenAck { connectionId: string; counterpartyConnectionId: string; version?: Version; + /** Deprecated: this field is unused. */ + /** @deprecated */ clientState?: Any; proofHeight: Height; /** @@ -143,13 +159,18 @@ export interface MsgConnectionOpenAck { * TRYOPEN` */ proofTry: Uint8Array; - /** proof of client state included in message */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proofClient: Uint8Array; - /** proof of client consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proofConsensus: Uint8Array; + /** Deprecated: this field is unused. */ + /** @deprecated */ consensusHeight: Height; signer: string; - /** optional proof data for host state machines that are unable to introspect their own consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ hostConsensusStateProof: Uint8Array; } export interface MsgConnectionOpenAckProtoMsg { @@ -164,6 +185,8 @@ export interface MsgConnectionOpenAckAmino { connection_id: string; counterparty_connection_id: string; version?: VersionAmino; + /** Deprecated: this field is unused. */ + /** @deprecated */ client_state?: AnyAmino; proof_height: HeightAmino; /** @@ -171,13 +194,18 @@ export interface MsgConnectionOpenAckAmino { * TRYOPEN` */ proof_try: string; - /** proof of client state included in message */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proof_client: string; - /** proof of client consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ proof_consensus: string; + /** Deprecated: this field is unused. */ + /** @deprecated */ consensus_height: HeightAmino; signer: string; - /** optional proof data for host state machines that are unable to introspect their own consensus state */ + /** Deprecated: this field is unused. */ + /** @deprecated */ host_consensus_state_proof: string; } export interface MsgConnectionOpenAckAminoMsg { diff --git a/libs/interchainjs/src/registry.ts b/libs/interchainjs/src/registry.ts index 4a0180cf..d78fce75 100644 --- a/libs/interchainjs/src/registry.ts +++ b/libs/interchainjs/src/registry.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/types.ts b/libs/interchainjs/src/types.ts index 95dbec3a..a91926e7 100644 --- a/libs/interchainjs/src/types.ts +++ b/libs/interchainjs/src/types.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/utf8.ts b/libs/interchainjs/src/utf8.ts index 288be9f6..4d16a562 100644 --- a/libs/interchainjs/src/utf8.ts +++ b/libs/interchainjs/src/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/libs/interchainjs/src/varint.ts b/libs/interchainjs/src/varint.ts index 0b7431a3..9df34fb2 100644 --- a/libs/interchainjs/src/varint.ts +++ b/libs/interchainjs/src/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.8 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.10 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/package.json b/package.json index 90fde7e9..01cfaa2b 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ "libs/*" ], "scripts": { - "codegen": "telescope transpile --config ./scripts/interchainjs.telescope.json && telescope transpile --config ./scripts/interchain-query.telescope.json", + "codegen": "yarn codegen:ic && yarn codegen:inj", + "codegen:ic": "telescope transpile --config ./scripts/interchainjs.telescope.json && telescope transpile --config ./scripts/interchain-query.telescope.json", + "codegen:inj": "telescope transpile --config ./scripts/inj.telescope.json && telescope transpile --config ./scripts/inj-query.telescope.json", "codegen:types": "telescope transpile --config ./scripts/cosmos-types.telescope.json", - "proto": "telescope download --config ./scripts/.protod.config.json", + "proto": "telescope download --config ./scripts/.protod.config.json && telescope download --config ./scripts/.injective.protod.config.json", "test": "lerna run test --stream", "clean": "lerna run clean", "clean:modules": "find . -name 'node_modules' -type d -prune -print | xargs rm -rf", @@ -32,7 +34,7 @@ "@chain-registry/client": "1.18.1", "@confio/relayer": "^0.12.0", "@cosmjs/crypto": "^0.32.2", - "@cosmology/telescope": "^1.10.8", + "@cosmology/telescope": "^1.10.10", "@injectivelabs/networks": "^1.14.13", "@injectivelabs/sdk-ts": "^1.14.13", "@injectivelabs/wallet-ts": "^1.14.13", diff --git a/protos/ibc/applications/transfer/v1/transfer.proto b/protos/ibc/applications/transfer/v1/transfer.proto deleted file mode 100644 index 15ce7a40..00000000 --- a/protos/ibc/applications/transfer/v1/transfer.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; - -// Params defines the set of IBC transfer parameters. -// NOTE: To prevent a single token from being transferred, set the -// TransfersEnabled parameter to true and then set the bank module's SendEnabled -// parameter for the denomination to false. -message Params { - // send_enabled enables or disables all cross-chain token transfers from this - // chain. - bool send_enabled = 1; - // receive_enabled enables or disables all cross-chain token transfers to this - // chain. - bool receive_enabled = 2; -} diff --git a/protos/ibc/core/client/v1/client.proto b/protos/ibc/core/client/v1/client.proto deleted file mode 100644 index 7a09e360..00000000 --- a/protos/ibc/core/client/v1/client.proto +++ /dev/null @@ -1,113 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; - -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; - // client state - google.protobuf.Any client_state = 2; -} - -// ConsensusStateWithHeight defines a consensus state with an additional height -// field. -message ConsensusStateWithHeight { - // consensus state height - Height height = 1 [(gogoproto.nullable) = false]; - // 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; - // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; -} - -// 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 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 - string description = 2; - // the client identifier for the client to be updated if the proposal passes - string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; - // the substitute client identifier for the client standing in for the subject - // client - string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; -} - -// 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; - - string title = 1; - string description = 2; - cosmos.upgrade.v1beta1.Plan plan = 3 [(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 - google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; -} diff --git a/protos/amino/amino.proto b/protos/injectivejs/amino/amino.proto similarity index 100% rename from protos/amino/amino.proto rename to protos/injectivejs/amino/amino.proto diff --git a/protos/cosmos/auth/v1beta1/auth.proto b/protos/injectivejs/cosmos/auth/v1beta1/auth.proto similarity index 100% rename from protos/cosmos/auth/v1beta1/auth.proto rename to protos/injectivejs/cosmos/auth/v1beta1/auth.proto diff --git a/protos/cosmos/auth/v1beta1/query.proto b/protos/injectivejs/cosmos/auth/v1beta1/query.proto similarity index 100% rename from protos/cosmos/auth/v1beta1/query.proto rename to protos/injectivejs/cosmos/auth/v1beta1/query.proto diff --git a/protos/cosmos/authz/v1beta1/authz.proto b/protos/injectivejs/cosmos/authz/v1beta1/authz.proto similarity index 100% rename from protos/cosmos/authz/v1beta1/authz.proto rename to protos/injectivejs/cosmos/authz/v1beta1/authz.proto diff --git a/protos/cosmos/authz/v1beta1/tx.proto b/protos/injectivejs/cosmos/authz/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/authz/v1beta1/tx.proto rename to protos/injectivejs/cosmos/authz/v1beta1/tx.proto diff --git a/protos/cosmos/bank/v1beta1/bank.proto b/protos/injectivejs/cosmos/bank/v1beta1/bank.proto similarity index 100% rename from protos/cosmos/bank/v1beta1/bank.proto rename to protos/injectivejs/cosmos/bank/v1beta1/bank.proto diff --git a/protos/cosmos/bank/v1beta1/query.proto b/protos/injectivejs/cosmos/bank/v1beta1/query.proto similarity index 100% rename from protos/cosmos/bank/v1beta1/query.proto rename to protos/injectivejs/cosmos/bank/v1beta1/query.proto diff --git a/protos/cosmos/bank/v1beta1/tx.proto b/protos/injectivejs/cosmos/bank/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/bank/v1beta1/tx.proto rename to protos/injectivejs/cosmos/bank/v1beta1/tx.proto diff --git a/protos/cosmos/base/abci/v1beta1/abci.proto b/protos/injectivejs/cosmos/base/abci/v1beta1/abci.proto similarity index 100% rename from protos/cosmos/base/abci/v1beta1/abci.proto rename to protos/injectivejs/cosmos/base/abci/v1beta1/abci.proto diff --git a/protos/cosmos/base/query/v1beta1/pagination.proto b/protos/injectivejs/cosmos/base/query/v1beta1/pagination.proto similarity index 100% rename from protos/cosmos/base/query/v1beta1/pagination.proto rename to protos/injectivejs/cosmos/base/query/v1beta1/pagination.proto diff --git a/protos/cosmos/base/v1beta1/coin.proto b/protos/injectivejs/cosmos/base/v1beta1/coin.proto similarity index 100% rename from protos/cosmos/base/v1beta1/coin.proto rename to protos/injectivejs/cosmos/base/v1beta1/coin.proto diff --git a/protos/cosmos/crypto/ed25519/keys.proto b/protos/injectivejs/cosmos/crypto/ed25519/keys.proto similarity index 100% rename from protos/cosmos/crypto/ed25519/keys.proto rename to protos/injectivejs/cosmos/crypto/ed25519/keys.proto diff --git a/protos/cosmos/crypto/multisig/v1beta1/multisig.proto b/protos/injectivejs/cosmos/crypto/multisig/v1beta1/multisig.proto similarity index 100% rename from protos/cosmos/crypto/multisig/v1beta1/multisig.proto rename to protos/injectivejs/cosmos/crypto/multisig/v1beta1/multisig.proto diff --git a/protos/cosmos/crypto/secp256k1/keys.proto b/protos/injectivejs/cosmos/crypto/secp256k1/keys.proto similarity index 100% rename from protos/cosmos/crypto/secp256k1/keys.proto rename to protos/injectivejs/cosmos/crypto/secp256k1/keys.proto diff --git a/protos/cosmos/crypto/secp256r1/keys.proto b/protos/injectivejs/cosmos/crypto/secp256r1/keys.proto similarity index 100% rename from protos/cosmos/crypto/secp256r1/keys.proto rename to protos/injectivejs/cosmos/crypto/secp256r1/keys.proto diff --git a/protos/cosmos/distribution/v1beta1/distribution.proto b/protos/injectivejs/cosmos/distribution/v1beta1/distribution.proto similarity index 100% rename from protos/cosmos/distribution/v1beta1/distribution.proto rename to protos/injectivejs/cosmos/distribution/v1beta1/distribution.proto diff --git a/protos/cosmos/distribution/v1beta1/tx.proto b/protos/injectivejs/cosmos/distribution/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/distribution/v1beta1/tx.proto rename to protos/injectivejs/cosmos/distribution/v1beta1/tx.proto diff --git a/protos/cosmos/feegrant/v1beta1/tx.proto b/protos/injectivejs/cosmos/feegrant/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/feegrant/v1beta1/tx.proto rename to protos/injectivejs/cosmos/feegrant/v1beta1/tx.proto diff --git a/protos/cosmos/gov/v1/gov.proto b/protos/injectivejs/cosmos/gov/v1/gov.proto similarity index 100% rename from protos/cosmos/gov/v1/gov.proto rename to protos/injectivejs/cosmos/gov/v1/gov.proto diff --git a/protos/cosmos/gov/v1/tx.proto b/protos/injectivejs/cosmos/gov/v1/tx.proto similarity index 100% rename from protos/cosmos/gov/v1/tx.proto rename to protos/injectivejs/cosmos/gov/v1/tx.proto diff --git a/protos/cosmos/gov/v1beta1/gov.proto b/protos/injectivejs/cosmos/gov/v1beta1/gov.proto similarity index 100% rename from protos/cosmos/gov/v1beta1/gov.proto rename to protos/injectivejs/cosmos/gov/v1beta1/gov.proto diff --git a/protos/cosmos/gov/v1beta1/query.proto b/protos/injectivejs/cosmos/gov/v1beta1/query.proto similarity index 100% rename from protos/cosmos/gov/v1beta1/query.proto rename to protos/injectivejs/cosmos/gov/v1beta1/query.proto diff --git a/protos/cosmos/gov/v1beta1/tx.proto b/protos/injectivejs/cosmos/gov/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/gov/v1beta1/tx.proto rename to protos/injectivejs/cosmos/gov/v1beta1/tx.proto diff --git a/protos/cosmos/group/v1/tx.proto b/protos/injectivejs/cosmos/group/v1/tx.proto similarity index 100% rename from protos/cosmos/group/v1/tx.proto rename to protos/injectivejs/cosmos/group/v1/tx.proto diff --git a/protos/cosmos/group/v1/types.proto b/protos/injectivejs/cosmos/group/v1/types.proto similarity index 100% rename from protos/cosmos/group/v1/types.proto rename to protos/injectivejs/cosmos/group/v1/types.proto diff --git a/protos/cosmos/ics23/v1/proofs.proto b/protos/injectivejs/cosmos/ics23/v1/proofs.proto similarity index 98% rename from protos/cosmos/ics23/v1/proofs.proto rename to protos/injectivejs/cosmos/ics23/v1/proofs.proto index 1c8b6ad7..940f6802 100644 --- a/protos/cosmos/ics23/v1/proofs.proto +++ b/protos/injectivejs/cosmos/ics23/v1/proofs.proto @@ -163,6 +163,7 @@ message ProofSpec { LeafOp leaf_spec = 1; InnerSpec inner_spec = 2; // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + // the max_depth is interpreted as 128 if set to 0 int32 max_depth = 3; // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) int32 min_depth = 4; @@ -189,7 +190,8 @@ message InnerSpec { repeated int32 child_order = 1; int32 child_size = 2; int32 min_prefix_length = 3; - int32 max_prefix_length = 4; + // the max prefix length must be less than the minimum prefix length + child size + 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 diff --git a/protos/cosmos/msg/v1/msg.proto b/protos/injectivejs/cosmos/msg/v1/msg.proto similarity index 100% rename from protos/cosmos/msg/v1/msg.proto rename to protos/injectivejs/cosmos/msg/v1/msg.proto diff --git a/protos/cosmos/query/v1/query.proto b/protos/injectivejs/cosmos/query/v1/query.proto similarity index 100% rename from protos/cosmos/query/v1/query.proto rename to protos/injectivejs/cosmos/query/v1/query.proto diff --git a/protos/cosmos/staking/v1beta1/query.proto b/protos/injectivejs/cosmos/staking/v1beta1/query.proto similarity index 99% rename from protos/cosmos/staking/v1beta1/query.proto rename to protos/injectivejs/cosmos/staking/v1beta1/query.proto index 08eb9f32..9b981223 100644 --- a/protos/cosmos/staking/v1beta1/query.proto +++ b/protos/injectivejs/cosmos/staking/v1beta1/query.proto @@ -292,10 +292,10 @@ message QueryRedelegationsRequest { string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // src_validator_addr defines the validator address to redelegate from. - string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // dst_validator_addr defines the validator address to redelegate to. - string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 4; diff --git a/protos/cosmos/staking/v1beta1/staking.proto b/protos/injectivejs/cosmos/staking/v1beta1/staking.proto similarity index 100% rename from protos/cosmos/staking/v1beta1/staking.proto rename to protos/injectivejs/cosmos/staking/v1beta1/staking.proto diff --git a/protos/cosmos/staking/v1beta1/tx.proto b/protos/injectivejs/cosmos/staking/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/staking/v1beta1/tx.proto rename to protos/injectivejs/cosmos/staking/v1beta1/tx.proto diff --git a/protos/cosmos/tx/signing/v1beta1/signing.proto b/protos/injectivejs/cosmos/tx/signing/v1beta1/signing.proto similarity index 100% rename from protos/cosmos/tx/signing/v1beta1/signing.proto rename to protos/injectivejs/cosmos/tx/signing/v1beta1/signing.proto diff --git a/protos/cosmos/tx/v1beta1/service.proto b/protos/injectivejs/cosmos/tx/v1beta1/service.proto similarity index 100% rename from protos/cosmos/tx/v1beta1/service.proto rename to protos/injectivejs/cosmos/tx/v1beta1/service.proto diff --git a/protos/cosmos/tx/v1beta1/tx.proto b/protos/injectivejs/cosmos/tx/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/tx/v1beta1/tx.proto rename to protos/injectivejs/cosmos/tx/v1beta1/tx.proto diff --git a/protos/cosmos/upgrade/v1beta1/upgrade.proto b/protos/injectivejs/cosmos/upgrade/v1beta1/upgrade.proto similarity index 100% rename from protos/cosmos/upgrade/v1beta1/upgrade.proto rename to protos/injectivejs/cosmos/upgrade/v1beta1/upgrade.proto diff --git a/protos/cosmos/vesting/v1beta1/tx.proto b/protos/injectivejs/cosmos/vesting/v1beta1/tx.proto similarity index 100% rename from protos/cosmos/vesting/v1beta1/tx.proto rename to protos/injectivejs/cosmos/vesting/v1beta1/tx.proto diff --git a/protos/cosmos/vesting/v1beta1/vesting.proto b/protos/injectivejs/cosmos/vesting/v1beta1/vesting.proto similarity index 100% rename from protos/cosmos/vesting/v1beta1/vesting.proto rename to protos/injectivejs/cosmos/vesting/v1beta1/vesting.proto diff --git a/protos/cosmos_proto/cosmos.proto b/protos/injectivejs/cosmos_proto/cosmos.proto similarity index 100% rename from protos/cosmos_proto/cosmos.proto rename to protos/injectivejs/cosmos_proto/cosmos.proto diff --git a/protos/injectivejs/cosmwasm/wasm/v1/proposal_legacy.proto b/protos/injectivejs/cosmwasm/wasm/v1/proposal_legacy.proto new file mode 100644 index 00000000..d6d7a7d2 --- /dev/null +++ b/protos/injectivejs/cosmwasm/wasm/v1/proposal_legacy.proto @@ -0,0 +1,355 @@ +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 contract 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 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 contract 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\"" + ]; +} + +// 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 contract 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/protos/cosmwasm/wasm/v1/query.proto b/protos/injectivejs/cosmwasm/wasm/v1/query.proto similarity index 82% rename from protos/cosmwasm/wasm/v1/query.proto rename to protos/injectivejs/cosmwasm/wasm/v1/query.proto index d759133d..e52b6b04 100644 --- a/protos/cosmwasm/wasm/v1/query.proto +++ b/protos/injectivejs/cosmwasm/wasm/v1/query.proto @@ -5,6 +5,7 @@ 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"; @@ -17,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,35 +53,54 @@ service Query { option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}"; } - // Code gets the binary code and metadata for a singe wasm code + // Code gets the binary code and metadata for a single 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"; } + // CodeInfo gets the metadata for a single wasm code + rpc CodeInfo(QueryCodeInfoRequest) returns (QueryCodeInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmwasm/wasm/v1/code-info/{code_id}"; + } + // 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"; } // 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}"; } + // WasmLimitsConfig gets the configured limits for static validation of Wasm + // files, encoded in JSON. + rpc WasmLimitsConfig(QueryWasmLimitsConfigRequest) + returns (QueryWasmLimitsConfigResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/wasm-limits-config"; + } + // 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"; } } @@ -122,7 +147,7 @@ message QueryContractHistoryResponse { // QueryContractsByCodeRequest is the request type for the Query/ContractsByCode // RPC method message QueryContractsByCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } @@ -195,7 +220,24 @@ message QuerySmartContractStateResponse { // QueryCodeRequest is the request type for the Query/Code RPC method message QueryCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID +} + +// QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method +message QueryCodeInfoRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID +} + +// QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method +message QueryCodeInfoResponse { + option (gogoproto.equal) = true; + + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bytes checksum = 3 [ (gogoproto.casttype) = + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; + AccessConfig instantiate_permission = 4 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // CodeInfoResponse contains code meta data from CodeInfo @@ -282,6 +324,15 @@ message QueryContractsByCreatorResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// QueryWasmLimitsConfigRequest is the request type for the +// Query/WasmLimitsConfig RPC method. +message QueryWasmLimitsConfigRequest {} + +// QueryWasmLimitsConfigResponse is the response type for the +// Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for +// static validation of Wasm files. +message QueryWasmLimitsConfigResponse { string config = 1; } + // QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC // method. message QueryBuildAddressRequest { @@ -301,4 +352,4 @@ message QueryBuildAddressRequest { message QueryBuildAddressResponse { // Address is the contract address string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; -} \ No newline at end of file +} diff --git a/protos/cosmwasm/wasm/v1/tx.proto b/protos/injectivejs/cosmwasm/wasm/v1/tx.proto similarity index 99% rename from protos/cosmwasm/wasm/v1/tx.proto rename to protos/injectivejs/cosmwasm/wasm/v1/tx.proto index adbc96ad..4dfe7446 100644 --- a/protos/cosmwasm/wasm/v1/tx.proto +++ b/protos/injectivejs/cosmwasm/wasm/v1/tx.proto @@ -145,7 +145,7 @@ message MsgInstantiateContractResponse { } // 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"; @@ -399,7 +399,7 @@ message MsgStoreAndInstantiateContract { 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. + // Label is optional metadata to be stored with a contract instance. string label = 7; // Msg json encoded message to be passed to the contract on instantiation bytes msg = 8 [ @@ -518,4 +518,4 @@ message MsgUpdateContractLabel { } // MsgUpdateContractLabelResponse returns empty data -message MsgUpdateContractLabelResponse {} \ No newline at end of file +message MsgUpdateContractLabelResponse {} diff --git a/protos/cosmwasm/wasm/v1/types.proto b/protos/injectivejs/cosmwasm/wasm/v1/types.proto similarity index 100% rename from protos/cosmwasm/wasm/v1/types.proto rename to protos/injectivejs/cosmwasm/wasm/v1/types.proto diff --git a/protos/gogoproto/gogo.proto b/protos/injectivejs/gogoproto/gogo.proto similarity index 100% rename from protos/gogoproto/gogo.proto rename to protos/injectivejs/gogoproto/gogo.proto diff --git a/protos/google/api/annotations.proto b/protos/injectivejs/google/api/annotations.proto similarity index 100% rename from protos/google/api/annotations.proto rename to protos/injectivejs/google/api/annotations.proto diff --git a/protos/google/api/http.proto b/protos/injectivejs/google/api/http.proto similarity index 93% rename from protos/google/api/http.proto rename to protos/injectivejs/google/api/http.proto index afa00aed..e3270371 100644 --- a/protos/google/api/http.proto +++ b/protos/injectivejs/google/api/http.proto @@ -41,7 +41,7 @@ message Http { bool fully_decode_reserved_expansion = 2; } -// # gRPC Transcoding +// gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service @@ -82,9 +82,8 @@ message Http { // // This enables an HTTP REST to gRPC mapping as below: // -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// - HTTP: `GET /v1/messages/123456` +// - gRPC: `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. @@ -108,11 +107,9 @@ message Http { // // This enables a HTTP JSON to RPC mapping as below: // -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` +// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` +// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: +// SubMessage(subfield: "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. @@ -142,10 +139,8 @@ message Http { // representation of the JSON in the request body is determined by // protos JSON encoding: // -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the @@ -168,10 +163,8 @@ message Http { // // The following HTTP JSON to RPC mapping is enabled: // -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in @@ -199,13 +192,13 @@ message Http { // // This enables the following two alternative HTTP JSON to RPC mappings: // -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` +// - HTTP: `GET /v1/messages/123456` +// - gRPC: `GetMessage(message_id: "123456")` // -// ## Rules for HTTP mapping +// - HTTP: `GET /v1/users/me/messages/123456` +// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` +// +// Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: @@ -224,7 +217,7 @@ message Http { // request body, all // fields are passed via URL path and URL query parameters. // -// ### Path template syntax +// Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; @@ -263,7 +256,7 @@ message Http { // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // -// ## Using gRPC API Service Configuration +// Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The @@ -278,15 +271,14 @@ message Http { // specified in the service config will override any matching transcoding // configuration in the proto. // -// Example: +// The following example selects a gRPC method and applies an `HttpRule` to it: // // http: // rules: -// # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // -// ## Special notes +// Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 diff --git a/protos/google/protobuf/any.proto b/protos/injectivejs/google/protobuf/any.proto similarity index 100% rename from protos/google/protobuf/any.proto rename to protos/injectivejs/google/protobuf/any.proto diff --git a/protos/google/protobuf/descriptor.proto b/protos/injectivejs/google/protobuf/descriptor.proto similarity index 92% rename from protos/google/protobuf/descriptor.proto rename to protos/injectivejs/google/protobuf/descriptor.proto index 8e5e2148..dd2d0fbf 100644 --- a/protos/google/protobuf/descriptor.proto +++ b/protos/injectivejs/google/protobuf/descriptor.proto @@ -55,6 +55,13 @@ option optimize_for = SPEED; // files it parses. message FileDescriptorSet { repeated FileDescriptorProto file = 1; + + // Extensions for tooling. + extensions 536000000 [declaration = { + number: 536000000 + type: ".buf.descriptor.v1.FileDescriptorSetExtension" + full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension" + }]; } // The full set of known editions. @@ -80,7 +87,7 @@ enum Edition { EDITION_2024 = 1001; // Placeholder editions for testing feature resolution. These should not be - // used or relyed on outside of tests. + // used or relied on outside of tests. EDITION_1_TEST_ONLY = 1; EDITION_2_TEST_ONLY = 2; EDITION_99997_TEST_ONLY = 99997; @@ -124,9 +131,15 @@ message FileDescriptorProto { // The supported values are "proto2", "proto3", and "editions". // // If `edition` is present, this value must be "editions". + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional string syntax = 12; // The edition of the proto file. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional Edition edition = 14; } @@ -494,6 +507,7 @@ message FileOptions { optional bool java_generic_services = 17 [default = false]; optional bool py_generic_services = 18 [default = false]; reserved 42; // removed php_generic_services + reserved "php_generic_services"; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations @@ -538,6 +552,9 @@ message FileOptions { optional string ruby_package = 45; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 50; // The parser stores options it doesn't recognize here. @@ -624,6 +641,9 @@ message MessageOptions { optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 12; // The parser stores options it doesn't recognize here. See above. @@ -634,13 +654,14 @@ message MessageOptions { } message FieldOptions { + // NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. // 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 only implemented to support use of // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - // type "bytes" in the open source release -- sorry, we'll try to include - // other types in a future version! - optional CType ctype = 1 [default = STRING]; + // type "bytes" in the open source release. + // TODO: make ctype actually deprecated. + optional CType ctype = 1 [/*deprecated = true,*/ default = STRING]; enum CType { // Default mode. STRING = 0; @@ -730,8 +751,6 @@ message FieldOptions { optional bool debug_redact = 16 [default = false]; // If set to RETENTION_SOURCE, the option will be omitted from the binary. - // Note: as of January 2023, support for this is in progress and does not yet - // have an effect (b/264593489). enum OptionRetention { RETENTION_UNKNOWN = 0; RETENTION_RUNTIME = 1; @@ -742,8 +761,7 @@ message FieldOptions { // This indicates the types of entities that the field may apply to when used // as an option. If it is unset, then the field may be freely used as an - // option on any kind of entity. Note: as of January 2023, support for this is - // in progress and does not yet have an effect (b/264593489). + // option on any kind of entity. enum OptionTargetType { TARGET_TYPE_UNKNOWN = 0; TARGET_TYPE_FILE = 1; @@ -766,6 +784,9 @@ message FieldOptions { repeated EditionDefault edition_defaults = 20; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 21; // Information about the support window of a feature. @@ -802,6 +823,9 @@ message FieldOptions { message OneofOptions { // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 1; // The parser stores options it doesn't recognize here. See above. @@ -834,6 +858,9 @@ message EnumOptions { optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 7; // The parser stores options it doesn't recognize here. See above. @@ -851,6 +878,9 @@ message EnumValueOptions { optional bool deprecated = 1 [default = false]; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 2; // Indicate that fields annotated with this enum value should not be printed @@ -858,6 +888,9 @@ message EnumValueOptions { // credentials. optional bool debug_redact = 3 [default = false]; + // Information about the support window of a feature value. + optional FieldOptions.FeatureSupport feature_support = 4; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -868,6 +901,9 @@ message EnumValueOptions { message ServiceOptions { // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 34; // Note: Field numbers 1 through 32 are reserved for Google's internal RPC @@ -913,6 +949,9 @@ message MethodOptions { [default = IDEMPOTENCY_UNKNOWN]; // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. optional FeatureSet features = 35; // The parser stores options it doesn't recognize here. See above. @@ -970,11 +1009,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_LEGACY, value: "EXPLICIT" }, edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } ]; @@ -988,11 +1026,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, + edition_defaults = { edition: EDITION_LEGACY, value: "CLOSED" }, edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } ]; @@ -1005,11 +1042,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_LEGACY, value: "EXPANDED" }, edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } ]; @@ -1017,16 +1053,16 @@ message FeatureSet { UTF8_VALIDATION_UNKNOWN = 0; VERIFY = 2; NONE = 3; + reserved 1; } optional Utf8Validation utf8_validation = 4 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, + edition_defaults = { edition: EDITION_LEGACY, value: "NONE" }, edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } ]; @@ -1039,11 +1075,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } + edition_defaults = { edition: EDITION_LEGACY, value: "LENGTH_PREFIXED" } ]; enum JsonFormat { @@ -1056,21 +1091,33 @@ message FeatureSet { targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, - // TODO Enable this in google3 once protoc rolls out. feature_support = { edition_introduced: EDITION_2023, }, - edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY_BEST_EFFORT" }, edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } ]; reserved 999; - extensions 1000; // for Protobuf C++ - extensions 1001; // for Protobuf Java - extensions 1002; // for Protobuf Go - - extensions 9990; // for deprecated Java Proto1 + extensions 1000 to 9994 [ + declaration = { + number: 1000, + full_name: ".pb.cpp", + type: ".pb.CppFeatures" + }, + declaration = { + number: 1001, + full_name: ".pb.java", + type: ".pb.JavaFeatures" + }, + declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" }, + declaration = { + number: 9990, + full_name: ".pb.proto1", + type: ".pb.Proto1Features" + } + ]; extensions 9995 to 9999; // For internal testing extensions 10000; // for https://github.com/bufbuild/protobuf-es @@ -1093,6 +1140,9 @@ message FeatureSetDefaults { // Defaults of features that can't be overridden in this edition. optional FeatureSet fixed_features = 5; + + reserved 1, 2; + reserved "features"; } repeated FeatureSetEditionDefault defaults = 1; @@ -1239,6 +1289,13 @@ message SourceCodeInfo { optional string trailing_comments = 4; repeated string leading_detached_comments = 6; } + + // Extensions for tooling. + extensions 536000000 [declaration = { + number: 536000000 + type: ".buf.descriptor.v1.SourceCodeInfoExtension" + full_name: ".buf.descriptor.v1.buf_source_code_info_extension" + }]; } // Describes the relationship between generated code and its original source diff --git a/protos/google/protobuf/duration.proto b/protos/injectivejs/google/protobuf/duration.proto similarity index 100% rename from protos/google/protobuf/duration.proto rename to protos/injectivejs/google/protobuf/duration.proto diff --git a/protos/google/protobuf/timestamp.proto b/protos/injectivejs/google/protobuf/timestamp.proto similarity index 100% rename from protos/google/protobuf/timestamp.proto rename to protos/injectivejs/google/protobuf/timestamp.proto diff --git a/protos/injectivejs/ibc/applications/transfer/v1/transfer.proto b/protos/injectivejs/ibc/applications/transfer/v1/transfer.proto new file mode 100644 index 00000000..8ae82cb6 --- /dev/null +++ b/protos/injectivejs/ibc/applications/transfer/v1/transfer.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"; + +// Params defines the set of IBC transfer parameters. +// NOTE: To prevent a single token from being transferred, set the +// TransfersEnabled parameter to true and then set the bank module's SendEnabled +// parameter for the denomination to false. +message Params { + // send_enabled enables or disables all cross-chain token transfers from this + // chain. + bool send_enabled = 1; + // receive_enabled enables or disables all cross-chain token transfers to this + // chain. + bool receive_enabled = 2; +} + +// Forwarding defines a list of port ID, channel ID pairs determining the path +// through which a packet must be forwarded, and an unwind boolean indicating if +// the coin should be unwinded to its native chain before forwarding. +message Forwarding { + // optional unwinding for the token transfered + bool unwind = 1; + // optional intermediate path through which packet will be forwarded + repeated Hop hops = 2 [(gogoproto.nullable) = false]; +} + +// Hop defines a port ID, channel ID pair specifying where tokens must be forwarded +// next in a multihop transfer. +message Hop { + option (gogoproto.goproto_stringer) = false; + string port_id = 1; + string channel_id = 2; +} diff --git a/protos/ibc/applications/transfer/v1/tx.proto b/protos/injectivejs/ibc/applications/transfer/v1/tx.proto similarity index 94% rename from protos/ibc/applications/transfer/v1/tx.proto rename to protos/injectivejs/ibc/applications/transfer/v1/tx.proto index 24101fff..69689688 100644 --- a/protos/ibc/applications/transfer/v1/tx.proto +++ b/protos/injectivejs/ibc/applications/transfer/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"; import "amino/amino.proto"; import "gogoproto/gogo.proto"; @@ -51,6 +51,8 @@ message MsgTransfer { string memo = 8; // tokens to be transferred repeated cosmos.base.v1beta1.Coin tokens = 9 [(gogoproto.nullable) = false]; + // optional forwarding information + Forwarding forwarding = 10; } // MsgTransferResponse defines the Msg/Transfer response type. @@ -78,4 +80,4 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -message MsgUpdateParamsResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} diff --git a/protos/ibc/core/channel/v1/channel.proto b/protos/injectivejs/ibc/core/channel/v1/channel.proto similarity index 99% rename from protos/ibc/core/channel/v1/channel.proto rename to protos/injectivejs/ibc/core/channel/v1/channel.proto index 242ff8fd..78df62bd 100644 --- a/protos/ibc/core/channel/v1/channel.proto +++ b/protos/injectivejs/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/v8/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/protos/ibc/core/channel/v1/tx.proto b/protos/injectivejs/ibc/core/channel/v1/tx.proto similarity index 99% rename from protos/ibc/core/channel/v1/tx.proto rename to protos/injectivejs/ibc/core/channel/v1/tx.proto index 3f30e8b8..06e85232 100644 --- a/protos/ibc/core/channel/v1/tx.proto +++ b/protos/injectivejs/ibc/core/channel/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; @@ -411,7 +411,7 @@ message MsgChannelUpgradeTimeout { string signer = 6; } -// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +// MsgChannelUpgradeTimeoutResponse defines the MsgChannelUpgradeTimeout response type message MsgChannelUpgradeTimeoutResponse {} // MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc diff --git a/protos/ibc/core/channel/v1/upgrade.proto b/protos/injectivejs/ibc/core/channel/v1/upgrade.proto similarity index 96% rename from protos/ibc/core/channel/v1/upgrade.proto rename to protos/injectivejs/ibc/core/channel/v1/upgrade.proto index 81530ed2..ea5ae929 100644 --- a/protos/ibc/core/channel/v1/upgrade.proto +++ b/protos/injectivejs/ibc/core/channel/v1/upgrade.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/protos/injectivejs/ibc/core/client/v1/client.proto b/protos/injectivejs/ibc/core/client/v1/client.proto new file mode 100644 index 00000000..d2ff2a28 --- /dev/null +++ b/protos/injectivejs/ibc/core/client/v1/client.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"; + +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; + // client state + google.protobuf.Any client_state = 2; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // 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; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// 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 +// +// Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. +// This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. +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.jsontag) = "revision_number"]; + // the height within the given revision + uint64 revision_height = 2 [(gogoproto.jsontag) = "revision_height"]; +} + +// 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; +} diff --git a/protos/ibc/core/client/v1/tx.proto b/protos/injectivejs/ibc/core/client/v1/tx.proto similarity index 97% rename from protos/ibc/core/client/v1/tx.proto rename to protos/injectivejs/ibc/core/client/v1/tx.proto index b504ab69..1e9e4f47 100644 --- a/protos/ibc/core/client/v1/tx.proto +++ b/protos/injectivejs/ibc/core/client/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"; import "cosmos/msg/v1/msg.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; @@ -52,7 +52,11 @@ message MsgCreateClient { } // MsgCreateClientResponse defines the Msg/CreateClient response type. -message MsgCreateClientResponse {} +message MsgCreateClientResponse { + option (gogoproto.goproto_getters) = false; + + string client_id = 1; +} // MsgUpdateClient defines an sdk.Msg to update a IBC client state using // the given client message. diff --git a/protos/ibc/core/commitment/v1/commitment.proto b/protos/injectivejs/ibc/core/commitment/v1/commitment.proto similarity index 75% rename from protos/ibc/core/commitment/v1/commitment.proto rename to protos/injectivejs/ibc/core/commitment/v1/commitment.proto index b4753be2..d3431f71 100644 --- a/protos/ibc/core/commitment/v1/commitment.proto +++ b/protos/injectivejs/ibc/core/commitment/v1/commitment.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.commitment.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types"; import "gogoproto/gogo.proto"; import "cosmos/ics23/v1/proofs.proto"; @@ -22,13 +22,6 @@ message MerklePrefix { 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 { - repeated string key_path = 1; -} - // MerkleProof is a wrapper type over a chain of CommitmentProofs. // It demonstrates membership or non-membership for an element or set of // elements, verifiable in conjunction with a known commitment root. Proofs diff --git a/protos/ibc/core/connection/v1/connection.proto b/protos/injectivejs/ibc/core/connection/v1/connection.proto similarity index 98% rename from protos/ibc/core/connection/v1/connection.proto rename to protos/injectivejs/ibc/core/connection/v1/connection.proto index 5b4554ca..c5aa79da 100644 --- a/protos/ibc/core/connection/v1/connection.proto +++ b/protos/injectivejs/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/v8/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/commitment/v1/commitment.proto"; diff --git a/protos/ibc/core/connection/v1/tx.proto b/protos/injectivejs/ibc/core/connection/v1/tx.proto similarity index 70% rename from protos/ibc/core/connection/v1/tx.proto rename to protos/injectivejs/ibc/core/connection/v1/tx.proto index 8e59c27d..894a8bcd 100644 --- a/protos/ibc/core/connection/v1/tx.proto +++ b/protos/injectivejs/ibc/core/connection/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; @@ -59,23 +59,25 @@ message MsgConnectionOpenTry { 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]; - 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]; + string previous_connection_id = 2 [deprecated = true]; + // Deprecated: this field is unused. + google.protobuf.Any client_state = 3 [deprecated = true]; + 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: `UNINITIALIZED -> // INIT` bytes proof_init = 8; - // proof of client state included in message - bytes proof_client = 9; - // proof of client consensus state - bytes proof_consensus = 10; - ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.nullable) = false]; + // Deprecated: this field is unused. + bytes proof_client = 9 [deprecated = true]; + // Deprecated: this field is unused. + bytes proof_consensus = 10 [deprecated = true]; + // Deprecated: this field is unused. + ibc.core.client.v1.Height consensus_height = 11 [deprecated = true, (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; + // Deprecated: this field is unused. + bytes host_consensus_state_proof = 13 [deprecated = true]; } // MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. @@ -88,22 +90,24 @@ message MsgConnectionOpenAck { option (gogoproto.goproto_getters) = 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]; + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + // Deprecated: this field is unused. + google.protobuf.Any client_state = 4 [deprecated = true]; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain B: `UNINITIALIZED -> // TRYOPEN` bytes proof_try = 6; - // proof of client state included in message - bytes proof_client = 7; - // proof of client consensus state - bytes proof_consensus = 8; - ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.nullable) = false]; + // Deprecated: this field is unused. + bytes proof_client = 7 [deprecated = true]; + // Deprecated: this field is unused. + bytes proof_consensus = 8 [deprecated = true]; + // Deprecated: this field is unused. + ibc.core.client.v1.Height consensus_height = 9 [deprecated = true, (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; + // Deprecated: this field is unused. + bytes host_consensus_state_proof = 11 [deprecated = true]; } // MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. @@ -143,4 +147,4 @@ message MsgUpdateParams { } // MsgUpdateParamsResponse defines the MsgUpdateParams response type. -message MsgUpdateParamsResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} diff --git a/protos/injectivejs/injective/auction/v1beta1/auction.proto b/protos/injectivejs/injective/auction/v1beta1/auction.proto new file mode 100644 index 00000000..c5f95038 --- /dev/null +++ b/protos/injectivejs/injective/auction/v1beta1/auction.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; +package injective.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/auction/types"; + +message Params { + option (gogoproto.equal) = true; + option (amino.name) = "auction/Params"; + + // auction_period_duration defines the auction period duration + int64 auction_period = 1; + // min_next_bid_increment_rate defines the minimum increment rate for new bids + string min_next_bid_increment_rate = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message Bid { + string bidder = 1 [ + (gogoproto.jsontag) = "bidder", + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} + +message LastAuctionResult { + // winner describes the address of the winner + string winner = 1; + // amount describes the amount the winner get from the auction + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; + // round defines the round number of auction + uint64 round = 3; +} + +message EventBid { + // bidder describes the address of bidder + string bidder = 1; + // amount describes the amount the bidder put on the auction + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; + // round defines the round number of auction + uint64 round = 3; +} + +message EventAuctionResult { + // winner describes the address of the winner + string winner = 1; + // amount describes the amount the winner get from the auction + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; + // round defines the round number of auction + uint64 round = 3; +} + +message EventAuctionStart { + // round defines the round number of auction + uint64 round = 1; + // ending_timestamp describes auction end time + int64 ending_timestamp = 2; + // new_basket describes auction module balance at the time of new auction + // start + repeated cosmos.base.v1beta1.Coin new_basket = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/auction/v1beta1/genesis.proto b/protos/injectivejs/injective/auction/v1beta1/genesis.proto new file mode 100644 index 00000000..08b5b9f2 --- /dev/null +++ b/protos/injectivejs/injective/auction/v1beta1/genesis.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package injective.auction.v1beta1; + +import "injective/auction/v1beta1/auction.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/auction/types"; + +// GenesisState defines the auction module's genesis state. +message GenesisState { + // params defines all the parameters of related to auction. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // current auction round + uint64 auction_round = 2; + + // current highest bid + Bid highest_bid = 3; + + // auction ending timestamp + int64 auction_ending_timestamp = 4; + + // last auction result + LastAuctionResult last_auction_result = 5; +} diff --git a/protos/injectivejs/injective/auction/v1beta1/query.proto b/protos/injectivejs/injective/auction/v1beta1/query.proto new file mode 100644 index 00000000..44e46d60 --- /dev/null +++ b/protos/injectivejs/injective/auction/v1beta1/query.proto @@ -0,0 +1,86 @@ +syntax = "proto3"; +package injective.auction.v1beta1; + +import "google/api/annotations.proto"; +import "injective/auction/v1beta1/auction.proto"; +import "injective/auction/v1beta1/genesis.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/auction/types"; + +// Query defines the gRPC querier service. +service Query { + + // Retrieves auction params + rpc AuctionParams(QueryAuctionParamsRequest) + returns (QueryAuctionParamsResponse) { + option (google.api.http).get = "/injective/auction/v1beta1/params"; + } + + // Retrieves current auction basket with current highest bid and bidder + rpc CurrentAuctionBasket(QueryCurrentAuctionBasketRequest) + returns (QueryCurrentAuctionBasketResponse) { + option (google.api.http).get = "/injective/auction/v1beta1/basket"; + }; + + // Retrieves the entire auction module's state + rpc AuctionModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/injective/auction/v1beta1/module_state"; + } + + rpc LastAuctionResult(QueryLastAuctionResultRequest) + returns (QueryLastAuctionResultResponse) { + option (google.api.http).get = + "/injective/auction/v1beta1/last_auction_result"; + } +} + +// QueryAuctionParamsRequest is the request type for the Query/AuctionParams RPC +// method. +message QueryAuctionParamsRequest {} + +// QueryAuctionParamsRequest is the response type for the Query/AuctionParams +// RPC method. +message QueryAuctionParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryCurrentAuctionBasketRequest is the request type for the +// Query/CurrentAuctionBasket RPC method. +message QueryCurrentAuctionBasketRequest {} + +// QueryCurrentAuctionBasketResponse is the response type for the +// Query/CurrentAuctionBasket RPC method. +message QueryCurrentAuctionBasketResponse { + // amount describes the amount put on auction + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + // auctionRound describes current auction round + uint64 auctionRound = 2; + // auctionClosingTime describes auction close time for the round + int64 auctionClosingTime = 3; + // highestBidder describes highest bidder on current round + string highestBidder = 4; + // highestBidAmount describes highest bid amount on current round + string highestBidAmount = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryModuleStateRequest is the request type for the Query/AuctionModuleState +// RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the +// Query/AuctionModuleState RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } + +message QueryLastAuctionResultRequest {} + +message QueryLastAuctionResultResponse { + LastAuctionResult last_auction_result = 1; +} diff --git a/protos/injectivejs/injective/auction/v1beta1/tx.proto b/protos/injectivejs/injective/auction/v1beta1/tx.proto new file mode 100644 index 00000000..34d7859b --- /dev/null +++ b/protos/injectivejs/injective/auction/v1beta1/tx.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package injective.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "injective/auction/v1beta1/auction.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/auction/types"; + +// Msg defines the auction Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Bid defines a method for placing a bid for an auction + rpc Bid(MsgBid) returns (MsgBidResponse); + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// Bid defines a SDK message for placing a bid for an auction +message MsgBid { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (amino.name) = "auction/MsgBid"; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // amount of the bid in INJ tokens + cosmos.base.v1beta1.Coin bid_amount = 2 [ (gogoproto.nullable) = false ]; + // the current auction round being bid on + uint64 round = 3; +} + +message MsgBidResponse {} + +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "auction/MsgUpdateParams"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the ocr parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/protos/injectivejs/injective/crypto/v1beta1/ethsecp256k1/keys.proto b/protos/injectivejs/injective/crypto/v1beta1/ethsecp256k1/keys.proto new file mode 100644 index 00000000..c5e13a1b --- /dev/null +++ b/protos/injectivejs/injective/crypto/v1beta1/ethsecp256k1/keys.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package injective.crypto.v1beta1.ethsecp256k1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/crypto/ethsecp256k1"; + +// PubKey defines a type alias for an ecdsa.PublicKey that implements +// Tendermint's PubKey interface. It represents the 33-byte compressed public +// key format. +message PubKey { + option (amino.name) = "injective/PubKeyEthSecp256k1"; + // 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; +} + +// PrivKey defines a type alias for an ecdsa.PrivateKey that implements +// Tendermint's PrivateKey interface. +message PrivKey { + option (amino.name) = "injective/PrivKeyEthSecp256k1"; + option (amino.message_encoding) = "key_field"; + + bytes key = 1; +} diff --git a/protos/injectivejs/injective/exchange/v1beta1/authz.proto b/protos/injectivejs/injective/exchange/v1beta1/authz.proto new file mode 100644 index 00000000..0d2bdea8 --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/authz.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +// spot authz messages +message CreateSpotLimitOrderAuthz { + option (amino.name) = "exchange/CreateSpotLimitOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message CreateSpotMarketOrderAuthz { + option (amino.name) = "exchange/CreateSpotMarketOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message BatchCreateSpotLimitOrdersAuthz { + option (amino.name) = "exchange/BatchCreateSpotLimitOrdersAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message CancelSpotOrderAuthz { + option (amino.name) = "exchange/CancelSpotOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message BatchCancelSpotOrdersAuthz { + option (amino.name) = "exchange/BatchCancelSpotOrdersAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +// derivative authz messages +message CreateDerivativeLimitOrderAuthz { + option (amino.name) = "exchange/CreateDerivativeLimitOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message CreateDerivativeMarketOrderAuthz { + option (amino.name) = "exchange/CreateDerivativeMarketOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message BatchCreateDerivativeLimitOrdersAuthz { + option (amino.name) = "exchange/BatchCreateDerivativeLimitOrdersAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message CancelDerivativeOrderAuthz { + option (amino.name) = "exchange/CancelDerivativeOrderAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +message BatchCancelDerivativeOrdersAuthz { + option (amino.name) = "exchange/BatchCancelDerivativeOrdersAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string market_ids = 2; +} + +// common authz message used in both spot & derivative markets +message BatchUpdateOrdersAuthz { + option (amino.name) = "exchange/BatchUpdateOrdersAuthz"; + option (cosmos_proto.implements_interface) = "Authorization"; + string subaccount_id = 1; + repeated string spot_markets = 2; + repeated string derivative_markets = 3; +} diff --git a/protos/injectivejs/injective/exchange/v1beta1/events.proto b/protos/injectivejs/injective/exchange/v1beta1/events.proto new file mode 100644 index 00000000..22cbafdd --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/events.proto @@ -0,0 +1,240 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "injective/exchange/v1beta1/exchange.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +message EventBatchSpotExecution { + string market_id = 1; + bool is_buy = 2; + ExecutionType executionType = 3; + repeated TradeLog trades = 4; +} + +message EventBatchDerivativeExecution { + string market_id = 1; + bool is_buy = 2; + bool is_liquidation = 3; + // nil for time expiry futures + string cumulative_funding = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + ExecutionType executionType = 5; + repeated DerivativeTradeLog trades = 6; +} + +message EventLostFundsFromLiquidation { + string market_id = 1; + bytes subaccount_id = 2; + string lost_funds_from_available_during_payout = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string lost_funds_from_order_cancels = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message EventBatchDerivativePosition { + string market_id = 1; + repeated SubaccountPosition positions = 2; +} + +message EventDerivativeMarketPaused { + string market_id = 1; + string settle_price = 2; + string total_missing_funds = 3; + string missing_funds_rate = 4; +} + +message EventMarketBeyondBankruptcy { + string market_id = 1; + string settle_price = 2; + string missing_market_funds = 3; +} + +message EventAllPositionsHaircut { + string market_id = 1; + string settle_price = 2; + string missing_funds_rate = 3; +} + +message EventBinaryOptionsMarketUpdate { + BinaryOptionsMarket market = 1 [ (gogoproto.nullable) = false ]; +} + +message EventNewSpotOrders { + string market_id = 1; + repeated SpotLimitOrder buy_orders = 2; + repeated SpotLimitOrder sell_orders = 3; +} + +message EventNewDerivativeOrders { + string market_id = 1; + repeated DerivativeLimitOrder buy_orders = 2; + repeated DerivativeLimitOrder sell_orders = 3; +} + +message EventCancelSpotOrder { + string market_id = 1; + SpotLimitOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +message EventSpotMarketUpdate { + SpotMarket market = 1 [ (gogoproto.nullable) = false ]; +} + +message EventPerpetualMarketUpdate { + DerivativeMarket market = 1 [ (gogoproto.nullable) = false ]; + PerpetualMarketInfo perpetual_market_info = 2 [ (gogoproto.nullable) = true ]; + PerpetualMarketFunding funding = 3 [ (gogoproto.nullable) = true ]; +} + +message EventExpiryFuturesMarketUpdate { + DerivativeMarket market = 1 [ (gogoproto.nullable) = false ]; + ExpiryFuturesMarketInfo expiry_futures_market_info = 3 + [ (gogoproto.nullable) = true ]; +} + +message EventPerpetualMarketFundingUpdate { + string market_id = 1; + PerpetualMarketFunding funding = 2 [ (gogoproto.nullable) = false ]; + bool is_hourly_funding = 3; + string funding_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + string mark_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message EventSubaccountDeposit { + string src_address = 1; + bytes subaccount_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message EventSubaccountWithdraw { + bytes subaccount_id = 1; + string dst_address = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message EventSubaccountBalanceTransfer { + string src_subaccount_id = 1; + string dst_subaccount_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message EventBatchDepositUpdate { repeated DepositUpdate deposit_updates = 1; } + +message DerivativeMarketOrderCancel { + DerivativeMarketOrder market_order = 1 [ (gogoproto.nullable) = true ]; + string cancel_quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message EventCancelDerivativeOrder { + string market_id = 1; + bool isLimitCancel = 2; + DerivativeLimitOrder limit_order = 3 [ (gogoproto.nullable) = true ]; + DerivativeMarketOrderCancel market_order_cancel = 4 + [ (gogoproto.nullable) = true ]; +} + +message EventFeeDiscountSchedule { FeeDiscountSchedule schedule = 1; } + +message EventTradingRewardCampaignUpdate { + TradingRewardCampaignInfo campaign_info = 1; + repeated CampaignRewardPool campaign_reward_pools = 2; +} + +message EventTradingRewardDistribution { + repeated AccountRewards account_rewards = 1; +} + +message EventNewConditionalDerivativeOrder { + string market_id = 1; + DerivativeOrder order = 2; + bytes hash = 3; + bool is_market = 4; +} + +message EventCancelConditionalDerivativeOrder { + string market_id = 1; + bool isLimitCancel = 2; + DerivativeLimitOrder limit_order = 3 [ (gogoproto.nullable) = true ]; + DerivativeMarketOrder market_order = 4 [ (gogoproto.nullable) = true ]; +} + +message EventConditionalDerivativeOrderTrigger { + bytes market_id = 1; + bool isLimitTrigger = 2; + bytes triggered_order_hash = 3; + bytes placed_order_hash = 4; + string triggered_order_cid = 5; +} + +message EventOrderFail { + bytes account = 1; + repeated bytes hashes = 2; + repeated uint32 flags = 3; + repeated string cids = 4; +} + +message EventAtomicMarketOrderFeeMultipliersUpdated { + repeated MarketFeeMultiplier market_fee_multipliers = 1; +} + +message EventOrderbookUpdate { + repeated OrderbookUpdate spot_updates = 1; + repeated OrderbookUpdate derivative_updates = 2; +} + +message OrderbookUpdate { + uint64 seq = 1; + Orderbook orderbook = 2; +} + +message Orderbook { + bytes market_id = 1; + repeated Level buy_levels = 2; + repeated Level sell_levels = 3; +} + +message EventGrantAuthorizations { + string granter = 1; + repeated GrantAuthorization grants = 2; +} + +message EventGrantActivation { + string grantee = 1; + string granter = 2; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message EventInvalidGrant { + string grantee = 1; + string granter = 2; +} + +message EventOrderCancelFail { + string market_id = 1; + string subaccount_id = 2; + string order_hash = 3; + string cid = 4; + string description = 5; +} diff --git a/protos/injectivejs/injective/exchange/v1beta1/exchange.proto b/protos/injectivejs/injective/exchange/v1beta1/exchange.proto new file mode 100644 index 00000000..c7b837b6 --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/exchange.proto @@ -0,0 +1,984 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +enum AtomicMarketOrderAccessLevel { + Nobody = 0; + // currently unsupported + BeginBlockerSmartContractsOnly = 1; + SmartContractsOnly = 2; + Everyone = 3; +} + +message Params { + option (gogoproto.equal) = true; + option (amino.name) = "exchange/Params"; + + // spot_market_instant_listing_fee defines the expedited fee in INJ required + // to create a spot market by bypassing governance + cosmos.base.v1beta1.Coin spot_market_instant_listing_fee = 1 + [ (gogoproto.nullable) = false ]; + + // derivative_market_instant_listing_fee defines the expedited fee in INJ + // required to create a derivative market by bypassing governance + cosmos.base.v1beta1.Coin derivative_market_instant_listing_fee = 2 + [ (gogoproto.nullable) = false ]; + + // default_spot_maker_fee defines the default exchange trade fee for makers on + // a spot market + string default_spot_maker_fee_rate = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_spot_taker_fee_rate defines the default exchange trade fee rate for + // takers on a new spot market + string default_spot_taker_fee_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_derivative_maker_fee defines the default exchange trade fee for + // makers on a new derivative market + string default_derivative_maker_fee_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_derivative_taker_fee defines the default exchange trade fee for + // takers on a new derivative market + string default_derivative_taker_fee_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_initial_margin_ratio defines the default initial margin ratio on a + // new derivative market + string default_initial_margin_ratio = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_maintenance_margin_ratio defines the default maintenance margin + // ratio on a new derivative market + string default_maintenance_margin_ratio = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_funding_interval defines the default funding interval on a + // derivative market + int64 default_funding_interval = 9; + + // funding_multiple defines the timestamp multiple that the funding timestamp + // should be a multiple of + int64 funding_multiple = 10; + + // relayer_fee_share_rate defines the trade fee share percentage that goes to + // relayers + string relayer_fee_share_rate = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // default_hourly_funding_rate_cap defines the default maximum absolute value + // of the hourly funding rate + string default_hourly_funding_rate_cap = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // hourly_interest_rate defines the hourly interest rate + string default_hourly_interest_rate = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // max_derivative_order_side_count defines the maximum number of derivative + // active orders a subaccount can have for a given orderbook side + uint32 max_derivative_order_side_count = 14; + + // inj_reward_staked_requirement_threshold defines the threshold on INJ + // rewards after which one also needs staked INJ to receive more + string inj_reward_staked_requirement_threshold = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // the trading_rewards_vesting_duration defines the vesting times for trading + // rewards + int64 trading_rewards_vesting_duration = 16; + + // liquidator_reward_share_rate defines the ratio of the split of the surplus + // collateral that goes to the liquidator + string liquidator_reward_share_rate = 17 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // binary_options_market_instant_listing_fee defines the expedited fee in INJ + // required to create a derivative market by bypassing governance + cosmos.base.v1beta1.Coin binary_options_market_instant_listing_fee = 18 + [ (gogoproto.nullable) = false ]; + // atomic_market_order_access_level defines the required access permissions + // for executing atomic market orders + AtomicMarketOrderAccessLevel atomic_market_order_access_level = 19; + + // spot_atomic_market_order_fee_multiplier defines the default multiplier for + // executing atomic market orders in spot markets + string spot_atomic_market_order_fee_multiplier = 20 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // derivative_atomic_market_order_fee_multiplier defines the default + // multiplier for executing atomic market orders in derivative markets + string derivative_atomic_market_order_fee_multiplier = 21 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // binary_options_atomic_market_order_fee_multiplier defines the default + // multiplier for executing atomic market orders in binary markets + string binary_options_atomic_market_order_fee_multiplier = 22 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // minimal_protocol_fee_rate defines the minimal protocol fee rate + string minimal_protocol_fee_rate = 23 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // is_instant_derivative_market_launch_enabled defines whether instant + // derivative market launch is enabled + bool is_instant_derivative_market_launch_enabled = 24; + + int64 post_only_mode_height_threshold = 25; + + // Maximum time in seconds since the last mark price update to allow a + // decrease in margin + int64 margin_decrease_price_timestamp_threshold_seconds = 26; + + // List of addresses that are allowed to perform exchange admin operations + repeated string exchange_admins = 27; + + // inj_auction_max_cap defines the maximum cap for INJ sent to auction + string inj_auction_max_cap = 28 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +enum MarketStatus { + Unspecified = 0; + Active = 1; + Paused = 2; + Demolished = 3; + Expired = 4; +} + +message MarketFeeMultiplier { + option (gogoproto.goproto_getters) = false; + + string market_id = 1; + + string fee_multiplier = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// An object describing a derivative market in the Injective Futures Protocol. +message DerivativeMarket { + option (gogoproto.goproto_getters) = false; + + // Ticker for the derivative contract. + string ticker = 1; + // Oracle base currency + string oracle_base = 2; + // Oracle quote currency + string oracle_quote = 3; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 4; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 5; + // Address of the quote currency denomination for the derivative contract + string quote_denom = 6; + // Unique market ID. + string market_id = 7; + // initial_margin_ratio defines the initial margin ratio of a derivative + // market + string initial_margin_ratio = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // maintenance_margin_ratio defines the maintenance margin ratio of a + // derivative market + string maintenance_margin_ratio = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // maker_fee_rate defines the maker fee rate of a derivative market + string maker_fee_rate = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // taker_fee_rate defines the taker fee rate of a derivative market + string taker_fee_rate = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // relayer_fee_share_rate defines the percentage of the transaction fee shared + // with the relayer in a derivative market + string relayer_fee_share_rate = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // true if the market is a perpetual market. false if the market is an expiry + // futures market + bool isPerpetual = 13; + // Status of the market + MarketStatus status = 14; + // min_price_tick_size defines the minimum tick size that the price and margin + // required for orders in the market + string min_price_tick_size = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the quantity + // required for orders in the market + string min_quantity_tick_size = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 17 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // current market admin + string admin = 18; + // level of admin permissions + uint32 admin_permissions = 19; +} +// An object describing a binary options market in Injective Protocol. +message BinaryOptionsMarket { + option (gogoproto.goproto_getters) = false; + + // Ticker for the derivative contract. + string ticker = 1; + // Oracle symbol + string oracle_symbol = 2; + // Oracle Provider + string oracle_provider = 3; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 4; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 5; + // expiration timestamp + int64 expiration_timestamp = 6; + // expiration timestamp + int64 settlement_timestamp = 7; + // admin of the market + string admin = 8; + // Address of the quote currency denomination for the binary options contract + string quote_denom = 9; + // Unique market ID. + string market_id = 10; + // maker_fee_rate defines the maker fee rate of a binary options market + string maker_fee_rate = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // taker_fee_rate defines the taker fee rate of a derivative market + string taker_fee_rate = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // relayer_fee_share_rate defines the percentage of the transaction fee shared + // with the relayer in a derivative market + string relayer_fee_share_rate = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Status of the market + MarketStatus status = 14; + // min_price_tick_size defines the minimum tick size that the price and margin + // required for orders in the market + string min_price_tick_size = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the quantity + // required for orders in the market + string min_quantity_tick_size = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string settlement_price = 17 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 18 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // level of admin permissions + uint32 admin_permissions = 19; +} + +message ExpiryFuturesMarketInfo { + // market ID. + string market_id = 1; + // expiration_timestamp defines the expiration time for a time expiry futures + // market. + int64 expiration_timestamp = 2; + // expiration_twap_start_timestamp defines the start time of the TWAP + // calculation window + int64 twap_start_timestamp = 3; + // expiration_twap_start_price_cumulative defines the cumulative price for the + // start of the TWAP window + string expiration_twap_start_price_cumulative = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // settlement_price defines the settlement price for a time expiry futures + // market. + string settlement_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message PerpetualMarketInfo { + // market ID. + string market_id = 1; + // hourly_funding_rate_cap defines the maximum absolute value of the hourly + // funding rate + string hourly_funding_rate_cap = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // hourly_interest_rate defines the hourly interest rate + string hourly_interest_rate = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // next_funding_timestamp defines the next funding timestamp in seconds of a + // perpetual market + int64 next_funding_timestamp = 4; + // funding_interval defines the next funding interval in seconds of a + // perpetual market. + int64 funding_interval = 5; +} + +message PerpetualMarketFunding { + // cumulative_funding defines the cumulative funding of a perpetual market. + string cumulative_funding = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // cumulative_price defines the cumulative price for the current hour up to + // the last timestamp + string cumulative_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + int64 last_timestamp = 3; +} + +message DerivativeMarketSettlementInfo { + // market ID. + string market_id = 1; + // settlement_price defines the settlement price + string settlement_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message NextFundingTimestamp { int64 next_timestamp = 1; } + +message MidPriceAndTOB { + // mid price of the market + string mid_price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best buy price of the market + string best_buy_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best sell price of the market + string best_sell_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// An object describing trade pair of two assets. +message SpotMarket { + // A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote + // asset. + string ticker = 1; + // Coin denom used for the base asset + string base_denom = 2; + // Coin used for the quote asset + string quote_denom = 3; + // maker_fee_rate defines the fee percentage makers pay when trading + string maker_fee_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // taker_fee_rate defines the fee percentage takers pay when trading + string taker_fee_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // relayer_fee_share_rate defines the percentage of the transaction fee shared + // with the relayer in a derivative market + string relayer_fee_share_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Unique market ID. + string market_id = 7; + // Status of the market + MarketStatus status = 8; + // min_price_tick_size defines the minimum tick size that the price required + // for orders in the market + string min_price_tick_size = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the quantity + // required for orders in the market + string min_quantity_tick_size = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // current market admin + string admin = 12; + // level of admin permissions + uint32 admin_permissions = 13; +} + +// A subaccount's deposit for a given base currency +message Deposit { + string available_balance = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total_balance = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SubaccountTradeNonce { uint32 nonce = 1; } + +message OrderInfo { + // bytes32 subaccount ID that created the order + string subaccount_id = 1; + // address fee_recipient address that will receive fees for the order + string fee_recipient = 2; + // price of the order + string price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity of the order + string quantity = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string cid = 5; +} + +enum OrderType { + UNSPECIFIED = 0 [ (gogoproto.enumvalue_customname) = "UNSPECIFIED" ]; + BUY = 1 [ (gogoproto.enumvalue_customname) = "BUY" ]; + SELL = 2 [ (gogoproto.enumvalue_customname) = "SELL" ]; + STOP_BUY = 3 [ (gogoproto.enumvalue_customname) = "STOP_BUY" ]; + STOP_SELL = 4 [ (gogoproto.enumvalue_customname) = "STOP_SELL" ]; + TAKE_BUY = 5 [ (gogoproto.enumvalue_customname) = "TAKE_BUY" ]; + TAKE_SELL = 6 [ (gogoproto.enumvalue_customname) = "TAKE_SELL" ]; + BUY_PO = 7 [ (gogoproto.enumvalue_customname) = "BUY_PO" ]; + SELL_PO = 8 [ (gogoproto.enumvalue_customname) = "SELL_PO" ]; + BUY_ATOMIC = 9 [ (gogoproto.enumvalue_customname) = "BUY_ATOMIC" ]; + SELL_ATOMIC = 10 [ (gogoproto.enumvalue_customname) = "SELL_ATOMIC" ]; +} + +message SpotOrder { + // market_id represents the unique ID of the market + string market_id = 1; + // order_info contains the information of the order + OrderInfo order_info = 2 [ (gogoproto.nullable) = false ]; + // order types + OrderType order_type = 3; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// A valid Spot limit order with Metadata. +message SpotLimitOrder { + // order_info contains the information of the order + OrderInfo order_info = 1 [ (gogoproto.nullable) = false ]; + // order types + OrderType order_type = 2; + // the amount of the quantity remaining fillable + string fillable = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + bytes order_hash = 5; +} + +// A valid Spot market order with Metadata. +message SpotMarketOrder { + // order_info contains the information of the order + OrderInfo order_info = 1 [ (gogoproto.nullable) = false ]; + string balance_hold = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes order_hash = 3; + // order types + OrderType order_type = 4; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message DerivativeOrder { + // market_id represents the unique ID of the market + string market_id = 1; + // order_info contains the information of the order + OrderInfo order_info = 2 [ (gogoproto.nullable) = false ]; + // order types + OrderType order_type = 3; + // margin is the margin used by the limit order + string margin = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message SubaccountOrderbookMetadata { + uint32 vanilla_limit_order_count = 1; + uint32 reduce_only_limit_order_count = 2; + // AggregateReduceOnlyQuantity is the aggregate fillable quantity of the + // subaccount's reduce-only limit orders in the given direction. + string aggregate_reduce_only_quantity = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // AggregateVanillaQuantity is the aggregate fillable quantity of the + // subaccount's vanilla limit orders in the given direction. + string aggregate_vanilla_quantity = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + uint32 vanilla_conditional_order_count = 5; + uint32 reduce_only_conditional_order_count = 6; +} + +message SubaccountOrder { + // price of the order + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the amount of the quantity remaining fillable + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bool isReduceOnly = 3; + string cid = 4; +} + +message SubaccountOrderData { + SubaccountOrder order = 1; + bytes order_hash = 2; +} + +// A valid Derivative limit order with Metadata. +message DerivativeLimitOrder { + // order_info contains the information of the order + OrderInfo order_info = 1 [ (gogoproto.nullable) = false ]; + // order types + OrderType order_type = 2; + // margin is the margin used by the limit order + string margin = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the amount of the quantity remaining fillable + string fillable = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + bytes order_hash = 6; +} + +// A valid Derivative market order with Metadata. +message DerivativeMarketOrder { + // order_info contains the information of the order + OrderInfo order_info = 1 [ (gogoproto.nullable) = false ]; + // order types + OrderType order_type = 2; + string margin = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string margin_hold = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // trigger_price is the trigger price used by stop/take orders + string trigger_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + bytes order_hash = 6; +} + +message Position { + bool isLong = 1; + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string entry_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string margin = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string cumulative_funding_entry = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MarketOrderIndicator { + // market_id represents the unique ID of the market + string market_id = 1; + bool isBuy = 2; +} + +message TradeLog { + string quantity = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // bytes32 subaccount ID that executed the trade + bytes subaccount_id = 3; + string fee = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes order_hash = 5; + bytes fee_recipient_address = 6 [ (gogoproto.nullable) = true ]; + string cid = 7; +} + +message PositionDelta { + bool is_long = 1; + string execution_quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string execution_margin = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string execution_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message DerivativeTradeLog { + bytes subaccount_id = 1; + PositionDelta position_delta = 2; + string payout = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string fee = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes order_hash = 5; + bytes fee_recipient_address = 6 [ (gogoproto.nullable) = true ]; + string cid = 7; + string pnl = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +enum ExecutionType { + UnspecifiedExecutionType = 0; + Market = 1; + LimitFill = 2; + LimitMatchRestingOrder = 3; + LimitMatchNewOrder = 4; + MarketLiquidation = 5; + ExpiryMarketSettlement = 6; +} + +message SubaccountPosition { + Position position = 1; + bytes subaccount_id = 2; +} + +message SubaccountDeposit { + bytes subaccount_id = 1; + Deposit deposit = 2; +} + +message DepositUpdate { + string denom = 1; + repeated SubaccountDeposit deposits = 2; +} + +message PointsMultiplier { + string maker_points_multiplier = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string taker_points_multiplier = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message TradingRewardCampaignBoostInfo { + repeated string boosted_spot_market_ids = 1; + repeated PointsMultiplier spot_market_multipliers = 2 + [ (gogoproto.nullable) = false ]; + repeated string boosted_derivative_market_ids = 3; + repeated PointsMultiplier derivative_market_multipliers = 4 + [ (gogoproto.nullable) = false ]; +} + +message CampaignRewardPool { + int64 start_timestamp = 1; + // max_campaign_rewards are the maximum reward amounts to be disbursed at the + // end of the campaign + repeated cosmos.base.v1beta1.Coin max_campaign_rewards = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message TradingRewardCampaignInfo { + // number of seconds of the duration of each campaign + int64 campaign_duration_seconds = 1; + // the trading fee quote denoms which will be counted for the rewards + repeated string quote_denoms = 2; + // the optional boost info for markets + TradingRewardCampaignBoostInfo trading_reward_boost_info = 3; + // the marketIDs which are disqualified from being rewarded + repeated string disqualified_market_ids = 4; +} + +message FeeDiscountTierInfo { + string maker_discount_rate = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string taker_discount_rate = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string staked_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string volume = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message FeeDiscountSchedule { + uint64 bucket_count = 1; + int64 bucket_duration = 2; + // the trading fee quote denoms which will be counted for the fee paid + // contribution + repeated string quote_denoms = 3; + // the fee discount tiers + repeated FeeDiscountTierInfo tier_infos = 4; + // the marketIDs which are disqualified from contributing to the fee paid + // amount + repeated string disqualified_market_ids = 5; +} + +message FeeDiscountTierTTL { + uint64 tier = 1; + int64 ttl_timestamp = 2; +} + +message VolumeRecord { + string maker_volume = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string taker_volume = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message AccountRewards { + string account = 1; + repeated cosmos.base.v1beta1.Coin rewards = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message TradeRecords { + string market_id = 1; + repeated TradeRecord latest_trade_records = 2; +} + +message SubaccountIDs { repeated bytes subaccount_ids = 1; } + +message TradeRecord { + int64 timestamp = 1; + + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string quantity = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +enum OrderMask { + UNUSED = 0 [ (gogoproto.enumvalue_customname) = "UNUSED" ]; + ANY = 1 [ (gogoproto.enumvalue_customname) = "ANY" ]; + REGULAR = 2 [ (gogoproto.enumvalue_customname) = "REGULAR" ]; + CONDITIONAL = 4 [ (gogoproto.enumvalue_customname) = "CONDITIONAL" ]; + DIRECTION_BUY_OR_HIGHER = 8 + [ (gogoproto.enumvalue_customname) = + "BUY_OR_HIGHER" ]; // for conditional orders means HIGHER + DIRECTION_SELL_OR_LOWER = 16 + [ (gogoproto.enumvalue_customname) = + "SELL_OR_LOWER" ]; // for conditional orders means LOWER + TYPE_MARKET = 32 [ (gogoproto.enumvalue_customname) = "MARKET" ]; + TYPE_LIMIT = 64 [ (gogoproto.enumvalue_customname) = "LIMIT" ]; +} + +message Level { + // price + string p = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity + string q = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message AggregateSubaccountVolumeRecord { + string subaccount_id = 1; + repeated MarketVolume market_volumes = 2; +} + +message AggregateAccountVolumeRecord { + string account = 1; + repeated MarketVolume market_volumes = 2; +} + +message MarketVolume { + string market_id = 1; + VolumeRecord volume = 2 [ (gogoproto.nullable) = false ]; +} + +message DenomDecimals { + string denom = 1; + uint64 decimals = 2; +} + +message GrantAuthorization { + string grantee = 1; + string amount = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message ActiveGrant { + string granter = 1; + string amount = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message EffectiveGrant { + string granter = 1; + string net_granted_stake = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + bool is_valid = 3; +} diff --git a/protos/injectivejs/injective/exchange/v1beta1/genesis.proto b/protos/injectivejs/injective/exchange/v1beta1/genesis.proto new file mode 100644 index 00000000..eccb4363 --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/genesis.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "injective/exchange/v1beta1/exchange.proto"; +import "injective/exchange/v1beta1/tx.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +// GenesisState defines the exchange module's genesis state. +message GenesisState { + // params defines all the parameters of related to exchange. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // spot_markets is an array containing the genesis trade pairs + repeated SpotMarket spot_markets = 2; + + // derivative_markets is an array containing the genesis derivative markets + repeated DerivativeMarket derivative_markets = 3; + + // spot_orderbook defines the spot exchange limit orderbook active at genesis. + repeated SpotOrderBook spot_orderbook = 4 [ (gogoproto.nullable) = false ]; + + // derivative_orderbook defines the derivative exchange limit orderbook active + // at genesis. + repeated DerivativeOrderBook derivative_orderbook = 5 + [ (gogoproto.nullable) = false ]; + + // balances defines the exchange users balances active at genesis. + repeated Balance balances = 6 [ (gogoproto.nullable) = false ]; + + // positions defines the exchange derivative positions at genesis + repeated DerivativePosition positions = 7 [ (gogoproto.nullable) = false ]; + + // subaccount_trade_nonces defines the subaccount trade nonces for the + // subaccounts at genesis + repeated SubaccountNonce subaccount_trade_nonces = 8 + [ (gogoproto.nullable) = false ]; + + // expiry_futures_market_info defines the market info for the expiry futures + // markets at genesis + repeated ExpiryFuturesMarketInfoState expiry_futures_market_info_state = 9 + [ (gogoproto.nullable) = false ]; + + // perpetual_market_info defines the market info for the perpetual derivative + // markets at genesis + repeated PerpetualMarketInfo perpetual_market_info = 10 + [ (gogoproto.nullable) = false ]; + + // perpetual_market_funding_state defines the funding state for the perpetual + // derivative markets at genesis + repeated PerpetualMarketFundingState perpetual_market_funding_state = 11 + [ (gogoproto.nullable) = false ]; + + // derivative_market_settlement_scheduled defines the scheduled markets for + // settlement at genesis + repeated DerivativeMarketSettlementInfo + derivative_market_settlement_scheduled = 12 + [ (gogoproto.nullable) = false ]; + + // sets spot markets as enabled + bool is_spot_exchange_enabled = 13; + + // sets derivative markets as enabled + bool is_derivatives_exchange_enabled = 14; + + // the current trading reward campaign info + TradingRewardCampaignInfo trading_reward_campaign_info = 15; + + // the current and upcoming trading reward campaign pools + repeated CampaignRewardPool trading_reward_pool_campaign_schedule = 16; + + // the current trading reward account points + repeated TradingRewardCampaignAccountPoints + trading_reward_campaign_account_points = 17; + + // the fee discount schedule + FeeDiscountSchedule fee_discount_schedule = 18; + + // the cached fee discount account tiers with TTL + repeated FeeDiscountAccountTierTTL fee_discount_account_tier_ttl = 19; + + // the fee discount paid by accounts in all buckets + repeated FeeDiscountBucketVolumeAccounts fee_discount_bucket_volume_accounts = + 20; + + // sets the first fee cycle as finished + bool is_first_fee_cycle_finished = 21; + + // the current and upcoming trading reward campaign pending pools + repeated CampaignRewardPool pending_trading_reward_pool_campaign_schedule = + 22; + + // the pending trading reward account points + repeated TradingRewardCampaignAccountPendingPoints + pending_trading_reward_campaign_account_points = 23; + + // the addresses opting out of trading rewards + repeated string rewards_opt_out_addresses = 24; + + repeated TradeRecords historical_trade_records = 25; + + // binary_options_markets is an array containing the genesis binary options + // markets + repeated BinaryOptionsMarket binary_options_markets = 26; + + // binary_options_markets_scheduled_for_settlement contains the marketIDs of + // binary options markets scheduled for next-block settlement + repeated string binary_options_market_ids_scheduled_for_settlement = 27; + + // spot_market_ids_scheduled_to_force_close defines the scheduled markets for + // forced closings at genesis + repeated string spot_market_ids_scheduled_to_force_close = 28; + + // denom_decimals defines the denom decimals for the exchange. + repeated DenomDecimals denom_decimals = 29 [ (gogoproto.nullable) = false ]; + + // conditional_derivative_orderbook contains conditional orderbooks for all + // markets (both lmit and market conditional orders) + repeated ConditionalDerivativeOrderBook conditional_derivative_orderbooks = + 30; + + // market_fee_multipliers contains any non-default atomic order fee + // multipliers + repeated MarketFeeMultiplier market_fee_multipliers = 31; + + repeated OrderbookSequence orderbook_sequences = 32; + + repeated AggregateSubaccountVolumeRecord subaccount_volumes = 33; + + repeated MarketVolume market_volumes = 34; + + repeated FullGrantAuthorizations grant_authorizations = 35; + + repeated FullActiveGrant active_grants = 36; +} + +message OrderbookSequence { + uint64 sequence = 1; + string market_id = 2; +} + +message FeeDiscountAccountTierTTL { + string account = 1; + FeeDiscountTierTTL tier_ttl = 2; +} + +message FeeDiscountBucketVolumeAccounts { + int64 bucket_start_timestamp = 1; + repeated AccountVolume account_volume = 2; +} + +message AccountVolume { + string account = 1; + string volume = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message TradingRewardCampaignAccountPoints { + string account = 1; + string points = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message TradingRewardCampaignAccountPendingPoints { + int64 reward_pool_start_timestamp = 1; + repeated TradingRewardCampaignAccountPoints account_points = 2; +} + +// Spot Exchange Limit Orderbook +message SpotOrderBook { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string market_id = 1; + bool isBuySide = 2; + repeated SpotLimitOrder orders = 3; +} + +// Derivative Exchange Limit Orderbook +message DerivativeOrderBook { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string market_id = 1; + bool isBuySide = 2; + repeated DerivativeLimitOrder orders = 3; +} + +// Orderbook containing limit & market conditional orders +message ConditionalDerivativeOrderBook { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string market_id = 1; + repeated DerivativeLimitOrder limit_buy_orders = 2; + repeated DerivativeMarketOrder market_buy_orders = 3; + repeated DerivativeLimitOrder limit_sell_orders = 4; + repeated DerivativeMarketOrder market_sell_orders = 5; +} + +message Balance { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string subaccount_id = 1; + string denom = 2; + Deposit deposits = 3; +} + +message DerivativePosition { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string subaccount_id = 1; + string market_id = 2; + Position position = 3; +} + +message SubaccountNonce { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string subaccount_id = 1; + SubaccountTradeNonce subaccount_trade_nonce = 2 + [ (gogoproto.nullable) = false ]; +} + +message ExpiryFuturesMarketInfoState { + string market_id = 1; + ExpiryFuturesMarketInfo market_info = 2; +} + +message PerpetualMarketFundingState { + string market_id = 1; + PerpetualMarketFunding funding = 2; +} + +message FullGrantAuthorizations { + string granter = 1; + string total_grant_amount = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + int64 last_delegations_checked_time = 3; + repeated GrantAuthorization grants = 4; +} + +message FullActiveGrant { + string grantee = 1; + ActiveGrant active_grant = 2; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/exchange/v1beta1/proposal.proto b/protos/injectivejs/injective/exchange/v1beta1/proposal.proto new file mode 100644 index 00000000..a116cfc8 --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/proposal.proto @@ -0,0 +1,653 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "injective/exchange/v1beta1/exchange.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +message SpotMarketParamUpdateProposal { + option (amino.name) = "exchange/SpotMarketParamUpdateProposal"; + 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 market_id = 3; + + // maker_fee_rate defines the trade fee rate for makers on the spot market + string maker_fee_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // taker_fee_rate defines the trade fee rate for takers on the spot market + string taker_fee_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // relayer_fee_share_rate defines the relayer fee share rate for the spot + // market + string relayer_fee_share_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + MarketStatus status = 9; + + string ticker = 10 [ (gogoproto.nullable) = true ]; + + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + AdminInfo admin_info = 12; +} + +enum ExchangeType { + EXCHANGE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "EXCHANGE_UNSPECIFIED" ]; + SPOT = 1 [ (gogoproto.enumvalue_customname) = "SPOT" ]; + DERIVATIVES = 2 [ (gogoproto.enumvalue_customname) = "DERIVATIVES" ]; +} + +message ExchangeEnableProposal { + option (amino.name) = "exchange/ExchangeEnableProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string title = 1; + string description = 2; + + ExchangeType exchangeType = 3; +} + +message BatchExchangeModificationProposal { + option (amino.name) = "exchange/BatchExchangeModificationProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated SpotMarketParamUpdateProposal spot_market_param_update_proposals = 3; + repeated DerivativeMarketParamUpdateProposal + derivative_market_param_update_proposals = 4; + repeated SpotMarketLaunchProposal spot_market_launch_proposals = 5; + repeated PerpetualMarketLaunchProposal perpetual_market_launch_proposals = 6; + repeated ExpiryFuturesMarketLaunchProposal + expiry_futures_market_launch_proposals = 7; + TradingRewardCampaignUpdateProposal trading_reward_campaign_update_proposal = + 8; + repeated BinaryOptionsMarketLaunchProposal + binary_options_market_launch_proposals = 9; + repeated BinaryOptionsMarketParamUpdateProposal + binary_options_param_update_proposals = 10; + UpdateDenomDecimalsProposal denom_decimals_update_proposal = 11; + + FeeDiscountProposal fee_discount_proposal = 12; + + repeated MarketForcedSettlementProposal market_forced_settlement_proposals = + 13; +} + +// SpotMarketLaunchProposal defines a SDK message for proposing a new spot +// market through governance +message SpotMarketLaunchProposal { + option (amino.name) = "exchange/SpotMarketLaunchProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + // Ticker for the spot market. + string ticker = 3; + // type of coin to use as the base currency + string base_denom = 4; + // type of coin to use as the quote currency + string quote_denom = 5; + // min_price_tick_size defines the minimum tick size of the order's price + string min_price_tick_size = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // maker_fee_rate defines the fee percentage makers pay when trading + string maker_fee_rate = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // taker_fee_rate defines the fee percentage takers pay when trading + string taker_fee_rate = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // min_notional defines the minimum notional for orders in the market + string min_notional = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + AdminInfo admin_info = 11; +} + +// PerpetualMarketLaunchProposal defines a SDK message for proposing a new +// perpetual futures market through governance +message PerpetualMarketLaunchProposal { + option (amino.name) = "exchange/PerpetualMarketLaunchProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + // Ticker for the derivative market. + string ticker = 3; + // type of coin to use as the base currency + string quote_denom = 4; + // Oracle base currency + string oracle_base = 5; + // Oracle quote currency + string oracle_quote = 6; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 7; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 8; + // initial_margin_ratio defines the initial margin ratio for the derivative + // market + string initial_margin_ratio = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // maintenance_margin_ratio defines the maintenance margin ratio for the + // derivative market + string maintenance_margin_ratio = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // maker_fee_rate defines the exchange trade fee for makers for the derivative + // market + string maker_fee_rate = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // taker_fee_rate defines the exchange trade fee for takers for the derivative + // market + string taker_fee_rate = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + AdminInfo admin_info = 16; +} + +message BinaryOptionsMarketLaunchProposal { + option (amino.name) = "exchange/BinaryOptionsMarketLaunchProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + // Ticker for the derivative contract. + string ticker = 3; + // Oracle symbol + string oracle_symbol = 4; + // Oracle Provider + string oracle_provider = 5; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 6; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 7; + // expiration timestamp + int64 expiration_timestamp = 8; + // expiration timestamp + int64 settlement_timestamp = 9; + // admin of the market + string admin = 10; + // Address of the quote currency denomination for the binary options contract + string quote_denom = 11; + // maker_fee_rate defines the maker fee rate of a binary options market + string maker_fee_rate = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // taker_fee_rate defines the taker fee rate of a derivative market + string taker_fee_rate = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_price_tick_size defines the minimum tick size that the price and margin + // required for orders in the market + string min_price_tick_size = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the quantity + // required for orders in the market + string min_quantity_tick_size = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint32 admin_permissions = 17; +} + +// ExpiryFuturesMarketLaunchProposal defines a SDK message for proposing a new +// expiry futures market through governance +message ExpiryFuturesMarketLaunchProposal { + option (amino.name) = "exchange/ExpiryFuturesMarketLaunchProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + // Ticker for the derivative market. + string ticker = 3; + // type of coin to use as the quote currency + string quote_denom = 4; + // Oracle base currency + string oracle_base = 5; + // Oracle quote currency + string oracle_quote = 6; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 7; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 8; + // Expiration time of the market + int64 expiry = 9; + // initial_margin_ratio defines the initial margin ratio for the derivative + // market + string initial_margin_ratio = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // maintenance_margin_ratio defines the maintenance margin ratio for the + // derivative market + string maintenance_margin_ratio = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // maker_fee_rate defines the exchange trade fee for makers for the derivative + // market + string maker_fee_rate = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // taker_fee_rate defines the exchange trade fee for takers for the derivative + // market + string taker_fee_rate = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + AdminInfo admin_info = 17; +} + +message DerivativeMarketParamUpdateProposal { + option (amino.name) = "exchange/DerivativeMarketParamUpdateProposal"; + 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 market_id = 3; + + // initial_margin_ratio defines the initial margin ratio for the derivative + // market + string initial_margin_ratio = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // maintenance_margin_ratio defines the maintenance margin ratio for the + // derivative market + string maintenance_margin_ratio = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // maker_fee_rate defines the exchange trade fee for makers for the derivative + // market + string maker_fee_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // taker_fee_rate defines the exchange trade fee for takers for the derivative + // market + string taker_fee_rate = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // relayer_fee_share_rate defines the relayer fee share rate for the + // derivative market + string relayer_fee_share_rate = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // hourly_interest_rate defines the hourly interest rate + string HourlyInterestRate = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // hourly_funding_rate_cap defines the maximum absolute value of the hourly + // funding rate + string HourlyFundingRateCap = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + MarketStatus status = 13; + + OracleParams oracle_params = 14; + + string ticker = 15 [ (gogoproto.nullable) = true ]; + + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + AdminInfo admin_info = 17; +} + +message AdminInfo { + string admin = 1; + uint32 admin_permissions = 2; +} + +message MarketForcedSettlementProposal { + option (amino.name) = "exchange/MarketForcedSettlementProposal"; + 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 market_id = 3; + string settlement_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message UpdateDenomDecimalsProposal { + option (amino.name) = "exchange/UpdateDenomDecimalsProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated DenomDecimals denom_decimals = 3; +} + +message BinaryOptionsMarketParamUpdateProposal { + option (amino.name) = "exchange/BinaryOptionsMarketParamUpdateProposal"; + 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 market_id = 3; + + // maker_fee_rate defines the exchange trade fee for makers for the derivative + // market + string maker_fee_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // taker_fee_rate defines the exchange trade fee for takers for the derivative + // market + string taker_fee_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // relayer_fee_share_rate defines the relayer fee share rate for the + // derivative market + string relayer_fee_share_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + + // expiration timestamp + int64 expiration_timestamp = 9; + // expiration timestamp + int64 settlement_timestamp = 10; + // new price at which market will be settled + string settlement_price = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // admin of the market + string admin = 12; + MarketStatus status = 13; + ProviderOracleParams oracle_params = 14; + + string ticker = 15 [ (gogoproto.nullable) = true ]; + + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message ProviderOracleParams { + // Oracle base currency + string symbol = 1; + // Oracle quote currency + string provider = 2; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 3; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 4; +} + +message OracleParams { + // Oracle base currency + string oracle_base = 1; + // Oracle quote currency + string oracle_quote = 2; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 3; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 4; +} + +message TradingRewardCampaignLaunchProposal { + option (amino.name) = "exchange/TradingRewardCampaignLaunchProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + TradingRewardCampaignInfo campaign_info = 3; + repeated CampaignRewardPool campaign_reward_pools = 4; +} + +message TradingRewardCampaignUpdateProposal { + option (amino.name) = "exchange/TradingRewardCampaignUpdateProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + TradingRewardCampaignInfo campaign_info = 3; + repeated CampaignRewardPool campaign_reward_pools_additions = 4; + repeated CampaignRewardPool campaign_reward_pools_updates = 5; +} + +message RewardPointUpdate { + string account_address = 1; + // new_points overwrites the current trading reward points for the account + string new_points = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message TradingRewardPendingPointsUpdateProposal { + option (amino.name) = "exchange/TradingRewardPendingPointsUpdateProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + int64 pending_pool_timestamp = 3; + repeated RewardPointUpdate reward_point_updates = 4; +} + +message FeeDiscountProposal { + option (amino.name) = "exchange/FeeDiscountProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + FeeDiscountSchedule schedule = 3; +} + +message BatchCommunityPoolSpendProposal { + option (amino.name) = "exchange/BatchCommunityPoolSpendProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated cosmos.distribution.v1beta1.CommunityPoolSpendProposal proposals = 3; +} + +// AtomicMarketOrderFeeMultiplierScheduleProposal defines a SDK message for +// proposing new atomic take fee multipliers for specified markets +message AtomicMarketOrderFeeMultiplierScheduleProposal { + option (amino.name) = + "exchange/AtomicMarketOrderFeeMultiplierScheduleProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated MarketFeeMultiplier market_fee_multipliers = 3; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/exchange/v1beta1/query.proto b/protos/injectivejs/injective/exchange/v1beta1/query.proto new file mode 100644 index 00000000..e74a687c --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/query.proto @@ -0,0 +1,1450 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "google/api/annotations.proto"; +import "injective/exchange/v1beta1/exchange.proto"; +import "injective/exchange/v1beta1/genesis.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +// Query defines the gRPC querier service. +service Query { + + // Retrieves exchange params + rpc QueryExchangeParams(QueryExchangeParamsRequest) + returns (QueryExchangeParamsResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/exchangeParams"; + } + + // Retrieves a Subaccount's Deposits + rpc SubaccountDeposits(QuerySubaccountDepositsRequest) + returns (QuerySubaccountDepositsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/subaccountDeposits"; + } + + // Retrieves a Subaccount's Deposits + rpc SubaccountDeposit(QuerySubaccountDepositRequest) + returns (QuerySubaccountDepositResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/subaccountDeposit"; + } + + // Retrieves all of the balances of all users on the exchange. + rpc ExchangeBalances(QueryExchangeBalancesRequest) + returns (QueryExchangeBalancesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/exchangeBalances"; + } + + // Retrieves the aggregate volumes for the specified account or subaccount + rpc AggregateVolume(QueryAggregateVolumeRequest) + returns (QueryAggregateVolumeResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/aggregateVolume/{account}"; + } + + // Retrieves the aggregate volumes for specified accounts + rpc AggregateVolumes(QueryAggregateVolumesRequest) + returns (QueryAggregateVolumesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/aggregateVolumes"; + } + + // Retrieves the aggregate volume for the specified market + rpc AggregateMarketVolume(QueryAggregateMarketVolumeRequest) + returns (QueryAggregateMarketVolumeResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/exchange/" + "aggregateMarketVolume/{market_id}"; + } + + // Retrieves the aggregate market volumes for specified markets + rpc AggregateMarketVolumes(QueryAggregateMarketVolumesRequest) + returns (QueryAggregateMarketVolumesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/aggregateMarketVolumes"; + } + + // Retrieves the denom decimals for a denom. + rpc DenomDecimal(QueryDenomDecimalRequest) + returns (QueryDenomDecimalResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/denom_decimal/{denom}"; + } + + // Retrieves the denom decimals for multiple denoms. Returns all denom + // decimals if unspecified. + rpc DenomDecimals(QueryDenomDecimalsRequest) + returns (QueryDenomDecimalsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/denom_decimals"; + } + + // Retrieves a list of spot markets. + rpc SpotMarkets(QuerySpotMarketsRequest) returns (QuerySpotMarketsResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/spot/markets"; + } + + // Retrieves a spot market by ticker + rpc SpotMarket(QuerySpotMarketRequest) returns (QuerySpotMarketResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/markets/{market_id}"; + } + + // Retrieves a list of spot markets with extra information. + rpc FullSpotMarkets(QueryFullSpotMarketsRequest) + returns (QueryFullSpotMarketsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/full_markets"; + } + + // Retrieves a spot market with extra information. + rpc FullSpotMarket(QueryFullSpotMarketRequest) + returns (QueryFullSpotMarketResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/full_market/{market_id}"; + } + + // Retrieves a spot market's orderbook by marketID + rpc SpotOrderbook(QuerySpotOrderbookRequest) + returns (QuerySpotOrderbookResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/orderbook/{market_id}"; + } + + // Retrieves a trader's spot orders + rpc TraderSpotOrders(QueryTraderSpotOrdersRequest) + returns (QueryTraderSpotOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/orders/{market_id}/{subaccount_id}"; + } + + // Retrieves all account address spot orders + rpc AccountAddressSpotOrders(QueryAccountAddressSpotOrdersRequest) + returns (QueryAccountAddressSpotOrdersResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/spot/orders/" + "{market_id}/account/{account_address}"; + } + + // Retrieves spot orders corresponding to specified order hashes for a given + // subaccountID and marketID + rpc SpotOrdersByHashes(QuerySpotOrdersByHashesRequest) + returns (QuerySpotOrdersByHashesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/orders_by_hashes/{market_id}/" + "{subaccount_id}"; + } + + // Retrieves subaccount's orders + rpc SubaccountOrders(QuerySubaccountOrdersRequest) + returns (QuerySubaccountOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/orders/{subaccount_id}"; + } + + // Retrieves a trader's transient spot orders + rpc TraderSpotTransientOrders(QueryTraderSpotOrdersRequest) + returns (QueryTraderSpotOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/transient_orders/{market_id}/" + "{subaccount_id}"; + } + + // Retrieves a spot market's mid-price + rpc SpotMidPriceAndTOB(QuerySpotMidPriceAndTOBRequest) + returns (QuerySpotMidPriceAndTOBResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/spot/mid_price_and_tob/{market_id}"; + } + + // Retrieves a derivative market's mid-price + rpc DerivativeMidPriceAndTOB(QueryDerivativeMidPriceAndTOBRequest) + returns (QueryDerivativeMidPriceAndTOBResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/mid_price_and_tob/{market_id}"; + } + + // Retrieves a derivative market's orderbook by marketID + rpc DerivativeOrderbook(QueryDerivativeOrderbookRequest) + returns (QueryDerivativeOrderbookResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/orderbook/{market_id}"; + } + + // Retrieves a trader's derivative orders + rpc TraderDerivativeOrders(QueryTraderDerivativeOrdersRequest) + returns (QueryTraderDerivativeOrdersResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/derivative/" + "orders/{market_id}/{subaccount_id}"; + } + + // Retrieves all account address derivative orders + rpc AccountAddressDerivativeOrders(QueryAccountAddressDerivativeOrdersRequest) + returns (QueryAccountAddressDerivativeOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/orders/{market_id}/account/" + "{account_address}"; + } + + // Retrieves a trader's derivative orders + rpc DerivativeOrdersByHashes(QueryDerivativeOrdersByHashesRequest) + returns (QueryDerivativeOrdersByHashesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/orders_by_hashes/{market_id}/" + "{subaccount_id}"; + } + + // Retrieves a trader's transient derivative orders + rpc TraderDerivativeTransientOrders(QueryTraderDerivativeOrdersRequest) + returns (QueryTraderDerivativeOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/transient_orders/{market_id}/" + "{subaccount_id}"; + } + + // Retrieves a list of derivative markets. + rpc DerivativeMarkets(QueryDerivativeMarketsRequest) + returns (QueryDerivativeMarketsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/markets"; + } + + // Retrieves a derivative market by ticker + rpc DerivativeMarket(QueryDerivativeMarketRequest) + returns (QueryDerivativeMarketResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/markets/{market_id}"; + } + + // Retrieves a derivative market's corresponding address for fees that + // contribute to the market's insurance fund + rpc DerivativeMarketAddress(QueryDerivativeMarketAddressRequest) + returns (QueryDerivativeMarketAddressResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/market_address/{market_id}"; + } + + // Retrieves a subaccount's trade nonce + rpc SubaccountTradeNonce(QuerySubaccountTradeNonceRequest) + returns (QuerySubaccountTradeNonceResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/exchange/{subaccount_id}"; + } + + // Retrieves the entire exchange module's state + rpc ExchangeModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/module_state"; + } + + // Retrieves the entire exchange module's positions + rpc Positions(QueryPositionsRequest) returns (QueryPositionsResponse) { + option (google.api.http).get = "/injective/exchange/v1beta1/positions"; + } + + // Retrieves subaccount's positions + rpc SubaccountPositions(QuerySubaccountPositionsRequest) + returns (QuerySubaccountPositionsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/positions/{subaccount_id}"; + } + + // Retrieves subaccount's position in market + rpc SubaccountPositionInMarket(QuerySubaccountPositionInMarketRequest) + returns (QuerySubaccountPositionInMarketResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/positions/{subaccount_id}/{market_id}"; + } + + // Retrieves subaccount's position in market + rpc SubaccountEffectivePositionInMarket( + QuerySubaccountEffectivePositionInMarketRequest) + returns (QuerySubaccountEffectivePositionInMarketResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/effective_positions/{subaccount_id}/" + "{market_id}"; + } + + // Retrieves perpetual market info + rpc PerpetualMarketInfo(QueryPerpetualMarketInfoRequest) + returns (QueryPerpetualMarketInfoResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/perpetual_market_info/{market_id}"; + } + + // Retrieves expiry market info + rpc ExpiryFuturesMarketInfo(QueryExpiryFuturesMarketInfoRequest) + returns (QueryExpiryFuturesMarketInfoResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/expiry_market_info/{market_id}"; + } + + // Retrieves perpetual market funding + rpc PerpetualMarketFunding(QueryPerpetualMarketFundingRequest) + returns (QueryPerpetualMarketFundingResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/perpetual_market_funding/{market_id}"; + } + + // Retrieves subaccount's order metadata + rpc SubaccountOrderMetadata(QuerySubaccountOrderMetadataRequest) + returns (QuerySubaccountOrderMetadataResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/order_metadata/{subaccount_id}"; + } + + // Retrieves the account and total trade rewards points + rpc TradeRewardPoints(QueryTradeRewardPointsRequest) + returns (QueryTradeRewardPointsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/trade_reward_points"; + } + + // Retrieves the pending account and total trade rewards points + rpc PendingTradeRewardPoints(QueryTradeRewardPointsRequest) + returns (QueryTradeRewardPointsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/pending_trade_reward_points"; + } + + // Retrieves the trade reward campaign + rpc TradeRewardCampaign(QueryTradeRewardCampaignRequest) + returns (QueryTradeRewardCampaignResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/trade_reward_campaign"; + } + + // Retrieves the account's fee discount info + rpc FeeDiscountAccountInfo(QueryFeeDiscountAccountInfoRequest) + returns (QueryFeeDiscountAccountInfoResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/fee_discount_account_info/{account}"; + } + + // Retrieves the fee discount schedule + rpc FeeDiscountSchedule(QueryFeeDiscountScheduleRequest) + returns (QueryFeeDiscountScheduleResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/fee_discount_schedule"; + } + + // Retrieves mismatches between available vs. total balance + rpc BalanceMismatches(QueryBalanceMismatchesRequest) + returns (QueryBalanceMismatchesResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/balance_mismatches/{dust_factor}"; + } + + // Retrieves available and total balances with balance holds + rpc BalanceWithBalanceHolds(QueryBalanceWithBalanceHoldsRequest) + returns (QueryBalanceWithBalanceHoldsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/balances_with_balance_holds"; + } + + // Retrieves fee discount tier stats + rpc FeeDiscountTierStatistics(QueryFeeDiscountTierStatisticsRequest) + returns (QueryFeeDiscountTierStatisticsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/fee_discount_tier_stats"; + } + + // Retrieves market making pool info + rpc MitoVaultInfos(MitoVaultInfosRequest) returns (MitoVaultInfosResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/mito_vault_infos"; + } + + // QueryMarketIDFromVault returns the market ID for a given vault subaccount + // ID + rpc QueryMarketIDFromVault(QueryMarketIDFromVaultRequest) + returns (QueryMarketIDFromVaultResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/vault_market_id/{vault_address}"; + } + + // Retrieves historical trade records for a given market ID + rpc HistoricalTradeRecords(QueryHistoricalTradeRecordsRequest) + returns (QueryHistoricalTradeRecordsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/historical_trade_records"; + } + + // Retrieves if the account is opted out of rewards + rpc IsOptedOutOfRewards(QueryIsOptedOutOfRewardsRequest) + returns (QueryIsOptedOutOfRewardsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/is_opted_out_of_rewards/{account}"; + } + + // Retrieves all accounts opted out of rewards + rpc OptedOutOfRewardsAccounts(QueryOptedOutOfRewardsAccountsRequest) + returns (QueryOptedOutOfRewardsAccountsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/opted_out_of_rewards_accounts"; + } + + // MarketVolatility computes the volatility for spot and derivative markets + // trading history. + rpc MarketVolatility(QueryMarketVolatilityRequest) + returns (QueryMarketVolatilityResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/market_volatility/{market_id}"; + } + + // Retrieves a spot market's orderbook by marketID + rpc BinaryOptionsMarkets(QueryBinaryMarketsRequest) + returns (QueryBinaryMarketsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/binary_options/markets"; + } + + // Retrieves a trader's derivative conditional orders + rpc TraderDerivativeConditionalOrders( + QueryTraderDerivativeConditionalOrdersRequest) + returns (QueryTraderDerivativeConditionalOrdersResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/derivative/orders/conditional/{market_id}/" + "{subaccount_id}"; + } + + rpc MarketAtomicExecutionFeeMultiplier( + QueryMarketAtomicExecutionFeeMultiplierRequest) + returns (QueryMarketAtomicExecutionFeeMultiplierResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/atomic_order_fee_multiplier"; + } + + // Retrieves the active stake grant for a grantee + rpc ActiveStakeGrant(QueryActiveStakeGrantRequest) + returns (QueryActiveStakeGrantResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/active_stake_grant/{grantee}"; + } + + // Retrieves the grant authorization amount for a granter and grantee + rpc GrantAuthorization(QueryGrantAuthorizationRequest) + returns (QueryGrantAuthorizationResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/grant_authorization/{granter}/{grantee}"; + } + + // Retrieves the grant authorization amount for a granter and grantee + rpc GrantAuthorizations(QueryGrantAuthorizationsRequest) + returns (QueryGrantAuthorizationsResponse) { + option (google.api.http).get = + "/injective/exchange/v1beta1/grant_authorizations/{granter}"; + } +} + +message Subaccount { + string trader = 1; + uint32 subaccount_nonce = 2; +} + +message QuerySubaccountOrdersRequest { + string subaccount_id = 1; + string market_id = 2; +} + +message QuerySubaccountOrdersResponse { + repeated SubaccountOrderData buy_orders = 1; + repeated SubaccountOrderData sell_orders = 2; +} + +message SubaccountOrderbookMetadataWithMarket { + SubaccountOrderbookMetadata metadata = 1; + string market_id = 2; + bool isBuy = 3; +} + +// QueryExchangeParamsRequest is the request type for the Query/ExchangeParams +// RPC method. +message QueryExchangeParamsRequest {} + +// QueryExchangeParamsRequest is the response type for the Query/ExchangeParams +// RPC method. +message QueryExchangeParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QuerySubaccountDepositsRequest is the request type for the +// Query/SubaccountDeposits RPC method. +message QuerySubaccountDepositsRequest { + string subaccount_id = 1; + Subaccount subaccount = 2 [ (gogoproto.nullable) = true ]; +} + +// QuerySubaccountDepositsResponse is the response type for the +// Query/SubaccountDeposits RPC method. +message QuerySubaccountDepositsResponse { map deposits = 1; } + +// QueryExchangeBalancesRequest is the request type for the +// Query/ExchangeBalances RPC method. +message QueryExchangeBalancesRequest {} + +// QuerySubaccountDepositsResponse is the response type for the +// Query/SubaccountDeposits RPC method. +message QueryExchangeBalancesResponse { + repeated Balance balances = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAggregateVolumeRequest is the request type for the Query/AggregateVolume +// RPC method. +message QueryAggregateVolumeRequest { + // can either be an address or a subaccount + string account = 1; +} + +// QueryAggregateVolumeResponse is the response type for the +// Query/AggregateVolume RPC method. +message QueryAggregateVolumeResponse { + // if an address is specified, then the aggregate_volumes will aggregate the + // volumes across all subaccounts for the address + repeated MarketVolume aggregate_volumes = 1; +} + +// QueryAggregateVolumesRequest is the request type for the +// Query/AggregateVolumes RPC method. +message QueryAggregateVolumesRequest { + repeated string accounts = 1; + repeated string market_ids = 2; +} + +// QueryAggregateVolumesResponse is the response type for the +// Query/AggregateVolumes RPC method. +message QueryAggregateVolumesResponse { + // the aggregate volume records for the accounts specified + repeated AggregateAccountVolumeRecord aggregate_account_volumes = 1; + // the aggregate volumes for the markets specified + repeated MarketVolume aggregate_market_volumes = 2; +} + +// QueryAggregateMarketVolumeRequest is the request type for the +// Query/AggregateMarketVolume RPC method. +message QueryAggregateMarketVolumeRequest { string market_id = 1; } + +// QueryAggregateMarketVolumeResponse is the response type for the +// Query/AggregateMarketVolume RPC method. +message QueryAggregateMarketVolumeResponse { + VolumeRecord volume = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDenomDecimalRequest is the request type for the Query/DenomDecimal RPC +// method. +message QueryDenomDecimalRequest { string denom = 1; } + +// QueryDenomDecimalResponse is the response type for the Query/DenomDecimal RPC +// method. +message QueryDenomDecimalResponse { uint64 decimal = 1; } + +// QueryDenomDecimalsRequest is the request type for the Query/DenomDecimals RPC +// method. +message QueryDenomDecimalsRequest { + // denoms can be empty to query all denom decimals + repeated string denoms = 1; +} + +// QueryDenomDecimalsRequest is the response type for the Query/DenomDecimals +// RPC method. +message QueryDenomDecimalsResponse { + repeated DenomDecimals denom_decimals = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAggregateMarketVolumesRequest is the request type for the +// Query/AggregateMarketVolumes RPC method. +message QueryAggregateMarketVolumesRequest { repeated string market_ids = 1; } + +// QueryAggregateMarketVolumesResponse is the response type for the +// Query/AggregateMarketVolumes RPC method. +message QueryAggregateMarketVolumesResponse { + // the aggregate volumes for the entire market + repeated MarketVolume volumes = 1; +} + +// QuerySubaccountDepositsRequest is the request type for the +// Query/SubaccountDeposits RPC method. +message QuerySubaccountDepositRequest { + string subaccount_id = 1; + string denom = 2; +} + +// QuerySubaccountDepositsResponse is the response type for the +// Query/SubaccountDeposits RPC method. +message QuerySubaccountDepositResponse { Deposit deposits = 1; } + +// QuerySpotMarketsRequest is the request type for the Query/SpotMarkets RPC +// method. +message QuerySpotMarketsRequest { + // Status of the market, for convenience it is set to string - not enum + string status = 1; + + // Filter by market IDs + repeated string market_ids = 2; +} + +// QuerySpotMarketsResponse is the response type for the Query/SpotMarkets RPC +// method. +message QuerySpotMarketsResponse { repeated SpotMarket markets = 1; } + +// QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC +// method. +message QuerySpotMarketRequest { + // Market ID for the market + string market_id = 1; +} + +// QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC +// method. +message QuerySpotMarketResponse { SpotMarket market = 1; } + +enum OrderSide { + // will return both + Side_Unspecified = 0; + Buy = 1; + Sell = 2; +} + +// QuerySpotOrderbookRequest is the request type for the Query/SpotOrderbook RPC +// method. +message QuerySpotOrderbookRequest { + // Market ID for the market + string market_id = 1; + uint64 limit = 2; + OrderSide order_side = 3; + string limit_cumulative_notional = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + string limit_cumulative_quantity = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QuerySpotOrderbookResponse is the response type for the Query/SpotOrderbook +// RPC method. +message QuerySpotOrderbookResponse { + repeated Level buys_price_level = 1; + repeated Level sells_price_level = 2; +} + +message FullSpotMarket { + SpotMarket market = 1; + // mid_price_and_tob defines the mid price for this market and the best ask + // and bid orders + MidPriceAndTOB mid_price_and_tob = 2 [ (gogoproto.nullable) = true ]; +} + +// QueryFullSpotMarketsRequest is the request type for the Query/FullSpotMarkets +// RPC method. +message QueryFullSpotMarketsRequest { + // Status of the market, for convenience it is set to string - not enum + string status = 1; + + // Filter by market IDs + repeated string market_ids = 2; + + // Flag to return the markets mid price and top of the book buy and sell + // orders. + bool with_mid_price_and_tob = 3; +} + +// QueryFullSpotMarketsResponse is the response type for the +// Query/FullSpotMarkets RPC method. +message QueryFullSpotMarketsResponse { repeated FullSpotMarket markets = 1; } + +// QuerySpotMarketRequest is the request type for the Query/SpotMarket RPC +// method. +message QueryFullSpotMarketRequest { + // Market ID for the market + string market_id = 1; + // Flag to return the markets mid price and top of the book buy and sell + // orders. + bool with_mid_price_and_tob = 2; +} + +// QuerySpotMarketResponse is the response type for the Query/SpotMarket RPC +// method. +message QueryFullSpotMarketResponse { FullSpotMarket market = 1; } + +// QuerySpotOrdersByHashesRequest is the request type for the +// Query/SpotOrdersByHashes RPC method. +message QuerySpotOrdersByHashesRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; + // the order hashes + repeated string order_hashes = 3; +} + +// QuerySpotOrdersByHashesResponse is the response type for the +// Query/SpotOrdersByHashes RPC method. +message QuerySpotOrdersByHashesResponse { + repeated TrimmedSpotLimitOrder orders = 1; +} + +// QueryTraderSpotOrdersRequest is the request type for the +// Query/TraderSpotOrders RPC method. +message QueryTraderSpotOrdersRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; +} + +// QueryAccountAddressSpotOrdersRequest is the request type for the +// Query/AccountAddressSpotOrders RPC method. +message QueryAccountAddressSpotOrdersRequest { + // Market ID for the market + string market_id = 1; + // Account address of the trader + string account_address = 2; +} + +message TrimmedSpotLimitOrder { + // price of the order + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity of the order + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the amount of the quantity remaining fillable + string fillable = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // true if the order is a buy + bool isBuy = 4; + string order_hash = 5; + string cid = 6; +} + +// QueryTraderSpotOrdersResponse is the response type for the +// Query/TraderSpotOrders RPC method. +message QueryTraderSpotOrdersResponse { + repeated TrimmedSpotLimitOrder orders = 1; +} + +// QueryAccountAddressSpotOrdersResponse is the response type for the +// Query/AccountAddressSpotOrders RPC method. +message QueryAccountAddressSpotOrdersResponse { + repeated TrimmedSpotLimitOrder orders = 1; +} + +// QuerySpotMidPriceAndTOBRequest is the request type for the +// Query/SpotMidPriceAndTOB RPC method. +message QuerySpotMidPriceAndTOBRequest { + // Market ID for the market + string market_id = 1; +} + +// QuerySpotMidPriceAndTOBResponse is the response type for the +// Query/SpotMidPriceAndTOB RPC method. +message QuerySpotMidPriceAndTOBResponse { + // mid price of the market + string mid_price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best buy price of the market + string best_buy_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best sell price of the market + string best_sell_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QueryDerivativeMidPriceAndTOBRequest is the request type for the +// Query/GetDerivativeMidPriceAndTOB RPC method. +message QueryDerivativeMidPriceAndTOBRequest { + // Market ID for the market + string market_id = 1; +} + +// QueryDerivativeMidPriceAndTOBResponse is the response type for the +// Query/GetDerivativeMidPriceAndTOB RPC method. +message QueryDerivativeMidPriceAndTOBResponse { + // mid price of the market + string mid_price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best buy price of the market + string best_buy_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // best sell price of the market + string best_sell_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QueryDerivativeOrderbookRequest is the request type for the +// Query/DerivativeOrderbook RPC method. +message QueryDerivativeOrderbookRequest { + // Market ID for the market + string market_id = 1; + uint64 limit = 2; + string limit_cumulative_notional = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QueryDerivativeOrderbookResponse is the response type for the +// Query/DerivativeOrderbook RPC method. +message QueryDerivativeOrderbookResponse { + repeated Level buys_price_level = 1; + repeated Level sells_price_level = 2; +} + +// CancellationStrategy is the list of cancellation strategies. +enum CancellationStrategy { + // just cancelling in random order in most efficient way + UnspecifiedOrder = 0; + // e.g. for buy orders from lowest to highest price + FromWorstToBest = 1; + // e.g. for buy orders from higest to lowest price + FromBestToWorst = 2; + + // more strategies could be imagined like cancel buy first or cancel sell + // first +} + +// QueryTraderSpotOrdersToCancelUpToAmountRequest is the request type for the +// Query/TraderSpotOrdersToCancelUpToAmountRequest RPC method. +message QueryTraderSpotOrdersToCancelUpToAmountRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; + // the base amount to cancel (free up) + string base_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the quote amount to cancel (free up) + string quote_amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // The cancellation strategy + CancellationStrategy strategy = 5; + // The reference price for the cancellation strategy, e.g. mid price or mark + // price + string reference_price = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QueryTraderDerivativeOrdersToCancelUpToAmountRequest is the request type for +// the Query/TraderDerivativeOrdersToCancelUpToAmountRequest RPC method. +message QueryTraderDerivativeOrdersToCancelUpToAmountRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; + // the quote amount to cancel (free up) + string quote_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // The cancellation strategy + CancellationStrategy strategy = 4; + // The reference price for the cancellation strategy, e.g. mid price or mark + // price + string reference_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +// QueryTraderDerivativeOrdersRequest is the request type for the +// Query/TraderDerivativeOrders RPC method. +message QueryTraderDerivativeOrdersRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; +} + +// QueryAccountAddressSpotOrdersRequest is the request type for the +// Query/AccountAddressDerivativeOrders RPC method. +message QueryAccountAddressDerivativeOrdersRequest { + // Market ID for the market + string market_id = 1; + // Account address of the trader + string account_address = 2; +} + +message TrimmedDerivativeLimitOrder { + // price of the order + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity of the order + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // margin of the order + string margin = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the amount of the quantity remaining fillable + string fillable = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // true if the order is a buy + bool isBuy = 5 + [ (gogoproto.jsontag) = "isBuy" ]; // ensure omitempty is not in jsontag + string order_hash = 6; + string cid = 7; +} + +// QueryTraderDerivativeOrdersResponse is the response type for the +// Query/TraderDerivativeOrders RPC method. +message QueryTraderDerivativeOrdersResponse { + repeated TrimmedDerivativeLimitOrder orders = 1; +} + +// QueryAccountAddressDerivativeOrdersResponse is the response type for the +// Query/AccountAddressDerivativeOrders RPC method. +message QueryAccountAddressDerivativeOrdersResponse { + repeated TrimmedDerivativeLimitOrder orders = 1; +} + +// QueryTraderDerivativeOrdersRequest is the request type for the +// Query/TraderDerivativeOrders RPC method. +message QueryDerivativeOrdersByHashesRequest { + // Market ID for the market + string market_id = 1; + // SubaccountID of the trader + string subaccount_id = 2; + // the order hashes + repeated string order_hashes = 3; +} + +// QueryDerivativeOrdersByHashesResponse is the response type for the +// Query/DerivativeOrdersByHashes RPC method. +message QueryDerivativeOrdersByHashesResponse { + repeated TrimmedDerivativeLimitOrder orders = 1; +} + +// QueryDerivativeMarketsRequest is the request type for the +// Query/DerivativeMarkets RPC method. +message QueryDerivativeMarketsRequest { + // Status of the market, for convenience it is set to string - not enum + string status = 1; + + // Filter by market IDs + repeated string market_ids = 2; + + // Flag to return the markets mid price and top of the book buy and sell + // orders. + bool with_mid_price_and_tob = 3; +} + +message PriceLevel { + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message PerpetualMarketState { + PerpetualMarketInfo market_info = 1; + PerpetualMarketFunding funding_info = 2; +} + +message FullDerivativeMarket { + DerivativeMarket market = 1; + oneof info { + PerpetualMarketState perpetual_info = 2; + ExpiryFuturesMarketInfo futures_info = 3; + } + string mark_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // mid_price_and_tob defines the mid price for this market and the best ask + // and bid orders + MidPriceAndTOB mid_price_and_tob = 5 [ (gogoproto.nullable) = true ]; +} + +// QueryDerivativeMarketsResponse is the response type for the +// Query/DerivativeMarkets RPC method. +message QueryDerivativeMarketsResponse { + repeated FullDerivativeMarket markets = 1; +} + +// QueryDerivativeMarketRequest is the request type for the +// Query/DerivativeMarket RPC method. +message QueryDerivativeMarketRequest { + // Market ID for the market + string market_id = 1; +} + +// QueryDerivativeMarketResponse is the response type for the +// Query/DerivativeMarket RPC method. +message QueryDerivativeMarketResponse { FullDerivativeMarket market = 1; } + +// QueryDerivativeMarketAddressRequest is the request type for the +// Query/DerivativeMarketAddress RPC method. +message QueryDerivativeMarketAddressRequest { + // Market ID for the market + string market_id = 1; +} + +// QueryDerivativeMarketAddressResponse is the response type for the +// Query/DerivativeMarketAddress RPC method. +message QueryDerivativeMarketAddressResponse { + // address for the market + string address = 1; + // subaccountID for the market + string subaccount_id = 2; +} + +// QuerySubaccountTradeNonceRequest is the request type for the +// Query/SubaccountTradeNonce RPC method. +message QuerySubaccountTradeNonceRequest { string subaccount_id = 1; } + +// QuerySubaccountPositionsRequest is the request type for the +// Query/SubaccountPositions RPC method. +message QuerySubaccountPositionsRequest { string subaccount_id = 1; } + +// QuerySubaccountPositionInMarketRequest is the request type for the +// Query/SubaccountPositionInMarket RPC method. +message QuerySubaccountPositionInMarketRequest { + string subaccount_id = 1; + string market_id = 2; +} + +// QuerySubaccountEffectivePositionInMarketRequest is the request type for the +// Query/SubaccountEffectivePositionInMarket RPC method. +message QuerySubaccountEffectivePositionInMarketRequest { + string subaccount_id = 1; + string market_id = 2; +} + +// QuerySubaccountOrderMetadataRequest is the request type for the +// Query/SubaccountOrderMetadata RPC method. +message QuerySubaccountOrderMetadataRequest { string subaccount_id = 1; } + +// QuerySubaccountPositionsResponse is the response type for the +// Query/SubaccountPositions RPC method. +message QuerySubaccountPositionsResponse { + repeated DerivativePosition state = 1 [ (gogoproto.nullable) = false ]; +} + +// QuerySubaccountPositionInMarketResponse is the response type for the +// Query/SubaccountPositionInMarket RPC method. +message QuerySubaccountPositionInMarketResponse { + Position state = 1 [ (gogoproto.nullable) = true ]; +} + +message EffectivePosition { + bool is_long = 1; + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string entry_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string effective_margin = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// QuerySubaccountEffectivePositionInMarketResponse is the response type for the +// Query/SubaccountEffectivePositionInMarket RPC method. +message QuerySubaccountEffectivePositionInMarketResponse { + EffectivePosition state = 1 [ (gogoproto.nullable) = true ]; +} + +// QueryPerpetualMarketInfoRequest is the request type for the +// Query/PerpetualMarketInfo RPC method. +message QueryPerpetualMarketInfoRequest { string market_id = 1; } + +// QueryPerpetualMarketInfoResponse is the response type for the +// Query/PerpetualMarketInfo RPC method. +message QueryPerpetualMarketInfoResponse { + PerpetualMarketInfo info = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryExpiryFuturesMarketInfoRequest is the request type for the Query/ +// ExpiryFuturesMarketInfo RPC method. +message QueryExpiryFuturesMarketInfoRequest { string market_id = 1; } + +// QueryExpiryFuturesMarketInfoResponse is the response type for the Query/ +// ExpiryFuturesMarketInfo RPC method. +message QueryExpiryFuturesMarketInfoResponse { + ExpiryFuturesMarketInfo info = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryPerpetualMarketFundingRequest is the request type for the +// Query/PerpetualMarketFunding RPC method. +message QueryPerpetualMarketFundingRequest { string market_id = 1; } + +// QueryPerpetualMarketFundingResponse is the response type for the +// Query/PerpetualMarketFunding RPC method. +message QueryPerpetualMarketFundingResponse { + PerpetualMarketFunding state = 1 [ (gogoproto.nullable) = false ]; +} + +// QuerySubaccountOrderMetadataResponse is the response type for the +// Query/SubaccountOrderMetadata RPC method. +message QuerySubaccountOrderMetadataResponse { + repeated SubaccountOrderbookMetadataWithMarket metadata = 1 + [ (gogoproto.nullable) = false ]; +} + +// QuerySubaccountTradeNonceResponse is the response type for the +// Query/SubaccountTradeNonce RPC method. +message QuerySubaccountTradeNonceResponse { uint32 nonce = 1; } + +// QueryModuleStateRequest is the request type for the Query/ExchangeModuleState +// RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the +// Query/ExchangeModuleState RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } + +// QueryPositionsRequest is the request type for the Query/Positions RPC method. +message QueryPositionsRequest {} + +// QueryPositionsResponse is the response type for the Query/Positions RPC +// method. +message QueryPositionsResponse { + repeated DerivativePosition state = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryTradeRewardPointsRequest is the request type for the +// Query/TradeRewardPoints RPC method. +message QueryTradeRewardPointsRequest { + repeated string accounts = 1; + int64 pending_pool_timestamp = 2; +} + +// QueryTradeRewardPointsResponse is the response type for the +// Query/TradeRewardPoints RPC method. +message QueryTradeRewardPointsResponse { + repeated string account_trade_reward_points = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// QueryTradeRewardCampaignRequest is the request type for the +// Query/TradeRewardCampaign RPC method. +message QueryTradeRewardCampaignRequest {} + +// QueryTradeRewardCampaignResponse is the response type for the +// Query/TradeRewardCampaign RPC method. +message QueryTradeRewardCampaignResponse { + TradingRewardCampaignInfo trading_reward_campaign_info = 1; + repeated CampaignRewardPool trading_reward_pool_campaign_schedule = 2; + string total_trade_reward_points = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + repeated CampaignRewardPool pending_trading_reward_pool_campaign_schedule = 4; + repeated string pending_total_trade_reward_points = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// QueryIsRegisteredDMMRequest is the request type for the Query/IsRegisteredDMM +// RPC method. +message QueryIsOptedOutOfRewardsRequest { string account = 1; } + +// QueryIsRegisteredDMMResponse is the response type for the +// Query/IsRegisteredDMM RPC method. +message QueryIsOptedOutOfRewardsResponse { bool is_opted_out = 1; } + +// QueryRegisteredDMMsRequest is the request type for the Query/RegisteredDMMs +// RPC method. +message QueryOptedOutOfRewardsAccountsRequest {} + +// QueryRegisteredDMMsResponse is the response type for the Query/RegisteredDMMs +// RPC method. +message QueryOptedOutOfRewardsAccountsResponse { repeated string accounts = 1; } + +// QueryFeeDiscountAccountInfoRequest is the request type for the +// Query/FeeDiscountAccountInfo RPC method. +message QueryFeeDiscountAccountInfoRequest { string account = 1; } + +// QueryFeeDiscountAccountInfoResponse is the response type for the +// Query/FeeDiscountAccountInfo RPC method. +message QueryFeeDiscountAccountInfoResponse { + uint64 tier_level = 1; + FeeDiscountTierInfo account_info = 2; + FeeDiscountTierTTL account_ttl = 3; +} + +// QueryFeeDiscountScheduleRequest is the request type for the +// Query/FeeDiscountSchedule RPC method. +message QueryFeeDiscountScheduleRequest {} + +// QueryFeeDiscountScheduleResponse is the response type for the +// Query/FeeDiscountSchedule RPC method. +message QueryFeeDiscountScheduleResponse { + FeeDiscountSchedule fee_discount_schedule = 1; +} + +// QueryBalanceMismatchesRequest is the request type for the +// Query/QueryBalanceMismatches RPC method. +message QueryBalanceMismatchesRequest { int64 dust_factor = 1; } + +message BalanceMismatch { + string subaccountId = 1; + string denom = 2; + string available = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string balance_hold = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string expected_total = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string difference = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// QueryBalanceMismatchesResponse is the response type for the +// Query/QueryBalanceMismatches RPC method. +message QueryBalanceMismatchesResponse { + repeated BalanceMismatch balance_mismatches = 1; +} + +// QueryBalanceWithBalanceHoldsRequest is the request type for the +// Query/QueryBalanceWithBalanceHolds RPC method. +message QueryBalanceWithBalanceHoldsRequest {} + +message BalanceWithMarginHold { + string subaccountId = 1; + string denom = 2; + string available = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string balance_hold = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// QueryBalanceWithBalanceHoldsResponse is the response type for the +// Query/QueryBalanceWithBalanceHolds RPC method. +message QueryBalanceWithBalanceHoldsResponse { + repeated BalanceWithMarginHold balance_with_balance_holds = 1; +} + +// QueryFeeDiscountTierStatisticsRequest is the request type for the +// Query/QueryFeeDiscountTierStatistics RPC method. +message QueryFeeDiscountTierStatisticsRequest {} + +message TierStatistic { + uint64 tier = 1; + uint64 count = 2; +} + +// QueryFeeDiscountTierStatisticsResponse is the response type for the +// Query/QueryFeeDiscountTierStatistics RPC method. +message QueryFeeDiscountTierStatisticsResponse { + repeated TierStatistic statistics = 1; +} + +// MitoVaultInfosRequest is the request type for the Query/MitoVaultInfos RPC +// method. +message MitoVaultInfosRequest {} + +// MitoVaultInfosResponse is the response type for the Query/MitoVaultInfos RPC +// method. +message MitoVaultInfosResponse { + repeated string master_addresses = 1; + repeated string derivative_addresses = 2; + repeated string spot_addresses = 3; + repeated string cw20_addresses = 4; +} + +// QueryMarketIDFromVaultRequest is the request type for the +// Query/QueryMarketIDFromVault RPC method. +message QueryMarketIDFromVaultRequest { string vault_address = 1; } + +// QueryMarketIDFromVaultResponse is the response type for the +// Query/QueryMarketIDFromVault RPC method. +message QueryMarketIDFromVaultResponse { string market_id = 1; } + +message QueryHistoricalTradeRecordsRequest { string market_id = 1; } + +message QueryHistoricalTradeRecordsResponse { + repeated TradeRecords trade_records = 1; +} + +// TradeHistoryOptions are the optional params for Query/MarketVolatility RPC +// method. +message TradeHistoryOptions { + // TradeGroupingSec of 0 means use the chain's default grouping + uint64 trade_grouping_sec = 1; + // MaxAge restricts the trade records oldest age in seconds from the current + // block time to consider. A value of 0 means use all the records present on + // the chain. + uint64 max_age = 2; + // If IncludeRawHistory is true, the raw underlying data used for the + // computation is included in the response + bool include_raw_history = 4; + // If IncludeMetadata is true, metadata on the computation is included in the + // response + bool include_metadata = 5; +} + +// QueryMarketVolatilityRequest are the request params for the +// Query/MarketVolatility RPC method. +message QueryMarketVolatilityRequest { + string market_id = 1; + TradeHistoryOptions trade_history_options = 2; +} + +// QueryMarketVolatilityResponse is the response type for the +// Query/MarketVolatility RPC method. +message QueryMarketVolatilityResponse { + string volatility = 1 + [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; + injective.oracle.v1beta1.MetadataStatistics history_metadata = 2; + repeated TradeRecord raw_history = 3; +} + +// QuerBinaryMarketsRequest is the request type for the Query/BinaryMarkets RPC +// method. +message QueryBinaryMarketsRequest { + // Status of the market, for convenience it is set to string - not enum + string status = 1; +} + +// QueryBinaryMarketsResponse is the response type for the Query/BinaryMarkets +// RPC method. +message QueryBinaryMarketsResponse { repeated BinaryOptionsMarket markets = 1; } + +// QueryConditionalOrdersRequest is the request type for the +// Query/ConditionalOrders RPC method. +message QueryTraderDerivativeConditionalOrdersRequest { + string subaccount_id = 1; + string market_id = 2; +} + +message TrimmedDerivativeConditionalOrder { + // price of the order + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // quantity of the order + string quantity = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // margin of the order + string margin = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // price to trigger the order + string triggerPrice = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // true if the order is a buy + bool isBuy = 5 + [ (gogoproto.jsontag) = "isBuy" ]; // ensure omitempty is not in jsontag + bool isLimit = 6 [ (gogoproto.jsontag) = "isLimit" ]; + string order_hash = 7; + string cid = 8; +} + +// QueryTraderDerivativeOrdersResponse is the response type for the +// Query/TraderDerivativeOrders RPC method. +message QueryTraderDerivativeConditionalOrdersResponse { + repeated TrimmedDerivativeConditionalOrder orders = 1; +} + +message QueryMarketAtomicExecutionFeeMultiplierRequest { string market_id = 1; } + +message QueryMarketAtomicExecutionFeeMultiplierResponse { + string multiplier = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryActiveStakeGrantRequest { string grantee = 1; } + +message QueryActiveStakeGrantResponse { + ActiveGrant grant = 1; + EffectiveGrant effective_grant = 2; +} + +message QueryGrantAuthorizationRequest { + string granter = 1; + string grantee = 2; +} + +message QueryGrantAuthorizationResponse { + string amount = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message QueryGrantAuthorizationsRequest { string granter = 1; } + +message QueryGrantAuthorizationsResponse { + string total_grant_amount = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + repeated GrantAuthorization grants = 2; +} diff --git a/protos/injectivejs/injective/exchange/v1beta1/tx.proto b/protos/injectivejs/injective/exchange/v1beta1/tx.proto new file mode 100644 index 00000000..b282f4da --- /dev/null +++ b/protos/injectivejs/injective/exchange/v1beta1/tx.proto @@ -0,0 +1,1154 @@ +syntax = "proto3"; +package injective.exchange.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "injective/exchange/v1beta1/exchange.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types"; + +// Msg defines the exchange Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Deposit defines a method for transferring coins from the sender's bank + // balance into the subaccount's exchange deposits + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // Withdraw defines a method for withdrawing coins from a subaccount's + // deposits to the user's bank balance + rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse); + + // InstantSpotMarketLaunch defines method for creating a spot market by paying + // listing fee without governance + rpc InstantSpotMarketLaunch(MsgInstantSpotMarketLaunch) + returns (MsgInstantSpotMarketLaunchResponse); + + // InstantPerpetualMarketLaunch defines a method for creating a new perpetual + // futures market by paying listing fee without governance + rpc InstantPerpetualMarketLaunch(MsgInstantPerpetualMarketLaunch) + returns (MsgInstantPerpetualMarketLaunchResponse); + + // InstantExpiryFuturesMarketLaunch defines a method for creating a new expiry + // futures market by paying listing fee without governance + rpc InstantExpiryFuturesMarketLaunch(MsgInstantExpiryFuturesMarketLaunch) + returns (MsgInstantExpiryFuturesMarketLaunchResponse); + + // CreateSpotLimitOrder defines a method for creating a new spot limit order. + rpc CreateSpotLimitOrder(MsgCreateSpotLimitOrder) + returns (MsgCreateSpotLimitOrderResponse); + + // BatchCreateSpotLimitOrder defines a method for creating a new batch of spot + // limit orders. + rpc BatchCreateSpotLimitOrders(MsgBatchCreateSpotLimitOrders) + returns (MsgBatchCreateSpotLimitOrdersResponse); + + // CreateSpotMarketOrder defines a method for creating a new spot market + // order. + rpc CreateSpotMarketOrder(MsgCreateSpotMarketOrder) + returns (MsgCreateSpotMarketOrderResponse); + + // MsgCancelSpotOrder defines a method for cancelling a spot order. + rpc CancelSpotOrder(MsgCancelSpotOrder) returns (MsgCancelSpotOrderResponse); + + // BatchCancelSpotOrders defines a method for cancelling a batch of spot + // orders in a given market. + rpc BatchCancelSpotOrders(MsgBatchCancelSpotOrders) + returns (MsgBatchCancelSpotOrdersResponse); + + // BatchUpdateOrders defines a method for updating a batch of orders. + rpc BatchUpdateOrders(MsgBatchUpdateOrders) + returns (MsgBatchUpdateOrdersResponse); + + // PrivilegedExecuteContract defines a method for executing a Cosmwasm + // contract from the exchange module with privileged capabilities. + rpc PrivilegedExecuteContract(MsgPrivilegedExecuteContract) + returns (MsgPrivilegedExecuteContractResponse); + + // CreateDerivativeLimitOrder defines a method for creating a new derivative + // limit order. + rpc CreateDerivativeLimitOrder(MsgCreateDerivativeLimitOrder) + returns (MsgCreateDerivativeLimitOrderResponse); + + // BatchCreateDerivativeLimitOrders defines a method for creating a new batch + // of derivative limit orders. + rpc BatchCreateDerivativeLimitOrders(MsgBatchCreateDerivativeLimitOrders) + returns (MsgBatchCreateDerivativeLimitOrdersResponse); + + // MsgCreateDerivativeLimitOrder defines a method for creating a new + // derivative market order. + rpc CreateDerivativeMarketOrder(MsgCreateDerivativeMarketOrder) + returns (MsgCreateDerivativeMarketOrderResponse); + + // MsgCancelDerivativeOrder defines a method for cancelling a derivative + // order. + rpc CancelDerivativeOrder(MsgCancelDerivativeOrder) + returns (MsgCancelDerivativeOrderResponse); + + // MsgBatchCancelDerivativeOrders defines a method for cancelling a batch of + // derivative limit orders. + rpc BatchCancelDerivativeOrders(MsgBatchCancelDerivativeOrders) + returns (MsgBatchCancelDerivativeOrdersResponse); + + // InstantBinaryOptionsMarketLaunch defines method for creating a binary + // options market by paying listing fee without governance + rpc InstantBinaryOptionsMarketLaunch(MsgInstantBinaryOptionsMarketLaunch) + returns (MsgInstantBinaryOptionsMarketLaunchResponse); + + // CreateBinaryOptionsLimitOrder defines a method for creating a new binary + // options limit order. + rpc CreateBinaryOptionsLimitOrder(MsgCreateBinaryOptionsLimitOrder) + returns (MsgCreateBinaryOptionsLimitOrderResponse); + + // CreateBinaryOptionsMarketOrder defines a method for creating a new binary + // options market order. + rpc CreateBinaryOptionsMarketOrder(MsgCreateBinaryOptionsMarketOrder) + returns (MsgCreateBinaryOptionsMarketOrderResponse); + + // MsgCancelBinaryOptionsOrder defines a method for cancelling a binary + // options order. + rpc CancelBinaryOptionsOrder(MsgCancelBinaryOptionsOrder) + returns (MsgCancelBinaryOptionsOrderResponse); + + // BatchCancelBinaryOptionsOrders defines a method for cancelling a batch of + // binary options limit orders. + rpc BatchCancelBinaryOptionsOrders(MsgBatchCancelBinaryOptionsOrders) + returns (MsgBatchCancelBinaryOptionsOrdersResponse); + + // SubaccountTransfer defines a method for transfer between subaccounts + rpc SubaccountTransfer(MsgSubaccountTransfer) + returns (MsgSubaccountTransferResponse); + + // ExternalTransfer defines a method for transfer between external accounts + rpc ExternalTransfer(MsgExternalTransfer) + returns (MsgExternalTransferResponse); + + // LiquidatePosition defines a method for liquidating a position + rpc LiquidatePosition(MsgLiquidatePosition) + returns (MsgLiquidatePositionResponse); + + // EmergencySettleMarket defines a method for emergency settling a market + rpc EmergencySettleMarket(MsgEmergencySettleMarket) + returns (MsgEmergencySettleMarketResponse); + + // IncreasePositionMargin defines a method for increasing margin of a position + rpc IncreasePositionMargin(MsgIncreasePositionMargin) + returns (MsgIncreasePositionMarginResponse); + + // DecreasePositionMargin defines a method for decreasing margin of a position + rpc DecreasePositionMargin(MsgDecreasePositionMargin) + returns (MsgDecreasePositionMarginResponse); + + // RewardsOptOut defines a method for opting out of rewards + rpc RewardsOptOut(MsgRewardsOptOut) returns (MsgRewardsOptOutResponse); + + // AdminUpdateBinaryOptionsMarket defines method for updating a binary options + // market by admin + rpc AdminUpdateBinaryOptionsMarket(MsgAdminUpdateBinaryOptionsMarket) + returns (MsgAdminUpdateBinaryOptionsMarketResponse); + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // UpdateSpotMarket modifies certain spot market fields (admin only) + rpc UpdateSpotMarket(MsgUpdateSpotMarket) + returns (MsgUpdateSpotMarketResponse); + + // UpdateDerivativeMarket modifies certain derivative market fields (admin + // only) + rpc UpdateDerivativeMarket(MsgUpdateDerivativeMarket) + returns (MsgUpdateDerivativeMarketResponse); + + rpc AuthorizeStakeGrants(MsgAuthorizeStakeGrants) + returns (MsgAuthorizeStakeGrantsResponse); + + rpc ActivateStakeGrant(MsgActivateStakeGrant) + returns (MsgActivateStakeGrantResponse); +} + +message MsgUpdateSpotMarket { + option (amino.name) = "exchange/MsgUpdateSpotMarket"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "admin"; + + // current admin address of the associated market + string admin = 1; + + // id of the market to be updated + string market_id = 2; + + // (optional) updated ticker value + string new_ticker = 3; + + // (optional) updated min price tick size value + string new_min_price_tick_size = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated min quantity tick size value + string new_min_quantity_tick_size = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated min notional + string new_min_notional = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgUpdateSpotMarketResponse {} + +message MsgUpdateDerivativeMarket { + option (amino.name) = "exchange/MsgUpdateDerivativeMarket"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "admin"; + + // current admin address of the associated market + string admin = 1; + + // id of the market to be updated + string market_id = 2; + + // (optional) updated value for ticker + string new_ticker = 3; + + // (optional) updated value for min_price_tick_size + string new_min_price_tick_size = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated value min_quantity_tick_size + string new_min_quantity_tick_size = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated min notional + string new_min_notional = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated value for initial_margin_ratio + string new_initial_margin_ratio = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // (optional) updated value for maintenance_margin_ratio + string new_maintenance_margin_ratio = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgUpdateDerivativeMarketResponse {} + +message MsgUpdateParams { + option (amino.name) = "exchange/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 exchange parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} + +// MsgDeposit defines a SDK message for transferring coins from the sender's +// bank balance into the subaccount's exchange deposits +message MsgDeposit { + option (amino.name) = "exchange/MsgDeposit"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // (Optional) bytes32 subaccount ID to deposit funds into. If empty, the coin + // will be deposited to the sender's default subaccount address. + string subaccount_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} + +// MsgWithdraw defines a SDK message for withdrawing coins from a subaccount's +// deposits to the user's bank balance +message MsgWithdraw { + option (amino.name) = "exchange/MsgWithdraw"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // bytes32 subaccount ID to withdraw funds from + string subaccount_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +// MsgWithdraw defines the Msg/Withdraw response type. +message MsgWithdrawResponse {} + +// MsgCreateSpotLimitOrder defines a SDK message for creating a new spot limit +// order. +message MsgCreateSpotLimitOrder { + option (amino.name) = "exchange/MsgCreateSpotLimitOrder"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + SpotOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateSpotLimitOrderResponse defines the Msg/CreateSpotOrder response +// type. +message MsgCreateSpotLimitOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + string cid = 2; +} + +// MsgBatchCreateSpotLimitOrders defines a SDK message for creating a new batch +// of spot limit orders. +message MsgBatchCreateSpotLimitOrders { + option (amino.name) = "exchange/MsgBatchCreateSpotLimitOrders"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated SpotOrder orders = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgBatchCreateSpotLimitOrdersResponse defines the +// Msg/BatchCreateSpotLimitOrders response type. +message MsgBatchCreateSpotLimitOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated string order_hashes = 1; + repeated string created_orders_cids = 2; + repeated string failed_orders_cids = 3; +} + +// MsgInstantSpotMarketLaunch defines a SDK message for creating a new spot +// market by paying listing fee without governance +message MsgInstantSpotMarketLaunch { + option (amino.name) = "exchange/MsgInstantSpotMarketLaunch"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Ticker for the spot market. + string ticker = 2; + // type of coin to use as the base currency + string base_denom = 3; + // type of coin to use as the quote currency + string quote_denom = 4; + // min_price_tick_size defines the minimum tick size of the order's price + string min_price_tick_size = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgInstantSpotMarketLaunchResponse defines the Msg/InstantSpotMarketLaunch +// response type. +message MsgInstantSpotMarketLaunchResponse {} + +// MsgInstantPerpetualMarketLaunch defines a SDK message for creating a new +// perpetual futures market by paying listing fee without governance +message MsgInstantPerpetualMarketLaunch { + option (amino.name) = "exchange/MsgInstantPerpetualMarketLaunch"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Ticker for the derivative market. + string ticker = 2; + // type of coin to use as the base currency + string quote_denom = 3; + // Oracle base currency + string oracle_base = 4; + // Oracle quote currency + string oracle_quote = 5; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 6; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 7; + // maker_fee_rate defines the trade fee rate for makers on the perpetual + // market + string maker_fee_rate = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // taker_fee_rate defines the trade fee rate for takers on the perpetual + // market + string taker_fee_rate = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // initial_margin_ratio defines the initial margin ratio for the perpetual + // market + string initial_margin_ratio = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // maintenance_margin_ratio defines the maintenance margin ratio for the + // perpetual market + string maintenance_margin_ratio = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgInstantPerpetualMarketLaunchResponse defines the +// Msg/InstantPerpetualMarketLaunchResponse response type. +message MsgInstantPerpetualMarketLaunchResponse {} + +// MsgInstantBinaryOptionsMarketLaunch defines a SDK message for creating a new +// perpetual futures market by paying listing fee without governance +message MsgInstantBinaryOptionsMarketLaunch { + option (amino.name) = "exchange/MsgInstantBinaryOptionsMarketLaunch"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Ticker for the derivative contract. + string ticker = 2; + // Oracle symbol + string oracle_symbol = 3; + // Oracle Provider + string oracle_provider = 4; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 5; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 6; + // maker_fee_rate defines the trade fee rate for makers on the perpetual + // market + string maker_fee_rate = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // taker_fee_rate defines the trade fee rate for takers on the perpetual + // market + string taker_fee_rate = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // expiration timestamp + int64 expiration_timestamp = 9; + // expiration timestamp + int64 settlement_timestamp = 10; + // admin of the market + string admin = 11; + // Address of the quote currency denomination for the binary options contract + string quote_denom = 12; + // min_price_tick_size defines the minimum tick size that the price and margin + // required for orders in the market + string min_price_tick_size = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the quantity + // required for orders in the market + string min_quantity_tick_size = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgInstantBinaryOptionsMarketLaunchResponse defines the +// Msg/InstantBinaryOptionsMarketLaunchResponse response type. +message MsgInstantBinaryOptionsMarketLaunchResponse {} + +// MsgInstantExpiryFuturesMarketLaunch defines a SDK message for creating a new +// expiry futures market by paying listing fee without governance +message MsgInstantExpiryFuturesMarketLaunch { + option (amino.name) = "exchange/MsgInstantExpiryFuturesMarketLaunch"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Ticker for the derivative market. + string ticker = 2; + // type of coin to use as the quote currency + string quote_denom = 3; + // Oracle base currency + string oracle_base = 4; + // Oracle quote currency + string oracle_quote = 5; + // Oracle type + injective.oracle.v1beta1.OracleType oracle_type = 6; + // Scale factor for oracle prices. + uint32 oracle_scale_factor = 7; + // Expiration time of the market + int64 expiry = 8; + // maker_fee_rate defines the trade fee rate for makers on the expiry futures + // market + string maker_fee_rate = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // taker_fee_rate defines the trade fee rate for takers on the expiry futures + // market + string taker_fee_rate = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // initial_margin_ratio defines the initial margin ratio for the derivative + // market + string initial_margin_ratio = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // maintenance_margin_ratio defines the maintenance margin ratio for the + // derivative market + string maintenance_margin_ratio = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_price_tick_size defines the minimum tick size of the order's price and + // margin + string min_price_tick_size = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_quantity_tick_size defines the minimum tick size of the order's + // quantity + string min_quantity_tick_size = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // min_notional defines the minimum notional (in quote asset) required for + // orders in the market + string min_notional = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgInstantExpiryFuturesMarketLaunchResponse defines the +// Msg/InstantExpiryFuturesMarketLaunch response type. +message MsgInstantExpiryFuturesMarketLaunchResponse {} + +// MsgCreateSpotMarketOrder defines a SDK message for creating a new spot market +// order. +message MsgCreateSpotMarketOrder { + option (amino.name) = "exchange/MsgCreateSpotMarketOrder"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + SpotOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateSpotMarketOrderResponse defines the Msg/CreateSpotMarketLimitOrder +// response type. +message MsgCreateSpotMarketOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + + SpotMarketOrderResults results = 2 [ (gogoproto.nullable) = true ]; + + string cid = 3; +} + +message SpotMarketOrderResults { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string quantity = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string fee = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// A Cosmos-SDK MsgCreateDerivativeLimitOrder +message MsgCreateDerivativeLimitOrder { + option (amino.name) = "exchange/MsgCreateDerivativeLimitOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + DerivativeOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateDerivativeLimitOrderResponse defines the +// Msg/CreateDerivativeMarketOrder response type. +message MsgCreateDerivativeLimitOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + string cid = 2; +} + +// A Cosmos-SDK MsgCreateBinaryOptionsLimitOrder +message MsgCreateBinaryOptionsLimitOrder { + option (amino.name) = "exchange/MsgCreateBinaryOptionsLimitOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + DerivativeOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateBinaryOptionsLimitOrderResponse defines the +// Msg/CreateBinaryOptionsLimitOrder response type. +message MsgCreateBinaryOptionsLimitOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + string cid = 2; +} + +// A Cosmos-SDK MsgBatchCreateDerivativeLimitOrders +message MsgBatchCreateDerivativeLimitOrders { + option (amino.name) = "exchange/MsgBatchCreateDerivativeLimitOrders"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated DerivativeOrder orders = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgBatchCreateDerivativeLimitOrdersResponse defines the +// Msg/BatchCreateDerivativeLimitOrders response type. +message MsgBatchCreateDerivativeLimitOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated string order_hashes = 1; + repeated string created_orders_cids = 2; + repeated string failed_orders_cids = 3; +} + +// MsgCancelSpotOrder defines the Msg/CancelSpotOrder response type. +message MsgCancelSpotOrder { + option (amino.name) = "exchange/MsgCancelSpotOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string market_id = 2; + string subaccount_id = 3; + string order_hash = 4; + string cid = 5; +} + +// MsgCancelSpotOrderResponse defines the Msg/CancelSpotOrder response type. +message MsgCancelSpotOrderResponse {} + +// MsgBatchCancelSpotOrders defines the Msg/BatchCancelSpotOrders response type. +message MsgBatchCancelSpotOrders { + option (amino.name) = "exchange/MsgBatchCancelSpotOrders"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated OrderData data = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgBatchCancelSpotOrdersResponse defines the Msg/BatchCancelSpotOrders +// response type. +message MsgBatchCancelSpotOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated bool success = 1; +} + +// MsgBatchCancelBinaryOptionsOrders defines the +// Msg/BatchCancelBinaryOptionsOrders response type. +message MsgBatchCancelBinaryOptionsOrders { + option (amino.name) = "exchange/MsgBatchCancelBinaryOptionsOrders"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated OrderData data = 2 [ (gogoproto.nullable) = false ]; +} + +// BatchCancelBinaryOptionsOrdersResponse defines the +// Msg/BatchCancelBinaryOptionsOrders response type. +message MsgBatchCancelBinaryOptionsOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated bool success = 1; +} + +// MsgBatchUpdateOrders defines the Msg/BatchUpdateOrders response type. +message MsgBatchUpdateOrders { + option (amino.name) = "exchange/MsgBatchUpdateOrders"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // subaccount_id only used for the spot_market_ids_to_cancel_all and + // derivative_market_ids_to_cancel_all. + string subaccount_id = 2; + repeated string spot_market_ids_to_cancel_all = 3; + repeated string derivative_market_ids_to_cancel_all = 4; + repeated OrderData spot_orders_to_cancel = 5 [ (gogoproto.nullable) = true ]; + repeated OrderData derivative_orders_to_cancel = 6 + [ (gogoproto.nullable) = true ]; + repeated SpotOrder spot_orders_to_create = 7 [ (gogoproto.nullable) = true ]; + repeated DerivativeOrder derivative_orders_to_create = 8 + [ (gogoproto.nullable) = true ]; + repeated OrderData binary_options_orders_to_cancel = 9 + [ (gogoproto.nullable) = true ]; + repeated string binary_options_market_ids_to_cancel_all = 10; + repeated DerivativeOrder binary_options_orders_to_create = 11 + [ (gogoproto.nullable) = true ]; +} + +// MsgBatchUpdateOrdersResponse defines the Msg/BatchUpdateOrders response type. +message MsgBatchUpdateOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated bool spot_cancel_success = 1; + repeated bool derivative_cancel_success = 2; + repeated string spot_order_hashes = 3; + repeated string derivative_order_hashes = 4; + repeated bool binary_options_cancel_success = 5; + repeated string binary_options_order_hashes = 6; + repeated string created_spot_orders_cids = 7; + repeated string failed_spot_orders_cids = 8; + repeated string created_derivative_orders_cids = 9; + repeated string failed_derivative_orders_cids = 10; + repeated string created_binary_options_orders_cids = 11; + repeated string failed_binary_options_orders_cids = 12; +} + +// A Cosmos-SDK MsgCreateDerivativeMarketOrder +message MsgCreateDerivativeMarketOrder { + option (amino.name) = "exchange/MsgCreateDerivativeMarketOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + DerivativeOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateDerivativeMarketOrderResponse defines the +// Msg/CreateDerivativeMarketOrder response type. +message MsgCreateDerivativeMarketOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + + DerivativeMarketOrderResults results = 2 [ (gogoproto.nullable) = true ]; + + string cid = 3; +} + +message DerivativeMarketOrderResults { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string quantity = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string fee = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + PositionDelta position_delta = 4 [ (gogoproto.nullable) = false ]; + string payout = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// A Cosmos-SDK MsgCreateBinaryOptionsMarketOrder +message MsgCreateBinaryOptionsMarketOrder { + option (amino.name) = "exchange/MsgCreateBinaryOptionsMarketOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + DerivativeOrder order = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateBinaryOptionsMarketOrderResponse defines the +// Msg/CreateBinaryOptionsMarketOrder response type. +message MsgCreateBinaryOptionsMarketOrderResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string order_hash = 1; + + DerivativeMarketOrderResults results = 2 [ (gogoproto.nullable) = true ]; + + string cid = 3; +} + +// MsgCancelDerivativeOrder defines the Msg/CancelDerivativeOrder response type. +message MsgCancelDerivativeOrder { + option (amino.name) = "exchange/MsgCancelDerivativeOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string market_id = 2; + string subaccount_id = 3; + string order_hash = 4; + int32 order_mask = 5; // bitwise combination of OrderMask enum values + string cid = 6; +} + +// MsgCancelDerivativeOrderResponse defines the +// Msg/CancelDerivativeOrderResponse response type. +message MsgCancelDerivativeOrderResponse {} + +// MsgCancelBinaryOptionsOrder defines the Msg/CancelBinaryOptionsOrder response +// type. +message MsgCancelBinaryOptionsOrder { + option (amino.name) = "exchange/MsgCancelBinaryOptionsOrder"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string market_id = 2; + string subaccount_id = 3; + string order_hash = 4; + int32 order_mask = 5; // bitwise combination of OrderMask enum values + string cid = 6; +} + +// MsgCancelBinaryOptionsOrderResponse defines the +// Msg/CancelBinaryOptionsOrderResponse response type. +message MsgCancelBinaryOptionsOrderResponse {} + +message OrderData { + string market_id = 1; + string subaccount_id = 2; + string order_hash = 3; + int32 order_mask = 4; // bitwise combination of OrderMask enum values + string cid = 5; +} + +// MsgBatchCancelDerivativeOrders defines the Msg/CancelDerivativeOrders +// response type. +message MsgBatchCancelDerivativeOrders { + option (amino.name) = "exchange/MsgBatchCancelDerivativeOrders"; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated OrderData data = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgBatchCancelDerivativeOrdersResponse defines the +// Msg/CancelDerivativeOrderResponse response type. +message MsgBatchCancelDerivativeOrdersResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated bool success = 1; +} + +// A Cosmos-SDK MsgSubaccountTransfer +message MsgSubaccountTransfer { + option (amino.name) = "exchange/MsgSubaccountTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string source_subaccount_id = 2; + string destination_subaccount_id = 3; + cosmos.base.v1beta1.Coin amount = 4 [ (gogoproto.nullable) = false ]; +} + +// MsgSubaccountTransferResponse defines the Msg/SubaccountTransfer response +// type. +message MsgSubaccountTransferResponse {} + +// A Cosmos-SDK MsgExternalTransfer +message MsgExternalTransfer { + option (amino.name) = "exchange/MsgExternalTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string source_subaccount_id = 2; + string destination_subaccount_id = 3; + cosmos.base.v1beta1.Coin amount = 4 [ (gogoproto.nullable) = false ]; +} + +// MsgExternalTransferResponse defines the Msg/ExternalTransfer response type. +message MsgExternalTransferResponse {} + +// A Cosmos-SDK MsgLiquidatePosition +message MsgLiquidatePosition { + option (amino.name) = "exchange/MsgLiquidatePosition"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string subaccount_id = 2; + string market_id = 3; + + // optional order to provide for liquidation + DerivativeOrder order = 4 [ (gogoproto.nullable) = true ]; +} + +// MsgLiquidatePositionResponse defines the Msg/LiquidatePosition response type. +message MsgLiquidatePositionResponse {} + +// A Cosmos-SDK MsgEmergencySettleMarket +message MsgEmergencySettleMarket { + option (amino.name) = "exchange/MsgEmergencySettleMarket"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string subaccount_id = 2; + string market_id = 3; +} + +// MsgEmergencySettleMarketResponse defines the Msg/EmergencySettleMarket +// response type. +message MsgEmergencySettleMarketResponse {} + +// A Cosmos-SDK MsgIncreasePositionMargin +message MsgIncreasePositionMargin { + option (amino.name) = "exchange/MsgIncreasePositionMargin"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string source_subaccount_id = 2; + string destination_subaccount_id = 3; + string market_id = 4; + // amount defines the amount of margin to add to the position + string amount = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgIncreasePositionMarginResponse defines the Msg/IncreasePositionMargin +// response type. +message MsgIncreasePositionMarginResponse { +} // A Cosmos-SDK MsgIncreasePositionMargin + +// A Cosmos-SDK MsgDecreasePositionMargin +message MsgDecreasePositionMargin { + option (amino.name) = "exchange/MsgDecreasePositionMargin"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string source_subaccount_id = 2; + string destination_subaccount_id = 3; + string market_id = 4; + // amount defines the amount of margin to withdraw from the position + string amount = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MsgDecreasePositionMarginResponse defines the Msg/MsgDecreasePositionMargin +// response type. +message MsgDecreasePositionMarginResponse {} + +// MsgPrivilegedExecuteContract defines the Msg/Exec message type +message MsgPrivilegedExecuteContract { + option (amino.name) = "exchange/MsgPrivilegedExecuteContract"; + option (cosmos.msg.v1.signer) = "sender"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + string sender = 1; + + // funds defines the user's bank coins used to fund the execution (e.g. + // 100inj). + string funds = 2; + + // contract_address defines the contract address to execute + string contract_address = 3; + + // data defines the call data used when executing the contract + string data = 4; +} + +// MsgPrivilegedExecuteContractResponse defines the Msg/Exec response type. +message MsgPrivilegedExecuteContractResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + repeated cosmos.base.v1beta1.Coin funds_diff = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// A Cosmos-SDK MsgRewardsOptOut +message MsgRewardsOptOut { + option (amino.name) = "exchange/MsgRewardsOptOut"; + option (cosmos.msg.v1.signer) = "sender"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string sender = 1; +} + +// MsgRewardsOptOutResponse defines the Msg/RewardsOptOut response type. +message MsgRewardsOptOutResponse {} + +// A Cosmos-SDK MsgReclaimLockedFunds +message MsgReclaimLockedFunds { + option (amino.name) = "exchange/MsgReclaimLockedFunds"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + bytes lockedAccountPubKey = 2; + bytes signature = 3; +} + +// MsgReclaimLockedFundsResponse defines the Msg/ReclaimLockedFunds response +// type. +message MsgReclaimLockedFundsResponse {} + +// MsgSignData defines an arbitrary, general-purpose, off-chain message +message MsgSignData { + // Signer is the sdk.AccAddress of the message signer + bytes Signer = 1 [ + (gogoproto.jsontag) = "signer", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + // Data represents the raw bytes of the content that is signed (text, json, + // etc) + bytes Data = 2 [ (gogoproto.jsontag) = "data" ]; +} + +// MsgSignDoc defines an arbitrary, general-purpose, off-chain message +message MsgSignDoc { + string sign_type = 1 [ (gogoproto.jsontag) = "type" ]; + MsgSignData value = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgAdminUpdateBinaryOptionsMarket is used by the market Admin to operate the +// market +message MsgAdminUpdateBinaryOptionsMarket { + option (amino.name) = "exchange/MsgAdminUpdateBinaryOptionsMarket"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string market_id = 2; + // new price at which market will be settled + string settlement_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + // expiration timestamp + int64 expiration_timestamp = 4; + // expiration timestamp + int64 settlement_timestamp = 5; + // Status of the market + MarketStatus status = 6; +} + +// MsgAdminUpdateBinaryOptionsMarketResponse is the response for +// AdminUpdateBinaryOptionsMarket rpc method +message MsgAdminUpdateBinaryOptionsMarketResponse {} + +// MsgAuthorizeStakeGrants grants stakes to grantees. +message MsgAuthorizeStakeGrants { + option (amino.name) = "exchange/MsgAuthorizeStakeGrants"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated GrantAuthorization grants = 2; +} + +message MsgAuthorizeStakeGrantsResponse {} + +// MsgActivateStakeGrant allows a grantee to activate a stake grant. +message MsgActivateStakeGrant { + option (amino.name) = "exchange/MsgActivateStakeGrant"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string granter = 2; +} + +message MsgActivateStakeGrantResponse {} \ No newline at end of file diff --git a/protos/injectivejs/injective/insurance/v1beta1/events.proto b/protos/injectivejs/injective/insurance/v1beta1/events.proto new file mode 100644 index 00000000..e4b2d48e --- /dev/null +++ b/protos/injectivejs/injective/insurance/v1beta1/events.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package injective.insurance.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/insurance/v1beta1/insurance.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types"; + +message EventInsuranceFundUpdate { InsuranceFund fund = 1; } + +message EventRequestRedemption { RedemptionSchedule schedule = 1; } + +message EventWithdrawRedemption { + // redemption schedule triggered withdraw + RedemptionSchedule schedule = 1; + // redeem coin amount in base_currency + cosmos.base.v1beta1.Coin redeem_coin = 2 [ (gogoproto.nullable) = false ]; +} + +message EventUnderwrite { + // address of the underwriter + string underwriter = 1; + // marketId of insurance fund for the redemption + string marketId = 2; + // deposit coin amount + cosmos.base.v1beta1.Coin deposit = 3 [ (gogoproto.nullable) = false ]; + // share coin amount + cosmos.base.v1beta1.Coin shares = 4 [ (gogoproto.nullable) = false ]; +} + +message EventInsuranceWithdraw { + string market_id = 1; + string market_ticker = 2; + cosmos.base.v1beta1.Coin withdrawal = 3 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/insurance/v1beta1/genesis.proto b/protos/injectivejs/injective/insurance/v1beta1/genesis.proto new file mode 100644 index 00000000..3b7d3d34 --- /dev/null +++ b/protos/injectivejs/injective/insurance/v1beta1/genesis.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package injective.insurance.v1beta1; + +import "injective/insurance/v1beta1/insurance.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types"; + +// GenesisState defines the insurance module's genesis state. +message GenesisState { + // params defines all the parameters of related to insurance. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // insurance_funds describes the insurance funds available for derivative + // markets + repeated InsuranceFund insurance_funds = 2 [ (gogoproto.nullable) = false ]; + + // redemption_schedule describes the redemption requests pending + repeated RedemptionSchedule redemption_schedule = 3 + [ (gogoproto.nullable) = false ]; + + // next_share_denom_id describes the next share denom id to be used for newly + // creating insurance fund incremented by 1 per insurance fund creation + uint64 next_share_denom_id = 4; + + // next_redemption_schedule_id describes next redemption schedule id to be + // used for next schedule incremented by 1 per redemption request + uint64 next_redemption_schedule_id = 5; +} diff --git a/protos/injectivejs/injective/insurance/v1beta1/insurance.proto b/protos/injectivejs/injective/insurance/v1beta1/insurance.proto new file mode 100644 index 00000000..e4e2ada5 --- /dev/null +++ b/protos/injectivejs/injective/insurance/v1beta1/insurance.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +package injective.insurance.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types"; + +message Params { + option (gogoproto.equal) = true; + option (amino.name) = "insurance/Params"; + + // default_redemption_notice_period_duration defines the default minimum + // notice period duration that must pass after an underwriter sends a + // redemption request before the underwriter can claim his tokens + google.protobuf.Duration default_redemption_notice_period_duration = 1 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"default_redemption_notice_period_duration\"" + ]; +} + +message InsuranceFund { + // deposit denomination for the given insurance fund + string deposit_denom = 1; + // insurance fund pool token denomination for the given insurance fund + string insurance_pool_token_denom = 2; + // redemption_notice_period_duration defines the minimum notice period + // duration that must pass after an underwriter sends a redemption request + // before the underwriter can claim his tokens + google.protobuf.Duration redemption_notice_period_duration = 3 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"redemption_notice_period_duration\"" + ]; + // balance of fund + string balance = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // total share tokens minted + string total_share = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // marketID of the derivative market + string market_id = 6; + // ticker of the derivative market + string market_ticker = 7; + // Oracle base currency of the derivative market OR the oracle symbol for the + // binary options market. + string oracle_base = 8; + // Oracle quote currency of the derivative market OR the oracle provider for + // the binary options market. + string oracle_quote = 9; + // Oracle type of the binary options or derivative market + injective.oracle.v1beta1.OracleType oracle_type = 10; + // Expiration time of the derivative market. Should be -1 for perpetual or -2 + // for binary options markets. + int64 expiry = 11; +} + +message RedemptionSchedule { + // id of redemption schedule + uint64 id = 1; + // marketId of insurance fund for the redemption + string marketId = 2; + // address of the redeemer + string redeemer = 3; + // the time after which the redemption can be claimed + google.protobuf.Timestamp claimable_redemption_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"claimable_redemption_time\"" + ]; + + // the insurance_pool_token amount to redeem + cosmos.base.v1beta1.Coin redemption_amount = 5 + [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/insurance/v1beta1/query.proto b/protos/injectivejs/injective/insurance/v1beta1/query.proto new file mode 100644 index 00000000..ec21948c --- /dev/null +++ b/protos/injectivejs/injective/insurance/v1beta1/query.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; +package injective.insurance.v1beta1; + +import "google/api/annotations.proto"; +import "injective/insurance/v1beta1/insurance.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/insurance/v1beta1/genesis.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types"; + +// Query defines the gRPC querier service. +service Query { + + // Retrieves insurance params + rpc InsuranceParams(QueryInsuranceParamsRequest) + returns (QueryInsuranceParamsResponse) { + option (google.api.http).get = "/injective/insurance/v1beta1/params"; + } + + // Retrieves individual insurance fund information from market id + rpc InsuranceFund(QueryInsuranceFundRequest) + returns (QueryInsuranceFundResponse) { + option (google.api.http).get = + "/injective/insurance/v1beta1/insurance_fund/{market_id}"; + } + + // Retrieves all insurance funds + rpc InsuranceFunds(QueryInsuranceFundsRequest) + returns (QueryInsuranceFundsResponse) { + option (google.api.http).get = + "/injective/insurance/v1beta1/insurance_funds"; + } + + // Retrives the value of insurance fund share token at current price (not + // pending redemption) + rpc EstimatedRedemptions(QueryEstimatedRedemptionsRequest) + returns (QueryEstimatedRedemptionsResponse) { + option (google.api.http).get = + "/injective/insurance/v1beta1/estimated_redemptions"; + } + + // Retrieves pending redemptions' share token at current price + rpc PendingRedemptions(QueryPendingRedemptionsRequest) + returns (QueryPendingRedemptionsResponse) { + option (google.api.http).get = + "/injective/insurance/v1beta1/pending_redemptions"; + } + + // Retrieves the entire insurance module's state + rpc InsuranceModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/injective/insurance/v1beta1/module_state"; + } +} + +// QueryInsuranceParamsRequest is the request type for the Query/InsuranceParams +// RPC method. +message QueryInsuranceParamsRequest {} + +// QueryInsuranceParamsRequest is the response type for the +// Query/InsuranceParams RPC method. +message QueryInsuranceParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryInsuranceFundRequest is the request type for the Query/InsuranceFunds +// RPC method. +message QueryInsuranceFundRequest { + // Market ID for the market + string market_id = 1; +} + +// QueryInsuranceFundResponse is the response type for the Query/InsuranceFund +// RPC method. +message QueryInsuranceFundResponse { InsuranceFund fund = 1; } + +// QueryInsuranceFundsRequest is the request type for the Query/InsuranceFunds +// RPC method. +message QueryInsuranceFundsRequest {} + +// QueryInsuranceFundsResponse is the response type for the Query/InsuranceFunds +// RPC method. +message QueryInsuranceFundsResponse { + repeated InsuranceFund funds = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryEstimatedRedemptionsRequest is the request type for the +// Query/EstimatedRedemptions RPC method. +message QueryEstimatedRedemptionsRequest { + string marketId = 1; + string address = 2; +} + +// QueryEstimatedRedemptionsResponse is the response type for the +// Query/EstimatedRedemptions RPC method. +message QueryEstimatedRedemptionsResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryPendingRedemptionsRequest is the request type for the +// Query/PendingRedemptions RPC method. +message QueryPendingRedemptionsRequest { + string marketId = 1; + string address = 2; +} + +// QueryPendingRedemptionsResponse is the response type for the +// Query/PendingRedemptions RPC method. +message QueryPendingRedemptionsResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryModuleStateRequest is the request type for the +// Query/InsuranceModuleState RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the +// Query/InsuranceModuleState RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } \ No newline at end of file diff --git a/protos/injectivejs/injective/insurance/v1beta1/tx.proto b/protos/injectivejs/injective/insurance/v1beta1/tx.proto new file mode 100644 index 00000000..88410ff4 --- /dev/null +++ b/protos/injectivejs/injective/insurance/v1beta1/tx.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package injective.insurance.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "injective/insurance/v1beta1/insurance.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types"; + +// Msg defines the insurance Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateInsuranceFund defines a method for creating an insurance fund + rpc CreateInsuranceFund(MsgCreateInsuranceFund) + returns (MsgCreateInsuranceFundResponse); + + // Underwrite defines a method for depositing tokens to underwrite an + // insurance fund + rpc Underwrite(MsgUnderwrite) returns (MsgUnderwriteResponse); + + // RequestRedemption defines a method for requesting a redemption of the + // sender's insurance fund tokens + rpc RequestRedemption(MsgRequestRedemption) + returns (MsgRequestRedemptionResponse); + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgCreateInsuranceFund a message to create an insurance fund for a derivative +// market. +message MsgCreateInsuranceFund { + option (amino.name) = "insurance/MsgCreateInsuranceFund"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + // Creator of the insurance fund. + string sender = 1; + // Ticker for the derivative market. + string ticker = 2; + // Coin denom to use for the market quote denom + string quote_denom = 3; + // Oracle base currency of the derivative market OR the oracle symbol for the + // binary options market. + string oracle_base = 4; + // Oracle quote currency of the derivative market OR the oracle provider for + // the binary options market. + string oracle_quote = 5; + // Oracle type of the binary options or derivative market + injective.oracle.v1beta1.OracleType oracle_type = 6; + // Expiration time of the derivative market. Should be -1 for perpetual or -2 + // for binary options markets. + int64 expiry = 7; + // Initial deposit of the insurance fund + cosmos.base.v1beta1.Coin initial_deposit = 8 [ (gogoproto.nullable) = false ]; +} + +message MsgCreateInsuranceFundResponse {} + +// MsgUnderwrite defines a message for depositing coins to underwrite an +// insurance fund +message MsgUnderwrite { + option (amino.name) = "insurance/MsgUnderwrite"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + // Address of the underwriter. + string sender = 1; + // MarketID of the insurance fund. + string market_id = 2; + // Amount of quote_denom to underwrite the insurance fund. + cosmos.base.v1beta1.Coin deposit = 3 [ (gogoproto.nullable) = false ]; +} + +message MsgUnderwriteResponse {} + +// MsgRequestRedemption defines a message for requesting a redemption of the +// sender's insurance fund tokens +message MsgRequestRedemption { + option (amino.name) = "insurance/MsgRequestRedemption"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + // Address of the underwriter requesting a redemption. + string sender = 1; + // MarketID of the insurance fund. + string market_id = 2; + // Insurance fund share token amount to be redeemed. + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message MsgRequestRedemptionResponse {} + +message MsgUpdateParams { + option (amino.name) = "insurance/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 insurance parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} diff --git a/protos/injectivejs/injective/ocr/v1beta1/genesis.proto b/protos/injectivejs/injective/ocr/v1beta1/genesis.proto new file mode 100644 index 00000000..3783cd9f --- /dev/null +++ b/protos/injectivejs/injective/ocr/v1beta1/genesis.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; +package injective.ocr.v1beta1; + +import "injective/ocr/v1beta1/ocr.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/ocr/types"; + +// GenesisState defines the OCR module's genesis state. +message GenesisState { + // params defines all the parameters of related to OCR. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // feed_configs stores all of the supported OCR feeds + repeated FeedConfig feed_configs = 2; + + // latest_epoch_and_rounds stores the latest epoch and round for each feedId + repeated FeedEpochAndRound latest_epoch_and_rounds = 3; + + // feed_transmissions stores the last transmission for each feed + repeated FeedTransmission feed_transmissions = 4; + + // latest_aggregator_round_ids stores the latest aggregator round ID for each + // feedId + repeated FeedLatestAggregatorRoundIDs latest_aggregator_round_ids = 5; + + // reward_pools stores the reward pools + repeated RewardPool reward_pools = 6; + + // feed_observation_counts stores the feed observation counts + repeated FeedCounts feed_observation_counts = 7; + + // feed_transmission_counts stores the feed transmission counts + repeated FeedCounts feed_transmission_counts = 8; + + // pending_payeeships stores the pending payeeships + repeated PendingPayeeship pending_payeeships = 9; +} + +message FeedTransmission { + string feed_id = 1; + Transmission transmission = 2; +} + +message FeedEpochAndRound { + string feed_id = 1; + EpochAndRound epoch_and_round = 2; +} + +message FeedLatestAggregatorRoundIDs { + string feed_id = 1; + uint64 aggregator_round_id = 2; +} + +message RewardPool { + string feed_id = 1; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message FeedCounts { + string feed_id = 1; + repeated Count counts = 2; +} + +message Count { + string address = 1; + uint64 count = 2; +} + +message PendingPayeeship { + string feed_id = 1; + string transmitter = 2; + string proposed_payee = 3; +} diff --git a/protos/injectivejs/injective/ocr/v1beta1/ocr.proto b/protos/injectivejs/injective/ocr/v1beta1/ocr.proto new file mode 100644 index 00000000..8f7c2a5d --- /dev/null +++ b/protos/injectivejs/injective/ocr/v1beta1/ocr.proto @@ -0,0 +1,334 @@ +syntax = "proto3"; +package injective.ocr.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/ocr/types"; + +message Params { + option (amino.name) = "ocr/Params"; + option (gogoproto.equal) = true; + + // Native denom for LINK coin in the bank keeper + string link_denom = 1; + // The block number interval at which payouts are made + uint64 payout_block_interval = 2; + // The admin for the OCR module + string module_admin = 3; +} + +message FeedConfig { + // signers ith element is address ith oracle uses to sign a report + repeated string signers = 1; + + // transmitters ith element is address ith oracle uses to transmit a report + // via the transmit method + repeated string transmitters = 2; + + // f maximum number of faulty/dishonest oracles the protocol can tolerate + // while still working correctly + uint32 f = 3; + + // onchain_config serialized data with reporting plugin params on chain. + bytes onchain_config = 4; + + // offchain_config_version version of the serialization format used for + // "offchain_config" parameter + uint64 offchain_config_version = 5; + + // offchain_config serialized data used by oracles to configure their offchain + // operation + bytes offchain_config = 6; + + // feed-specific params for the Cosmos module. + ModuleParams module_params = 7; +} + +message FeedConfigInfo { + bytes latest_config_digest = 1; + uint32 f = 2; + uint32 n = 3; + // config_count ordinal number of this config setting among all config + // settings + uint64 config_count = 4; + int64 latest_config_block_number = 5; +} + +message ModuleParams { + // feed_id is an unique ID for the target of this config + string feed_id = 1; + + // lowest answer the median of a report is allowed to be + string min_answer = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // highest answer the median of a report is allowed to be + string max_answer = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Fixed LINK reward for each observer + string link_per_observation = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // Fixed LINK reward for transmitter + string link_per_transmission = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // Native denom for LINK coin in the bank keeper + string link_denom = 6; + + // Enables unique reports + bool unique_reports = 7; + + // short human-readable description of observable this feed's answers pertain + // to + string description = 8; + + // feed administrator + string feed_admin = 9; + + // feed billing administrator + string billing_admin = 10; +} + +message ContractConfig { + // config_count ordinal number of this config setting among all config + // settings + uint64 config_count = 1; + + // signers ith element is address ith oracle uses to sign a report + repeated string signers = 2; + + // transmitters ith element is address ith oracle uses to transmit a report + // via the transmit method + repeated string transmitters = 3; + + // f maximum number of faulty/dishonest oracles the protocol can tolerate + // while still working correctly + uint32 f = 4; + + // onchain_config serialized data with reporting plugin params on chain. + bytes onchain_config = 5; + + // offchain_config_version version of the serialization format used for + // "offchain_config" parameter + uint64 offchain_config_version = 6; + + // offchain_config serialized data used by oracles to configure their offchain + // operation + bytes offchain_config = 7; +} + +message SetConfigProposal { + option (amino.name) = "ocr/SetConfigProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + FeedConfig config = 3; +} + +message FeedProperties { + // feed_id is an unique ID for the target of this config + string feed_id = 1; + + // f maximum number of faulty/dishonest oracles the protocol can tolerate + // while still working correctly + uint32 f = 2; + + // onchain_config serialized data with reporting plugin params on chain. + bytes onchain_config = 3; + + // offchain_config_version version of the serialization format used for + // "offchain_config" parameter + uint64 offchain_config_version = 4; + + // offchain_config serialized data used by oracles to configure their offchain + // operation + bytes offchain_config = 5; + + // lowest answer the median of a report is allowed to be + string min_answer = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // highest answer the median of a report is allowed to be + string max_answer = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Fixed LINK reward for each observer + string link_per_observation = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // Fixed LINK reward for transmitter + string link_per_transmission = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // Enables unique reports + bool unique_reports = 10; + + // short human-readable description of observable this feed's answers pertain + // to + string description = 11; +} + +message SetBatchConfigProposal { + option (amino.name) = "ocr/SetBatchConfigProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + // signers ith element is address ith oracle uses to sign a report + repeated string signers = 3; + + // transmitters ith element is address ith oracle uses to transmit a report + // via the transmit method + repeated string transmitters = 4; + + // Native denom for LINK coin in the bank keeper + string link_denom = 5; + + // feed properties + repeated FeedProperties feed_properties = 6; +} + +message OracleObservationsCounts { repeated uint32 counts = 1; } + +// LINK-INJ-denominated reimbursements for gas used by transmitters. +message GasReimbursements { + repeated cosmos.base.v1beta1.Coin reimbursements = 1; +} + +message Payee { + string transmitter_addr = 1; + string payment_addr = 2; +} + +// Transmission records the median answer from the transmit transaction at +// time timestamp +message Transmission { + string answer = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + int64 observations_timestamp = 2; // when were observations made offchain + int64 transmission_timestamp = 3; // when was report received onchain +} + +message EpochAndRound { + uint64 epoch = 1; + uint64 round = 2; +} + +message Report { + int64 observations_timestamp = 1; + bytes observers = 2; // ith element is the index of the ith observer + repeated string observations = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; // ith element is the ith observation +} + +message ReportToSign { + bytes config_digest = 1; + uint64 epoch = 2; + uint64 round = 3; + bytes extra_hash = 4; + + // Opaque report + bytes report = 5; +} + +message EventOraclePaid { + string transmitter_addr = 1; + string payee_addr = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message EventAnswerUpdated { + string current = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + string round_id = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + google.protobuf.Timestamp updated_at = 3 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} + +message EventNewRound { + string round_id = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // address of starter + string started_by = 2; + + google.protobuf.Timestamp started_at = 3 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} + +message EventTransmitted { + bytes config_digest = 1; + uint64 epoch = 2; +} + +message EventNewTransmission { + string feed_id = 1; + uint32 aggregator_round_id = 2; + string answer = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string transmitter = 4; + int64 observations_timestamp = 5; + repeated string observations = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes observers = 7; + bytes config_digest = 8; + EpochAndRound epoch_and_round = 9; +} + +message EventConfigSet { + // hash of the config + bytes config_digest = 1; + // previous_config_block_number block in which the previous config was set, to + // simplify historic analysis + int64 previous_config_block_number = 2; + + FeedConfig config = 3; + FeedConfigInfo config_info = 4; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/ocr/v1beta1/query.proto b/protos/injectivejs/injective/ocr/v1beta1/query.proto new file mode 100644 index 00000000..408c1e26 --- /dev/null +++ b/protos/injectivejs/injective/ocr/v1beta1/query.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; +package injective.ocr.v1beta1; + +import "google/api/annotations.proto"; +import "injective/ocr/v1beta1/ocr.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/ocr/v1beta1/genesis.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/ocr/types"; + +// Query defines the gRPC querier service for OCR module. +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/chainlink/ocr/v1beta1/params"; + } + + // Retrieves the OCR FeedConfig for a given FeedId + rpc FeedConfig(QueryFeedConfigRequest) returns (QueryFeedConfigResponse) { + option (google.api.http).get = + "/chainlink/ocr/v1beta1/feed_config/{feed_id}"; + } + + // Retrieves the OCR FeedConfigInfo for a given FeedId + rpc FeedConfigInfo(QueryFeedConfigInfoRequest) + returns (QueryFeedConfigInfoResponse) { + option (google.api.http).get = + "/chainlink/ocr/v1beta1/feed_config_info/{feed_id}"; + } + + // Retrieves latest round ID and data, including median answer for that round + rpc LatestRound(QueryLatestRoundRequest) returns (QueryLatestRoundResponse) { + option (google.api.http).get = + "/chainlink/ocr/v1beta1/latest_round/{feed_id}"; + } + + // LatestTransmissionDetails returns details about the latest trasmission + // recorded on chain for the given feed ID. + rpc LatestTransmissionDetails(QueryLatestTransmissionDetailsRequest) + returns (QueryLatestTransmissionDetailsResponse) { + option (google.api.http).get = + "/chainlink/ocr/v1beta1/latest_transmission_details/{feed_id}"; + } + + // Retrieves transmitter's owed amount + rpc OwedAmount(QueryOwedAmountRequest) returns (QueryOwedAmountResponse) { + option (google.api.http).get = + "/chainlink/ocr/v1beta1/owed_amount/{transmitter}"; + } + + // Retrieves the entire OCR module's state + rpc OcrModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/chainlink/ocr/v1beta1/module_state"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryFeedConfigRequest { string feed_id = 1; } + +message QueryFeedConfigResponse { + FeedConfigInfo feed_config_info = 1; + FeedConfig feed_config = 2; +} + +message QueryFeedConfigInfoRequest { string feed_id = 1; } + +message QueryFeedConfigInfoResponse { + FeedConfigInfo feed_config_info = 1; + EpochAndRound epoch_and_round = 2; +} + +message QueryLatestRoundRequest { string feed_id = 1; } + +message QueryLatestRoundResponse { + uint64 latest_round_id = 1; + Transmission data = 2; +} + +message QueryLatestTransmissionDetailsRequest { string feed_id = 1; } + +message QueryLatestTransmissionDetailsResponse { + bytes config_digest = 1; + EpochAndRound epoch_and_round = 2; + Transmission data = 3; +} + +message QueryOwedAmountRequest { string transmitter = 1; } + +message QueryOwedAmountResponse { + cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryModuleStateRequest {} + +message QueryModuleStateResponse { GenesisState state = 1; } \ No newline at end of file diff --git a/protos/injectivejs/injective/ocr/v1beta1/tx.proto b/protos/injectivejs/injective/ocr/v1beta1/tx.proto new file mode 100644 index 00000000..1da0a80b --- /dev/null +++ b/protos/injectivejs/injective/ocr/v1beta1/tx.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; +package injective.ocr.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "injective/ocr/v1beta1/ocr.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/ocr/types"; + +// Msg defines the OCR Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateFeed defines a method for creating feed by module admin + rpc CreateFeed(MsgCreateFeed) returns (MsgCreateFeedResponse); + // CreateFeed defines a method for creating feed by feed admin or feed billing + // admin + rpc UpdateFeed(MsgUpdateFeed) returns (MsgUpdateFeedResponse); + // Transmit defines a method for transmitting the feed info by transmitter + rpc Transmit(MsgTransmit) returns (MsgTransmitResponse); + // FundFeedRewardPool defines a method to put funds into feed reward pool + rpc FundFeedRewardPool(MsgFundFeedRewardPool) + returns (MsgFundFeedRewardPoolResponse); + // WithdrawFeedRewardPool defines a method to witdhraw feed reward by feed + // admin or billing admin + rpc WithdrawFeedRewardPool(MsgWithdrawFeedRewardPool) + returns (MsgWithdrawFeedRewardPoolResponse); + // SetPayees defines a method to set payees for transmitters (batch action) + rpc SetPayees(MsgSetPayees) returns (MsgSetPayeesResponse); + // TransferPayeeship defines a method for a payee to transfer reward receive + // ownership + rpc TransferPayeeship(MsgTransferPayeeship) + returns (MsgTransferPayeeshipResponse); + // AcceptPayeeship defines a method for a new payee to accept reward receive + // ownership + rpc AcceptPayeeship(MsgAcceptPayeeship) returns (MsgAcceptPayeeshipResponse); + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgCreateFeed { + option (amino.name) = "ocr/MsgCreateFeed"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + FeedConfig config = 2; +} + +message MsgCreateFeedResponse {} + +message MsgUpdateFeed { + option (amino.name) = "ocr/MsgUpdateFeed"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // feed_id is an unique ID for the target of this config + string feed_id = 2; + + // signers ith element is address ith oracle uses to sign a report + repeated string signers = 3; + + // transmitters ith element is address ith oracle uses to transmit a report + // via the transmit method + repeated string transmitters = 4; + + // Fixed LINK reward for each observer + string link_per_observation = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + + // Fixed LINK reward for transmitter + string link_per_transmission = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + + // Native denom for LINK coin in the bank keeper + string link_denom = 7; + + // feed administrator + string feed_admin = 8; + + // feed billing administrator + string billing_admin = 9; +} + +message MsgUpdateFeedResponse {} + +message MsgTransmit { + option (amino.name) = "ocr/MsgTransmit"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "transmitter"; + + // Address of the transmitter + string transmitter = 1; + bytes config_digest = 2; + string feed_id = 3; + uint64 epoch = 4; + uint64 round = 5; + bytes extra_hash = 6; + Report report = 7; + repeated bytes signatures = 8; +} + +message MsgTransmitResponse {} + +message MsgFundFeedRewardPool { + option (amino.name) = "ocr/MsgFundFeedRewardPool"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string feed_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message MsgFundFeedRewardPoolResponse {} + +message MsgWithdrawFeedRewardPool { + option (amino.name) = "ocr/MsgWithdrawFeedRewardPool"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string feed_id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message MsgWithdrawFeedRewardPoolResponse {} + +message MsgSetPayees { + option (amino.name) = "ocr/MsgSetPayees"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string feed_id = 2; + // addresses oracles use to transmit the reports + repeated string transmitters = 3; + + // addresses of payees corresponding to list of transmitters + repeated string payees = 4; +} + +message MsgSetPayeesResponse {} + +message MsgTransferPayeeship { + option (amino.name) = "ocr/MsgTransferPayeeship"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "sender"; + + // transmitter address of oracle whose payee is changing + string sender = 1; + string transmitter = 2; + string feed_id = 3; + // new payee address + string proposed = 4; +} + +message MsgTransferPayeeshipResponse {} + +message MsgAcceptPayeeship { + option (amino.name) = "ocr/MsgAcceptPayeeship"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "transmitter"; + + // new payee address + string payee = 1; + // transmitter address of oracle whose payee is changing + string transmitter = 2; + string feed_id = 3; +} + +message MsgAcceptPayeeshipResponse {} + +message MsgUpdateParams { + option (amino.name) = "ocr/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 ocr parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/protos/injectivejs/injective/oracle/v1beta1/events.proto b/protos/injectivejs/injective/oracle/v1beta1/events.proto new file mode 100644 index 00000000..82c151fc --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/events.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "injective/oracle/v1beta1/oracle.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; + +message SetChainlinkPriceEvent { + string feed_id = 1; + string answer = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 timestamp = 3; +} + +// Event type upon set ref +message SetBandPriceEvent { + string relayer = 1; + string symbol = 2; + string price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 resolve_time = 4; + uint64 request_id = 5; +} + +message SetBandIBCPriceEvent { + string relayer = 1; + repeated string symbols = 2; + repeated string prices = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 resolve_time = 4; + uint64 request_id = 5; + int64 client_id = 6; +} + +message EventBandIBCAckSuccess { + string ack_result = 1; + int64 client_id = 2; +} + +message EventBandIBCAckError { + string ack_error = 1; + int64 client_id = 2; +} + +message EventBandIBCResponseTimeout { int64 client_id = 1; } + +message SetPriceFeedPriceEvent { + string relayer = 1; + + string base = 2; + string quote = 3; + + // price defines the price of the oracle base and quote + string price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SetProviderPriceEvent { + string provider = 1; + string relayer = 2; + string symbol = 3; + string price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SetCoinbasePriceEvent { + string symbol = 1; + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 timestamp = 3; +} + +message EventSetStorkPrices { repeated StorkPriceState prices = 1; } + +message EventSetPythPrices { repeated PythPriceState prices = 1; } diff --git a/protos/injectivejs/injective/oracle/v1beta1/genesis.proto b/protos/injectivejs/injective/oracle/v1beta1/genesis.proto new file mode 100644 index 00000000..8e2665dc --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/genesis.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "injective/oracle/v1beta1/oracle.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + // params defines all the parameters of related to oracle. + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated string band_relayers = 2; + + repeated BandPriceState band_price_states = 3; + + repeated PriceFeedState price_feed_price_states = 4; + + repeated CoinbasePriceState coinbase_price_states = 5; + + repeated BandPriceState band_ibc_price_states = 6; + + repeated BandOracleRequest band_ibc_oracle_requests = 7; + + BandIBCParams band_ibc_params = 8 [ (gogoproto.nullable) = false ]; + + uint64 band_ibc_latest_client_id = 9; + + repeated CalldataRecord calldata_records = 10; + + uint64 band_ibc_latest_request_id = 11; + + repeated ChainlinkPriceState chainlink_price_states = 12; + + repeated PriceRecords historical_price_records = 13; + + repeated ProviderState provider_states = 14; + + repeated PythPriceState pyth_price_states = 15; + + repeated StorkPriceState stork_price_states = 16; + + repeated string stork_publishers = 17; +} + +message CalldataRecord { + uint64 client_id = 1; + bytes calldata = 2; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/oracle/v1beta1/oracle.proto b/protos/injectivejs/injective/oracle/v1beta1/oracle.proto new file mode 100644 index 00000000..2b9e2a84 --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/oracle.proto @@ -0,0 +1,299 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; +option (gogoproto.goproto_registration) = true; + +message Params { + option (amino.name) = "oracle/Params"; + option (gogoproto.equal) = true; + + string pyth_contract = 1; +} + +enum OracleType { + Unspecified = 0; + Band = 1; + PriceFeed = 2; + Coinbase = 3; + Chainlink = 4; + Razor = 5; + Dia = 6; + API3 = 7; + Uma = 8; + Pyth = 9; + BandIBC = 10; + Provider = 11; + Stork = 12; +} + +message OracleInfo { + string symbol = 1; + OracleType oracle_type = 2; +} + +message ChainlinkPriceState { + string feed_id = 1; + string answer = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 timestamp = 3; + PriceState price_state = 4 [ (gogoproto.nullable) = false ]; +} + +message BandPriceState { + string symbol = 1; + string rate = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + uint64 resolve_time = 3; + uint64 request_ID = 4; + PriceState price_state = 5 [ (gogoproto.nullable) = false ]; +} + +message PriceFeedState { + string base = 1; + string quote = 2; + PriceState price_state = 3; + repeated string relayers = 4; +} + +message ProviderInfo { + string provider = 1; + repeated string relayers = 2; +} + +message ProviderState { + ProviderInfo provider_info = 1; + repeated ProviderPriceState provider_price_states = 2; +} + +message ProviderPriceState { + string symbol = 1; + PriceState state = 2; +} + +message PriceFeedInfo { + string base = 1; + string quote = 2; +} + +message PriceFeedPrice { + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message CoinbasePriceState { + // kind should always be "prices" + string kind = 1; + // timestamp of the when the price was signed by coinbase + uint64 timestamp = 2; + // the symbol of the price, e.g. BTC + string key = 3; + // the value of the price scaled by 1e6 + uint64 value = 4; + // the price state + PriceState price_state = 5 [ (gogoproto.nullable) = false ]; +} + +message StorkPriceState { + // timestamp of the when the price was signed by stork + uint64 timestamp = 1; + // the symbol of the price, e.g. BTC + string symbol = 2; + // the value of the price scaled by 1e18 + string value = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // the price state + PriceState price_state = 5 [ (gogoproto.nullable) = false ]; +} + +message PriceState { + string price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string cumulative_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + int64 timestamp = 3; +} + +message PythPriceState { + string price_id = 1; + string ema_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string ema_conf = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string conf = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 publish_time = 5; + PriceState price_state = 6 [ (gogoproto.nullable) = false ]; +} + +message BandOracleRequest { + // Unique Identifier for band ibc oracle request + uint64 request_id = 1; + + // OracleScriptID is the unique identifier of the oracle script to be + // executed. + int64 oracle_script_id = 2; + + // Symbols is the list of symbols to prepare in the calldata + repeated string symbols = 3; + + // AskCount is the number of validators that are requested to respond to this + // oracle request. Higher value means more security, at a higher gas cost. + uint64 ask_count = 4; + + // MinCount is the minimum number of validators necessary for the request to + // proceed to the execution phase. Higher value means more security, at the + // cost of liveness. + uint64 min_count = 5; + + // FeeLimit is the maximum tokens that will be paid to all data source + // providers. + repeated cosmos.base.v1beta1.Coin fee_limit = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // PrepareGas is amount of gas to pay to prepare raw requests + uint64 prepare_gas = 7; + // ExecuteGas is amount of gas to reserve for executing + uint64 execute_gas = 8; + // MinSourceCount is the minimum number of data sources that must be used by + // each validator + uint64 min_source_count = 9; +} + +message BandIBCParams { + // true if Band IBC should be enabled + bool band_ibc_enabled = 1; + // block request interval to send Band IBC prices + int64 ibc_request_interval = 2; + + // band IBC source channel + string ibc_source_channel = 3; + // band IBC version + string ibc_version = 4; + // band IBC portID + string ibc_port_id = 5; + // legacy oracle scheme ids + repeated int64 legacy_oracle_ids = 6; +} + +message SymbolPriceTimestamp { + OracleType oracle = 1; + string symbol_id = 2; + + int64 timestamp = 3; +} + +message LastPriceTimestamps { + repeated SymbolPriceTimestamp last_price_timestamps = 1; +} + +message PriceRecords { + OracleType oracle = 1; + string symbol_id = 2; + repeated PriceRecord latest_price_records = 3; +} + +message PriceRecord { + int64 timestamp = 1; + + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// MetadataStatistics refers to the metadata summary statistics of the +// historical sample considered +message MetadataStatistics { + // GroupCount refers to the number of groups used. Equals RecordsSampleSize if + // no grouping is used + uint32 group_count = 1; + // RecordsSampleSize refers to the total number of records used. + uint32 records_sample_size = 2; + // Mean refers to the arithmetic mean + // For trades, the mean is the VWAP computed over the grouped trade records ∑ + // (price * quantity) / ∑ quantity For oracle prices, the mean is computed + // over the price records ∑ (price) / prices_count + string mean = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // TWAP refers to the time-weighted average price which equals ∑ (price_i * + // ∆t_i) / ∑ ∆t_i where ∆t_i = t_i - t_{i-1} + string twap = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // FirstTimestamp is the timestamp of the oldest record considered + int64 first_timestamp = 5; + // LastTimestamp is the timestamp of the youngest record considered + int64 last_timestamp = 6; + // MinPrice refers to the smallest individual raw price considered + string min_price = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // MaxPrice refers to the largest individual raw price considered + string max_price = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // MedianPrice refers to the median individual raw price considered + string median_price = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message PriceAttestation { + string price_id = 1; + // MaxPrice refers to the largest individual raw price considered + int64 price = 2; + uint64 conf = 3; + int32 expo = 4; + int64 ema_price = 5; + uint64 ema_conf = 6; + int32 ema_expo = 7; + int64 publish_time = 8; +} + +message AssetPair { + string asset_id = 1; + repeated SignedPriceOfAssetPair signed_prices = 2; +} + +message SignedPriceOfAssetPair { + string publisher_key = 1; + uint64 timestamp = 2; + string price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes signature = 4; +} diff --git a/protos/injectivejs/injective/oracle/v1beta1/proposal.proto b/protos/injectivejs/injective/oracle/v1beta1/proposal.proto new file mode 100644 index 00000000..2c149cf7 --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/proposal.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; + +message GrantBandOraclePrivilegeProposal { + option (amino.name) = "oracle/GrantBandOraclePrivilegeProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string relayers = 3; +} + +message RevokeBandOraclePrivilegeProposal { + option (amino.name) = "oracle/RevokeBandOraclePrivilegeProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string relayers = 3; +} + +message GrantPriceFeederPrivilegeProposal { + option (amino.name) = "oracle/GrantPriceFeederPrivilegeProposal"; + 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 base = 3; + string quote = 4; + repeated string relayers = 5; +} + +message GrantProviderPrivilegeProposal { + option (amino.name) = "oracle/GrantProviderPrivilegeProposal"; + 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 provider = 3; + repeated string relayers = 4; +} + +message RevokeProviderPrivilegeProposal { + option (amino.name) = "oracle/RevokeProviderPrivilegeProposal"; + 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 provider = 3; + repeated string relayers = 5; +} + +message RevokePriceFeederPrivilegeProposal { + option (amino.name) = "oracle/RevokePriceFeederPrivilegeProposal"; + 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 base = 3; + string quote = 4; + repeated string relayers = 5; +} + +message AuthorizeBandOracleRequestProposal { + option (amino.name) = "oracle/AuthorizeBandOracleRequestProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + BandOracleRequest request = 3 [ (gogoproto.nullable) = false ]; +} + +message UpdateBandOracleRequestProposal { + option (amino.name) = "oracle/UpdateBandOracleRequestProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated uint64 delete_request_ids = 3; + BandOracleRequest update_oracle_request = 4; +} + +message EnableBandIBCProposal { + option (amino.name) = "oracle/EnableBandIBCProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + BandIBCParams band_ibc_params = 3 [ (gogoproto.nullable) = false ]; +} + +message GrantStorkPublisherPrivilegeProposal { + option (amino.name) = "oracle/GrantStorkPublisherPrivilegeProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated string stork_publishers = 3; +} + +message RevokeStorkPublisherPrivilegeProposal { + option (amino.name) = "oracle/RevokeStorkPublisherPrivilegeProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + + repeated string stork_publishers = 3; +} diff --git a/protos/injectivejs/injective/oracle/v1beta1/query.proto b/protos/injectivejs/injective/oracle/v1beta1/query.proto new file mode 100644 index 00000000..f949c580 --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/query.proto @@ -0,0 +1,323 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "google/api/annotations.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "injective/oracle/v1beta1/genesis.proto"; +import "gogoproto/gogo.proto"; +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; + +// Query defines the gRPC querier service. +service Query { + + // Retrieves oracle params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/params"; + } + + // Retrieves the band relayers + rpc BandRelayers(QueryBandRelayersRequest) + returns (QueryBandRelayersResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/band_relayers"; + } + + // Retrieves the state for all band price feeds + rpc BandPriceStates(QueryBandPriceStatesRequest) + returns (QueryBandPriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/band_price_states"; + } + + // Retrieves the state for all band ibc price feeds + rpc BandIBCPriceStates(QueryBandIBCPriceStatesRequest) + returns (QueryBandIBCPriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/band_ibc_price_states"; + } + + // Retrieves the state for all price feeds + rpc PriceFeedPriceStates(QueryPriceFeedPriceStatesRequest) + returns (QueryPriceFeedPriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/pricefeed_price_states"; + } + + // Retrieves the state for all coinbase price feeds + rpc CoinbasePriceStates(QueryCoinbasePriceStatesRequest) + returns (QueryCoinbasePriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/coinbase_price_states"; + } + + // Retrieves the state for all pyth price feeds + rpc PythPriceStates(QueryPythPriceStatesRequest) + returns (QueryPythPriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/pyth_price_states"; + } + + // Retrieves the state for all stork price feeds + rpc StorkPriceStates(QueryStorkPriceStatesRequest) + returns (QueryStorkPriceStatesResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/stork_price_states"; + } + + // Retrieves all stork publishers + rpc StorkPublishers(QueryStorkPublishersRequest) + returns (QueryStorkPublishersResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/stork_publishers"; + } + + // Retrieves the state for all provider price feeds + rpc ProviderPriceState(QueryProviderPriceStateRequest) + returns (QueryProviderPriceStateResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/provider_price_state/{provider}/{symbol}"; + } + + // Retrieves the entire oracle module's state + rpc OracleModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/module_state"; + } + + // Retrieves historical price records for a given OracleType and Symbol + rpc HistoricalPriceRecords(QueryHistoricalPriceRecordsRequest) + returns (QueryHistoricalPriceRecordsResponse) { + option (google.api.http).get = + "/injective/oracle/v1beta1/historical_price_records"; + } + + // Retrieves mixed volatility value for the specified pair of base/quote + rpc OracleVolatility(QueryOracleVolatilityRequest) + returns (QueryOracleVolatilityResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/volatility"; + } + + rpc OracleProvidersInfo(QueryOracleProvidersInfoRequest) + returns (QueryOracleProvidersInfoResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/providers"; + } + + rpc OracleProviderPrices(QueryOracleProviderPricesRequest) + returns (QueryOracleProviderPricesResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/provider_prices"; + } + + rpc OraclePrice(QueryOraclePriceRequest) returns (QueryOraclePriceResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/price"; + } + + rpc PythPrice(QueryPythPriceRequest) returns (QueryPythPriceResponse) { + option (google.api.http).get = "/injective/oracle/v1beta1/pyth_price"; + } +} + +message QueryPythPriceRequest { string price_id = 1; } + +message QueryPythPriceResponse { PythPriceState price_state = 1; } + +// QueryOracleParamsRequest is the request type for the Query/OracleParams RPC +// method. +message QueryParamsRequest {} + +// QueryOracleParamsResponse is the response type for the Query/OracleParams RPC +// method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryBandRelayersRequest is the request type for the Query/BandRelayers RPC +// method. +message QueryBandRelayersRequest {} + +// QueryBandRelayersResponse is the response type for the Query/BandRelayers RPC +// method. +message QueryBandRelayersResponse { repeated string relayers = 1; } + +// QueryBandPriceStatesRequest is the request type for the Query/BandPriceStates +// RPC method. +message QueryBandPriceStatesRequest {} + +// QueryBandPriceStatesResponse is the response type for the +// Query/BandPriceStates RPC method. +message QueryBandPriceStatesResponse { + repeated BandPriceState price_states = 1; +} + +// QueryBandIBCPriceStatesRequest is the request type for the +// Query/BandIBCPriceStates RPC method. +message QueryBandIBCPriceStatesRequest {} + +// QueryBandIBCPriceStatesResponse is the response type for the +// Query/BandIBCPriceStates RPC method. +message QueryBandIBCPriceStatesResponse { + repeated BandPriceState price_states = 1; +} + +// QueryPriceFeedPriceStatesRequest is the request type for the +// Query/PriceFeedPriceStates RPC method. +message QueryPriceFeedPriceStatesRequest {} + +// QueryPriceFeedPriceStatesResponse is the response type for the +// Query/PriceFeedPriceStates RPC method. +message QueryPriceFeedPriceStatesResponse { + repeated PriceFeedState price_states = 1; +} + +// QueryCoinbasePriceStatesRequest is the request type for the +// Query/CoinbasePriceStates RPC method. +message QueryCoinbasePriceStatesRequest {} + +// QueryCoinbasePriceStatesResponse is the response type for the +// Query/CoinbasePriceStates RPC method. +message QueryCoinbasePriceStatesResponse { + repeated CoinbasePriceState price_states = 1; +} + +// QueryPythPriceStatesRequest is the request type for the +// Query/CoinbasePriceStates RPC method. +message QueryPythPriceStatesRequest {} + +// QueryPythPriceStatesResponse is the response type for the +// Query/CoinbasePriceStates RPC method. +message QueryPythPriceStatesResponse { + repeated PythPriceState price_states = 1; +} + +// QueryStorkPriceStatesRequest is the request type for the +// Query/StorkPriceStates RPC method. +message QueryStorkPriceStatesRequest {} + +// QueryStorkPriceStatesResponse is the response type for the +// Query/StorkPriceStates RPC method. +message QueryStorkPriceStatesResponse { + repeated StorkPriceState price_states = 1; +} + +// QueryStorkPublishersRequest is the request type for the +// Query/StorkPublishers RPC method. +message QueryStorkPublishersRequest {} + +// QueryStorkPublishersResponse is the response type for the +// Query/StorkPublishers RPC method. +message QueryStorkPublishersResponse { repeated string publishers = 1; } + +// QueryProviderPriceStateRequest is the request type for the +// Query/ProviderPriceState RPC method. +message QueryProviderPriceStateRequest { + string provider = 1; + string symbol = 2; +} + +// QueryProviderPriceStatesResponse is the response type for the +// Query/ProviderPriceStates RPC method. +message QueryProviderPriceStateResponse { PriceState price_state = 1; } + +// QueryModuleStateRequest is the request type for the Query/OracleModuleState +// RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the Query/OracleModuleState +// RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } + +message QueryHistoricalPriceRecordsRequest { + OracleType oracle = 1; + string symbol_id = 2; +} + +message QueryHistoricalPriceRecordsResponse { + repeated PriceRecords price_records = 1; +} + +message OracleHistoryOptions { + // MaxAge restricts the oracle price records oldest age in seconds from the + // current block time to consider. A value of 0 means use all the records + // present on the chain. + uint64 max_age = 1; + // If IncludeRawHistory is true, the raw underlying data used for the + // computation is included in the response + bool include_raw_history = 2; + // If IncludeMetadata is true, metadata on the computation is included in the + // response + bool include_metadata = 3; +} + +// QueryOracleVolatilityRequest is the request type for Query/OracleVolatility +// RPC method. +message QueryOracleVolatilityRequest { + OracleInfo base_info = 1; + OracleInfo quote_info = 2; + OracleHistoryOptions oracle_history_options = 3; +} + +// QueryOracleVolatilityResponse is the response type for Query/OracleVolatility +// RPC method. +message QueryOracleVolatilityResponse { + string volatility = 1 + [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; + MetadataStatistics history_metadata = 2; + repeated PriceRecord raw_history = 3; +} + +message QueryOracleProvidersInfoRequest {} + +message QueryOracleProvidersInfoResponse { + repeated ProviderInfo providers = 1; +} + +message QueryOracleProviderPricesRequest { string provider = 1; } + +message QueryOracleProviderPricesResponse { + repeated ProviderState providerState = 1; +} + +// ScalingOptions defines optional configuration to avoid precision loss. The +// oracle result will be returned as base_price * 10^base_decimals / quote_price +// * 10^quote_decimals +message ScalingOptions { + uint32 base_decimals = 1; + uint32 quote_decimals = 2; +} + +// QueryOraclePriceRequest is the request type for the Query/OraclePrice RPC +// method. +message QueryOraclePriceRequest { + OracleType oracle_type = 1; + string base = 2; + string quote = 3; + ScalingOptions scaling_options = 4 [ (gogoproto.nullable) = true ]; +} + +message PricePairState { + string pair_price = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string base_price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string quote_price = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string base_cumulative_price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string quote_cumulative_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + int64 base_timestamp = 6; + int64 quote_timestamp = 7; +} + +// QueryOraclePriceResponse is the response type for the Query/OraclePrice RPC +// method. +message QueryOraclePriceResponse { PricePairState price_pair_state = 1; } \ No newline at end of file diff --git a/protos/injectivejs/injective/oracle/v1beta1/tx.proto b/protos/injectivejs/injective/oracle/v1beta1/tx.proto new file mode 100644 index 00000000..bc48f5e6 --- /dev/null +++ b/protos/injectivejs/injective/oracle/v1beta1/tx.proto @@ -0,0 +1,175 @@ +syntax = "proto3"; +package injective.oracle.v1beta1; + +import "gogoproto/gogo.proto"; +import "injective/oracle/v1beta1/oracle.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/oracle/types"; + +// Msg defines the oracle Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // RelayProviderPrice defines a method for relaying a price for a + // provider-based oracle + rpc RelayProviderPrices(MsgRelayProviderPrices) + returns (MsgRelayProviderPricesResponse); + + // RelayPriceFeedPrice defines a method for relaying a price for a price + // feeder-based oracle + rpc RelayPriceFeedPrice(MsgRelayPriceFeedPrice) + returns (MsgRelayPriceFeedPriceResponse); + + // RelayBandRates defines a method for relaying rates from Band + rpc RelayBandRates(MsgRelayBandRates) returns (MsgRelayBandRatesResponse); + + // RequestBandIBCRates defines a method for fetching rates from Band ibc + rpc RequestBandIBCRates(MsgRequestBandIBCRates) + returns (MsgRequestBandIBCRatesResponse); + + // RelayCoinbaseMessages defines a method for relaying price messages from + // Coinbase API + rpc RelayCoinbaseMessages(MsgRelayCoinbaseMessages) + returns (MsgRelayCoinbaseMessagesResponse); + + // RelayStorkMessage defines a method for relaying price message from + // Stork API + rpc RelayStorkMessage(MsgRelayStorkPrices) + returns (MsgRelayStorkPricesResponse); + + // RelayPythPrices defines a method for relaying rates from the Pyth contract + rpc RelayPythPrices(MsgRelayPythPrices) returns (MsgRelayPythPricesResponse); + + // UpdateParams enables updating oracle module's params via governance + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgRelayProviderPrice defines a SDK message for setting a price through the +// provider oracle. +message MsgRelayProviderPrices { + option (amino.name) = "oracle/MsgRelayProviderPrices"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string provider = 2; + repeated string symbols = 3; + repeated string prices = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgRelayProviderPricesResponse {} + +// MsgRelayPriceFeedPrice defines a SDK message for setting a price through the +// pricefeed oracle. +message MsgRelayPriceFeedPrice { + option (amino.name) = "oracle/MsgRelayPriceFeedPrice"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + + repeated string base = 2; + repeated string quote = 3; + + // price defines the price of the oracle base and quote + repeated string price = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgRelayPriceFeedPriceResponse {} + +message MsgRelayBandRates { + option (amino.name) = "oracle/MsgRelayBandRates"; + option (cosmos.msg.v1.signer) = "relayer"; + + string relayer = 1; + repeated string symbols = 2; + repeated uint64 rates = 3; + repeated uint64 resolve_times = 4; + repeated uint64 requestIDs = 5; +} + +message MsgRelayBandRatesResponse {} + +// MsgRelayCoinbaseMessages defines a SDK message for relaying price messages +// from Coinbase API. +message MsgRelayCoinbaseMessages { + option (amino.name) = "oracle/MsgRelayCoinbaseMessages"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + + repeated bytes messages = 2; + repeated bytes signatures = 3; +} + +message MsgRelayCoinbaseMessagesResponse {} + +// MsgRelayStorkPrices defines a SDK message for relaying price message +// from Stork API. +message MsgRelayStorkPrices { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated AssetPair asset_pairs = 2; +} + +message MsgRelayStorkPricesResponse {} + +// MsgRequestBandIBCRates defines a SDK message for requesting data from +// BandChain using IBC. +message MsgRequestBandIBCRates { + option (amino.name) = "oracle/MsgRequestBandIBCRates"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + uint64 request_id = 2; +} + +// MsgRequestDataResponse defines the Msg/RequestBandIBCRates response type. +message MsgRequestBandIBCRatesResponse {} + +// MsgRelayPythPrices defines a SDK message for updating Pyth prices +message MsgRelayPythPrices { + option (amino.name) = "oracle/MsgRelayPythPrices"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + repeated PriceAttestation price_attestations = 2; +} + +// MsgRelayPythPricesResponse defines the Msg/RelayPythPrices response type. +message MsgRelayPythPricesResponse {} + +message MsgUpdateParams { + option (amino.name) = "oracle/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 oracle parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/protos/injectivejs/injective/peggy/v1/attestation.proto b/protos/injectivejs/injective/peggy/v1/attestation.proto new file mode 100644 index 00000000..fa6301dc --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/attestation.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package injective.peggy.v1; + +// TODO-JT: add ERC20DeployedEvent claim + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// ClaimType is the cosmos type of an event from the counterpart chain that can +// be handled +enum ClaimType { + option (gogoproto.goproto_enum_prefix) = false; + + CLAIM_TYPE_UNKNOWN = 0 + [ (gogoproto.enumvalue_customname) = "CLAIM_TYPE_UNKNOWN" ]; + CLAIM_TYPE_DEPOSIT = 1 + [ (gogoproto.enumvalue_customname) = "CLAIM_TYPE_DEPOSIT" ]; + CLAIM_TYPE_WITHDRAW = 2 + [ (gogoproto.enumvalue_customname) = "CLAIM_TYPE_WITHDRAW" ]; + CLAIM_TYPE_ERC20_DEPLOYED = 3 + [ (gogoproto.enumvalue_customname) = "CLAIM_TYPE_ERC20_DEPLOYED" ]; + CLAIM_TYPE_VALSET_UPDATED = 4 + [ (gogoproto.enumvalue_customname) = "CLAIM_TYPE_VALSET_UPDATED" ]; +} + +// Attestation is an aggregate of `claims` that eventually becomes `observed` by +// all orchestrators +// EVENT_NONCE: +// EventNonce a nonce provided by the peggy contract that is unique per event +// fired These event nonces must be relayed in order. This is a correctness +// issue, if relaying out of order transaction replay attacks become possible +// OBSERVED: +// Observed indicates that >67% of validators have attested to the event, +// and that the event should be executed by the peggy state machine +// +// The actual content of the claims is passed in with the transaction making the +// claim and then passed through the call stack alongside the attestation while +// it is processed the key in which the attestation is stored is keyed on the +// exact details of the claim but there is no reason to store those exact +// details becuause the next message sender will kindly provide you with them. +message Attestation { + bool observed = 1; + repeated string votes = 2; + uint64 height = 3; + google.protobuf.Any claim = 4; +} + +// ERC20Token unique identifier for an Ethereum ERC20 token. +// CONTRACT: +// The contract address on ETH of the token, this could be a Cosmos +// originated token, if so it will be the ERC20 address of the representation +// (note: developers should look up the token symbol using the address on ETH to +// display for UI) +message ERC20Token { + string contract = 1; + string amount = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/protos/injectivejs/injective/peggy/v1/batch.proto b/protos/injectivejs/injective/peggy/v1/batch.proto new file mode 100644 index 00000000..c0d8afee --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/batch.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "injective/peggy/v1/attestation.proto"; +// import "injective/peggy/v1/types.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// OutgoingTxBatch represents a batch of transactions going from Peggy to ETH +message OutgoingTxBatch { + uint64 batch_nonce = 1; + uint64 batch_timeout = 2; + repeated OutgoingTransferTx transactions = 3; + string token_contract = 4; + uint64 block = 5; +} + +// OutgoingTransferTx represents an individual send from Peggy to ETH +message OutgoingTransferTx { + uint64 id = 1; + string sender = 2; + string dest_address = 3; + ERC20Token erc20_token = 4; + ERC20Token erc20_fee = 5; +} diff --git a/protos/injectivejs/injective/peggy/v1/ethereum_signer.proto b/protos/injectivejs/injective/peggy/v1/ethereum_signer.proto new file mode 100644 index 00000000..6b3f6ea7 --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/ethereum_signer.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package injective.peggy.v1; +import "gogoproto/gogo.proto"; +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// SignType defines messages that have been signed by an orchestrator +enum SignType { + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.goproto_enum_stringer) = false; + + SIGN_TYPE_UNKNOWN = 0; + SIGN_TYPE_ORCHESTRATOR_SIGNED_MULTI_SIG_UPDATE = 1; + SIGN_TYPE_ORCHESTRATOR_SIGNED_WITHDRAW_BATCH = 2; +} diff --git a/protos/injectivejs/injective/peggy/v1/events.proto b/protos/injectivejs/injective/peggy/v1/events.proto new file mode 100644 index 00000000..8a5f866d --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/events.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "gogoproto/gogo.proto"; +import "injective/peggy/v1/attestation.proto"; +import "injective/peggy/v1/types.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +message EventAttestationObserved { + ClaimType attestation_type = 1; + string bridge_contract = 2; + uint64 bridge_chain_id = 3; + bytes attestation_id = 4; + uint64 nonce = 5; +} + +message EventBridgeWithdrawCanceled { + string bridge_contract = 1; + uint64 bridge_chain_id = 2; +} + +message EventOutgoingBatch { + string denom = 1; + string orchestrator_address = 2; + uint64 batch_nonce = 3; + uint64 batch_timeout = 4; + repeated uint64 batch_tx_ids = 5; +} + +message EventOutgoingBatchCanceled { + string bridge_contract = 1; + uint64 bridge_chain_id = 2; + uint64 batch_id = 3; + uint64 nonce = 4; +} + +message EventValsetUpdateRequest { + uint64 valset_nonce = 1; + uint64 valset_height = 2; + repeated BridgeValidator valset_members = 3; + string reward_amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string reward_token = 5; +} +message EventSetOrchestratorAddresses { + string validator_address = 1; + string orchestrator_address = 2; + string operator_eth_address = 3; +} + +message EventValsetConfirm { + uint64 valset_nonce = 1; + string orchestrator_address = 2; +} + +message EventSendToEth { + uint64 outgoing_tx_id = 1; + string sender = 2; + string receiver = 3; + string amount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; + + string bridge_fee = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} + +message EventConfirmBatch { + uint64 batch_nonce = 1; + string orchestrator_address = 2; +} + +message EventAttestationVote { + uint64 event_nonce = 1; + bytes attestation_id = 2; + string voter = 3; +} + +message EventDepositClaim { + uint64 event_nonce = 1; + uint64 event_height = 2; + bytes attestation_id = 3; + string ethereum_sender = 4; + string cosmos_receiver = 5; + string token_contract = 6; + string amount = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string orchestrator_address = 8; + string data = 9; +} + +message EventWithdrawClaim { + uint64 event_nonce = 1; + uint64 event_height = 2; + bytes attestation_id = 3; + uint64 batch_nonce = 4; + string token_contract = 5; + string orchestrator_address = 6; +} + +message EventERC20DeployedClaim { + uint64 event_nonce = 1; + uint64 event_height = 2; + bytes attestation_id = 3; + string cosmos_denom = 4; + string token_contract = 5; + string name = 6; + string symbol = 7; + uint64 decimals = 8; + string orchestrator_address = 9; +} + +message EventValsetUpdateClaim { + uint64 event_nonce = 1; + uint64 event_height = 2; + bytes attestation_id = 3; + uint64 valset_nonce = 4; + repeated BridgeValidator valset_members = 5; + string reward_amount = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string reward_token = 7; + string orchestrator_address = 8; +} + +message EventCancelSendToEth { uint64 outgoing_tx_id = 1; } + +message EventSubmitBadSignatureEvidence { + string bad_eth_signature = 1; + string bad_eth_signature_subject = 2; +} + +message EventValidatorSlash { + int64 power = 1; + string reason = 2; + string consensus_address = 3; + string operator_address = 4; + string moniker = 5; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/peggy/v1/genesis.proto b/protos/injectivejs/injective/peggy/v1/genesis.proto new file mode 100644 index 00000000..78febe09 --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "gogoproto/gogo.proto"; +import "injective/peggy/v1/types.proto"; +import "injective/peggy/v1/msgs.proto"; +import "injective/peggy/v1/batch.proto"; +import "injective/peggy/v1/attestation.proto"; +import "injective/peggy/v1/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// GenesisState struct +message GenesisState { + Params params = 1; + uint64 last_observed_nonce = 2; + repeated Valset valsets = 3; + repeated MsgValsetConfirm valset_confirms = 4; + repeated OutgoingTxBatch batches = 5; + repeated MsgConfirmBatch batch_confirms = 6; + repeated Attestation attestations = 7; + repeated MsgSetOrchestratorAddresses orchestrator_addresses = 8; + repeated ERC20ToDenom erc20_to_denoms = 9; + repeated OutgoingTransferTx unbatched_transfers = 10; + uint64 last_observed_ethereum_height = 11; + uint64 last_outgoing_batch_id = 12; + uint64 last_outgoing_pool_id = 13; + Valset last_observed_valset = 14 [ (gogoproto.nullable) = false ]; + repeated string ethereum_blacklist = 15; +} diff --git a/protos/injectivejs/injective/peggy/v1/msgs.proto b/protos/injectivejs/injective/peggy/v1/msgs.proto new file mode 100644 index 00000000..2858a1f7 --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/msgs.proto @@ -0,0 +1,336 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "injective/peggy/v1/types.proto"; +import "injective/peggy/v1/params.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc ValsetConfirm(MsgValsetConfirm) returns (MsgValsetConfirmResponse) { + option (google.api.http).post = "/injective/peggy/v1/valset_confirm"; + } + rpc SendToEth(MsgSendToEth) returns (MsgSendToEthResponse) { + option (google.api.http).post = "/injective/peggy/v1/send_to_eth"; + } + rpc RequestBatch(MsgRequestBatch) returns (MsgRequestBatchResponse) { + option (google.api.http).post = "/injective/peggy/v1/request_batch"; + } + rpc ConfirmBatch(MsgConfirmBatch) returns (MsgConfirmBatchResponse) { + option (google.api.http).post = "/injective/peggy/v1/confirm_batch"; + } + rpc DepositClaim(MsgDepositClaim) returns (MsgDepositClaimResponse) { + option (google.api.http).post = "/injective/peggy/v1/deposit_claim"; + } + rpc WithdrawClaim(MsgWithdrawClaim) returns (MsgWithdrawClaimResponse) { + option (google.api.http).post = "/injective/peggy/v1/withdraw_claim"; + } + rpc ValsetUpdateClaim(MsgValsetUpdatedClaim) + returns (MsgValsetUpdatedClaimResponse) { + option (google.api.http).post = "/injective/peggy/v1/valset_updated_claim"; + } + rpc ERC20DeployedClaim(MsgERC20DeployedClaim) + returns (MsgERC20DeployedClaimResponse) { + option (google.api.http).post = "/injective/peggy/v1/erc20_deployed_claim"; + } + rpc SetOrchestratorAddresses(MsgSetOrchestratorAddresses) + returns (MsgSetOrchestratorAddressesResponse) { + option (google.api.http).post = + "/injective/peggy/v1/set_orchestrator_address"; + } + rpc CancelSendToEth(MsgCancelSendToEth) returns (MsgCancelSendToEthResponse) { + option (google.api.http).post = "/injective/peggy/v1/cancel_send_to_eth"; + } + rpc SubmitBadSignatureEvidence(MsgSubmitBadSignatureEvidence) + returns (MsgSubmitBadSignatureEvidenceResponse) { + option (google.api.http).post = + "/injective/peggy/v1/submit_bad_signature_evidence"; + } + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // BlacklistEthereumAddresses adds Ethereum addresses to the peggy blacklist. + rpc BlacklistEthereumAddresses(MsgBlacklistEthereumAddresses) + returns (MsgBlacklistEthereumAddressesResponse); + + // RevokeEthereumBlacklist removes Ethereum addresses from the peggy + // blacklist. + rpc RevokeEthereumBlacklist(MsgRevokeEthereumBlacklist) + returns (MsgRevokeEthereumBlacklistResponse); +} + +// MsgSetOrchestratorAddresses +// this message allows validators to delegate their voting responsibilities +// to a given key. This key is then used as an optional authentication method +// for sigining oracle claims +// VALIDATOR +// The validator field is a cosmosvaloper1... string (i.e. sdk.ValAddress) +// that references a validator in the active set +// ORCHESTRATOR +// The orchestrator field is a cosmos1... string (i.e. sdk.AccAddress) that +// references the key that is being delegated to +// ETH_ADDRESS +// This is a hex encoded 0x Ethereum public key that will be used by this +// validator on Ethereum +message MsgSetOrchestratorAddresses { + option (amino.name) = "peggy/MsgSetOrchestratorAddresses"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string orchestrator = 2; + string eth_address = 3; +} + +message MsgSetOrchestratorAddressesResponse {} + +// MsgValsetConfirm +// this is the message sent by the validators when they wish to submit their +// signatures over the validator set at a given block height. A validator must +// first call MsgSetEthAddress to set their Ethereum address to be used for +// signing. Then someone (anyone) must make a ValsetRequest the request is +// essentially a messaging mechanism to determine which block all validators +// should submit signatures over. Finally validators sign the validator set, +// powers, and Ethereum addresses of the entire validator set at the height of a +// ValsetRequest and submit that signature with this message. +// +// If a sufficient number of validators (66% of voting power) (A) have set +// Ethereum addresses and (B) submit ValsetConfirm messages with their +// signatures it is then possible for anyone to view these signatures in the +// chain store and submit them to Ethereum to update the validator set +// ------------- +message MsgValsetConfirm { + option (amino.name) = "peggy/MsgValsetConfirm"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 nonce = 1; + string orchestrator = 2; + string eth_address = 3; + string signature = 4; +} + +message MsgValsetConfirmResponse {} + +// MsgSendToEth +// This is the message that a user calls when they want to bridge an asset +// it will later be removed when it is included in a batch and successfully +// submitted tokens are removed from the users balance immediately +// ------------- +// AMOUNT: +// the coin to send across the bridge, note the restriction that this is a +// single coin not a set of coins that is normal in other Cosmos messages +// FEE: +// the fee paid for the bridge, distinct from the fee paid to the chain to +// actually send this message in the first place. So a successful send has +// two layers of fees for the user +message MsgSendToEth { + option (amino.name) = "peggy/MsgSendToEth"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string eth_dest = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin bridge_fee = 4 [ (gogoproto.nullable) = false ]; +} + +message MsgSendToEthResponse {} + +// MsgRequestBatch +// this is a message anyone can send that requests a batch of transactions to +// send across the bridge be created for whatever block height this message is +// included in. This acts as a coordination point, the handler for this message +// looks at the AddToOutgoingPool tx's in the store and generates a batch, also +// available in the store tied to this message. The validators then grab this +// batch, sign it, submit the signatures with a MsgConfirmBatch before a relayer +// can finally submit the batch +// ------------- +message MsgRequestBatch { + option (amino.name) = "peggy/MsgRequestBatch"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + string orchestrator = 1; + string denom = 2; +} + +message MsgRequestBatchResponse {} + +// MsgConfirmBatch +// When validators observe a MsgRequestBatch they form a batch by ordering +// transactions currently in the txqueue in order of highest to lowest fee, +// cutting off when the batch either reaches a hardcoded maximum size (to be +// decided, probably around 100) or when transactions stop being profitable +// (TODO determine this without nondeterminism) This message includes the batch +// as well as an Ethereum signature over this batch by the validator +// ------------- +message MsgConfirmBatch { + option (amino.name) = "peggy/MsgConfirmBatch"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 nonce = 1; + string token_contract = 2; + string eth_signer = 3; + string orchestrator = 4; + string signature = 5; +} + +message MsgConfirmBatchResponse {} + +// EthereumBridgeDepositClaim +// When more than 66% of the active validator set has +// claimed to have seen the deposit enter the ethereum blockchain coins are +// issued to the Cosmos address in question +// ------------- +message MsgDepositClaim { + option (amino.name) = "peggy/MsgDepositClaim"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 event_nonce = 1; + uint64 block_height = 2; + string token_contract = 3; + string amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string ethereum_sender = 5; + string cosmos_receiver = 6; + string orchestrator = 7; + string data = 8; +} + +message MsgDepositClaimResponse {} + +// WithdrawClaim claims that a batch of withdrawal +// operations on the bridge contract was executed. +message MsgWithdrawClaim { + option (amino.name) = "peggy/MsgWithdrawClaim"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 event_nonce = 1; + uint64 block_height = 2; + uint64 batch_nonce = 3; + string token_contract = 4; + string orchestrator = 5; +} + +message MsgWithdrawClaimResponse {} + +// ERC20DeployedClaim allows the Cosmos module +// to learn about an ERC20 that someone deployed +// to represent a Cosmos asset +message MsgERC20DeployedClaim { + option (amino.name) = "peggy/MsgERC20DeployedClaim"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 event_nonce = 1; + uint64 block_height = 2; + string cosmos_denom = 3; + string token_contract = 4; + string name = 5; + string symbol = 6; + uint64 decimals = 7; + string orchestrator = 8; +} + +message MsgERC20DeployedClaimResponse {} + +// This call allows the sender (and only the sender) +// to cancel a given MsgSendToEth and recieve a refund +// of the tokens +message MsgCancelSendToEth { + option (amino.name) = "peggy/MsgCancelSendToEth"; + option (cosmos.msg.v1.signer) = "sender"; + + uint64 transaction_id = 1; + string sender = 2; +} + +message MsgCancelSendToEthResponse {} + +// This call allows anyone to submit evidence that a +// validator has signed a valset, batch, or logic call that never +// existed. Subject contains the batch, valset, or logic call. +message MsgSubmitBadSignatureEvidence { + option (amino.name) = "peggy/MsgSubmitBadSignatureEvidence"; + option (cosmos.msg.v1.signer) = "sender"; + + google.protobuf.Any subject = 1; + string signature = 2; + string sender = 3; +} + +message MsgSubmitBadSignatureEvidenceResponse {} + +// This informs the Cosmos module that a validator +// set has been updated. +message MsgValsetUpdatedClaim { + option (amino.name) = "peggy/MsgValsetUpdatedClaim"; + option (cosmos.msg.v1.signer) = "orchestrator"; + + uint64 event_nonce = 1; + uint64 valset_nonce = 2; + uint64 block_height = 3; + repeated BridgeValidator members = 4; + string reward_amount = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string reward_token = 6; + string orchestrator = 7; +} + +message MsgValsetUpdatedClaimResponse {} + +message MsgUpdateParams { + option (amino.name) = "peggy/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 peggy parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} + +// MsgBlacklistEthereumAddresses defines the message used to add Ethereum +// addresses to peggy blacklist. +message MsgBlacklistEthereumAddresses { + option (amino.name) = "peggy/MsgBlacklistEthereumAddresses"; + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // Ethereum addresses to include in the blacklist + repeated string blacklist_addresses = 2; +} + +// MsgBlacklistEthereumAddressesResponse defines the +// MsgBlacklistEthereumAddresses response type. +message MsgBlacklistEthereumAddressesResponse {} + +// MsgRevokeEthereumBlacklist defines the message used to remove Ethereum +// addresses from peggy blacklist. +message MsgRevokeEthereumBlacklist { + option (amino.name) = "peggy/MsgRevokeEthereumBlacklist"; + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // Ethereum addresses to include in the blacklist + repeated string blacklist_addresses = 2; +} + +// MsgRevokeEthereumBlacklistResponse defines the MsgRevokeEthereumBlacklist +// response type. +message MsgRevokeEthereumBlacklistResponse {} diff --git a/protos/injectivejs/injective/peggy/v1/params.proto b/protos/injectivejs/injective/peggy/v1/params.proto new file mode 100644 index 00000000..43c4b3a8 --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/params.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// Params represent the peggy genesis and store parameters +// peggy_id: +// a random 32 byte value to prevent signature reuse, for example if the +// cosmos validators decided to use the same Ethereum keys for another chain +// also running Peggy we would not want it to be possible to play a deposit +// from chain A back on chain B's peggy. This value IS USED ON ETHEREUM so +// it must be set in your genesis.json before launch and not changed after +// deploying Peggy +// +// contract_hash: +// the code hash of a known good version of the Peggy contract +// solidity code. This can be used to verify the correct version +// of the contract has been deployed. This is a reference value for +// goernance action only it is never read by any Peggy code +// +// bridge_ethereum_address: +// is address of the bridge contract on the Ethereum side, this is a +// reference value for governance only and is not actually used by any +// Peggy code +// +// bridge_chain_id: +// the unique identifier of the Ethereum chain, this is a reference value +// only and is not actually used by any Peggy code +// +// These reference values may be used by future Peggy client implemetnations +// to allow for saftey features or convenience features like the peggy address +// in your relayer. A relayer would require a configured peggy address if +// governance had not set the address on the chain it was relaying for. +// +// signed_valsets_window +// signed_batches_window +// signed_claims_window +// +// These values represent the time in blocks that a validator has to submit +// a signature for a batch or valset, or to submit a claim for a particular +// attestation nonce. In the case of attestations this clock starts when the +// attestation is created, but only allows for slashing once the event has +// passed +// +// target_batch_timeout: +// +// This is the 'target' value for when batches time out, this is a target +// becuase Ethereum is a probabalistic chain and you can't say for sure what the +// block frequency is ahead of time. +// +// average_block_time +// average_ethereum_block_time +// +// These values are the average Cosmos block time and Ethereum block time +// repsectively and they are used to copute what the target batch timeout is. It +// is important that governance updates these in case of any major, prolonged +// change in the time it takes to produce a block +// +// slash_fraction_valset +// slash_fraction_batch +// slash_fraction_claim +// slash_fraction_conflicting_claim +// +// The slashing fractions for the various peggy related slashing conditions. The +// first three refer to not submitting a particular message, the third for +// submitting a different claim for the same Ethereum event +// +// unbond_slashing_valsets_window +// +// The unbond slashing valsets window is used to determine how many blocks after +// starting to unbond a validator needs to continue signing blocks. The goal of +// this paramater is that when a validator leaves the set, if their leaving +// creates enough change in the validator set to justify an update they will +// sign a validator set update for the Ethereum bridge that does not include +// themselves. Allowing us to remove them from the Ethereum bridge and replace +// them with the new set gracefully. +// +// valset_reward +// +// Valset rewards are the amount of tokens this chain issues to relayers of +// validator sets. These can be any ERC20 token in the bridge, but it's strongly +// advised that chains use only Cosmos originated tokens, which the bridge +// effectively mints on Ethereum. If you run out of the token you are using for +// validator set rewards valset updates will fail and the bridge will be +// vulnerable to highjacking. For these paramaters the zero values are special +// and indicate not to attempt any reward. This is the default for +// bootstrapping. + +message Params { + option (amino.name) = "peggy/Params"; + option (gogoproto.stringer) = false; + + string peggy_id = 1; + string contract_source_hash = 2; + string bridge_ethereum_address = 3; + uint64 bridge_chain_id = 4; + uint64 signed_valsets_window = 5; + uint64 signed_batches_window = 6; + uint64 signed_claims_window = 7; + uint64 target_batch_timeout = 8; + uint64 average_block_time = 9; + uint64 average_ethereum_block_time = 10; + bytes slash_fraction_valset = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_batch = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_claim = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_conflicting_claim = 14 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + uint64 unbond_slashing_valsets_window = 15; + bytes slash_fraction_bad_eth_signature = 16 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string cosmos_coin_denom = 17; + string cosmos_coin_erc20_contract = 18; + bool claim_slashing_enabled = 19; + uint64 bridge_contract_start_height = 20; + + cosmos.base.v1beta1.Coin valset_reward = 21 [ (gogoproto.nullable) = false ]; + + repeated string admins = 22; +} diff --git a/protos/injectivejs/injective/peggy/v1/pool.proto b/protos/injectivejs/injective/peggy/v1/pool.proto new file mode 100644 index 00000000..b4152a3f --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/pool.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// IDSet represents a set of IDs +message IDSet { repeated uint64 ids = 1; } + +message BatchFees { + string token = 1; + string total_fees = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/peggy/v1/proposal.proto b/protos/injectivejs/injective/peggy/v1/proposal.proto new file mode 100644 index 00000000..f6eed0f1 --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/proposal.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +message BlacklistEthereumAddressesProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string blacklist_addresses = 3; +} + +message RevokeEthereumBlacklistProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string blacklist_addresses = 3; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/peggy/v1/query.proto b/protos/injectivejs/injective/peggy/v1/query.proto new file mode 100644 index 00000000..08ac210d --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/query.proto @@ -0,0 +1,218 @@ +syntax = "proto3"; +package injective.peggy.v1; + +import "injective/peggy/v1/genesis.proto"; +import "injective/peggy/v1/params.proto"; +import "injective/peggy/v1/types.proto"; +import "injective/peggy/v1/msgs.proto"; +import "injective/peggy/v1/pool.proto"; +import "injective/peggy/v1/batch.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// Query defines the gRPC querier service +service Query { + // Deployments queries deployments + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/peggy/v1/params"; + } + + // valset + rpc CurrentValset(QueryCurrentValsetRequest) + returns (QueryCurrentValsetResponse) { + option (google.api.http).get = "/peggy/v1/valset/current"; + } + rpc ValsetRequest(QueryValsetRequestRequest) + returns (QueryValsetRequestResponse) { + option (google.api.http).get = "/peggy/v1/valset"; + } + rpc ValsetConfirm(QueryValsetConfirmRequest) + returns (QueryValsetConfirmResponse) { + option (google.api.http).get = "/peggy/v1/valset/confirm"; + } + rpc ValsetConfirmsByNonce(QueryValsetConfirmsByNonceRequest) + returns (QueryValsetConfirmsByNonceResponse) { + option (google.api.http).get = "/peggy/v1/confirms/{nonce}"; + } + rpc LastValsetRequests(QueryLastValsetRequestsRequest) + returns (QueryLastValsetRequestsResponse) { + option (google.api.http).get = "/peggy/v1/valset/requests"; + } + rpc LastPendingValsetRequestByAddr(QueryLastPendingValsetRequestByAddrRequest) + returns (QueryLastPendingValsetRequestByAddrResponse) { + option (google.api.http).get = "/peggy/v1/valset/last"; + } + + // claim + rpc LastEventByAddr(QueryLastEventByAddrRequest) + returns (QueryLastEventByAddrResponse) { + option (google.api.http).get = "/peggy/v1/oracle/event/{address}"; + } + + // batch + rpc GetPendingSendToEth(QueryPendingSendToEth) + returns (QueryPendingSendToEthResponse) { + option (google.api.http).get = "/peggy/v1/pending_send_to_eth"; + } + rpc BatchFees(QueryBatchFeeRequest) returns (QueryBatchFeeResponse) { + option (google.api.http).get = "/peggy/v1/batchfees"; + } + rpc OutgoingTxBatches(QueryOutgoingTxBatchesRequest) + returns (QueryOutgoingTxBatchesResponse) { + option (google.api.http).get = "/peggy/v1/batch/outgoingtx"; + } + rpc LastPendingBatchRequestByAddr(QueryLastPendingBatchRequestByAddrRequest) + returns (QueryLastPendingBatchRequestByAddrResponse) { + option (google.api.http).get = "/peggy/v1/batch/last"; + } + rpc BatchRequestByNonce(QueryBatchRequestByNonceRequest) + returns (QueryBatchRequestByNonceResponse) { + option (google.api.http).get = "/peggy/v1/batch"; + } + rpc BatchConfirms(QueryBatchConfirmsRequest) + returns (QueryBatchConfirmsResponse) { + option (google.api.http).get = "/peggy/v1/batch/confirms"; + } + + rpc ERC20ToDenom(QueryERC20ToDenomRequest) + returns (QueryERC20ToDenomResponse) { + option (google.api.http).get = "/peggy/v1/cosmos_originated/erc20_to_denom"; + } + rpc DenomToERC20(QueryDenomToERC20Request) + returns (QueryDenomToERC20Response) { + option (google.api.http).get = "/peggy/v1/cosmos_originated/denom_to_erc20"; + } + + rpc GetDelegateKeyByValidator(QueryDelegateKeysByValidatorAddress) + returns (QueryDelegateKeysByValidatorAddressResponse) { + option (google.api.http).get = "/peggy/v1/query_delegate_keys_by_validator"; + } + rpc GetDelegateKeyByEth(QueryDelegateKeysByEthAddress) + returns (QueryDelegateKeysByEthAddressResponse) { + option (google.api.http).get = "/peggy/v1/query_delegate_keys_by_eth"; + } + rpc GetDelegateKeyByOrchestrator(QueryDelegateKeysByOrchestratorAddress) + returns (QueryDelegateKeysByOrchestratorAddressResponse) { + option (google.api.http).get = + "/peggy/v1/query_delegate_keys_by_orchestrator"; + } + + // Retrieves the entire peggy module's state + rpc PeggyModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/peggy/v1/module_state"; + } + + rpc MissingPeggoNonces(MissingNoncesRequest) returns (MissingNoncesResponse) { + option (google.api.http).get = "/peggy/v1/missing_nonces"; + } +} + +message QueryParamsRequest {} +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryCurrentValsetRequest {} +message QueryCurrentValsetResponse { Valset valset = 1; } + +message QueryValsetRequestRequest { uint64 nonce = 1; } +message QueryValsetRequestResponse { Valset valset = 1; } + +message QueryValsetConfirmRequest { + uint64 nonce = 1; + string address = 2; +} +message QueryValsetConfirmResponse { MsgValsetConfirm confirm = 1; } + +message QueryValsetConfirmsByNonceRequest { uint64 nonce = 1; } +message QueryValsetConfirmsByNonceResponse { + repeated MsgValsetConfirm confirms = 1; +} + +message QueryLastValsetRequestsRequest {} +message QueryLastValsetRequestsResponse { repeated Valset valsets = 1; } + +message QueryLastPendingValsetRequestByAddrRequest { string address = 1; } +message QueryLastPendingValsetRequestByAddrResponse { + repeated Valset valsets = 1; +} + +message QueryBatchFeeRequest {} +message QueryBatchFeeResponse { repeated BatchFees batchFees = 1; } + +message QueryLastPendingBatchRequestByAddrRequest { string address = 1; } +message QueryLastPendingBatchRequestByAddrResponse { + OutgoingTxBatch batch = 1; +} + +message QueryOutgoingTxBatchesRequest {} +message QueryOutgoingTxBatchesResponse { repeated OutgoingTxBatch batches = 1; } + +message QueryBatchRequestByNonceRequest { + uint64 nonce = 1; + string contract_address = 2; +} +message QueryBatchRequestByNonceResponse { OutgoingTxBatch batch = 1; } + +message QueryBatchConfirmsRequest { + uint64 nonce = 1; + string contract_address = 2; +} +message QueryBatchConfirmsResponse { repeated MsgConfirmBatch confirms = 1; } + +message QueryLastEventByAddrRequest { string address = 1; } +message QueryLastEventByAddrResponse { LastClaimEvent last_claim_event = 1; } + +message QueryERC20ToDenomRequest { string erc20 = 1; } +message QueryERC20ToDenomResponse { + string denom = 1; + bool cosmos_originated = 2; +} + +message QueryDenomToERC20Request { string denom = 1; } +message QueryDenomToERC20Response { + string erc20 = 1; + bool cosmos_originated = 2; +} + +message QueryDelegateKeysByValidatorAddress { string validator_address = 1; } +message QueryDelegateKeysByValidatorAddressResponse { + string eth_address = 1; + string orchestrator_address = 2; +} + +message QueryDelegateKeysByEthAddress { string eth_address = 1; } +message QueryDelegateKeysByEthAddressResponse { + string validator_address = 1; + string orchestrator_address = 2; +} + +message QueryDelegateKeysByOrchestratorAddress { + string orchestrator_address = 1; +} +message QueryDelegateKeysByOrchestratorAddressResponse { + string validator_address = 1; + string eth_address = 2; +} + +message QueryPendingSendToEth { string sender_address = 1; } + +message QueryPendingSendToEthResponse { + repeated OutgoingTransferTx transfers_in_batches = 1; + repeated OutgoingTransferTx unbatched_transfers = 2; +} + +// QueryModuleStateRequest is the request type for the Query/PeggyModuleState +// RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the Query/PeggyModuleState +// RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } + +message MissingNoncesRequest {} + +message MissingNoncesResponse { repeated string operator_addresses = 1; } \ No newline at end of file diff --git a/protos/injectivejs/injective/peggy/v1/types.proto b/protos/injectivejs/injective/peggy/v1/types.proto new file mode 100644 index 00000000..5ba5964e --- /dev/null +++ b/protos/injectivejs/injective/peggy/v1/types.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package injective.peggy.v1; +import "gogoproto/gogo.proto"; +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/peggy/types"; + +// BridgeValidator represents a validator's ETH address and its power +message BridgeValidator { + uint64 power = 1; + string ethereum_address = 2; +} + +// Valset is the Ethereum Bridge Multsig Set, each peggy validator also +// maintains an ETH key to sign messages, these are used to check signatures on +// ETH because of the significant gas savings +message Valset { + uint64 nonce = 1; + repeated BridgeValidator members = 2; + uint64 height = 3; + string reward_amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // the reward token in it's Ethereum hex address representation + string reward_token = 5; +} + +// LastObservedEthereumBlockHeight stores the last observed +// Ethereum block height along with the Cosmos block height that +// it was observed at. These two numbers can be used to project +// outward and always produce batches with timeouts in the future +// even if no Ethereum block height has been relayed for a long time +message LastObservedEthereumBlockHeight { + uint64 cosmos_block_height = 1; + uint64 ethereum_block_height = 2; +} + +// LastClaimEvent stores last claim event details of validator. +message LastClaimEvent { + uint64 ethereum_event_nonce = 1; + uint64 ethereum_event_height = 2; +} + +// This records the relationship between an ERC20 token and the denom +// of the corresponding Cosmos originated asset +message ERC20ToDenom { + string erc20 = 1; + string denom = 2; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/permissions/v1beta1/events.proto b/protos/injectivejs/injective/permissions/v1beta1/events.proto new file mode 100644 index 00000000..7bec7e4d --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/events.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package injective.permissions.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +message EventSetVoucher { + string addr = 1; + cosmos.base.v1beta1.Coin voucher = 2 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/permissions/v1beta1/genesis.proto b/protos/injectivejs/injective/permissions/v1beta1/genesis.proto new file mode 100644 index 00000000..7890fc27 --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package injective.permissions.v1beta1; + +import "gogoproto/gogo.proto"; +import "injective/permissions/v1beta1/params.proto"; +import "injective/permissions/v1beta1/permissions.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +// GenesisState defines the permissions module's genesis state. +message GenesisState { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated Namespace namespaces = 2 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/permissions/v1beta1/params.proto b/protos/injectivejs/injective/permissions/v1beta1/params.proto new file mode 100644 index 00000000..5b731fd6 --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/params.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package injective.permissions.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/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +// Params defines the parameters for the permissions module. +message Params { + option (gogoproto.equal) = true; + option (amino.name) = "permissions/Params"; + + uint64 wasm_hook_query_max_gas = 1; +} diff --git a/protos/injectivejs/injective/permissions/v1beta1/permissions.proto b/protos/injectivejs/injective/permissions/v1beta1/permissions.proto new file mode 100644 index 00000000..0abb5c5c --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/permissions.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package injective.permissions.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +// Namespace defines a permissions namespace +message Namespace { + string denom = 1; // tokenfactory denom to which this namespace applies to + string wasm_hook = + 2; // address of smart contract to apply code-based restrictions + + bool mints_paused = 3; + bool sends_paused = 4; + bool burns_paused = 5; + + repeated Role role_permissions = 6; // permissions for each role + + repeated AddressRoles address_roles = 7; +} + +message AddressRoles { + string address = 1; + repeated string roles = 2; +} + +// each Action enum value should be a power of two +enum Action { + UNSPECIFIED = 0; + MINT = 1; + RECEIVE = 2; + BURN = 4; +} + +// Role is only used for storage +message Role { + string role = 1; + uint32 permissions = 2; +} + +// used in storage +message RoleIDs { repeated uint32 role_ids = 1; } + +message Voucher { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message AddressVoucher { + string address = 1; + Voucher voucher = 2; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/permissions/v1beta1/query.proto b/protos/injectivejs/injective/permissions/v1beta1/query.proto new file mode 100644 index 00000000..6e4d4b9c --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/query.proto @@ -0,0 +1,118 @@ +syntax = "proto3"; +package injective.permissions.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "injective/permissions/v1beta1/params.proto"; +import "injective/permissions/v1beta1/genesis.proto"; +import "injective/permissions/v1beta1/permissions.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the permissions module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/injective/permissions/v1beta1/params"; + } + + // AllNamespaces defines a gRPC query method that returns the permissions + // module's created namespaces. + rpc AllNamespaces(QueryAllNamespacesRequest) + returns (QueryAllNamespacesResponse) { + option (google.api.http).get = + "/injective/permissions/v1beta1/all_namespaces"; + } + + // NamespaceByDenom defines a gRPC query method that returns the permissions + // module's namespace associated with the provided denom. + rpc NamespaceByDenom(QueryNamespaceByDenomRequest) + returns (QueryNamespaceByDenomResponse) { + option (google.api.http).get = + "/injective/permissions/v1beta1/namespace_by_denom"; + } + + // AddressRoles defines a gRPC query method that returns address roles in the + // namespace + rpc AddressRoles(QueryAddressRolesRequest) + returns (QueryAddressRolesResponse) { + option (google.api.http).get = + "/injective/permissions/v1beta1/addresses_by_role"; + } + + // AddressesByRole defines a gRPC query method that returns a namespace's + // roles associated with the provided address. + rpc AddressesByRole(QueryAddressesByRoleRequest) + returns (QueryAddressesByRoleResponse) { + option (google.api.http).get = + "/injective/permissions/v1beta1/addresses_by_role"; + } + + // VouchersForAddress defines a gRPC query method that returns a map of + // vouchers that are held by permissions module for this address, keyed by the + // originator address + rpc VouchersForAddress(QueryVouchersForAddressRequest) + returns (QueryVouchersForAddressResponse) { + option (google.api.http).get = + "/injective/permissions/v1beta1/vouchers_for_address"; + } +} + +// 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 ]; +} + +// QueryAllNamespacesRequest is the request type for the Query/AllNamespaces RPC +// method. +message QueryAllNamespacesRequest {} + +// QueryAllNamespacesResponse is the response type for the Query/AllNamespaces +// RPC method. +message QueryAllNamespacesResponse { repeated Namespace namespaces = 1; } + +// QueryNamespaceByDenomRequest is the request type for the +// Query/NamespaceByDenom RPC method. +message QueryNamespaceByDenomRequest { + string denom = 1; + bool include_roles = 2; +} + +// QueryNamespaceByDenomResponse is the response type for the +// Query/NamespaceByDenom RPC method. +message QueryNamespaceByDenomResponse { Namespace namespace = 1; } + +// QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole +// RPC method. +message QueryAddressesByRoleRequest { + string denom = 1; + string role = 2; +} + +// QueryAddressesByRoleResponse is the response type for the +// Query/AddressesByRole RPC method. +message QueryAddressesByRoleResponse { repeated string addresses = 1; } + +message QueryAddressRolesRequest { + string denom = 1; + string address = 2; +} + +message QueryAddressRolesResponse { repeated string roles = 1; } + +message QueryVouchersForAddressRequest { string address = 1; } + +message QueryVouchersForAddressResponse { + repeated cosmos.base.v1beta1.Coin vouchers = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.jsontag) = "vouchers,omitempty" + ]; +} diff --git a/protos/injectivejs/injective/permissions/v1beta1/tx.proto b/protos/injectivejs/injective/permissions/v1beta1/tx.proto new file mode 100644 index 00000000..b5749aa7 --- /dev/null +++ b/protos/injectivejs/injective/permissions/v1beta1/tx.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; +package injective.permissions.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "injective/permissions/v1beta1/params.proto"; +import "injective/permissions/v1beta1/permissions.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/permissions/types"; + +// Msg defines the permissions module's gRPC message service. +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc CreateNamespace(MsgCreateNamespace) returns (MsgCreateNamespaceResponse); + rpc DeleteNamespace(MsgDeleteNamespace) returns (MsgDeleteNamespaceResponse); + rpc UpdateNamespace(MsgUpdateNamespace) returns (MsgUpdateNamespaceResponse); + rpc UpdateNamespaceRoles(MsgUpdateNamespaceRoles) + returns (MsgUpdateNamespaceRolesResponse); + rpc RevokeNamespaceRoles(MsgRevokeNamespaceRoles) + returns (MsgRevokeNamespaceRolesResponse); + rpc ClaimVoucher(MsgClaimVoucher) returns (MsgClaimVoucherResponse); +} + +message MsgUpdateParams { + option (amino.name) = "permissions/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 permissions parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} + +message MsgCreateNamespace { + option (amino.name) = "permissions/MsgCreateNamespace"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + Namespace namespace = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgCreateNamespaceResponse {} + +message MsgDeleteNamespace { + option (amino.name) = "permissions/MsgDeleteNamespace"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + string namespace_denom = 2; +} + +message MsgDeleteNamespaceResponse {} + +message MsgUpdateNamespace { + option (amino.name) = "permissions/MsgUpdateNamespace"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + string namespace_denom = + 2; // namespace denom to which this updates are applied + + message MsgSetWasmHook { string new_value = 1; } + MsgSetWasmHook wasm_hook = + 3; // address of smart contract to apply code-based restrictions + + message MsgSetMintsPaused { bool new_value = 1; } + MsgSetMintsPaused mints_paused = 4; + + message MsgSetSendsPaused { bool new_value = 1; } + MsgSetSendsPaused sends_paused = 5; + + message MsgSetBurnsPaused { bool new_value = 1; } + MsgSetBurnsPaused burns_paused = 6; +} + +message MsgUpdateNamespaceResponse {} + +message MsgUpdateNamespaceRoles { + option (amino.name) = "permissions/MsgUpdateNamespaceRoles"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + string namespace_denom = + 2; // namespace denom to which this updates are applied + + repeated Role role_permissions = + 3; // new role definitions or updated permissions for existing roles + repeated AddressRoles address_roles = + 4; // new addresses to add or new roles for existing addresses to + // overwrite current roles +} + +message MsgUpdateNamespaceRolesResponse {} + +message MsgRevokeNamespaceRoles { + option (amino.name) = "permissions/MsgRevokeNamespaceRoles"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + string namespace_denom = + 2; // namespace denom to which this updates are applied + repeated AddressRoles address_roles_to_revoke = + 3; // {"address" => array of roles to revoke from this address} +} + +message MsgRevokeNamespaceRolesResponse {} + +message MsgClaimVoucher { + option (amino.name) = "permissions/MsgClaimVoucher"; + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + string denom = 2; +} + +message MsgClaimVoucherResponse {} diff --git a/protos/injectivejs/injective/stream/v1beta1/query.proto b/protos/injectivejs/injective/stream/v1beta1/query.proto new file mode 100644 index 00000000..66d168ed --- /dev/null +++ b/protos/injectivejs/injective/stream/v1beta1/query.proto @@ -0,0 +1,205 @@ +syntax = "proto3"; +package injective.stream.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "injective/exchange/v1beta1/events.proto"; +import "injective/exchange/v1beta1/exchange.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/stream/types"; + +// ChainStream defines the gRPC streaming service. +service Stream { rpc Stream(StreamRequest) returns (stream StreamResponse); } + +message StreamRequest { + BankBalancesFilter bank_balances_filter = 1 [ (gogoproto.nullable) = true ]; + SubaccountDepositsFilter subaccount_deposits_filter = 2 + [ (gogoproto.nullable) = true ]; + TradesFilter spot_trades_filter = 3 [ (gogoproto.nullable) = true ]; + TradesFilter derivative_trades_filter = 4 [ (gogoproto.nullable) = true ]; + OrdersFilter spot_orders_filter = 5 [ (gogoproto.nullable) = true ]; + OrdersFilter derivative_orders_filter = 6 [ (gogoproto.nullable) = true ]; + OrderbookFilter spot_orderbooks_filter = 7 [ (gogoproto.nullable) = true ]; + OrderbookFilter derivative_orderbooks_filter = 8 + [ (gogoproto.nullable) = true ]; + PositionsFilter positions_filter = 9 [ (gogoproto.nullable) = true ]; + OraclePriceFilter oracle_price_filter = 10 [ (gogoproto.nullable) = true ]; +} + +message StreamResponse { + uint64 block_height = 1; + int64 block_time = 2; + repeated BankBalance bank_balances = 3; + repeated SubaccountDeposits subaccount_deposits = 4; + repeated SpotTrade spot_trades = 5; + repeated DerivativeTrade derivative_trades = 6; + repeated SpotOrderUpdate spot_orders = 7; + repeated DerivativeOrderUpdate derivative_orders = 8; + repeated OrderbookUpdate spot_orderbook_updates = 9; + repeated OrderbookUpdate derivative_orderbook_updates = 10; + repeated Position positions = 11; + repeated OraclePrice oracle_prices = 12; +} + +message OrderbookUpdate { + uint64 seq = 1; + Orderbook orderbook = 2; +} + +message Orderbook { + string market_id = 1; + repeated injective.exchange.v1beta1.Level buy_levels = 2; + repeated injective.exchange.v1beta1.Level sell_levels = 3; +} + +message BankBalance { + string account = 1; + repeated cosmos.base.v1beta1.Coin balances = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message SubaccountDeposits { + string subaccount_id = 1; + repeated SubaccountDeposit deposits = 2 [ (gogoproto.nullable) = false ]; +} + +message SubaccountDeposit { + string denom = 1; + injective.exchange.v1beta1.Deposit deposit = 2 + [ (gogoproto.nullable) = false ]; +} + +enum OrderUpdateStatus { + Unspecified = 0; + Booked = 1; + Matched = 2; + Cancelled = 3; +} + +message SpotOrderUpdate { + OrderUpdateStatus status = 1; + bytes order_hash = 2; + string cid = 3; + SpotOrder order = 4; +} + +message SpotOrder { + string market_id = 1; + injective.exchange.v1beta1.SpotLimitOrder order = 2 + [ (gogoproto.nullable) = false ]; +} + +message DerivativeOrderUpdate { + OrderUpdateStatus status = 1; + bytes order_hash = 2; + string cid = 3; + DerivativeOrder order = 4; +} + +message DerivativeOrder { + string market_id = 1; + injective.exchange.v1beta1.DerivativeLimitOrder order = 2 + [ (gogoproto.nullable) = false ]; + bool is_market = 3; +} + +message Position { + string market_id = 1; + string subaccount_id = 2; + bool isLong = 3; + string quantity = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string entry_price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string margin = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string cumulative_funding_entry = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message OraclePrice { + string symbol = 1; + string price = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string type = 3; +} + +message SpotTrade { + string market_id = 1; + bool is_buy = 2; + string executionType = 3; + + string quantity = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string price = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // bytes32 subaccount ID that executed the trade + string subaccount_id = 6; + string fee = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + bytes order_hash = 8; + string fee_recipient_address = 9 [ (gogoproto.nullable) = true ]; + string cid = 10; + string trade_id = 11; +} + +message DerivativeTrade { + string market_id = 1; + bool is_buy = 2; + string executionType = 3; + string subaccount_id = 4; + injective.exchange.v1beta1.PositionDelta position_delta = 5; + string payout = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string fee = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string order_hash = 8; + string fee_recipient_address = 9 [ (gogoproto.nullable) = true ]; + string cid = 10; + string trade_id = 11; +} + +message TradesFilter { + repeated string subaccount_ids = 1; + repeated string market_ids = 2; +} + +message PositionsFilter { + repeated string subaccount_ids = 1; + repeated string market_ids = 2; +} + +message OrdersFilter { + repeated string subaccount_ids = 1; + repeated string market_ids = 2; +} + +message OrderbookFilter { repeated string market_ids = 1; } + +message BankBalancesFilter { repeated string accounts = 1; } + +message SubaccountDepositsFilter { repeated string subaccount_ids = 1; } + +message OraclePriceFilter { repeated string symbol = 1; } diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/authorityMetadata.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/authorityMetadata.proto new file mode 100644 index 00000000..fd68ac49 --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/authorityMetadata.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/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 injective address + string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/events.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/events.proto new file mode 100644 index 00000000..fd20575b --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/events.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "injective/tokenfactory/v1beta1/authorityMetadata.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/tokenfactory/types"; + +message EventCreateTFDenom { + string account = 1; + string denom = 2; +} + +message EventMintTFDenom { + string recipient_address = 1; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message EventBurnDenom { + string burner_address = 1; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message EventChangeTFAdmin { + string denom = 1; + string new_admin_address = 2; +} + +message EventSetTFDenomMetadata { + string denom = 1; + cosmos.bank.v1beta1.Metadata metadata = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/genesis.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/genesis.proto new file mode 100644 index 00000000..b8316666 --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/genesis.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "injective/tokenfactory/v1beta1/authorityMetadata.proto"; +import "injective/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/tokenfactory/types"; + +// GenesisState defines the tokenfactory module's genesis state. +message GenesisState { + // params defines the parameters 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 + ]; + string name = 3 [ (gogoproto.moretags) = "yaml:\"name\"" ]; + string symbol = 4 [ (gogoproto.moretags) = "yaml:\"symbol\"" ]; + uint32 decimals = 5 [ (gogoproto.moretags) = "yaml:\"decimals\"" ]; +} diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/params.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/params.proto new file mode 100644 index 00000000..fb936f36 --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/params.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "injective/tokenfactory/v1beta1/authorityMetadata.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/tokenfactory/types"; + +// Params defines the parameters for the tokenfactory module. +message Params { + option (amino.name) = "injective/tokenfactory/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 + ]; +} diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/query.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/query.proto new file mode 100644 index 00000000..6633a211 --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/query.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "injective/tokenfactory/v1beta1/authorityMetadata.proto"; +import "injective/tokenfactory/v1beta1/params.proto"; +import "injective/tokenfactory/v1beta1/genesis.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/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 = "/injective/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 = "/injective/tokenfactory/v1beta1/denoms/" + "{creator}/{sub_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 = + "/injective/tokenfactory/v1beta1/denoms_from_creator/{creator}"; + } + + // Retrieves the entire auction module's state + rpc TokenfactoryModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = + "/injective/tokenfactory/v1beta1/module_state"; + } +} + +// 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 creator = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string sub_denom = 2 [ (gogoproto.moretags) = "yaml:\"sub_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\"" ]; +} + +// QueryModuleStateRequest is the request type for the +// Query/TokenfactoryModuleState RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the +// Query/TokenfactoryModuleState RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } \ No newline at end of file diff --git a/protos/injectivejs/injective/tokenfactory/v1beta1/tx.proto b/protos/injectivejs/injective/tokenfactory/v1beta1/tx.proto new file mode 100644 index 00000000..7ece2944 --- /dev/null +++ b/protos/injectivejs/injective/tokenfactory/v1beta1/tx.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; +package injective.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "injective/tokenfactory/v1beta1/params.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/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 UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // ForceTransfer is deactivated for now because we need to think through edge + // cases 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 (amino.name) = "injective/tokenfactory/create-denom"; + 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\"" ]; + string name = 3 [ (gogoproto.moretags) = "yaml:\"name\"" ]; + string symbol = 4 [ (gogoproto.moretags) = "yaml:\"symbol\"" ]; + uint32 decimals = 5 [ (gogoproto.moretags) = "yaml:\"decimals\"" ]; +} + +// 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 (amino.name) = "injective/tokenfactory/mint"; + 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 + ]; +} + +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 (amino.name) = "injective/tokenfactory/burn"; + 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 + ]; +} + +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 { + option (amino.name) = "injective/tokenfactory/change-admin"; + option (cosmos.msg.v1.signer) = "sender"; + + 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 {} + +// 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 {} + +// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set +// the denom's bank metadata +message MsgSetDenomMetadata { + option (amino.name) = "injective/tokenfactory/set-denom-metadata"; + option (cosmos.msg.v1.signer) = "sender"; + + 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 MsgUpdateParams { + option (amino.name) = "injective/tokenfactory/update-params"; + 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 tokenfactory parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/protos/injective/types/v1beta1/account.proto b/protos/injectivejs/injective/types/v1beta1/account.proto similarity index 87% rename from protos/injective/types/v1beta1/account.proto rename to protos/injectivejs/injective/types/v1beta1/account.proto index 54e6e527..f17a2a13 100644 --- a/protos/injective/types/v1beta1/account.proto +++ b/protos/injectivejs/injective/types/v1beta1/account.proto @@ -14,8 +14,7 @@ message EthAccount { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - option (cosmos_proto.implements_interface) = - "github.com/cosmos/cosmos-sdk/x/auth/types.AccountI"; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; cosmos.auth.v1beta1.BaseAccount base_account = 1 [ (gogoproto.embed) = true, diff --git a/protos/injectivejs/injective/types/v1beta1/tx_ext.proto b/protos/injectivejs/injective/types/v1beta1/tx_ext.proto new file mode 100644 index 00000000..7c13befe --- /dev/null +++ b/protos/injectivejs/injective/types/v1beta1/tx_ext.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package injective.types.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/types"; + +message ExtensionOptionsWeb3Tx { + option (gogoproto.goproto_getters) = false; + + // typedDataChainID used only in EIP712 Domain and should match + // Ethereum network ID in a Web3 provider (e.g. Metamask). + uint64 typedDataChainID = 1; + + // feePayer is an account address for the fee payer. It will be validated + // during EIP712 signature checking. + string feePayer = 2; + + // feePayerSig is a signature data from the fee paying account, + // allows to perform fee delegation when using EIP712 Domain. + bytes feePayerSig = 3; +} diff --git a/protos/injectivejs/injective/types/v1beta1/tx_response.proto b/protos/injectivejs/injective/types/v1beta1/tx_response.proto new file mode 100644 index 00000000..c2b15d4f --- /dev/null +++ b/protos/injectivejs/injective/types/v1beta1/tx_response.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package injective.types.v1beta1; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/types"; + +// base header ak message type, we can cast the bytes into corresponding message +// response type +message TxResponseGenericMessage { + string header = 1; + bytes data = 2; +} + +// improvised message to unpack length prefixed messages in tx response data +message TxResponseData { repeated TxResponseGenericMessage messages = 1; } diff --git a/protos/injectivejs/injective/wasmx/v1/events.proto b/protos/injectivejs/injective/wasmx/v1/events.proto new file mode 100644 index 00000000..63ad78bf --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/events.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "injective/wasmx/v1/wasmx.proto"; +import "injective/wasmx/v1/proposal.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +message EventContractExecution { + string contract_address = 1; + bytes response = 2; + string other_error = 3; + string execution_error = 4; +} + +message EventContractRegistered { + string contract_address = 1; + uint64 gas_price = 3; + bool should_pin_contract = 4; + bool is_migration_allowed = 5; + uint64 code_id = 6; + string admin_address = 7; + string granter_address = 8; + FundingMode funding_mode = 9; +} + +message EventContractDeregistered { string contract_address = 1; } diff --git a/protos/injectivejs/injective/wasmx/v1/genesis.proto b/protos/injectivejs/injective/wasmx/v1/genesis.proto new file mode 100644 index 00000000..e0f1b999 --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "injective/wasmx/v1/wasmx.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +message RegisteredContractWithAddress { + string address = 1; + + RegisteredContract registered_contract = 2; +} + +// GenesisState defines the wasmx module's genesis state. +message GenesisState { + // params defines all the parameters of related to wasmx. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // registered_contracts is an array containing the genesis registered + // contracts + repeated RegisteredContractWithAddress registered_contracts = 2 + [ (gogoproto.nullable) = false ]; +} diff --git a/protos/injectivejs/injective/wasmx/v1/proposal.proto b/protos/injectivejs/injective/wasmx/v1/proposal.proto new file mode 100644 index 00000000..3fbe2af4 --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/proposal.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmwasm/wasm/v1/proposal_legacy.proto"; +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +message ContractRegistrationRequestProposal { + option (amino.name) = "wasmx/ContractRegistrationRequestProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + ContractRegistrationRequest contract_registration_request = 3 + [ (gogoproto.nullable) = false ]; +} + +message BatchContractRegistrationRequestProposal { + option (amino.name) = "wasmx/BatchContractRegistrationRequestProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated ContractRegistrationRequest contract_registration_requests = 3 + [ (gogoproto.nullable) = false ]; +} + +message BatchContractDeregistrationProposal { + option (amino.name) = "wasmx/BatchContractDeregistrationProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated string contracts = 3; +} + +enum FundingMode { + Unspecified = 0; + SelfFunded = 1; + GrantOnly = 2; + Dual = 3; +} + +message ContractRegistrationRequest { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Unique Identifier for contract instance to be registered. + string contract_address = 1; + + // Maximum gas to be used for the smart contract execution. + uint64 gas_limit = 2; + + // gas price to be used for the smart contract execution. + uint64 gas_price = 3; + + bool should_pin_contract = 4; + + // if true contract owner can update it, if false only current code_id will be + // allowed to be executed + bool is_migration_allowed = 5; + + // code_id of the contract being registered - will be verified upon every + // execution but only if is_migration_allowed is false + uint64 code_id = 6; + + // Optional address of admin account (that will be allowed to pause or update + // contract params) + string admin_address = 7; + + // Optional address of the contract that grants fees. Must be set if + // funding_mode is other than SelfFunded + string granter_address = 8; + + // Specifies how the contract will fund its execution + FundingMode funding_mode = 9; +} + +message BatchStoreCodeProposal { + option (amino.name) = "wasmx/BatchStoreCodeProposal"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated cosmwasm.wasm.v1.StoreCodeProposal proposals = 3 + [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/wasmx/v1/query.proto b/protos/injectivejs/injective/wasmx/v1/query.proto new file mode 100644 index 00000000..8fce230b --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/query.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "google/api/annotations.proto"; +import "injective/wasmx/v1/wasmx.proto"; +import "injective/wasmx/v1/genesis.proto"; +import "gogoproto/gogo.proto"; +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +// Query defines the gRPC querier service. +service Query { + + // Retrieves wasmx params + rpc WasmxParams(QueryWasmxParamsRequest) returns (QueryWasmxParamsResponse) { + option (google.api.http).get = "/injective/wasmx/v1/params"; + } + + // Retrieves contract registration info + rpc ContractRegistrationInfo(QueryContractRegistrationInfoRequest) + returns (QueryContractRegistrationInfoResponse) { + option (google.api.http).get = + "/injective/wasmx/v1/registration_info/{contract_address}"; + } + + // Retrieves the entire wasmx module's state + rpc WasmxModuleState(QueryModuleStateRequest) + returns (QueryModuleStateResponse) { + option (google.api.http).get = "/injective/wasmx/v1/module_state"; + } +} + +// QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC +// method. +message QueryWasmxParamsRequest {} + +// QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC +// method. +message QueryWasmxParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryModuleStateRequest is the request type for the Query/WasmxModuleState +// RPC method. +message QueryModuleStateRequest {} + +// QueryModuleStateResponse is the response type for the Query/WasmxModuleState +// RPC method. +message QueryModuleStateResponse { GenesisState state = 1; } + +// Contract registration info +message QueryContractRegistrationInfoRequest { string contract_address = 1; } + +message QueryContractRegistrationInfoResponse { + RegisteredContract contract = 1; +} \ No newline at end of file diff --git a/protos/injectivejs/injective/wasmx/v1/tx.proto b/protos/injectivejs/injective/wasmx/v1/tx.proto new file mode 100644 index 00000000..ac19a6f1 --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/tx.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "injective/wasmx/v1/wasmx.proto"; +import "injective/wasmx/v1/proposal.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +// Msg defines the wasmx Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc UpdateRegistryContractParams(MsgUpdateContract) + returns (MsgUpdateContractResponse); + rpc ActivateRegistryContract(MsgActivateContract) + returns (MsgActivateContractResponse); + rpc DeactivateRegistryContract(MsgDeactivateContract) + returns (MsgDeactivateContractResponse); + rpc ExecuteContractCompat(MsgExecuteContractCompat) + returns (MsgExecuteContractCompatResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc RegisterContract(MsgRegisterContract) + returns (MsgRegisterContractResponse); +} + +// MsgExecuteContractCompat submits the given message data to a smart contract, +// compatible with EIP712 +message MsgExecuteContractCompat { + option (amino.name) = "wasmx/MsgExecuteContractCompat"; + option (cosmos.msg.v1.signer) = "sender"; + + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // Msg json encoded message to be passed to the contract + string msg = 3; + // Funds coins that are transferred to the contract on execution + string funds = 4; +} + +// MsgExecuteContractCompatResponse returns execution result data. +message MsgExecuteContractCompatResponse { + // Data contains bytes to returned from the contract + bytes data = 1; +} + +message MsgUpdateContract { + option (amino.name) = "wasmx/MsgUpdateContract"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Unique Identifier for contract instance to be registered. + string contract_address = 2; + // Maximum gas to be used for the smart contract execution. + uint64 gas_limit = 3; + // gas price to be used for the smart contract execution. + uint64 gas_price = 4; + // optional - admin account that will be allowed to perform any changes + string admin_address = 5 [ (gogoproto.nullable) = true ]; +} + +message MsgUpdateContractResponse {} + +message MsgActivateContract { + option (amino.name) = "wasmx/MsgActivateContract"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Unique Identifier for contract instance to be activated. + string contract_address = 2; +} + +message MsgActivateContractResponse {} + +message MsgDeactivateContract { + option (amino.name) = "wasmx/MsgDeactivateContract"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // Unique Identifier for contract instance to be deactivated. + string contract_address = 2; +} + +message MsgDeactivateContractResponse {} + +message MsgUpdateParams { + option (amino.name) = "wasmx/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 wasmx parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} + +message MsgRegisterContract { + option (amino.name) = "wasmx/MsgRegisterContract"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + + ContractRegistrationRequest contract_registration_request = 2 + [ (gogoproto.nullable) = false ]; +} + +message MsgRegisterContractResponse {} \ No newline at end of file diff --git a/protos/injectivejs/injective/wasmx/v1/wasmx.proto b/protos/injectivejs/injective/wasmx/v1/wasmx.proto new file mode 100644 index 00000000..4f0436c4 --- /dev/null +++ b/protos/injectivejs/injective/wasmx/v1/wasmx.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package injective.wasmx.v1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/wasm/v1/types.proto"; +import "amino/amino.proto"; +import "injective/wasmx/v1/proposal.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/wasmx/types"; + +message Params { + option (amino.name) = "wasmx/Params"; + option (gogoproto.equal) = true; + + // Set the status to active to indicate that contracts can be executed in + // begin blocker. + bool is_execution_enabled = 1; + + // Maximum aggregate total gas to be used for the contract executions in the + // BeginBlocker. + uint64 max_begin_block_total_gas = 2; + + // the maximum gas limit each individual contract can consume in the + // BeginBlocker. + uint64 max_contract_gas_limit = 3; + + // min_gas_price defines the minimum gas price the contracts must pay to be + // executed in the BeginBlocker. + uint64 min_gas_price = 4; + + cosmwasm.wasm.v1.AccessConfig register_contract_access = 5 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.moretags) = "yaml:\"register_contract_access\"" + ]; +} + +message RegisteredContract { + option (gogoproto.equal) = true; + + // limit of gas per BB execution + uint64 gas_limit = 1; + + // gas price that contract is willing to pay for execution in BeginBlocker + uint64 gas_price = 2; + + // is contract currently active + bool is_executable = 3; + + // code_id that is allowed to be executed (to prevent malicious updates) - if + // nil/0 any code_id can be executed + uint64 code_id = 4 [ (gogoproto.nullable) = true ]; + + // optional - admin addr that is allowed to update contract data + string admin_address = 5 [ (gogoproto.nullable) = true ]; + + // Optional: address of the contract granting fee + // Must be set if fund_mode is GrantOnly + string granter_address = 6 [ (gogoproto.nullable) = true ]; + + // funding mode + FundingMode fund_mode = 7; +} \ No newline at end of file diff --git a/protos/tendermint/abci/types.proto b/protos/injectivejs/tendermint/abci/types.proto similarity index 100% rename from protos/tendermint/abci/types.proto rename to protos/injectivejs/tendermint/abci/types.proto diff --git a/protos/tendermint/crypto/keys.proto b/protos/injectivejs/tendermint/crypto/keys.proto similarity index 100% rename from protos/tendermint/crypto/keys.proto rename to protos/injectivejs/tendermint/crypto/keys.proto diff --git a/protos/tendermint/crypto/proof.proto b/protos/injectivejs/tendermint/crypto/proof.proto similarity index 100% rename from protos/tendermint/crypto/proof.proto rename to protos/injectivejs/tendermint/crypto/proof.proto diff --git a/protos/tendermint/types/block.proto b/protos/injectivejs/tendermint/types/block.proto similarity index 100% rename from protos/tendermint/types/block.proto rename to protos/injectivejs/tendermint/types/block.proto diff --git a/protos/tendermint/types/evidence.proto b/protos/injectivejs/tendermint/types/evidence.proto similarity index 100% rename from protos/tendermint/types/evidence.proto rename to protos/injectivejs/tendermint/types/evidence.proto diff --git a/protos/tendermint/types/params.proto b/protos/injectivejs/tendermint/types/params.proto similarity index 100% rename from protos/tendermint/types/params.proto rename to protos/injectivejs/tendermint/types/params.proto diff --git a/protos/tendermint/types/types.proto b/protos/injectivejs/tendermint/types/types.proto similarity index 100% rename from protos/tendermint/types/types.proto rename to protos/injectivejs/tendermint/types/types.proto diff --git a/protos/tendermint/types/validator.proto b/protos/injectivejs/tendermint/types/validator.proto similarity index 100% rename from protos/tendermint/types/validator.proto rename to protos/injectivejs/tendermint/types/validator.proto diff --git a/protos/tendermint/version/types.proto b/protos/injectivejs/tendermint/version/types.proto similarity index 100% rename from protos/tendermint/version/types.proto rename to protos/injectivejs/tendermint/version/types.proto diff --git a/protos/interchainjs/amino/amino.proto b/protos/interchainjs/amino/amino.proto new file mode 100644 index 00000000..fb099b8e --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/auth/v1beta1/auth.proto b/protos/interchainjs/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 00000000..ebc18b69 --- /dev/null +++ b/protos/interchainjs/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (amino.name) = "cosmos-sdk/BaseAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; + + 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 (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; + + 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 (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/protos/interchainjs/cosmos/auth/v1beta1/query.proto b/protos/interchainjs/cosmos/auth/v1beta1/query.proto new file mode 100644 index 00000000..804f2ff0 --- /dev/null +++ b/protos/interchainjs/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,236 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +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. + // + // 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 (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 (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 (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 (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}"; + } +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsResponse { + // accounts are the existing accounts + 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; +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + 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) = "cosmos.auth.v1beta1.AccountI"]; +} + +// 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]; +} + +// 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; +} + +// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameResponse { + 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/protos/interchainjs/cosmos/authz/v1beta1/authz.proto b/protos/interchainjs/cosmos/authz/v1beta1/authz.proto new file mode 100644 index 00000000..3fee7364 --- /dev/null +++ b/protos/interchainjs/cosmos/authz/v1beta1/authz.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +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 (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; +} + +// Grant gives permissions to execute +// the provide method with expiration time. +message Grant { + 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 +message GrantAuthorization { + 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) = "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/protos/interchainjs/cosmos/authz/v1beta1/tx.proto b/protos/interchainjs/cosmos/authz/v1beta1/tx.proto new file mode 100644 index 00000000..a1abff0d --- /dev/null +++ b/protos/interchainjs/cosmos/authz/v1beta1/tx.proto @@ -0,0 +1,81 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.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 + // will be overwritten. + rpc Grant(MsgGrant) returns (MsgGrantResponse); + + // Exec 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. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); +} + +// 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 { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrant"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + 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 { + 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) = "cosmos.base.v1beta1.Msg"]; +} + +// 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 { + 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; +} + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +message MsgRevokeResponse {} diff --git a/protos/interchainjs/cosmos/bank/v1beta1/bank.proto b/protos/interchainjs/cosmos/bank/v1beta1/bank.proto new file mode 100644 index 00000000..cbf6a41c --- /dev/null +++ b/protos/interchainjs/cosmos/bank/v1beta1/bank.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; +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 (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; + 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 [(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. +message Output { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + 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 +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +message Supply { + option deprecated = true; + + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; + + 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 +// denomination unit of the basic token. +message DenomUnit { + // denom represents the string name of the given denom unit (e.g uatom). + 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 = 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; + // aliases is a list of string aliases for the given denom + repeated string aliases = 3; +} + +// Metadata represents a struct that describes +// a basic token. +message Metadata { + string description = 1; + // denom_units represents the list of DenomUnit's for a given coin + repeated DenomUnit denom_units = 2; + // base represents the base denom (should be the DenomUnit with exponent = 0). + string base = 3; + // display indicates the suggested denom that should be + // displayed in clients. + string display = 4; + // name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + string name = 5; + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // 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/protos/interchainjs/cosmos/bank/v1beta1/query.proto b/protos/interchainjs/cosmos/bank/v1beta1/query.proto new file mode 100644 index 00000000..5b21a30b --- /dev/null +++ b/protos/interchainjs/cosmos/bank/v1beta1/query.proto @@ -0,0 +1,408 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +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"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the balance of a single coin for a single account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + 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 (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + } + + // 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 (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 (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 (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 (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } + + // DenomMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + } + + // 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 (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"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + 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; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +message QueryAllBalancesRequest { + 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"]; + + // 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, + (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; +} + +// 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// 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, + (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 { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +message QueryTotalSupplyResponse { + // supply is the supply of the 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. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +message QuerySupplyOfRequest { + // denom is the coin denom to query balances for. + string denom = 1; +} + +// 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, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + // 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. +message QueryDenomsMetadataRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +message QueryDenomsMetadataResponse { + // metadata provides the client information for all the registered tokens. + 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; +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +message QueryDenomMetadataRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +message QueryDenomMetadataResponse { + // metadata describes and provides all the client information for the requested token. + 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/protos/interchainjs/cosmos/bank/v1beta1/tx.proto b/protos/interchainjs/cosmos/bank/v1beta1/tx.proto new file mode 100644 index 00000000..a4e8fae4 --- /dev/null +++ b/protos/interchainjs/cosmos/bank/v1beta1/tx.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +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 [(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. +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; + + // 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/protos/interchainjs/cosmos/base/abci/v1beta1/abci.proto b/protos/interchainjs/cosmos/base/abci/v1beta1/abci.proto new file mode 100644 index 00000000..9e3b4e55 --- /dev/null +++ b/protos/interchainjs/cosmos/base/abci/v1beta1/abci.proto @@ -0,0 +1,177 @@ +syntax = "proto3"; +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"; +option (gogoproto.goproto_stringer_all) = false; + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +message TxResponse { + option (gogoproto.goproto_getters) = false; + // The block height + int64 height = 1; + // The transaction hash. + string txhash = 2 [(gogoproto.customname) = "TxHash"]; + // Namespace for the Code + string codespace = 3; + // Response code. + uint32 code = 4; + // Result bytes, if any. + string data = 5; + // The output of the application's logger (raw string). May be + // non-deterministic. + string raw_log = 6; + // The output of the application's logger (typed). May be non-deterministic. + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; + // Additional information. May be non-deterministic. + string info = 8; + // Amount of gas requested for transaction. + int64 gas_wanted = 9; + // Amount of gas consumed by transaction. + int64 gas_used = 10; + // The request transaction bytes. + google.protobuf.Any tx = 11; + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + 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. 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 + repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; +} + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +message ABCIMessageLog { + option (gogoproto.stringer) = true; + + uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; + string log = 2; + + // Events contains a slice of Event objects that were emitted during some + // execution. + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +message StringEvent { + option (gogoproto.stringer) = true; + + string type = 1; + repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +message Attribute { + string key = 1; + string value = 2; +} + +// 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; + + // GasUsed is the amount of gas actually consumed. + uint64 gas_used = 2; +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +message Result { + option (gogoproto.goproto_getters) = false; + + // 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. + bytes data = 1 [deprecated = true]; + + // Log contains the log information from message or handler execution. + string log = 2; + + // 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 +// successfully simulated. +message SimulationResponse { + GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Result result = 2; +} + +// 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; + bytes data = 2; +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +message TxMsgData { + option (gogoproto.stringer) = true; + + // 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 +message SearchTxsResult { + option (gogoproto.stringer) = true; + + // Count of all txs + uint64 total_count = 1; + // Count of txs in current page + uint64 count = 2; + // Index of current page, start from 1 + uint64 page_number = 3; + // Count of total pages + 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/protos/interchainjs/cosmos/base/query/v1beta1/pagination.proto b/protos/interchainjs/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 00000000..0a368144 --- /dev/null +++ b/protos/interchainjs/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package cosmos.base.query.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } +message PageRequest { + // key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + bytes key = 1; + + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + uint64 offset = 2; + + // 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 = 3; + + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + bool count_total = 4; + + // reverse is set to true if results are to be returned in the descending order. + // + // Since: cosmos-sdk 0.43 + bool reverse = 5; +} + +// PageResponse is to be embedded in gRPC response messages where the +// corresponding request message has used PageRequest. +// +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } +message PageResponse { + // next_key is the key to be passed to PageRequest.key to + // 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 + // was set, its value is undefined otherwise + uint64 total = 2; +} diff --git a/protos/interchainjs/cosmos/base/v1beta1/coin.proto b/protos/interchainjs/cosmos/base/v1beta1/coin.proto new file mode 100644 index 00000000..1447d642 --- /dev/null +++ b/protos/interchainjs/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,61 @@ +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; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + 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. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + 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 [ + (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 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/protos/interchainjs/cosmos/crypto/ed25519/keys.proto b/protos/interchainjs/cosmos/crypto/ed25519/keys.proto new file mode 100644 index 00000000..31768075 --- /dev/null +++ b/protos/interchainjs/cosmos/crypto/ed25519/keys.proto @@ -0,0 +1,39 @@ +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"; + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// 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"]; +} + +// 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/protos/interchainjs/cosmos/crypto/multisig/v1beta1/multisig.proto b/protos/interchainjs/cosmos/crypto/multisig/v1beta1/multisig.proto new file mode 100644 index 00000000..bf671f17 --- /dev/null +++ b/protos/interchainjs/cosmos/crypto/multisig/v1beta1/multisig.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crypto.multisig.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +message MultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +message CompactBitArray { + option (gogoproto.goproto_stringer) = false; + + uint32 extra_bits_stored = 1; + bytes elems = 2; +} diff --git a/protos/interchainjs/cosmos/crypto/secp256k1/keys.proto b/protos/interchainjs/cosmos/crypto/secp256k1/keys.proto new file mode 100644 index 00000000..e2358d6d --- /dev/null +++ b/protos/interchainjs/cosmos/crypto/secp256k1/keys.proto @@ -0,0 +1,38 @@ +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"; + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// 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; +} + +// 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/protos/interchainjs/cosmos/crypto/secp256r1/keys.proto b/protos/interchainjs/cosmos/crypto/secp256r1/keys.proto new file mode 100644 index 00000000..2e96c6e3 --- /dev/null +++ b/protos/interchainjs/cosmos/crypto/secp256r1/keys.proto @@ -0,0 +1,23 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.crypto.secp256r1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a secp256r1 ECDSA public key. +message PubKey { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; +} + +// PrivKey defines a secp256r1 ECDSA private key. +message PrivKey { + // secret number serialized using big-endian encoding + bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; +} diff --git a/protos/interchainjs/cosmos/distribution/v1beta1/distribution.proto b/protos/interchainjs/cosmos/distribution/v1beta1/distribution.proto new file mode 100644 index 00000000..0c20286f --- /dev/null +++ b/protos/interchainjs/cosmos/distribution/v1beta1/distribution.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +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 (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 [ + (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 [ + (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; +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message ValidatorHistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + 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, + (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, + (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.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// 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; + 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 { + 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, + (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 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, + (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 +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// 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; + string stake = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + 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; + + 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, + (amino.dont_omitempty) = true + ]; +} + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +message CommunityPoolSpendProposalWithDeposit { + 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/protos/interchainjs/cosmos/distribution/v1beta1/tx.proto b/protos/interchainjs/cosmos/distribution/v1beta1/tx.proto new file mode 100644 index 00000000..32318bd8 --- /dev/null +++ b/protos/interchainjs/cosmos/distribution/v1beta1/tx.proto @@ -0,0 +1,215 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +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); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// 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 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// 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, + (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/protos/interchainjs/cosmos/feegrant/v1beta1/tx.proto b/protos/interchainjs/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 00000000..a45eec3b --- /dev/null +++ b/protos/interchainjs/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,77 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +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. + rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); + + // 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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // 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. +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 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + 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/protos/interchainjs/cosmos/gov/v1/gov.proto b/protos/interchainjs/cosmos/gov/v1/gov.proto new file mode 100644 index 00000000..0ebfbc1d --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/gov/v1/tx.proto b/protos/interchainjs/cosmos/gov/v1/tx.proto new file mode 100644 index 00000000..21920a5f --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/gov/v1beta1/gov.proto b/protos/interchainjs/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 00000000..99b97191 --- /dev/null +++ b/protos/interchainjs/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,254 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +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/v1beta1"; + +option (gogoproto.goproto_getters_all) = false; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 +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", + (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) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/TextProposal"; + + option (gogoproto.equal) = true; + + // title of the proposal. + string title = 1; + + // description associated with the proposal. + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // 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; + + // 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, (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, (amino.dont_omitempty) = 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, + (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, (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, (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 proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + // 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 [ + (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.equal) = false; + + // 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, (amino.dont_omitempty) = true]; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // 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.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.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // 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. + bytes quorum = 1 [ + (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. + bytes threshold = 2 [ + (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. + bytes veto_threshold = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty" + ]; +} diff --git a/protos/interchainjs/cosmos/gov/v1beta1/query.proto b/protos/interchainjs/cosmos/gov/v1beta1/query.proto new file mode 100644 index 00000000..28352ed4 --- /dev/null +++ b/protos/interchainjs/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +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/v1beta1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // 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}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// 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 proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // 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 { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // 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 { + // voting_params defines the parameters related to voting. + 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, (amino.dont_omitempty) = true]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // 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 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/protos/interchainjs/cosmos/gov/v1beta1/tx.proto b/protos/interchainjs/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 00000000..9de763be --- /dev/null +++ b/protos/interchainjs/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,134 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +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/v1beta1"; + +// 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); + + // 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. + // + // Since: cosmos-sdk 0.43 + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// 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/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"]; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // 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 { + // 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 (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. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeighted { + 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. +// +// Since: cosmos-sdk 0.43 +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/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. +message MsgDepositResponse {} diff --git a/protos/interchainjs/cosmos/group/v1/tx.proto b/protos/interchainjs/cosmos/group/v1/tx.proto new file mode 100644 index 00000000..5a5f028b --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/group/v1/types.proto b/protos/interchainjs/cosmos/group/v1/types.proto new file mode 100644 index 00000000..97af45ff --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/ics23/v1/proofs.proto b/protos/interchainjs/cosmos/ics23/v1/proofs.proto new file mode 100644 index 00000000..940f6802 --- /dev/null +++ b/protos/interchainjs/cosmos/ics23/v1/proofs.proto @@ -0,0 +1,243 @@ +syntax = "proto3"; + +package cosmos.ics23.v1; + +option go_package = "github.com/cosmos/ics23/go;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; + KECCAK256 = 3; + RIPEMD160 = 4; + BITCOIN = 5; // ripemd160(sha256(x)) + SHA512_256 = 6; + BLAKE2B_512 = 7; + BLAKE2S_256 = 8; + BLAKE3 = 9; +} + +/** +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) + // the max_depth is interpreted as 128 if set to 0 + int32 max_depth = 3; + // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) + int32 min_depth = 4; + // prehash_key_before_comparison is a flag that indicates whether to use the + // prehash_key specified by LeafOp to compare lexical ordering of keys for + // non-existence proofs. + bool prehash_key_before_comparison = 5; +} + +/* +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; + // the max prefix length must be less than the minimum prefix length + child size + 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/protos/interchainjs/cosmos/msg/v1/msg.proto b/protos/interchainjs/cosmos/msg/v1/msg.proto new file mode 100644 index 00000000..853efa1f --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/query/v1/query.proto b/protos/interchainjs/cosmos/query/v1/query.proto new file mode 100644 index 00000000..e42e73d7 --- /dev/null +++ b/protos/interchainjs/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/protos/interchainjs/cosmos/staking/v1beta1/query.proto b/protos/interchainjs/cosmos/staking/v1beta1/query.proto new file mode 100644 index 00000000..9b981223 --- /dev/null +++ b/protos/interchainjs/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,387 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// 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, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// 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 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // 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 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + 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; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + 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, (amino.dont_omitempty) = true]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + 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; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + 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; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + 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; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // 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; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +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, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +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, (amino.dont_omitempty) = true]; +} diff --git a/protos/interchainjs/cosmos/staking/v1beta1/staking.proto b/protos/interchainjs/cosmos/staking/v1beta1/staking.proto new file mode 100644 index 00000000..24ec65d1 --- /dev/null +++ b/protos/interchainjs/cosmos/staking/v1beta1/staking.proto @@ -0,0 +1,394 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +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"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// HistoricalInfo contains header and validator information for a given block. +// It is stored as part of staking module's state, which persists the `n` most +// recent HistoricalInfo +// (`n` is set by the staking module's `historical_entries` parameter). +message HistoricalInfo { + 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; + + // rate is the commission rate charged to delegators, as a fraction. + 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 [ + (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 [ + (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; + + // commission_rates defines the initial commission rates to be used for creating a validator. + 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, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Description defines a validator description. +message Description { + option (gogoproto.equal) = true; + + // moniker defines a human-readable name for the validator. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4; + // details define other optional details. + string details = 5; +} + +// Validator defines a validator, together with the total amount of the +// Validator's bond shares and their exchange rate to coins. Slashing results in +// a decrease in the exchange rate, allowing correct calculation of future +// undelegations without iterating over delegators. When coins are delegated to +// this validator, the validator is credited with a delegation whose number of +// bond shares is based on the amount of coins delegated divided by the current +// exchange rate. Voting power can be calculated as total bonded shares +// multiplied by exchange rate. +message Validator { + 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 [(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"]; + // 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 [ + (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 [ + (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, (amino.dont_omitempty) = true]; + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + 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, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // commission defines the commission parameters. + 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 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // strictly positive if this validator's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 12; + + // list of unbonding ids, each uniquely identifing an unbonding of this validator + repeated uint64 unbonding_ids = 13; +} + +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + +// ValAddresses defines a repeated set of validator addresses. +message ValAddresses { + 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; + + 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, (amino.dont_omitempty) = true]; +} + +// DVVTriplet is struct that just has a delegator-validator-validator triplet +// with no other data. It is intended to be used as a marshalable pointer. For +// 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; + + 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, (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; + + // 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 [ + (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; + + // 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, (amino.dont_omitempty) = true]; // unbonding delegation entries +} + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +message UnbondingDelegationEntry { + option (gogoproto.equal) = true; + + // creation_height is the height which the unbonding took place. + int64 creation_height = 1; + // completion_time is the unix time for unbonding completion. + google.protobuf.Timestamp completion_time = 2 + [(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 [ + (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 [ + (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; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// RedelegationEntry defines a redelegation object with relevant metadata. +message RedelegationEntry { + option (gogoproto.equal) = true; + + // creation_height defines the height which the redelegation took place. + int64 creation_height = 1; + // completion_time defines the unix time for redelegation completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // initial_balance defines the initial balance when redelegation started. + string initial_balance = 3 [ + (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 [ + (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; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// 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; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_src_address is the validator redelegation source operator 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 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // entries are the redelegation entries. + repeated RedelegationEntry entries = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries +} + +// Params defines the parameters for the x/staking module. +message Params { + 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, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + // max_validators is the maximum number of validators. + uint32 max_validators = 2; + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + uint32 max_entries = 3; + // historical_entries is the number of historical entries to persist. + uint32 historical_entries = 4; + // bond_denom defines the bondable coin denomination. + 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; + + Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +message RedelegationEntryResponse { + option (gogoproto.equal) = true; + + 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 +// contain a balance in addition to shares which is more suitable for client +// responses. +message RedelegationResponse { + option (gogoproto.equal) = 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 +// denomination. +message Pool { + option (gogoproto.description) = true; + option (gogoproto.equal) = true; + string not_bonded_tokens = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "not_bonded_tokens", + (amino.dont_omitempty) = true + ]; + string bonded_tokens = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "bonded_tokens", + (amino.dont_omitempty) = true + ]; +} + +// 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_DOUBLE_SIGN = 1; + // DOWNTIME defines a validator that missed signing too many blocks. + 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, (amino.dont_omitempty) = true]; +} diff --git a/protos/interchainjs/cosmos/staking/v1beta1/tx.proto b/protos/interchainjs/cosmos/staking/v1beta1/tx.proto new file mode 100644 index 00000000..238645ba --- /dev/null +++ b/protos/interchainjs/cosmos/staking/v1beta1/tx.proto @@ -0,0 +1,206 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +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); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // 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, (amino.dont_omitempty) = true]; + CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string min_self_delegation = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + // 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, (amino.dont_omitempty) = true]; +} + +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +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, (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 + [(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. +message MsgEditValidatorResponse {} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message MsgDelegate { + 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 [(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. +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 (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; + + 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, (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 (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 [(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, (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/protos/interchainjs/cosmos/tx/signing/v1beta1/signing.proto b/protos/interchainjs/cosmos/tx/signing/v1beta1/signing.proto new file mode 100644 index 00000000..584eff4e --- /dev/null +++ b/protos/interchainjs/cosmos/tx/signing/v1beta1/signing.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; +package cosmos.tx.signing.v1beta1; + +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +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. + SIGN_MODE_UNSPECIFIED = 0; + + // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + // 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. + // + // 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. + SIGN_MODE_LEGACY_AMINO_JSON = 127; + + // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + // + // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + // but is not implemented on the SDK by default. To enable EIP-191, you need + // to pass a custom `TxConfig` that has an implementation of + // `SignModeHandler` for EIP-191. The SDK may decide to fully support + // EIP-191 in the future. + // + // Since: cosmos-sdk 0.45.2 + SIGN_MODE_EIP_191 = 191; +} + +// SignatureDescriptors wraps multiple SignatureDescriptor's. +message SignatureDescriptors { + // signatures are the signature descriptors + repeated SignatureDescriptor signatures = 1; +} + +// SignatureDescriptor is a convenience type which represents the full data for +// a signature including the public key of the signer, signing modes and the +// signature itself. It is primarily used for coordinating signatures between +// clients. +message SignatureDescriptor { + // public_key is the public key of the signer + google.protobuf.Any public_key = 1; + + Data data = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to prevent + // replay attacks. + uint64 sequence = 3; + + // Data represents signature data + message Data { + // sum is the oneof that specifies whether this represents single or multi-signature data + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a multisig signer + Multi multi = 2; + } + + // Single is the signature data for a single signer + message Single { + // mode is the signing mode of the single signer + SignMode mode = 1; + + // signature is the raw signature bytes + bytes signature = 2; + } + + // Multi is the signature data for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // signatures is the signatures of the multi-signature + repeated Data signatures = 2; + } + } +} diff --git a/protos/interchainjs/cosmos/tx/v1beta1/service.proto b/protos/interchainjs/cosmos/tx/v1beta1/service.proto new file mode 100644 index 00000000..7e19a186 --- /dev/null +++ b/protos/interchainjs/cosmos/tx/v1beta1/service.proto @@ -0,0 +1,292 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/tx/v1beta1/tx.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Service defines a gRPC service for interacting with transactions. +service Service { + // Simulate simulates executing a transaction for estimating gas usage. + rpc Simulate(SimulateRequest) returns (SimulateResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/simulate" + body: "*" + }; + } + // GetTx fetches a tx by hash. + rpc GetTx(GetTxRequest) returns (GetTxResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; + } + // BroadcastTx broadcast transaction. + rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/txs" + body: "*" + }; + } + // GetTxsEvent fetches txs by event. + rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; + } + // GetBlockWithTxs fetches a block with decoded txs. + // + // Since: cosmos-sdk 0.45.2 + 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. + // 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. + // 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 = 0; + // ORDER_BY_ASC defines ascending order + ORDER_BY_ASC = 1; + // ORDER_BY_DESC defines descending order + ORDER_BY_DESC = 2; +} + +// GetTxsEventResponse is the response type for the Service.TxsByEvents +// RPC method. +message GetTxsEventResponse { + // txs is the list of queried transactions. + repeated cosmos.tx.v1beta1.Tx txs = 1; + // tx_responses is the list of queried TxResponses. + repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; + // pagination defines a pagination for the response. + // 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 +// RPC method. +message BroadcastTxRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; + BroadcastMode mode = 2; +} + +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +// method. +enum BroadcastMode { + // zero-value for mode ordering + BROADCAST_MODE_UNSPECIFIED = 0; + // 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 = 3; +} + +// BroadcastTxResponse is the response type for the +// Service.BroadcastTx method. +message BroadcastTxResponse { + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 1; +} + +// SimulateRequest is the request type for the Service.Simulate +// RPC method. +message SimulateRequest { + // tx is the transaction to simulate. + // Deprecated. Send raw tx bytes instead. + cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; + // tx_bytes is the raw transaction. + // + // Since: cosmos-sdk 0.43 + bytes tx_bytes = 2; +} + +// SimulateResponse is the response type for the +// Service.SimulateRPC method. +message SimulateResponse { + // gas_info is the information about gas used in the simulation. + cosmos.base.abci.v1beta1.GasInfo gas_info = 1; + // result is the result of the simulation. + cosmos.base.abci.v1beta1.Result result = 2; +} + +// GetTxRequest is the request type for the Service.GetTx +// RPC method. +message GetTxRequest { + // hash is the tx hash to query, encoded as a hex string. + string hash = 1; +} + +// GetTxResponse is the response type for the Service.GetTx method. +message GetTxResponse { + // tx is the queried transaction. + cosmos.tx.v1beta1.Tx tx = 1; + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 2; +} + +// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +// RPC method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsRequest { + // height is the height of the block to query. + int64 height = 1; + // pagination defines a pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +// method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsResponse { + // txs are the transactions in the block. + repeated cosmos.tx.v1beta1.Tx txs = 1; + .tendermint.types.BlockID block_id = 2; + .tendermint.types.Block block = 3; + // pagination defines a pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 4; +} + +// 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/protos/interchainjs/cosmos/tx/v1beta1/tx.proto b/protos/interchainjs/cosmos/tx/v1beta1/tx.proto new file mode 100644 index 00000000..cfaac704 --- /dev/null +++ b/protos/interchainjs/cosmos/tx/v1beta1/tx.proto @@ -0,0 +1,260 @@ +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"; + +// Tx is the standard type used for broadcasting transactions. +message Tx { + // body is the processable content of the transaction + TxBody body = 1; + + // auth_info is the authorization related content of the transaction, + // specifically signers, signer modes and fee + AuthInfo auth_info = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// TxRaw is a variant of Tx that pins the signer's exact binary representation +// of body and auth_info. This is used for signing, broadcasting and +// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +// as the transaction ID. +message TxRaw { + // body_bytes is a protobuf serialization of a TxBody that matches the + // representation in SignDoc. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in SignDoc. + bytes auth_info_bytes = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +message SignDoc { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in TxRaw. + bytes auth_info_bytes = 2; + + // chain_id is the unique 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; +} + +// 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 + // those messages define the number and order of elements in AuthInfo's + // signer_infos and Tx's signatures. Each required signer address is added to + // the list only the first time it occurs. + // By convention, the first required signer (usually from the first message) + // is referred to as the primary signer and pays the fee for the whole + // transaction. + repeated google.protobuf.Any messages = 1; + + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + string memo = 2; + + // timeout is the block height after which this transaction will not + // be processed by the chain + uint64 timeout_height = 3; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, the transaction will be rejected + repeated google.protobuf.Any extension_options = 1023; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, they will be ignored + repeated google.protobuf.Any non_critical_extension_options = 2047; +} + +// AuthInfo describes the fee and signer modes that are used to sign a +// transaction. +message AuthInfo { + // signer_infos defines the signing modes for the required signers. The number + // and order of elements must match the required signers from TxBody's + // messages. The first element is the primary signer and the one which pays + // the fee. + repeated SignerInfo signer_infos = 1; + + // Fee is the fee and gas limit for the transaction. The first signer is the + // primary signer and the one which pays the fee. The fee can be calculated + // 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 +// signer. +message SignerInfo { + // public_key is the public key of the signer. It is optional for accounts + // that already exist in state. If unset, the verifier can use the required \ + // signer address for this position and lookup the public key. + google.protobuf.Any public_key = 1; + + // mode_info describes the signing mode of the signer and is a nested + // structure to support nested multisig pubkey's + ModeInfo mode_info = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to + // prevent replay attacks. + uint64 sequence = 3; +} + +// ModeInfo describes the signing mode of a single or nested multisig signer. +message ModeInfo { + // sum is the oneof that specifies whether this represents a single or nested + // multisig signer + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a nested multisig signer + Multi multi = 2; + } + + // Single is the mode info for a single signer. It is structured as a message + // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + // future + message Single { + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + } + + // Multi is the mode info for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // mode_infos is the corresponding modes of the signers of the multisig + // which could include nested multisig public keys + repeated ModeInfo mode_infos = 2; + } +} + +// Fee includes the amount of coins paid in fees and the maximum +// gas to be used by the transaction. The ratio yields an effective "gasprice", +// 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", + (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 + uint64 gas_limit = 2; + + // 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 [(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 [(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/protos/interchainjs/cosmos/upgrade/v1beta1/upgrade.proto b/protos/interchainjs/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 00000000..5dfb289d --- /dev/null +++ b/protos/interchainjs/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; +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 = "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 (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 + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // 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, (amino.dont_omitempty) = true]; + + // The height at which the upgrade must be performed. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // 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]; +} + +// 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 deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; + + // 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 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; + + // description of the proposal + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/protos/interchainjs/cosmos/vesting/v1beta1/tx.proto b/protos/interchainjs/cosmos/vesting/v1beta1/tx.proto new file mode 100644 index 00000000..67008724 --- /dev/null +++ b/protos/interchainjs/cosmos/vesting/v1beta1/tx.proto @@ -0,0 +1,102 @@ +syntax = "proto3"; +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 [(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" + ]; + + // end of vesting as unix time (in seconds). + int64 end_time = 4; + bool delayed = 5; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +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/protos/interchainjs/cosmos/vesting/v1beta1/vesting.proto b/protos/interchainjs/cosmos/vesting/v1beta1/vesting.proto new file mode 100644 index 00000000..12e9cdd2 --- /dev/null +++ b/protos/interchainjs/cosmos/vesting/v1beta1/vesting.proto @@ -0,0 +1,94 @@ +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"; + +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 (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, + (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, + (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, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // 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 (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; + option (gogoproto.goproto_getters) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + // 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 (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 { + // Period duration in seconds. + int64 length = 1; + 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 (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; + option (gogoproto.goproto_getters) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// PermanentLockedAccount implements the VestingAccount interface. It does +// not ever release coins, locking them indefinitely. Coins in this account can +// still be used for delegating and for governance votes even while locked. +// +// Since: cosmos-sdk 0.43 +message PermanentLockedAccount { + option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; + option (gogoproto.goproto_getters) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} diff --git a/protos/interchainjs/cosmos_proto/cosmos.proto b/protos/interchainjs/cosmos_proto/cosmos.proto new file mode 100644 index 00000000..4fb58159 --- /dev/null +++ b/protos/interchainjs/cosmos_proto/cosmos.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MethodOptions { + + // method_added_in is used to indicate from which version the method was added. + string method_added_in = 93001; +} + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; + + // message_added_in is used to indicate from which version the message was added. + string message_added_in = 93002; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; + + // field_added_in is used to indicate from which version the field was added. + string field_added_in = 93003; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; + + // file_added_in is used to indicate from which the version the file was added. + string file_added_in = 793023; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} \ No newline at end of file diff --git a/protos/interchainjs/cosmwasm/wasm/v1/query.proto b/protos/interchainjs/cosmwasm/wasm/v1/query.proto new file mode 100644 index 00000000..e52b6b04 --- /dev/null +++ b/protos/interchainjs/cosmwasm/wasm/v1/query.proto @@ -0,0 +1,355 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +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; +option (gogoproto.equal_all) = false; + +// Query provides defines the gRPC querier service +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}"; + } + // SmartContractState get smart query result from the contract + rpc SmartContractState(QuerySmartContractStateRequest) + returns (QuerySmartContractStateResponse) { + option (google.api.http).get = + "/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}"; + } + // Code gets the binary code and metadata for a single 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"; + } + + // CodeInfo gets the metadata for a single wasm code + rpc CodeInfo(QueryCodeInfoRequest) returns (QueryCodeInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmwasm/wasm/v1/code-info/{code_id}"; + } + + // 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"; + } + + // 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}"; + } + + // WasmLimitsConfig gets the configured limits for static validation of Wasm + // files, encoded in JSON. + rpc WasmLimitsConfig(QueryWasmLimitsConfigRequest) + returns (QueryWasmLimitsConfigResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/wasm-limits-config"; + } + + // 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} +// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +// method +message QueryContractInfoResponse { + option (gogoproto.equal) = true; + + // address is the address of the contract + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + ContractInfo contract_info = 2 [ + (gogoproto.embed) = true, + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.jsontag) = "" + ]; +} + +// QueryContractHistoryRequest is the request type for the Query/ContractHistory +// RPC method +message QueryContractHistoryRequest { + // address is the address of the contract to query + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractHistoryResponse is the response type for the +// Query/ContractHistory RPC method +message QueryContractHistoryResponse { + repeated ContractCodeHistoryEntry entries = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +// RPC method +message QueryContractsByCodeRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractsByCodeResponse is the response type for the +// Query/ContractsByCode RPC method +message QueryContractsByCodeResponse { + // contracts are a set of contract addresses + repeated string contracts = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllContractStateRequest is the request type for the +// Query/AllContractState RPC method +message QueryAllContractStateRequest { + // address is the address of the contract + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllContractStateResponse is the response type for the +// Query/AllContractState RPC method +message QueryAllContractStateResponse { + 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; +} + +// QueryRawContractStateRequest is the request type for the +// Query/RawContractState RPC method +message QueryRawContractStateRequest { + // address is the address of the contract + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bytes query_data = 2; +} + +// QueryRawContractStateResponse is the response type for the +// Query/RawContractState RPC method +message QueryRawContractStateResponse { + // Data contains the raw store data + bytes data = 1; +} + +// QuerySmartContractStateRequest is the request type for the +// Query/SmartContractState RPC method +message QuerySmartContractStateRequest { + // address is the address of the contract + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // QueryData contains the query data passed to the contract + 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", + (amino.encoding) = "inline_json" + ]; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method +message QueryCodeRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID +} + +// QueryCodeInfoRequest is the request type for the Query/CodeInfo RPC method +message QueryCodeInfoRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodeID +} + +// QueryCodeInfoResponse is the response type for the Query/CodeInfo RPC method +message QueryCodeInfoResponse { + option (gogoproto.equal) = true; + + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bytes checksum = 3 [ (gogoproto.casttype) = + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; + AccessConfig instantiate_permission = 4 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// CodeInfoResponse contains code meta data from CodeInfo +message CodeInfoResponse { + option (gogoproto.equal) = true; + + uint64 code_id = 1 [ + (gogoproto.customname) = "CodeID", + (gogoproto.jsontag) = "id" + ]; // id for legacy support + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bytes data_hash = 3 + [ (gogoproto.casttype) = + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; + // Used in v1beta1 + reserved 4, 5; + AccessConfig instantiate_permission = 6 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// QueryCodeResponse is the response type for the Query/Code RPC method +message QueryCodeResponse { + option (gogoproto.equal) = true; + CodeInfoResponse code_info = 1 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; + bytes data = 2 [ (gogoproto.jsontag) = "data" ]; +} + +// QueryCodesRequest is the request type for the Query/Codes RPC method +message QueryCodesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryCodesResponse is the response type for the Query/Codes RPC method +message QueryCodesResponse { + 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; +} + +// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes +// RPC method +message QueryPinnedCodesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryPinnedCodesResponse is the response type for the +// Query/PinnedCodes RPC method +message QueryPinnedCodesResponse { + repeated uint64 code_ids = 1 [ (gogoproto.customname) = "CodeIDs" ]; + // 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 {} + +// 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, (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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractsByCreatorResponse is the response type for the +// Query/ContractsByCreator RPC method. +message QueryContractsByCreatorResponse { + // ContractAddresses result set + repeated string contract_addresses = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWasmLimitsConfigRequest is the request type for the +// Query/WasmLimitsConfig RPC method. +message QueryWasmLimitsConfigRequest {} + +// QueryWasmLimitsConfigResponse is the response type for the +// Query/WasmLimitsConfig RPC method. It contains the JSON encoded limits for +// static validation of Wasm files. +message QueryWasmLimitsConfigResponse { string config = 1; } + +// 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/protos/interchainjs/cosmwasm/wasm/v1/tx.proto b/protos/interchainjs/cosmwasm/wasm/v1/tx.proto new file mode 100644 index 00000000..4dfe7446 --- /dev/null +++ b/protos/interchainjs/cosmwasm/wasm/v1/tx.proto @@ -0,0 +1,521 @@ +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 + // code id. + rpc InstantiateContract(MsgInstantiateContract) + returns (MsgInstantiateContractResponse); + // InstantiateContract2 creates a new smart contract instance for the given + // code id with a predictable address + rpc InstantiateContract2(MsgInstantiateContract2) + returns (MsgInstantiateContract2Response); + // Execute submits the given message data to a smart contract + 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 + 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); +} + +// 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 3, 4; + // InstantiatePermission access control to apply on contract creation, + // optional + AccessConfig instantiate_permission = 5; +} +// MsgStoreCodeResponse returns store result data. +message MsgStoreCodeResponse { + // 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; +} + +// 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + 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", + (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" + ]; +} + +// 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 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + 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", + (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" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 7; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 8; +} + +// MsgInstantiateContract2Response return instantiation result data +message MsgInstantiateContract2Response { + // 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; +} + +// 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 [ (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 + 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, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// MsgExecuteContractResponse returns execution result data. +message MsgExecuteContractResponse { + // Data contains bytes to returned from the contract + bytes data = 1; +} + +// 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + 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", + (amino.encoding) = "inline_json" + ]; +} + +// MsgMigrateContractResponse returns contract migration result data. +message MsgMigrateContractResponse { + // Data contains same raw bytes returned as data from the wasm contract. + // (May be empty) + bytes data = 1; +} + +// 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // NewAdmin address to be set + string new_admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgUpdateAdminResponse returns empty data +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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgClearAdminResponse returns empty data +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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID references the stored WASM code + uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; + // NewInstantiatePermission is the new access control + AccessConfig new_instantiate_permission = 3; +} + +// MsgUpdateInstantiateConfigResponse returns empty data +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 contract 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 {} diff --git a/protos/interchainjs/cosmwasm/wasm/v1/types.proto b/protos/interchainjs/cosmwasm/wasm/v1/types.proto new file mode 100644 index 00000000..ad530854 --- /dev/null +++ b/protos/interchainjs/cosmwasm/wasm/v1/types.proto @@ -0,0 +1,150 @@ +syntax = "proto3"; +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; +option (gogoproto.equal_all) = true; + +// AccessType permission types +enum AccessType { + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.goproto_enum_stringer) = false; + // AccessTypeUnspecified placeholder for empty value + ACCESS_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ]; + // AccessTypeNobody forbidden + ACCESS_TYPE_NOBODY = 1 + [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; + + reserved 2; // was AccessTypeOnlyAddress + + // AccessTypeEverybody unrestricted + ACCESS_TYPE_EVERYBODY = 3 + [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; + // AccessTypeAnyOfAddresses allow any of the addresses + ACCESS_TYPE_ANY_OF_ADDRESSES = 4 + [ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddresses" ]; +} + +// AccessTypeParam +message AccessTypeParam { + option (gogoproto.goproto_stringer) = true; + AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; +} + +// AccessConfig access control type. +message AccessConfig { + option (gogoproto.goproto_stringer) = true; + AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; + + reserved 2; // was address + + repeated string addresses = 3 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Params defines the set of wasm parameters. +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 + [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; +} + +// CodeInfo is data for the uploaded contract WASM code +message CodeInfo { + // CodeHash is the unique identifier created by wasmvm + bytes code_hash = 1; + // Creator address who initially stored the code + 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, (amino.dont_omitempty) = true ]; +} + +// ContractInfo stores a WASM contract instance +message ContractInfo { + option (gogoproto.equal) = true; + + // 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 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + 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. + AbsoluteTxPosition created = 5; + string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; + + // Extension is an extension point to store custom metadata within the + // persistence model. + google.protobuf.Any extension = 7 + [ (cosmos_proto.accepts_interface) = + "cosmwasm.wasm.v1.ContractInfoExtension" ]; +} + +// ContractCodeHistoryOperationType actions that caused a code change +enum ContractCodeHistoryOperationType { + option (gogoproto.goproto_enum_prefix) = false; + // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeUnspecified" ]; + // ContractCodeHistoryOperationTypeInit on chain contract instantiation + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeInit" ]; + // ContractCodeHistoryOperationTypeMigrate code migration + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeMigrate" ]; + // ContractCodeHistoryOperationTypeGenesis based on genesis data + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeGenesis" ]; +} + +// ContractCodeHistoryEntry metadata to a contract. +message ContractCodeHistoryEntry { + ContractCodeHistoryOperationType operation = 1; + // CodeID is the reference to the stored WASM code + uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; + // Updated Tx position when the operation was executed. + AbsoluteTxPosition updated = 3; + bytes msg = 4 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// AbsoluteTxPosition is a unique transaction position that allows for global +// ordering of transactions. +message AbsoluteTxPosition { + // BlockHeight is the block the contract was created at + uint64 block_height = 1; + // TxIndex is a monotonic counter within the block (actual transaction index, + // or gas consumed) + uint64 tx_index = 2; +} + +// Model is a struct that holds a KV pair +message Model { + // hex-encode key to read it better (this is often ascii) + bytes key = 1 [ (gogoproto.casttype) = + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; + // base64-encode raw value + bytes value = 2; +} diff --git a/protos/interchainjs/gogoproto/gogo.proto b/protos/interchainjs/gogoproto/gogo.proto new file mode 100644 index 00000000..b80c8565 --- /dev/null +++ b/protos/interchainjs/gogoproto/gogo.proto @@ -0,0 +1,144 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// 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. +// +// 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. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + +} diff --git a/protos/interchainjs/google/api/annotations.proto b/protos/interchainjs/google/api/annotations.proto new file mode 100644 index 00000000..84c48164 --- /dev/null +++ b/protos/interchainjs/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/protos/interchainjs/google/api/http.proto b/protos/interchainjs/google/api/http.proto new file mode 100644 index 00000000..e3270371 --- /dev/null +++ b/protos/interchainjs/google/api/http.proto @@ -0,0 +1,371 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// - HTTP: `GET /v1/messages/123456` +// - gRPC: `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` +// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: +// SubMessage(subfield: "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// - HTTP: `GET /v1/messages/123456` +// - gRPC: `GetMessage(message_id: "123456")` +// +// - HTTP: `GET /v1/users/me/messages/123456` +// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` +// +// Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They +// are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL +// query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP +// request body, all +// fields are passed via URL path and URL query parameters. +// +// Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// The following example selects a gRPC method and applies an `HttpRule` to it: +// +// http: +// rules: +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax + // details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/protos/interchainjs/google/protobuf/any.proto b/protos/interchainjs/google/protobuf/any.proto new file mode 100644 index 00000000..eff44e50 --- /dev/null +++ b/protos/interchainjs/google/protobuf/any.proto @@ -0,0 +1,162 @@ +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// // or ... +// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +// foo = any.unpack(Foo.getDefaultInstance()); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/protos/interchainjs/google/protobuf/descriptor.proto b/protos/interchainjs/google/protobuf/descriptor.proto new file mode 100644 index 00000000..dd2d0fbf --- /dev/null +++ b/protos/interchainjs/google/protobuf/descriptor.proto @@ -0,0 +1,1337 @@ +// 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; + + // Extensions for tooling. + extensions 536000000 [declaration = { + number: 536000000 + type: ".buf.descriptor.v1.FileDescriptorSetExtension" + full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension" + }]; +} + +// The full set of known editions. +enum Edition { + // A placeholder for an unknown edition value. + EDITION_UNKNOWN = 0; + + // A placeholder edition for specifying default behaviors *before* a feature + // was first introduced. This is effectively an "infinite past". + EDITION_LEGACY = 900; + + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + EDITION_PROTO2 = 998; + EDITION_PROTO3 = 999; + + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + EDITION_2023 = 1000; + EDITION_2024 = 1001; + + // Placeholder editions for testing feature resolution. These should not be + // used or relied on outside of tests. + EDITION_1_TEST_ONLY = 1; + EDITION_2_TEST_ONLY = 2; + EDITION_99997_TEST_ONLY = 99997; + EDITION_99998_TEST_ONLY = 99998; + EDITION_99999_TEST_ONLY = 99999; + + // Placeholder for specifying unbounded edition support. This should only + // ever be used by plugins that can expect to never require any changes to + // support a new edition. + EDITION_MAX = 0x7FFFFFFF; +} + +// 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". + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional string syntax = 12; + + // The edition of the proto file. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional Edition edition = 14; +} + +// 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; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + + reserved 4; // removed is_repeated + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO: flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 + [default = UNVERIFIED, retention = RETENTION_SOURCE]; + + // 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 after google.protobuf. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. + 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_REPEATED = 3; + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + LABEL_REQUIRED = 2; + } + + 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 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]; + + // A proto2 file can set this to true to opt in to UTF-8 checking for Java, + // which will throw an exception if invalid UTF-8 is parsed from the wire or + // assigned to a string field. + // + // TODO: clarify exactly what kinds of field types this option + // applies to, and update these docs accordingly. + // + // Proto3 files already perform these checks. Setting the option explicitly to + // false has no effect: it cannot be used to opt proto3 files out of UTF-8 + // checks. + 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]; + reserved 42; // removed php_generic_services + reserved "php_generic_services"; + + // 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; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 50; + + // 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; + + // 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. + // + // 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. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 12; + + // 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 { + // NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + // 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 only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release. + // TODO: make ctype actually deprecated. + optional CType ctype = 1 [/*deprecated = true,*/ default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + 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. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. + 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 lazy message fields are still eagerly verified to check + // ill-formed wireformat or missing required fields. Calling IsInitialized() + // on the outer message would fail if the inner message has missing required + // fields. Failed verification would result in parsing failure (except when + // uninitialized messages are acceptable). + 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]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + message EditionDefault { + optional Edition edition = 3; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 21; + + // Information about the support window of a feature. + message FeatureSupport { + // The edition that this feature was first available in. In editions + // earlier than this one, the default assigned to EDITION_LEGACY will be + // used, and proto files will not be able to override it. + optional Edition edition_introduced = 1; + + // The edition this feature becomes deprecated in. Using this after this + // edition may trigger warnings. + optional Edition edition_deprecated = 2; + + // The deprecation warning text if this feature is used after the edition it + // was marked deprecated in. + optional string deprecation_warning = 3; + + // The edition this feature is no longer available in. In editions after + // this one, the last default assigned will be used, and proto files will + // not be able to override it. + optional Edition edition_removed = 4; + } + optional FeatureSupport feature_support = 22; + + // 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 + reserved 18; // reserve target, target_obsolete_do_not_use +} + +message OneofOptions { + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 1; + + // 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 + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 7; + + // 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]; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 2; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // Information about the support window of a feature value. + optional FieldOptions.FeatureSupport feature_support = 4; + + // 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 { + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 34; + + // 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]; + + // Any features defined in the specific edition. + // WARNING: This field should only be used by protobuf plugins or special + // cases like the proto compiler. Other uses are discouraged and + // developers should rely on the protoreflect APIs for their client language. + optional FeatureSet features = 35; + + // 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; +} + +// =================================================================== +// Features + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "CLOSED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } + ]; + + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0; + VERIFY = 2; + NONE = 3; + reserved 1; + } + optional Utf8Validation utf8_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "NONE" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } + ]; + + reserved 999; + + extensions 1000 to 9994 [ + declaration = { + number: 1000, + full_name: ".pb.cpp", + type: ".pb.CppFeatures" + }, + declaration = { + number: 1001, + full_name: ".pb.java", + type: ".pb.JavaFeatures" + }, + declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" }, + declaration = { + number: 9990, + full_name: ".pb.proto1", + type: ".pb.Proto1Features" + } + ]; + + extensions 9995 to 9999; // For internal testing + extensions 10000; // for https://github.com/bufbuild/protobuf-es +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +message FeatureSetDefaults { + // A map from every known edition with a unique set of defaults to its + // defaults. Not all editions may be contained here. For a given edition, + // the defaults at the closest matching edition ordered at or before it should + // be used. This field must be in strict ascending order by edition. + message FeatureSetEditionDefault { + optional Edition edition = 3; + + // Defaults of features that can be overridden in this edition. + optional FeatureSet overridable_features = 4; + + // Defaults of features that can't be overridden in this edition. + optional FeatureSet fixed_features = 5; + + reserved 1, 2; + reserved "features"; + } + repeated FeatureSetEditionDefault defaults = 1; + + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + optional Edition minimum_edition = 4; + + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + optional Edition maximum_edition = 5; +} + +// =================================================================== +// 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 appears. + // 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; + } + + // Extensions for tooling. + extensions 536000000 [declaration = { + number: 536000000 + type: ".buf.descriptor.v1.SourceCodeInfoExtension" + full_name: ".buf.descriptor.v1.buf_source_code_info_extension" + }]; +} + +// 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/protos/interchainjs/google/protobuf/duration.proto b/protos/interchainjs/google/protobuf/duration.proto new file mode 100644 index 00000000..41f40c22 --- /dev/null +++ b/protos/interchainjs/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/protos/interchainjs/google/protobuf/timestamp.proto b/protos/interchainjs/google/protobuf/timestamp.proto new file mode 100644 index 00000000..fd0bc07d --- /dev/null +++ b/protos/interchainjs/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/protos/interchainjs/ibc/applications/transfer/v1/transfer.proto b/protos/interchainjs/ibc/applications/transfer/v1/transfer.proto new file mode 100644 index 00000000..8ae82cb6 --- /dev/null +++ b/protos/interchainjs/ibc/applications/transfer/v1/transfer.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"; + +// Params defines the set of IBC transfer parameters. +// NOTE: To prevent a single token from being transferred, set the +// TransfersEnabled parameter to true and then set the bank module's SendEnabled +// parameter for the denomination to false. +message Params { + // send_enabled enables or disables all cross-chain token transfers from this + // chain. + bool send_enabled = 1; + // receive_enabled enables or disables all cross-chain token transfers to this + // chain. + bool receive_enabled = 2; +} + +// Forwarding defines a list of port ID, channel ID pairs determining the path +// through which a packet must be forwarded, and an unwind boolean indicating if +// the coin should be unwinded to its native chain before forwarding. +message Forwarding { + // optional unwinding for the token transfered + bool unwind = 1; + // optional intermediate path through which packet will be forwarded + repeated Hop hops = 2 [(gogoproto.nullable) = false]; +} + +// Hop defines a port ID, channel ID pair specifying where tokens must be forwarded +// next in a multihop transfer. +message Hop { + option (gogoproto.goproto_stringer) = false; + string port_id = 1; + string channel_id = 2; +} diff --git a/protos/interchainjs/ibc/applications/transfer/v1/tx.proto b/protos/interchainjs/ibc/applications/transfer/v1/tx.proto new file mode 100644 index 00000000..69689688 --- /dev/null +++ b/protos/interchainjs/ibc/applications/transfer/v1/tx.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/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 (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; + // the channel by which the packet will be sent + string source_channel = 2; + // the token to be transferred. this field has been replaced by the tokens field. + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, deprecated = 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.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; + // optional memo + string memo = 8; + // tokens to be transferred + repeated cosmos.base.v1beta1.Coin tokens = 9 [(gogoproto.nullable) = false]; + // optional forwarding information + Forwarding forwarding = 10; +} + +// 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 {} diff --git a/protos/interchainjs/ibc/core/channel/v1/channel.proto b/protos/interchainjs/ibc/core/channel/v1/channel.proto new file mode 100644 index 00000000..78df62bd --- /dev/null +++ b/protos/interchainjs/ibc/core/channel/v1/channel.proto @@ -0,0 +1,187 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// Channel defines pipeline for exactly-once packet delivery between specific +// modules on separate blockchains, which has at least one end capable of +// sending packets and one end capable of receiving packets. +message Channel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + 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; + // 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 +// identifier fields. +message IdentifiedChannel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + 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; + // 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, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A channel has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A channel has acknowledged the handshake step on the counterparty chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A channel has completed the handshake. Open channels are + // ready to send and receive packets. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; + // 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 +enum Order { + option (gogoproto.goproto_enum_prefix) = false; + + // zero-value for channel ordering + ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; + // packets can be delivered in any order, which may differ from the order in + // which they were sent. + ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; + // packets are delivered exactly in the order which they were sent + ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; +} + +// Counterparty defines a channel end counterparty +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // port on the counterparty chain which owns the other end of the channel. + string port_id = 1; + // channel end on the counterparty chain + string channel_id = 2; +} + +// Packet defines a type that carries data across different chains through IBC +message Packet { + option (gogoproto.goproto_getters) = false; + + // number corresponds to the order of sends and receives, where a Packet + // with an earlier sequence number must be sent and received before a Packet + // with a later sequence number. + uint64 sequence = 1; + // identifies the port on the sending chain. + string source_port = 2; + // identifies the channel end on the sending chain. + string source_channel = 3; + // identifies the port on the receiving chain. + string destination_port = 4; + // identifies the channel end on the receiving chain. + 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.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet times out + uint64 timeout_timestamp = 8; +} + +// PacketState defines the generic type necessary to retrieve and store +// packet commitments, acknowledgements, and receipts. +// Caller is responsible for knowing the context necessary to interpret this +// state as a commitment, acknowledgement, or a receipt. +message PacketState { + option (gogoproto.goproto_getters) = false; + + // channel port identifier. + string port_id = 1; + // channel unique identifier. + string channel_id = 2; + // packet sequence. + uint64 sequence = 3; + // embedded data that represents packet state. + bytes data = 4; +} + +// PacketId is an identifier for a unique Packet +// Source chains refer to packets by source port/channel +// Destination chains refer to packets by destination port/channel +message PacketId { + option (gogoproto.goproto_getters) = false; + + // channel port identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// Acknowledgement is the recommended acknowledgement format to be used by +// app-specific protocols. +// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +// conflicts with other protobuf message formats used for acknowledgements. +// The first byte of any message with this format will be the non-ASCII values +// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope +message Acknowledgement { + // response contains either a result or an error and must be non-empty + oneof response { + bytes result = 21; + 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/protos/interchainjs/ibc/core/channel/v1/tx.proto b/protos/interchainjs/ibc/core/channel/v1/tx.proto new file mode 100644 index 00000000..06e85232 --- /dev/null +++ b/protos/interchainjs/ibc/core/channel/v1/tx.proto @@ -0,0 +1,469 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/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); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for + // MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // 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 +enum ResponseResultType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default zero value enumeration + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + 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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + Channel channel = 2 [(gogoproto.nullable) = false]; + string signer = 3; +} + +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse { + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; + string version = 2; +} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// on Chain B. The version field within the Channel field has been deprecated. Its +// value will be ignored by core IBC. +message MsgChannelOpenTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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]; + // 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; + 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 { + 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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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. +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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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 +// type. +message MsgChannelOpenConfirmResponse {} + +// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +// to close a channel with Chain B. +message MsgChannelCloseInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + string signer = 3; +} + +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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 +// type. +message MsgChannelCloseConfirmResponse {} + +// MsgRecvPacket receives incoming IBC packet +message MsgRecvPacket { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + 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. +message MsgRecvPacketResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgTimeout receives timed-out packet +message MsgTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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. +message MsgTimeoutResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +message MsgTimeoutOnClose { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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. +message MsgTimeoutOnCloseResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgAcknowledgement receives incoming IBC acknowledgement +message MsgAcknowledgement { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes acknowledgement = 2; + 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. +message MsgAcknowledgementResponse { + option (gogoproto.goproto_getters) = false; + + 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; +} + +// MsgChannelUpgradeTimeoutResponse 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/protos/interchainjs/ibc/core/channel/v1/upgrade.proto b/protos/interchainjs/ibc/core/channel/v1/upgrade.proto new file mode 100644 index 00000000..ea5ae929 --- /dev/null +++ b/protos/interchainjs/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/v9/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/protos/interchainjs/ibc/core/client/v1/client.proto b/protos/interchainjs/ibc/core/client/v1/client.proto new file mode 100644 index 00000000..d2ff2a28 --- /dev/null +++ b/protos/interchainjs/ibc/core/client/v1/client.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"; + +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; + // client state + google.protobuf.Any client_state = 2; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // 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; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// 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 +// +// Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. +// This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height. +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.jsontag) = "revision_number"]; + // the height within the given revision + uint64 revision_height = 2 [(gogoproto.jsontag) = "revision_height"]; +} + +// 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; +} diff --git a/protos/interchainjs/ibc/core/client/v1/tx.proto b/protos/interchainjs/ibc/core/client/v1/tx.proto new file mode 100644 index 00000000..1e9e4f47 --- /dev/null +++ b/protos/interchainjs/ibc/core/client/v1/tx.proto @@ -0,0 +1,179 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/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); + + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); + + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); + + // 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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // light 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; + // signer address + string signer = 3; +} + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse { + option (gogoproto.goproto_getters) = false; + + string client_id = 1; +} + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given client message. +message MsgUpdateClient { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // client message to update the light client + google.protobuf.Any client_message = 2; + // signer address + string signer = 3; +} + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse {} + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +// state +message MsgUpgradeClient { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // upgraded 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; + // proof that old chain committed to new client + bytes proof_upgrade_client = 4; + // proof that old chain committed to new consensus state + bytes proof_upgrade_consensus_state = 5; + // signer address + string signer = 6; +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +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 deprecated = true; + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1; + // misbehaviour used for freezing the light client + google.protobuf.Any misbehaviour = 2; + // signer address + string signer = 3; +} + +// 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/protos/interchainjs/ibc/core/commitment/v1/commitment.proto b/protos/interchainjs/ibc/core/commitment/v1/commitment.proto new file mode 100644 index 00000000..d3431f71 --- /dev/null +++ b/protos/interchainjs/ibc/core/commitment/v1/commitment.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package ibc.core.commitment.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types"; + +import "gogoproto/gogo.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. +message MerkleRoot { + option (gogoproto.goproto_getters) = false; + + bytes hash = 1; +} + +// MerklePrefix is merkle path prefixed to the key. +// The constructed key from the Path and the key will be append(Path.KeyPath, +// append(Path.KeyPrefix, key...)) +message MerklePrefix { + bytes key_prefix = 1; +} + +// MerkleProof is a wrapper type over a chain of CommitmentProofs. +// It demonstrates membership or non-membership for an element or set of +// elements, verifiable in conjunction with a known commitment root. Proofs +// should be succinct. +// MerkleProofs are ordered from leaf-to-root +message MerkleProof { + repeated cosmos.ics23.v1.CommitmentProof proofs = 1; +} diff --git a/protos/interchainjs/ibc/core/connection/v1/connection.proto b/protos/interchainjs/ibc/core/connection/v1/connection.proto new file mode 100644 index 00000000..c5aa79da --- /dev/null +++ b/protos/interchainjs/ibc/core/connection/v1/connection.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/commitment/v1/commitment.proto"; + +// ICS03 - Connection Data Structures as defined in +// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures + +// ConnectionEnd defines a stateful object on a chain connected to another +// separate one. +// NOTE: there must only be 2 defined ConnectionEnds to establish +// a connection between two chains. +message ConnectionEnd { + option (gogoproto.goproto_getters) = false; + // client associated with this connection. + 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; + // current state of the connection end. + State state = 3; + // counterparty chain associated with this connection. + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + // 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; +} + +// IdentifiedConnection defines a connection with additional connection +// identifier field. +message IdentifiedConnection { + option (gogoproto.goproto_getters) = false; + // connection identifier. + string id = 1; + // client associated with this connection. + 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; + // current state of the connection end. + State state = 4; + // counterparty chain associated with this connection. + Counterparty counterparty = 5 [(gogoproto.nullable) = false]; + // delay period associated with this connection. + uint64 delay_period = 6; +} + +// State defines if a connection is in one of the following states: +// INIT, TRYOPEN, OPEN or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A connection end has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A connection end has acknowledged the handshake step on the counterparty + // chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A connection end has completed the handshake. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; +} + +// Counterparty defines the counterparty chain associated with a connection end. +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // identifies the client on the counterparty chain associated with a given + // connection. + string client_id = 1; + // identifies the connection end on the counterparty chain associated with a + // given connection. + string connection_id = 2; + // commitment merkle prefix of the counterparty chain. + ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; +} + +// ClientPaths define all the connection paths for a client state. +message ClientPaths { + // list of connection paths + repeated string paths = 1; +} + +// ConnectionPaths define all the connection paths for a given client state. +message ConnectionPaths { + // client state unique identifier + string client_id = 1; + // list of connection paths + repeated string paths = 2; +} + +// Version defines the versioning scheme used to negotiate the IBC version in +// the connection handshake. +message Version { + option (gogoproto.goproto_getters) = false; + + // unique version identifier + string identifier = 1; + // list of features compatible with the specified identifier + repeated string features = 2; +} + +// Params defines the set of Connection parameters. +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; +} diff --git a/protos/interchainjs/ibc/core/connection/v1/tx.proto b/protos/interchainjs/ibc/core/connection/v1/tx.proto new file mode 100644 index 00000000..894a8bcd --- /dev/null +++ b/protos/interchainjs/ibc/core/connection/v1/tx.proto @@ -0,0 +1,150 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v9/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); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // 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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string client_id = 1; + Counterparty counterparty = 2 [(gogoproto.nullable) = false]; + Version version = 3; + uint64 delay_period = 4; + string signer = 5; +} + +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +// type. +message MsgConnectionOpenInitResponse {} + +// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +// connection on Chain B. +message MsgConnectionOpenTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + 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]; + // Deprecated: this field is unused. + google.protobuf.Any client_state = 3 [deprecated = true]; + 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: `UNINITIALIZED -> + // INIT` + bytes proof_init = 8; + // Deprecated: this field is unused. + bytes proof_client = 9 [deprecated = true]; + // Deprecated: this field is unused. + bytes proof_consensus = 10 [deprecated = true]; + // Deprecated: this field is unused. + ibc.core.client.v1.Height consensus_height = 11 [deprecated = true, (gogoproto.nullable) = false]; + string signer = 12; + // Deprecated: this field is unused. + bytes host_consensus_state_proof = 13 [deprecated = true]; +} + +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + // Deprecated: this field is unused. + google.protobuf.Any client_state = 4 [deprecated = true]; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain B: `UNINITIALIZED -> + // TRYOPEN` + bytes proof_try = 6; + // Deprecated: this field is unused. + bytes proof_client = 7 [deprecated = true]; + // Deprecated: this field is unused. + bytes proof_consensus = 8 [deprecated = true]; + // Deprecated: this field is unused. + ibc.core.client.v1.Height consensus_height = 9 [deprecated = true, (gogoproto.nullable) = false]; + string signer = 10; + // Deprecated: this field is unused. + bytes host_consensus_state_proof = 11 [deprecated = true]; +} + +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +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 (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string connection_id = 1; + // proof for the change of the connection state on Chain A: `INIT -> OPEN` + 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 {} diff --git a/protos/interchainjs/injective/types/v1beta1/account.proto b/protos/interchainjs/injective/types/v1beta1/account.proto new file mode 100644 index 00000000..f17a2a13 --- /dev/null +++ b/protos/interchainjs/injective/types/v1beta1/account.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package injective.types.v1beta1; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/types"; + +// EthAccount implements the authtypes.AccountI interface and embeds an +// authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. +message EthAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [ + (gogoproto.embed) = true, + (gogoproto.moretags) = "yaml:\"base_account\"" + ]; + bytes code_hash = 2 [ (gogoproto.moretags) = "yaml:\"code_hash\"" ]; +} diff --git a/protos/interchainjs/tendermint/abci/types.proto b/protos/interchainjs/tendermint/abci/types.proto new file mode 100644 index 00000000..78eecceb --- /dev/null +++ b/protos/interchainjs/tendermint/abci/types.proto @@ -0,0 +1,486 @@ +syntax = "proto3"; +package tendermint.abci; + +option go_package = "github.com/cometbft/cometbft/abci/types"; + +// For more information on gogo.proto, see: +// https://github.com/cosmos/gogoproto/blob/master/extensions.md +import "tendermint/crypto/proof.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"; + +// NOTE: When using custom types, mind the warnings. +// 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; + 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 { + string message = 1; +} + +message RequestFlush {} + +message RequestInfo { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; + string abci_version = 4; +} + +message RequestInitChain { + 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 { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +enum CheckTxType { + NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; + RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +} + +message RequestCheckTx { + bytes tx = 1; + CheckTxType type = 2; +} + +message RequestCommit {} + +// lists available snapshots +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 +} + +// loads a snapshot chunk +message RequestLoadSnapshotChunk { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Applies a snapshot chunk +message RequestApplySnapshotChunk { + uint32 index = 1; + bytes chunk = 2; + 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; + 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 +message ResponseException { + string error = 1; +} + +message ResponseEcho { + string message = 1; +} + +message ResponseFlush {} + +message ResponseInfo { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +message ResponseInitChain { + 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 + int64 index = 5; + bytes key = 6; + bytes value = 7; + tendermint.crypto.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message ResponseCheckTx { + 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"]; + string codespace = 8; + + // 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 { + reserved 1, 2; // data was previously returned here + int64 retain_height = 3; +} + +message ResponseListSnapshots { + repeated Snapshot snapshots = 1; +} + +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 + } +} + +message ResponseLoadSnapshotChunk { + bytes chunk = 1; +} + +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 + + 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 + } +} + +message ResponsePrepareProposal { + repeated bytes txs = 1; +} + +message ResponseProcessProposal { + ProposalStatus status = 1; + + enum ProposalStatus { + UNKNOWN = 0; + ACCEPT = 1; + REJECT = 2; + } +} + +message ResponseExtendVote { + bytes vote_extension = 1; +} + +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 +// 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"]; +} + +// EventAttribute is a single key-value pair, associated with an event. +message EventAttribute { + 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; + ExecTxResult result = 4 [(gogoproto.nullable) = false]; +} + +//---------------------------------------- +// Blockchain Types + +message Validator { + bytes address = 1; // The first 20 bytes of SHA256(public key) + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + int64 power = 3; // The voting power +} + +message ValidatorUpdate { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + int64 power = 2; +} + +message VoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + tendermint.types.BlockIDFlag block_id_flag = 3; + + reserved 2; // signed_last_block +} + +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 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]; + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + int64 total_voting_power = 5; +} + +//---------------------------------------- +// 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 +} diff --git a/protos/interchainjs/tendermint/crypto/keys.proto b/protos/interchainjs/tendermint/crypto/keys.proto new file mode 100644 index 00000000..8fa192fa --- /dev/null +++ b/protos/interchainjs/tendermint/crypto/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +// PublicKey defines the keys available for use with Validators +message PublicKey { + option (gogoproto.compare) = true; + option (gogoproto.equal) = true; + + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + } +} diff --git a/protos/interchainjs/tendermint/crypto/proof.proto b/protos/interchainjs/tendermint/crypto/proof.proto new file mode 100644 index 00000000..ae72195e --- /dev/null +++ b/protos/interchainjs/tendermint/crypto/proof.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +message Proof { + int64 total = 1; + int64 index = 2; + bytes leaf_hash = 3; + repeated bytes aunts = 4; +} + +message ValueOp { + // Encoded in ProofOp.Key. + bytes key = 1; + + // To encode in ProofOp.Data + Proof proof = 2; +} + +message DominoOp { + string key = 1; + string input = 2; + string output = 3; +} + +// ProofOp defines an operation used for calculating Merkle root +// The data could be arbitrary format, providing nessecary data +// for example neighbouring node hash +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; +} diff --git a/protos/interchainjs/tendermint/types/block.proto b/protos/interchainjs/tendermint/types/block.proto new file mode 100644 index 00000000..d531c06a --- /dev/null +++ b/protos/interchainjs/tendermint/types/block.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; + +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Commit last_commit = 4; +} diff --git a/protos/interchainjs/tendermint/types/evidence.proto b/protos/interchainjs/tendermint/types/evidence.proto new file mode 100644 index 00000000..06f30ec2 --- /dev/null +++ b/protos/interchainjs/tendermint/types/evidence.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; + +message Evidence { + oneof sum { + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; + } +} + +// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +message DuplicateVoteEvidence { + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +message LightClientAttackEvidence { + tendermint.types.LightBlock conflicting_block = 1; + 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]; +} + +message EvidenceList { + repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; +} diff --git a/protos/interchainjs/tendermint/types/params.proto b/protos/interchainjs/tendermint/types/params.proto new file mode 100644 index 00000000..6a42d5ef --- /dev/null +++ b/protos/interchainjs/tendermint/types/params.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option (gogoproto.equal_all) = true; + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +message ConsensusParams { + BlockParams block = 1; + EvidenceParams evidence = 2; + ValidatorParams validator = 3; + VersionParams version = 4; + ABCIParams abci = 5; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Max block size, in bytes. + // Note: must be greater than 0 + int64 max_bytes = 1; + // Max gas per block. + // Note: must be greater or equal to -1 + int64 max_gas = 2; + + reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 +} + +// EvidenceParams determine how we handle evidence of malfeasance. +message EvidenceParams { + // Max age of evidence, in blocks. + // + // The basic formula for calculating this is: MaxAgeDuration / {average block + // time}. + int64 max_age_num_blocks = 1; + + // Max age of evidence, in time. + // + // 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]; + + // 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. + // Default is 1048576 or 1MB + int64 max_bytes = 3; +} + +// ValidatorParams restrict the public key types validators can use. +// NOTE: uses ABCI pubkey naming, not Amino names. +message ValidatorParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + repeated string pub_key_types = 1; +} + +// VersionParams contains the ABCI application version. +message VersionParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + uint64 app = 1; +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +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/protos/interchainjs/tendermint/types/types.proto b/protos/interchainjs/tendermint/types/types.proto new file mode 100644 index 00000000..a0d545ad --- /dev/null +++ b/protos/interchainjs/tendermint/types/types.proto @@ -0,0 +1,172 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/version/types.proto"; +import "tendermint/types/validator.proto"; + +// SignedMsgType is a type of signed message in the consensus. +enum SignedMsgType { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; + SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +} + +// PartsetHeader +message PartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message Part { + uint32 index = 1; + bytes bytes = 2; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +} + +// BlockID +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +} + +// -------------------------------- + +// Header defines the structure of a block header. +message Header { + // basic block info + tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // prev block info + 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 + + // 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 + bytes proposer_address = 14; // original proposer of the block +} + +// Data contains the set of transactions included in the block +message Data { + // Txs that will be applied by state @ block.Height+1. + // NOTE: not all txs here are valid. We're just agreeing on the order first. + // This means that block.AppHash does not include these txs. + repeated bytes txs = 1; +} + +// 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; + // 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. +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + 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 { + SignedMsgType type = 1; + int64 height = 2; + 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; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + tendermint.types.ValidatorSet validator_set = 2; +} + +message BlockMeta { + BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; +} + +// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +message TxProof { + bytes root_hash = 1; + bytes data = 2; + tendermint.crypto.Proof proof = 3; +} diff --git a/protos/interchainjs/tendermint/types/validator.proto b/protos/interchainjs/tendermint/types/validator.proto new file mode 100644 index 00000000..cd5105fa --- /dev/null +++ b/protos/interchainjs/tendermint/types/validator.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package 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; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + tendermint.crypto.PublicKey pub_key = 1; + int64 voting_power = 2; +} diff --git a/protos/interchainjs/tendermint/version/types.proto b/protos/interchainjs/tendermint/version/types.proto new file mode 100644 index 00000000..3b6ef454 --- /dev/null +++ b/protos/interchainjs/tendermint/version/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package tendermint.version; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/version"; + +import "gogoproto/gogo.proto"; + +// App includes the protocol and software version for the application. +// This information is included in ResponseInfo. The App.Protocol can be +// updated in ResponseEndBlock. +message App { + uint64 protocol = 1; + string software = 2; +} + +// Consensus captures the consensus rules for processing a block in the blockchain, +// including all blockchain data structures and the rules of the application's +// state transition machine. +message Consensus { + option (gogoproto.equal) = true; + + uint64 block = 1; + uint64 app = 2; +} diff --git a/scripts/.injective.protod.config.json b/scripts/.injective.protod.config.json new file mode 100644 index 00000000..f4ee4527 --- /dev/null +++ b/scripts/.injective.protod.config.json @@ -0,0 +1,44 @@ +{ + "repos": [ + { "owner": "cosmos", "repo": "cosmos-sdk", "branch": "release/v0.50.x" }, + { "owner": "cosmos", "repo": "ibc-go" }, + { "owner": "injectivelabs", "repo": "sdk-go" } + ], + "protoDirMapping": { + "gogo/protobuf/master": ".", + "googleapis/googleapis/master": ".", + "protocolbuffers/protobuf/main": "src" + }, + "outDir": "protos/injectivejs", + "ssh": true, + "tempRepoDir": "git-modules", + "targets": [ + "cosmos/auth/v1beta1/auth.proto", + "cosmos/vesting/v1beta1/vesting.proto", + "cosmos/crypto/secp256k1/keys.proto", + "cosmos/crypto/secp256r1/keys.proto", + "cosmos/crypto/ed25519/keys.proto", + "cosmos/authz/v1beta1/tx.proto", + "cosmos/bank/v1beta1/tx.proto", + "cosmos/distribution/v1beta1/tx.proto", + "cosmos/feegrant/v1beta1/tx.proto", + "cosmos/gov/v1beta1/tx.proto", + "cosmos/gov/v1/tx.proto", + "cosmos/group/v1/tx.proto", + "cosmos/staking/v1beta1/tx.proto", + "cosmos/vesting/v1beta1/tx.proto", + "cosmos/auth/v1beta1/query.proto", + "cosmos/bank/v1beta1/query.proto", + "cosmos/staking/v1beta1/query.proto", + "cosmos/gov/v1beta1/query.proto", + "cosmos/tx/v1beta1/service.proto", + "cosmos/tx/v1beta1/tx.proto", + "cosmwasm/wasm/v1/tx.proto", + "cosmwasm/wasm/v1/query.proto", + "ibc/applications/transfer/v1/tx.proto", + "ibc/core/channel/v1/tx.proto", + "ibc/core/client/v1/tx.proto", + "ibc/core/connection/v1/tx.proto", + "injective/**/*.proto" + ] +} \ No newline at end of file diff --git a/scripts/.protod.config.json b/scripts/.protod.config.json index 4e3a4a66..41f3ef2d 100644 --- a/scripts/.protod.config.json +++ b/scripts/.protod.config.json @@ -9,7 +9,7 @@ "googleapis/googleapis/master": ".", "protocolbuffers/protobuf/main": "src" }, - "outDir": "protos", + "outDir": "protos/interchainjs", "ssh": true, "tempRepoDir": "git-modules", "targets": [ diff --git a/scripts/inj-query.telescope.json b/scripts/inj-query.telescope.json new file mode 100644 index 00000000..276cd62f --- /dev/null +++ b/scripts/inj-query.telescope.json @@ -0,0 +1,77 @@ +{ + "protoDirs": [ + "./protos/injectivejs" + ], + "outPath": "./libs/injective-query/src", + "options": { + "classesUseArrowFunctions": true, + "env": "v-next", + "useInterchainJs": true, + "useSDKTypes": false, + "prototypes": { + "enableRegistryLoader": false, + "enableMessageComposer": false, + "enabled": true, + "parser": { + "keepCase": false + }, + "methods": { + "fromJSON": false, + "toJSON": false, + "encode": true, + "decode": true, + "fromPartial": true, + "toAmino": true, + "fromAmino": true, + "fromProto": false, + "toProto": false, + "fromProtoMsg": false, + "toProtoMsg": false, + "toAminoMsg": true, + "fromAminoMsg": true + }, + "addTypeUrlToDecoders": false, + "addTypeUrlToObjects": true, + "addAminoTypeToObjects": true, + "typingsFormat": { + "duration": "duration", + "timestamp": "date", + "useExact": false, + "useDeepPartial": true, + "num64": "bigint", + "customTypes": { + "useCosmosSDKDec": false + }, + "useTelescopeGeneratedType": true, + "autoFixUndefinedEnumDefault": true + } + }, + "bundle": { + "enabled": false + }, + "stargateClients": { + "enabled": false + }, + "lcdClients": { + "enabled": false + }, + "rpcClients": { + "enabled": false + }, + "helperFuncCreators": { + "enabled": true, + "genCustomHooks": true + }, + "interfaces": { + "enabled": true, + "useGlobalDecoderRegistry": true, + "useUnionTypes": true + }, + "aminoEncoding": { + "enabled": true, + "useLegacyInlineEncoding": false, + "disableMsgTypes": false, + "useProtoOptionality": true + } + } +} \ No newline at end of file diff --git a/scripts/inj.telescope.json b/scripts/inj.telescope.json new file mode 100644 index 00000000..9c3e8241 --- /dev/null +++ b/scripts/inj.telescope.json @@ -0,0 +1,77 @@ +{ + "protoDirs": [ + "./protos/injectivejs" + ], + "outPath": "./libs/injectivejs/src", + "options": { + "classesUseArrowFunctions": true, + "env": "v-next", + "useInterchainJs": true, + "useSDKTypes": false, + "prototypes": { + "enableRegistryLoader": false, + "enableMessageComposer": false, + "enabled": true, + "parser": { + "keepCase": false + }, + "methods": { + "fromJSON": false, + "toJSON": false, + "encode": true, + "decode": true, + "fromPartial": true, + "toAmino": true, + "fromAmino": true, + "fromProto": false, + "toProto": false, + "fromProtoMsg": false, + "toProtoMsg": false, + "toAminoMsg": true, + "fromAminoMsg": true + }, + "addTypeUrlToDecoders": false, + "addTypeUrlToObjects": true, + "addAminoTypeToObjects": true, + "typingsFormat": { + "duration": "duration", + "timestamp": "date", + "useExact": false, + "useDeepPartial": true, + "num64": "bigint", + "customTypes": { + "useCosmosSDKDec": false + }, + "useTelescopeGeneratedType": true, + "autoFixUndefinedEnumDefault": true + } + }, + "bundle": { + "enabled": false + }, + "stargateClients": { + "enabled": false + }, + "lcdClients": { + "enabled": false + }, + "rpcClients": { + "enabled": false + }, + "helperFuncCreators": { + "enabled": true, + "genCustomHooks": false + }, + "interfaces": { + "enabled": true, + "useGlobalDecoderRegistry": true, + "useUnionTypes": true + }, + "aminoEncoding": { + "enabled": true, + "useLegacyInlineEncoding": false, + "disableMsgTypes": false, + "useProtoOptionality": true + } + } +} \ No newline at end of file diff --git a/scripts/interchain-query.telescope.json b/scripts/interchain-query.telescope.json index bf5ae593..4d7721c7 100644 --- a/scripts/interchain-query.telescope.json +++ b/scripts/interchain-query.telescope.json @@ -1,6 +1,6 @@ { "protoDirs": [ - "./protos" + "./protos/interchainjs" ], "outPath": "./libs/interchain-query/src", "options": { diff --git a/scripts/interchainjs.telescope.json b/scripts/interchainjs.telescope.json index 4e07bb84..0de2b2bf 100644 --- a/scripts/interchainjs.telescope.json +++ b/scripts/interchainjs.telescope.json @@ -1,6 +1,6 @@ { "protoDirs": [ - "./protos" + "./protos/interchainjs" ], "outPath": "./libs/interchainjs/src", "options": { diff --git a/yarn.lock b/yarn.lock index bf097221..5cb32d83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1694,25 +1694,25 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671" integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w== -"@cosmology/ast@^1.8.10": - version "1.8.10" - resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.8.10.tgz#9db5b6887f62d3ca8547714d0f8cee43e7a59e8e" - integrity sha512-1rJrSbFbmfT/9OqmGBuHcQe1D2tD+i2jGvLq1yOEULaLkllVM6XfRnNwWq68RsI6cUHs0i6k5BtBnPDBqBTxSw== +"@cosmology/ast@^1.8.11": + version "1.8.11" + resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.8.11.tgz#2d9375dd0698eeda43607e4ed9a1af748d376d06" + integrity sha512-z4vEM9e8fzw+WytPod7Vp/OMJ5EJMe3Cl5yfcD1vHYHjdBvg/0FkQT3rRfxxBEb61MdVMLSUvg69cSdG+gCfMw== dependencies: "@babel/types" "7.23.6" - "@cosmology/types" "^1.10.3" - "@cosmology/utils" "^1.8.7" + "@cosmology/types" "^1.10.4" + "@cosmology/utils" "^1.8.8" case "1.6.3" dotty "0.1.2" -"@cosmology/proto-parser@^1.8.7": - version "1.8.7" - resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.8.7.tgz#b79d9969b2445ca27b8c57bd741305868214e730" - integrity sha512-fF6bq+ddV3ITUwZWFAR3GiA04TEh9akY9Jzeo4F92BtaeJ4DdfPoBhLgMVDmvCvDCzlzs2VfO8QANnzCMCqB2w== +"@cosmology/proto-parser@^1.8.8": + version "1.8.8" + resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.8.8.tgz#c6fd4785da7515ea4f17e89077ee1c1f1a05605d" + integrity sha512-UaEubYlhdWY4TjhWaKe94MEo3fUY8H0utHNWoyrFe9TSM8TKx0r0eN7T6J0JpbDaEVNNVosZfUG3BsgzpPnrRw== dependencies: "@cosmology/protobufjs" "7.3.2" - "@cosmology/types" "^1.10.3" - "@cosmology/utils" "^1.8.7" + "@cosmology/types" "^1.10.4" + "@cosmology/utils" "^1.8.8" dotty "0.1.2" fast-json-patch "3.1.1" glob "8.0.3" @@ -1738,19 +1738,19 @@ "@types/node" ">=13.7.0" long "^5.0.0" -"@cosmology/telescope@^1.10.8": - version "1.10.8" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.10.8.tgz#de7f19e7b8ca9de95c90b35d0e473beb3aa62777" - integrity sha512-8tRaG6rV94maxdqr2HYzcEhhzecDawegZJ/U28rShId0F5h0L8tavXHcpJZUD90j98RujizOzwpSAf/JEDNgzw== +"@cosmology/telescope@^1.10.10": + version "1.10.10" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.10.10.tgz#d00642bb09c6914d40a657c0a8eaa833fb35b861" + integrity sha512-wOm71Jr6ivNmvS+KE8uYuafTM8qO8NW+YYDb9X0KMUvHPA+jvdlQkk4A1uyju/9mjlpVodNuU2Q/QXcBYDZW+w== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6" "@babel/traverse" "7.23.6" "@babel/types" "7.23.6" - "@cosmology/ast" "^1.8.10" - "@cosmology/proto-parser" "^1.8.7" - "@cosmology/types" "^1.10.3" - "@cosmology/utils" "^1.8.7" + "@cosmology/ast" "^1.8.11" + "@cosmology/proto-parser" "^1.8.8" + "@cosmology/types" "^1.10.4" + "@cosmology/utils" "^1.8.8" "@cosmwasm/ts-codegen" "0.35.7" "@types/parse-package-name" "0.1.0" case "1.6.3" @@ -1768,20 +1768,20 @@ rimraf "5.0.0" yaml "^2.3.4" -"@cosmology/types@^1.10.3": - version "1.10.3" - resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.10.3.tgz#005ee9246ef618466254d4156074c0cc80f2dfaa" - integrity sha512-3iBnbmMcJQ7xVgudS/BoxU/dPGJxFQibhMjA5LW2dIAaQh54oCcd2pTuG93daRgh7TMKyh/tIMnwfwg2G5dcGw== +"@cosmology/types@^1.10.4": + version "1.10.4" + resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.10.4.tgz#2a8122d15d3a09d1703fa74d5ca31d1736e7ea02" + integrity sha512-Wxlc9oyxjsy5ZWG0xt7Yq/DgIFX2QCf+dGvbIBvklGmiEa9P05gUjUfoJ9y6pqIqTz3evpnJyI0kZgeaquVgxg== dependencies: case "1.6.3" fast-json-patch "3.1.1" -"@cosmology/utils@^1.8.7": - version "1.8.7" - resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.8.7.tgz#f19b08cfe606c46a01176006f754283a5e117f60" - integrity sha512-sb1Zk3YjRsS8lAh8GUYskUQUQj34rlJ4Rbleir+kQ6YtqXxsTPvo0b78ALtQJYhd5k03JPmAH80mCaWkmjrTKA== +"@cosmology/utils@^1.8.8": + version "1.8.8" + resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.8.8.tgz#d039262a83509be962e22ebe30152d68dd188364" + integrity sha512-hvVW3gaClqSDxTLPIY/VAU/23pLVBa1kewgMqJZzXRTIMT8Jvz901BTPSexBBhf2veB075LzmE//NXELMJFq0g== dependencies: - "@cosmology/types" "^1.10.3" + "@cosmology/types" "^1.10.4" dotty "0.1.2" "@cosmostation/extension-client@^0.1.15":